diff --git a/.gitignore b/.gitignore index 784871f509032bdf327546de7ea13d29640ee3b6..55a0b4d5740be083e1b49c7763342beb55c4ce66 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,11 @@ *~ -debian/libvisp-2-6-dbg.debhelper.log -debian/libvisp-2-6-dbg.substvars -debian/libvisp-2-6-dbg/ -debian/libvisp-2-6.debhelper.log -debian/libvisp-2-6.substvars -debian/libvisp-2-6/ -debian/libvisp-dev.debhelper.log -debian/libvisp-dev.substvars +debian/libvisp-*.log +debian/libvisp-*.substvars +debian/libvisp-*-dbg/ debian/files -debian/libvisp-dev/ debian/tmp/ -obj-x86_64-linux-gnu/ \ No newline at end of file +obj-x86_64-linux-gnu/ +*/CMakeFiles +CMakeCache.txt +.DS_Store +CMakeLists.txt.user* diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..2bb9c077c9c99df608ecc31750fa4d6f7804c8dd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,56 @@ +language: cpp + +os: + - linux + - osx + +env: + - VISP_INPUT_IMAGE_PATH=${TRAVIS_BUILD_DIR} + +compiler: + - gcc + - clang + +sudo: required +dist: trusty + +before_install: + - cd ${TRAVIS_BUILD_DIR} && { curl -O http://visp-doc.inria.fr/download/dataset/ViSP-images-3.0.0.zip ; cd -; } + - unzip ${TRAVIS_BUILD_DIR}/ViSP-images-3.0.0.zip -d ${TRAVIS_BUILD_DIR} + # Get libs for OSX + - "if [ $TRAVIS_OS_NAME = 'osx' ]; then brew update; fi" + #- "if [ $TRAVIS_OS_NAME = 'osx' ]; then brew tap homebrew/science; fi" + #- "if [ $TRAVIS_OS_NAME = 'osx' ]; then brew install opencv3; fi" + - "if [ $TRAVIS_OS_NAME = 'osx' ]; then brew install libxml2 libdc1394 gsl; fi" + + # Get libs for Linux + - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get update -qq; fi" + - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq cmake libopencv-dev libx11-dev; fi" + - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq liblapack-dev libgsl0-dev; fi" + - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libdc1394-22-dev libv4l-dev; fi" + - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libcoin80-dev; fi" + - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libxml2-dev; fi" + - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libjpeg-dev libpng12-dev; fi" + - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libswscale-dev libavutil-dev; fi" + - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libavformat-dev; fi" + - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libavcodec-dev libbz2-dev; fi" + - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libogre-1.9-dev libois-dev; fi" + - "if [ $TRAVIS_OS_NAME = 'linux' ]; then sudo apt-get install -qq libzbar-dev libdmtx-dev; fi" + +before_script: + - mkdir build + - cd build + - cmake .. + # Show 3rd parties that are detected + - cat ViSP-third-party.txt + +script: + - make + - ctest + +notifications: + email: + - Fabien.Spindler@inria.fr + on_success: change + on_failure: always + diff --git a/CMakeHeaderFileList.cmake b/CMakeHeaderFileList.cmake deleted file mode 100644 index 68a3429306a823b5770ed299a636199be22e97ca..0000000000000000000000000000000000000000 --- a/CMakeHeaderFileList.cmake +++ /dev/null @@ -1,407 +0,0 @@ -############################################################################# -# -# $Id: CMakeHeaderFileList.cmake 5255 2015-02-03 14:52:43Z strinh $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP header file list. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# Set HEADER_subdir variable to all the files we want to parse during -# the build process. -# Don't forget to update HEADER_ALL variable if you add/remove a -# HEADER_subdir variable -# -# If you add/remove a directory, modify here - -SET (HEADER_CAMERA - camera/vpCameraParameters.h - camera/vpMeterPixelConversion.h - camera/vpPixelMeterConversion.h - camera/vpXmlParserCamera.h - camera/calibration/vpCalibration.h - camera/calibration/vpCalibrationException.h - ) - -SET (HEADER_COMPUTER_VISION - computer-vision/homography-estimation/vpHomography.h - computer-vision/pose-estimation/vpLevenbergMarquartd.h - computer-vision/pose-estimation/vpPoseException.h - computer-vision/pose-estimation/vpPose.h - computer-vision/pose-estimation/vpPoseFeatures.h - ) - -SET (HEADER_DATA_STRUCTURE - data-structure/vpList.h - ) - -set(HEADER_DETECTION - detection/vpDetectorBase.h - detection/barcode/vpDetectorDataMatrixCode.h - detection/barcode/vpDetectorQRCode.h - detection/face/vpDetectorFace.h -) - -SET (HEADER_EXCEPTION - exceptions/vpException.h - ) - -SET (HEADER_DEVICE_FRAMEGRABBER - device/framegrabber/1394/vp1394TwoGrabber.h - device/framegrabber/1394/vp1394CMUGrabber.h - device/framegrabber/disk/vpDiskGrabber.h - device/framegrabber/generic-framegrabber/vpFrameGrabberException.h - device/framegrabber/generic-framegrabber/vpFrameGrabber.h - device/framegrabber/v4l2/vpV4l2Grabber.h - device/framegrabber/directshow/vpDirectShowGrabber.h - device/framegrabber/directshow/vpDirectShowGrabberImpl.h - device/framegrabber/directshow/vpDirectShowDevice.h - device/framegrabber/directshow/vpDirectShowSampleGrabberI.h - device/framegrabber/OpenCV/vpOpenCVGrabber.h - ) - -SET (HEADER_IMAGE - image/vpColor.h - image/vpImageConvert.h - image/vpImageException.h - image/vpImageFilter.h - image/vpImage.h - image/vpImageIo.h - image/vpImageMorphology.h - image/vpImageTools.h - image/vpRGBa.h - image/vpImagePoint.h - ) - -SET (HEADER_KEY_POINT - key-point/vpBasicKeyPoint.h - key-point/vpKeyPointSurf.h - key-point/vpPlanarObjectDetector.h - key-point/vpFernClassifier.h - key-point/vpKeyPoint.h - key-point/vpXmlConfigParserKeyPoint.h - ) - -SET (HEADER_DEVICE_KINECT - device/kinect/vpKinect.h - ) - -SET (HEADER_DEVICE_LASERSCANNER - device/laserscanner/vpScanPoint.h - device/laserscanner/vpLaserScan.h - device/laserscanner/vpLaserScanner.h - device/laserscanner/sick/vpSickLDMRS.h - ) - -SET (HEADER_DEVICE_LIGHT - device/light/vpRingLight.h - ) - -SET (HEADER_MATH - math/kalman/vpKalmanFilter.h - math/kalman/vpLinearKalmanFilterInstantiation.h - math/matrix/vpColVector.h - math/matrix/vpMatrixException.h - math/matrix/vpMatrix.h - math/matrix/vpRowVector.h - math/matrix/vpSubMatrix.h - math/matrix/vpSubColVector.h - math/matrix/vpSubRowVector.h - math/matrix/vpGEMM.h - math/misc/vpMath.h - math/misc/vpHinkley.h - math/misc/vpNoise.h - math/robust/vpRansac.h - math/robust/vpRobust.h - math/robust/vpScale.h - math/spline/vpBSpline.h - math/spline/vpNurbs.h - math/transformation/vpExponentialMap.h - math/transformation/vpForceTwistMatrix.h - math/transformation/vpHomogeneousMatrix.h - math/transformation/vpPoseVector.h - math/transformation/vpQuaternionVector.h - math/transformation/vpRotationMatrix.h - math/transformation/vpRotationVector.h - math/transformation/vpRxyzVector.h - math/transformation/vpRzyxVector.h - math/transformation/vpRzyzVector.h - math/transformation/vpXmlParserHomogeneousMatrix.h - math/transformation/vpThetaUVector.h - math/transformation/vpTranslationVector.h - math/transformation/vpVelocityTwistMatrix.h - ) - -SET (HEADER_ROBOT - robot/robot/vpRobotException.h - robot/robot/vpRobot.h - robot/robot/vpRobotTemplate.h - robot/real-robot/afma4/vpAfma4.h - robot/real-robot/afma4/vpRobotAfma4.h - robot/real-robot/afma4/vpServolens.h - robot/real-robot/afma6/vpAfma6.h - robot/real-robot/afma6/vpRobotAfma6.h - robot/real-robot/biclops/vpBiclops.h - robot/real-robot/biclops/vpRobotBiclopsController.h - robot/real-robot/biclops/vpRobotBiclops.h - robot/real-robot/pioneer/vpUnicycle.h - robot/real-robot/pioneer/vpPioneer.h - robot/real-robot/pioneer/vpPioneerPan.h - robot/real-robot/pioneer/vpRobotPioneer.h - robot/real-robot/ptu46/vpPtu46.h - robot/real-robot/ptu46/vpRobotPtu46.h - robot/real-robot/viper/vpViper.h - robot/real-robot/viper/vpViper650.h - robot/real-robot/viper/vpViper850.h - robot/real-robot/viper/vpRobotViper650.h - robot/real-robot/viper/vpRobotViper850.h - robot/simulator-robot/vpRobotCamera.h - robot/simulator-robot/vpRobotSimulator.h - robot/simulator-robot/vpRobotWireFrameSimulator.h - robot/simulator-robot/vpSimulatorAfma6.h - robot/simulator-robot/vpSimulatorCamera.h - robot/simulator-robot/vpSimulatorPioneer.h - robot/simulator-robot/vpSimulatorPioneerPan.h - robot/simulator-robot/vpSimulatorViper850.h - ) - -SET (HEADER_SERVO - servo/vpAdaptiveGain.h - servo/vpServoData.h - servo/vpServoDisplay.h - servo/vpServoException.h - servo/vpServo.h - ) - -SET (HEADER_SIMULATOR - simulator/coin-simulator/vpAR.h - simulator/coin-simulator/vpProjectionDisplay.h - simulator/coin-simulator/vpSimulatorException.h - simulator/coin-simulator/vpSimulator.h - simulator/coin-simulator/vpViewer.h - simulator/ogre-simulator/vpAROgre.h - simulator/image-simulator/vpImageSimulator.h - simulator/wireframe-simulator/vpWireFrameSimulator.h - simulator/wireframe-simulator/core/vpArit.h - simulator/wireframe-simulator/core/vpBound.h - simulator/wireframe-simulator/core/vpCgiconstants.h - simulator/wireframe-simulator/core/vpImstack.h - simulator/wireframe-simulator/core/vpKeyword.h - simulator/wireframe-simulator/core/vpLex.h - simulator/wireframe-simulator/core/vpMy.h - simulator/wireframe-simulator/core/vpRfstack.h - simulator/wireframe-simulator/core/vpSkipio.h - simulator/wireframe-simulator/core/vpTmstack.h - simulator/wireframe-simulator/core/vpToken.h - simulator/wireframe-simulator/core/vpView.h - simulator/wireframe-simulator/core/vpVwstack.h - ) - -SET (HEADER_TOOLS - tools/convert/vpConvert.h - tools/geometry/vpPlane.h - tools/geometry/vpRect.h - tools/geometry/vpTriangle.h - tools/geometry/vpPolygon.h - tools/histogram/vpHistogram.h - tools/histogram/vpHistogramPeak.h - tools/histogram/vpHistogramValey.h - tools/io/vpIoException.h - tools/io/vpIoTools.h - tools/io/vpKeyboard.h - tools/io/vpParallelPort.h - tools/io/vpParallelPortException.h - tools/io/vpParseArgv.h - tools/mutex/vpMutex.h - tools/plot/vpPlot.h - tools/plot/vpPlotCurve.h - tools/plot/vpPlotGraph.h - tools/time/vpTime.h - tools/trace/vpDebug.h - tools/xml/vpXmlParser.h - ) - -SET (HEADER_TRACKING - tracking/dots/vpDot2.h - tracking/dots/vpDot.h - tracking/feature-builder/vpFeatureBuilder.h - tracking/forward-projection/vpCircle.h - tracking/forward-projection/vpCylinder.h - tracking/forward-projection/vpForwardProjection.h - tracking/forward-projection/vpLine.h - tracking/forward-projection/vpPoint.h - tracking/forward-projection/vpSphere.h - tracking/general-tracking-issues/vpTracker.h - tracking/general-tracking-issues/vpTrackingException.h - tracking/klt/vpKltOpencv.h - tracking/moving-edges/vpMeEllipse.h - tracking/moving-edges/vpMe.h - tracking/moving-edges/vpMeLine.h - tracking/moving-edges/vpMeSite.h - tracking/moving-edges/vpMeTracker.h - tracking/moving-edges/vpMeNurbs.h - - tracking/mbt/vpMbTracker.h - tracking/mbt/vpMbHiddenFaces.h - tracking/mbt/vpMbXmlParser.h - tracking/mbt/vpMbtPolygon.h - tracking/mbt/edge/vpMbtDistanceCircle.h - tracking/mbt/edge/vpMbtDistanceCylinder.h - tracking/mbt/edge/vpMbtDistanceLine.h - tracking/mbt/edge/vpMbtMeEllipse.h - tracking/mbt/edge/vpMbtMeLine.h - tracking/mbt/edge/vpMbEdgeTracker.h - tracking/mbt/edge/vpMbtXmlParser.h - tracking/mbt/hybrid/vpMbEdgeKltTracker.h - tracking/mbt/hybrid/vpMbtEdgeKltXmlParser.h - tracking/mbt/klt/vpMbtDistanceKltPoints.h - tracking/mbt/klt/vpMbKltTracker.h - tracking/mbt/klt/vpMbtKltXmlParser.h - - tracking/moments/vpMomentAlpha.h - tracking/moments/vpMomentBasic.h - tracking/moments/vpMomentCentered.h - tracking/moments/vpMomentCInvariant.h - tracking/moments/vpMomentCommon.h - tracking/moments/vpMoment.h - tracking/moments/vpMomentDatabase.h - tracking/moments/vpMomentGravityCenter.h - tracking/moments/vpMomentGravityCenterNormalized.h - tracking/moments/vpMomentObject.h - tracking/moments/vpMomentAreaNormalized.h - tracking/moments/vpMomentArea.h - - tracking/template-tracker/vpTemplateTracker.h - tracking/template-tracker/ssd/vpTemplateTrackerSSD.h - tracking/template-tracker/ssd/vpTemplateTrackerSSDESM.h - tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardAdditional.h - tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardCompositional.h - tracking/template-tracker/ssd/vpTemplateTrackerSSDInverseCompositional.h - tracking/template-tracker/zncc/vpTemplateTrackerZNCC.h - tracking/template-tracker/zncc/vpTemplateTrackerZNCCForwardAdditional.h - tracking/template-tracker/zncc/vpTemplateTrackerZNCCInverseCompositional.h - tracking/template-tracker/tools/vpTemplateTrackerBSpline.h - tracking/template-tracker/tools/vpTemplateTrackerHeader.h - tracking/template-tracker/tools/vpTemplateTrackerZone.h - tracking/template-tracker/tools/vpTemplateTrackerTriangle.h - tracking/template-tracker/warp/vpTemplateTrackerWarp.h - tracking/template-tracker/warp/vpTemplateTrackerWarpAffine.h - tracking/template-tracker/warp/vpTemplateTrackerWarpHomography.h - tracking/template-tracker/warp/vpTemplateTrackerWarpHomographySL3.h - tracking/template-tracker/warp/vpTemplateTrackerWarpSRT.h - tracking/template-tracker/warp/vpTemplateTrackerWarpTranslation.h - ) - -SET (HEADER_VIDEO - video/vpVideoReader.h - video/vpVideoWriter.h - video/vpFFMPEG.h - ) - -SET (HEADER_DEVICE_DISPLAY - device/display/vpDisplayException.h - device/display/vpDisplayGTK.h - device/display/vpDisplayOpenCV.h - device/display/vpDisplay.h - device/display/vpDisplayX.h - device/display/vpMouseButton.h - device/display/windows/vpDisplayGDI.h - device/display/windows/vpDisplayWin32.h - device/display/windows/vpGDIRenderer.h - device/display/windows/vpWin32Renderer.h - device/display/windows/vpWin32Window.h - device/display/windows/vpD3DRenderer.h - device/display/windows/vpDisplayD3D.h - device/display/windows/vpWin32API.h - ) - -SET (HEADER_VISUAL_FEATURE - visual-feature/vpBasicFeature.h - visual-feature/vpFeatureDepth.h - visual-feature/vpFeatureDisplay.h - visual-feature/vpFeatureEllipse.h - visual-feature/vpFeatureException.h - visual-feature/vpFeatureLine.h - visual-feature/vpFeatureLuminance.h - visual-feature/vpFeatureMoment.h - visual-feature/vpFeatureMomentAlpha.h - visual-feature/vpFeatureMomentArea.h - visual-feature/vpFeatureMomentAreaNormalized.h - visual-feature/vpFeatureMomentBasic.h - visual-feature/vpFeatureMomentCentered.h - visual-feature/vpFeatureMomentCInvariant.h - visual-feature/vpFeatureMomentCommon.h - visual-feature/vpFeatureMomentDatabase.h - visual-feature/vpFeatureMomentGravityCenter.h - visual-feature/vpFeatureMomentGravityCenterNormalized.h - visual-feature/vpFeaturePoint3D.h - visual-feature/vpFeaturePoint.h - visual-feature/vpFeaturePointPolar.h - visual-feature/vpFeatureThetaU.h - visual-feature/vpFeatureTranslation.h - visual-feature/vpFeatureVanishingPoint.h - visual-feature/vpFeatureSegment.h - visual-feature/vpGenericFeature.h - ) - -SET (HEADER_NETWORK - network/vpNetwork.h - network/vpServer.h - network/vpClient.h - network/vpRequest.h - ) - -SET (HEADER_ALL - ${HEADER_CAMERA} - ${HEADER_COMPUTER_VISION} - ${HEADER_DATA_STRUCTURE} - ${HEADER_DETECTION} - ${HEADER_DEVICE_DISPLAY} - ${HEADER_DEVICE_FRAMEGRABBER} - ${HEADER_DEVICE_KINECT} - ${HEADER_DEVICE_LASERSCANNER} - ${HEADER_DEVICE_LIGHT} - ${HEADER_EXCEPTION} - ${HEADER_IMAGE} - ${HEADER_KEY_POINT} - ${HEADER_MATH} - ${HEADER_ROBOT} - ${HEADER_SIMULATOR} - ${HEADER_SERVO} - ${HEADER_TOOLS} - ${HEADER_TRACKING} - ${HEADER_VIDEO} - ${HEADER_VISUAL_FEATURE} - ${HEADER_NETWORK} - ) diff --git a/CMakeLists.txt b/CMakeLists.txt index d10e231c1316113f4ef4f24bcdd847c4cf2313de..c53d54a2bf20c76854d275192cae30a5022a2118 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,2359 +1,722 @@ -############################################################################# -# -# $Id: CMakeLists.txt 5287 2015-02-09 15:29:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP overall configuration file. Detect third party libraries (X11, GTK, ...) -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# Need to be befor project(VISP) to work -if(WIN32) - set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory") -endif() - -project(VISP C CXX) - -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) - -#----------------------------------------------------------------------------- -# VISP version number. An even minor number corresponds to releases. -SET(VISP_VERSION_MAJOR "2") -SET(VISP_VERSION_MINOR "10") -SET(VISP_VERSION_PATCH "0") -SET(VISP_VERSION "${VISP_VERSION_MAJOR}.${VISP_VERSION_MINOR}.${VISP_VERSION_PATCH}") -# Package revision number -SET(VISP_REVISION "1") - -# where are user-specific cmake modules -set(VISP_CMAKE_MODULE_PATH ${VISP_SOURCE_DIR}/CMakeModules) - -find_file(GNU_INSTALL_DIRS_FROM_CMAKE NAMES GNUInstallDirs.cmake PATHS ${CMAKE_ROOT}/Modules) -mark_as_advanced(GNU_INSTALL_DIRS_FROM_CMAKE) -if(GNU_INSTALL_DIRS_FROM_CMAKE) - include(${CMAKE_ROOT}/Modules/GNUInstallDirs.cmake) -else() - include(${VISP_CMAKE_MODULE_PATH}/GNUInstallDirs.cmake) -endif() - -list(APPEND CMAKE_MODULE_PATH ${VISP_CMAKE_MODULE_PATH}) - -# the include directory we depend on -SET(VISP_INTERN_INCLUDE_DIR ${VISP_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}) -SET(VISP_INCLUDE_DIR "${VISP_INTERN_INCLUDE_DIR}/visp") -SET(VISP_DOC_DIR "${VISP_BINARY_DIR}/doc") - -# The location in which to install VISP libraries. -SET(LIBRARY_OUTPUT_PATH ${VISP_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) -# The location in which to install some VISP binaries. -SET(BINARY_OUTPUT_PATH ${VISP_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) - -# the third party include directories we depend on -SET(VISP_EXTERN_INCLUDE_DIRS "") -# the internal visp libs we depend on -SET(VISP_INTERN_LIBRARY visp) -# the third party libraries we depend on -SET(VISP_EXTERN_LIBRARIES "") -# the compiler definitions -SET(VISP_DEFS "") - -if(WIN32) - # Postfix of .lib and .dll - set(VISP_DEBUG_POSTFIX "d") - set(VISP_DLLVERSION "${VISP_VERSION_MAJOR}${VISP_VERSION_MINOR}${VISP_VERSION_PATCH}") -else() - set(VISP_DEBUG_POSTFIX "") - set(VISP_DLLVERSION "") -endif() - -# Get the OS -SET(OS ${CMAKE_SYSTEM_NAME}) - -SET(OGRE_HOME $ENV{OGRE_HOME}) -if(OGRE_HOME) - # replace \ with / especially for windows - STRING(REGEX REPLACE "\\\\" "/" OGRE_HOME ${OGRE_HOME}) -endif() - -# add the path to detect Ogre3D -if(WIN32) - list(APPEND CMAKE_MODULE_PATH "${OGRE_HOME}/CMake") -endif(WIN32) - -if(UNIX) - list(APPEND CMAKE_MODULE_PATH "${OGRE_HOME}/cmake") - list(APPEND CMAKE_MODULE_PATH "${OGRE_HOME}/CMake") - list(APPEND CMAKE_MODULE_PATH "/usr/local/lib/OGRE/cmake") - list(APPEND CMAKE_MODULE_PATH "/usr/lib/OGRE/cmake") - list(APPEND CMAKE_MODULE_PATH "/usr/local/lib64/OGRE/cmake") - list(APPEND CMAKE_MODULE_PATH "/usr/lib64/OGRE/cmake") - list(APPEND CMAKE_MODULE_PATH "/usr/share/OGRE/cmake/modules") -endif(UNIX) - -# Create include directory which will contain all the headers -MAKE_DIRECTORY(${VISP_INCLUDE_DIR}) - -#----------------------------------------------------------------------------- -# Add extra compilation flags under UNIX -#----------------------------------------------------------------------------- -include(${VISP_CMAKE_MODULE_PATH}/AddExtraCompilationFlags.cmake) -ADD_EXTRA_COMPILATION_FLAGS() - -#-------------------------------------------------------------------- -# By default set release configuration -#-------------------------------------------------------------------- -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE String "Choose the type of build, options are: None Debug Release" FORCE) -endif() - -#-------------------------------------------------------------------- -# Option management -#-------------------------------------------------------------------- - -# Choose static or shared libraries. -OPTION(BUILD_SHARED_LIBS "Build ViSP shared libraries (.dll/.so) instead of static ones (.lib/.a)." ON) -# Build examples as an option. -OPTION(BUILD_EXAMPLES "Build ViSP examples." ON) -# Build examples as an option. -OPTION(BUILD_TESTS "Build ViSP tests." ON) -# Build demos as an option. -OPTION(BUILD_DEMOS "Build ViSP demos." ON) -# Build demos as an option. -OPTION(BUILD_TUTORIALS "Build ViSP tutorials." ON) -# Build deprecated functions as an option. -OPTION(BUILD_DEPRECATED_FUNCTIONS "Build deprecated functionalities." ON) -# Debug and trace cflags -option(ACTIVATE_DEBUG_TRACE "Enable debug and trace printings" ON) - -if(ACTIVATE_DEBUG_TRACE) - list(APPEND VISP_DEFS "-DVP_TRACE") - list(APPEND VISP_DEFS "-DVP_DEBUG") -else() - string(REPLACE "-DVP_TRACE" "" " " VISP_DEFS "${VISP_DEFS}") - string(REPLACE "-DVP_DEBUG" "" " " VISP_DEFS "${VISP_DEFS}") -endif() - -if(MSVC) - option(BUILD_WITH_STATIC_CRT "Enables use of staticaly linked CRT for staticaly linked ViSP" ON) -endif() - -# Note that it is better to set MOMENTS_COMBINE_MATRICES to OFF -OPTION(MOMENTS_COMBINE_MATRICES "Use linear combination of matrices instead of linear combination of moments to compute interaction matrices." OFF) -MARK_AS_ADVANCED(MOMENTS_COMBINE_MATRICES) - -OPTION(ENABLE_TEST_WITHOUT_DISPLAY "Don't use display features when testing" ON) -MARK_AS_ADVANCED(ENABLE_TEST_WITHOUT_DISPLAY) - -IF(ENABLE_TEST_WITHOUT_DISPLAY) - SET(OPTION_TO_DESACTIVE_DISPLAY "-d") -ENDIF() - -IF(BUILD_DEPRECATED_FUNCTIONS) - SET(VISP_BUILD_DEPRECATED_FUNCTIONS TRUE) # for header vpConfig.h -ENDIF() - -IF(MOMENTS_COMBINE_MATRICES) - SET(VISP_MOMENTS_COMBINE_MATRICES TRUE) # for header vpConfig.h -ENDIF() - - -IF (UNIX) - find_package(DC1394) - if(DC1394_FOUND) - option(USE_DC1394 "Compile ViSP with the libdc1394.2 library" ON) - else() - set(USE_DC1394 OFF) - endif() - - FIND_PACKAGE(V4L2) - IF(V4L2_FOUND) - OPTION(USE_V4L2 "Compile ViSP with the v4l2 (video for linux 2) library" ON) - ELSE(V4L2_FOUND) - SET(USE_V4L2 OFF) - ENDIF(V4L2_FOUND) - - IF(NOT RAW1394_FOUND) - FIND_PACKAGE(RAW1394) - ENDIF(NOT RAW1394_FOUND) - FIND_PACKAGE(RT) - FIND_PACKAGE(CALINUX) - FIND_PACKAGE(IRISA) - IF(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) - OPTION(USE_AFMA4 "Compile ViSP for Afma4 robot usage at Irisa" ON) - OPTION(USE_AFMA6 "Compile ViSP for Afma6 robot usage at Irisa" ON) - OPTION(USE_VIPER650 "Compile ViSP for Viper S650 robot usage at Irisa" ON) - OPTION(USE_VIPER850 "Compile ViSP for Viper S850 robot usage at Irisa" ON) - ELSE(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) - SET(USE_AFMA4 OFF) - SET(USE_AFMA6 OFF) - SET(USE_VIPER650 OFF) - SET(USE_VIPER850 OFF) - ENDIF(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) - - FIND_PACKAGE(BICLOPS) - IF(BICLOPS_FOUND) - OPTION(USE_BICLOPS "Compile ViSP for Biclops head usage at Irisa" ON) - ELSE(BICLOPS_FOUND) - SET(USE_BICLOPS OFF) - ENDIF(BICLOPS_FOUND) - - FIND_PACKAGE(PTU46) - IF(PTU46_FOUND) - OPTION(USE_PTU46 "Compile ViSP for Ptu-46 head usage at Irisa" ON) - ELSE(PTU46_FOUND) - SET(USE_PTU46 OFF) - ENDIF(PTU46_FOUND) - -ENDIF(UNIX) - -IF(WIN32) - FIND_PACKAGE(CMU1394) - IF(CMU1394_FOUND) - OPTION(USE_CMU1394 "Compile ViSP with the CMU 1394 Digital Camera SDK" ON) - ELSE(CMU1394_FOUND) - SET(USE_CMU1394 OFF) - ENDIF(CMU1394_FOUND) - - FIND_PACKAGE(GDI) - IF(GDI_FOUND) - OPTION(USE_GDI "Manages the display on windows" ON) - ELSE(GDI_FOUND) - SET(USE_GDI OFF) - ENDIF(GDI_FOUND) - - FIND_PACKAGE(DIRECT3D) - IF(DIRECT3D_FOUND) - OPTION(USE_DIRECT3D "Manages the display on windows" ON) - ELSE(DIRECT3D_FOUND) - SET(USE_DIRECT3D OFF) - ENDIF(DIRECT3D_FOUND) - - FIND_PACKAGE(DIRECTSHOW) - IF(DIRECTSHOW_FOUND) - OPTION(USE_DIRECTSHOW "Manages the frame grabbing on windows" ON) - ELSE(DIRECTSHOW_FOUND) - SET(USE_DIRECTSHOW OFF) - ENDIF(DIRECTSHOW_FOUND) - -ENDIF(WIN32) - -include(FindOpenMP) -if(OPENMP_FOUND) - OPTION(USE_OPENMP "Add C++ compiler flags for OpenMP parallization" ON) -else(OPENMP_FOUND) - SET(USE_OPENMP OFF) -endif(OPENMP_FOUND) - -include(FindCPP11) -if(CPP11_FOUND) - OPTION(USE_CPP11 "Add C++ compiler flags for C++11 support" OFF) -else() - SET(USE_CPP11 OFF) -endif() - -# Since the FindLAPACK.cmake provided with CMake is for Fortran language, -# in CMakeModules we have added FindLAPACK_C.cmake for C language -FIND_PACKAGE(LAPACK_C) -IF(LAPACK_FOUND) - OPTION(USE_LAPACK "Compile ViSP with the lapack/blas libraries" ON) -ELSE(LAPACK_FOUND) - SET(USE_LAPACK OFF) -ENDIF(LAPACK_FOUND) - -#IF(NOT USE_LAPACK) # line removed since the template tracker needs gsl - find_package(GSL) - if(GSL_FOUND) - option(USE_GSL "Compile ViSP with the GSL library" ON) - else() - set(USE_GSL OFF) - endif() -#ENDIF() - -FIND_PACKAGE(OpenGL) -FIND_PACKAGE(Coin3D) -if (NOT COIN3D_FOUND) - FIND_PACKAGE(MyCoin3D) -endif() -IF (COIN3D_FOUND AND OPENGL_FOUND) - OPTION(USE_COIN "Compile ViSP with Coin3D" ON) -ELSE (COIN3D_FOUND AND OPENGL_FOUND) - SET(USE_COIN OFF) -ENDIF (COIN3D_FOUND AND OPENGL_FOUND) - -FIND_PACKAGE(YARP QUIET) -MARK_AS_ADVANCED(YARP_DIR) -IF (YARP_FOUND) - OPTION(USE_YARP "Compile ViSP with YARP" ON) -ELSE (YARP_FOUND) - SET(USE_YARP OFF) -ENDIF () - -FIND_PACKAGE(OGRE QUIET) -MARK_AS_ADVANCED(OGRE_DIR) -IF (OGRE_FOUND) - OPTION(USE_OGRE "Compile ViSP with Ogre3D engine and renderer" ON) -ELSE () - SET(USE_OGRE OFF) -ENDIF () - -FIND_PACKAGE(OIS QUIET) -MARK_AS_ADVANCED(OIS_DIR) -IF (OGRE_FOUND AND OIS_FOUND) - OPTION(USE_OIS "Compile ViSP with OIS (Object Oriented Input System library)" ON) -ELSE () - SET(USE_OIS OFF) -ENDIF () - -FIND_PACKAGE(LIBFREENECT) -IF(LIBFREENECT_FOUND) - OPTION(USE_LIBFREENECT "Compile ViSP with the libfreenect library" ON) -ELSE(LIBFREENECT_FOUND) - SET(USE_LIBFREENECT OFF) -ENDIF(LIBFREENECT_FOUND) - -FIND_PACKAGE(LIBUSB-1) -IF(LIBUSB_1_FOUND) - OPTION(USE_LIBUSB_1 "Compile ViSP with the libusb-1.0 library" ON) -ELSE(LIBUSB_1_FOUND) - SET(USE_LIBUSB_1 OFF) -ENDIF(LIBUSB_1_FOUND) - -IF(WIN32 AND USE_COIN) - FIND_PACKAGE(SOWIN) - IF (SOWIN_FOUND) - OPTION(USE_SOWIN "Compile ViSP with SoWin" OFF) - ELSE (SOWIN_FOUND) - SET(USE_SOWIN OFF) - ENDIF (SOWIN_FOUND) -ENDIF(WIN32 AND USE_COIN) - -IF(USE_COIN) - FIND_PACKAGE(SOQT) - IF (SOQT_FOUND) - OPTION(USE_SOQT "Compile ViSP with SoQt" OFF) - ELSE (SOQT_FOUND) - SET(USE_SOQT OFF) - ENDIF (SOQT_FOUND) - IF(USE_SOQT) - INCLUDE (${CMAKE_ROOT}/Modules/FindQt.cmake) - IF (QT_FOUND) - OPTION(USE_QT "Compile ViSP with Qt" ON) - ELSE (QT_FOUND) - SET(USE_QT OFF) - ENDIF (QT_FOUND) - ENDIF (USE_SOQT) -ENDIF(USE_COIN) - -IF(USE_COIN) - FIND_PACKAGE(SOXT) - IF (SOXT_FOUND) - OPTION(USE_SOXT "Compile ViSP with SoXt" OFF) - ELSE (SOXT_FOUND) - SET(USE_SOXT OFF) - ENDIF (SOXT_FOUND) -ENDIF(USE_COIN) - -FIND_PACKAGE(PTHREAD) -IF (PTHREAD_FOUND) - OPTION(USE_PTHREAD "Compile ViSP with pthread" ON) -ELSE () - SET(USE_PTHREAD OFF) -ENDIF () - -FIND_PACKAGE(XML2) -IF(XML2_FOUND) - OPTION(USE_XML2 "Compile ViSP with the xml2 library" ON) -ELSE(XML2_FOUND) - SET(USE_XML2 OFF) -ENDIF(XML2_FOUND) - -FIND_PACKAGE(OpenCV QUIET) -MARK_AS_ADVANCED(OpenCV_DIR OpenCV_FOUND OPENCV_FOUND) -IF(OpenCV_FOUND) - OPTION(USE_OPENCV "Compile ViSP with OpenCV >= 2.1 library" ON) -ELSE(OpenCV_FOUND) - FIND_PACKAGE(OpenCV2 QUIET) - IF(OpenCV_FOUND) - OPTION(USE_OPENCV "Compile ViSP with OpenCV <= 2.0 library" ON) - ELSE(OpenCV_FOUND) - SET(USE_OPENCV OFF) - ENDIF(OpenCV_FOUND) -ENDIF(OpenCV_FOUND) - -FIND_PACKAGE(ZLIB) -if(ZLIB_FOUND) - OPTION(USE_ZLIB "Compile ViSP with zlib library" ON) -else() - FIND_PACKAGE(MyZLIB) - if(ZLIB_FOUND) - option(USE_ZLIB "Compile ViSP with zlib library" ON) - else() - set(USE_ZLIB OFF) - endif() -endif() - -FIND_PACKAGE(X11) -IF(X11_FOUND) - OPTION(USE_X11 "Compile ViSP with the X11 library" ON) -ELSE(X11_FOUND) - SET(USE_X11 OFF) -ENDIF(X11_FOUND) - -# The native FindGTK2.cmake doesn't consider libgobject-2.0 that is -# requested by ViSP. That's why we use our FindMyGTK2.cmake -#FIND_PACKAGE(GTK2) -#mark_as_advanced(GTK2_ATK_INCLUDE_DIR) -#mark_as_advanced(GTK2_CAIRO_INCLUDE_DIR) -#mark_as_advanced(GTK2_FONTCONFIG_INCLUDE_DIR) -#mark_as_advanced(GTK2_GDK_INCLUDE_DIR) -#mark_as_advanced(GTK2_GDK_PIXBUF_INCLUDE_DIR) -#mark_as_advanced(GTK2_GDKCONFIG_INCLUDE_DIR) -#mark_as_advanced(GTK2_GLIB_INCLUDE_DIR) -#mark_as_advanced(GTK2_GLIBCONFIG_INCLUDE_DIR) -#mark_as_advanced(GTK2_GOBJECT_INCLUDE_DIR) -#mark_as_advanced(GTK2_GTK_INCLUDE_DIR) -#mark_as_advanced(GTK2_PANGO_INCLUDE_DIR) -#IF(GTK2_FOUND) -# OPTION(USE_GTK2 "Compile ViSP with the gtk2 library" ON) -#ELSE(GTK2_FOUND) - FIND_PACKAGE(MyGTK2) - if(GTK2_FOUND) - OPTION(USE_GTK2 "Compile ViSP with the gtk2 library" OFF) - else(GTK2_FOUND) - SET(USE_GTK2 OFF) - endif(GTK2_FOUND) -#ENDIF(GTK2_FOUND) - -FIND_PACKAGE(JPEG) -if(JPEG_FOUND) - OPTION(USE_LIBJPEG "Compile ViSP with the libjpeg library" ON) -else(JPEG_FOUND) - FIND_PACKAGE(MyJPEG) - if(JPEG_FOUND) - OPTION(USE_LIBJPEG "Compile ViSP with the libjpeg library" ON) - else(JPEG_FOUND) - SET(USE_LIBJPEG OFF) - endif() -endif() - -FIND_PACKAGE(PNG) -if(PNG_FOUND) - option(USE_LIBPNG "Compile ViSP with the libpng library" ON) -else(PNG_FOUND) - FIND_PACKAGE(MyPNG) - if(PNG_FOUND) - OPTION(USE_LIBPNG "Compile ViSP with the libpng library" ON) - else(PNG_FOUND) - SET(USE_LIBPNG OFF) - endif() -endif() - -find_package(FFMPEG) -if(FFMPEG_FOUND) - if(USE_OPENCV) - option(USE_FFMPEG "Compile ViSP with the ffmpeg library" OFF) - else() - option(USE_FFMPEG "Compile ViSP with the ffmpeg library" ON) - endif() -else() - set(USE_FFMPEG OFF) -endif() - -# To control Pioneer mobile robots, under UNIX we need Aria, pthread, rt and dl 3rd party libraries -find_package(ARIA) -if(ARIA_FOUND) - OPTION(USE_ARIA "Compile ViSP with Aria library to control Pioneer mobile robots" ON) -else() - SET(USE_ARIA OFF) -endif() - -find_package(RT) -if(RT_FOUND) - OPTION(USE_RT "Compile ViSP with rt library" ON) -else() - SET(USE_RT OFF) -endif() -find_package(DL) -if(DL_FOUND) - OPTION(USE_DL "Compile ViSP with dl library" ON) -else() - SET(USE_DL OFF) -endif() - -find_package(ZBAR) -if(ZBAR_FOUND) - OPTION(USE_ZBAR "Compile ViSP with zbar library" ON) -else() - SET(USE_ZBAR OFF) -endif() - -find_package(DMTX) -if(DMTX_FOUND) - OPTION(USE_DMTX "Compile ViSP with zbar library" ON) -else() - SET(USE_DMTX OFF) -endif() - -# Set other options to default value -#SET(USE_X11 ON) # For Linux/OSX display -#SET(USE_XML2 ON) # For the Xml Parser (vpCameraParameters) -#SET(USE_COIN ON) # For the simulator -#SET(USE_SOWIN ON) # For the simulator viewer -#SET(USE_SOQT ON) # For the simulator viewer -#SET(USE_SOXT ON) # For the simulator viewer -#SET(USE_PTHREAD ON) # For Biclops/Simulator -#SET(USE_OPENCV ON) # For Intel opencv -#SET(USE_GSL ON) # For matrix manipulations -#SET(USE_GTK2 ON) # For Linux/OSX/Windows display with gtk-2.x -#SET(USE_DIRECT3D ON) # For Windows display -#SET(USE_GDI ON) # For Windows display -#SET(USE_DC1394 ON) # For firewire grabber under Linux and OSX ? -#SET(USE_V4L2 ON) # For Video 4 Linux 2 grabber under Linux -#SET(USE_DIRECTSHOW ON) # For Windows direct show grabber -#SET(USE_LIBJPEG ON) # For reading jpeg files -#SET(USE_LIBPNG ON) # For reading png files -#SET(USE_ZLIB ON) # For data compression -#SET(USE_YARP ON) # For YARP -#SET(USE_FFMPEG ON) # For video read and write - -IF(BUILD_SHARED_LIBS) - SET(VISP_BUILD_SHARED_LIBS TRUE) # for header vpConfig.h -ENDIF(BUILD_SHARED_LIBS) - -#---------------------------------------------------------------------- -# Try to find doxygen for documentation generation -# Use "make visp_doc" target to generate the documentation -#---------------------------------------------------------------------- -find_package(Doxygen) -if(DOXYGEN_FOUND) - set(VISP_HAVE_DOXYGEN "yes") # for header vpConfig.h - set(VISP_HAVE_DOXYGEN_FOUND "yes") # for ViSP-third-party.txt - if(DOXYGEN_DOT_EXECUTABLE) - set(VISP_HAVE_DOT "yes") # for header vpConfig.h - set(VISP_HAVE_DOT_FOUND "yes") # for ViSP-third-party.txt - else() - set(VISP_HAVE_DOT "no") # for header vpConfig.h - set(VISP_HAVE_DOT_FOUND "no") # for ViSP-third-party.txt - endif() - ## we need latex for doxygen because of the formulas - find_package(LATEX) - if(NOT LATEX_COMPILER) - message(STATUS "latex command LATEX_COMPILER not found but usually required. You will probably get warnings and user interaction on doxy run.") - endif() - if(NOT MAKEINDEX_COMPILER) - message(STATUS "makeindex command MAKEINDEX_COMPILER not found but usually required.") - endif() - if(NOT DVIPS_CONVERTER) - message(STATUS "dvips command DVIPS_CONVERTER not found but usually required.") - endif() - - configure_file(${VISP_SOURCE_DIR}/doc/config-doxygen.in - ${VISP_DOC_DIR}/config-doxygen - @ONLY ) - - configure_file(${VISP_SOURCE_DIR}/doc/mainpage.doc.in - ${VISP_DOC_DIR}/mainpage.doc - @ONLY ) -else() - set(VISP_HAVE_DOXYGEN "no") # for header vpConfig.h - set(VISP_HAVE_DOXYGEN_FOUND "no") # for ViSP-third-party.txt - set(VISP_HAVE_DOT_FOUND "no") # for ViSP-third-party.txt -endif() - -# ---------------------------------------------------------------------------- -# Solution folders: -# ---------------------------------------------------------------------------- -if(MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) - option(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" ON) -endif() - -if(ENABLE_SOLUTION_FOLDERS) - set_property(GLOBAL PROPERTY USE_FOLDERS ON) - set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets") -endif() - -# Extra ViSP targets: uninstall, etc. -include(${VISP_CMAKE_MODULE_PATH}/VISPExtraTargets.cmake) - - -INCLUDE(CheckLibraryExists) - -#-------------------------------------------------------------------- -# yarp lib -#-------------------------------------------------------------------- -# default initialisation -SET(VISP_HAVE_YARP_FOUND "no") # for ViSP-third-party.txt - -IF(USE_YARP) - IF(YARP_FOUND) - MESSAGE(STATUS "yarp found") - SET(VISP_HAVE_YARP TRUE) # for header vpConfig.h - SET(VISP_HAVE_YARP_FOUND "yes") # for ViSP-third-party.txt - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${YARP_INCLUDE_DIRS}) - - # Work around to add Yarp libraries and also third party libraries requested by Yarp - LIST(REVERSE YARP_LIBRARIES) # to start with YARP_init, that depends on YARP_dev, YARP_sig and YARP_OS - FOREACH(lib ${YARP_LIBRARIES}) - #MESSAGE("lib: ${lib}") - GET_TARGET_PROPERTY(CONFIGURATIONS ${lib} IMPORTED_CONFIGURATIONS) - FOREACH(CONFIGURATION ${CONFIGURATIONS}) - GET_TARGET_PROPERTY(YARP_LIB ${lib} "IMPORTED_LOCATION_${CONFIGURATION}") # Get Yarp full absolute library path and name - - IF(WIN32) - #Work around when YARP is build as shared libraries - STRING(REGEX REPLACE ".dll$" ".lib" YARP_LIB ${YARP_LIB}) - - IF(${CONFIGURATION} STREQUAL "RELEASE") - LIST(APPEND VISP_EXTERN_LIBRARIES optimized ${YARP_LIB}) # Append full absolute library path and name - ELSEIF(${CONFIGURATION} STREQUAL "DEBUG") - LIST(APPEND VISP_EXTERN_LIBRARIES debug ${YARP_LIB}) # Append full absolute library path and name - ENDIF() - ELSE() - LIST(APPEND VISP_EXTERN_LIBRARIES ${YARP_LIB}) # Append full absolute library path and name - ENDIF() - # Get 3rd party libraries requested by Yarp - GET_TARGET_PROPERTY(YARP_LINK_LIBS_ ${lib} "IMPORTED_LINK_INTERFACE_LIBRARIES_${CONFIGURATION}") - LIST(APPEND YARP_LINK_LIBS ${YARP_LINK_LIBS_}) - ENDFOREACH() - ENDFOREACH() - - # Remove Yarp libraries since they were added previously with full absolute library path and name - if(YARP_LINK_LIBS) - foreach(lib ${YARP_LIBRARIES}) - list(REMOVE_ITEM YARP_LINK_LIBS ${lib}) - endforeach() - endif() - # Add 3rd party libraries requested by Yarp - LIST(APPEND VISP_EXTERN_LIBRARIES ${YARP_LINK_LIBS}) - - LIST(APPEND VISP_DEFS ${YARP_DEFINES}) - ELSE() - MESSAGE(STATUS "yarp not found") - SET(VISP_HAVE_YARP_FOUND "no") # for ViSP-third-party.txt - ENDIF() -ENDIF(USE_YARP) - -#--------------------------------------------------------------------- -# Try to determine if Inria's NAS server hosting /udd/ is available -#---------------------------------------------------------------------- -FIND_PACKAGE(NAS) -IF(NAS_FOUND) - SET(VISP_HAVE_ACCESS_TO_NAS TRUE) # for header vpConfig.h -ENDIF(NAS_FOUND) - -#--------------------------------------------------------------------- -# Platform dependent -#---------------------------------------------------------------------- -IF(WIN32 AND NOT CYGWIN) - if(BUILD_DEPRECATED_FUNCTIONS) - list(APPEND VISP_DEFS "-DWIN32") # only for compat with previous versions - endif() - CHECK_LIBRARY_EXISTS("winmm.lib" getch "" HAVE_LIBWINMM) # for timeGetTime() - IF(HAVE_LIBWINMM) - #MESSAGE("have winmm.lib") - LIST(APPEND VISP_EXTERN_LIBRARIES "winmm.lib") - ENDIF(HAVE_LIBWINMM) - if(MSVC) #check if MSVC is the compiler and set VISP_USE_MSVC accordingly - SET(VISP_USE_MSVC TRUE) - endif() - # Add library ws2_32.a or ws2_32.lib for vpNetwork class - if(MINGW) - CHECK_LIBRARY_EXISTS("ws2_32.a" getch "" HAVE_LIBWS2_32) # for inet_ntoa() and socket functionalities - if(HAVE_LIBWS2_32) - list(APPEND VISP_EXTERN_LIBRARIES "ws2_32.a") - else() - find_library(WS2_32_LIBRARY "libws2_32.a" - "$ENV{MINGW_DIR}/lib" - "$ENV{MINGW_DIR}/mingw/lib" - C:/mingw/mingw/lib) - mark_as_advanced(WS2_32_LIBRARY) - if(WS2_32_LIBRARY) - list(APPEND VISP_EXTERN_LIBRARIES "${WS2_32_LIBRARY}") - endif() - endif() - else() # pure WIN32 - CHECK_LIBRARY_EXISTS("ws2_32.lib" getch "" HAVE_LIBWS2_32) # for inet_ntoa() and socket functionalities - if(HAVE_LIBWS2_32) - #message("have ws2_32.lib") - list(APPEND VISP_EXTERN_LIBRARIES "ws2_32.lib") - endif() - endif() -ENDIF(WIN32 AND NOT CYGWIN) -if(UNIX) - if(BUILD_DEPRECATED_FUNCTIONS) - list(APPEND VISP_DEFS "-DUNIX") - if(APPLE) - list(APPEND VISP_DEFS "-DAPPLE") - endif() - if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS") - list(APPEND VISP_DEFS "-DSOLARIS") - endif() - endif() -endif() - -#-------------------------------------------------------------------- -# OpenMP -#-------------------------------------------------------------------- -if(USE_OPENMP) - set(VISP_OPENMP_FLAGS "${OpenMP_CXX_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") -else() - set(VISP_OPENMP_FLAGS "") - if(OpenMP_CXX_FLAGS) - string(REPLACE ${OpenMP_CXX_FLAGS} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - endif() -endif() - -#-------------------------------------------------------------------- -# C++11 -#-------------------------------------------------------------------- -if(USE_CPP11) - set(VISP_CPP11_FLAGS "${CPP11_CXX_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPP11_CXX_FLAGS}") -else() - set(VISP_CPP11_FLAGS "") - if(CPP11_CXX_FLAGS) - string(REPLACE ${CPP11_CXX_FLAGS} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - endif() -endif() - -# Remove duplicates compilation flags -separate_arguments(CMAKE_CXX_FLAGS) -list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS) -string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "common C++ build flags" FORCE) - -#-------------------------------------------------------------------- -# LAPACK lib -#-------------------------------------------------------------------- -SET(VISP_HAVE_LAPACK_FOUND "no") # for ViSP-third-party.txt -IF(USE_LAPACK) - MESSAGE(STATUS "lapack/blas found") - SET(VISP_HAVE_LAPACK TRUE) # for header vpConfig.h - SET(VISP_HAVE_LAPACK_FOUND "yes") # for ViSP-third-party.txt - - #MESSAGE("LAPACK_LIBRARIES = ${LAPACK_LIBRARIES}") - LIST(APPEND VISP_EXTERN_LIBRARIES ${LAPACK_LIBRARIES}) -ENDIF(USE_LAPACK) - -#-------------------------------------------------------------------- -# X11 lib -#-------------------------------------------------------------------- -set(VISP_HAVE_X11_FOUND "no") # for ViSP-third-party.txt -if(USE_X11) - message(STATUS "X11 found") - set(VISP_HAVE_X11 TRUE) # for header vpConfig.h - set(VISP_HAVE_X11_FOUND "yes") # for ViSP-third-party.txt - # try to found -lm requested on some platforms to link with X11 - list(APPEND VISP_EXTERN_INCLUDE_DIRS ${X11_INCLUDE_DIR}) - list(APPEND VISP_EXTERN_LIBRARIES ${X11_LIBRARIES}) - find_library(M_LIBRARY NAMES m) - mark_as_advanced(M_LIBRARY) - if(M_LIBRARY) - list(APPEND VISP_EXTERN_LIBRARIES ${M_LIBRARY}) - endif() - #MESSAGE("X11: ${X11_LIBRARIES}") -else() - # try to found -lsocket -lnsl requested for vpNetwork and vpSickLDMRS - find_library(SOCKET_LIBRARY NAMES socket) - find_library(NSL_LIBRARY NAMES nsl) - if (SOCKET_LIBRARY) - list(APPEND VISP_EXTERN_LIBRARIES ${SOCKET_LIBRARY}) - endif() - if (NSL_LIBRARY) - list(APPEND VISP_EXTERN_LIBRARIES ${NSL_LIBRARY}) - endif() - mark_as_advanced(SOCKET_LIBRARY NSL_LIBRARY) -endif() - - -#-------------------------------------------------------------------- -# OpenGL, Qt, SoQt and Coin libs -#-------------------------------------------------------------------- -# default initialisation -SET(VISP_HAVE_SIMULATOR_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_COIN_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_OGRE_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_OIS_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_SOWIN_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_SOXT_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_SOQT_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_QT4_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_QT3_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_OPENGL_FOUND "no") # for ViSP-third-party.txt - -IF(USE_OGRE) - # Find Boost - if (NOT OGRE_BUILD_PLATFORM_IPHONE) - if (WIN32 OR APPLE) - set(Boost_USE_STATIC_LIBS TRUE) - else () - # Statically linking boost to a dynamic Ogre build doesn't work on Linux 64bit - set(Boost_USE_STATIC_LIBS ${OGRE_STATIC}) - endif () - if (MINGW) - # this is probably a bug in CMake: the boost find module tries to look for - # boost libraries with name libboost_*, but CMake already prefixes library - # search names with "lib". This is the workaround. - set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "") - endif () - #set(Boost_ADDITIONAL_VERSIONS "1.53.0" "1.52.0" "1.51.0" "1.50.0" "1.49.0" "1.48.0" "1.47.0" "1.46.0" "1.45.0" "1.44.0" "1.44" "1.44.0" "1.42" "1.42.0" "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" ) - # Components that need to be linked with. Since Ogre 1.9 we need not only boost_thread and boost_date_time, but also boost_system - set(OGRE_BOOST_COMPONENTS thread system date_time) - if(WIN32) - list(APPEND OGRE_BOOST_COMPONENTS chrono) - endif() - find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET) - mark_as_advanced(Boost_LIB_DIAGNOSTIC_DEFINITIONS Boost_DIR BOOST_THREAD_LIBRARY) - if (NOT Boost_FOUND) - set(OGRE_BOOST_COMPONENTS thread date_time) - if(WIN32) - list(APPEND OGRE_BOOST_COMPONENTS chrono) - endif() - find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET) - endif() - if (NOT Boost_FOUND) - # Try again with the other type of libs - set(Boost_USE_STATIC_LIBS NOT ${Boost_USE_STATIC_LIBS}) - find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET) - endif() - - if (Boost_FOUND) - # Set up referencing of Boost - #LIST(APPEND VISP_DEFS "-DBOOST_ALL_NO_LIB") - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${Boost_LIBRARIES}) - endif() - endif() - - MARK_AS_ADVANCED(OGRE_SAMPLES_INCLUDEPATH) - #message("OGRE_SAMPLES_INCLUDEPATH: ${OGRE_SAMPLES_INCLUDEPATH}") - if(OGRE_SAMPLES_INCLUDEPATH) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${OGRE_SAMPLES_INCLUDEPATH}) - endif() - - # if OGRE_MEDIA_DIR is empty, try to find the path by searching for plugins.cfg - # Introduced since Ubuntu 12.04 - if(NOT OGRE_MEDIA_DIR) - FIND_PATH(OGRE_MEDIA_DIR ../plugins.cfg - $ENV{OGRE_MEDIA_DIR} - /usr/share/OGRE-1.7.4/media - /usr/share/OGRE-1.8.0/media - /usr/share/OGRE-1.8.1/media - /usr/share/OGRE-1.9.0/media - ) - endif() - - #message("OGRE_PLUGIN_DIR_REL: ${OGRE_PLUGIN_DIR_REL}") - #message("OGRE_PLUGIN_DIR_DBG: ${OGRE_PLUGIN_DIR_DBG}") - SET(VISP_HAVE_OGRE_FOUND "yes") # for ViSP-third-party.txt - SET(VISP_HAVE_OGRE TRUE) # for header vpConfig.h - - # If Ogre media are not available we provide the minimal material to run the examples: - # - resources.cfg - # - plugins.cfg - # - media/materials/... - # - media/models/... - # - # We need to introduce OGRE_MEDIA_NOT_AVAILABLE to memorize when OGRE_MEDIA_DIR is not set. - # Because in that case, OGRE_MEDIA_DIR should be set first to VISP_HAVE_OGRE_RESOURCES_PATH - # (for the "make all" case) then to VISP_INSTALL_DIR_OGRE_RESOURCES (for the "make install" case) - if(NOT OGRE_MEDIA_DIR) - set(OGRE_MEDIA_NOT_AVAILABLE "TRUE") - endif() - - # Try to search for an existing plugins.cfg file - # Here we cannot use OGRE_PLUGIN_DIR_REL or OGRE_PLUGIN_DIR_DBG where - # we may find an existing plugins.cfg file, since under Windows in these - # files the PluginFolder is set to a relative path. We need an absolute - # path to avoid recopy of the plugins in ViSP. - # Under Linux or OSX, we may find plugins.cfg with a PluginFolder set - # to an absolute path in OGRE_MEDIA_DIR/.. - FIND_PATH(VISP_HAVE_OGRE_PLUGINS_PATH - NAMES plugins.cfg - PATHS ${OGRE_MEDIA_DIR}/.. - NO_SYSTEM_ENVIRONMENT_PATH - ) - - # If no plugins.cfg file is found, we create one with absolute path - IF(NOT VISP_HAVE_OGRE_PLUGINS_PATH) - include(${VISP_CMAKE_MODULE_PATH}/OgreTools.cmake) - # case 1: normal case - #-------------- - CREATE_OGRE_PLUGIN_CONFIG_FILE() - - # case 2: install or packaging case - #-------------- - # install rule for plugins.cfg: - IF(UNIX) - if(OGRE_PLUGIN_DIR_REL) - INSTALL(FILES - ${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins.cfg - DESTINATION ${CMAKE_INSTALL_LIBDIR}/visp/data/ogre-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - endif() - if(OGRE_PLUGIN_DIR_DBG) - INSTALL(FILES - ${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins_d.cfg - DESTINATION ${CMAKE_INSTALL_LIBDIR}/visp/data/ogre-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - endif() - - ELSE() - if(OGRE_PLUGIN_DIR_REL) - INSTALL(FILES - ${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins.cfg - DESTINATION data/ogre-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - endif() - if(OGRE_PLUGIN_DIR_DBG) - INSTALL(FILES - ${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins_d.cfg - DESTINATION data/ogre-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - endif() - ENDIF() - ENDIF() - - # Try to search for an existing resources.cfg file - FIND_PATH(VISP_HAVE_OGRE_RESOURCES_PATH - NAMES resources.cfg - PATHS ${OGRE_MEDIA_DIR}/.. - NO_SYSTEM_ENVIRONMENT_PATH - ) - - # Here we copy all the minimal media files - # - media/materials/... - # - media/models/... - if(OGRE_MEDIA_NOT_AVAILABLE) - file(COPY data/ogre-simulator/media DESTINATION ${VISP_BINARY_DIR}/data/ogre-simulator) - endif() - - - # Here we create a resources.cfg if it was not found - IF(NOT VISP_HAVE_OGRE_RESOURCES_PATH) - # we create a resources.cfg file for vpAROgre.cpp - # case 1: normal case - # If OGRE_MEDIA_DIR is not found, we set it to VISP_HAVE_OGRE_RESOURCES_PATH in order to use - # the minimal requested media to run the examples - #-------------- - SET(VISP_HAVE_OGRE_RESOURCES_PATH ${VISP_BINARY_DIR}/data/ogre-simulator) - if(OGRE_MEDIA_NOT_AVAILABLE) - set(OGRE_MEDIA_DIR ${VISP_HAVE_OGRE_RESOURCES_PATH}/media) - endif() - - # On Fedora 20 when ogre-devel and ogre-samples packages are installed, AROgre and - # AROgreBasic examples produce a segfault when the folowing line in resource.cf.in - # is commented: - # '#FileSystem=@OGRE_MEDIA_DIR@/materials/programs' - # Here we check if @OGRE_MEDIA_DIR@/materials/programs forder is empty. - # If empty, we comment the line to avoid lintian warnings. - # If not empty we remove the comment to use the available programs. - file(GLOB OGRE_PROGRAM_CONTENT ${OGRE_MEDIA_DIR}/materials/programs/*.*) - if(OGRE_PROGRAM_CONTENT) - set(OGRE_COMMENT_LINE "") - else() - set(OGRE_COMMENT_LINE "#") - endif() - CONFIGURE_FILE( - ${VISP_CMAKE_MODULE_PATH}/resources.cfg.in - ${VISP_HAVE_OGRE_RESOURCES_PATH}/resources.cfg - IMMEDIATE @ONLY) - - # case 2: install or packaging case - # If OGRE_MEDIA_DIR is not found, we set it to VISP_INSTALL_DIR_OGRE_RESOURCES in order to use - # the minimal requested media to run the examples - #-------------- - IF(UNIX) - set(VISP_INSTALL_DIR_OGRE_RESOURCES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/data/ogre-simulator") - ELSE() - set(VISP_INSTALL_DIR_OGRE_RESOURCES "${CMAKE_INSTALL_PREFIX}/data/ogre-simulator") - ENDIF() - - if(OGRE_MEDIA_NOT_AVAILABLE) - set(OGRE_MEDIA_DIR ${VISP_INSTALL_DIR_OGRE_RESOURCES}/media) - endif() - - # install rule for resources.cfg and Ogre media if they are not available: - if(UNIX) - configure_file( - ${VISP_CMAKE_MODULE_PATH}/resources.cfg.in - ${VISP_BINARY_DIR}/unix-install/resources.cfg - IMMEDIATE @ONLY) - install(FILES - ${VISP_BINARY_DIR}/unix-install/resources.cfg - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/data/ogre-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - if(OGRE_MEDIA_NOT_AVAILABLE) - install(DIRECTORY - data/ogre-simulator/media - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/data/ogre-simulator - FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - endif() - else() - configure_file( - ${VISP_CMAKE_MODULE_PATH}/resources.cfg.in - ${VISP_BINARY_DIR}/win-install/resources.cfg - IMMEDIATE @ONLY) - install(FILES - ${VISP_BINARY_DIR}/win-install/resources.cfg - DESTINATION data/ogre-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - if(OGRE_MEDIA_NOT_AVAILABLE) - install(DIRECTORY - data/ogre-simulator/media - DESTINATION data/ogre-simulator - FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - endif() - endif() - endif() - - MARK_AS_ADVANCED(VISP_HAVE_OGRE_PLUGINS_PATH) - MARK_AS_ADVANCED(VISP_HAVE_OGRE_RESOURCES_PATH) - #message("VISP_HAVE_OGRE_PLUGINS_PATH: ${VISP_HAVE_OGRE_PLUGINS_PATH}") - #message("VISP_HAVE_OGRE_RESOURCES_PATH: ${VISP_HAVE_OGRE_RESOURCES_PATH}") - - # hack to fix possible presence of NOTFOUND in OGRE_INCLUDE_DIRS - #message("OGRE_INCLUDE_DIRS: ${OGRE_INCLUDE_DIRS}") - #LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${OGRE_INCLUDE_DIRS}) - foreach(inc_ ${OGRE_INCLUDE_DIRS}) - if(NOT ${inc_} MATCHES "NOTFOUND") - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${inc_}) - endif() - endforeach() - LIST(APPEND VISP_EXTERN_LIBRARIES ${OGRE_LIBRARIES}) -ENDIF(USE_OGRE) - -IF(USE_OIS AND USE_OGRE) - SET(VISP_HAVE_OIS_FOUND "yes") # for ViSP-third-party.txt - SET(VISP_HAVE_OIS TRUE) # for header vpConfig.h - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${OIS_INCLUDE_DIR}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${OIS_LIBRARIES}) - IF(APPLE) - # With Ogre 1.7.4 and 1.8.1 to be able to link with libOIS.a, Cocoa framework is requested. - # This is a work around since it should come with FindOGRE.cmake - LIST(APPEND VISP_EXTERN_LIBRARIES "-framework Cocoa") - ENDIF(APPLE) - -ENDIF(USE_OIS AND USE_OGRE) - -IF(USE_COIN) - IF (COIN3D_FOUND) - MESSAGE(STATUS "Coin3D found") - SET(VISP_HAVE_COIN_FOUND "yes") # for ViSP-third-party.txt - SET(VISP_HAVE_COIN TRUE) # for header vpConfig.h - SET(VISP_HAVE_OPENGL TRUE) # for header vpConfig.h - SET(VISP_HAVE_OPENGL_FOUND "yes") # for ViSP-third-party.txt - IF(WIN32) - LIST(APPEND VISP_DEFS "-DCOIN_DLL") - ENDIF(WIN32) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${COIN3D_INCLUDE_DIRS}) - # On OSX cmake 2.8 found OpenGL but OPENGL_INCLUDE_DIR was set to NOT_FOUND - # We add a test to be sure that the OPENGL vars exist. - if(OPENGL_INCLUDE_DIR) - list(APPEND VISP_EXTERN_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) - endif() - if(OPENGL_LIBRARIES) - list(APPEND VISP_EXTERN_LIBRARIES ${OPENGL_LIBRARIES}) - endif() - - #MESSAGE("COIN3D_INCLUDE_DIRS = ${COIN3D_INCLUDE_DIRS}") - #MESSAGE("COIN3D_LIBRARIES = ${COIN3D_LIBRARIES}") - LIST(APPEND VISP_EXTERN_LIBRARIES ${COIN3D_LIBRARIES}) - - IF (USE_SOWIN AND SOWIN_FOUND) - # We manage SoWin and Coin - SET(VISP_HAVE_SOWIN TRUE) # for header vpConfig.h - SET(VISP_HAVE_SOWIN_FOUND "yes") # for ViSP-third-party.txt - SET(VISP_HAVE_COIN_AND_GUI TRUE) # for header vpConfig.h - - #MESSAGE("SOWIN_INCLUDE_DIR = ${SOWIN_INCLUDE_DIRS}") - #MESSAGE("SOWIN_LIBRARIES = ${SOWIN_LIBRARIES}") - - LIST(APPEND VISP_DEFS "-DSOWIN_DLL") - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${SOWIN_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${SOWIN_LIBRARIES}) - ENDIF(USE_SOWIN AND SOWIN_FOUND) - - IF(USE_SOQT AND SOQT_FOUND) - #MESSAGE("SoQt found") - - IF (USE_QT AND QT_FOUND) - #MESSAGE("Qt found") - # OpenGL, QT and SOQT are found - # We first manage OpenGL - SET(VISP_HAVE_SOQT TRUE) # for header vpConfig.h - SET(VISP_HAVE_SOQT_FOUND "yes") # for ViSP-third-party.txt - SET(VISP_HAVE_QT TRUE) # for header vpConfig.h - SET(VISP_HAVE_COIN_AND_GUI TRUE) # for header vpConfig.h - - #MESSAGE(STATUS "SOQT_INCLUDE_DIRS = ${SOQT_INCLUDE_DIRS}") - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${SOQT_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${QT_INCLUDE_DIR}) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${QT_INCLUDES}) - - # Add SoQt libraries - #MESSAGE("SOQT_LIBRARIES = ${SOQT_LIBRARIES}") - LIST(APPEND VISP_EXTERN_LIBRARIES ${SOQT_LIBRARIES}) - IF(WIN32) - LIST(APPEND VISP_DEFS "-DSOQT_DLL") - ENDIF(WIN32) - - # We manage QT libraries - IF (DESIRED_QT_VERSION MATCHES 3) - #Add Qt3 libraries - SET(VISP_HAVE_QT3_FOUND "yes") # for ViSP-third-party.txt - #MESSAGE("QT_QT_LIBRARY ${QT_QT_LIBRARY}") - LIST(APPEND VISP_EXTERN_LIBRARIES ${QT_QT_LIBRARY}) - ELSEIF(DESIRED_QT_VERSION MATCHES 4) - #Add Qt4 libraries - SET(VISP_HAVE_QT4_FOUND "yes") # for ViSP-third-party.txt - #MESSAGE("QT_QTGUI_LIBRARY ${QT_QTGUI_LIBRARY}") - #MESSAGE("QT_QTGUI_LIBRARY_RELEASE ${QT_QTGUI_LIBRARY_RELEASE}") - #MESSAGE("QT_QTGUI_LIBRARY_DEBUG ${QT_QTGUI_LIBRARY_DEBUG}") - IF (QT_QTGUI_LIBRARY_RELEASE AND QT_QTCORE_LIBRARY_RELEASE AND QT_QTGUI_LIBRARY_DEBUG AND QT_QTCORE_LIBRARY_DEBUG) - LIST(APPEND VISP_EXTERN_LIBRARIES optimized ${QT_QTGUI_LIBRARY_RELEASE}) - LIST(APPEND VISP_EXTERN_LIBRARIES optimized ${QT_QTCORE_LIBRARY_RELEASE}) - LIST(APPEND VISP_EXTERN_LIBRARIES debug ${QT_QTGUI_LIBRARY_DEBUG}) - LIST(APPEND VISP_EXTERN_LIBRARIES debug ${QT_QTCORE_LIBRARY_DEBUG}) - ELSEIF (QT_QTGUI_LIBRARY_RELEASE AND QT_QTCORE_LIBRARY_RELEASE) - LIST(APPEND VISP_EXTERN_LIBRARIES ${QT_QTGUI_LIBRARY_RELEASE}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${QT_QTCORE_LIBRARY_RELEASE}) - ELSEIF (QT_QTGUI_LIBRARY_DEBUG AND QT_QTCORE_LIBRARY_DEBUG) - LIST(APPEND VISP_EXTERN_LIBRARIES ${QT_QTGUI_LIBRARY_DEBUG}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${QT_QTCORE_LIBRARY_DEBUG}) - ENDIF() - ENDIF (DESIRED_QT_VERSION MATCHES 3) - - # Because in QT_DEFINITIONS defs are separated by ";", parse the - # QT_DEFINITIONS in order to build a space separated string - #SET(VISP_DEFS "${VISP_DEFS} ${QT_DEFINITIONS}") did not work - # in third party projects which use visp-config shell script - # (due to ";" # separate char) - FOREACH(DEF ${QT_DEFINITIONS}) - #MESSAGE("DEF: ${DEF}") - LIST(APPEND VISP_DEFS ${DEF}) - ENDFOREACH(DEF) - - LIST(APPEND VISP_DEFS "-DQT_DLL") - ENDIF (USE_QT AND QT_FOUND) - ENDIF(USE_SOQT AND SOQT_FOUND) - - IF (USE_SOXT AND SOXT_FOUND) - # OPenGL and SoXt are found - # We first manage OpenGL - SET(VISP_HAVE_SOXT TRUE) # for header vpConfig.h - SET(VISP_HAVE_COIN_AND_GUI TRUE) # for header vpConfig.h - SET(VISP_HAVE_SOXT_FOUND "yes") # for ViSP-third-party.txt - LIST(APPEND VISP_EXTERN_LIBRARIES ${SOXT_LIBRARIES}) - ENDIF(USE_SOXT AND SOXT_FOUND) - - IF(VISP_HAVE_COIN_AND_GUI) - SET(VISP_HAVE_COIN_AND_GUI_FOUND "yes") # for ViSP-third-party.txt - MESSAGE(STATUS "Coin3D + GUI found") - ELSE(VISP_HAVE_COIN_AND_GUI) - MESSAGE(STATUS "Coin3D + GUI not found") - SET(VISP_HAVE_COIN_AND_GUI_FOUND "no") # for ViSP-third-party.txt - ENDIF(VISP_HAVE_COIN_AND_GUI) - ENDIF (COIN3D_FOUND) -ENDIF(USE_COIN) - -#--------------------------------------------------------------------- -# XML2 -#--------------------------------------------------------------------- -# default initialisation -SET(VISP_HAVE_XML2_FOUND "no") # for ViSP-third-party.txt - -IF(USE_XML2) - #FIND_PACKAGE(XML2) - IF(XML2_FOUND) - SET(VISP_HAVE_XML2 TRUE) - SET(VISP_HAVE_XML2_FOUND "yes") # for ViSP-third-party.txt - MESSAGE(STATUS "XML2 found") - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${XML2_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${XML2_LIBRARIES}) - ELSE(XML2_FOUND) - MESSAGE(STATUS "XML2 not found") - SET(VISP_HAVE_XML2_FOUND "no") # for ViSP-third-party.txt - ENDIF(XML2_FOUND) -ENDIF(USE_XML2) - - -#--------------------------------------------------------------------- -# libfreenect -# Note that this library needs libusb-1.0 and libpthread -#--------------------------------------------------------------------- -# default initialisation for ViSP-third-party.txt -SET(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES_FOUND "no") -SET(VISP_HAVE_LIBFREENECT_FOUND "no") -SET(VISP_HAVE_LIBUSB_1_FOUND "no") - -IF(USE_LIBFREENECT) - #FIND_PACKAGE(LIBFREENECT) - IF(LIBFREENECT_FOUND) - SET(VISP_HAVE_LIBFREENECT TRUE) - SET(VISP_HAVE_LIBFREENECT_FOUND "yes") # for ViSP-third-party.txt - - MESSAGE(STATUS "libfreenect found") - - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${LIBFREENECT_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${LIBFREENECT_LIBRARIES}) - ELSE() - MESSAGE(STATUS "libfreenect not found") - SET(VISP_HAVE_LIBFREENECT_FOUND "no") # for ViSP-third-party.txt - ENDIF() -ENDIF() - -IF(USE_LIBUSB_1) - #FIND_PACKAGE(LIBUSB-1) - IF(LIBUSB_1_FOUND) - SET(VISP_HAVE_LIBUSB_1 TRUE) - SET(VISP_HAVE_LIBUSB_1_FOUND "yes") # for ViSP-third-party.txt - - MESSAGE(STATUS "libusb-1.0 found") - - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${LIBUSB_1_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${LIBUSB_1_LIBRARIES}) - ELSE() - MESSAGE(STATUS "libusb-1.0 not found") - SET(VISP_HAVE_LIBUSB_1_FOUND "no") # for ViSP-third-party.txt - ENDIF() -ENDIF() - -# Check if libfreenect dependencies (ie libusb-1.0 and libpthread) are available -IF(USE_LIBFREENECT AND USE_LIBUSB_1 AND USE_PTHREAD) - IF(LIBFREENECT_FOUND AND LIBUSB_1_FOUND AND PTHREAD_FOUND) - SET(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES TRUE) - SET(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES_FOUND "yes") # for ViSP-third-party.txt - - # The material is found. Check if libfreenect is an old version - include(CheckCXXSourceCompiles) - SET(CMAKE_REQUIRED_LIBRARIES ${LIBFREENECT_LIBRARIES} ${PTHREAD_LIBRARIES} ${LIBUSB_1_LIBRARIES}) - SET(CMAKE_REQUIRED_INCLUDES ${LIBFREENECT_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIRS} ${LIBUSB_1_INCLUDE_DIRS}) - CHECK_CXX_SOURCE_COMPILES(" - #include <libfreenect.hpp> - - class vpMyKinect : public Freenect::FreenectDevice - { - }; - - int main() - { - Freenect::Freenect<vpMyKinect> freenect; - } - " LIBFREENECT_IS_OLD_VERSION) - #MESSAGE("LIBFREENECT_IS_OLD_VERSION: ${LIBFREENECT_IS_OLD_VERSION}") - IF(LIBFREENECT_IS_OLD_VERSION) - SET(VISP_HAVE_LIBFREENECT_OLD TRUE) - ELSE() - SET(VISP_HAVE_LIBFREENECT_OLD FALSE) - ENDIF() - - ENDIF() -ENDIF() - - -#-------------------------------------------------------------------- -# pthread lib -#-------------------------------------------------------------------- -# default initialisation -SET(VISP_HAVE_PTHREAD_FOUND "no") # for ViSP-third-party.txt - -IF(USE_PTHREAD) - #FIND_PACKAGE(PTHREAD) - IF(PTHREAD_FOUND) - MESSAGE(STATUS "pthread found") - SET(VISP_HAVE_PTHREAD TRUE) # for header vpConfig.h - SET(VISP_HAVE_PTHREAD_FOUND "yes") # for ViSP-third-party.txt - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${PTHREAD_LIBRARIES}) - #MESSAGE("PTHREAD_LIBRARIES = ${PTHREAD_LIBRARIES}") - ELSE(PTHREAD_FOUND) - MESSAGE(STATUS "pthread not found") - SET(VISP_HAVE_PTHREAD_FOUND "no") # for ViSP-third-party.txt - ENDIF(PTHREAD_FOUND) -ENDIF(USE_PTHREAD) - -#-------------------------------------------------------------------- -# parallel port usage -#-------------------------------------------------------------------- -FIND_PACKAGE(PARPORT) -IF(PARPORT_FOUND) - SET(VISP_HAVE_PARPORT TRUE) # for header vpConfig.h -ENDIF(PARPORT_FOUND) - -#---------------------------------------------------------------------- -# Third party software : -#---------------------------------------------------------------------- -# default initialisation -SET(VISP_HAVE_OPENCV_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_GSL_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_GTK_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_D3D9_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_GDI_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_LIBJPEG_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_LIBPNG_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_ZLIB_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_FFMPEG_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_CMU1394_FOUND "no") # for ViSP-third-party.txt - -# OpenCV -if(USE_OPENCV) - #SET(OpenCV_FIND_QUIETLY TRUE) - #FIND_PACKAGE(OpenCV) - if(OpenCV_FOUND) - message(STATUS "OpenCV found") - set(VISP_HAVE_OPENCV TRUE) # for header vpConfig.h - set(VISP_HAVE_OPENCV_FOUND "yes") # for ViSP-third-party.txt - # On win32 since OpenCV 2.4.7 and on OSX with OpenCV 2.4.10 we cannot use OpenCV_LIBS to set ViSP 3rd party libraries. - # Using OpenCV_LIBS works to build visp library, examples, demos and test thanks to the components, - # but not tutorials that are stand alone Cmake project that use ViSP as a 3rd party. - # To be clear OpenCV_LIBS contains opencv_core and not c:\...\opencv_core248.lib full path as requested - # to use ViSP. This was not the case with OpenCV 2.4.6. - # For the build of ViSP it works with OpenCV_LIBS: in that case thanks to opencv_core properties, CMake - # is able to find the real name and location of the libraries. - # But when ViSP is used as a 3rd party where it should import OpenCV libraries, it doesn't work with - # OpenCV_LIBS. - # The solution here is to get the real name of OpenCV libraries thanks to the properties and link - # with these names. - # An other way could be to include OpenCVConfig.cmake, but in that case, visp-config and visp.pc - # will be not able to give the names of OpenCV libraries when used without CMake. - #message("OpenCV_LIB_COMPONENTS: ${OpenCV_LIB_COMPONENTS}") - #message("OpenCV_LIBS: ${OpenCV_LIBS}") - #if(WIN32 AND OpenCV_LIB_COMPONENTS AND OpenCV_VERSION AND OpenCV_VERSION VERSION_GREATER 2.4.6.1) - if(OpenCV_LIB_COMPONENTS AND OpenCV_VERSION AND OpenCV_VERSION VERSION_GREATER 2.4.6.1) - set(config_ "NONE" "RELEASE" "DEBUG" "RELEASEWITHDEBINFO") # RelWithDebugInfo was requested under Fedora 20 - - if(POLICY CMP0045) - # Fix Error on non-existent target in get_target_property for 3rd party location extraction - cmake_policy(PUSH) - cmake_policy(SET CMP0045 OLD) - endif() - - foreach(component_ ${OpenCV_LIB_COMPONENTS}) - foreach(imp_config_ ${config_}) - if(OpenCV_SHARED) - get_target_property(component_property_${imp_config_}_ ${component_} IMPORTED_IMPLIB_${imp_config_}) - # particular case of opencv_ts that doesn't have an implib - if(NOT EXISTS "${component_property_${imp_config_}_}") - get_target_property(component_property_${imp_config_}_ ${component_} IMPORTED_LOCATION_${imp_config_}) - endif() - else() - get_target_property(component_property_${imp_config_}_ ${component_} IMPORTED_LOCATION_${imp_config_}) - endif() - get_target_property(component_property_3rdparty_${imp_config_}_ ${component_} IMPORTED_LINK_INTERFACE_LIBRARIES_${imp_config_}) - #message("component_property_${imp_config_}_: ${component_property_${imp_config_}_}") - #message("component_property_3rdparty_${imp_config_}_: ${component_property_3rdparty_${imp_config_}_}") - - # Under Unix, there is no specific suffix for OpenCV libraries. If one is found we add it - # Under Windows, we add the "optimized", "debug" specific keywords - if(WIN32 AND EXISTS "${component_property_${imp_config_}_}" AND "${imp_config_}" MATCHES "RELEASE") # also valid for RELEASEWITHDEBINFO - list(APPEND VISP_EXTERN_LIBRARIES optimized "${component_property_${imp_config_}_}") - elseif(WIN32 AND EXISTS "${component_property_${imp_config_}_}" AND "${imp_config_}" MATCHES "DEBUG") - list(APPEND VISP_EXTERN_LIBRARIES debug "${component_property_${imp_config_}_}") - elseif(EXISTS "${component_property_${imp_config_}_}") - list(APPEND VISP_EXTERN_LIBRARIES "${component_property_${imp_config_}_}") - endif() - - if(component_property_3rdparty_${imp_config_}_) - foreach(3rdparty_ ${component_property_3rdparty_${imp_config_}_}) - #message("3rdparty_ ${3rdparty_}") - list(FIND OpenCV_LIB_COMPONENTS ${3rdparty_} 3rdparty_is_opencv_component_) - if(3rdparty_is_opencv_component_ LESS 0) - #message("${3rdparty_} is not an opencv component") - get_target_property(3rdparty_opt_location_ ${3rdparty_} IMPORTED_LOCATION_${imp_config_}) - if(NOT EXISTS "${3rdparty_opt_location_}") - #message("3rdparty_: ${3rdparty_} location doesn't exist in ${imp_config_}") - get_target_property(3rdparty_opt_location_ ${3rdparty_} IMPORTED_LOCATION) - #message("3rdparty_: ${3rdparty_} location : ${3rdparty_opt_location_}") - endif() - if(EXISTS "${3rdparty_opt_location_}") - #message("3rdparty_opt_location_: ${3rdparty_opt_location_} with config ${imp_config_}") - if(WIN32 AND "${imp_config_}" MATCHES "RELEASE") - #message("is release") - list(APPEND VISP_EXTERN_LIBRARIES optimized ${3rdparty_opt_location_}) - elseif(WIN32 AND "${imp_config_}" MATCHES "DEBUG") - list(APPEND VISP_EXTERN_LIBRARIES debug ${3rdparty_opt_location_}) - else() - list(APPEND VISP_EXTERN_LIBRARIES ${3rdparty_opt_location_}) - endif() - else() - find_library(3rdparty_location_ NAMES ${3rdparty_}) - mark_as_advanced(3rdparty_location_) - if(3rdparty_location_) - #message(${3rdparty_location_}) - list(APPEND VISP_EXTERN_LIBRARIES ${3rdparty_location_}) # should be a system dependency - else() - list(APPEND VISP_EXTERN_LIBRARIES ${3rdparty_}) # should be a system dependency - endif() - endif() - endif() - endforeach() - endif() - endforeach() - endforeach() - - if(POLICY CMP0045) - # Fix Error on non-existent target in get_target_property for 3rd party location extraction - cmake_policy(POP) - endif() - - else() - # this should be an old OpenCV version that doesn't have the previous behavior - list(APPEND VISP_EXTERN_LIBRARIES ${OpenCV_LIBS}) - endif() - list(APPEND VISP_EXTERN_INCLUDE_DIRS ${OpenCV_INCLUDE_DIRS}) - #LIST(APPEND VISP_EXTERN_LIBRARIES ${OpenCV_LIBS}) - #MESSAGE("OpenCV_INCLUDE_DIRS = ${OpenCV_INCLUDE_DIRS}") - #MESSAGE("OpenCV_LIBS = ${OpenCV_LIBS}") - #MESSAGE("OpenCV_LIB_DIR = ${OpenCV_LIB_DIR}") - set(VISP_HAVE_OPENCV_VERSION "(${OpenCV_VERSION_MAJOR}*65536 + ${OpenCV_VERSION_MINOR}*256 + ${OpenCV_VERSION_PATCH})") # for ViSP-third-party.txt - #MESSAGE("VISP_HAVE_OPENCV_VERSION = ${VISP_HAVE_OPENCV_VERSION}") - #message("VISP_EXTERN_LIBRARIES = ${VISP_EXTERN_LIBRARIES}") - - # additional check to see if opencv_nonfree module introduced in OpenCV 2.4 is available - #message("OpenCV_VERSION = ${OpenCV_VERSION}") - #message("OpenCV_NONFREE_FOUND: ${OPENCV_NONFREE_FOUND}") - if(OpenCV_VERSION) - if(OpenCV_VERSION VERSION_LESS "2.4.0") - message(STATUS "OpenCV nonfree module found") - set(VISP_HAVE_OPENCV_NONFREE TRUE) # for header vpConfig.h - else() # Version is greater or equal to 2.4.0 - if(OPENCV_NONFREE_FOUND) # OpenCV < 3.0.0 - message(STATUS "OpenCV xfeatures2d module found") - set(VISP_HAVE_OPENCV_NONFREE TRUE) # for header vpConfig.h - elseif(OPENCV_XFEATURES2D_FOUND) # OpenCV >= 3.0.0 - set(VISP_HAVE_OPENCV_XFEATURES2D TRUE) # for header vpConfig.h - else() - message(STATUS "OpenCV nonfree or xfeature2d module not found") - endif() - endif() - else() - message("OpenCV_VERSION is false") - message(STATUS "OpenCV nonfree not found") - endif() - else(OpenCV_FOUND) - message(STATUS "OpenCV not found") - set(VISP_HAVE_OPENCV_FOUND "no") # for ViSP-third-party.txt - set(VISP_HAVE_OPENCV_VERSION "(0)") # for ViSP-third-party.txt - endif(OpenCV_FOUND) -else(USE_OPENCV) - set(OpenCV_VERSION_MAJOR 0) - set(OpenCV_VERSION_MINOR 0) - SET(OpenCV_VERSION_PATCH 0) - set(VISP_HAVE_OPENCV_VERSION "(0)") # for ViSP-third-party.txt -endif(USE_OPENCV) - -# gnu scientific library -IF(USE_GSL) - #FIND_PACKAGE(GSL) - IF(GSL_FOUND) - MESSAGE(STATUS "GSL found") - SET(VISP_HAVE_GSL TRUE) # for header vpConfig.h - SET(VISP_HAVE_GSL_FOUND "yes") # for ViSP-third-party.txt - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${GSL_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${GSL_LIBRARIES}) - #MESSAGE("GSL_INCLUDE_DIRS = ${GSL_INCLUDE_DIRS}") - #MESSAGE("GSL_LIBRARIES = ${GSL_LIBRARIES}") - ELSE(GSL_FOUND) - MESSAGE(STATUS "GSL not found") - SET(VISP_HAVE_GSL_FOUND "no") # for ViSP-third-party.txt - ENDIF(GSL_FOUND) -ENDIF(USE_GSL) - -# strategy for gtk: search first gtk2. If not found search gtk1 -# gtk-2 library: -IF(USE_GTK2) - #FIND_PACKAGE(GTK2) - IF(GTK2_FOUND) - MESSAGE(STATUS "GTK2 found") - SET(VISP_HAVE_GTK TRUE) # for header vpConfig.h - SET(VISP_HAVE_GTK_FOUND "yes") # for ViSP-third-party.txt - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${GTK2_INCLUDE_DIRS}) - - IF(UNIX) - ## ignore gtk pedantic warnings by gcc specific -isystem : - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${GTK2_gtk_INCLUDE_PATH}") - ENDIF(UNIX) - - LIST(APPEND VISP_EXTERN_LIBRARIES ${GTK2_LIBRARIES}) - # MESSAGE(STATUS "DBG CMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}") - #MESSAGE("GTK2 includes: ${GTK2_INCLUDE_DIRS}") - #MESSAGE("GTK2 Libs: ${GTK2_LIBRARIES}") - SET(USE_GTK1 OFF) # no need to found gtk-1 - ELSE(GTK2_FOUND) - MESSAGE(STATUS "GTK2 not found") - SET(VISP_HAVE_GTK_FOUND "no") # for ViSP-third-party.txt - #MESSAGE("GTK2 requested but not found.") - ENDIF(GTK2_FOUND) -ENDIF(USE_GTK2) - -# Under Windows, usage of Direct3D9 -IF(USE_DIRECT3D) - #FIND_PACKAGE(DIRECT3D) - IF(DIRECT3D_FOUND) - MESSAGE(STATUS "Direct3D found") - SET(VISP_HAVE_D3D9 TRUE) # for header vpConfig.h - SET(VISP_HAVE_D3D9_FOUND "yes") # for ViSP-third-party.txt - #MESSAGE("DBG VISP_HAVE_D3D9= ${VISP_HAVE_D3D9}") - #MESSAGE("DBG DIRECT3D_INCLUDE_DIRS=${DIRECT3D_INCLUDE_DIRS}") - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${DIRECT3D_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${DIRECT3D_LIBRARIES}) - #MESSAGE("DIRECT3D_LIBRARIES = ${DIRECT3D_LIBRARIES}") - ELSE(DIRECT3D_FOUND) - MESSAGE(STATUS "Direct3D not found") - SET(VISP_HAVE_D3D9_FOUND "no") # for ViSP-third-party.txt - ENDIF(DIRECT3D_FOUND) -ENDIF(USE_DIRECT3D) - -# Under Windows, usage of GDI (Graphics Device Interface) -IF(USE_GDI) - #FIND_PACKAGE(GDI) - IF(GDI_FOUND) - MESSAGE(STATUS "GDI found") - SET(VISP_HAVE_GDI TRUE) # for header vpConfig.h - SET(VISP_HAVE_GDI_FOUND "yes") # for ViSP-third-party.txt - #MESSAGE("DBG VISP_HAVE_GDI= ${VISP_HAVE_GDI}") - LIST(APPEND VISP_EXTERN_LIBRARIES ${GDI_LIBRARIES}) - #MESSAGE("GDI_LIBRARIES = ${GDI_LIBRARIES}") - ELSE(GDI_FOUND) - MESSAGE(STATUS "GDI not found") - SET(VISP_HAVE_GDI_FOUND "no") # for ViSP-third-party.txt - ENDIF(GDI_FOUND) -ENDIF(USE_GDI) - -# zlib -IF(USE_ZLIB) - #FIND_PACKAGE(ZLIB) - IF(ZLIB_FOUND) - MESSAGE(STATUS "zlib found") - SET(VISP_HAVE_ZLIB TRUE) # for header vpConfig.h - SET(VISP_HAVE_ZLIB_FOUND "yes") # for ViSP-third-party.txt - - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${ZLIB_LIBRARIES}) - #MESSAGE(ZLIB_LIBRARIES: ${ZLIB_LIBRARIES}) - ELSE() - MESSAGE(STATUS "zlib not found") - SET(VISP_HAVE_FOUND "no") # for ViSP-third-party.txt - ENDIF() -ENDIF(USE_ZLIB) - -# Libjpeg -IF(USE_LIBJPEG) - #FIND_PACKAGE(JPEG) - #MESSAGE("test ${JPEG_FOUND}") - IF(JPEG_FOUND) - MESSAGE(STATUS "libjpeg found") - SET(VISP_HAVE_LIBJPEG TRUE) # for header vpConfig.h - SET(VISP_HAVE_LIBJPEG_FOUND "yes") # for ViSP-third-party.txt - - #message("JPEG_INCLUDE_DIR: ${JPEG_INCLUDE_DIR}") - # Here we use JPEG_INCLUDE_DIR that is the var name defined in CMake/Modules/FindJPEG.cmake - # In FindMyJPEG.cmake, we define both JPEG_INCLUDE_DIR and JPEG_INCLUDE_DIRS - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${JPEG_INCLUDE_DIR}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${JPEG_LIBRARIES}) - - # If Qt3 and libjpeg are used, we add here QT_CLEAN_NAMESPACE define to - # handle a compilation error "conflicting declaration 'typedef long int - # INT32'" - IF(VISP_HAVE_QT3_FOUND) - LIST(APPEND VISP_DEFS "-DQT_CLEAN_NAMESPACE") - # MESSAGE("add -DQT_CLEAN_NAMESPACE") - ENDIF(VISP_HAVE_QT3_FOUND) - - ELSE(JPEG_FOUND) - MESSAGE(STATUS "libjpeg not found") - SET(VISP_HAVE_LIBJPEG_FOUND "no") # for ViSP-third-party.txt - ENDIF(JPEG_FOUND) -ENDIF(USE_LIBJPEG) - -# Libpng -IF(USE_LIBPNG) - #FIND_PACKAGE(PNG) - IF(PNG_FOUND) - MESSAGE(STATUS "libpng found") - SET(VISP_HAVE_LIBPNG TRUE) # for header vpConfig.h - SET(VISP_HAVE_LIBPNG_FOUND "yes") # for ViSP-third-party.txt - - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${PNG_INCLUDE_DIR}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${PNG_LIBRARIES}) - LIST(APPEND VISP_DEFS ${PNG_DEFINITIONS}) - ELSE() - MESSAGE(STATUS "libpng not found") - SET(VISP_HAVE_LIBPNG_FOUND "no") # for ViSP-third-party.txt - ENDIF() -ENDIF(USE_LIBPNG) - -# FFMPEG -IF(USE_FFMPEG) - #FIND_PACKAGE(FFMPEG) - IF(FFMPEG_FOUND) - MESSAGE(STATUS "FFMPEG found") - SET(VISP_HAVE_FFMPEG TRUE) # for header vpConfig.h - SET(VISP_HAVE_FFMPEG_FOUND "yes") # for ViSP-third-party.txt - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${FFMPEG_LIBRARIES}) - ELSE(LIBFFMPEG_FOUND) - MESSAGE(STATUS "FFMPEG not found") - SET(VISP_HAVE_FFMPEG_FOUND "no") # for ViSP-third-party.txt - ENDIF(FFMPEG_FOUND) -ENDIF(USE_FFMPEG) - -#---------------------------------------------------------------------- -# Specific hardware : framegrabbers and cameras -#---------------------------------------------------------------------- -# default initialisation -SET(VISP_HAVE_DC1394_2_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_V4L2_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_DIRECTSHOW_FOUND "no") # for ViSP-third-party.txt - -# library for firewire cameras -IF(USE_DC1394) - #FIND_PACKAGE(DC1394) - if(DC1394_FOUND) - set(VISP_HAVE_DC1394 TRUE) # for header vpConfig.h - - MESSAGE(STATUS "libdc1394-2.x found") - SET(VISP_HAVE_DC1394_2 TRUE) # for header vpConfig.h - SET(VISP_HAVE_DC1394_2_FOUND "yes") # for ViSP-third-party.txt - IF(DC1394_CAMERA_ENUMERATE_FOUND) - SET(VISP_HAVE_DC1394_2_CAMERA_ENUMERATE TRUE) # for header vpConfig.h - ENDIF(DC1394_CAMERA_ENUMERATE_FOUND) - IF(DC1394_FIND_CAMERAS_FOUND) - SET(VISP_HAVE_DC1394_2_FIND_CAMERAS TRUE) # for header vpConfig.h - ENDIF(DC1394_FIND_CAMERAS_FOUND) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${DC1394_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${DC1394_LIBRARY}) - - #MESSAGE("DBG VISP_HAVE_DC1394_2= ${VISP_HAVE_DC1394_2}") - #MESSAGE("DBG DC1394_INCLUDE_DIRS=${DC1394_INCLUDE_DIRS}") - - IF(APPLE) - #SET(VISP_EXTERN_LIBRARIES ${VISP_EXTERN_LIBRARIES} IOkit "-framework Carbon") - LIST(APPEND VISP_EXTERN_LIBRARIES "-framework IOkit -framework Carbon") - ENDIF(APPLE) - #MESSAGE("DC1394_LIBRARIES = ${DC1394_LIBRARIES}") - ELSE(DC1394_FOUND) - MESSAGE(STATUS "libdc1394-2.x not found") - SET(VISP_HAVE_DC1394_2_FOUND "no") # for ViSP-third-party.txt - #MESSAGE("Firewire dc1394 requested but not found. Turn off USE_DC1394!") - # SET(USE_DC1394 OFF) - ENDIF(DC1394_FOUND) -ENDIF(USE_DC1394) - -# library for CMU1394 pan-tilt head -IF(USE_CMU1394) -# FIND_PACKAGE(CMU1394) - IF(CMU1394_FOUND) - MESSAGE(STATUS "CMU1394 found") - SET(VISP_HAVE_CMU1394 TRUE) # for header vpConfig.h - SET(VISP_HAVE_CMU1394_FOUND "yes") # for ViSP-third-party.txt - #MESSAGE("DBG VISP_HAVE_CMU1394= ${VISP_HAVE_CMU1394}") - #MESSAGE("DBG CMU1394_INCLUDE_DIRS=${CMU1394_INCLUDE_DIRS}") - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${CMU1394_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${CMU1394_LIBRARIES}) - #MESSAGE("CMU1394_LIBRARIES = ${CMU1394_LIBRARIES}") - ELSE(CMU1394_FOUND) - MESSAGE(STATUS "CMU1394 not found") - SET(VISP_HAVE_CMU1394_FOUND "no") # for ViSP-third-party.txt - # SET(CMU1394 OFF) - ENDIF(CMU1394_FOUND) -ENDIF(USE_CMU1394) - -# library for Video For Linux Two framegrabber devices -IF(USE_V4L2) - #FIND_PACKAGE(V4L2) - IF(V4L2_FOUND) - MESSAGE(STATUS "V4l2 found") - SET(VISP_HAVE_V4L2 TRUE) # for header vpConfig.h - SET(VISP_HAVE_V4L2_FOUND "yes") # for ViSP-third-party.txt - #MESSAGE("DBG VISP_HAVE_V4L2= ${VISP_HAVE_V4L2}") - #MESSAGE("DBG V4L2_INCLUDE_DIRS=${V4L2_INCLUDE_DIRS}") - #MESSAGE("DBG V4L2_LIBRARIES=${V4L2_LIBRARIES}") - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${V4L2_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${V4L2_LIBRARIES}) - ELSE(V4L2_FOUND) - MESSAGE(STATUS "V4l2 not found") - SET(VISP_HAVE_V4L2_FOUND "no") # for ViSP-third-party.txt - #MESSAGE("Video For Linux Two requested but not found.") - # SET(USE_V4L2 OFF) - ENDIF(V4L2_FOUND) -ENDIF(USE_V4L2) - -# Under Windows, usage of Direct Show -IF(USE_DIRECTSHOW) - #FIND_PACKAGE(DIRECTSHOW) - IF(DIRECTSHOW_FOUND) - MESSAGE(STATUS "DirectShow found") - SET(VISP_HAVE_DIRECTSHOW TRUE) # for header vpConfig.h - SET(VISP_HAVE_DIRECTSHOW_FOUND "yes") # for ViSP-third-party.txt - #MESSAGE("DBG VISP_HAVE_DIRECTSHOW= ${VISP_HAVE_PTU46}") - #MESSAGE("DBG DIRECTSHOW_INCLUDE_DIRS=${DIRECTSHOW_INCLUDE_DIRS}") - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${DIRECTSHOW_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${DIRECTSHOW_LIBRARIES}) - #MESSAGE("DIRECTSHOW_LIBRARIES = ${DIRECTSHOW_LIBRARIES}") - ELSE(DIRECTSHOW_FOUND) - MESSAGE(STATUS "DirectShow not found") - SET(VISP_HAVE_DIRECTSHOW_FOUND "no") # for ViSP-third-party.txt - ENDIF(DIRECTSHOW_FOUND) -ENDIF(USE_DIRECTSHOW) - -#---------------------------------------------------------------------- -# Specific compiler options -#---------------------------------------------------------------------- -# default initialisation -SET(VISP_HAVE_OPENMP_FOUND "no") -SET(VISP_HAVE_CPP11_COMPATIBILITY_FOUND "no") - -IF(USE_OPENMP) - IF(OPENMP_FOUND) - MESSAGE(STATUS "OpenMP found") - SET(VISP_HAVE_OPENMP TRUE) # for header vpConfig.h - SET(VISP_HAVE_OPENMP_FOUND "yes") # for ViSP-third-party.txt - ELSE(OPENMP_FOUND) - MESSAGE(STATUS "OpenMP not found") - SET(VISP_HAVE_OPENMP_FOUND "no") # for ViSP-third-party.txt - ENDIF(OPENMP_FOUND) -ENDIF(USE_OPENMP) - -IF(USE_CPP11) - IF(CPP11_FOUND) - MESSAGE(STATUS "C++11 found") - SET(VISP_HAVE_CPP11_COMPATIBILITY TRUE) # for header vpConfig.h - SET(VISP_HAVE_CPP11_COMPATIBILITY_FOUND "yes") # for ViSP-third-party.txt - ELSE(CPP11_FOUND) - MESSAGE(STATUS "C++11 not found") - SET(VISP_HAVE_CPP11_COMPATIBILITY_FOUND "no") # for ViSP-third-party.txt - ENDIF(CPP11_FOUND) -ENDIF() - - -#---------------------------------------------------------------------- -# The wireframe simulator -#---------------------------------------------------------------------- -# include all the wireframe scene files -INCLUDE(${VISP_SOURCE_DIR}/src/simulator/wireframe-simulator/scene/CMakeWireframeScenesList.cmake) - -SET(WIREFRAME_SCENES_LIST "") -foreach(SCENE ${WIREFRAME_SCENES}) - set(WIREFRAME_SCENES_SRC "${VISP_SOURCE_DIR}/src/simulator/wireframe-simulator/scene/${SCENE}") - set(WIREFRAME_SCENES_DST "${VISP_BINARY_DIR}/data/wireframe-simulator/${SCENE}") - IF(CMAKE_MINOR_VERSION LESS 8 - AND CMAKE_MAJOR_VERSION GREATER 1) - ADD_CUSTOM_COMMAND( - OUTPUT ${WIREFRAME_SCENES_DST} - COMMAND ${CMAKE_COMMAND} -E copy ${WIREFRAME_SCENES_SRC} ${WIREFRAME_SCENES_DST} - DEPENDS ${WIREFRAME_SCENES_SRC} - ) - SET(WIREFRAME_SCENES_LIST ${WIREFRAME_SCENES_LIST} ${WIREFRAME_SCENES_DST}) - ELSE(CMAKE_MINOR_VERSION LESS 8 - AND CMAKE_MAJOR_VERSION GREATER 1) - file(COPY ${WIREFRAME_SCENES_SRC} - DESTINATION data/wireframe-simulator - FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE - OWNER_WRITE - ) - ENDIF(CMAKE_MINOR_VERSION LESS 8 - AND CMAKE_MAJOR_VERSION GREATER 1) -endforeach(SCENE) - -IF(CMAKE_MINOR_VERSION LESS 8 - AND CMAKE_MAJOR_VERSION GREATER 1) - ADD_CUSTOM_TARGET(SCENE ALL - DEPENDS ${WIREFRAME_SCENES_LIST} - ) -ENDIF(CMAKE_MINOR_VERSION LESS 8 - AND CMAKE_MAJOR_VERSION GREATER 1) - - -#---------------------------------------------------------------------- -# Robot simulators -#---------------------------------------------------------------------- -INCLUDE(${VISP_SOURCE_DIR}/src/robot/simulator-robot/arms/CMakeRobotArmsList.cmake) - -SET(ROBOT_ARMS_LIST "") -foreach(SCENE_ROBOT ${ROBOT_ARMS_SCENES}) - set(ROBOT_ARMS_SRC "${VISP_SOURCE_DIR}/src/robot/simulator-robot/arms/${SCENE_ROBOT}") - set(ROBOT_ARMS_DST "${VISP_BINARY_DIR}/data/robot-simulator/${SCENE_ROBOT}") - IF(CMAKE_MINOR_VERSION LESS 8 - AND CMAKE_MAJOR_VERSION GREATER 1) - ADD_CUSTOM_COMMAND( - OUTPUT ${ROBOT_ARMS_DST} - COMMAND ${CMAKE_COMMAND} -E copy ${ROBOT_ARMS_SRC} ${ROBOT_ARMS_DST} - DEPENDS ${ROBOT_ARMS_SRC} - ) - SET(ROBOT_ARMS_LIST ${ROBOT_ARMS_LIST} ${ROBOT_ARMS_DST}) - ELSE(CMAKE_MINOR_VERSION LESS 8 - AND CMAKE_MAJOR_VERSION GREATER 1) - file(COPY ${ROBOT_ARMS_SRC} - DESTINATION data/robot-simulator - FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE - OWNER_WRITE - ) - ENDIF(CMAKE_MINOR_VERSION LESS 8 - AND CMAKE_MAJOR_VERSION GREATER 1) -endforeach(SCENE_ROBOT) - -IF(CMAKE_MINOR_VERSION LESS 8 - AND CMAKE_MAJOR_VERSION GREATER 1) - ADD_CUSTOM_TARGET(SCENE_ROBOT ALL - DEPENDS ${ROBOT_ARMS_LIST} - ) -ENDIF(CMAKE_MINOR_VERSION LESS 8 - AND CMAKE_MAJOR_VERSION GREATER 1) - -#---------------------------------------------------------------------- -# Specific hardware : robots -#---------------------------------------------------------------------- -# default initialisation -SET(VISP_HAVE_AFMA4_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_AFMA6_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_BICLOPS_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_PTU46_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_PIONEER_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_VIPER650_FOUND "no") # for ViSP-third-party.txt -SET(VISP_HAVE_VIPER850_FOUND "no") # for ViSP-third-party.txt - -# library for Irisa's Afma4 cylindrical robot -IF(USE_AFMA4) - # Low level API to control the robot: - # libcalinux - librt - libraw1394 - libirisa -# IF(NOT RAW1394_FOUND) -# FIND_PACKAGE(RAW1394) -# ENDIF(NOT RAW1394_FOUND) -# FIND_PACKAGE(RT) -# FIND_PACKAGE(CALINUX) -# FIND_PACKAGE(IRISA) - IF(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) - MESSAGE(STATUS "Afma4 found") - SET(VISP_HAVE_AFMA4 TRUE) # for header vpConfig.h - SET(VISP_HAVE_AFMA4_FOUND "yes") # for ViSP-third-party.txt - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${RAW1394_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${CALINUX_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${IRISA_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${IRISA_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${CALINUX_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${RAW1394_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${RT_LIBRARIES}) - ELSE(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) - MESSAGE(STATUS "Afma4 not found") - MESSAGE("Afma4 robot requested but not found. Turn off USE_AFMA4 option!") - SET(VISP_HAVE_AFMA4_FOUND "no") # for ViSP-third-party.txt - # SET(USE_AFMA4 OFF) - ENDIF(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) -ENDIF(USE_AFMA4) - -# library for Irisa's Afma6 cartesian robot -IF(USE_AFMA6) - # Low level API to control the robot: - # libcalinux - librt - libraw1394 - libirisa -# IF(NOT RAW1394_FOUND) -# FIND_PACKAGE(RAW1394) -# ENDIF(NOT RAW1394_FOUND) -# FIND_PACKAGE(RT) -# FIND_PACKAGE(CALINUX) -# FIND_PACKAGE(IRISA) - IF(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) - MESSAGE(STATUS "Afma6 found") - SET(VISP_HAVE_AFMA6 TRUE) # for header vpConfig.h - SET(VISP_HAVE_AFMA6_FOUND "yes") # for ViSP-third-party.txt - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${RAW1394_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${CALINUX_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${IRISA_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${IRISA_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${CALINUX_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${RAW1394_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${RT_LIBRARIES}) - ELSE(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) - MESSAGE(STATUS "Afma6 not found") - MESSAGE("Afma6 robot requested but not found. Turn off USE_AFMA6 option!") - SET(VISP_HAVE_AFMA6_FOUND "no") # for ViSP-third-party.txt - # SET(USE_AFMA6 OFF) - ENDIF(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) -ENDIF(USE_AFMA6) - -# library for Irisa's Viper850 arm robot -IF(USE_VIPER850) - # Low level API to control the robot: - # libcalinux - librt - libraw1394 - libirisa -# IF(NOT RAW1394_FOUND) -# FIND_PACKAGE(RAW1394) -# ENDIF(NOT RAW1394_FOUND) -# FIND_PACKAGE(RT) -# FIND_PACKAGE(CALINUX) -# FIND_PACKAGE(IRISA) - IF(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) - MESSAGE(STATUS "Viper850 found") - SET(VISP_HAVE_VIPER850 TRUE) # for header vpConfig.h - SET(VISP_HAVE_VIPER850_FOUND "yes") # for ViSP-third-party.txt - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${RAW1394_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${CALINUX_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${IRISA_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${IRISA_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${CALINUX_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${RAW1394_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${RT_LIBRARIES}) - ELSE(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) - MESSAGE(STATUS "Viper S850 not found") - MESSAGE("Viper S850 robot requested but not found. Turn off USE_VIPER850 option!") - SET(VISP_HAVE_VIPER850_FOUND "no") # for ViSP-third-party.txt - # SET(USE_VIPER850 OFF) - ENDIF(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) -ENDIF(USE_VIPER850) - -# library for Irisa's Viper650 arm robot -IF(USE_VIPER650) - # Low level API to control the robot: - # libcalinux - librt - libraw1394 - libirisa -# IF(NOT RAW1394_FOUND) -# FIND_PACKAGE(RAW1394) -# ENDIF(NOT RAW1394_FOUND) -# FIND_PACKAGE(RT) -# FIND_PACKAGE(CALINUX) -# FIND_PACKAGE(IRISA) - IF(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) - MESSAGE(STATUS "Viper650 found") - SET(VISP_HAVE_VIPER650 TRUE) # for header vpConfig.h - SET(VISP_HAVE_VIPER650_FOUND "yes") # for ViSP-third-party.txt - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${RAW1394_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${CALINUX_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${IRISA_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${IRISA_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${CALINUX_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${RAW1394_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${RT_LIBRARIES}) - ELSE(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) - MESSAGE(STATUS "Viper S650 not found") - MESSAGE("Viper S650 robot requested but not found. Turn off USE_VIPER650 option!") - SET(VISP_HAVE_VIPER650_FOUND "no") # for ViSP-third-party.txt - # SET(USE_VIPER650 OFF) - ENDIF(RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND) -ENDIF(USE_VIPER650) - -# library for Biclops pan-tilt head -IF(USE_BICLOPS) -# FIND_PACKAGE(BICLOPS) - IF(BICLOPS_FOUND) - MESSAGE(STATUS "Biclops found") - SET(VISP_HAVE_BICLOPS TRUE) # for header vpConfig.h - #message("BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION: ${BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION}") - IF(BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION) - SET(VISP_HAVE_BICLOPS_AND_GET_HOMED_STATE_FUNCTION TRUE) # for header vpConfig.h - ENDIF() - SET(VISP_HAVE_BICLOPS_FOUND "yes") # for ViSP-third-party.txt - #MESSAGE("DBG VISP_HAVE_BICLOPS= ${VISP_HAVE_BICLOPS}") - #MESSAGE("DBG BICLOPS_INCLUDE_DIRS=${BICLOPS_INCLUDE_DIRS}") - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${BICLOPS_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${BICLOPS_LIBRARIES}) - #MESSAGE("BICLOPS_LIBRARIES = ${BICLOPS_LIBRARIES}") - ELSE(BICLOPS_FOUND) - MESSAGE(STATUS "Biclops not found") - MESSAGE("Biclops requested but not found. Turn off USE_BICLOPS option!") - SET(VISP_HAVE_BICLOPS_FOUND "no") # for ViSP-third-party.txt - # SET(USE_BICLOPS OFF) - ENDIF(BICLOPS_FOUND) -ENDIF(USE_BICLOPS) - -# library for Ptu-46 pan-tilt head -IF(USE_PTU46) -# FIND_PACKAGE(PTU46) - IF(PTU46_FOUND) - MESSAGE(STATUS "Ptu46 found") - SET(VISP_HAVE_PTU46 TRUE) # for header vpConfig.h - SET(VISP_HAVE_PTU46_FOUND "yes") # for ViSP-third-party.txt - #MESSAGE("DBG VISP_HAVE_PTU46= ${VISP_HAVE_PTU46}") - #MESSAGE("DBG PTU46_INCLUDE_DIRS=${PTU46_INCLUDE_DIRS}") - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${PTU46_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${PTU46_LIBRARIES}) - #MESSAGE("PTU46_LIBRARIES = ${PTU46_LIBRARIES}") - ELSE(PTU46_FOUND) - MESSAGE(STATUS "Ptu46 not found") - MESSAGE("Ptu-46 requested but not found. Turn off USE_PTU46 option!") - SET(VISP_HAVE_PTU46_FOUND "no") # for ViSP-third-party.txt - # SET(USE_PTU46 OFF) - ENDIF(PTU46_FOUND) -ENDIF(USE_PTU46) - -# libraries for Pioneer mobile robots -if(USE_ARIA) - if(UNIX) - # Under Unix we need Aria, pthread, dl and rt libraries - if(ARIA_FOUND AND PTHREAD_FOUND AND RT_FOUND AND DL_FOUND) - message(STATUS "Aria found") - SET(VISP_HAVE_PIONEER TRUE) # for header vpConfig.h - SET(VISP_HAVE_PIONEER_FOUND "yes") # for ViSP-third-party.txt - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${ARIA_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${ARIA_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${PTHREAD_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${RT_LIBRARIES}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${DL_LIBRARIES}) - endif() - else(UNIX) - if(ARIA_FOUND) - message(STATUS "Aria found") - SET(VISP_HAVE_PIONEER TRUE) # for header vpConfig.h - SET(VISP_HAVE_PIONEER_FOUND "yes") # for ViSP-third-party.txt - LIST(APPEND VISP_EXTERN_INCLUDE_DIRS ${ARIA_INCLUDE_DIRS}) - LIST(APPEND VISP_EXTERN_LIBRARIES ${ARIA_LIBRARIES}) - else() - message(STATUS "Aria not found") - endif() - endif(UNIX) -endif() - -if(USE_ZBAR) - set(VISP_HAVE_ZBAR TRUE) # for header vpConfig.h - set(VISP_HAVE_ZBAR_FOUND "yes") # for ViSP-third-party.txt - list(APPEND VISP_EXTERN_INCLUDE_DIRS ${ZBAR_INCLUDE_DIRS}) - list(APPEND VISP_EXTERN_LIBRARIES ${ZBAR_LIBRARIES}) -else() - set(VISP_HAVE_ZBAR_FOUND "no") # for ViSP-third-party.txt -endif() - -if(USE_DMTX) - set(VISP_HAVE_DMTX TRUE) # for header vpConfig.h - set(VISP_HAVE_DMTX_FOUND "yes") # for ViSP-third-party.txt - list(APPEND VISP_EXTERN_INCLUDE_DIRS ${DMTX_INCLUDE_DIRS}) - list(APPEND VISP_EXTERN_LIBRARIES ${DMTX_LIBRARIES}) -else() - set(VISP_HAVE_DMTX_FOUND "no") # for ViSP-third-party.txt -endif() - -#---------------------------------------------------------------------- -# Add definitions -#---------------------------------------------------------------------- -# With Visual Studio 2005, Microsoft deprecates the standard C library, for -# example fopen() and sprintf(), to non-portable functions fopen_s() and -# sprintf_s(). These functions are considered by Microsoft more secure. This is -# a worthwhile exercise ! The use of these deprecated functions causes a lot of -# warnings. To suppress it, we add the _CRT_SECURE_NO_DEPRECATE preprocessor -# definition -if(WIN32 AND MSVC) - add_definitions("-D_CRT_SECURE_NO_DEPRECATE") -endif() - -#MESSAGE("Definitions: ${VISP_DEFS}") -IF(VISP_DEFS) - LIST(REMOVE_DUPLICATES VISP_DEFS) -ENDIF(VISP_DEFS) -#MESSAGE("Definitions without duplicates: ${VISP_DEFS}") -add_definitions(${VISP_DEFS}) - -#---------------------------------------------------------------------- -# Add intern and third party include dirs -#---------------------------------------------------------------------- -#MESSAGE("VISP_EXTERN_INCLUDE_DIRS: ${VISP_EXTERN_INCLUDE_DIRS}") -IF(VISP_EXTERN_INCLUDE_DIRS) - LIST(REMOVE_DUPLICATES VISP_EXTERN_INCLUDE_DIRS) -ENDIF(VISP_EXTERN_INCLUDE_DIRS) -#MESSAGE("VISP_INTERN_INCLUDE_DIR: ${VISP_INTERN_INCLUDE_DIR}") -#MESSAGE("VISP_EXTERN_INCLUDE_DIRS: ${VISP_EXTERN_INCLUDE_DIRS}") -include_directories(BEFORE ${VISP_INTERN_INCLUDE_DIR}) -include_directories(${VISP_EXTERN_INCLUDE_DIRS}) - -#---------------------------------------------------------------------- -# Use statically or dynamically linked CRT? -# Default: dynamic -#---------------------------------------------------------------------- -if(MSVC) - include(${VISP_CMAKE_MODULE_PATH}/VISPCRTLinkage.cmake) -endif(MSVC) - -#---------------------------------------------------------------------- -# Platform specific -#---------------------------------------------------------------------- -include(${VISP_CMAKE_MODULE_PATH}/VISPDetectPlatform.cmake) - -# Set the path where to install the lib -if(WIN32) - if(DEFINED VISP_RUNTIME AND DEFINED VISP_ARCH) - set(VISP_INSTALL_BINARIES_PREFIX "${VISP_ARCH}/${VISP_RUNTIME}/") - else() - message(STATUS "Can't detect runtime and/or arch") - set(VISP_INSTALL_BINARIES_PREFIX "") - endif() -else() - set(VISP_INSTALL_BINARIES_PREFIX "") -endif() - -# where to install the library -if(WIN32) - if(VISP_STATIC) - set(VISP_LIB_INSTALL_PATH "${VISP_INSTALL_BINARIES_PREFIX}static${CMAKE_INSTALL_LIBDIR}") - else() - set(VISP_LIB_INSTALL_PATH "${VISP_INSTALL_BINARIES_PREFIX}${CMAKE_INSTALL_LIBDIR}") - endif() - set(VISP_BIN_INSTALL_PATH "${VISP_INSTALL_BINARIES_PREFIX}${CMAKE_INSTALL_BINDIR}") -else() - set(VISP_LIB_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}) - set(VISP_BIN_INSTALL_PATH ${CMAKE_INSTALL_BINDIR}) -endif() - -#---------------------------------------------------------------------- -# Cleanify the libraries list -#---------------------------------------------------------------------- -IF(APPLE) - LIST(REMOVE_DUPLICATES VISP_EXTERN_LIBRARIES) -ENDIF() - -#---------------------------------------------------------------------- -# customize clean target -#---------------------------------------------------------------------- -INCLUDE(${VISP_SOURCE_DIR}/CMakeHeaderFileList.cmake) - -SET(FILE_TO_CLEAN "core*;*~;gmon.out;DartTestfile.txt") -FOREACH(header ${HEADER_ALL}) - GET_FILENAME_COMPONENT(headerName ${header} NAME) - LIST(APPEND FILE_TO_CLEAN ${CMAKE_SOURCE_DIR}/include/visp/${headerName}) -ENDFOREACH(header) - -SET_DIRECTORY_PROPERTIES(PROPERTIES - ADDITIONAL_MAKE_CLEAN_FILES "${FILE_TO_CLEAN}" -) - -#---------------------------------------------------------------------- -# Propagation in src to build the library -#---------------------------------------------------------------------- -add_subdirectory(src) - -#---------------------------------------------------------------------- -# Configure the files that depend on the build <binary dir> or -# installation <install dir> usage. This is the case of: -# vpConfig.h -#---------------------------------------------------------------------- - -# case 1: when ViSP is build with make; files are used in <binary dir> -#-------------- -set(VISP_ROOT_DIR_DATA_CONFIGCMAKE "${VISP_BINARY_DIR}") - -SET(VISP_SCENES_DIR ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/wireframe-simulator) -SET(VISP_ROBOT_ARMS_DIR ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/robot-simulator) - -# Generate the package dependent file include/visp/vpConfig.h -CONFIGURE_FILE(${VISP_SOURCE_DIR}/include/vpConfig.h.cmake - ${VISP_INCLUDE_DIR}/vpConfig.h -) - -# case 2: when ViSP is build with make install; files are used in <install dir> -#-------------- -IF(UNIX) - set(VISP_ROOT_DIR_DATA_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}") -ELSE() - set(VISP_ROOT_DIR_DATA_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}") -ENDIF() - -SET(VISP_SCENES_DIR ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/wireframe-simulator) -SET(VISP_ROBOT_ARMS_DIR ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/robot-simulator) -# Only if resources.cfg created by hand, we change the path to resources.cfg in install/vpConfig.h -if(VISP_INSTALL_DIR_OGRE_RESOURCES) - SET(VISP_HAVE_OGRE_RESOURCES_PATH ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/ogre-simulator) -endif() -# Only if plugins.cfg created by hand, we change the path to plugins.cfg in install/vpConfig.h -if(VISP_INSTALL_DIR_OGRE_RESOURCES) - SET(VISP_HAVE_OGRE_PLUGINS_PATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/visp/data/ogre-simulator) -endif() - -#---------------------------------------------------------------------- -# Generate the ViSP-third-party.txt information file -#---------------------------------------------------------------------- -CONFIGURE_FILE(${VISP_SOURCE_DIR}/ViSP-third-party.txt.cmake - ${VISP_BINARY_DIR}/ViSP-third-party.txt -) - -#---------------------------------------------------------------------- -# Create and install visp-config.1.gz man page -#---------------------------------------------------------------------- -if(UNIX) - FIND_PROGRAM(GZIP gzip) - file(MAKE_DIRECTORY ${VISP_BINARY_DIR}/doc/man/man1) - ADD_CUSTOM_COMMAND( - OUTPUT ${VISP_BINARY_DIR}/doc/man/man1/visp-config.1.gz - COMMAND ${GZIP} --best -c ${CMAKE_CURRENT_SOURCE_DIR}/doc/man/man1/visp-config.1 > ${VISP_BINARY_DIR}/doc/man/man1/visp-config.1.gz - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/doc/man/man1/visp-config.1 - ) - ADD_CUSTOM_TARGET(man ALL - DEPENDS ${VISP_BINARY_DIR}/doc/man/man1/visp-config.1.gz - ) - INSTALL(FILES - ${VISP_BINARY_DIR}/doc/man/man1/visp-config.1.gz - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/man/man1 - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - MARK_AS_ADVANCED(GZIP) -endif() - -#---------------------------------------------------------------------- -# Export the library -#---------------------------------------------------------------------- -# we need to adapt VISP_SCENES_DIR and VISP_ROBOT_ARMS_DIR -# here set to /usr/share/visp/data -if(UNIX) - foreach(SCENE ${WIREFRAME_SCENES}) - install(FILES - "${VISP_SOURCE_DIR}/src/simulator/wireframe-simulator/scene/${SCENE}" - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/data/wireframe-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - endforeach() - foreach(SCENE ${ROBOT_ARMS_SCENES}) - install(FILES - "${VISP_SOURCE_DIR}/src/robot/simulator-robot/arms/${SCENE}" - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/data/robot-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - endforeach() -else() - foreach(SCENE ${WIREFRAME_SCENES}) - install(FILES - "${VISP_SOURCE_DIR}/src/simulator/wireframe-simulator/scene/${SCENE}" - DESTINATION data/wireframe-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - endforeach() - foreach(SCENE ${ROBOT_ARMS_SCENES}) - install(FILES - "${VISP_SOURCE_DIR}/src/robot/simulator-robot/arms/${SCENE}" - DESTINATION data/robot-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries - ) - endforeach() -endif() - -#---------------------------------------------------------------------- -# For CPack packaging tool -#---------------------------------------------------------------------- - -option(BUILD_PACKAGE "Configure ViSP packaging" OFF) -if (BUILD_PACKAGE) - if(UNIX AND NOT APPLE AND NOT WIN32) # =linux - option(BUILD_PACKAGE_DEBIAN "Build debian package" ON) - option(BUILD_PACKAGE_RPM "Build rpm package" ON) - endif() - - include (${VISP_SOURCE_DIR}/CMakeModules/CPackConfig.cmake) -endif(BUILD_PACKAGE) - -#---------------------------------------------------------------------- -# Configure the file describing how to use ViSP. VISPConfig.cmake -# is the main file configuring a CMake package. -# . Exports build settings and dependencies for projects using ViSP as a -# third party project. -# . Create and install files for simple use of find_package(VISP) -# by other cmakified "user" projects and libraries depending on ViSP. -# (see "Mastering CMake", pp.72) -# . To use ViSP in a third party project based on CMake: -# find_package(VISP REQUIRED) -# include_directories(${VISP_INCLUDE_DIRS}) -# target_link_libraries(<target> ${VISP_LIBRARIES}) -#---------------------------------------------------------------------- -include(${VISP_CMAKE_MODULE_PATH}/VISPGenerateConfig.cmake) - -#---------------------------------------------------------------------- -# Generate the package dependent visp-config shell script for projects which -# are not using CMake: -# Usage: -# visp-config --cflags ... -#---------------------------------------------------------------------- -include(${VISP_CMAKE_MODULE_PATH}/VISPGeneratePkgConfigScript.cmake) - -#---------------------------------------------------------------------- -# Propagation in sub dirs to build demo, example, test, tutorial -#---------------------------------------------------------------------- -if(BUILD_TESTS) - #---------------------------------------------------------------------- - # For Dart server and tests - # We use CDash set through CTestConfig.cmake file - # Dashboards are sent to http://cdash.irisa.fr/CDash/index.php?project=ViSP - #---------------------------------------------------------------------- - enable_testing() - include(Dart) - mark_as_advanced(DART_ROOT) - mark_as_advanced(BUILD_TESTING) - # - # Test coverage specific code - # - if(CMAKE_COMPILER_IS_GNUCXX AND NOT BUILD_SHARED_LIBS AND CMAKE_BUILD_TYPE MATCHES "Debug") - option(BUILD_TEST_COVERAGE "Enable test coverage." OFF) - endif() - - if(BUILD_TEST_COVERAGE) - # Add build options for test coverage. Currently coverage is only supported - # on gcc compiler - # Because using -fprofile-arcs with shared lib can cause problems like: - # hidden symbol `__bb_init_func', we add this option only for static - # library build - message(STATUS "Add -ftest-coverage -fprofile-arcs compiler options") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs") - endif() - - add_subdirectory(test) -endif() - -if(BUILD_DEMOS) - add_subdirectory(demo) -endif() -if(BUILD_EXAMPLES) - add_subdirectory(example) -endif() -if(BUILD_TUTORIALS) - set(VISP_DIR ${PROJECT_BINARY_DIR}) - mark_as_advanced(VISP_DIR) - mark_as_advanced(VISP_INCLUDE_DIRS) - add_subdirectory(tutorial) -endif() +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP overall configuration file. Detect third party libraries (X11, GTK, ...) +# +# Authors: +# Fabien Spindler +# +############################################################################# + +# Need to be befor project(VISP) to work +if(WIN32) + set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "Installation Directory") +endif() + +project(VISP C CXX) + +cmake_minimum_required(VERSION 2.8.3) + +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") + +include(cmake/VISPUtils.cmake) + +vp_clear_vars(VISPModules_TARGETS) + +#----------------------------------------------------------------------------- +# VISP version number. An even minor number corresponds to releases. +set(VISP_VERSION_MAJOR "3") +set(VISP_VERSION_MINOR "0") +set(VISP_VERSION_PATCH "0") +set(VISP_VERSION "${VISP_VERSION_MAJOR}.${VISP_VERSION_MINOR}.${VISP_VERSION_PATCH}") +# Package revision number +set(VISP_REVISION "1") + +find_file(GNU_INSTALL_DIRS_FROM_CMAKE NAMES GNUInstallDirs.cmake PATHS ${CMAKE_ROOT}/Modules) +mark_as_advanced(GNU_INSTALL_DIRS_FROM_CMAKE) +if(GNU_INSTALL_DIRS_FROM_CMAKE) + include(${CMAKE_ROOT}/Modules/GNUInstallDirs.cmake) +else() + include(cmake/GNUInstallDirs.cmake) +endif() + +# the include directory we depend on +set(VISP_INCLUDE_DIR ${VISP_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}) +set(VISP_DOC_DIR "${VISP_BINARY_DIR}/doc") + +# The location in which to install VISP libraries. +set(LIBRARY_OUTPUT_PATH ${VISP_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) +# The location in which to install some VISP binaries. +set(BINARY_OUTPUT_PATH ${VISP_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) + +include_directories(${VISP_BINARY_DIR}/include) + +if(WIN32) + # Postfix of .lib and .dll + set(VISP_DEBUG_POSTFIX "d") + set(VISP_DLLVERSION "${VISP_VERSION_MAJOR}${VISP_VERSION_MINOR}${VISP_VERSION_PATCH}") +else() + set(VISP_DEBUG_POSTFIX "") + set(VISP_DLLVERSION "") +endif() + +# ---------------------------------------------------------------------------- +# Handle always full RPATH +# http://www.cmake.org/Wiki/CMake_RPATH_handling +# ---------------------------------------------------------------------------- + +# avoid CMP0042 warning +if(APPLE) + set(CMAKE_MACOSX_RPATH ON) +endif() + +# use, i.e. don't skip the full RPATH for the build tree +set(CMAKE_SKIP_BUILD_RPATH FALSE) + +# when building, don't use the install RPATH already +# (but later on when installing) +set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) + +set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + +# add the automatically determined parts of the RPATH +# which point to directories outside the build tree to the install RPATH +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + +# the RPATH to be used when installing, but only if it's not a system directory +list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir) +if("${isSystemDir}" STREQUAL "-1") + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +endif("${isSystemDir}" STREQUAL "-1") + +# ---------------------------------------------------------------------------- +# Path for additional contrib modules +# ---------------------------------------------------------------------------- +set(VISP_CONTRIB_MODULES_PATH "" CACHE PATH "Where to look for additional contrib ViSP modules") + +# Get the OS +set(OS ${CMAKE_SYSTEM_NAME}) + +set(OGRE_HOME $ENV{OGRE_HOME}) +if(OGRE_HOME) + # replace \ with / especially for windows + STRING(REGEX REPLACE "\\\\" "/" OGRE_HOME ${OGRE_HOME}) +endif() + +# add the path to detect Ogre3D +if(WIN32) + list(APPEND CMAKE_MODULE_PATH "${OGRE_HOME}/CMake") +endif(WIN32) + +if(UNIX) + list(APPEND CMAKE_MODULE_PATH "${OGRE_HOME}/cmake") + list(APPEND CMAKE_MODULE_PATH "${OGRE_HOME}/CMake") + list(APPEND CMAKE_MODULE_PATH "/usr/local/lib/OGRE/cmake") + list(APPEND CMAKE_MODULE_PATH "/usr/lib/OGRE/cmake") + list(APPEND CMAKE_MODULE_PATH "/usr/local/lib64/OGRE/cmake") + list(APPEND CMAKE_MODULE_PATH "/usr/lib64/OGRE/cmake") + list(APPEND CMAKE_MODULE_PATH "/usr/share/OGRE/cmake/modules") +endif(UNIX) + +#-------------------------------------------------------------------- +# Option management +#-------------------------------------------------------------------- + +# Choose static or shared libraries. +VP_OPTION(BUILD_SHARED_LIBS "" "" "Build ViSP shared libraries (.dll/.so) instead of static ones (.lib/.a)" "" ON) +# Build examples as an option. +VP_OPTION(BUILD_EXAMPLES "" "" "Build ViSP examples" "" ON) +# Build examples as an option. +VP_OPTION(BUILD_TESTS "" "" "Build ViSP tests" "" ON) +VP_OPTION(BUILD_COVERAGE "" "" "Enables test coverage" "" OFF IF (BUILD_TESTS AND CMAKE_COMPILER_IS_GNUCXX AND NOT BUILD_SHARED_LIBS AND CMAKE_BUILD_TYPE MATCHES "Debug")) + +# Build demos as an option. +VP_OPTION(BUILD_DEMOS "" "" "Build ViSP demos" "" ON) +# Build demos as an option. +VP_OPTION(BUILD_TUTORIALS "" "" "Build ViSP tutorials" "" ON) +# Build deprecated functions as an option. +VP_OPTION(BUILD_DEPRECATED_FUNCTIONS "" "" "Build deprecated functionalities" "" ON) +# Debug and trace cflags +VP_OPTION(ACTIVATE_DEBUG_TRACE "" "" "Enable debug and trace printings" "" ON) + +VP_OPTION(BUILD_WITH_STATIC_CRT "" "" "Enables use of staticaly linked CRT for staticaly linked ViSP" "" ON IF MSVC) + +# Note that it is better to set MOMENTS_COMBINE_MATRICES to OFF +VP_OPTION(MOMENTS_COMBINE_MATRICES "" "" "Use linear combination of matrices instead of linear combination of moments to compute interaction matrices." "MOMENTS_COMBINE_MATRICES" OFF) +VP_OPTION(ENABLE_TEST_WITHOUT_DISPLAY "" "" "Don't use display features when testing" "ENABLE_TEST_WITHOUT_DISPLAY" ON) + +if(ENABLE_TEST_WITHOUT_DISPLAY) + set(OPTION_TO_DESACTIVE_DISPLAY "-d") +endif() + +# Check for Inria's robot drivers +VP_CHECK_PACKAGE(RAW1394) +VP_CHECK_PACKAGE(RT) +VP_CHECK_PACKAGE(CALINUX) +VP_CHECK_PACKAGE(IRISA) +# Try to determine if Inria's NAS server hosting /udd/ is available +VP_CHECK_PACKAGE(NAS) +# check for linux/parport.h +VP_CHECK_PACKAGE(PARPORT) +# Find IsNaN +VP_CHECK_PACKAGE(IsNaN) +# Find IsInf +VP_CHECK_PACKAGE(IsInf) +# Find Round +VP_CHECK_PACKAGE(Round) +# OpenGL +VP_CHECK_PACKAGE(OpenGL) +# for pioneer +VP_CHECK_PACKAGE(RT) +VP_CHECK_PACKAGE(DL) + +VP_OPTION(USE_AFMA4 "" "" "Include Afma4 robot support" "" ON IF (RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND)) +VP_OPTION(USE_AFMA6 "" "" "Include Afma6 robot support" "" ON IF (RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND)) +VP_OPTION(USE_VIPER650 "" "" "Include Viper s650 robot support" "" ON IF (RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND)) +VP_OPTION(USE_VIPER850 "" "" "Include Viper s850 robot support" "" ON IF (RAW1394_FOUND AND RT_FOUND AND CALINUX_FOUND AND IRISA_FOUND)) +VP_OPTION(USE_DC1394 DC1394 "" "Include dc1394 support" "" ON IF UNIX) +VP_OPTION(USE_V4L2 V4L2 "" "Include v4l2 support" "" ON IF UNIX) +VP_OPTION(USE_BICLOPS BICLOPS "" "Include biclops support" "" ON IF UNIX) +VP_OPTION(USE_PTU46 PTU46 "" "Include ptu-46 support" "" ON IF UNIX) +VP_OPTION(USE_CMU1394 CMU1394 "" "Include cmu1494 support" "" ON IF WIN32) +VP_OPTION(USE_GDI GDI "" "Include gdi support" "" ON IF WIN32) +VP_OPTION(USE_DIRECT3D DIRECT3D "" "Include d3d support" "" ON IF WIN32) +VP_OPTION(USE_DIRECTSHOW DIRECTSHOW "" "Include dshow support" "" ON IF WIN32) +VP_OPTION(USE_OPENMP OpenMP "" "Include openmp support" "" ON) +VP_OPTION(USE_CPP11 CPP11 "" "Include c++11 support" "" OFF) +# Since the FindLAPACK.cmake provided with CMake is for Fortran language, +# in CMakeModules we have added FindLAPACK_C.cmake for C language +VP_OPTION(USE_LAPACK LAPACK_C "" "Include lapack support" "" ON) +VP_OPTION(USE_GSL GSL "" "Include gsl support" "" ON) +VP_OPTION(USE_COIN3D "Coin3D;MyCoin3D" "" "Include coin3d support" "" ON IF OPENGL_FOUND) +VP_OPTION(USE_YARP YARP QUIET "Include yarp support" "YARP_DIR" ON) +VP_OPTION(USE_OGRE OGRE QUIET "Include Ogre support" "OGRE_DIR" ON) +VP_OPTION(USE_OIS OIS QUIET "Include Ogre/ois support" "OIS_DIR" ON IF USE_OGRE) +VP_OPTION(USE_LIBFREENECT LIBFREENECT "" "Include libfreenect support" "" ON) +VP_OPTION(USE_LIBUSB_1 LIBUSB_1 "" "Include libusb-1 support" "" ON) +VP_OPTION(USE_SOWIN SOWIN "" "Include Coin/SoWin support" "" OFF IF (WIN32 AND USE_COIN3D)) +VP_OPTION(USE_SOQT SOQT "" "Include Coin/SoQt support" "" OFF IF USE_COIN3D) +VP_OPTION(USE_QT Qt "" "Include Coin/SoQt/Qt support" "" ON IF USE_SOQT) +VP_OPTION(USE_SOXT SOXT "" "Include Coin/SoXt support" "" OFF IF USE_COIN3D) +VP_OPTION(USE_PTHREAD PTHREAD "" "Include pthread support" "" ON) +VP_OPTION(USE_XML2 XML2 "" "Include xml support" "" ON) +VP_OPTION(USE_OPENCV OpenCV QUIET "Include OpenCV support" "OpenCV_DIR;OpenCV_FOUND;OPENCV_FOUND" ON) +VP_OPTION(USE_ZLIB "ZLIB;MyZLIB" "" "Include zlib support" "" ON) +VP_OPTION(USE_X11 X11 "" "Include X11 support" "" ON) +# The native FindGTK2.cmake doesn't consider libgobject-2.0 that is +# requested by ViSP. That's why we use our FindMyGTK2.cmake +VP_OPTION(USE_GTK2 MyGTK2 "" "Include gtk2 support" "" OFF) +VP_OPTION(USE_JPEG "JPEG;MyJPEG" "" "Include jpeg support" "" ON) +VP_OPTION(USE_PNG "PNG;MyPNG" "" "Include png support" "" ON) +VP_OPTION(USE_FFMPEG FFMPEG "" "Include ffmpeg support" "" OFF) +# To control Pioneer mobile robots, under UNIX we need Aria, pthread, rt and dl 3rd party libraries +VP_OPTION(USE_ARIA ARIA "" "Include aria support" "" ON) +#VP_OPTION(USE_RT RT "" "Include rt support" "" ON) +#VP_OPTION(USE_DL DL "" "Include dl support" "" ON) +# bar codes +VP_OPTION(USE_ZBAR ZBAR "" "Include zbar support" "" ON) +VP_OPTION(USE_DMTX DMTX "" "Include dmtx support" "" ON) + +#---------------------------------------------------------------------- +# For Dart server and tests +# We use CDash set through CTestConfig.cmake file +# Dashboards are sent to http://cdash.irisa.fr/CDash/index.php?project=ViSP +#---------------------------------------------------------------------- +if(BUILD_TESTS) + enable_testing() + mark_as_advanced(DART_ROOT) + mark_as_advanced(BUILD_TESTING) +endif() + +#---------------------------------------------------------------------- +# Try to find doxygen for documentation generation +# Use "make visp_doc" target to generate the documentation +#---------------------------------------------------------------------- +find_package(Doxygen) +if(DOXYGEN_FOUND) + set(VISP_HAVE_DOXYGEN "yes") # for header vpConfig.h + set(VISP_HAVE_DOXYGEN_FOUND "yes") # for ViSP-third-party.txt + ## we need latex for doxygen because of the formulas + find_package(LATEX) + if(NOT LATEX_COMPILER) + message(STATUS "latex command LATEX_COMPILER not found but usually required. You will probably get warnings and user interaction on doxy run.") + endif() + if(NOT MAKEINDEX_COMPILER) + message(STATUS "makeindex command MAKEINDEX_COMPILER not found but usually required.") + endif() + if(NOT DVIPS_CONVERTER) + message(STATUS "dvips command DVIPS_CONVERTER not found but usually required.") + endif() + + configure_file(${VISP_SOURCE_DIR}/doc/config-doxygen.in + ${VISP_DOC_DIR}/config-doxygen + @ONLY ) + + configure_file(${VISP_SOURCE_DIR}/doc/mainpage.doc.in + ${VISP_DOC_DIR}/mainpage.doc + @ONLY ) +else() + set(VISP_HAVE_DOXYGEN "no") # for header vpConfig.h + set(VISP_HAVE_DOXYGEN_FOUND "no") # for ViSP-third-party.txt +endif() + +# ---------------------------------------------------------------------------- +# Solution folders: +# ---------------------------------------------------------------------------- +if(MSVC_IDE OR CMAKE_GENERATOR MATCHES Xcode) + option(ENABLE_SOLUTION_FOLDERS "Solution folder in Visual Studio or in other IDEs" ON) +endif() + +if(ENABLE_SOLUTION_FOLDERS) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets") +endif() + +# Extra ViSP targets: uninstall, etc. +include(cmake/VISPExtraTargets.cmake) + +include(CheckLibraryExists) + +# ---------------------------------------------------------------------------- +# Check for system libs +# ---------------------------------------------------------------------------- +if(UNIX) + # try to found -lm requested on some platforms to link with X11 + find_library(M_LIBRARY NAMES m) + mark_as_advanced(M_LIBRARY) + if(M_LIBRARY) + list(APPEND VISP_LINKER_LIBS ${M_LIBRARY}) + endif() + # try to found -lsocket -lnsl requested for vpNetwork and vpSickLDMRS + find_library(SOCKET_LIBRARY NAMES socket) + find_library(NSL_LIBRARY NAMES nsl) + mark_as_advanced(SOCKET_LIBRARY NSL_LIBRARY) + if (SOCKET_LIBRARY) + list(APPEND VISP_LINKER_LIBS ${SOCKET_LIBRARY}) + endif() + if (NSL_LIBRARY) + list(APPEND VISP_LINKER_LIBS ${NSL_LIBRARY}) + endif() +endif() + +#---------------------------------------------------------------------- +# Add definitions +#---------------------------------------------------------------------- +# With Visual Studio 2005, Microsoft deprecates the standard C library, for +# example fopen() and sprintf(), to non-portable functions fopen_s() and +# sprintf_s(). These functions are considered by Microsoft more secure. This is +# a worthwhile exercise ! The use of these deprecated functions causes a lot of +# warnings. To suppress it, we add the _CRT_SECURE_NO_DEPRECATE preprocessor +# definition +if(WIN32 AND MSVC) + add_definitions("-D_CRT_SECURE_NO_DEPRECATE") +endif() + +#---------------------------------------------------------------------- +# Use statically or dynamically linked CRT? +# Default: dynamic +#---------------------------------------------------------------------- +if(MSVC) + include(cmake/VISPCRTLinkage.cmake) +endif(MSVC) + +#---------------------------------------------------------------------- +# Platform specific +#---------------------------------------------------------------------- +include(cmake/VISPDetectPlatform.cmake) + +# Set the path where to install the lib +if(WIN32) + if(DEFINED VISP_RUNTIME AND DEFINED VISP_ARCH) + set(VISP_INSTALL_BINARIES_PREFIX "${VISP_ARCH}/${VISP_RUNTIME}/") + else() + message(STATUS "Can't detect runtime and/or arch") + set(VISP_INSTALL_BINARIES_PREFIX "") + endif() +else() + set(VISP_INSTALL_BINARIES_PREFIX "") +endif() + +# where to install the library +if(WIN32) + if(VISP_STATIC) + set(VISP_LIB_INSTALL_PATH "${VISP_INSTALL_BINARIES_PREFIX}static${CMAKE_INSTALL_LIBDIR}") + else() + set(VISP_LIB_INSTALL_PATH "${VISP_INSTALL_BINARIES_PREFIX}${CMAKE_INSTALL_LIBDIR}") + endif() + set(VISP_BIN_INSTALL_PATH "${VISP_INSTALL_BINARIES_PREFIX}${CMAKE_INSTALL_BINDIR}") +else() + set(VISP_LIB_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}) + set(VISP_BIN_INSTALL_PATH ${CMAKE_INSTALL_BINDIR}) +endif() + + +#---------------------------------------------------------------------- +# Configure the files that depend on the build <binary dir> or +# installation <install dir> usage. This is the case of: +# vpConfig.h +#---------------------------------------------------------------------- + +# case 1: when ViSP is build with make; files are used in <binary dir> +#-------------- +set(VISP_ROOT_DIR_DATA_CONFIGCMAKE "${VISP_BINARY_DIR}") + +set(VISP_SCENES_DIR ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/wireframe-simulator) +set(VISP_ROBOT_ARMS_DIR ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/robot-simulator) + +# case 2: when ViSP is build with make install; files are used in <install dir> +#-------------- +IF(UNIX) + set(VISP_ROOT_DIR_DATA_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}") +ELSE() + set(VISP_ROOT_DIR_DATA_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}") +ENDIF() + +list(APPEND VISP_SCENES_DIR ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/wireframe-simulator) +list(APPEND VISP_ROBOT_ARMS_DIR ${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/robot-simulator) +# Only if resources.cfg created by hand, we change the path to resources.cfg in install/vpConfig.h +if(VISP_INSTALL_DIR_OGRE_RESOURCES) + list(APPEND VISP_HAVE_OGRE_RESOURCES_PATH "${VISP_ROOT_DIR_DATA_CONFIGCMAKE}/data/ogre-simulator") +endif() +# append to VISP_HAVE_OGRE_PLUGINS_PATH the path of the installed plugins.cfg file +# to be able to use ViSP from build tree or install tree +if(VISP_INSTALL_DIR_OGRE_RESOURCES) + list(APPEND VISP_HAVE_OGRE_PLUGINS_PATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/visp/data/ogre-simulator") +endif() + +#---------------------------------------------------------------------- +# Create and install visp-config.1.gz man page +#---------------------------------------------------------------------- +if(UNIX) + FIND_PROGRAM(GZIP gzip) + file(MAKE_DIRECTORY ${VISP_BINARY_DIR}/doc/man/man1) + ADD_CUSTOM_COMMAND( + OUTPUT ${VISP_BINARY_DIR}/doc/man/man1/visp-config.1.gz + COMMAND ${GZIP} --best -c ${CMAKE_CURRENT_SOURCE_DIR}/doc/man/man1/visp-config.1 > ${VISP_BINARY_DIR}/doc/man/man1/visp-config.1.gz + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/doc/man/man1/visp-config.1 + ) + ADD_CUSTOM_TARGET(man ALL + DEPENDS ${VISP_BINARY_DIR}/doc/man/man1/visp-config.1.gz + ) + INSTALL(FILES + ${VISP_BINARY_DIR}/doc/man/man1/visp-config.1.gz + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/man/man1 + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + COMPONENT dev + ) + MARK_AS_ADVANCED(GZIP) +endif() + +#---------------------------------------------------------------------- +# Modules +#---------------------------------------------------------------------- +include(cmake/VISPModule.cmake) + +# process subdirectories +add_subdirectory(modules) + +#----------------------------------------------------------------------------- +# Add extra compilation flags under UNIX +#----------------------------------------------------------------------------- +include(cmake/AddExtraCompilationFlags.cmake) # should be called after FindOpenMP +vp_add_extra_compilation_flags() + +#------------------------------------------------------------------------------- +# specific things that need to be updated in vpConfig.h and ViSP-third-party.txt +#------------------------------------------------------------------------------- +VP_SET(VISP_HAVE_OPENMP TRUE IF USE_OPENMP) +VP_SET(VISP_HAVE_OPENCV TRUE IF (BUILD_MODULE_visp_core AND USE_OPENCV)) +VP_SET(VISP_HAVE_X11 TRUE IF (BUILD_MODULE_visp_core AND USE_X11)) +VP_SET(VISP_HAVE_GTK TRUE IF (BUILD_MODULE_visp_core AND USE_GTK2)) +VP_SET(VISP_HAVE_GDI TRUE IF (BUILD_MODULE_visp_core AND USE_GDI)) +VP_SET(VISP_HAVE_D3D9 TRUE IF (BUILD_MODULE_visp_core AND USE_DIRECT3D)) +VP_SET(VISP_HAVE_JPEG TRUE IF (BUILD_MODULE_visp_core AND USE_JPEG)) +VP_SET(VISP_HAVE_PNG TRUE IF (BUILD_MODULE_visp_core AND USE_PNG)) +VP_SET(VISP_HAVE_YARP TRUE IF (BUILD_MODULE_visp_core AND USE_YARP)) +VP_SET(VISP_HAVE_GSL TRUE IF (BUILD_MODULE_visp_core AND USE_GSL)) +VP_SET(VISP_HAVE_LAPACK_C TRUE IF (BUILD_MODULE_visp_core AND USE_LAPACK)) +VP_SET(VISP_HAVE_PTHREAD TRUE IF (BUILD_MODULE_visp_core AND USE_PTHREAD)) +VP_SET(VISP_HAVE_XML2 TRUE IF (BUILD_MODULE_visp_core AND USE_XML2)) +VP_SET(VISP_HAVE_FFMPEG TRUE IF (BUILD_MODULE_visp_core AND USE_FFMPEG)) + +VP_SET(VISP_HAVE_OGRE TRUE IF (BUILD_MODULE_visp_ar AND USE_OGRE)) +VP_SET(VISP_HAVE_OIS TRUE IF (BUILD_MODULE_visp_ar AND USE_OIS)) +VP_SET(VISP_HAVE_COIN3D TRUE IF (BUILD_MODULE_visp_ar AND USE_COIN3D)) +VP_SET(VISP_HAVE_SOWIN TRUE IF (BUILD_MODULE_visp_ar AND USE_SOWIN)) +VP_SET(VISP_HAVE_SOXT TRUE IF (BUILD_MODULE_visp_ar AND USE_SOXT)) +VP_SET(VISP_HAVE_SOQT TRUE IF (BUILD_MODULE_visp_ar AND USE_SOQT)) +VP_SET(VISP_HAVE_QT TRUE IF (BUILD_MODULE_visp_ar AND USE_QT)) + +VP_SET(VISP_HAVE_ZBAR TRUE IF (BUILD_MODULE_visp_detection AND USE_ZBAR)) +VP_SET(VISP_HAVE_DMTX TRUE IF (BUILD_MODULE_visp_detection AND USE_DMTX)) + +VP_SET(VISP_HAVE_AFMA4 TRUE IF (BUILD_MODULE_visp_robot AND USE_AFMA4)) +VP_SET(VISP_HAVE_AFMA6 TRUE IF (BUILD_MODULE_visp_robot AND USE_AFMA6)) +VP_SET(VISP_HAVE_VIPER650 TRUE IF (BUILD_MODULE_visp_robot AND USE_VIPER650)) +VP_SET(VISP_HAVE_VIPER850 TRUE IF (BUILD_MODULE_visp_robot AND USE_VIPER850)) +VP_SET(VISP_HAVE_BICLOPS TRUE IF (BUILD_MODULE_visp_robot AND USE_BICLOPS)) +VP_SET(VISP_HAVE_PTU46 TRUE IF (BUILD_MODULE_visp_robot AND USE_PTU46)) +#VP_SET(VISP_HAVE_PIONEER TRUE IF (BUILD_MODULE_visp_robot AND USE_ARIA)) +if(BUILD_MODULE_visp_robot AND USE_ARIA) + if(UNIX AND USE_PTHREAD AND RT_FOUND AND DL_FOUND) + set(VISP_HAVE_PIONEER TRUE) + elseif(NOT UNIX) + set(VISP_HAVE_PIONEER TRUE) + endif() +endif() +VP_SET(VISP_HAVE_COIN3D TRUE IF (BUILD_MODULE_visp_robot AND USE_COIN3D)) + +VP_SET(VISP_HAVE_V4L2 TRUE IF (BUILD_MODULE_visp_sensor AND USE_V4L2)) +VP_SET(VISP_HAVE_DC1394 TRUE IF (BUILD_MODULE_visp_sensor AND USE_DC1394)) +VP_SET(VISP_HAVE_CMU1394 TRUE IF (BUILD_MODULE_visp_sensor AND USE_CMU1394)) +VP_SET(VISP_HAVE_DIRECTSHOW TRUE IF (BUILD_MODULE_visp_sensor AND USE_DIRECTSHOW)) +VP_SET(VISP_HAVE_LIBFREENECT TRUE IF (BUILD_MODULE_visp_sensor AND USE_LIBFREENECT)) +VP_SET(VISP_HAVE_LIBUSB_1 TRUE IF (BUILD_MODULE_visp_sensor AND USE_LIBUSB_1)) + +#VP_SET(VISP_HAVE_COIN3D TRUE IF (BUILD_MODULE_visp_mbt AND USE_COIN3D)) + + +VP_SET(VISP_BUILD_SHARED_LIBS TRUE IF BUILD_SHARED_LIBS) # for header vpConfig.h +VP_SET(VISP_HAVE_DC1394_CAMERA_ENUMERATE TRUE IF (USE_DC1394 AND DC1394_CAMERA_ENUMERATE_FOUND)) # for header vpConfig.h +VP_SET(VISP_HAVE_DC1394_FIND_CAMERAS TRUE IF (USE_DC1394 AND DC1394_FIND_CAMERAS_FOUND)) # for header vpConfig.h +VP_SET(VISP_HAVE_D3D9 TRUE IF USE_DIRECT3D) # for header vpConfig.h +VP_SET(VISP_HAVE_GTK TRUE IF USE_GTK2) # for header vpConfig.h + +# Check if libfreenect dependencies (ie libusb-1.0 and libpthread) are available +if(USE_LIBFREENECT AND USE_LIBUSB_1 AND USE_PTHREAD) + if(LIBFREENECT_FOUND AND LIBUSB_1_FOUND AND PTHREAD_FOUND) + set(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES TRUE) + set(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES_FOUND "yes") # for ViSP-third-party.txt + + # The material is found. Check if libfreenect is an old version + include(CheckCXXSourceCompiles) + set(CMAKE_REQUIRED_LIBRARIES ${LIBFREENECT_LIBRARIES} ${PTHREAD_LIBRARIES} ${LIBUSB_1_LIBRARIES}) + set(CMAKE_REQUIRED_INCLUDES ${LIBFREENECT_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIRS} ${LIBUSB_1_INCLUDE_DIRS}) + CHECK_CXX_SOURCE_COMPILES(" + #include <libfreenect.hpp> + + class vpMyKinect : public Freenect::FreenectDevice + { + }; + + int main() + { + Freenect::Freenect<vpMyKinect> freenect; + } + " LIBFREENECT_IS_OLD_VERSION) + #MESSAGE("LIBFREENECT_IS_OLD_VERSION: ${LIBFREENECT_IS_OLD_VERSION}") + if(LIBFREENECT_IS_OLD_VERSION) + set(VISP_HAVE_LIBFREENECT_OLD TRUE) # for header vpConfig.h + else() + set(VISP_HAVE_LIBFREENECT_OLD FALSE) # for header vpConfig.h + endif() + endif() +endif() + +# check OpenCV nonfree modules and version +if(USE_OPENCV) + set(VISP_HAVE_OPENCV_VERSION "(${OpenCV_VERSION_MAJOR}*65536 + ${OpenCV_VERSION_MINOR}*256 + ${OpenCV_VERSION_PATCH})") # for vpConfig.h + if(OpenCV_VERSION) + if(OpenCV_VERSION VERSION_LESS "2.4.0") + message(STATUS "opencv nonfree module found") + set(VISP_HAVE_OPENCV_NONFREE TRUE) # for header vpConfig.h + elseif(OPENCV_NONFREE_FOUND) # OpenCV < 3.0.0 + message(STATUS "opencv xfeatures2d module found") + set(VISP_HAVE_OPENCV_NONFREE TRUE) # for header vpConfig.h + elseif(OPENCV_XFEATURES2D_FOUND) # OpenCV >= 3.0.0 + set(VISP_HAVE_OPENCV_XFEATURES2D TRUE) # for header vpConfig.h + else() + message(STATUS "opencv nonfree or xfeature2d module not found") + endif() + else() + message(STATUS "opencv nonfree not found") + set(VISP_HAVE_OPENCV_VERSION "(0)") # for vpConfig.h + endif() +endif() + +# coin and gui +set(VISP_HAVE_COIN3D_AND_GUI_FOUND "no") # for ViSP-third-party.txt +set(VISP_HAVE_QT3_FOUND "no") # for ViSP-third-party.txt +set(VISP_HAVE_QT4_FOUND "no") # for ViSP-third-party.txt +if(USE_SOWIN) + set(VISP_HAVE_COIN3D_AND_GUI TRUE) # for header vpConfig.h + set(VISP_HAVE_COIN3D_AND_GUI_FOUND "yes") # for ViSP-third-party.txt +elseif(USE_SOXT) + set(VISP_HAVE_COIN3D_AND_GUI TRUE) # for header vpConfig.h + set(VISP_HAVE_COIN3D_AND_GUI_FOUND "yes") # for ViSP-third-party.txt +elseif(USE_SOQT AND USE_QT) + set(VISP_HAVE_COIN3D_AND_GUI TRUE) # for header vpConfig.h + set(VISP_HAVE_COIN3D_AND_GUI_FOUND "yes") # for ViSP-third-party.txt + if(DESIRED_QT_VERSION MATCHES 3) + set(VISP_HAVE_QT3_FOUND "yes") # for ViSP-third-party.txt + elseif(DESIRED_QT_VERSION MATCHES 4) + set(VISP_HAVE_QT4_FOUND "yes") # for ViSP-third-party.txt + endif() +endif() + +# Ogre plugins and resources +if(USE_OGRE) + include(cmake/OgreTools.cmake) + vp_set_ogre_media() +endif() + +# Find isnan macro (C-style) +VP_SET(VISP_HAVE_FUNC_ISNAN TRUE IF HAVE_FUNC_ISNAN) # for header vpConfig.h +# Find std::isnan function (cmath) +VP_SET(VISP_HAVE_FUNC_STD_ISNAN TRUE IF HAVE_FUNC_STD_ISNAN) # for header vpConfig.h +# Find _isnan function for MSVC +VP_SET(VISP_HAVE_FUNC__ISNAN TRUE IF HAVE_FUNC__ISNAN) # for header vpConfig.h +# Find isinf macro (C-style) +VP_SET(VISP_HAVE_FUNC_ISINF TRUE IF HAVE_FUNC_ISINF) # for header vpConfig.h +# Find std::isinf function (cmath) +VP_SET(VISP_HAVE_FUNC_STD_ISINF TRUE IF HAVE_FUNC_STD_ISINF) # for header vpConfig.h +# Find _finite function for MSVC +VP_SET(VISP_HAVE_FUNC__FINITE TRUE IF HAVE_FUNC__FINITE) # for header vpConfig.h +# Find round function (math.h) +VP_SET(VISP_HAVE_FUNC_ROUND TRUE IF HAVE_FUNC_ROUND) # for header vpConfig.h +# Find std::round function (cmath) +VP_SET(VISP_HAVE_FUNC_STD_ROUND TRUE IF HAVE_FUNC_STD_ROUND) # for header vpConfig.h + +VP_SET(VISP_HAVE_ACCESS_TO_NAS TRUE IF NAS_FOUND) # for header vpConfig.h +VP_SET(VISP_BUILD_DEPRECATED_FUNCTIONS TRUE IF BUILD_DEPRECATED_FUNCTIONS) # for header vpConfig.h +VP_SET(MOMENTS_COMBINE_MATRICES TRUE IF VISP_MOMENTS_COMBINE_MATRICES) # for header vpConfig.h +VP_SET(VISP_USE_MSVC TRUE IF MSVC) # for header vpConfig.h +VP_SET(VISP_HAVE_CPP11_COMPATIBILITY TRUE IF USE_CPP11) # for header vpConfig.h +VP_SET(VISP_HAVE_BICLOPS_AND_GET_HOMED_STATE_FUNCTION TRUE IF (USE_BICLOPS AND BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION)) # for header vpConfig.h + +if(USE_CPP11) + set(VISP_HAVE_CPP11_COMPATIBILITY_FOUND "yes") # for ViSP-third-party.txt +else() + set(VISP_HAVE_CPP11_COMPATIBILITY_FOUND "no") # for ViSP-third-party.txt +endif() + +# libraries for Pioneer mobile robots +if(USE_ARIA AND UNIX) + if(ARIA_FOUND AND USE_PTHREAD AND RT_FOUND AND DL_FOUND) + set(VISP_HAVE_PIONEER TRUE) # for header vpConfig.h + set(VISP_HAVE_PIONEER_FOUND "yes") # for ViSP-third-party.txt + endif() +elseif(USE_ARIA AND NOT UNIX) + set(VISP_HAVE_PIONEER TRUE) # for header vpConfig.h + set(VISP_HAVE_PIONEER_FOUND "yes") # for ViSP-third-party.txt +else() + set(VISP_HAVE_PIONEER_FOUND "no") # for ViSP-third-party.txt +endif() + +if(USE_AFMA4) + set(VISP_HAVE_AFMA4_FOUND "yes") # for ViSP-third-party.txt +else() + set(VISP_HAVE_AFMA4_FOUND "no") # for ViSP-third-party.txt +endif() +if(USE_AFMA6) + set(VISP_HAVE_AFMA6_FOUND "yes") # for ViSP-third-party.txt +else() + set(VISP_HAVE_AFMA6_FOUND "no") # for ViSP-third-party.txt +endif() +if(USE_VIPER650) + set(VISP_HAVE_VIPER650_FOUND "yes") # for ViSP-third-party.txt +else() + set(VISP_HAVE_VIPER650_FOUND "no") # for ViSP-third-party.txt +endif() +if(USE_VIPER850) + set(VISP_HAVE_VIPER850_FOUND "yes") # for ViSP-third-party.txt +else() + set(VISP_HAVE_VIPER850_FOUND "no") # for ViSP-third-party.txt +endif() + +# ---------------------------------------------------------------------------- +# Finalization: generate configuration-based files +# ---------------------------------------------------------------------------- + +# Generate platform-dependent and configuration-dependent headers +include(cmake/VISPGenerateHeaders.cmake) + +# Configure the file describing how to use ViSP. VISPConfig.cmake +# is the main file configuring a CMake package. +# . Exports build settings and dependencies for projects using ViSP as a +# third party project. +# . Create and install files for simple use of find_package(VISP) +# by other cmakified "user" projects and libraries depending on ViSP. +# (see "Mastering CMake", pp.72) +# . To use ViSP in a third party project based on CMake: +# find_package(VISP REQUIRED) +# include_directories(${VISP_INCLUDE_DIRS}) +# target_link_libraries(<target> ${VISP_LIBRARIES}) +include(cmake/VISPGenerateConfig.cmake) + +#---------------------------------------------------------------------- +# For Dart server and tests +# We use CDash set through CTestConfig.cmake file +# Dashboards are sent to http://cdash.irisa.fr/CDash/index.php?project=ViSP +#---------------------------------------------------------------------- +if(BUILD_TESTS) + include(CTest) +endif() + +#---------------------------------------------------------------------- +# For CPack packaging tool +#---------------------------------------------------------------------- + +option(BUILD_PACKAGE "Configure ViSP packaging" OFF) +if(BUILD_PACKAGE) + if(UNIX AND NOT APPLE AND NOT WIN32) # =linux + option(BUILD_PACKAGE_DEBIAN "Build debian package" ON) + option(BUILD_PACKAGE_RPM "Build rpm package" ON) + endif() + + include(cmake/CPackConfig.cmake) +endif(BUILD_PACKAGE) + + +#---------------------------------------------------------------------- +# Generate the package dependent visp-config shell script for projects which +# are not using CMake: +# Usage: +# visp-config --cflags ... +#---------------------------------------------------------------------- +include(cmake/VISPGeneratePkgConfigScript.cmake) + +#---------------------------------------------------------------------- +# Propagation in sub dirs to build demo, example, test, tutorial +#---------------------------------------------------------------------- + +set(VISP_DIR ${PROJECT_BINARY_DIR}) +mark_as_advanced(VISP_DIR) +mark_as_advanced(VISP_INCLUDE_DIRS) + +if(BUILD_DEMOS) + add_subdirectory(demo) +endif() +if(BUILD_EXAMPLES) + add_subdirectory(example) +endif() +if(BUILD_TUTORIALS) + add_subdirectory(tutorial) +endif() diff --git a/CMakeModules/FindLAPACK_C.cmake b/CMakeModules/FindLAPACK_C.cmake deleted file mode 100644 index 577944d749c73e69aed98db9dcb6f5e6f1c99c66..0000000000000000000000000000000000000000 --- a/CMakeModules/FindLAPACK_C.cmake +++ /dev/null @@ -1,165 +0,0 @@ -############################################################################# -# -# $Id: FindLAPACK_C.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Try to find lapack, the Linear Algebra PACKage. -# Since the FindLAPACK.cmake provided with CMake is for Fortran language, -# this file is able to detect lapack for C language. -# Once run this will define: -# -# LAPACK_FOUND -# LAPACK_LIBRARIES -# -# Authors: -# Filip Novotny -# Fabien Spindler -# -############################################################################# - -SET(LAPACK_FOUND FALSE) -SET(LAPACK_LIBRARIES "") -IF(WIN32) - FIND_LIBRARY(LAPACK_LIBRARY_LAPACK_RELEASE - NAMES lapack - PATHS - $ENV{LAPACK_HOME} - $ENV{LAPACK_DIR} - $ENV{LAPACK_HOME}/lib - $ENV{LAPACK_DIR}/lib - ) - - FIND_LIBRARY(LAPACK_LIBRARY_BLAS_RELEASE - NAMES blas - PATHS - $ENV{LAPACK_HOME} - $ENV{LAPACK_DIR} - $ENV{LAPACK_HOME}/lib - $ENV{LAPACK_DIR}/lib - ) - - FIND_LIBRARY(LAPACK_LIBRARY_F2C_RELEASE - NAMES libf2c - PATHS - $ENV{LAPACK_HOME} - $ENV{LAPACK_DIR} - $ENV{LAPACK_HOME}/lib - $ENV{LAPACK_DIR}/lib - ) - - FIND_LIBRARY(LAPACK_LIBRARY_LAPACK_DEBUG - NAMES lapackd - PATHS - $ENV{LAPACK_HOME} - $ENV{LAPACK_DIR} - $ENV{LAPACK_HOME}/lib - $ENV{LAPACK_DIR}/lib - ) - - FIND_LIBRARY(LAPACK_LIBRARY_BLAS_DEBUG - NAMES blasd - PATHS - $ENV{LAPACK_HOME} - $ENV{LAPACK_DIR} - $ENV{LAPACK_HOME}/lib - $ENV{LAPACK_DIR}/lib - ) - - FIND_LIBRARY(LAPACK_LIBRARY_F2C_DEBUG - NAMES libf2cd - PATHS - $ENV{LAPACK_HOME} - $ENV{LAPACK_DIR} - $ENV{LAPACK_HOME}/lib - $ENV{LAPACK_DIR}/lib - ) - - IF((LAPACK_LIBRARY_LAPACK_RELEASE AND LAPACK_LIBRARY_BLAS_RELEASE AND LAPACK_LIBRARY_F2C_RELEASE)) - LIST(APPEND LAPACK_LIBRARIES optimized ${LAPACK_LIBRARY_LAPACK_RELEASE}) - LIST(APPEND LAPACK_LIBRARIES optimized ${LAPACK_LIBRARY_BLAS_RELEASE}) - LIST(APPEND LAPACK_LIBRARIES optimized ${LAPACK_LIBRARY_F2C_RELEASE}) - - SET(LAPACK_FOUND TRUE) - ENDIF() - IF((LAPACK_LIBRARY_LAPACK_DEBUG AND LAPACK_LIBRARY_BLAS_DEBUG AND LAPACK_LIBRARY_F2C_DEBUG)) - LIST(APPEND LAPACK_LIBRARIES debug ${LAPACK_LIBRARY_LAPACK_DEBUG}) - LIST(APPEND LAPACK_LIBRARIES debug ${LAPACK_LIBRARY_BLAS_DEBUG}) - LIST(APPEND LAPACK_LIBRARIES debug ${LAPACK_LIBRARY_F2C_DEBUG}) - SET(LAPACK_FOUND TRUE) - ENDIF() - - -ELSE(WIN32) - FIND_LIBRARY(LAPACK_LIBRARY_LAPACK - NAMES lapack - PATHS - $ENV{LAPACK_HOME} - $ENV{LAPACK_DIR} - $ENV{LAPACK_HOME}/lib - $ENV{LAPACK_DIR}/lib - /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 - ) - - FIND_LIBRARY(LAPACK_LIBRARY_BLAS - NAMES blas - PATHS - $ENV{LAPACK_DIR} - $ENV{LAPACK_HOME} - $ENV{LAPACK_HOME}/lib - $ENV{LAPACK_DIR}/lib - /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 - ) - IF((LAPACK_LIBRARY_LAPACK AND LAPACK_LIBRARY_BLAS)) - SET(LAPACK_LIBRARIES ${LAPACK_LIBRARY_LAPACK} ${LAPACK_LIBRARY_BLAS}) - SET(LAPACK_FOUND TRUE) - ENDIF() -ENDIF(WIN32) -## -------------------------------- - - -MARK_AS_ADVANCED( - LAPACK_LIBRARIES - LAPACK_LIBRARY_LAPACK - LAPACK_LIBRARY_BLAS - LAPACK_LIBRARY_LAPACK_RELEASE - LAPACK_LIBRARY_BLAS_RELEASE - LAPACK_LIBRARY_LAPACK_DEBUG - LAPACK_LIBRARY_BLAS_DEBUG - LAPACK_LIBRARY_F2C_DEBUG - LAPACK_LIBRARY_F2C_RELEASE -) - diff --git a/CMakeModules/OgreTools.cmake b/CMakeModules/OgreTools.cmake deleted file mode 100755 index fd714dedc4fb3740482f4cac179f034bb6513ce7..0000000000000000000000000000000000000000 --- a/CMakeModules/OgreTools.cmake +++ /dev/null @@ -1,174 +0,0 @@ -############################################################################# -# -# $Id: OgreTools.cmake 4769 2014-07-08 20:25:50Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP overall configuration file. Some useful tools for Ogre3D. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -######################################################### -# Find Ogre plugins -# -# This is a modified version of the macro provided with Ogre -# except that it should be used only in a desperate way when the original -# one doesn't detect anything -######################################################### - -macro(ogre_find_plugin_lib_visp PLUGIN) - # On Unix, the plugins might have no prefix - if (CMAKE_FIND_LIBRARY_PREFIXES) - set(TMP_CMAKE_LIB_PREFIX ${CMAKE_FIND_LIBRARY_PREFIXES}) - set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "") - endif() - - # strip RenderSystem_ or Plugin_ prefix from plugin name - string(REPLACE "RenderSystem_" "" PLUGIN_TEMP ${PLUGIN}) - string(REPLACE "Plugin_" "" PLUGIN_NAME ${PLUGIN_TEMP}) - - set(OGRE_PLUGIN_PATH_SUFFIXES - PlugIns PlugIns/${PLUGIN_NAME} Plugins Plugins/${PLUGIN_NAME} ${PLUGIN} - RenderSystems RenderSystems/${PLUGIN_NAME} ${ARGN}) - # find link libraries for plugins - set(OGRE_${PLUGIN}_LIBRARY_NAMES "${PLUGIN}${OGRE_LIB_SUFFIX}") - get_debug_names(OGRE_${PLUGIN}_LIBRARY_NAMES) - find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES} - HINTS ${OGRE_LIBRARY_DIRS} ${OGRE_LIBRARY_DIRS}/OGRE ${OGRE_LIBRARY_DIRS}/OGRE-${OGRE_VERSION_MAJOR}.${OGRE_VERSION_MINOR}.${OGRE_VERSION_PATCH} - PATH_SUFFIXES "" OGRE opt release release/opt relwithdebinfo relwithdebinfo/opt minsizerel minsizerel/opt) - find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG} - HINTS ${OGRE_LIBRARY_DIRS} ${OGRE_LIBRARY_DIRS}/OGRE ${OGRE_LIBRARY_DIRS}/OGRE-${OGRE_VERSION_MAJOR}.${OGRE_VERSION_MINOR}.${OGRE_VERSION_PATCH} - PATH_SUFFIXES "" OGRE opt debug debug/opt) - make_library_set(OGRE_${PLUGIN}_LIBRARY) - - if (OGRE_${PLUGIN}_LIBRARY) - set(OGRE_${PLUGIN}_FOUND TRUE) - endif () - - mark_as_advanced(OGRE_${PLUGIN}_LIBRARY_REL OGRE_${PLUGIN}_LIBRARY_DBG OGRE_${PLUGIN}_LIBRARY_FWK) - -endmacro(ogre_find_plugin_lib_visp) - -MACRO(CREATE_OGRE_PLUGIN_CONFIG_FILE) - SET(VISP_HAVE_OGRE_PLUGINS_PATH ${VISP_BINARY_DIR}/data/ogre-simulator) - - # If OGRE_PLUGIN_DIR_REL and OGRE_PLUGIN_DIR_DBG are not defined we - # try to find them manually - IF(NOT OGRE_PLUGIN_DIR_REL AND NOT OGRE_PLUGIN_DIR_DBG) - ogre_find_plugin_lib_visp(RenderSystem_Direct3D9) - ogre_find_plugin_lib_visp(RenderSystem_Direct3D10) - ogre_find_plugin_lib_visp(RenderSystem_Direct3D11) - ogre_find_plugin_lib_visp(RenderSystem_GL) - ogre_find_plugin_lib_visp(RenderSystem_GLES) - ogre_find_plugin_lib_visp(Plugin_ParticleFX) - ogre_find_plugin_lib_visp(Plugin_BSPSceneManager) - ogre_find_plugin_lib_visp(Plugin_CgProgramManager) - ogre_find_plugin_lib_visp(Plugin_PCZSceneManager) - ogre_find_plugin_lib_visp(Plugin_OctreeSceneManager) - ogre_find_plugin_lib_visp(Plugin_OctreeZone) - - - IF(OGRE_RenderSystem_GL_LIBRARY_REL) - GET_FILENAME_COMPONENT(OGRE_PLUGIN_DIR_REL ${OGRE_RenderSystem_GL_LIBRARY_REL} PATH) - #message("set manually OGRE_PLUGIN_DIR_REL to ${OGRE_PLUGIN_DIR_REL}") - ELSEIF(OGRE_RenderSystem_GL_LIBRARY_DBG) - GET_FILENAME_COMPONENT(OGRE_PLUGIN_DIR_DBG ${OGRE_RenderSystem_GL_LIBRARY_DBG} PATH) - #message("set manually OGRE_PLUGIN_DIR_DBG to ${OGRE_PLUGIN_DIR_DBG}") - ENDIF() - ENDIF() - - IF(OGRE_PLUGIN_DIR_REL) - LIST(APPEND PLUGIN_REL ${OGRE_RenderSystem_Direct3D9_LIBRARY_REL}) - LIST(APPEND PLUGIN_REL ${OGRE_RenderSystem_Direct3D10_LIBRARY_REL}) - LIST(APPEND PLUGIN_REL ${OGRE_RenderSystem_Direct3D11_LIBRARY_REL}) - LIST(APPEND PLUGIN_REL ${OGRE_RenderSystem_GL_LIBRARY_REL}) - LIST(APPEND PLUGIN_REL ${OGRE_RenderSystem_GLES_LIBRARY_REL}) - LIST(APPEND PLUGIN_REL ${OGRE_Plugin_ParticleFX_LIBRARY_REL}) - LIST(APPEND PLUGIN_REL ${OGRE_Plugin_BSPSceneManager_LIBRARY_REL}) - LIST(APPEND PLUGIN_REL ${OGRE_Plugin_CgProgramManager_LIBRARY_REL}) - LIST(APPEND PLUGIN_REL ${OGRE_Plugin_PCZSceneManager_LIBRARY_REL}) - LIST(APPEND PLUGIN_REL ${OGRE_Plugin_OctreeSceneManager_LIBRARY_REL}) - IF (NOT APPLE) - # Since the plugin Plugin_Octree causes problems on OSX, we take - # it only into account on non Apple platforms - LIST(APPEND PLUGIN_REL ${OGRE_Plugin_OctreeZone_LIBRARY_REL}) - ENDIF() - - SET(PLUGINS_CONTENT_REL "# Defines plugins to load\n\n") - LIST(APPEND PLUGINS_CONTENT_REL "# Define plugin folder\n") - - LIST(APPEND PLUGINS_CONTENT_REL "PluginFolder=${OGRE_PLUGIN_DIR_REL}/\n\n") - LIST(APPEND PLUGINS_CONTENT_REL "# Define plugins\n") - foreach(PLUGIN ${PLUGIN_REL}) - if(PLUGIN) - GET_FILENAME_COMPONENT(PLUGIN_NAME ${PLUGIN} NAME_WE) - LIST(APPEND PLUGINS_CONTENT_REL " Plugin=${PLUGIN_NAME}\n") - endif() - endforeach() - #MESSAGE("PLUGINS_CONTENT_REL: ${PLUGINS_CONTENT_REL}") - FILE(WRITE "${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins.cfg" ${PLUGINS_CONTENT_REL}) - ENDIF() - - IF(OGRE_PLUGIN_DIR_DBG) - LIST(APPEND PLUGIN_DBG ${OGRE_RenderSystem_Direct3D9_LIBRARY_DBG}) - LIST(APPEND PLUGIN_DBG ${OGRE_RenderSystem_Direct3D10_LIBRARY_DBG}) - LIST(APPEND PLUGIN_DBG ${OGRE_RenderSystem_Direct3D11_LIBRARY_DBG}) - LIST(APPEND PLUGIN_DBG ${OGRE_RenderSystem_GL_LIBRARY_DBG}) - LIST(APPEND PLUGIN_DBG ${OGRE_RenderSystem_GLES_LIBRARY_DBG}) - LIST(APPEND PLUGIN_DBG ${OGRE_Plugin_ParticleFX_LIBRARY_DBG}) - LIST(APPEND PLUGIN_DBG ${OGRE_Plugin_BSPSceneManager_LIBRARY_DBG}) - LIST(APPEND PLUGIN_DBG ${OGRE_Plugin_CgProgramManager_LIBRARY_DBG}) - LIST(APPEND PLUGIN_DBG ${OGRE_Plugin_PCZSceneManager_LIBRARY_DBG}) - LIST(APPEND PLUGIN_DBG ${OGRE_Plugin_OctreeSceneManager_LIBRARY_DBG}) - IF (NOT APPLE) - # Since the plugin Plugin_Octree causes problems on OSX, we take - # it only into account on non Apple platforms - LIST(APPEND PLUGIN_DBG ${OGRE_Plugin_OctreeZone_LIBRARY_DBG}) - ENDIF() - - SET(PLUGINS_CONTENT_DBG "# Defines plugins to load\n\n") - LIST(APPEND PLUGINS_CONTENT_DBG "# Define plugin folder\n") - LIST(APPEND PLUGINS_CONTENT_DBG "PluginFolder=${OGRE_PLUGIN_DIR_DBG}/\n\n") - LIST(APPEND PLUGINS_CONTENT_DBG "# Define plugins\n") - foreach(PLUGIN ${PLUGIN_DBG}) - if(PLUGIN) - GET_FILENAME_COMPONENT(PLUGIN_NAME ${PLUGIN} NAME_WE) - LIST(APPEND PLUGINS_CONTENT_DBG " Plugin=${PLUGIN_NAME}\n") - endif() - endforeach() - - #MESSAGE("PLUGINS_CONTENT_DBG: ${PLUGINS_CONTENT_DBG}") - FILE(WRITE "${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins_d.cfg" ${PLUGINS_CONTENT_DBG}) - ENDIF() - -ENDMACRO() diff --git a/CMakeModules/VISPDetectPlatform.cmake b/CMakeModules/VISPDetectPlatform.cmake deleted file mode 100644 index 50ef61f9be7ad42089f98325bcc6c83bab59765d..0000000000000000000000000000000000000000 --- a/CMakeModules/VISPDetectPlatform.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# Similar code exist in VISPConfig.cmake - -if(NOT DEFINED VISP_STATIC) - # look for global setting - if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) - set(VISP_STATIC OFF) - else() - set(VISP_STATIC ON) - endif() -endif() - -if(MSVC) - if(CMAKE_CL_64) - set(VISP_ARCH x64) - else() - set(VISP_ARCH x86) - endif() - if(MSVC_VERSION EQUAL 1400) - set(VISP_RUNTIME vc8) - elseif(MSVC_VERSION EQUAL 1500) - set(VISP_RUNTIME vc9) - elseif(MSVC_VERSION EQUAL 1600) - set(VISP_RUNTIME vc10) - elseif(MSVC_VERSION EQUAL 1700) - set(VISP_RUNTIME vc11) - elseif(MSVC_VERSION EQUAL 1800) - set(VISP_RUNTIME vc12) - endif() -elseif(MINGW) - set(VISP_RUNTIME mingw) - - execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine - OUTPUT_VARIABLE VISP_GCC_TARGET_MACHINE - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(VISP_GCC_TARGET_MACHINE MATCHES "64") - set(MINGW64 1) - set(VISP_ARCH x64) - else() - set(VISP_ARCH x86) - endif() -endif() diff --git a/CMakeModules/resources.cfg.in b/CMakeModules/resources.cfg.in deleted file mode 100644 index dc38028ea60fa14b05af69e1fc4cb1e653ac133d..0000000000000000000000000000000000000000 --- a/CMakeModules/resources.cfg.in +++ /dev/null @@ -1,11 +0,0 @@ -# Resources required by the sample browser and most samples. -[Essential] -#Zip=@OGRE_MEDIA_DIR@/packs/SdkTrays.zip - -# Resource locations to be added to the default path -[General] -FileSystem=@OGRE_MEDIA_DIR@ -@OGRE_COMMENT_LINE@FileSystem=@OGRE_MEDIA_DIR@/materials/programs -FileSystem=@OGRE_MEDIA_DIR@/materials/scripts -FileSystem=@OGRE_MEDIA_DIR@/materials/textures -FileSystem=@OGRE_MEDIA_DIR@/models diff --git a/CMakeSourceFileList.cmake b/CMakeSourceFileList.cmake deleted file mode 100644 index ec9a60af2e28a6e1930f9696e98a21a53180e922..0000000000000000000000000000000000000000 --- a/CMakeSourceFileList.cmake +++ /dev/null @@ -1,489 +0,0 @@ -############################################################################# -# -# $Id: CMakeSourceFileList.cmake,v 1.29 2008-12-17 14:45:01 fspindle Exp $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP source file list. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# Set SRC_subdir variable to all the files we want to parse during -# the build process. -# Don't forget to update SRC_ALL variable if you add/remove a SRC_subdir -# variable -# -# If you add/remove a directory, modify here -SET (SRC_CAMERA - camera/vpCameraParameters.cpp - camera/vpMeterPixelConversion.cpp - camera/vpPixelMeterConversion.cpp - camera/calibration/vpCalibration.cpp - camera/calibration/vpCalibrationTools.cpp - ) - -IF(VISP_HAVE_XML2) - LIST(APPEND SRC_CAMERA camera/vpXmlParserCamera.cpp) -ENDIF() - -SET (SRC_COMPUTER_VISION - computer-vision/homography-estimation/vpHomography.cpp - computer-vision/homography-estimation/vpHomographyDLT.cpp - computer-vision/homography-estimation/vpHomographyVVS.cpp - computer-vision/homography-estimation/vpHomographyExtract.cpp - computer-vision/homography-estimation/vpHomographyMalis.cpp - computer-vision/homography-estimation/vpHomographyRansac.cpp - computer-vision/pose-estimation/vpLevenbergMarquartd.cpp - computer-vision/pose-estimation/vpPose.cpp - computer-vision/pose-estimation/vpPoseFeatures.cpp - computer-vision/pose-estimation/vpPoseDementhon.cpp - computer-vision/pose-estimation/vpPoseLagrange.cpp - computer-vision/pose-estimation/vpPoseLowe.cpp - computer-vision/pose-estimation/vpPoseRansac.cpp - computer-vision/pose-estimation/vpPoseVirtualVisualServoing.cpp - ) - -if(VISP_HAVE_ZBAR) - list(APPEND SRC_DETECTION detection/barcode/vpDetectorQRCode.cpp) -endif() - -if(VISP_HAVE_DMTX) - list(APPEND SRC_DETECTION detection/barcode/vpDetectorDataMatrixCode.cpp) -endif() - -SET (SRC_EXCEPTION - exceptions/vpException.cpp - ) - -SET (SRC_DEVICE_FRAMEGRABBER - device/framegrabber/disk/vpDiskGrabber.cpp - ) - -IF(VISP_HAVE_DC1394_2) - LIST(APPEND SRC_DEVICE_FRAMEGRABBER device/framegrabber/1394/vp1394TwoGrabber.cpp) -ENDIF() -IF(VISP_HAVE_CMU1394) - LIST(APPEND SRC_DEVICE_FRAMEGRABBER device/framegrabber/1394/vp1394CMUGrabber.cpp) -ENDIF() -IF(VISP_HAVE_V4L2) - LIST(APPEND SRC_DEVICE_FRAMEGRABBER device/framegrabber/v4l2/vpV4l2Grabber.cpp) -ENDIF() -IF(VISP_HAVE_DIRECTSHOW) - LIST(APPEND SRC_DEVICE_FRAMEGRABBER device/framegrabber/directshow/vpDirectShowGrabber.cpp) - LIST(APPEND SRC_DEVICE_FRAMEGRABBER device/framegrabber/directshow/vpDirectShowGrabberImpl.cpp) - LIST(APPEND SRC_DEVICE_FRAMEGRABBER device/framegrabber/directshow/vpDirectShowDevice.cpp) - LIST(APPEND SRC_DEVICE_FRAMEGRABBER device/framegrabber/directshow/vpDirectShowSampleGrabberI.cpp) -ENDIF() -IF(VISP_HAVE_OPENCV) - LIST(APPEND SRC_DEVICE_FRAMEGRABBER device/framegrabber/OpenCV/vpOpenCVGrabber.cpp) -ENDIF() - -SET (SRC_IMAGE - image/vpColor.cpp - image/vpImageConvert.cpp - image/vpImageFilter.cpp - image/vpImageIo.cpp - image/vpImageTools.cpp - image/vpRGBa.cpp - image/vpImagePoint.cpp - ) - -SET (SRC_KEY_POINT - key-point/vpBasicKeyPoint.cpp - ) - -if(VISP_HAVE_OPENCV_NONFREE AND OpenCV_VERSION VERSION_LESS 3.0.0) - list(APPEND SRC_KEY_POINT key-point/vpKeyPointSurf.cpp) -endif() -if(VISP_HAVE_OPENCV) - list(APPEND SRC_KEY_POINT key-point/vpPlanarObjectDetector.cpp) - list(APPEND SRC_KEY_POINT key-point/vpFernClassifier.cpp) - list (APPEND SRC_KEY_POINT key-point/vpKeyPoint.cpp) -endif() - -IF(VISP_HAVE_XML2) - LIST(APPEND SRC_KEY_POINT key-point/vpXmlConfigParserKeyPoint.cpp) -ENDIF() - -IF(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES) - SET (SRC_DEVICE_KINECT - device/kinect/vpKinect.cpp - ) -ENDIF() - -SET (SRC_DEVICE_LASERSCANNER - device/laserscanner/sick/vpSickLDMRS.cpp - ) - -IF(VISP_HAVE_PARPORT) - SET (SRC_DEVICE_LIGHT - device/light/vpRingLight.cpp - ) -ENDIF() - -SET (SRC_MATH - math/kalman/vpKalmanFilter.cpp - math/kalman/vpLinearKalmanFilterInstantiation.cpp - math/matrix/vpColVector.cpp - math/matrix/vpMatrix.cpp - math/matrix/vpMatrix_lu.cpp - math/matrix/vpMatrix_qr.cpp - math/matrix/vpMatrix_svd.cpp - math/matrix/vpMatrix_covariance.cpp - math/matrix/vpRowVector.cpp - math/matrix/vpSubMatrix.cpp - math/matrix/vpSubColVector.cpp - math/matrix/vpSubRowVector.cpp - math/misc/vpMath.cpp - math/misc/vpNoise.cpp - math/misc/vpHinkley.cpp - math/robust/vpRobust.cpp - math/robust/vpScale.cpp - math/spline/vpBSpline.cpp - math/spline/vpNurbs.cpp - math/transformation/vpExponentialMap.cpp - math/transformation/vpForceTwistMatrix.cpp - math/transformation/vpHomogeneousMatrix.cpp - math/transformation/vpPoseVector.cpp - math/transformation/vpQuaternionVector.cpp - math/transformation/vpRotationMatrix.cpp - math/transformation/vpRotationVector.cpp - math/transformation/vpRxyzVector.cpp - math/transformation/vpRzyxVector.cpp - math/transformation/vpRzyzVector.cpp - math/transformation/vpThetaUVector.cpp - math/transformation/vpTranslationVector.cpp - math/transformation/vpVelocityTwistMatrix.cpp - ) - -IF(VISP_HAVE_LAPACK) - LIST(APPEND SRC_MATH math/matrix/vpMatrix_cholesky.cpp) -ENDIF() - -IF(VISP_HAVE_XML2) - LIST(APPEND SRC_MATH math/transformation/vpXmlParserHomogeneousMatrix.cpp) -ENDIF() - -SET (SRC_ROBOT - robot/robot/vpRobot.cpp - robot/robot/vpRobotTemplate.cpp - robot/real-robot/afma4/vpAfma4.cpp - robot/real-robot/afma6/vpAfma6.cpp - robot/real-robot/biclops/vpBiclops.cpp - robot/real-robot/ptu46/vpPtu46.cpp - robot/real-robot/viper/vpViper.cpp - robot/real-robot/viper/vpViper650.cpp - robot/real-robot/viper/vpViper850.cpp - robot/simulator-robot/vpRobotCamera.cpp - robot/simulator-robot/vpRobotSimulator.cpp - robot/simulator-robot/vpSimulatorCamera.cpp - robot/simulator-robot/vpSimulatorPioneer.cpp - robot/simulator-robot/vpSimulatorPioneerPan.cpp - ) - -IF(WIN32 OR VISP_HAVE_PTHREAD) - list(APPEND SRC_ROBOT robot/simulator-robot/vpRobotWireFrameSimulator.cpp) - list(APPEND SRC_ROBOT robot/simulator-robot/vpSimulatorAfma6.cpp) - list(APPEND SRC_ROBOT robot/simulator-robot/vpSimulatorViper850.cpp) -ENDIF() - -IF(VISP_HAVE_AFMA4) - LIST(APPEND SRC_ROBOT robot/real-robot/afma4/vpRobotAfma4.cpp) -ENDIF() -IF(UNIX) - LIST(APPEND SRC_ROBOT robot/real-robot/afma4/vpServolens.cpp) -ENDIF() -IF(VISP_HAVE_AFMA6) - LIST(APPEND SRC_ROBOT robot/real-robot/afma6/vpRobotAfma6.cpp) -ENDIF() -IF(VISP_HAVE_BICLOPS) - LIST(APPEND SRC_ROBOT robot/real-robot/biclops/vpRobotBiclopsController.cpp) - LIST(APPEND SRC_ROBOT robot/real-robot/biclops/vpRobotBiclops.cpp) -ENDIF() -IF(VISP_HAVE_PTU46) - LIST(APPEND SRC_ROBOT robot/real-robot/ptu46/vpRobotPtu46.cpp) -ENDIF() -IF(VISP_HAVE_PIONEER) - LIST(APPEND SRC_ROBOT robot/real-robot/pioneer/vpRobotPioneer.cpp) -ENDIF() -IF(VISP_HAVE_VIPER650) - LIST(APPEND SRC_ROBOT robot/real-robot/viper/vpRobotViper650.cpp) -ENDIF() -IF(VISP_HAVE_VIPER850) - LIST(APPEND SRC_ROBOT robot/real-robot/viper/vpRobotViper850.cpp) -ENDIF() - -SET (SRC_SERVO - servo/vpAdaptiveGain.cpp - servo/vpServo.cpp - servo/vpServoData.cpp - servo/vpServoDisplay.cpp - ) - -SET (SRC_SIMULATOR - simulator/image-simulator/vpImageSimulator.cpp - simulator/wireframe-simulator/vpWireFrameSimulator.cpp - simulator/wireframe-simulator/core/vpArit.cpp - simulator/wireframe-simulator/core/vpAritio.cpp - simulator/wireframe-simulator/core/vpBound.cpp - simulator/wireframe-simulator/core/vpBoundio.cpp - simulator/wireframe-simulator/core/vpClipping.cpp - simulator/wireframe-simulator/core/vpCoreDisplay.cpp - simulator/wireframe-simulator/core/vpKeyword.cpp - simulator/wireframe-simulator/core/vpLex.cpp - simulator/wireframe-simulator/core/vpMyio.cpp - simulator/wireframe-simulator/core/vpParser.cpp - simulator/wireframe-simulator/core/vpProjection.cpp - simulator/wireframe-simulator/core/vpRfstack.cpp - simulator/wireframe-simulator/core/vpSkipio.cpp - simulator/wireframe-simulator/core/vpTmstack.cpp - simulator/wireframe-simulator/core/vpToken.cpp - simulator/wireframe-simulator/core/vpViewio.cpp - simulator/wireframe-simulator/core/vpVwstack.cpp - ) -IF(VISP_HAVE_X11 OR VISP_HAVE_GDI OR VISP_HAVE_OPENCV OR VISP_HAVE_D3D9 OR VISP_HAVE_GTK) - list(APPEND SRC_SIMULATOR simulator/coin-simulator/vpProjectionDisplay.cpp) -ENDIF() -IF(VISP_HAVE_COIN_AND_GUI) - LIST(APPEND SRC_SIMULATOR simulator/coin-simulator/vpAR.cpp) - LIST(APPEND SRC_SIMULATOR simulator/coin-simulator/vpSimulator.cpp) - LIST(APPEND SRC_SIMULATOR simulator/coin-simulator/vpViewer.cpp) -ENDIF() -IF(VISP_HAVE_OGRE) - LIST(APPEND SRC_SIMULATOR simulator/ogre-simulator/vpAROgre.cpp) -ENDIF() - -SET (SRC_TOOLS - tools/convert/vpConvert.cpp - tools/geometry/vpPlane.cpp - tools/geometry/vpRect.cpp - tools/geometry/vpTriangle.cpp - tools/geometry/vpPolygon.cpp - tools/histogram/vpHistogram.cpp - tools/histogram/vpHistogramPeak.cpp - tools/histogram/vpHistogramValey.cpp - tools/io/vpIoTools.cpp - tools/io/vpKeyboard.cpp - tools/io/vpParseArgv.cpp - tools/time/vpTime.cpp - ) - -IF(VISP_HAVE_X11 OR VISP_HAVE_GDI OR VISP_HAVE_OPENCV OR VISP_HAVE_D3D9 OR VISP_HAVE_GTK) - list(APPEND SRC_TOOLS tools/plot/vpPlot.cpp) - list(APPEND SRC_TOOLS tools/plot/vpPlotCurve.cpp) - list(APPEND SRC_TOOLS tools/plot/vpPlotGraph.cpp) -ENDIF() -IF(VISP_HAVE_XML2) - LIST(APPEND SRC_TOOLS tools/xml/vpXmlParser.cpp) -ENDIF() - -IF(VISP_HAVE_PARPORT) - LIST(APPEND SRC_TOOLS tools/io/vpParallelPort.cpp) -ENDIF() - -SET (SRC_TRACKING - tracking/dots/vpDot2.cpp - tracking/dots/vpDot.cpp - tracking/feature-builder/vpFeatureBuilderEllipse.cpp - tracking/feature-builder/vpFeatureBuilderLine.cpp - tracking/feature-builder/vpFeatureBuilderPoint3D.cpp - tracking/feature-builder/vpFeatureBuilderPoint.cpp - tracking/feature-builder/vpFeatureBuilderPointPolar.cpp - tracking/feature-builder/vpFeatureBuilderSegment.cpp - tracking/feature-builder/vpFeatureBuilderVanishingPoint.cpp - tracking/forward-projection/vpCircle.cpp - tracking/forward-projection/vpCylinder.cpp - tracking/forward-projection/vpForwardProjection.cpp - tracking/forward-projection/vpLine.cpp - tracking/forward-projection/vpPoint.cpp - tracking/forward-projection/vpSphere.cpp - tracking/general-tracking-issues/vpTracker.cpp - tracking/moving-edges/vpMe.cpp - tracking/moving-edges/vpMeEllipse.cpp - tracking/moving-edges/vpMeLine.cpp - tracking/moving-edges/vpMeSite.cpp - tracking/moving-edges/vpMeTracker.cpp - tracking/moving-edges/vpMeNurbs.cpp - - tracking/mbt/vpMbTracker.cpp - tracking/mbt/vpMbtPolygon.cpp - tracking/mbt/edge/vpMbEdgeTracker.cpp - tracking/mbt/edge/vpMbtDistanceCircle.cpp - tracking/mbt/edge/vpMbtDistanceCylinder.cpp - tracking/mbt/edge/vpMbtDistanceLine.cpp - tracking/mbt/edge/vpMbtMeEllipse.cpp - tracking/mbt/edge/vpMbtMeLine.cpp - - tracking/moments/vpMoment.cpp - tracking/moments/vpMomentAlpha.cpp - tracking/moments/vpMomentArea.cpp - tracking/moments/vpMomentAreaNormalized.cpp - tracking/moments/vpMomentBasic.cpp - tracking/moments/vpMomentCentered.cpp - tracking/moments/vpMomentCInvariant.cpp - tracking/moments/vpMomentCommon.cpp - tracking/moments/vpMomentDatabase.cpp - tracking/moments/vpMomentGravityCenter.cpp - tracking/moments/vpMomentGravityCenterNormalized.cpp - tracking/moments/vpMomentObject.cpp - - tracking/template-tracker/vpTemplateTracker.cpp - tracking/template-tracker/ssd/vpTemplateTrackerSSD.cpp - tracking/template-tracker/ssd/vpTemplateTrackerSSDESM.cpp - tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardAdditional.cpp - tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardCompositional.cpp - tracking/template-tracker/ssd/vpTemplateTrackerSSDInverseCompositional.cpp - tracking/template-tracker/zncc/vpTemplateTrackerZNCC.cpp - tracking/template-tracker/zncc/vpTemplateTrackerZNCCForwardAdditional.cpp - tracking/template-tracker/zncc/vpTemplateTrackerZNCCInverseCompositional.cpp - tracking/template-tracker/tools/vpTemplateTrackerBSpline.cpp - tracking/template-tracker/tools/vpTemplateTrackerZone.cpp - tracking/template-tracker/tools/vpTemplateTrackerTriangle.cpp - tracking/template-tracker/warp/vpTemplateTrackerWarp.cpp - tracking/template-tracker/warp/vpTemplateTrackerWarpAffine.cpp - tracking/template-tracker/warp/vpTemplateTrackerWarpHomography.cpp - tracking/template-tracker/warp/vpTemplateTrackerWarpHomographySL3.cpp - tracking/template-tracker/warp/vpTemplateTrackerWarpSRT.cpp - tracking/template-tracker/warp/vpTemplateTrackerWarpTranslation.cpp - ) - -if(VISP_HAVE_XML2) - list(APPEND SRC_TRACKING tracking/mbt/vpMbXmlParser.cpp) - list(APPEND SRC_TRACKING tracking/mbt/edge/vpMbtXmlParser.cpp) - list(APPEND SRC_TRACKING tracking/mbt/klt/vpMbtKltXmlParser.cpp) - list(APPEND SRC_TRACKING tracking/mbt/hybrid/vpMbtEdgeKltXmlParser.cpp) -endif() - -if(VISP_HAVE_OPENCV) - list(APPEND SRC_TRACKING detection/face/vpDetectorFace.cpp) - list(APPEND SRC_TRACKING tracking/klt/vpKltOpencv.cpp) - list(APPEND SRC_TRACKING tracking/mbt/hybrid/vpMbEdgeKltTracker.cpp) - list(APPEND SRC_TRACKING tracking/mbt/klt/vpMbtDistanceKltPoints.cpp) - list(APPEND SRC_TRACKING tracking/mbt/klt/vpMbKltTracker.cpp) -endif() - -SET (SRC_VIDEO - video/vpVideoReader.cpp - video/vpVideoWriter.cpp - ) - -IF(VISP_HAVE_FFMPEG) - LIST(APPEND SRC_VIDEO video/vpFFMPEG.cpp) -ENDIF() - -SET (SRC_DEVICE_DISPLAY - device/display/vpDisplay.cpp - ) - -IF(VISP_HAVE_GTK) - LIST(APPEND SRC_DEVICE_DISPLAY device/display/vpDisplayGTK.cpp) -ENDIF() -IF(VISP_HAVE_OPENCV) - LIST(APPEND SRC_DEVICE_DISPLAY device/display/vpDisplayOpenCV.cpp) -ENDIF() -IF(VISP_HAVE_X11) - LIST(APPEND SRC_DEVICE_DISPLAY device/display/vpDisplayX.cpp) -ENDIF() - -IF(WIN32) - LIST(APPEND SRC_DEVICE_DISPLAY device/display/windows/vpDisplayWin32.cpp) - LIST(APPEND SRC_DEVICE_DISPLAY device/display/windows/vpWin32Window.cpp) -ENDIF() -IF(VISP_HAVE_GDI) - LIST(APPEND SRC_DEVICE_DISPLAY device/display/windows/vpGDIRenderer.cpp) - LIST(APPEND SRC_DEVICE_DISPLAY device/display/windows/vpWin32API.cpp) - LIST(APPEND SRC_DEVICE_DISPLAY device/display/windows/vpDisplayGDI.cpp) -ENDIF() -IF(VISP_HAVE_D3D9) - LIST(APPEND SRC_DEVICE_DISPLAY device/display/windows/vpD3DRenderer.cpp) - LIST(APPEND SRC_DEVICE_DISPLAY device/display/windows/vpDisplayD3D.cpp) -ENDIF() - -SET (SRC_VISUAL_FEATURE - visual-feature/vpBasicFeature.cpp - visual-feature/vpFeatureDepth.cpp - visual-feature/vpFeatureDisplay.cpp - visual-feature/vpFeatureEllipse.cpp - visual-feature/vpFeatureLine.cpp - visual-feature/vpFeatureLuminance.cpp - visual-feature/vpFeatureMoment.cpp - visual-feature/vpFeatureMomentAlpha.cpp - visual-feature/vpFeatureMomentArea.cpp - visual-feature/vpFeatureMomentAreaNormalized.cpp - visual-feature/vpFeatureMomentBasic.cpp - visual-feature/vpFeatureMomentCentered.cpp - visual-feature/vpFeatureMomentCInvariant.cpp - visual-feature/vpFeatureMomentCommon.cpp - visual-feature/vpFeatureMomentDatabase.cpp - visual-feature/vpFeatureMomentGravityCenter.cpp - visual-feature/vpFeatureMomentGravityCenterNormalized.cpp - visual-feature/vpFeaturePoint3D.cpp - visual-feature/vpFeaturePoint.cpp - visual-feature/vpFeaturePointPolar.cpp - visual-feature/vpFeatureThetaU.cpp - visual-feature/vpFeatureTranslation.cpp - visual-feature/vpFeatureVanishingPoint.cpp - visual-feature/vpFeatureSegment.cpp - visual-feature/vpGenericFeature.cpp - ) - -SET (SRC_NETWORK - network/vpNetwork.cpp - network/vpServer.cpp - network/vpClient.cpp - network/vpRequest.cpp - ) - -SET (SRC_ALL - ${SRC_CAMERA} - ${SRC_COMPUTER_VISION} - ${SRC_EXCEPTION} - ${SRC_DETECTION} - ${SRC_DEVICE_DISPLAY} - ${SRC_DEVICE_FRAMEGRABBER} - ${SRC_DEVICE_KINECT} - ${SRC_DEVICE_LASERSCANNER} - ${SRC_DEVICE_LIGHT} - ${SRC_IMAGE} - ${SRC_KEY_POINT} - ${SRC_MATH} - ${SRC_ROBOT} - ${SRC_SERVO} - ${SRC_SIMULATOR} - ${SRC_TOOLS} - ${SRC_TRACKING} - ${SRC_VIDEO} - ${SRC_VISUAL_FEATURE} - ${SRC_NETWORK} - ) - diff --git a/CTestConfig.cmake b/CTestConfig.cmake index e35b40d7588b85ea2f73f424274d8adf44b3c265..4d3982deabefb6dc8947f9df4c4b766506d54761 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CTestConfig.cmake,v 1.9 2008-12-11 13:19:44 fspindle Exp $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -52,12 +49,12 @@ set(CTEST_DROP_SITE_CDASH TRUE) # on the ViSP dashboard http://cdash.irisa.fr/CDash/ #-------------------------------------------------------------------- # Start with the short system name, e.g. "Linux", "FreeBSD" or "Windows" -IF(BUILDNAME) - SET(BUILDNAME "${BUILDNAME}-${CMAKE_SYSTEM_NAME}") -ELSE(BUILDNAME) +if(BUILDNAME) + set(BUILDNAME "${BUILDNAME}-${CMAKE_SYSTEM_NAME}") +else(BUILDNAME) # To suppress the first space if BUILDNAME is not set - SET(BUILDNAME "${CMAKE_SYSTEM_NAME}") -ENDIF(BUILDNAME) + set(BUILDNAME "${CMAKE_SYSTEM_NAME}") +endif(BUILDNAME) # Add i386 or amd64 if(CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -89,56 +86,56 @@ elseif(MINGW) set(BUILDNAME "${BUILDNAME}-mingw") else() # g++ - SET(BUILDNAME "${BUILDNAME}-${CMAKE_BASE_NAME}") + set(BUILDNAME "${BUILDNAME}-${CMAKE_BASE_NAME}") endif() # Find out the version of gcc being used. -IF(CMAKE_COMPILER_IS_GNUCC) - EXEC_PROGRAM(${CMAKE_CXX_COMPILER} +if(CMAKE_COMPILER_IS_GNUCC) + exec_program(${CMAKE_CXX_COMPILER} ARGS -dumpversion OUTPUT_VARIABLE COMPILER_VERSION ) - #MESSAGE("COMPILER_VERSION 1: ${COMPILER_VERSION}") - STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.[0-9].*" "\\1\\2" + #message("COMPILER_VERSION 1: ${COMPILER_VERSION}") + string(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.[0-9].*" "\\1\\2" COMPILER_VERSION ${COMPILER_VERSION}) - #MESSAGE("COMPILER_VERSION 2: ${COMPILER_VERSION}") + #message("COMPILER_VERSION 2: ${COMPILER_VERSION}") - SET(BUILDNAME "${BUILDNAME}${COMPILER_VERSION}") + set(BUILDNAME "${BUILDNAME}${COMPILER_VERSION}") -ENDIF(CMAKE_COMPILER_IS_GNUCC) +endif(CMAKE_COMPILER_IS_GNUCC) # Add the type of library generation, e.g. "Dynamic or Static" -IF(BUILD_SHARED_LIBS) - SET(BUILDNAME "${BUILDNAME}-Dyn") -ELSE(BUILD_SHARED_LIBS) - SET(BUILDNAME "${BUILDNAME}-Sta") -ENDIF(BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) + set(BUILDNAME "${BUILDNAME}-Dyn") +else(BUILD_SHARED_LIBS) + set(BUILDNAME "${BUILDNAME}-Sta") +endif(BUILD_SHARED_LIBS) # Add the build type, e.g. "Debug, Release..." -IF(CMAKE_BUILD_TYPE) - SET(BUILDNAME "${BUILDNAME}-${CMAKE_BUILD_TYPE}") -ENDIF(CMAKE_BUILD_TYPE) +if(CMAKE_BUILD_TYPE) + set(BUILDNAME "${BUILDNAME}-${CMAKE_BUILD_TYPE}") +endif(CMAKE_BUILD_TYPE) #---- Robots ---- # Add specific Afma4 robots -IF(VISP_HAVE_AFMA4) - SET(BUILDNAME "${BUILDNAME}-Afma4") -ENDIF(VISP_HAVE_AFMA4) +if(VISP_HAVE_AFMA4) + set(BUILDNAME "${BUILDNAME}-Afma4") +endif(VISP_HAVE_AFMA4) # Add specific Afma6 robots -IF(VISP_HAVE_AFMA6) - SET(BUILDNAME "${BUILDNAME}-Afma6") -ENDIF(VISP_HAVE_AFMA6) +if(VISP_HAVE_AFMA6) + set(BUILDNAME "${BUILDNAME}-Afma6") +endif(VISP_HAVE_AFMA6) # Add specific Ptu46 robots -IF(VISP_HAVE_PTU46) - SET(BUILDNAME "${BUILDNAME}-Ptu46") -ENDIF(VISP_HAVE_PTU46) +if(VISP_HAVE_PTU46) + set(BUILDNAME "${BUILDNAME}-Ptu46") +endif(VISP_HAVE_PTU46) # Add specific Biclops robots -IF(VISP_HAVE_BICLOPS) - SET(BUILDNAME "${BUILDNAME}-Biclops") -ENDIF(VISP_HAVE_BICLOPS) +if(VISP_HAVE_BICLOPS) + set(BUILDNAME "${BUILDNAME}-Biclops") +endif(VISP_HAVE_BICLOPS) # Add specific Pioneer robots if(VISP_HAVE_PIONEER) @@ -147,44 +144,44 @@ endif() #---- Framegrabers ---- # Firewire dc1394-2.x -IF(VISP_HAVE_DC1394_2) - SET(BUILDNAME "${BUILDNAME}-dc1394") -ENDIF(VISP_HAVE_DC1394_2) +if(VISP_HAVE_DC1394) + set(BUILDNAME "${BUILDNAME}-dc1394") +endif(VISP_HAVE_DC1394) # Video 4 linux 2 (V4L2) -IF(VISP_HAVE_V4L2) - SET(BUILDNAME "${BUILDNAME}-v4l2") -ENDIF(VISP_HAVE_V4L2) +if(VISP_HAVE_V4L2) + set(BUILDNAME "${BUILDNAME}-v4l2") +endif(VISP_HAVE_V4L2) # Directshow -IF(VISP_HAVE_DIRECTSHOW) - SET(BUILDNAME "${BUILDNAME}-dshow") -ENDIF(VISP_HAVE_DIRECTSHOW) -IF(VISP_HAVE_CMU1394) - SET(BUILDNAME "${BUILDNAME}-CMU1394") -ENDIF(VISP_HAVE_CMU1394) -IF(VISP_HAVE_LIBFREENECT) - SET(BUILDNAME "${BUILDNAME}-freenect") -ENDIF() -IF(VISP_HAVE_LIBUSB_1) - SET(BUILDNAME "${BUILDNAME}-usb") -ENDIF() +if(VISP_HAVE_DIRECTSHOW) + set(BUILDNAME "${BUILDNAME}-dshow") +endif(VISP_HAVE_DIRECTSHOW) +if(VISP_HAVE_CMU1394) + set(BUILDNAME "${BUILDNAME}-CMU1394") +endif(VISP_HAVE_CMU1394) +if(VISP_HAVE_LIBFREENECT) + set(BUILDNAME "${BUILDNAME}-freenect") +endif() +if(VISP_HAVE_LIBUSB_1) + set(BUILDNAME "${BUILDNAME}-usb") +endif() #---- Video-devices ---- # X11 -IF(VISP_HAVE_X11) - SET(BUILDNAME "${BUILDNAME}-X11") -ENDIF(VISP_HAVE_X11) +if(VISP_HAVE_X11) + set(BUILDNAME "${BUILDNAME}-X11") +endif(VISP_HAVE_X11) # GTK -IF(VISP_HAVE_GTK) - SET(BUILDNAME "${BUILDNAME}-gtk") -ENDIF(VISP_HAVE_GTK) +if(VISP_HAVE_GTK) + set(BUILDNAME "${BUILDNAME}-gtk") +endif(VISP_HAVE_GTK) # GDI (Windows Graphics Device Interface) -IF(VISP_HAVE_GDI) - SET(BUILDNAME "${BUILDNAME}-gdi") -ENDIF(VISP_HAVE_GDI) +if(VISP_HAVE_GDI) + set(BUILDNAME "${BUILDNAME}-gdi") +endif(VISP_HAVE_GDI) # D3D (Direct3D9) -IF(VISP_HAVE_D3D9) - SET(BUILDNAME "${BUILDNAME}-Direct3D") -ENDIF(VISP_HAVE_D3D9) +if(VISP_HAVE_D3D9) + set(BUILDNAME "${BUILDNAME}-Direct3D") +endif(VISP_HAVE_D3D9) # OpenCV if(VISP_HAVE_OPENCV) if(OpenCV_VERSION) @@ -200,56 +197,56 @@ endif(VISP_HAVE_OPENCV) #---- Mathematics ---- # Lapack (Linear Algebra PACKage) -IF(VISP_HAVE_LAPACK) - SET(BUILDNAME "${BUILDNAME}-lapack") -ENDIF() +if(VISP_HAVE_LAPACK_C) + set(BUILDNAME "${BUILDNAME}-lapack") +endif() # GSL (Gnu Scientific Library) -IF(VISP_HAVE_GSL) - SET(BUILDNAME "${BUILDNAME}-gsl") -ENDIF(VISP_HAVE_GSL) +if(VISP_HAVE_GSL) + set(BUILDNAME "${BUILDNAME}-gsl") +endif(VISP_HAVE_GSL) #---- Simulator ---- # Ogre -IF(VISP_HAVE_OGRE) - SET(BUILDNAME "${BUILDNAME}-Ogre") -ENDIF() -IF(VISP_HAVE_OIS) - SET(BUILDNAME "${BUILDNAME}-OIS") -ENDIF() +if(VISP_HAVE_OGRE) + set(BUILDNAME "${BUILDNAME}-Ogre") +endif() +if(VISP_HAVE_OIS) + set(BUILDNAME "${BUILDNAME}-OIS") +endif() # Coin -IF(VISP_HAVE_COIN) - SET(BUILDNAME "${BUILDNAME}-Coin") -ENDIF(VISP_HAVE_COIN) +if(VISP_HAVE_COIN3D) + set(BUILDNAME "${BUILDNAME}-Coin") +endif(VISP_HAVE_COIN3D) # SoQt -IF(VISP_HAVE_SOQT) - SET(BUILDNAME "${BUILDNAME}-SoQt") -ENDIF(VISP_HAVE_SOQT) +if(VISP_HAVE_SOQT) + set(BUILDNAME "${BUILDNAME}-SoQt") +endif(VISP_HAVE_SOQT) # Qt -IF(VISP_HAVE_QT) - SET(BUILDNAME "${BUILDNAME}-Qt${DESIRED_QT_VERSION}") -ENDIF(VISP_HAVE_QT) +if(VISP_HAVE_QT) + set(BUILDNAME "${BUILDNAME}-Qt${DESIRED_QT_VERSION}") +endif(VISP_HAVE_QT) # SoWin -IF(VISP_HAVE_SOWIN) - SET(BUILDNAME "${BUILDNAME}-SoWin") -ENDIF(VISP_HAVE_SOWIN) +if(VISP_HAVE_SOWIN) + set(BUILDNAME "${BUILDNAME}-SoWin") +endif(VISP_HAVE_SOWIN) # SoXt -IF(VISP_HAVE_SOXT) - SET(BUILDNAME "${BUILDNAME}-SoXt") -ENDIF(VISP_HAVE_SOXT) +if(VISP_HAVE_SOXT) + set(BUILDNAME "${BUILDNAME}-SoXt") +endif(VISP_HAVE_SOXT) #---- Images ---- -IF(VISP_HAVE_FFMPEG) - SET(BUILDNAME "${BUILDNAME}-ffmpeg") -ENDIF(VISP_HAVE_FFMPEG) -IF(VISP_HAVE_LIBJPEG) - SET(BUILDNAME "${BUILDNAME}-jpeg") -ENDIF(VISP_HAVE_LIBJPEG) -IF(VISP_HAVE_LIBPNG) - SET(BUILDNAME "${BUILDNAME}-png") -ENDIF(VISP_HAVE_LIBPNG) -IF(VISP_HAVE_ZLIB) - SET(BUILDNAME "${BUILDNAME}-zlib") -ENDIF() +if(VISP_HAVE_FFMPEG) + set(BUILDNAME "${BUILDNAME}-ffmpeg") +endif(VISP_HAVE_FFMPEG) +if(VISP_HAVE_JPEG) + set(BUILDNAME "${BUILDNAME}-jpeg") +endif(VISP_HAVE_JPEG) +if(VISP_HAVE_PNG) + set(BUILDNAME "${BUILDNAME}-png") +endif(VISP_HAVE_PNG) +#if(VISP_HAVE_ZLIB) +# set(BUILDNAME "${BUILDNAME}-zlib") +#endif() #---- Misc ---- # XML @@ -274,16 +271,21 @@ endif() #---- Special compiler flags ---- if(ACTIVATE_WARNING_STRICT_OVERFLOW) - SET(BUILDNAME "${BUILDNAME}-Wov") + set(BUILDNAME "${BUILDNAME}-Wov") endif() if(ACTIVATE_WARNING_FLOAT_EQUAL) - SET(BUILDNAME "${BUILDNAME}-Weq") + set(BUILDNAME "${BUILDNAME}-Weq") endif() if(USE_CPP11) - SET(BUILDNAME "${BUILDNAME}-c11") + set(BUILDNAME "${BUILDNAME}-c11") endif() if(MOMENTS_COMBINE_MATRICES) - SET(BUILDNAME "${BUILDNAME}-Moment") + set(BUILDNAME "${BUILDNAME}-Moment") +endif() + +#---- Suffix contrib ---- +if(VISP_CONTRIB_MODULES_PATH) + set(BUILDNAME "${BUILDNAME}-contrib") endif() -#MESSAGE("BUILDNAME=${BUILDNAME}") +#message("BUILDNAME=${BUILDNAME}") diff --git a/ChangeLog b/ChangeLog index 9d8a0a7ba34de62a8320db1d6a58085f4580eb5e..6e5a8ebc9ddc0de9bf459a4da0bb9805a6497015 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,77 @@ http://team.inria.fr/lagadic +ViSP 3.0.0 (released December 18th, 2015) + - New features + . Compatibility with Windows 8.1 and 10 + . Compatibility with Microsoft Visual C++ 2015 (MSCV 14) + . Compatibility with Odroid XU4 + . Source code migrates to GitHub: http://github.org/lagadic/visp + . Introduce Travis continuous integration + . New website: http://visp.inria.fr + . Reorganize source in modules (core, vision, mbt, tt, …) with a library + per module named libvisp_<module>. Keep compat with previous releases. + . Allow to link contributions to ViSP source code using + VISP_CONTRIB_MODULES_PATH CMake var; + see http://github.org/lagadic/visp_contrib + . Model-based tracker: + + New visibility tests based on the scanline rendering algorithm. + + Improve Ogre3D visibility tests in order to use it in a probalistic + approach via the setNbRayCastingAttemptsForVisibility() + and setGoodNbRayCastingAttemptsRatio() functions. + + Introduction of cylinder tracking with the model-based trackers using + key points. + + Improve the setPose() functionnality to use the given pose as a + prediction of the key points position while using vpMbKltTracker and + vpMbEdgeKltTracker. + . Introduce vpArray2D template class that is inherited by all matrices and + vectors. + . vpKeyPoint class: + + Full code compatibility with OpenCV 3.0. + + Add support to the new Features introduce in OpenCV 3.0 and contrib + module releases. + + Add possibility to detect keypoints on an image pyramid with OpenCV 3.0. + + Add possibility to change the image type (jpeg, png, ppm, pgm) when + saving a learning file. + + Add OpenMP support for Affine SIFT. + + Add single matching filter (discard pairs of keypoints where multiple + query keypoints are matched to the same train keypoints). + + Add possibility to match train keypoints to query keypoints (could be + useful when we learn only on one image, it allows to avoid to match + background keypoints with train keypoints). + + Optimize the FLANN matching by learning once the train descriptors + instead of doing it at each call of the matching function (noticeable + with large train descriptors). + + Add possibility to use the FLANN matcher with binary descriptors. + + Fix displayMatching function and fix small memory leak in loadLearningData. + + Should be possible to read / write learning files in binary mode regardless + of the endianness of the host (need to be tested on a real case). + + Save learning files in XML mode with the full precision (according to + the data type). + . and a lot of improvements and fixes + - Tutorials + . New tutorial: Bridge over OpenCV + . New tutorial: Installation from source with Homebrew + . Update all the installation tutorials since GitHub migration and modules + introduction and make more explicit 3rd party installation + . Update tutorial: Markerless 3D model-based tracking + - Bug fixed + . [18748] Ogre and wireframe resources not found after ViSP installation + . [18823] vpMatrix::kernel method returns false result if matrix has + less rows than columns + . [18939] vpParseArgv::ARGV_CONSTANT segfault + . [19312] Model-based tracker unable to initialize the number of cylinder + or circle from cao file + . [19326] segfault when using vpDisplayX::init(unsigned int, unsigned int, ...) + . [19368] Invalid rotation parameters in vpSimulatorViper850::getPosition() + . [#3] Issue when comparing two vpRGBa + . [#5] Unable to get calibration matrix K when model with distorsion is + used + . [#6] Issue with vpMath::round() + . [#18] Issues with vpColVector::median() + with assignment operator of + vpRowVector + with vpRowVector::normalize() function + +---------------------------------------------- ViSP 2.10.0 (released February 13th, 2015) - New features . New object detection and localisation capabilities that allow to diff --git a/INSTALL.txt b/INSTALL.txt index f39d4f03891e6dafe5c70757faa11b6612c3067b..5c349f1a9e824dd791687085e4ae78aa0a73ea62 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -1,8 +1,8 @@ - ViSP-2.7.0 + ViSP Visual Servoing Platform - Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - www: http://www.irisa.fr/lagadic + Copyright (C) 2005 - 2015 by Inria. All rights reserved. + http://visp.inria.fr @@ -56,14 +56,14 @@ directly if you prefer command line instead of graphical interface. (5) install: > make install -Copy headers in ${CMAKE_INSTALL_PREFIX}/include/visp +Copy headers in ${CMAKE_INSTALL_PREFIX}/include Copy library in ${CMAKE_INSTALL_PREFIX}/lib Copy visp-config shell script in ${CMAKE_INSTALL_PREFIX}/bin (6) uninstall: > make uninstall Dual from install. -Remove headers in ${CMAKE_INSTALL_PREFIX}/include/visp +Remove headers in ${CMAKE_INSTALL_PREFIX}/include Remove library and cmake files in ${CMAKE_INSTALL_PREFIX}/lib Remove visp-config shell script in ${CMAKE_INSTALL_PREFIX}/bin @@ -71,17 +71,8 @@ Remove visp-config shell script in ${CMAKE_INSTALL_PREFIX}/bin > make clean The "make clean" target will remove files generated by the compiler and linker. -(8) distclean: -> sh ./distclean.sh -CMake does not generate a "make distclean" target (see the cmake FAQ). CMake -generates many files related to the build system, but since CMakeLists.txt -files can run scripts and other arbitrary commands, there is no way it can keep -track of exactly which files are generated as part of running CMake. So we -have developped a distclean shell script (working under Unix platforms) that -removes these files related to the build system. - (8) documentation -> make html-doc +> make visp_doc Generate doxygen html documentation in doc/html. See README.txt for further information. diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..dd4973f6462264cb4fe4811b6a02ad05e44ca02c --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +### ViSP: Open source Visual Servoing Platform + +[](https://travis-ci.org/lagadic/visp) + +#### Resources +- Homepage: http://visp.inria.fr +- Wiki: https://github.com/lagadic/visp/wiki +- Code documentation: http://visp-doc.inria.fr/doxygen/visp-daily +- Q&A forum: http://gforge.inria.fr/forum/?group_id=397 +- Issue tracking: https://github.com/lagadic/visp/issues + +#### Contributing + +Please read before starting work on a pull request: http://visp.inria.fr/contributing-code/ + diff --git a/README.txt b/README.txt deleted file mode 100644 index db3a910ec463154ce4edcae894c997bb256d5213..0000000000000000000000000000000000000000 --- a/README.txt +++ /dev/null @@ -1,274 +0,0 @@ - ViSP-2.10.0 - Visual Servoing Platform - - Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - www: http://www.irisa.fr/lagadic - - - -This project is using the CMake build system. - -CMake is a complete stand-alone platform-independant build-system -replacing autotools (autoconf/autoheader/automake/libtools) completely. -It depends just on installed cmake (tested with cmake cvs version). It -needs a cmake 2.6.x or more recent version of cmake. -See http://www.cmake.org for details. - -USAGE: -===== - -1. Install the newest cmake from www.cmake.org - - See INSTALL file for further information. - -2. Check out/install ViSP source code - - Checkout, copy or unzip the ViSP tar ball in <visp source dir>. - - For building you have got the option of "in-source" or "out-of-source" - builds. CMake developpers strongly recommend using an "out-of-source" build - which never writes any files to the source tree. Using a separate source and - build tree greatly reduces the need for "make clean" and "make distclean" - targets. - -2.1 In-source build under Unix platforms: - - cd <visp source dir>; - ccmake . - or for defaults: cmake . - make - make install - - The make install step is needed if you want to use ViSP in your own - projects. To do the installation, you don't need to be root. - -2.2 Out-of-source build under Unix platforms: - - The out-of-source build is very useful for different parallel build - configurations: - - mkdir <visp build dir> - cd <visp build dir> - ccmake <visp source dir> - or for defaults: cmake <source dir> - make - make install - - The make install step is needed if you want to use ViSP in your own - projects. To do the installation, you don't need to be root. - - -2.3 Build under Win32 - - Use cmake or CMakeSetup Gui for in-source or out-of-source build. - Set environment variables and proceed as described for Unix. - - - -Important Files: -=============== - -- CMakeLists.txt: - Overall configuration file. Detect third party libraries (X11, GTK, ...). - -- CMakeHeaderFileList.cmake: - The list of all the headers (*.h) or (*.t.cpp for templates) to copy - in <visp source dir>/include/visp directory or to install in - <visp install prefix>/include/visp - -- CMakeSourceFileList.cmake: - The list of all the sources (*.cpp) used to build the ViSP library. - -- src/CMakeLists.txt: - Build the library in <visp source dir>/lib. - -- include/vpConfig.h.in versus include/visp/vpConfig.h: - vpConfig.h.in is the source for vpConfig.h. - vpConfig.h is generated in CMakeList.txt by the command - CONFIGURE_FILE(${VISP_SOURCE_DIR}/include/vpConfig.h.cmake - ${VISP_INCLUDE_DIR}/vpConfig.h - vpConfig.h contains preprocessor defines like VISP_HAVE_X11 and is . - included in most header files (*.h) to allow system dependent code usage - -- CMakeModule/visp-config.in versus bin/visp-config: - visp-config is a shell script for third party projects not using cmake to - get hold of prefix, cflags, libs and version. - It is generated from visp-config.in by the module - CMakeModules/GenerateConfigScript.cmake in CMakeList.txt. - -- lib/VISPBuildSettings.cmake: - SET commands for most important variables, i.e. - PROJECT_NAME - CMAKE_VERSION - C(XX)_COMPILER - C(XX)_FLAGS(_*) - BUILD_TYPE - BUILD_TOOL - It can be included from third cmake projects. - -- CMakeModules/VISPConfig.cmake.in / lib/VISPConfig.cmake: - VISPConfig.cmake contains SET command for some basic variables like - VISP_INCLUDE_DIR, VISP_LINK_DIRECTORIES, VISP_BUILD_SETTINGS_FILE, - VISP_SOURCE_DIR, VISP_LIBRARIES and VISP_USE_FILE - VISPConfig.cmake can be used by by third cmake projects to make these - variables available. - VISPConfig.cmake.in is the source for VISPConfig.cmake - - -HOWTO: -====== - -1. Change configuration: - --------------------- - - You can change configuration easily with ccmake GUI. - ccmake <source dir> - type 't' to toggle display of advanced variables - or - cmake -LA <source dir> - to have the list of all configuration variables. - - -2. Do a optimized build: - -------------------- - cmake -DCMAKE_BUILD_TYPE=Release <visp source dir> - - or use ccmake <visp source dir> to set CMAKE_BUILD_TYPE. - - Available build types are: Release, Debug, RelWithDebInfo, MinSizeRel. - The build process uses specific build variable CMAKE_CXX_FLAGS_*. - For example Release build uses CMAKE_CXX_FLAGS_RELEASE, while Debug - build uses CMAKE_CXX_FLAGS_DEBUG. - - The flags according to the different build types can be seen with - cmake -LA <source_dir> - - -3. Build shared libraries: - ----------------------- - cmake -DBUILD_SHARED_LIBS=ON <visp source dir> - - or use ccmake <visp source dir> to set BUILD_SHARED_LIBS. - - Produce shared libraries (.so). - - -4. Build static libraries: - ----------------------- - cmake -DBUILD_SHARED_LIBS=OFF <visp source dir> - - or use ccmake <visp source dir> to set BUILD_SHARED_LIBS. - - Produce static libraries (.a). - - -5. Add more files to clean target: - ------------------------------ - SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES - "file_to_remove") - - - -6. Use ViSP with another cmake project: - ----------------------------------- - Include the following into your CMakeList.txt: - - FIND_PACKAGE(VISP REQUIRED) - IF(VISP_FOUND) - INCLUDE(${VISP_USE_FILE}) - ENDIF(VISP_FOUND) - - With CMake GUI set the environment variable VISP_DIR to - <visp install prefix>/lib - or using a command line run: - `cmake -DVISP_DIR=<visp install prefix>/lib <project source dir>` - - -7. Use ViSP with autoconf (autotools): - ----------------------------------- - Copy the M4 macro file `macro/have_visp.m4` in your project. - - cp macro/have_visp.m4 <your project home dir>/macro - - This macro check if <visp install prefix>/bin/visp-config shell script - is available (see below how to use ViSP with a common Makefile). - - In your configure.ac project file add lines like: - - AC_HAVE_VISP_IFELSE(have_visp=yes,have_visp=no) - if test "x$have_visp" = "xyes"; then - CXXFLAGS="$CXXFLAGS $ac_visp_cflags " - LIBS="$LIBS $ac_visp_libs " - fi - - cd <your project home dir> - aclocal -I macro # updates the aclocal.m4 file - autoconf - configure --with-visp-install-bin=<visp install prefix>/bin - - -8. Use ViSP with a common Makefile: - ------------------------------- - a: Install ViSP: - - configure ViSP using cmake, particularly set the ViSP install prefix - (cmake -DCMAKE_INSTALL_PREFIX:PATH=<visp install prefix>) - - build ViSP: - make - - install ViSP by: - make install - b: Make sure, the visp-config shell script is found by the makefile: - export PATH=$PATH:<visp install prefix>/bin - c: Use `visp-config --prefix/--cflags/--libs/--version` - to get the compiler/linker flags needed to use ViSP - - -9. View compiler and linker options used: - ------------------------------------- - cmake -DCMAKE_VERBOSE_MAKEFILE=ON <visp source dir> - - Generate more 'verbose' makefile including compiler calls instead of - default "SILENT" . - - -10. View all available options/variables: - ------------------------------------ - ccmake <source dir> - type 't' to toggle display of advanced variables - or - cmake -LA <source dir> - - -11. Remove Cache: - ------------- - cd <visp build dir> - rm CMakeCache.txt - - -12. Make a distclean: - ----------------- - CMake does not generate a "make distclean" target (see the cmake FAQ). CMake - generates many files related to the build system, but since CMakeLists.txt - files can run scripts and other arbitrary commands, there is no way it can - keep track of exactly which files are generated as part of running CMake. - - - So, for in-source build under Unix platforms, we have developped a distclean - shell script (working only under Unix platforms) that removes these files - related to the build system. To remove some intermediate files related to - the build system: sh ./distclean.sh - - For out-of-source build, just remove the <visp build dir> tree. - -13. Where to found documentation about CMake: - ---------------------------------------- - Almost complete documentation of cmake commands: - cmake --help-full and http://www.cmake.org - - The 250-page book Mastering CMake by Ken Martin and Bill Hoffman, ISBN - 1-930934-16-5, published by Kitware, Inc. - ------------------------- - -Fabien Spindler - - diff --git a/CMakeModules/AddExtraCompilationFlags.cmake b/cmake/AddExtraCompilationFlags.cmake similarity index 75% rename from CMakeModules/AddExtraCompilationFlags.cmake rename to cmake/AddExtraCompilationFlags.cmake index c75a69408173780fd15d3e62fb877e443609da69..71e34745c640985f3cdae09fbdbaf699bb88bd46 100644 --- a/CMakeModules/AddExtraCompilationFlags.cmake +++ b/cmake/AddExtraCompilationFlags.cmake @@ -1,166 +1,201 @@ -############################################################################# -# -# $Id: AddExtraCompilationFlags.cmake 4608 2014-01-21 16:37:58Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP overall configuration file. Add extra compilation flags. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -MACRO(ADD_EXTRA_COMPILATION_FLAGS) - include(CheckCXXCompilerFlag) - if(CMAKE_COMPILER_IS_GNUCXX OR MINGW) #Not only UNIX but also WIN32 for MinGW - - set(WARNING_ALL "-Wall") - CHECK_CXX_COMPILER_FLAG(${WARNING_ALL} WARNING_ALL_ALLOWED) - if(WARNING_ALL_ALLOWED) -# MESSAGE("Compiler flag ${WARNING_ALL} allowed") - set(ACTIVATE_WARNING_ALL "ON" CACHE BOOL "activate -Wall flag") - else() -# MESSAGE("Compiler flag ${WARNING_ALL} not allowed") - endif() - - set(WARNING_EXTRA "-Wextra") - CHECK_CXX_COMPILER_FLAG(${WARNING_EXTRA} WARNING_EXTRA_ALLOWED) - if(WARNING_EXTRA_ALLOWED) -# MESSAGE("Compiler flag ${WARNING_EXTRA} allowed") - set(ACTIVATE_WARNING_EXTRA "ON" CACHE BOOL "activate -Wextra flag") - else() -# MESSAGE("Compiler flag ${WARNING_EXTRA} not allowed") - endif() - - set(WARNING_STRICT_OVERFLOW "-Wstrict-overflow=5") - CHECK_CXX_COMPILER_FLAG(${WARNING_STRICT_OVERFLOW} WARNING_STRICT_OVERFLOW_ALLOWED) - if(WARNING_STRICT_OVERFLOW_ALLOWED) -# MESSAGE("Compiler flag ${WARNING_STRICT_OVERFLOW} allowed") - set(ACTIVATE_WARNING_STRICT_OVERFLOW "OFF" CACHE BOOL "activate -Wstrict-overflow=5 flag") - else() -# MESSAGE("Compiler flag ${WARNING_STRICT_OVERFLOW} not allowed") - endif() - - set(WARNING_FLOAT_EQUAL "-Wfloat-equal") - CHECK_CXX_COMPILER_FLAG(${WARNING_FLOAT_EQUAL} WARNING_FLOAT_EQUAL_ALLOWED) - if(WARNING_FLOAT_EQUAL_ALLOWED) -# MESSAGE("Compiler flag ${WARNING_FLOAT_EQUAL} allowed") - set(ACTIVATE_WARNING_FLOAT_EQUAL "OFF" CACHE BOOL "activate -Wfloat-equal flag") - else() -# MESSAGE("Compiler flag ${WARNING_FLOAT_EQUAL} not allowed") - endif() - - set(WARNING_SIGN_CONVERSION "-Wsign-conversion") - CHECK_CXX_COMPILER_FLAG(${WARNING_SIGN_CONVERSION} WARNING_SIGN_CONVERSION_ALLOWED) - if(WARNING_SIGN_CONVERSION_ALLOWED) -# MESSAGE("Compiler flag ${WARNING_SIGN_CONVERSION} allowed") - set(ACTIVATE_WARNING_SIGN_CONVERSION "OFF" CACHE BOOL "activate -Wsign-conversion flag") - else() -# MESSAGE("Compiler flag ${WARNING_SIGN_CONVERSION} not allowed") - endif() - - if(ACTIVATE_WARNING_ALL) - list(APPEND CMAKE_CXX_FLAGS ${WARNING_ALL}) - else() - string(REPLACE ${WARNING_ALL} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - endif() - if(ACTIVATE_WARNING_EXTRA) - list(APPEND CMAKE_CXX_FLAGS ${WARNING_EXTRA}) - else() - string(REPLACE ${WARNING_EXTRA} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - endif() - if(ACTIVATE_WARNING_STRICT_OVERFLOW) - list(APPEND CMAKE_CXX_FLAGS ${WARNING_STRICT_OVERFLOW}) - list(APPEND CMAKE_C_FLAGS ${WARNING_STRICT_OVERFLOW}) - else() - string(REPLACE ${WARNING_STRICT_OVERFLOW} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - string(REPLACE ${WARNING_STRICT_OVERFLOW} "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - endif() - if(ACTIVATE_WARNING_FLOAT_EQUAL) - list(APPEND CMAKE_CXX_FLAGS ${WARNING_FLOAT_EQUAL}) - else() - string(REPLACE ${WARNING_FLOAT_EQUAL} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - endif() - if(ACTIVATE_WARNING_SIGN_CONVERSION) - list(APPEND CMAKE_CXX_FLAGS ${WARNING_SIGN_CONVERSION}) - else() - string(REPLACE ${WARNING_SIGN_CONVERSION} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - endif() - - elseif(MSVC) - # Add specific compilation flags for Windows Visual - - set(WARNING_ALL "/Wall") - CHECK_CXX_COMPILER_FLAG(${WARNING_ALL} WARNING_ALL_ALLOWED) - if(WARNING_ALL_ALLOWED) - #MESSAGE("Compiler flag ${WARNING_ALL} allowed") - set(ACTIVATE_WARNING_ALL "OFF" CACHE BOOL "activate /Wall flag") - else() - #MESSAGE("Compiler flag ${WARNING_ALL} not allowed") - endif() - - if(ACTIVATE_WARNING_ALL) - list(APPEND CMAKE_CXX_FLAGS ${WARNING_ALL}) - else() - string(REPLACE ${WARNING_ALL} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - endif() - if(MSVC80 OR MSVC90 OR MSVC10 OR MSVC11) - # To avoid compiler warning (level 4) C4571, compile with /EHa if you still want - # your catch(...) blocks to catch structured exceptions. - list(APPEND CMAKE_CXX_FLAGS "/EHa") - endif() - endif() - - # If compiler support symbol visibility, enable it. - include(CheckCCompilerFlag) - check_c_compiler_flag(-fvisibility=hidden HAS_VISIBILITY) - if (HAS_VISIBILITY) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") - endif() - - if(UNIX) - if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") - endif() - endif() - - # Remove duplicates compilation flags - separate_arguments(CMAKE_CXX_FLAGS) - list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS) - string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "common C++ build flags" FORCE) - separate_arguments(CMAKE_C_FLAGS) - list(REMOVE_DUPLICATES CMAKE_C_FLAGS) - string(REPLACE ";" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "common C build flags" FORCE) - - #message("CMAKE_CXX_FLAGS : ${CMAKE_CXX_FLAGS}") -ENDMACRO(ADD_EXTRA_COMPILATION_FLAGS) +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP overall configuration file. Add extra compilation flags. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +macro(vp_add_extra_compilation_flags) + # By default set release configuration + if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release" CACHE String "Choose the type of build, options are: None Debug Release" FORCE) + endif() + + include(CheckCXXCompilerFlag) + if(CMAKE_COMPILER_IS_GNUCXX OR MINGW OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") #Not only UNIX but also WIN32 for MinGW + + set(WARNING_ALL "-Wall") + CHECK_CXX_COMPILER_FLAG(${WARNING_ALL} WARNING_ALL_ALLOWED) + if(WARNING_ALL_ALLOWED) +# MESSAGE("Compiler flag ${WARNING_ALL} allowed") + set(ACTIVATE_WARNING_ALL "ON" CACHE BOOL "activate -Wall flag") + else() +# MESSAGE("Compiler flag ${WARNING_ALL} not allowed") + endif() + + set(WARNING_EXTRA "-Wextra") + CHECK_CXX_COMPILER_FLAG(${WARNING_EXTRA} WARNING_EXTRA_ALLOWED) + if(WARNING_EXTRA_ALLOWED) +# MESSAGE("Compiler flag ${WARNING_EXTRA} allowed") + set(ACTIVATE_WARNING_EXTRA "ON" CACHE BOOL "activate -Wextra flag") + else() +# MESSAGE("Compiler flag ${WARNING_EXTRA} not allowed") + endif() + + set(WARNING_STRICT_OVERFLOW "-Wstrict-overflow=5") + CHECK_CXX_COMPILER_FLAG(${WARNING_STRICT_OVERFLOW} WARNING_STRICT_OVERFLOW_ALLOWED) + if(WARNING_STRICT_OVERFLOW_ALLOWED) +# MESSAGE("Compiler flag ${WARNING_STRICT_OVERFLOW} allowed") + set(ACTIVATE_WARNING_STRICT_OVERFLOW "OFF" CACHE BOOL "activate -Wstrict-overflow=5 flag") + else() +# MESSAGE("Compiler flag ${WARNING_STRICT_OVERFLOW} not allowed") + endif() + + set(WARNING_FLOAT_EQUAL "-Wfloat-equal") + CHECK_CXX_COMPILER_FLAG(${WARNING_FLOAT_EQUAL} WARNING_FLOAT_EQUAL_ALLOWED) + if(WARNING_FLOAT_EQUAL_ALLOWED) +# MESSAGE("Compiler flag ${WARNING_FLOAT_EQUAL} allowed") + set(ACTIVATE_WARNING_FLOAT_EQUAL "OFF" CACHE BOOL "activate -Wfloat-equal flag") + else() +# MESSAGE("Compiler flag ${WARNING_FLOAT_EQUAL} not allowed") + endif() + + set(WARNING_SIGN_CONVERSION "-Wsign-conversion") + CHECK_CXX_COMPILER_FLAG(${WARNING_SIGN_CONVERSION} WARNING_SIGN_CONVERSION_ALLOWED) + if(WARNING_SIGN_CONVERSION_ALLOWED) +# MESSAGE("Compiler flag ${WARNING_SIGN_CONVERSION} allowed") + set(ACTIVATE_WARNING_SIGN_CONVERSION "OFF" CACHE BOOL "activate -Wsign-conversion flag") + else() +# MESSAGE("Compiler flag ${WARNING_SIGN_CONVERSION} not allowed") + endif() + + if(ACTIVATE_WARNING_ALL) + list(APPEND CMAKE_CXX_FLAGS ${WARNING_ALL}) + else() + string(REPLACE ${WARNING_ALL} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + if(ACTIVATE_WARNING_EXTRA) + list(APPEND CMAKE_CXX_FLAGS ${WARNING_EXTRA}) + else() + string(REPLACE ${WARNING_EXTRA} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + if(ACTIVATE_WARNING_STRICT_OVERFLOW) + list(APPEND CMAKE_CXX_FLAGS ${WARNING_STRICT_OVERFLOW}) + list(APPEND CMAKE_C_FLAGS ${WARNING_STRICT_OVERFLOW}) + else() + string(REPLACE ${WARNING_STRICT_OVERFLOW} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + string(REPLACE ${WARNING_STRICT_OVERFLOW} "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + endif() + if(ACTIVATE_WARNING_FLOAT_EQUAL) + list(APPEND CMAKE_CXX_FLAGS ${WARNING_FLOAT_EQUAL}) + else() + string(REPLACE ${WARNING_FLOAT_EQUAL} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + if(ACTIVATE_WARNING_SIGN_CONVERSION) + list(APPEND CMAKE_CXX_FLAGS ${WARNING_SIGN_CONVERSION}) + else() + string(REPLACE ${WARNING_SIGN_CONVERSION} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + + elseif(MSVC) + # Add specific compilation flags for Windows Visual + + set(WARNING_ALL "/Wall") + CHECK_CXX_COMPILER_FLAG(${WARNING_ALL} WARNING_ALL_ALLOWED) + if(WARNING_ALL_ALLOWED) + #MESSAGE("Compiler flag ${WARNING_ALL} allowed") + set(ACTIVATE_WARNING_ALL "OFF" CACHE BOOL "activate /Wall flag") + else() + #MESSAGE("Compiler flag ${WARNING_ALL} not allowed") + endif() + + if(ACTIVATE_WARNING_ALL) + list(APPEND CMAKE_CXX_FLAGS ${WARNING_ALL}) + else() + string(REPLACE ${WARNING_ALL} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + if(MSVC80 OR MSVC90 OR MSVC10 OR MSVC11) + # To avoid compiler warning (level 4) C4571, compile with /EHa if you still want + # your catch(...) blocks to catch structured exceptions. + list(APPEND CMAKE_CXX_FLAGS "/EHa") + endif() + endif() + + # If compiler support symbol visibility, enable it. + include(CheckCCompilerFlag) + check_c_compiler_flag(-fvisibility=hidden HAS_VISIBILITY) + if (HAS_VISIBILITY) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") + endif() + +# FS no more needed since it is added by default by CMake when build as shared +# if(UNIX) +# if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC) +# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") +# endif() +# endif() + + # OpenMP + if(USE_OPENMP) + set(VISP_OPENMP_FLAGS "${OpenMP_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + else() + set(VISP_OPENMP_FLAGS "") + if(OpenMP_CXX_FLAGS) + string(REPLACE ${OpenMP_CXX_FLAGS} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + endif() + + # C++11 + if(USE_CPP11) + set(VISP_CPP11_FLAGS "${CPP11_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPP11_CXX_FLAGS}") + else() + set(VISP_CPP11_FLAGS "") + if(CPP11_CXX_FLAGS) + string(REPLACE ${CPP11_CXX_FLAGS} "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + endif() + + if(BUILD_COVERAGE) + # Add build options for test coverage. Currently coverage is only supported + # on gcc compiler + # Because using -fprofile-arcs with shared lib can cause problems like: + # hidden symbol `__bb_init_func', we add this option only for static + # library build + message(STATUS "Add -ftest-coverage -fprofile-arcs compiler options") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs") + endif() + + # Remove duplicates compilation flags + separate_arguments(CMAKE_CXX_FLAGS) + list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS) + string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "common C++ build flags" FORCE) + separate_arguments(CMAKE_C_FLAGS) + list(REMOVE_DUPLICATES CMAKE_C_FLAGS) + string(REPLACE ";" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "common C build flags" FORCE) + + #message("CMAKE_CXX_FLAGS : ${CMAKE_CXX_FLAGS}") +endmacro(vp_add_extra_compilation_flags) diff --git a/CMakeModules/CPackConfig.cmake b/cmake/CPackConfig.cmake similarity index 87% rename from CMakeModules/CPackConfig.cmake rename to cmake/CPackConfig.cmake index cb4e00d1deed8cff98279d0bc9eb4762665f0231..b22f2808b78ac97ae2d098efef28e208bd88ed23 100644 --- a/CMakeModules/CPackConfig.cmake +++ b/cmake/CPackConfig.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CPackConfig.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -99,14 +96,14 @@ set(BUILD_SHARED_LIBS ON CACHE BOOL "Build ViSP with shared libraries." FORCE) if(WIN32 AND NOT UNIX) - include(${VISP_SOURCE_DIR}/CMakeModules/CPackConfigNsis.cmake) + include(${VISP_CMAKE_MODULE_PATH}/CPackConfigNsis.cmake) elseif(APPLE) set(CPACK_GENERATOR "PackageMaker;TBZ2") elseif(UNIX) if(BUILD_PACKAGE_DEBIAN) - include(${VISP_SOURCE_DIR}/CMakeModules/CPackConfigDeb.cmake) + include(${VISP_CMAKE_MODULE_PATH}/CPackConfigDeb.cmake) elseif(BUILD_PACKAGE_RPM) - include(${VISP_SOURCE_DIR}/CMakeModules/CPackConfigRpm.cmake) + include(${VISP_CMAKE_MODULE_PATH}/CPackConfigRpm.cmake) endif() endif() diff --git a/CMakeModules/CPackConfigDeb.cmake b/cmake/CPackConfigDeb.cmake similarity index 94% rename from CMakeModules/CPackConfigDeb.cmake rename to cmake/CPackConfigDeb.cmake index b7aaa40063454bc10bd432cc10adbb0e9142b484..116e1d997952ca116820495ddb420172a15fa69c 100644 --- a/CMakeModules/CPackConfigDeb.cmake +++ b/cmake/CPackConfigDeb.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CPackConfigDeb.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/CPackConfigNsis.cmake b/cmake/CPackConfigNsis.cmake similarity index 83% rename from CMakeModules/CPackConfigNsis.cmake rename to cmake/CPackConfigNsis.cmake index 9ccb97cd6b280c26f3cc39d3e63bb9154b6c3350..18adfec6848df1899206f61f394dead3caad728f 100644 --- a/CMakeModules/CPackConfigNsis.cmake +++ b/cmake/CPackConfigNsis.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CPackConfigNsis.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/CPackConfigRpm.cmake b/cmake/CPackConfigRpm.cmake similarity index 93% rename from CMakeModules/CPackConfigRpm.cmake rename to cmake/CPackConfigRpm.cmake index ec624e3359f8b8da02d8251d59d57a8d98a19939..0b26055077aa598321c0864ee316d18b8db3caff 100644 --- a/CMakeModules/CPackConfigRpm.cmake +++ b/cmake/CPackConfigRpm.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CPackConfigRpm.cmake 4972 2014-11-16 13:03:24Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindARIA.cmake b/cmake/FindARIA.cmake similarity index 59% rename from CMakeModules/FindARIA.cmake rename to cmake/FindARIA.cmake index e3c32aa108f28f23e944c71f2e26bda6709c1bbe..c066bc96d13fd5e850ad6ac12df785077c102d28 100644 --- a/CMakeModules/FindARIA.cmake +++ b/cmake/FindARIA.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindARIA.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -43,18 +40,20 @@ # ############################################################################# -FIND_PATH(ARIA_INCLUDE_DIR Aria.h - $ENV{ARIA_HOME}/include - /usr/local/Aria/include - /usr/Aria/include - /usr/include - /usr/local/include - "C:/Program Files/MobileRobots/Aria/include" - ) +find_path(ARIA_INCLUDE_DIR Aria.h + $ENV{ARIA_HOME}/include + /usr/local/Aria/include + /usr/Aria/include + /usr/include + /usr/include/Aria + /usr/local/include + /usr/local/include/Aria + "C:/Program Files/MobileRobots/Aria/include" +) #MESSAGE("DBG ARIA_INCLUDE_DIR=${ARIA_INCLUDE_DIR}") if(UNIX) - FIND_LIBRARY(ARIA_LIBRARY + find_library(ARIA_LIBRARY NAMES Aria PATHS $ENV{ARIA_HOME}/lib @@ -62,8 +61,8 @@ if(UNIX) /usr/Aria/lib /usr/lib /usr/local/lib - "C:/Program Files/MobileRobots/Aria/lib" - ) + "C:/Program Files/MobileRobots/Aria/lib" + ) #MESSAGE("DBG ARIA_LIBRARY=${ARIA_LIBRARY}") else() if(MSVC11) @@ -80,7 +79,7 @@ else() set(ARIA_SUFFIX_NAME "") endif() - FIND_LIBRARY(ARIA_LIBRARY_DEBUG + find_library(ARIA_LIBRARY_DEBUG NAMES AriaDebug${ARIA_SUFFIX_NAME} PATHS $ENV{ARIA_HOME}/lib @@ -88,9 +87,9 @@ else() /usr/Aria/lib /usr/lib /usr/local/lib - "C:/Program Files/MobileRobots/Aria/lib" - ) - FIND_LIBRARY(ARIA_LIBRARY_RELEASE + "C:/Program Files/MobileRobots/Aria/lib" + ) + find_library(ARIA_LIBRARY_RELEASE NAMES Aria${ARIA_SUFFIX_NAME} PATHS $ENV{ARIA_HOME}/lib @@ -98,37 +97,37 @@ else() /usr/Aria/lib /usr/lib /usr/local/lib - "C:/Program Files/MobileRobots/Aria/lib" - ) + "C:/Program Files/MobileRobots/Aria/lib" + ) endif() if(UNIX) - IF(ARIA_LIBRARY AND ARIA_INCLUDE_DIR) - SET(ARIA_INCLUDE_DIRS ${ARIA_INCLUDE_DIR}) - SET(ARIA_LIBRARIES ${ARIA_LIBRARY}) - SET(ARIA_FOUND TRUE) - ELSE() - SET(ARIA_FOUND FALSE) - ENDIF() + if(ARIA_LIBRARY AND ARIA_INCLUDE_DIR) + set(ARIA_INCLUDE_DIRS ${ARIA_INCLUDE_DIR}) + set(ARIA_LIBRARIES ${ARIA_LIBRARY}) + set(ARIA_FOUND TRUE) + else() + set(ARIA_FOUND FALSE) + endif() else() set(ARIA_LIBRARIES "") - IF(ARIA_LIBRARY_RELEASE AND ARIA_INCLUDE_DIR) - SET(ARIA_INCLUDE_DIRS ${ARIA_INCLUDE_DIR}) - LIST(APPEND ARIA_LIBRARIES optimized ${ARIA_LIBRARY_RELEASE}) - SET(ARIA_FOUND TRUE) - ENDIF() + if(ARIA_LIBRARY_RELEASE AND ARIA_INCLUDE_DIR) + set(ARIA_INCLUDE_DIRS ${ARIA_INCLUDE_DIR}) + list(APPEND ARIA_LIBRARIES optimized ${ARIA_LIBRARY_RELEASE}) + set(ARIA_FOUND TRUE) + endif() IF(ARIA_LIBRARY_DEBUG AND ARIA_INCLUDE_DIR) - SET(ARIA_INCLUDE_DIRS ${ARIA_INCLUDE_DIR}) - LIST(APPEND ARIA_LIBRARIES debug ${ARIA_LIBRARY_DEBUG}) - SET(ARIA_FOUND TRUE) - ENDIF() + set(ARIA_INCLUDE_DIRS ${ARIA_INCLUDE_DIR}) + list(APPEND ARIA_LIBRARIES debug ${ARIA_LIBRARY_DEBUG}) + set(ARIA_FOUND TRUE) + endif() endif() -MARK_AS_ADVANCED( - ARIA_INCLUDE_DIR - ARIA_LIBRARY - ARIA_LIBRARY_DEBUG - ARIA_LIBRARY_RELEASE - ) +mark_as_advanced( + ARIA_INCLUDE_DIR + ARIA_LIBRARY + ARIA_LIBRARY_DEBUG + ARIA_LIBRARY_RELEASE +) diff --git a/CMakeModules/FindBICLOPS.cmake b/cmake/FindBICLOPS.cmake similarity index 92% rename from CMakeModules/FindBICLOPS.cmake rename to cmake/FindBICLOPS.cmake index c5fa981f26d2d7461835cdeb29552b772a64e671..0a50f5b52ddf3080cf9c739b316169ecef88b004 100644 --- a/CMakeModules/FindBICLOPS.cmake +++ b/cmake/FindBICLOPS.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindBICLOPS.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindCALINUX.cmake b/cmake/FindCALINUX.cmake similarity index 87% rename from CMakeModules/FindCALINUX.cmake rename to cmake/FindCALINUX.cmake index 61571bc05fbb2954f45c6507533fa8a4928bcf74..b2844e7759bf7dde697ace7f7a079cef0e4e4b99 100644 --- a/CMakeModules/FindCALINUX.cmake +++ b/cmake/FindCALINUX.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindCALINUX.cmake 5309 2015-02-11 11:08:15Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindCMU1394.cmake b/cmake/FindCMU1394.cmake similarity index 89% rename from CMakeModules/FindCMU1394.cmake rename to cmake/FindCMU1394.cmake index a01b813aa29f6c4e3fab31053b9a832433f7336d..15780260f8a0628537372f42619030d5fa514d18 100644 --- a/CMakeModules/FindCMU1394.cmake +++ b/cmake/FindCMU1394.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindCMU1394.cmake 4603 2014-01-21 13:40:58Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindCPP11.cmake b/cmake/FindCPP11.cmake similarity index 84% rename from CMakeModules/FindCPP11.cmake rename to cmake/FindCPP11.cmake index 69001799a57ec8763732a3e470c2d7916c2f1772..917378b04154a692ffd7f65d2fa2f4b9c71fb424 100644 --- a/CMakeModules/FindCPP11.cmake +++ b/cmake/FindCPP11.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindCPP11.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindDC1394.cmake b/cmake/FindDC1394.cmake similarity index 92% rename from CMakeModules/FindDC1394.cmake rename to cmake/FindDC1394.cmake index 01b4db77f9e374b8a286de9d60409aa7ea949e85..0c53afc452a5245e352ba2adaf2cce48f4b35a14 100644 --- a/CMakeModules/FindDC1394.cmake +++ b/cmake/FindDC1394.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindDC1394.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindDIRECT3D.cmake b/cmake/FindDIRECT3D.cmake old mode 100755 new mode 100644 similarity index 89% rename from CMakeModules/FindDIRECT3D.cmake rename to cmake/FindDIRECT3D.cmake index 18eb6a173ea0096faeaadbc7d42e24b1cb87f5f4..91b45ee5e6367be010ea9f9513c5d9cc1eeee29b --- a/CMakeModules/FindDIRECT3D.cmake +++ b/cmake/FindDIRECT3D.cmake @@ -1,146 +1,143 @@ -############################################################################# -# -# $Id: FindDIRECT3D.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Try to find Direct3D on Windows. This code comes originaly -# from http://www.cmake.org/Wiki/CMakeUserFindDirectShow . -# Once loaded this will define: -# -# DIRECT3D_FOUND - system has DirectShow -# DIRECT3D_INCLUDE_DIRS - include directory for DirectShow -# DIRECT3D_LIBRARIES - libraries you need to link to -# -# Authors: -# Bruno Renier -# -############################################################################# - -SET(DIRECT3D_FOUND "NO") - -# Direct3D is only available on Windows platforms -IF(WIN32 AND NOT MINGW) - # Find Direct3D Include Directory - FIND_PATH(DIRECT3D_INCLUDE_DIR d3dx9.h - "$ENV{DXSDK_DIR}/Include" - "C:/Program Files/Microsoft DirectX SDK/Include" - "C:/DXSDK/Include" - NO_DEFAULT_PATH - DOC "What is the path where the file d3dx9.h can be found" - ) - FIND_PATH(DIRECT3D_INCLUDE_DIR d3dx9.h - NO_DEFAULT_PATH - DOC "What is the path where the file d3dx9.h can be found" - ) - - # if Direct3D include dir found, then find Direct3D libraries - IF(DIRECT3D_INCLUDE_DIR) - IF(CMAKE_CL_64) - FIND_LIBRARY(DIRECT3D_d3d9_LIBRARY d3d9 - "$ENV{DXSDK_DIR}/Lib" - "$ENV{DXSDK_DIR}/Lib/x64" - "C:/Program Files/Microsoft DirectX SDK/Lib/x64" - "C:/DXSDK/Include/Lib/x64" - NO_DEFAULT_PATH - DOC "Where can the Direct3D d3d9 library be found" - ) - ELSE(CMAKE_CL_64) - FIND_LIBRARY(DIRECT3D_d3d9_LIBRARY d3d9 - "$ENV{DXSDK_DIR}/Lib" - "$ENV{DXSDK_DIR}/Lib/x86" - "C:/Program Files/Microsoft DirectX SDK/Lib/x86" - "C:/DXSDK/Include/Lib/x86" - NO_DEFAULT_PATH - DOC "Where can the Direct3D d3d9 library be found" - ) - ENDIF(CMAKE_CL_64) - FIND_LIBRARY(DIRECT3D_d3d9_LIBRARY d3d9 - DOC "Where can the Direct3D d3d9 library be found" - ) - - IF(CMAKE_CL_64) - FIND_LIBRARY(DIRECT3D_d3dx9_LIBRARY d3dx9 - "$ENV{DXSDK_DIR}/Lib/" - "$ENV{DXSDK_DIR}/Lib/x64" - "C:/Program Files/Microsoft DirectX SDK/Lib/x64" - "C:/DXSDK/Include/Lib/x64" - NO_DEFAULT_PATH - DOC "Where can the Direct3D d3dx9 library be found" - ) - ELSE(CMAKE_CL_64) - FIND_LIBRARY(DIRECT3D_d3dx9_LIBRARY d3dx9 - "$ENV{DXSDK_DIR}/Lib/" - "$ENV{DXSDK_DIR}/Lib/x86" - "C:/Program Files/Microsoft DirectX SDK/Lib/x86" - "C:/DXSDK/Include/Lib/x86" - NO_DEFAULT_PATH - DOC "Where can the Direct3D d3dx9 library be found" - ) - ENDIF(CMAKE_CL_64) - FIND_LIBRARY(DIRECT3D_d3dx9_LIBRARY d3dx9 - DOC "Where can the Direct3D d3dx9 library be found" - ) - - # if Direct3D libraries found, then we're ok - IF(DIRECT3D_d3d9_LIBRARY) - IF(DIRECT3D_d3dx9_LIBRARY) - # everything found - SET(DIRECT3D_FOUND "YES") - ENDIF(DIRECT3D_d3dx9_LIBRARY) - ENDIF(DIRECT3D_d3d9_LIBRARY) - ENDIF(DIRECT3D_INCLUDE_DIR) - - MARK_AS_ADVANCED( - DIRECT3D_INCLUDE_DIR - DIRECT3D_d3d9_LIBRARY - DIRECT3D_d3dx9_LIBRARY - ) - - -ENDIF(WIN32 AND NOT MINGW) - - -#--------------------------------------------------------------------- -IF(DIRECT3D_FOUND) - SET(DIRECT3D_INCLUDE_DIRS ${DIRECT3D_INCLUDE_DIR}) - SET(DIRECT3D_LIBRARIES - "${DIRECT3D_d3d9_LIBRARY}" - "${DIRECT3D_d3dx9_LIBRARY}" - ) -ELSE(DIRECT3D_FOUND) - # make FIND_PACKAGE friendly - IF(NOT DIRECT3D_FIND_QUIETLY) - IF(DIRECT3D_FIND_REQUIRED) - MESSAGE(FATAL_ERROR - "Direct3D required, please specify it's location.") - ENDIF(DIRECT3D_FIND_REQUIRED) - ENDIF(NOT DIRECT3D_FIND_QUIETLY) -ENDIF(DIRECT3D_FOUND) +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find Direct3D on Windows. This code comes originaly +# from http://www.cmake.org/Wiki/CMakeUserFindDirectShow . +# Once loaded this will define: +# +# DIRECT3D_FOUND - system has DirectShow +# DIRECT3D_INCLUDE_DIRS - include directory for DirectShow +# DIRECT3D_LIBRARIES - libraries you need to link to +# +# Authors: +# Bruno Renier +# +############################################################################# + +SET(DIRECT3D_FOUND "NO") + +# Direct3D is only available on Windows platforms +IF(WIN32 AND NOT MINGW) + # Find Direct3D Include Directory + FIND_PATH(DIRECT3D_INCLUDE_DIR d3dx9.h + "$ENV{DXSDK_DIR}/Include" + "C:/Program Files/Microsoft DirectX SDK/Include" + "C:/DXSDK/Include" + NO_DEFAULT_PATH + DOC "What is the path where the file d3dx9.h can be found" + ) + FIND_PATH(DIRECT3D_INCLUDE_DIR d3dx9.h + NO_DEFAULT_PATH + DOC "What is the path where the file d3dx9.h can be found" + ) + + # if Direct3D include dir found, then find Direct3D libraries + IF(DIRECT3D_INCLUDE_DIR) + IF(CMAKE_CL_64) + FIND_LIBRARY(DIRECT3D_d3d9_LIBRARY d3d9 + "$ENV{DXSDK_DIR}/Lib" + "$ENV{DXSDK_DIR}/Lib/x64" + "C:/Program Files/Microsoft DirectX SDK/Lib/x64" + "C:/DXSDK/Include/Lib/x64" + NO_DEFAULT_PATH + DOC "Where can the Direct3D d3d9 library be found" + ) + ELSE(CMAKE_CL_64) + FIND_LIBRARY(DIRECT3D_d3d9_LIBRARY d3d9 + "$ENV{DXSDK_DIR}/Lib" + "$ENV{DXSDK_DIR}/Lib/x86" + "C:/Program Files/Microsoft DirectX SDK/Lib/x86" + "C:/DXSDK/Include/Lib/x86" + NO_DEFAULT_PATH + DOC "Where can the Direct3D d3d9 library be found" + ) + ENDIF(CMAKE_CL_64) + FIND_LIBRARY(DIRECT3D_d3d9_LIBRARY d3d9 + DOC "Where can the Direct3D d3d9 library be found" + ) + + IF(CMAKE_CL_64) + FIND_LIBRARY(DIRECT3D_d3dx9_LIBRARY d3dx9 + "$ENV{DXSDK_DIR}/Lib/" + "$ENV{DXSDK_DIR}/Lib/x64" + "C:/Program Files/Microsoft DirectX SDK/Lib/x64" + "C:/DXSDK/Include/Lib/x64" + NO_DEFAULT_PATH + DOC "Where can the Direct3D d3dx9 library be found" + ) + ELSE(CMAKE_CL_64) + FIND_LIBRARY(DIRECT3D_d3dx9_LIBRARY d3dx9 + "$ENV{DXSDK_DIR}/Lib/" + "$ENV{DXSDK_DIR}/Lib/x86" + "C:/Program Files/Microsoft DirectX SDK/Lib/x86" + "C:/DXSDK/Include/Lib/x86" + NO_DEFAULT_PATH + DOC "Where can the Direct3D d3dx9 library be found" + ) + ENDIF(CMAKE_CL_64) + FIND_LIBRARY(DIRECT3D_d3dx9_LIBRARY d3dx9 + DOC "Where can the Direct3D d3dx9 library be found" + ) + + # if Direct3D libraries found, then we're ok + IF(DIRECT3D_d3d9_LIBRARY) + IF(DIRECT3D_d3dx9_LIBRARY) + # everything found + SET(DIRECT3D_FOUND "YES") + ENDIF(DIRECT3D_d3dx9_LIBRARY) + ENDIF(DIRECT3D_d3d9_LIBRARY) + ENDIF(DIRECT3D_INCLUDE_DIR) + + MARK_AS_ADVANCED( + DIRECT3D_INCLUDE_DIR + DIRECT3D_d3d9_LIBRARY + DIRECT3D_d3dx9_LIBRARY + ) + + +ENDIF(WIN32 AND NOT MINGW) + + +#--------------------------------------------------------------------- +IF(DIRECT3D_FOUND) + SET(DIRECT3D_INCLUDE_DIRS ${DIRECT3D_INCLUDE_DIR}) + SET(DIRECT3D_LIBRARIES + "${DIRECT3D_d3d9_LIBRARY}" + "${DIRECT3D_d3dx9_LIBRARY}" + ) +ELSE(DIRECT3D_FOUND) + # make FIND_PACKAGE friendly + IF(NOT DIRECT3D_FIND_QUIETLY) + IF(DIRECT3D_FIND_REQUIRED) + MESSAGE(FATAL_ERROR + "Direct3D required, please specify it's location.") + ENDIF(DIRECT3D_FIND_REQUIRED) + ENDIF(NOT DIRECT3D_FIND_QUIETLY) +ENDIF(DIRECT3D_FOUND) diff --git a/CMakeModules/FindDIRECTSHOW.cmake b/cmake/FindDIRECTSHOW.cmake similarity index 94% rename from CMakeModules/FindDIRECTSHOW.cmake rename to cmake/FindDIRECTSHOW.cmake index 95ecea8eacb0fb0fab8850a251c79d8eaaead042..5d34ab37e5b8aceb326df90f1c4b25e88b968e7a 100644 --- a/CMakeModules/FindDIRECTSHOW.cmake +++ b/cmake/FindDIRECTSHOW.cmake @@ -1,283 +1,280 @@ -############################################################################# -# -# $Id: FindDIRECTSHOW.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Try to find Direct Show on Windows. This code comes originaly -# from http://www.cmake.org/Wiki/CMakeUserFindDirectShow . -# Once loaded this will define: -# -# DIRECTSHOW_FOUND - system has DirectShow -# DIRECTSHOW_INCLUDE_DIRS - include directory for DirectShow -# DIRECTSHOW_LIBRARIES - libraries you need to link to -# -# Authors: -# Fabien Spindler -# -############################################################################# - -SET(DIRECTSHOW_FOUND "NO") - -# DirectShow is only available on Windows platforms -IF(WIN32 AND NOT MINGW) -# find DirectX - FIND_PATH(DIRECTX_INCLUDE_PATH ddraw.h - "$ENV{DXSDK_DIR}/Include" - "C:/Program Files/Microsoft SDKs/Windows/v6.1/Include" - "C:/Program Files/Microsoft SDKs/Windows/v6.0/Include" - "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include" - "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Include" - "C:/DXSDK/include" - "C:/Program Files/Microsoft Platform SDK/Include" - "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Include" - NO_DEFAULT_PATH - DOC "What is the path where the file ddraw.h can be found" - ) - FIND_PATH(DIRECTX_INCLUDE_PATH ddraw.h - DOC "What is the path where the file ddraw.h can be found" - ) - - # find DirectShow include directory - FIND_PATH(DIRECTSHOW_dshow_INCLUDE_PATH dshow.h - "$ENV{WINSDK_HOME}/Include" - "$ENV{DXSDK_DIR}/Include" - "C:/Program Files/Microsoft SDKs/Windows/v6.1/Include" - "C:/Program Files/Microsoft SDKs/Windows/v6.0/Include" - "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include" - "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Include" - "C:/DXSDK/include" - "C:/Program Files/Microsoft Platform SDK/Include" - "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Include" - NO_DEFAULT_PATH - DOC "What is the path where the file dshow.h can be found" - ) - FIND_PATH(DIRECTSHOW_dshow_INCLUDE_PATH dshow.h - DOC "What is the path where the file dshow.h can be found" - ) - - FIND_PATH(DIRECTSHOW_qedit_INCLUDE_PATH qedit.h - "$ENV{WINSDK_HOME}/Include" - "$ENV{DXSDK_DIR}/Include" - "C:/Program Files/Microsoft SDKs/Windows/v6.1/Include" - "C:/Program Files/Microsoft SDKs/Windows/v6.0/Include" - "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include" - "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Include" - "C:/DXSDK/include" - "C:/Program Files/Microsoft Platform SDK/Include" - "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Include" - NO_DEFAULT_PATH - DOC "What is the path where the file qedit.h can be found" - ) - FIND_PATH(DIRECTSHOW_qedit_INCLUDE_PATH qedit.h - DOC "What is the path where the file qedit.h can be found" - ) - - FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h - DOC "What is the path where the file atlbase.h can be found" - ) -# Specific path search for Visual Studio .NET 2003 - IF(MSVC71) - IF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) - FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h - "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/atlmfc/include" - "$ENV{VS71COMNTOOLS}/../../Vc7/atlmfc/include" - DOC "What is the path where the file atlbase.h can be found" - ) - ENDIF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) - ENDIF(MSVC71) - -# Specific path search for Visual Studio 2005 - IF(MSVC80) - IF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) - FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h - "C:/Program Files/Microsoft Visual Studio 8/VC/atlmfc/include" - "$ENV{VS80COMNTOOLS}/../../VC/atlmfc/include" - DOC "What is the path where the file atlbase.h can be found" - ) - ENDIF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) - ENDIF(MSVC80) - -# Specific path search for Visual Studio 2008 - IF(MSVC90) - IF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) - FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h - "C:/Program Files/Microsoft Visual Studio 9.0/VC/atlmfc/include" - "$ENV{VS90COMNTOOLS}/../../VC/atlmfc/include" - DOC "What is the path where the file atlbase.h can be found" - ) - ENDIF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) - ENDIF(MSVC90) -# Specific path search for Visual Studio 2008 - IF(MSVC10) - IF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) - FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h - "C:/Program Files/Microsoft Visual Studio 10.0/VC/atlmfc/include" - "$ENV{VS100COMNTOOLS}/../../VC/atlmfc/include" - DOC "What is the path where the file atlbase.h can be found" - ) - ENDIF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) - ENDIF(MSVC10) - IF(DIRECTX_INCLUDE_PATH AND DIRECTSHOW_dshow_INCLUDE_PATH AND DIRECTSHOW_qedit_INCLUDE_PATH AND DIRECTSHOW_atlbase_INCLUDE_PATH) - SET(DIRECTSHOW_INCLUDE_DIRS ${DIRECTX_INCLUDE_PATH} - ${DIRECTSHOW_dshow_INCLUDE_PATH} - ${DIRECTSHOW_qedit_INCLUDE_PATH} - ${DIRECTSHOW_atlbase_INCLUDE_PATH}) - ENDIF(DIRECTX_INCLUDE_PATH AND DIRECTSHOW_dshow_INCLUDE_PATH AND DIRECTSHOW_qedit_INCLUDE_PATH AND DIRECTSHOW_atlbase_INCLUDE_PATH) - # if DirectShow include dir found, then find DirectShow libraries - IF(DIRECTSHOW_INCLUDE_DIRS) - IF(CMAKE_CL_64) - FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY - NAMES strmiids - PATHS - "$ENV{WINSDK_HOME}/Lib/x64" - "$ENV{DXSDK_DIR}/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib/x64" - "C:/DXSDK/lib/x64" - "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib/x64" - "C:/Program Files/Microsoft Platform SDK/Lib/x64" - NO_DEFAULT_PATH - DOC "Where can the DirectShow strmiids library be found" - ) - ELSE(CMAKE_CL_64) - FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY - NAMES strmiids - PATHS - "$ENV{WINSDK_HOME}/Lib" - "$ENV{WINSDK_HOME}/Lib/x86" - "$ENV{DXSDK_DIR}/Lib" - "$ENV{DXSDK_DIR}/Lib/x86" - "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib" - "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x86" - "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib" - "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib" - "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x86" - "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/x86" - "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib" - "C:/DXSDK/lib" - "C:/DXSDK/lib/x64" - "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" - "C:/Program Files/Microsoft Platform SDK/Lib" - NO_DEFAULT_PATH - DOC "Where can the DirectShow strmiids library be found" - ) - ENDIF(CMAKE_CL_64) - FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY - NAMES strmiids - DOC "Where can the DirectShow strmiids library be found" - ) - - - IF(CMAKE_CL_64) - FIND_LIBRARY(DIRECTSHOW_quartz_LIBRARY - NAMES quartz - PATHS - "$ENV{WINSDK_HOME}/Lib/x64" - "$ENV{DXSDK_DIR}/Lib/x64" - "C:/DXSDK/lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/x64" - "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib/x64" - "C:/Program Files/Microsoft Platform SDK/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib/x64" - NO_DEFAULT_PATH - DOC "Where can the DirectShow quartz library be found" - ) - ELSE(CMAKE_CL_64) - FIND_LIBRARY(DIRECTSHOW_quartz_LIBRARY - NAMES quartz - PATHS - "$ENV{WINSDK_HOME}/Lib/x86" - "$ENV{DXSDK_DIR}/Lib/x86" - "C:/DXSDK/lib/x86" - "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x86" - "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x86" - "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/x86" - "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib/x86" - "C:/Program Files/Microsoft Platform SDK/Lib/x86" - "C:/Program Files/Microsoft SDKs/Windows/v7.0A" - "$ENV{WINSDK_HOME}/Lib" - "$ENV{DXSDK_DIR}/Lib" - "C:/DXSDK/lib" - "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib" - "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib" - "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib" - "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" - "C:/Program Files/Microsoft Platform SDK/Lib" - NO_DEFAULT_PATH - DOC "Where can the DirectShow quartz library be found" - ) - ENDIF(CMAKE_CL_64) - FIND_LIBRARY(DIRECTSHOW_quartz_LIBRARY - NAMES quartz - DOC "Where can the DirectShow quartz library be found" - ) - - # if DirectShow libraries found, then we're ok - IF(DIRECTSHOW_strmiids_LIBRARY) - IF(DIRECTSHOW_quartz_LIBRARY) - # everything found - SET(DIRECTSHOW_FOUND "YES") - ENDIF(DIRECTSHOW_quartz_LIBRARY) - ENDIF(DIRECTSHOW_strmiids_LIBRARY) - ENDIF(DIRECTSHOW_INCLUDE_DIRS) - - MARK_AS_ADVANCED( - DIRECTSHOW_INCLUDE_DIRS - DIRECTSHOW_strmiids_LIBRARY - DIRECTSHOW_quartz_LIBRARY - DIRECTX_INCLUDE_PATH - DIRECTSHOW_dshow_INCLUDE_PATH - DIRECTSHOW_qedit_INCLUDE_PATH - DIRECTSHOW_atlbase_INCLUDE_PATH - ) - -ENDIF(WIN32 AND NOT MINGW) - - -#--------------------------------------------------------------------- -IF(DIRECTSHOW_FOUND) - SET(DIRECTSHOW_LIBRARIES - ${DIRECTSHOW_strmiids_LIBRARY} - ${DIRECTSHOW_quartz_LIBRARY} - ) -ELSE(DIRECTSHOW_FOUND) - # make FIND_PACKAGE friendly - IF(NOT DIRECTSHOW_FIND_QUIETLY) - IF(DIRECTSHOW_FIND_REQUIRED) - MESSAGE(FATAL_ERROR - "DirectShow required, please specify it's location.") - ENDIF(DIRECTSHOW_FIND_REQUIRED) - ENDIF(NOT DIRECTSHOW_FIND_QUIETLY) -ENDIF(DIRECTSHOW_FOUND) +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find Direct Show on Windows. This code comes originaly +# from http://www.cmake.org/Wiki/CMakeUserFindDirectShow . +# Once loaded this will define: +# +# DIRECTSHOW_FOUND - system has DirectShow +# DIRECTSHOW_INCLUDE_DIRS - include directory for DirectShow +# DIRECTSHOW_LIBRARIES - libraries you need to link to +# +# Authors: +# Fabien Spindler +# +############################################################################# + +SET(DIRECTSHOW_FOUND "NO") + +# DirectShow is only available on Windows platforms +IF(WIN32 AND NOT MINGW) +# find DirectX + FIND_PATH(DIRECTX_INCLUDE_PATH ddraw.h + "$ENV{DXSDK_DIR}/Include" + "C:/Program Files/Microsoft SDKs/Windows/v6.1/Include" + "C:/Program Files/Microsoft SDKs/Windows/v6.0/Include" + "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include" + "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Include" + "C:/DXSDK/include" + "C:/Program Files/Microsoft Platform SDK/Include" + "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Include" + NO_DEFAULT_PATH + DOC "What is the path where the file ddraw.h can be found" + ) + FIND_PATH(DIRECTX_INCLUDE_PATH ddraw.h + DOC "What is the path where the file ddraw.h can be found" + ) + + # find DirectShow include directory + FIND_PATH(DIRECTSHOW_dshow_INCLUDE_PATH dshow.h + "$ENV{WINSDK_HOME}/Include" + "$ENV{DXSDK_DIR}/Include" + "C:/Program Files/Microsoft SDKs/Windows/v6.1/Include" + "C:/Program Files/Microsoft SDKs/Windows/v6.0/Include" + "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include" + "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Include" + "C:/DXSDK/include" + "C:/Program Files/Microsoft Platform SDK/Include" + "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Include" + NO_DEFAULT_PATH + DOC "What is the path where the file dshow.h can be found" + ) + FIND_PATH(DIRECTSHOW_dshow_INCLUDE_PATH dshow.h + DOC "What is the path where the file dshow.h can be found" + ) + + FIND_PATH(DIRECTSHOW_qedit_INCLUDE_PATH qedit.h + "$ENV{WINSDK_HOME}/Include" + "$ENV{DXSDK_DIR}/Include" + "C:/Program Files/Microsoft SDKs/Windows/v6.1/Include" + "C:/Program Files/Microsoft SDKs/Windows/v6.0/Include" + "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Include" + "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Include" + "C:/DXSDK/include" + "C:/Program Files/Microsoft Platform SDK/Include" + "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Include" + NO_DEFAULT_PATH + DOC "What is the path where the file qedit.h can be found" + ) + FIND_PATH(DIRECTSHOW_qedit_INCLUDE_PATH qedit.h + DOC "What is the path where the file qedit.h can be found" + ) + + FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h + DOC "What is the path where the file atlbase.h can be found" + ) +# Specific path search for Visual Studio .NET 2003 + IF(MSVC71) + IF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) + FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h + "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/atlmfc/include" + "$ENV{VS71COMNTOOLS}/../../Vc7/atlmfc/include" + DOC "What is the path where the file atlbase.h can be found" + ) + ENDIF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) + ENDIF(MSVC71) + +# Specific path search for Visual Studio 2005 + IF(MSVC80) + IF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) + FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h + "C:/Program Files/Microsoft Visual Studio 8/VC/atlmfc/include" + "$ENV{VS80COMNTOOLS}/../../VC/atlmfc/include" + DOC "What is the path where the file atlbase.h can be found" + ) + ENDIF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) + ENDIF(MSVC80) + +# Specific path search for Visual Studio 2008 + IF(MSVC90) + IF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) + FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h + "C:/Program Files/Microsoft Visual Studio 9.0/VC/atlmfc/include" + "$ENV{VS90COMNTOOLS}/../../VC/atlmfc/include" + DOC "What is the path where the file atlbase.h can be found" + ) + ENDIF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) + ENDIF(MSVC90) +# Specific path search for Visual Studio 2008 + IF(MSVC10) + IF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) + FIND_PATH(DIRECTSHOW_atlbase_INCLUDE_PATH atlbase.h + "C:/Program Files/Microsoft Visual Studio 10.0/VC/atlmfc/include" + "$ENV{VS100COMNTOOLS}/../../VC/atlmfc/include" + DOC "What is the path where the file atlbase.h can be found" + ) + ENDIF(NOT DIRECTSHOW_atlbase_INCLUDE_PATH) + ENDIF(MSVC10) + IF(DIRECTX_INCLUDE_PATH AND DIRECTSHOW_dshow_INCLUDE_PATH AND DIRECTSHOW_qedit_INCLUDE_PATH AND DIRECTSHOW_atlbase_INCLUDE_PATH) + SET(DIRECTSHOW_INCLUDE_DIRS ${DIRECTX_INCLUDE_PATH} + ${DIRECTSHOW_dshow_INCLUDE_PATH} + ${DIRECTSHOW_qedit_INCLUDE_PATH} + ${DIRECTSHOW_atlbase_INCLUDE_PATH}) + ENDIF(DIRECTX_INCLUDE_PATH AND DIRECTSHOW_dshow_INCLUDE_PATH AND DIRECTSHOW_qedit_INCLUDE_PATH AND DIRECTSHOW_atlbase_INCLUDE_PATH) + # if DirectShow include dir found, then find DirectShow libraries + IF(DIRECTSHOW_INCLUDE_DIRS) + IF(CMAKE_CL_64) + FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY + NAMES strmiids + PATHS + "$ENV{WINSDK_HOME}/Lib/x64" + "$ENV{DXSDK_DIR}/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib/x64" + "C:/DXSDK/lib/x64" + "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib/x64" + "C:/Program Files/Microsoft Platform SDK/Lib/x64" + NO_DEFAULT_PATH + DOC "Where can the DirectShow strmiids library be found" + ) + ELSE(CMAKE_CL_64) + FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY + NAMES strmiids + PATHS + "$ENV{WINSDK_HOME}/Lib" + "$ENV{WINSDK_HOME}/Lib/x86" + "$ENV{DXSDK_DIR}/Lib" + "$ENV{DXSDK_DIR}/Lib/x86" + "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib" + "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x86" + "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib" + "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib" + "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x86" + "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/x86" + "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib" + "C:/DXSDK/lib" + "C:/DXSDK/lib/x64" + "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" + "C:/Program Files/Microsoft Platform SDK/Lib" + NO_DEFAULT_PATH + DOC "Where can the DirectShow strmiids library be found" + ) + ENDIF(CMAKE_CL_64) + FIND_LIBRARY(DIRECTSHOW_strmiids_LIBRARY + NAMES strmiids + DOC "Where can the DirectShow strmiids library be found" + ) + + + IF(CMAKE_CL_64) + FIND_LIBRARY(DIRECTSHOW_quartz_LIBRARY + NAMES quartz + PATHS + "$ENV{WINSDK_HOME}/Lib/x64" + "$ENV{DXSDK_DIR}/Lib/x64" + "C:/DXSDK/lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/x64" + "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib/x64" + "C:/Program Files/Microsoft Platform SDK/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib/x64" + NO_DEFAULT_PATH + DOC "Where can the DirectShow quartz library be found" + ) + ELSE(CMAKE_CL_64) + FIND_LIBRARY(DIRECTSHOW_quartz_LIBRARY + NAMES quartz + PATHS + "$ENV{WINSDK_HOME}/Lib/x86" + "$ENV{DXSDK_DIR}/Lib/x86" + "C:/DXSDK/lib/x86" + "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x86" + "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x86" + "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib/x86" + "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib/x86" + "C:/Program Files/Microsoft Platform SDK/Lib/x86" + "C:/Program Files/Microsoft SDKs/Windows/v7.0A" + "$ENV{WINSDK_HOME}/Lib" + "$ENV{DXSDK_DIR}/Lib" + "C:/DXSDK/lib" + "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib" + "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib" + "C:/Program Files/Microsoft SDKs/Windows/v6.0A/Lib" + "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" + "C:/Program Files/Microsoft Platform SDK/Lib" + NO_DEFAULT_PATH + DOC "Where can the DirectShow quartz library be found" + ) + ENDIF(CMAKE_CL_64) + FIND_LIBRARY(DIRECTSHOW_quartz_LIBRARY + NAMES quartz + DOC "Where can the DirectShow quartz library be found" + ) + + # if DirectShow libraries found, then we're ok + IF(DIRECTSHOW_strmiids_LIBRARY) + IF(DIRECTSHOW_quartz_LIBRARY) + # everything found + SET(DIRECTSHOW_FOUND "YES") + ENDIF(DIRECTSHOW_quartz_LIBRARY) + ENDIF(DIRECTSHOW_strmiids_LIBRARY) + ENDIF(DIRECTSHOW_INCLUDE_DIRS) + + MARK_AS_ADVANCED( + DIRECTSHOW_INCLUDE_DIRS + DIRECTSHOW_strmiids_LIBRARY + DIRECTSHOW_quartz_LIBRARY + DIRECTX_INCLUDE_PATH + DIRECTSHOW_dshow_INCLUDE_PATH + DIRECTSHOW_qedit_INCLUDE_PATH + DIRECTSHOW_atlbase_INCLUDE_PATH + ) + +ENDIF(WIN32 AND NOT MINGW) + + +#--------------------------------------------------------------------- +IF(DIRECTSHOW_FOUND) + SET(DIRECTSHOW_LIBRARIES + ${DIRECTSHOW_strmiids_LIBRARY} + ${DIRECTSHOW_quartz_LIBRARY} + ) +ELSE(DIRECTSHOW_FOUND) + # make FIND_PACKAGE friendly + IF(NOT DIRECTSHOW_FIND_QUIETLY) + IF(DIRECTSHOW_FIND_REQUIRED) + MESSAGE(FATAL_ERROR + "DirectShow required, please specify it's location.") + ENDIF(DIRECTSHOW_FIND_REQUIRED) + ENDIF(NOT DIRECTSHOW_FIND_QUIETLY) +ENDIF(DIRECTSHOW_FOUND) diff --git a/CMakeModules/FindDL.cmake b/cmake/FindDL.cmake similarity index 79% rename from CMakeModules/FindDL.cmake rename to cmake/FindDL.cmake index f62ab6b041f3c02d2e972fcb5f785341a7d470bb..3ca9e2f6e5966afab19167840e56ab10f777b839 100644 --- a/CMakeModules/FindDL.cmake +++ b/cmake/FindDL.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindDL.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindDMTX.cmake b/cmake/FindDMTX.cmake similarity index 77% rename from CMakeModules/FindDMTX.cmake rename to cmake/FindDMTX.cmake index db31d64b4e146c1fb9aab7312e6206434ce91bf4..a46a1601630c9918e86831a91b54a9e89986b3c2 100644 --- a/CMakeModules/FindDMTX.cmake +++ b/cmake/FindDMTX.cmake @@ -1,71 +1,68 @@ -############################################################################# -# -# $Id: FindV4L2.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Try to find dmtx library. -# Once run this will define: -# -# DMTX_FOUND -# DMTX_INCLUDE_DIRS -# DMTX_LIBRARIES -# -# Authors: -# Fabien Spindler -# -############################################################################# - - -find_path(DMTX_INCLUDE_DIRS dmtx.h - $ENV{DMTX_DIR}/include - /usr/include - /usr/local/include -) - -find_library(DMTX_LIBRARIES - NAMES dmtx - PATHS - $ENV{DMTX_DIR}/lib - /usr/lib - /usr/local/lib -) - -if(DMTX_INCLUDE_DIRS AND DMTX_LIBRARIES) - set(DMTX_FOUND TRUE) -else() - set(DMTX_FOUND FALSE) -endif() - -mark_as_advanced( - DMTX_INCLUDE_DIRS - DMTX_LIBRARIES -) - +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find dmtx library. +# Once run this will define: +# +# DMTX_FOUND +# DMTX_INCLUDE_DIRS +# DMTX_LIBRARIES +# +# Authors: +# Fabien Spindler +# +############################################################################# + + +find_path(DMTX_INCLUDE_DIRS dmtx.h + $ENV{DMTX_DIR}/include + /usr/include + /usr/local/include +) + +find_library(DMTX_LIBRARIES + NAMES dmtx + PATHS + $ENV{DMTX_DIR}/lib + /usr/lib + /usr/local/lib +) + +if(DMTX_INCLUDE_DIRS AND DMTX_LIBRARIES) + set(DMTX_FOUND TRUE) +else() + set(DMTX_FOUND FALSE) +endif() + +mark_as_advanced( + DMTX_INCLUDE_DIRS + DMTX_LIBRARIES +) + diff --git a/CMakeModules/FindFFMPEG.cmake b/cmake/FindFFMPEG.cmake similarity index 95% rename from CMakeModules/FindFFMPEG.cmake rename to cmake/FindFFMPEG.cmake index ff8dea34fb59ec5dcde6bd506b6d62c1c3929bf0..86d20f318bbd1c40af64ab6ddac5c935e79af9a2 100644 --- a/CMakeModules/FindFFMPEG.cmake +++ b/cmake/FindFFMPEG.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindFFMPEG.cmake 5316 2015-02-12 10:58:18Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindGDI.cmake b/cmake/FindGDI.cmake similarity index 91% rename from CMakeModules/FindGDI.cmake rename to cmake/FindGDI.cmake index 3db6543c709aac1b83e9467a282ed1bff0c66a74..0248e4402f515b4b471fa462742fafa1da8211d7 100644 --- a/CMakeModules/FindGDI.cmake +++ b/cmake/FindGDI.cmake @@ -1,159 +1,158 @@ -############################################################################# -# -# $Id: FindGDI.cmake 5286 2015-02-09 14:36:35Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Try to find GDI (Graphics Device Interface) on Windows. -# Once loaded this will define: -# -# GDI_FOUND - system has GDI -# GDI_LIBRARIES - libraries you need to link to -# -# Authors: -# Fabien Spindler -# -############################################################################# - -SET(GDI_FOUND "NO") - -# GDI (Graphics Device Interface) is only available on Windows platforms -IF(WIN32) - IF(MINGW) - FIND_LIBRARY(GDI_LIBRARY gdi32 - "C:/MinGW/lib" - "C:/mingw/mingw/lib" - "$ENV{MINGW_DIR}/lib" - "$ENV{MINGW_DIR}/mingw/lib" - DOC "Where can the GDI (Graphics Device Interface) library be found" - NO_DEFAULT_PATH - ) - ELSE(MINGW) - IF(CMAKE_CL_64) - # Generic path seach - FIND_LIBRARY(GDI_LIBRARY gdi32 - "$ENV{WINSDK_DIR}/Lib/x64" - "$ENV{WINSDK_HOME}/Lib/x64" - "$ENV{DXSDK_DIR}/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v6.0a/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v7.1/Lib/x64" - "C:/Program Files/Microsoft SDKs/Windows/v7.1A/Lib/x64" - "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib/x64" - "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib/x64" - "C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x64" - "C:/Program Files/Microsoft Platform SDK/Lib/x64" - "C:/DXSDK/Include/Lib/x64" - DOC "Where can the GDI (Graphics Device Interface) library be found" - ) - - # Specific path search for Visual Studio .NET 2003 - IF(MSVC71) - IF(NOT GDI_LIBRARY) - FIND_LIBRARY(GDI_LIBRARY gdi32 - "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" - ) - ENDIF(NOT GDI_LIBRARY) - ENDIF(MSVC71) - - # Specific path search for Visual Studio 2005 - IF(MSVC80) - IF(NOT GDI_LIBRARY) - FIND_LIBRARY(GDI_LIBRARY gdi32 - "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Lib/AMD64" ) - ENDIF(NOT GDI_LIBRARY) - ENDIF(MSVC80) - - # Specific path search for Visual Studio 2008 - IF(MSVC90) - IF(NOT GDI_LIBRARY) - FIND_LIBRARY(GDI_LIBRARY gdi32 - "C:/Program Files/Microsoft Visual Studio 9/VC/PlatformSDK/Lib/AMD64" ) - ENDIF(NOT GDI_LIBRARY) - ENDIF(MSVC90) - - ELSE(CMAKE_CL_64) - # Generic path seach - FIND_LIBRARY(GDI_LIBRARY gdi32 - "$ENV{WINSDK_DIR}/Lib" - "$ENV{WINSDK_HOME}/Lib" - "$ENV{DXSDK_DIR}/Lib" - "C:/Program Files/Microsoft SDKs/Windows/v6.0a/Lib" - "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib" - "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib" - "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib" - "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" - "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Lib" - "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib" - "C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86" - "C:/Program Files/Microsoft Platform SDK/Lib" - "C:/DXSDK/Include/Lib" - DOC "Where can the GDI (Graphics Device Interface) library be found" - ) - - # Specific path search for Visual Studio .NET 2003 - IF(MSVC71) - IF(NOT GDI_LIBRARY) - FIND_LIBRARY(GDI_LIBRARY gdi32 - "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" - ) - ENDIF(NOT GDI_LIBRARY) - ENDIF(MSVC71) - - # Specific path search for Visual Studio 2005 - IF(MSVC80) - IF(NOT GDI_LIBRARY) - FIND_LIBRARY(GDI_LIBRARY gdi32 - "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Lib" - ) - ENDIF(NOT GDI_LIBRARY) - ENDIF(MSVC80) - - # Specific path search for Visual Studio 2008 - IF(MSVC90) - IF(NOT GDI_LIBRARY) - FIND_LIBRARY(GDI_LIBRARY gdi32 - "C:/Program Files/Microsoft Visual Studio 9/VC/PlatformSDK/Lib" - ) - ENDIF(NOT GDI_LIBRARY) - ENDIF(MSVC90) - ENDIF(CMAKE_CL_64) - ENDIF(MINGW) - # if GDI libraries found, then we're ok - IF(GDI_LIBRARY) - SET(GDI_FOUND "YES") - SET(GDI_LIBRARIES ${GDI_LIBRARY}) - - ENDIF(GDI_LIBRARY) - - MARK_AS_ADVANCED(GDI_LIBRARY) -ENDIF(WIN32) +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find GDI (Graphics Device Interface) on Windows. +# Once loaded this will define: +# +# GDI_FOUND - system has GDI +# GDI_LIBRARIES - libraries you need to link to +# +# Authors: +# Fabien Spindler +# +############################################################################# + +SET(GDI_FOUND "NO") + +# GDI (Graphics Device Interface) is only available on Windows platforms +IF(WIN32) + IF(MINGW) + FIND_LIBRARY(GDI_LIBRARY gdi32 + "C:/MinGW/lib" + "C:/mingw/mingw/lib" + "$ENV{MINGW_DIR}/lib" + "$ENV{MINGW_DIR}/mingw/lib" + DOC "Where can the GDI (Graphics Device Interface) library be found" + NO_DEFAULT_PATH + ) + ELSE(MINGW) + IF(CMAKE_CL_64) + # Generic path search + FIND_LIBRARY(GDI_LIBRARY gdi32 + "$ENV{WINSDK_DIR}/Lib/x64" + "$ENV{WINSDK_HOME}/Lib/x64" + "$ENV{DXSDK_DIR}/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v6.0a/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v7.1/Lib/x64" + "C:/Program Files/Microsoft SDKs/Windows/v7.1A/Lib/x64" + "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib/x64" + "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib/x64" + "C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x64" + "C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64" + "C:/Program Files/Microsoft Platform SDK/Lib/x64" + "C:/DXSDK/Include/Lib/x64" + DOC "Where can the GDI (Graphics Device Interface) library be found" + ) + + # Specific path search for Visual Studio .NET 2003 + IF(MSVC71) + IF(NOT GDI_LIBRARY) + FIND_LIBRARY(GDI_LIBRARY gdi32 + "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" + ) + ENDIF(NOT GDI_LIBRARY) + ENDIF(MSVC71) + + # Specific path search for Visual Studio 2005 + IF(MSVC80) + IF(NOT GDI_LIBRARY) + FIND_LIBRARY(GDI_LIBRARY gdi32 + "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Lib/AMD64" ) + ENDIF(NOT GDI_LIBRARY) + ENDIF(MSVC80) + + # Specific path search for Visual Studio 2008 + IF(MSVC90) + IF(NOT GDI_LIBRARY) + FIND_LIBRARY(GDI_LIBRARY gdi32 + "C:/Program Files/Microsoft Visual Studio 9/VC/PlatformSDK/Lib/AMD64" ) + ENDIF(NOT GDI_LIBRARY) + ENDIF(MSVC90) + + ELSE(CMAKE_CL_64) + # Generic path search + FIND_LIBRARY(GDI_LIBRARY gdi32 + "$ENV{WINSDK_DIR}/Lib" + "$ENV{WINSDK_HOME}/Lib" + "$ENV{DXSDK_DIR}/Lib" + "C:/Program Files/Microsoft SDKs/Windows/v6.0a/Lib" + "C:/Program Files/Microsoft SDKs/Windows/v6.0/Lib" + "C:/Program Files/Microsoft SDKs/Windows/v6.1/Lib" + "C:/Program Files/Microsoft SDKs/Windows/v7.0A/Lib" + "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" + "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1/Lib" + "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib" + "C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um/x86" + "C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x86" + "C:/Program Files/Microsoft Platform SDK/Lib" + "C:/DXSDK/Include/Lib" + DOC "Where can the GDI (Graphics Device Interface) library be found" + ) + + # Specific path search for Visual Studio .NET 2003 + IF(MSVC71) + IF(NOT GDI_LIBRARY) + FIND_LIBRARY(GDI_LIBRARY gdi32 + "C:/Program Files/Microsoft Visual Studio .NET 2003/Vc7/PlatformSDK/Lib" + ) + ENDIF(NOT GDI_LIBRARY) + ENDIF(MSVC71) + + # Specific path search for Visual Studio 2005 + IF(MSVC80) + IF(NOT GDI_LIBRARY) + FIND_LIBRARY(GDI_LIBRARY gdi32 + "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Lib" + ) + ENDIF(NOT GDI_LIBRARY) + ENDIF(MSVC80) + + # Specific path search for Visual Studio 2008 + IF(MSVC90) + IF(NOT GDI_LIBRARY) + FIND_LIBRARY(GDI_LIBRARY gdi32 + "C:/Program Files/Microsoft Visual Studio 9/VC/PlatformSDK/Lib" + ) + ENDIF(NOT GDI_LIBRARY) + ENDIF(MSVC90) + ENDIF(CMAKE_CL_64) + ENDIF(MINGW) + # if GDI libraries found, then we're ok + IF(GDI_LIBRARY) + SET(GDI_FOUND "YES") + SET(GDI_LIBRARIES ${GDI_LIBRARY}) + + ENDIF(GDI_LIBRARY) + + MARK_AS_ADVANCED(GDI_LIBRARY) +ENDIF(WIN32) diff --git a/CMakeModules/FindGSL.cmake b/cmake/FindGSL.cmake similarity index 84% rename from CMakeModules/FindGSL.cmake rename to cmake/FindGSL.cmake index 91a0801ee17bb04d460ff46d2a262e45e5626004..9f84470374b657ac63a340ef6c44bef371c23b55 100644 --- a/CMakeModules/FindGSL.cmake +++ b/cmake/FindGSL.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindGSL.cmake 4815 2014-07-31 14:00:05Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -86,47 +83,41 @@ macro(CheckCompilation_gsl1 MY_INCLUDE_DIR MY_LIBRARY MY_BUILD_SUCCEED) set(${MY_BUILD_SUCCEED} ${BUILD_SUCCEED}) endmacro() -find_path(GSL_INCLUDE_DIR gsl/gsl_linalg.h +set(GSL_LIB_SEARCH_PATH + "$ENV{GSL_HOME}/lib" + "$ENV{GSL_DIR}/lib" + /usr/lib + /usr/local/lib +) +set(GSL_INC_SEARCH_PATH $ENV{GSL_HOME}/include $ENV{GSL_DIR}/include /usr/include /usr/local/include ) +find_path(GSL_INCLUDE_DIR gsl/gsl_linalg.h + ${GSL_INC_SEARCH_PATH} +) + find_library(GSL_gsl_LIBRARY NAMES gsl - PATHS - "$ENV{GSL_HOME}/lib" - "$ENV{GSL_DIR}/lib" - /usr/lib - /usr/local/lib + PATHS ${GSL_LIB_SEARCH_PATH} ) if(WIN32) find_library(GSL_cblas_LIBRARY NAMES cblas - PATHS - "$ENV{GSL_HOME}/lib" - "$ENV{GSL_DIR}/lib" - /usr/lib - /usr/local/lib + PATHS ${GSL_LIB_SEARCH_PATH} ) find_library(GSL_gsl_LIBRARY_DEBUG NAMES gsl_d - PATHS - "$ENV{GSL_HOME}/lib" - "$ENV{GSL_DIR}/lib" - /usr/lib - /usr/local/lib + PATHS ${GSL_LIB_SEARCH_PATH} ) find_library(GSL_cblas_LIBRARY_DEBUG NAMES cblas_d - PATHS - "$ENV{GSL_HOME}/lib" - "$ENV{GSL_DIR}/lib" - /usr/lib - /usr/local/lib + PATHS ${GSL_LIB_SEARCH_PATH} ) if(GSL_INCLUDE_DIR AND GSL_gsl_LIBRARY AND GSL_cblas_LIBRARY @@ -160,11 +151,7 @@ else() find_library(GSL_cblas_LIBRARY NAMES gslcblas - PATHS - "$ENV{GSL_HOME}/lib" - "$ENV{GSL_DIR}/lib" - /usr/lib - /usr/local/lib + PATHS ${GSL_LIB_SEARCH_PATH} ) if(GSL_cblas_LIBRARY) list(APPEND GSL_LIBRARIES ${GSL_cblas_LIBRARY}) diff --git a/CMakeModules/FindICONV.cmake b/cmake/FindICONV.cmake old mode 100755 new mode 100644 similarity index 84% rename from CMakeModules/FindICONV.cmake rename to cmake/FindICONV.cmake index 2a5ac18c0c7572956ccec1cac87acc3fa113ec33..6277c8443c15e231b09880ab6146b527de27ef22 --- a/CMakeModules/FindICONV.cmake +++ b/cmake/FindICONV.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindICONV.cmake 5316 2015-02-12 10:58:18Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindIRISA.cmake b/cmake/FindIRISA.cmake similarity index 86% rename from CMakeModules/FindIRISA.cmake rename to cmake/FindIRISA.cmake index f7d9993d728b40d444e92d40c43a0ac5fe270336..42c95438748462c480609ff16651b20c6b20b8a1 100644 --- a/CMakeModules/FindIRISA.cmake +++ b/cmake/FindIRISA.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindIRISA.cmake 5309 2015-02-11 11:08:15Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/cmake/FindIsInf.cmake b/cmake/FindIsInf.cmake new file mode 100644 index 0000000000000000000000000000000000000000..a1b4ce91d94fe2631c484d4e1867f95c8d391653 --- /dev/null +++ b/cmake/FindIsInf.cmake @@ -0,0 +1,70 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find isnan macro, std::isnan function or _isnan function. +# +# Authors: +# Souriya Trinh +# +############################################################################# + +include(CheckIncludeFile) +include(CheckIncludeFiles) +include(CheckCXXSourceCompiles) + +macro(check_math_expr _expr _var) + check_cxx_source_compiles(" +#include <cmath> +int main(int argc, char ** argv) +{ + (void)${_expr}; + return 0; +} +" ${_var}) +endmacro() + +check_include_files("float.h" HAVE_FLOAT_H) +check_math_expr("isinf(1.0)" HAVE_FUNC_ISINF) +check_math_expr("std::isinf(1.0)" HAVE_FUNC_STD_ISINF) + +if(HAVE_FLOAT_H) + # The version that should work with MSVC + check_cxx_source_compiles(" +#include <float.h> +int main(int argc, char ** argv) +{ + (void)_finite(1.0); + return 0; +} +" HAVE_FUNC__ISINF) +else() + set(HAVE_FUNC__FINITE FALSE) +endif() + diff --git a/cmake/FindIsNaN.cmake b/cmake/FindIsNaN.cmake new file mode 100644 index 0000000000000000000000000000000000000000..13325d6e94eb1fab722507fd7881dee9d0e1da74 --- /dev/null +++ b/cmake/FindIsNaN.cmake @@ -0,0 +1,70 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find isnan macro, std::isnan function or _isnan function. +# +# Authors: +# Souriya Trinh +# +############################################################################# + +include(CheckIncludeFile) +include(CheckIncludeFiles) +include(CheckCXXSourceCompiles) + +macro(check_math_expr _expr _var) + check_cxx_source_compiles(" +#include <cmath> +int main(int argc, char ** argv) +{ + (void)${_expr}; + return 0; +} +" ${_var}) +endmacro() + +check_include_files("float.h" HAVE_FLOAT_H) +check_math_expr("isnan(1.0)" HAVE_FUNC_ISNAN) +check_math_expr("std::isnan(1.0)" HAVE_FUNC_STD_ISNAN) + +if(HAVE_FLOAT_H) + # The version that should work with MSVC + check_cxx_source_compiles(" +#include <float.h> +int main(int argc, char ** argv) +{ + (void)_isnan(1.0); + return 0; +} +" HAVE_FUNC__ISNAN) +else() + set(HAVE_FUNC__ISNAN FALSE) +endif() + diff --git a/cmake/FindLAPACK_C.cmake b/cmake/FindLAPACK_C.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0a2f3ac36bf648ed0f09a7623e85095f4a00203d --- /dev/null +++ b/cmake/FindLAPACK_C.cmake @@ -0,0 +1,145 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find lapack, the Linear Algebra PACKage. +# Since the FindLAPACK.cmake provided with CMake is for Fortran language, +# this file is able to detect lapack for C language. +# Once run this will define: +# +# LAPACK_C_FOUND +# LAPACK_C_LIBRARIES +# +# Authors: +# Filip Novotny +# Fabien Spindler +# +############################################################################# + +set(LAPACK_C_FOUND FALSE) +set(LAPACK_C_LIBRARIES "") +if(WIN32) + set(LAPACK_C_LIB_SEARCH_PATH + $ENV{LAPACK_C_HOME} + $ENV{LAPACK_C_DIR} + $ENV{LAPACK_C_HOME}/lib + $ENV{LAPACK_C_DIR}/lib + $ENV{LAPACK_HOME} + $ENV{LAPACK_DIR} + $ENV{LAPACK_HOME}/lib + $ENV{LAPACK_DIR}/lib + ) + + find_library(LAPACK_C_LIBRARY_LAPACK_C_RELEASE + NAMES lapack + PATHS ${LAPACK_C_LIB_SEARCH_PATH} + ) + + find_library(LAPACK_C_LIBRARY_BLAS_RELEASE + NAMES blas + PATHS ${LAPACK_C_LIB_SEARCH_PATH} + ) + + find_library(LAPACK_C_LIBRARY_F2C_RELEASE + NAMES libf2c + PATHS ${LAPACK_C_LIB_SEARCH_PATH} + ) + + find_library(LAPACK_C_LIBRARY_LAPACK_C_DEBUG + NAMES lapackd + PATHS ${LAPACK_C_LIB_SEARCH_PATH} + ) + + find_library(LAPACK_C_LIBRARY_BLAS_DEBUG + NAMES blasd + PATHS ${LAPACK_C_LIB_SEARCH_PATH} + ) + + find_library(LAPACK_C_LIBRARY_F2C_DEBUG + NAMES libf2cd + PATHS ${LAPACK_C_LIB_SEARCH_PATH} + ) + + if((LAPACK_C_LIBRARY_LAPACK_C_RELEASE AND LAPACK_C_LIBRARY_BLAS_RELEASE AND LAPACK_C_LIBRARY_F2C_RELEASE)) + list(APPEND LAPACK_C_LIBRARIES optimized ${LAPACK_C_LIBRARY_LAPACK_C_RELEASE}) + list(APPEND LAPACK_C_LIBRARIES optimized ${LAPACK_C_LIBRARY_BLAS_RELEASE}) + list(APPEND LAPACK_C_LIBRARIES optimized ${LAPACK_C_LIBRARY_F2C_RELEASE}) + set(LAPACK_C_FOUND TRUE) + endif() + if((LAPACK_C_LIBRARY_LAPACK_C_DEBUG AND LAPACK_C_LIBRARY_BLAS_DEBUG AND LAPACK_C_LIBRARY_F2C_DEBUG)) + list(APPEND LAPACK_C_LIBRARIES debug ${LAPACK_C_LIBRARY_LAPACK_C_DEBUG}) + list(APPEND LAPACK_C_LIBRARIES debug ${LAPACK_C_LIBRARY_BLAS_DEBUG}) + list(APPEND LAPACK_C_LIBRARIES debug ${LAPACK_C_LIBRARY_F2C_DEBUG}) + set(LAPACK_C_FOUND TRUE) + endif() + +else(WIN32) + + set(LAPACK_C_LIB_SEARCH_PATH + $ENV{LAPACK_C_HOME} + $ENV{LAPACK_C_DIR} + $ENV{LAPACK_C_HOME}/lib + $ENV{LAPACK_C_DIR}/lib + $ENV{LAPACK_HOME} + $ENV{LAPACK_DIR} + $ENV{LAPACK_HOME}/lib + $ENV{LAPACK_DIR}/lib + /usr/lib + /usr/lib64 + /usr/local/lib + /usr/local/lib64 + ) + find_library(LAPACK_C_LIBRARY_LAPACK + NAMES lapack + PATHS ${LAPACK_C_LIB_SEARCH_PATH} + ) + + find_library(LAPACK_C_LIBRARY_BLAS + NAMES blas + PATHS ${LAPACK_C_LIB_SEARCH_PATH} + ) + + if((LAPACK_C_LIBRARY_LAPACK AND LAPACK_C_LIBRARY_BLAS)) + set(LAPACK_C_LIBRARIES ${LAPACK_C_LIBRARY_LAPACK} ${LAPACK_C_LIBRARY_BLAS}) + set(LAPACK_C_FOUND TRUE) + endif() +endif(WIN32) + +mark_as_advanced( + LAPACK_C_LIBRARIES + LAPACK_C_LIBRARY_LAPACK + LAPACK_C_LIBRARY_BLAS + LAPACK_C_LIBRARY_LAPACK_C_RELEASE + LAPACK_C_LIBRARY_BLAS_RELEASE + LAPACK_C_LIBRARY_LAPACK_C_DEBUG + LAPACK_C_LIBRARY_BLAS_DEBUG + LAPACK_C_LIBRARY_F2C_DEBUG + LAPACK_C_LIBRARY_F2C_RELEASE +) + diff --git a/CMakeModules/FindLIBFREENECT.cmake b/cmake/FindLIBFREENECT.cmake similarity index 87% rename from CMakeModules/FindLIBFREENECT.cmake rename to cmake/FindLIBFREENECT.cmake index a9325f88cb81b5ddc5acb5d0e8be35fde4c27ade..3260836e4be4b5ced45a1ca9fd3bf7980bf2da5e 100644 --- a/CMakeModules/FindLIBFREENECT.cmake +++ b/cmake/FindLIBFREENECT.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindLIBFREENECT.cmake 4695 2014-03-15 11:28:48Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindLIBUSB-1.cmake b/cmake/FindLIBUSB_1.cmake similarity index 84% rename from CMakeModules/FindLIBUSB-1.cmake rename to cmake/FindLIBUSB_1.cmake index 4a9432c0b9b5e744cd6b800240fea896eff90ed1..05e95738f51cd55bbe291eeb5a1a608e44359dff 100644 --- a/CMakeModules/FindLIBUSB-1.cmake +++ b/cmake/FindLIBUSB_1.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindLIBUSB-1.cmake 4678 2014-02-19 09:52:35Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindMyCoin3D.cmake b/cmake/FindMyCoin3D.cmake similarity index 94% rename from CMakeModules/FindMyCoin3D.cmake rename to cmake/FindMyCoin3D.cmake index 1cefd1610f2967ca1a308490c68b1244e84f5b81..c7c211d4ef7652341bc9c2d6764db127e2b83be7 100644 --- a/CMakeModules/FindMyCoin3D.cmake +++ b/cmake/FindMyCoin3D.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindMyCoin3D.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindMyGTK2.cmake b/cmake/FindMyGTK2.cmake similarity index 95% rename from CMakeModules/FindMyGTK2.cmake rename to cmake/FindMyGTK2.cmake index 674de22d44067d38bdf862df4f76dd9ddd3e5ba3..0750694c5b289aba1d6e3f29927e28639331949f 100644 --- a/CMakeModules/FindMyGTK2.cmake +++ b/cmake/FindMyGTK2.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindMyGTK2.cmake 4637 2014-02-04 09:48:33Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindMyJPEG.cmake b/cmake/FindMyJPEG.cmake similarity index 89% rename from CMakeModules/FindMyJPEG.cmake rename to cmake/FindMyJPEG.cmake index 8364005a63d99ef3f5431da49d64c214bfdc9e7e..488fe9c832347931f648581fdf27d9c5deda6b31 100644 --- a/CMakeModules/FindMyJPEG.cmake +++ b/cmake/FindMyJPEG.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindMyJPEG.cmake 5316 2015-02-12 10:58:18Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindMyPNG.cmake b/cmake/FindMyPNG.cmake similarity index 93% rename from CMakeModules/FindMyPNG.cmake rename to cmake/FindMyPNG.cmake index 1a70f440c49972d067eecf3eb592c359cd97cabc..6e8b1f52ab79667b4c0d1d553c9a42a55fc30cdf 100644 --- a/CMakeModules/FindMyPNG.cmake +++ b/cmake/FindMyPNG.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindMyPNG.cmake 5316 2015-02-12 10:58:18Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindMyZLIB.cmake b/cmake/FindMyZLIB.cmake similarity index 61% rename from CMakeModules/FindMyZLIB.cmake rename to cmake/FindMyZLIB.cmake index 1d55ae6c7a0f1774d426af96fdd0630ac641ade2..7c6908e53e6212461e87505e7e7cc8a8b959d539 100644 --- a/CMakeModules/FindMyZLIB.cmake +++ b/cmake/FindMyZLIB.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindMyZLIB.cmake 5316 2015-02-12 10:58:18Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -43,6 +40,8 @@ # # Authors: # Fabien Spindler +# +############################################################################# if(MINGW) find_path(ZLIB_INCLUDE_DIR zlib.h @@ -68,8 +67,6 @@ if(UNIX) /usr/local/lib "C:/Program Files/zlib/lib" ) - #MESSAGE("ZLIB_LIBRARY=${ZLIB_LIBRARY}") - #MESSAGE("ZLIB_INCLUDE_DIRS=${ZLIB_INCLUDE_DIRS}") elseif(MINGW) find_library(ZLIB_LIBRARY z zlib "$ENV{MINGW_DIR}/lib64" @@ -95,39 +92,33 @@ else() /usr/local/lib "C:/Program Files/zlib/lib" ) - #MESSAGE("ZLIB_LIBRARY_RELEASE=${ZLIB_LIBRARY_RELEASE}") - #MESSAGE("ZLIB_LIBRARY_DEBUG=${ZLIB_LIBRARY_DEBUG}") endif() -## -------------------------------- - -IF(UNIX) - IF(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) - SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) - SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) - SET(ZLIB_FOUND TRUE) - #MESSAGE("ZLIB_LIBRARIES=${ZLIB_LIBRARIES}") - #MESSAGE("ZLIB_INCLUDE_DIRS=${ZLIB_INCLUDE_DIRS}") - ELSE() - SET(ZLIB_FOUND FALSE) - ENDIF() -ELSE(UNIX) - SET(ZLIB_LIBRARIES "") - IF(ZLIB_LIBRARY_RELEASE AND ZLIB_INCLUDE_DIR) - SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) - LIST(APPEND ZLIB_LIBRARIES optimized) - LIST(APPEND ZLIB_LIBRARIES ${ZLIB_LIBRARY_RELEASE}) - SET(ZLIB_FOUND TRUE) - ENDIF() - IF(ZLIB_LIBRARY_DEBUG AND ZLIB_INCLUDE_DIR) - SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) - LIST(APPEND ZLIB_LIBRARIES debug) - LIST(APPEND ZLIB_LIBRARIES ${ZLIB_LIBRARY_DEBUG}) - SET(ZLIB_FOUND TRUE) - ENDIF() -ENDIF(UNIX) +if(UNIX OR MINGW) + if(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) + set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) + set(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) + set(ZLIB_FOUND TRUE) + else() + set(ZLIB_FOUND FALSE) + endif() +else() + set(ZLIB_LIBRARIES "") + if(ZLIB_LIBRARY_RELEASE AND ZLIB_INCLUDE_DIR) + set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) + list(APPEND ZLIB_LIBRARIES optimized) + list(APPEND ZLIB_LIBRARIES ${ZLIB_LIBRARY_RELEASE}) + set(ZLIB_FOUND TRUE) + endif() + if(ZLIB_LIBRARY_DEBUG AND ZLIB_INCLUDE_DIR) + set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) + list(APPEND ZLIB_LIBRARIES debug) + list(APPEND ZLIB_LIBRARIES ${ZLIB_LIBRARY_DEBUG}) + set(ZLIB_FOUND TRUE) + endif() +endif() -MARK_AS_ADVANCED( +mark_as_advanced( ZLIB_INCLUDE_DIR ZLIB_LIBRARY ZLIB_LIBRARY_RELEASE diff --git a/CMakeModules/FindNAS.cmake b/cmake/FindNAS.cmake similarity index 81% rename from CMakeModules/FindNAS.cmake rename to cmake/FindNAS.cmake index 4e927af45cde72f647a9de703d35d76bc677a991..a254545479e675daa096591baa3e2a201246bc85 100644 --- a/CMakeModules/FindNAS.cmake +++ b/cmake/FindNAS.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindNAS.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindOpenCV2.cmake b/cmake/FindOpenCV2.cmake similarity index 100% rename from CMakeModules/FindOpenCV2.cmake rename to cmake/FindOpenCV2.cmake diff --git a/CMakeModules/FindPARPORT.cmake b/cmake/FindPARPORT.cmake similarity index 62% rename from CMakeModules/FindPARPORT.cmake rename to cmake/FindPARPORT.cmake index 8450d1ebf136f54a05d43da178547d85f9d7bf4e..80778b3968226fc2c8a28a39d9ac72f1008fe01a 100644 --- a/CMakeModules/FindPARPORT.cmake +++ b/cmake/FindPARPORT.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindPARPORT.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -35,24 +32,25 @@ # Once run this will define: # # PARPORT_FOUND +# PARPORT_INCLUDE_DIRS # # Authors: # Fabien Spindler # ############################################################################# -FIND_PATH(PARPORT_INCLUDE_DIR linux/parport.h +find_path(PARPORT_INCLUDE_DIRS linux/parport.h /usr/include - /usr/src/linux/include) - #MESSAGE("DBG PARPORT_INCLUDE_DIR=${PARPORT_INCLUDE_DIR}") + /usr/src/linux/include +) -MARK_AS_ADVANCED( - PARPORT_INCLUDE_DIR +mark_as_advanced( + PARPORT_INCLUDE_DIRS ) -IF(PARPORT_INCLUDE_DIR) - SET(PARPORT_FOUND TRUE) -ELSE(PARPORT_INCLUDE_DIR) - SET(PARPORT_FOUND FALSE) -ENDIF(PARPORT_INCLUDE_DIR) +if(PARPORT_INCLUDE_DIRS) + set(PARPORT_FOUND TRUE) +else() + set(PARPORT_FOUND FALSE) +endif() diff --git a/CMakeModules/FindPTHREAD.cmake b/cmake/FindPTHREAD.cmake similarity index 86% rename from CMakeModules/FindPTHREAD.cmake rename to cmake/FindPTHREAD.cmake index 683d7bf6ba5cdd7b3ad3e55a9589208be9e665dc..acbeb987f46670c06d6b8275eddb8be8b0b26efa 100644 --- a/CMakeModules/FindPTHREAD.cmake +++ b/cmake/FindPTHREAD.cmake @@ -1,104 +1,101 @@ -############################################################################# -# -# $Id: FindPTHREAD.cmake 5316 2015-02-12 10:58:18Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Try to find pthread library. -# Once run this will define: -# -# PTHREAD_FOUND -# PTHREAD_INCLUDE_DIRS -# PTHREAD_LIBRARIES -# -# Authors: -# Fabien Spindler -# -############################################################################# - -if(MINGW) - find_path(PTHREAD_INCLUDE_DIR pthread.h - "$ENV{MINGW_DIR}/include" - "$ENV{MINGW_DIR}/mingw/include" - C:/mingw/mingw/include - ) - - # pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web - find_library(PTHREAD_LIBRARY - NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 - PATHS - "$ENV{MINGW_DIR}/lib" - "$ENV{MINGW_DIR}/mingw/lib" - C:/mingw/mingw/lib - ) -else() - find_path(PTHREAD_INCLUDE_DIR pthread.h - "$ENV{PTHREAD_HOME}/include" - "$ENV{PTHREAD_DIR}/include" - /usr/include - ) - # pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web - find_library(PTHREAD_LIBRARY - NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 - PATHS - "$ENV{PTHREAD_HOME}/lib" - "$ENV{PTHREAD_DIR}/lib" - /usr/lib - /usr/local/lib - /lib - ) -endif() - #MESSAGE("DBG PTHREAD_INCLUDE_DIR=${PTHREAD_INCLUDE_DIR}") - #MESSAGE(STATUS "DBG PTHREAD_LIBRARY=${PTHREAD_LIBRARY}") - - ## -------------------------------- - - IF(PTHREAD_LIBRARY) - SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY}) - ELSE(PTHREAD_LIBRARY) - #MESSAGE(SEND_ERROR "pthread library not found.") - ENDIF(PTHREAD_LIBRARY) - - IF(NOT PTHREAD_INCLUDE_DIR) - #MESSAGE(SEND_ERROR "pthread include dir not found.") - ENDIF(NOT PTHREAD_INCLUDE_DIR) - - IF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) - SET(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR}) - SET(PTHREAD_FOUND TRUE) - ELSE(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) - SET(PTHREAD_FOUND FALSE) - ENDIF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) - - MARK_AS_ADVANCED( - PTHREAD_INCLUDE_DIR - PTHREAD_LIBRARY - ) - #MESSAGE(STATUS "PTHREAD_FOUND : ${PTHREAD_FOUND}") +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find pthread library. +# Once run this will define: +# +# PTHREAD_FOUND +# PTHREAD_INCLUDE_DIRS +# PTHREAD_LIBRARIES +# +# Authors: +# Fabien Spindler +# +############################################################################# + +if(MINGW) + find_path(PTHREAD_INCLUDE_DIR pthread.h + "$ENV{MINGW_DIR}/include" + "$ENV{MINGW_DIR}/mingw/include" + C:/mingw/mingw/include + ) + + # pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web + find_library(PTHREAD_LIBRARY + NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 + PATHS + "$ENV{MINGW_DIR}/lib" + "$ENV{MINGW_DIR}/mingw/lib" + C:/mingw/mingw/lib + ) +else() + find_path(PTHREAD_INCLUDE_DIR pthread.h + "$ENV{PTHREAD_HOME}/include" + "$ENV{PTHREAD_DIR}/include" + /usr/include + ) + # pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 are comming from web + find_library(PTHREAD_LIBRARY + NAMES pthread pthreadGC2 pthreadVSE pthreadGCE pthreadGC pthreadVC1 pthreadVC2 + PATHS + "$ENV{PTHREAD_HOME}/lib" + "$ENV{PTHREAD_DIR}/lib" + /usr/lib + /usr/local/lib + /lib + ) +endif() + #MESSAGE("DBG PTHREAD_INCLUDE_DIR=${PTHREAD_INCLUDE_DIR}") + #MESSAGE(STATUS "DBG PTHREAD_LIBRARY=${PTHREAD_LIBRARY}") + + ## -------------------------------- + + IF(PTHREAD_LIBRARY) + SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY}) + ELSE(PTHREAD_LIBRARY) + #MESSAGE(SEND_ERROR "pthread library not found.") + ENDIF(PTHREAD_LIBRARY) + + IF(NOT PTHREAD_INCLUDE_DIR) + #MESSAGE(SEND_ERROR "pthread include dir not found.") + ENDIF(NOT PTHREAD_INCLUDE_DIR) + + IF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) + SET(PTHREAD_INCLUDE_DIRS ${PTHREAD_INCLUDE_DIR}) + SET(PTHREAD_FOUND TRUE) + ELSE(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) + SET(PTHREAD_FOUND FALSE) + ENDIF(PTHREAD_LIBRARIES AND PTHREAD_INCLUDE_DIR) + + MARK_AS_ADVANCED( + PTHREAD_INCLUDE_DIR + PTHREAD_LIBRARY + ) + #MESSAGE(STATUS "PTHREAD_FOUND : ${PTHREAD_FOUND}") diff --git a/CMakeModules/FindPTU46.cmake b/cmake/FindPTU46.cmake similarity index 90% rename from CMakeModules/FindPTU46.cmake rename to cmake/FindPTU46.cmake index 46fdae34b427fef83583be84088e76caf3e56018..bad98b11cf6342dc885004ab1f72f4dfaa8c6e75 100644 --- a/CMakeModules/FindPTU46.cmake +++ b/cmake/FindPTU46.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindPTU46.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindRAW1394.cmake b/cmake/FindRAW1394.cmake similarity index 86% rename from CMakeModules/FindRAW1394.cmake rename to cmake/FindRAW1394.cmake index db33295810f070768da6375e646b15af6d14d8f7..cb8fb61037db95fd1f5e41ab454627b663a13194 100644 --- a/CMakeModules/FindRAW1394.cmake +++ b/cmake/FindRAW1394.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindRAW1394.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/CMakeModules/FindRT.cmake b/cmake/FindRT.cmake similarity index 82% rename from CMakeModules/FindRT.cmake rename to cmake/FindRT.cmake index 4554ea78f2e69195f471473578cf1eb1d7722d3a..0ef73aa28d45a76ff1932802fab0cbc59d36f840 100644 --- a/CMakeModules/FindRT.cmake +++ b/cmake/FindRT.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindRT.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/test/CMakeLists.txt b/cmake/FindRound.cmake similarity index 53% rename from test/CMakeLists.txt rename to cmake/FindRound.cmake index a20846074244be4c62eb79483df54f473c75a24e..b96556d49befe59c436efb0fdf20c0f85b32ba44 100644 --- a/test/CMakeLists.txt +++ b/cmake/FindRound.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,53 +10,56 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: -# ViSP overall configuration file. +# Try to find round function. # # Authors: -# Fabien Spindler +# Souriya Trinh # ############################################################################# -# Set SRC_SUBDIRS variable to all the sub directories we want to parse during -# the build process. -# -# If you add/remove a directory, modify here -SET (SRC_SUBDIRS - camera - device - feature - homography - image - key-point - math - network - pose - servo-afma4 - servo-afma6 - servo-viper - tools - tracking - visual-feature -) +include(CheckIncludeFile) +include(CheckIncludeFiles) +include(CheckCXXSourceCompiles) + +macro(check_math_expr1 _expr _var) + check_cxx_source_compiles(" +#include <math.h> +int main(int argc, char ** argv) +{ + (void)${_expr}; + return 0; +} +" ${_var}) +endmacro() + +macro(check_math_expr2 _expr _var) + check_cxx_source_compiles(" +#include <cmath> +int main(int argc, char ** argv) +{ + (void)${_expr}; + return 0; +} +" ${_var}) +endmacro() -# Build process propagation in the sub directories -SUBDIRS(${SRC_SUBDIRS}) +check_math_expr1("round(5.5)" HAVE_FUNC_ROUND) +check_math_expr2("std::round(5.5)" HAVE_FUNC_STD_ROUND) diff --git a/CMakeModules/FindSOQT.cmake b/cmake/FindSOQT.cmake similarity index 86% rename from CMakeModules/FindSOQT.cmake rename to cmake/FindSOQT.cmake index ad7d73ca93c1bad1aa1aa6f4aa990af6f2ac6f4e..4dfb2e4077cfeeb2326da2de20cee840309cbad0 100644 --- a/CMakeModules/FindSOQT.cmake +++ b/cmake/FindSOQT.cmake @@ -1,129 +1,126 @@ -############################################################################# -# -# $Id: FindSOQT.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Try to find SoQt library. -# Once run this will define: -# -# SOQT_FOUND -# SOQT_INCLUDE_DIRS -# SOQT_LIBRARIES -# -# Authors: -# Fabien Spindler -# -############################################################################# - -set(SOQT_FOUND FALSE) - -# detection of the SoQt headers location -FIND_PATH(SOQT_INCLUDE_DIR Inventor/Qt/SoQt.h - "$ENV{COIN_DIR}/include" - "$ENV{SOQT_DIR}/include" - "$ENV{COIN_DIR}" - "$ENV{SOQT_DIR}" - "$ENV{COINDIR}/include" - "$ENV{SOQTDIR}/include" - /usr/include/Coin2 - /Library/Frameworks/SoQt.framework/Headers - ) -#MESSAGE("DBG SOQT_INCLUDE_DIR=${SOQT_INCLUDE_DIR}") - -IF(WIN32) - # Detection of the SoQt library on Windows - FIND_LIBRARY(SOQT_LIBRARY_RELEASE - NAMES soqt1 #only shared libraries under windows - PATHS - "$ENV{COIN_DIR}/lib" - "$ENV{SOQT_DIR}/lib" - "$ENV{COINDIR}/lib" - "$ENV{SOQTDIR}/lib" - ) - FIND_LIBRARY(SOQT_LIBRARY_DEBUG - NAMES soqt1d #only shared libraries under windows - PATHS - "$ENV{COIN_DIR}/lib" - "$ENV{SOQT_DIR}/lib" - "$ENV{COINDIR}/lib" - "$ENV{SOQTDIR}/lib" - ) - - if(SOQT_INCLUDE_DIR AND SOQT_LIBRARY_RELEASE) - set(SOQT_INCLUDE_DIRS ${SOQT_INCLUDE_DIR}) - list(APPEND SOQT_LIBRARIES optimized ${SOQT_LIBRARY_RELEASE}) - set(SOQT_FOUND TRUE) - endif() - - if(SOQT_INCLUDE_DIR AND SOQT_LIBRARY_DEBUG) - set(SOQT_INCLUDE_DIRS ${SOQT_INCLUDE_DIR}) - list(APPEND SOQT_LIBRARIES debug ${SOQT_LIBRARY_DEBUG}) - set(SOQT_FOUND TRUE) - endif() - - MARK_AS_ADVANCED( - SOQT_LIBRARIES - SOQT_LIBRARY_DEBUG - SOQT_LIBRARY_RELEASE - SOQT_INCLUDE_DIR - ) - -ELSE(WIN32) - # Detection of the SoQt library on Unix - FIND_LIBRARY(SOQT_LIBRARY - NAMES SoQt - PATHS - "$ENV{COIN_DIR}/lib" - "$ENV{SOQT_DIR}/lib" - "$ENV{COINDIR}/lib" - "$ENV{SOQTDIR}/lib" - /usr/lib - /usr/local/lib - /lib - /Library/Frameworks/SoQt.framework/Libraries - ) - - if(SOQT_INCLUDE_DIR AND SOQT_LIBRARY) - set(SOQT_INCLUDE_DIRS ${SOQT_INCLUDE_DIR}) - set(SOQT_LIBRARIES ${SOQT_LIBRARY}) - set(SOQT_FOUND TRUE) - endif() - - MARK_AS_ADVANCED( - SOQT_LIBRARIES - SOQT_LIBRARY - SOQT_INCLUDE_DIR - ) - #MESSAGE(STATUS "DBG SOQT_LIBRARY=${SOQT_LIBRARY}") - -ENDIF(WIN32) - -#MESSAGE(STATUS "SOQT_FOUND : ${SOQT_FOUND}") +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find SoQt library. +# Once run this will define: +# +# SOQT_FOUND +# SOQT_INCLUDE_DIRS +# SOQT_LIBRARIES +# +# Authors: +# Fabien Spindler +# +############################################################################# + +set(SOQT_FOUND FALSE) + +# detection of the SoQt headers location +FIND_PATH(SOQT_INCLUDE_DIR Inventor/Qt/SoQt.h + "$ENV{COIN_DIR}/include" + "$ENV{SOQT_DIR}/include" + "$ENV{COIN_DIR}" + "$ENV{SOQT_DIR}" + "$ENV{COINDIR}/include" + "$ENV{SOQTDIR}/include" + /usr/include/Coin2 + /Library/Frameworks/SoQt.framework/Headers + ) +#MESSAGE("DBG SOQT_INCLUDE_DIR=${SOQT_INCLUDE_DIR}") + +IF(WIN32) + # Detection of the SoQt library on Windows + FIND_LIBRARY(SOQT_LIBRARY_RELEASE + NAMES soqt1 #only shared libraries under windows + PATHS + "$ENV{COIN_DIR}/lib" + "$ENV{SOQT_DIR}/lib" + "$ENV{COINDIR}/lib" + "$ENV{SOQTDIR}/lib" + ) + FIND_LIBRARY(SOQT_LIBRARY_DEBUG + NAMES soqt1d #only shared libraries under windows + PATHS + "$ENV{COIN_DIR}/lib" + "$ENV{SOQT_DIR}/lib" + "$ENV{COINDIR}/lib" + "$ENV{SOQTDIR}/lib" + ) + + if(SOQT_INCLUDE_DIR AND SOQT_LIBRARY_RELEASE) + set(SOQT_INCLUDE_DIRS ${SOQT_INCLUDE_DIR}) + list(APPEND SOQT_LIBRARIES optimized ${SOQT_LIBRARY_RELEASE}) + set(SOQT_FOUND TRUE) + endif() + + if(SOQT_INCLUDE_DIR AND SOQT_LIBRARY_DEBUG) + set(SOQT_INCLUDE_DIRS ${SOQT_INCLUDE_DIR}) + list(APPEND SOQT_LIBRARIES debug ${SOQT_LIBRARY_DEBUG}) + set(SOQT_FOUND TRUE) + endif() + + MARK_AS_ADVANCED( + SOQT_LIBRARIES + SOQT_LIBRARY_DEBUG + SOQT_LIBRARY_RELEASE + SOQT_INCLUDE_DIR + ) + +ELSE(WIN32) + # Detection of the SoQt library on Unix + FIND_LIBRARY(SOQT_LIBRARY + NAMES SoQt + PATHS + "$ENV{COIN_DIR}/lib" + "$ENV{SOQT_DIR}/lib" + "$ENV{COINDIR}/lib" + "$ENV{SOQTDIR}/lib" + /usr/lib + /usr/local/lib + /lib + /Library/Frameworks/SoQt.framework/Libraries + ) + + if(SOQT_INCLUDE_DIR AND SOQT_LIBRARY) + set(SOQT_INCLUDE_DIRS ${SOQT_INCLUDE_DIR}) + set(SOQT_LIBRARIES ${SOQT_LIBRARY}) + set(SOQT_FOUND TRUE) + endif() + + MARK_AS_ADVANCED( + SOQT_LIBRARIES + SOQT_LIBRARY + SOQT_INCLUDE_DIR + ) + #MESSAGE(STATUS "DBG SOQT_LIBRARY=${SOQT_LIBRARY}") + +ENDIF(WIN32) + +#MESSAGE(STATUS "SOQT_FOUND : ${SOQT_FOUND}") diff --git a/CMakeModules/FindSOWIN.cmake b/cmake/FindSOWIN.cmake similarity index 83% rename from CMakeModules/FindSOWIN.cmake rename to cmake/FindSOWIN.cmake index 632fb721711e0d69a531adc18f7e05a5d533401f..667e87bcf1a97d592d51cd1fbfe276505447d597 100644 --- a/CMakeModules/FindSOWIN.cmake +++ b/cmake/FindSOWIN.cmake @@ -1,95 +1,92 @@ -############################################################################# -# -# $Id: FindSOWIN.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Try to find SoQt library. -# Once run this will define: -# -# SOWIN_FOUND -# SOWIN_INCLUDE_DIRS -# SOWIN_LIBRARIES -# SOWIN_LIBRARY_RELEASE -# SOWIN_LIBRARY_DEBUG -# -# Authors: -# Fabien Spindler -# Anthony Saunier -# -############################################################################# - -set(SOWIN_FOUND FALSE) - -if(WIN32) - FIND_LIBRARY(SOWIN_LIBRARY_RELEASE - NAMES sowin1 #only shared libraries under windows - PATHS - "$ENV{COINDIR}/lib" - "$ENV{COIN_DIR}/lib" - "$ENV{SOWIN_DIR}/lib" - ) - FIND_LIBRARY(SOWIN_LIBRARY_DEBUG - NAMES sowin1d #only shared libraries under windows - PATHS - "$ENV{COINDIR}/lib" - "$ENV{COIN_DIR}/lib" - "$ENV{SOWIN_DIR}/lib" - ) - - FIND_PATH(SOWIN_INCLUDE_DIR Inventor/Win/SoWin.h - "$ENV{COINDIR}/include" - "$ENV{COIN_DIR}/include" - "$ENV{SOWIN_DIR}/include" - ) - - ## -------------------------------- - set(SOWIN_LIBRARIES "") - - if(SOWIN_LIBRARY_DEBUG) - list(APPEND SOWIN_LIBRARIES debug ${SOWIN_LIBRARY_DEBUG}) - endif() - if(SOWIN_LIBRARY_RELEASE) - list(APPEND SOWIN_LIBRARIES optimized ${SOWIN_LIBRARY_RELEASE}) - endif() - IF(SOWIN_LIBRARIES AND SOWIN_INCLUDE_DIR) - set(SOWIN_INCLUDE_DIRS ${SOWIN_INCLUDE_DIR}) - set(SOWIN_FOUND TRUE) - else() - set(SOWIN_FOUND FALSE) - endif() - -endif(WIN32) - -MARK_AS_ADVANCED( - SOWIN_LIBRARY_DEBUG - SOWIN_LIBRARY_RELEASE - SOWIN_INCLUDE_DIR -) +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find SoQt library. +# Once run this will define: +# +# SOWIN_FOUND +# SOWIN_INCLUDE_DIRS +# SOWIN_LIBRARIES +# SOWIN_LIBRARY_RELEASE +# SOWIN_LIBRARY_DEBUG +# +# Authors: +# Fabien Spindler +# Anthony Saunier +# +############################################################################# + +set(SOWIN_FOUND FALSE) + +if(WIN32) + FIND_LIBRARY(SOWIN_LIBRARY_RELEASE + NAMES sowin1 #only shared libraries under windows + PATHS + "$ENV{COINDIR}/lib" + "$ENV{COIN_DIR}/lib" + "$ENV{SOWIN_DIR}/lib" + ) + FIND_LIBRARY(SOWIN_LIBRARY_DEBUG + NAMES sowin1d #only shared libraries under windows + PATHS + "$ENV{COINDIR}/lib" + "$ENV{COIN_DIR}/lib" + "$ENV{SOWIN_DIR}/lib" + ) + + FIND_PATH(SOWIN_INCLUDE_DIR Inventor/Win/SoWin.h + "$ENV{COINDIR}/include" + "$ENV{COIN_DIR}/include" + "$ENV{SOWIN_DIR}/include" + ) + + ## -------------------------------- + set(SOWIN_LIBRARIES "") + + if(SOWIN_LIBRARY_DEBUG) + list(APPEND SOWIN_LIBRARIES debug ${SOWIN_LIBRARY_DEBUG}) + endif() + if(SOWIN_LIBRARY_RELEASE) + list(APPEND SOWIN_LIBRARIES optimized ${SOWIN_LIBRARY_RELEASE}) + endif() + IF(SOWIN_LIBRARIES AND SOWIN_INCLUDE_DIR) + set(SOWIN_INCLUDE_DIRS ${SOWIN_INCLUDE_DIR}) + set(SOWIN_FOUND TRUE) + else() + set(SOWIN_FOUND FALSE) + endif() + +endif(WIN32) + +MARK_AS_ADVANCED( + SOWIN_LIBRARY_DEBUG + SOWIN_LIBRARY_RELEASE + SOWIN_INCLUDE_DIR +) diff --git a/CMakeModules/FindSOXT.cmake b/cmake/FindSOXT.cmake similarity index 79% rename from CMakeModules/FindSOXT.cmake rename to cmake/FindSOXT.cmake index 2d178304027951366a4d0783d1e55f0b40f031d5..1a5de4a9fb3eb51575c6adf48613e8439e74a1a6 100644 --- a/CMakeModules/FindSOXT.cmake +++ b/cmake/FindSOXT.cmake @@ -1,79 +1,76 @@ -############################################################################# -# -# $Id: FindSOXT.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Try to find SoXt library. -# Once run this will define: -# -# SOXT_FOUND -# SOXT_LIBRARIES -# -# Authors: -# Fabien Spindler -# -############################################################################# - -IF(UNIX) - -FIND_LIBRARY(SOXT_LIBRARY - NAMES SoXt - PATHS - /usr/lib - /usr/local/lib - /lib - "$ENV{COIN_DIR}/lib" - "$ENV{COINDIR}/lib" - ) -MARK_AS_ADVANCED( - SOXT_LIBRARY - ) - #MESSAGE(STATUS "DBG SOXT_LIBRARY=${SOXT_LIBRARY}") - - ## -------------------------------- - - IF(SOXT_LIBRARY) - - SET(SOXT_LIBRARIES ${SOXT_LIBRARY}) - SET(SOXT_FOUND TRUE) - MARK_AS_ADVANCED( - SOXT_LIBRARIES - ) - ELSE(SOXT_LIBRARY) - SET(SOXT_FOUND FALSE) - #MESSAGE("SoXt library not found.") - ENDIF(SOXT_LIBRARY) - - #MESSAGE(STATUS "SOXT_FOUND : ${SOXT_FOUND}") - -ELSE(UNIX) - SET(SOXT_FOUND FALSE) -ENDIF(UNIX) +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find SoXt library. +# Once run this will define: +# +# SOXT_FOUND +# SOXT_LIBRARIES +# +# Authors: +# Fabien Spindler +# +############################################################################# + +IF(UNIX) + +FIND_LIBRARY(SOXT_LIBRARY + NAMES SoXt + PATHS + /usr/lib + /usr/local/lib + /lib + "$ENV{COIN_DIR}/lib" + "$ENV{COINDIR}/lib" + ) +MARK_AS_ADVANCED( + SOXT_LIBRARY + ) + #MESSAGE(STATUS "DBG SOXT_LIBRARY=${SOXT_LIBRARY}") + + ## -------------------------------- + + IF(SOXT_LIBRARY) + + SET(SOXT_LIBRARIES ${SOXT_LIBRARY}) + SET(SOXT_FOUND TRUE) + MARK_AS_ADVANCED( + SOXT_LIBRARIES + ) + ELSE(SOXT_LIBRARY) + SET(SOXT_FOUND FALSE) + #MESSAGE("SoXt library not found.") + ENDIF(SOXT_LIBRARY) + + #MESSAGE(STATUS "SOXT_FOUND : ${SOXT_FOUND}") + +ELSE(UNIX) + SET(SOXT_FOUND FALSE) +ENDIF(UNIX) diff --git a/CMakeModules/FindV4L2.cmake b/cmake/FindV4L2.cmake similarity index 84% rename from CMakeModules/FindV4L2.cmake rename to cmake/FindV4L2.cmake index fe068c3d40298119526aa5f7d7c4e855a6b2ba3c..d2e92ae0495048629096a3ca9d7c5ff79b554c3b 100644 --- a/CMakeModules/FindV4L2.cmake +++ b/cmake/FindV4L2.cmake @@ -1,106 +1,103 @@ -############################################################################# -# -# $Id: FindV4L2.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Try to find linux/videodev.h for Video For Linux Two framegrabbing -# capabilities. -# Once run this will define: -# -# V4L2_FOUND -# V4L2_INCLUDE_DIRS -# V4L2_LIBRARIES -# -# Authors: -# Fabien Spindler -# -############################################################################# - -IF(NOT UNIX) - # MESSAGE("FindV4L2.cmake: only available for Unix.") - SET(V4L2_FOUND FALSE) -ELSE(NOT UNIX) - - FIND_PATH(V4L2_INCLUDE_VIDEODEV2 linux/videodev2.h - $ENV{V4L2_HOME}/include - $ENV{V4L2_DIR}/include - /usr/include - /usr/local/include - /usr/src/linux/include - ) - #MESSAGE("DBG V4L2_INCLUDE_VIDEODEV2=${V4L2_INCLUDE_VIDEODEV2}") - - FIND_PATH(V4L2_INCLUDE_LIBV4L2 libv4l2.h - $ENV{V4L2_HOME}/include - $ENV{V4L2_DIR}/include - /usr/include - /usr/local/include - ) - #MESSAGE("DBG V4L2_INCLUDE_LIBV4L2=${V4L2_INCLUDE_LIBV4L2}") - - FIND_LIBRARY(V4L2_LIBRARY_LIBV4L2 - NAMES v4l2 - PATHS - $ENV{V4L2_HOME}/lib - $ENV{V4L2_DIR}/lib - /usr/lib - /usr/local/lib - ) - - FIND_LIBRARY(V4L2_LIBRARY_LIBV4LCONVERT - NAMES v4lconvert - PATHS - $ENV{V4L2_HOME}/lib - $ENV{V4L2_DIR}/lib - /usr/lib - /usr/local/lib - ) - - - ## -------------------------------- - - - IF(V4L2_INCLUDE_VIDEODEV2 AND V4L2_INCLUDE_LIBV4L2 AND V4L2_LIBRARY_LIBV4L2 AND V4L2_LIBRARY_LIBV4LCONVERT) - SET(V4L2_INCLUDE_DIRS ${V4L2_INCLUDE_VIDEODEV2} ${V4L2_INCLUDE_LIBV4L2}) - SET(V4L2_LIBRARIES ${V4L2_LIBRARY_LIBV4L2} ${V4L2_LIBRARY_LIBV4LCONVERT}) - SET(V4L2_FOUND TRUE) - ELSE() - SET(V4L2_FOUND FALSE) - ENDIF() - - MARK_AS_ADVANCED( - V4L2_INCLUDE_DIRS - V4L2_INCLUDE_VIDEODEV2 - V4L2_INCLUDE_LIBV4L2 - V4L2_LIBRARY_LIBV4L2 - V4L2_LIBRARY_LIBV4LCONVERT - ) -ENDIF(NOT UNIX) +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find linux/videodev.h for Video For Linux Two framegrabbing +# capabilities. +# Once run this will define: +# +# V4L2_FOUND +# V4L2_INCLUDE_DIRS +# V4L2_LIBRARIES +# +# Authors: +# Fabien Spindler +# +############################################################################# + +IF(NOT UNIX) + # MESSAGE("FindV4L2.cmake: only available for Unix.") + SET(V4L2_FOUND FALSE) +ELSE(NOT UNIX) + + FIND_PATH(V4L2_INCLUDE_VIDEODEV2 linux/videodev2.h + $ENV{V4L2_HOME}/include + $ENV{V4L2_DIR}/include + /usr/include + /usr/local/include + /usr/src/linux/include + ) + #MESSAGE("DBG V4L2_INCLUDE_VIDEODEV2=${V4L2_INCLUDE_VIDEODEV2}") + + FIND_PATH(V4L2_INCLUDE_LIBV4L2 libv4l2.h + $ENV{V4L2_HOME}/include + $ENV{V4L2_DIR}/include + /usr/include + /usr/local/include + ) + #MESSAGE("DBG V4L2_INCLUDE_LIBV4L2=${V4L2_INCLUDE_LIBV4L2}") + + FIND_LIBRARY(V4L2_LIBRARY_LIBV4L2 + NAMES v4l2 + PATHS + $ENV{V4L2_HOME}/lib + $ENV{V4L2_DIR}/lib + /usr/lib + /usr/local/lib + ) + + FIND_LIBRARY(V4L2_LIBRARY_LIBV4LCONVERT + NAMES v4lconvert + PATHS + $ENV{V4L2_HOME}/lib + $ENV{V4L2_DIR}/lib + /usr/lib + /usr/local/lib + ) + + + ## -------------------------------- + + + IF(V4L2_INCLUDE_VIDEODEV2 AND V4L2_INCLUDE_LIBV4L2 AND V4L2_LIBRARY_LIBV4L2 AND V4L2_LIBRARY_LIBV4LCONVERT) + SET(V4L2_INCLUDE_DIRS ${V4L2_INCLUDE_VIDEODEV2} ${V4L2_INCLUDE_LIBV4L2}) + SET(V4L2_LIBRARIES ${V4L2_LIBRARY_LIBV4L2} ${V4L2_LIBRARY_LIBV4LCONVERT}) + SET(V4L2_FOUND TRUE) + ELSE() + SET(V4L2_FOUND FALSE) + ENDIF() + + MARK_AS_ADVANCED( + V4L2_INCLUDE_DIRS + V4L2_INCLUDE_VIDEODEV2 + V4L2_INCLUDE_LIBV4L2 + V4L2_LIBRARY_LIBV4L2 + V4L2_LIBRARY_LIBV4LCONVERT + ) +ENDIF(NOT UNIX) diff --git a/CMakeModules/FindXML2.cmake b/cmake/FindXML2.cmake old mode 100755 new mode 100644 similarity index 89% rename from CMakeModules/FindXML2.cmake rename to cmake/FindXML2.cmake index d03d955a06c5536a158afc46d1050a0c8f38891d..ba6ca5bb558aeb9f3db9494d54bac1c134054687 --- a/CMakeModules/FindXML2.cmake +++ b/cmake/FindXML2.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: FindXML2.cmake 5316 2015-02-12 10:58:18Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -77,12 +74,14 @@ else(WIN32) "$ENV{XML2_HOME}/include/libxml2" /usr/include/libxml2 /usr/local/include/libxml2 + /usr/local/opt/libxml2/include/libxml2 ) find_library(XML2_LIBRARY xml2 "$ENV{XML2_DIR}/lib" "$ENV{XML2_HOME}/lib" /usr/lib /usr/local/lib + /usr/local/opt/libxml2/lib ) endif(WIN32) #MESSAGE("DBG XML2_INCLUDE_DIR=${XML2_INCLUDE_DIR}") diff --git a/CMakeModules/FindZBAR.cmake b/cmake/FindZBAR.cmake similarity index 77% rename from CMakeModules/FindZBAR.cmake rename to cmake/FindZBAR.cmake index 21c31be5e4d5fc69104a8ffdf8655c2f9148486c..241779a7a70938581ffc542d71e812bf362d9d37 100644 --- a/CMakeModules/FindZBAR.cmake +++ b/cmake/FindZBAR.cmake @@ -1,71 +1,68 @@ -############################################################################# -# -# $Id: FindV4L2.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Try to find zbar library. -# Once run this will define: -# -# ZBAR_FOUND -# ZBAR_INCLUDE_DIRS -# ZBAR_LIBRARIES -# -# Authors: -# Fabien Spindler -# -############################################################################# - - -find_path(ZBAR_INCLUDE_DIRS zbar.h - $ENV{ZBAR_DIR}/include - /usr/include - /usr/local/include -) - -find_library(ZBAR_LIBRARIES - NAMES zbar - PATHS - $ENV{ZBAR_DIR}/lib - /usr/lib - /usr/local/lib -) - -if(ZBAR_INCLUDE_DIRS AND ZBAR_LIBRARIES) - set(ZBAR_FOUND TRUE) -else() - set(ZBAR_FOUND FALSE) -endif() - -mark_as_advanced( - ZBAR_INCLUDE_DIRS - ZBAR_LIBRARIES -) - +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# Try to find zbar library. +# Once run this will define: +# +# ZBAR_FOUND +# ZBAR_INCLUDE_DIRS +# ZBAR_LIBRARIES +# +# Authors: +# Fabien Spindler +# +############################################################################# + + +find_path(ZBAR_INCLUDE_DIRS zbar.h + $ENV{ZBAR_DIR}/include + /usr/include + /usr/local/include +) + +find_library(ZBAR_LIBRARIES + NAMES zbar + PATHS + $ENV{ZBAR_DIR}/lib + /usr/lib + /usr/local/lib +) + +if(ZBAR_INCLUDE_DIRS AND ZBAR_LIBRARIES) + set(ZBAR_FOUND TRUE) +else() + set(ZBAR_FOUND FALSE) +endif() + +mark_as_advanced( + ZBAR_INCLUDE_DIRS + ZBAR_LIBRARIES +) + diff --git a/CMakeModules/GNUInstallDirs.cmake b/cmake/GNUInstallDirs.cmake similarity index 100% rename from CMakeModules/GNUInstallDirs.cmake rename to cmake/GNUInstallDirs.cmake diff --git a/cmake/OgreTools.cmake b/cmake/OgreTools.cmake new file mode 100644 index 0000000000000000000000000000000000000000..81951be1552a3538e69a4593fe400d0f765e2d9b --- /dev/null +++ b/cmake/OgreTools.cmake @@ -0,0 +1,371 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP overall configuration file. Some useful tools for Ogre3D. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +######################################################### +# Find Ogre plugins +# +# This is a modified version of the macro provided with Ogre +# except that it should be used only in a desperate way when the original +# one doesn't detect anything +######################################################### + + +macro(vp_ogre_find_plugin_lib_visp PLUGIN) + # On Unix, the plugins might have no prefix + if (CMAKE_FIND_LIBRARY_PREFIXES) + set(TMP_CMAKE_LIB_PREFIX ${CMAKE_FIND_LIBRARY_PREFIXES}) + set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "") + endif() + + # strip RenderSystem_ or Plugin_ prefix from plugin name + string(REPLACE "RenderSystem_" "" PLUGIN_TEMP ${PLUGIN}) + string(REPLACE "Plugin_" "" PLUGIN_NAME ${PLUGIN_TEMP}) + + set(OGRE_PLUGIN_PATH_SUFFIXES + PlugIns PlugIns/${PLUGIN_NAME} Plugins Plugins/${PLUGIN_NAME} ${PLUGIN} + RenderSystems RenderSystems/${PLUGIN_NAME} ${ARGN}) + # find link libraries for plugins + set(OGRE_${PLUGIN}_LIBRARY_NAMES "${PLUGIN}${OGRE_LIB_SUFFIX}") + get_debug_names(OGRE_${PLUGIN}_LIBRARY_NAMES) + find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES} + HINTS ${OGRE_LIBRARY_DIRS} ${OGRE_LIBRARY_DIRS}/OGRE ${OGRE_LIBRARY_DIRS}/OGRE-${OGRE_VERSION_MAJOR}.${OGRE_VERSION_MINOR}.${OGRE_VERSION_PATCH} + PATH_SUFFIXES "" OGRE opt release release/opt relwithdebinfo relwithdebinfo/opt minsizerel minsizerel/opt) + find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG} + HINTS ${OGRE_LIBRARY_DIRS} ${OGRE_LIBRARY_DIRS}/OGRE ${OGRE_LIBRARY_DIRS}/OGRE-${OGRE_VERSION_MAJOR}.${OGRE_VERSION_MINOR}.${OGRE_VERSION_PATCH} + PATH_SUFFIXES "" OGRE opt debug debug/opt) + make_library_set(OGRE_${PLUGIN}_LIBRARY) + + if (OGRE_${PLUGIN}_LIBRARY) + set(OGRE_${PLUGIN}_FOUND TRUE) + endif () + + mark_as_advanced(OGRE_${PLUGIN}_LIBRARY_REL OGRE_${PLUGIN}_LIBRARY_DBG OGRE_${PLUGIN}_LIBRARY_FWK) +endmacro() + +macro(vp_create_ogre_plugin_config_file) + set(VISP_HAVE_OGRE_PLUGINS_PATH "${VISP_BINARY_DIR}/data/ogre-simulator" CACHE INTERNAL "Ogre plugins location") + + # If OGRE_PLUGIN_DIR_REL and OGRE_PLUGIN_DIR_DBG are not defined we + # try to find them manually + if(NOT OGRE_PLUGIN_DIR_REL AND NOT OGRE_PLUGIN_DIR_DBG) + vp_ogre_find_plugin_lib_visp(RenderSystem_Direct3D9) + vp_ogre_find_plugin_lib_visp(RenderSystem_Direct3D10) + vp_ogre_find_plugin_lib_visp(RenderSystem_Direct3D11) + vp_ogre_find_plugin_lib_visp(RenderSystem_GL) + vp_ogre_find_plugin_lib_visp(RenderSystem_GLES) + vp_ogre_find_plugin_lib_visp(Plugin_ParticleFX) + vp_ogre_find_plugin_lib_visp(Plugin_BSPSceneManager) + vp_ogre_find_plugin_lib_visp(Plugin_CgProgramManager) + vp_ogre_find_plugin_lib_visp(Plugin_PCZSceneManager) + vp_ogre_find_plugin_lib_visp(Plugin_OctreeSceneManager) + vp_ogre_find_plugin_lib_visp(Plugin_OctreeZone) + + if(OGRE_RenderSystem_GL_LIBRARY_REL) + get_filename_component(OGRE_PLUGIN_DIR_REL ${OGRE_RenderSystem_GL_LIBRARY_REL} PATH) + #message("set manually OGRE_PLUGIN_DIR_REL to ${OGRE_PLUGIN_DIR_REL}") + elseif(OGRE_RenderSystem_GL_LIBRARY_DBG) + get_filename_component(OGRE_PLUGIN_DIR_DBG ${OGRE_RenderSystem_GL_LIBRARY_DBG} PATH) + #message("set manually OGRE_PLUGIN_DIR_DBG to ${OGRE_PLUGIN_DIR_DBG}") + endif() + endif() + + if(OGRE_PLUGIN_DIR_REL) + list(APPEND PLUGIN_REL ${OGRE_RenderSystem_Direct3D9_LIBRARY_REL}) + list(APPEND PLUGIN_REL ${OGRE_RenderSystem_Direct3D10_LIBRARY_REL}) + list(APPEND PLUGIN_REL ${OGRE_RenderSystem_Direct3D11_LIBRARY_REL}) + list(APPEND PLUGIN_REL ${OGRE_RenderSystem_GL_LIBRARY_REL}) + list(APPEND PLUGIN_REL ${OGRE_RenderSystem_GLES_LIBRARY_REL}) + list(APPEND PLUGIN_REL ${OGRE_Plugin_ParticleFX_LIBRARY_REL}) + list(APPEND PLUGIN_REL ${OGRE_Plugin_BSPSceneManager_LIBRARY_REL}) + list(APPEND PLUGIN_REL ${OGRE_Plugin_CgProgramManager_LIBRARY_REL}) + list(APPEND PLUGIN_REL ${OGRE_Plugin_PCZSceneManager_LIBRARY_REL}) + list(APPEND PLUGIN_REL ${OGRE_Plugin_OctreeSceneManager_LIBRARY_REL}) + if(NOT APPLE) + # Since the plugin Plugin_Octree causes problems on OSX, we take + # it only into account on non Apple platforms + list(APPEND PLUGIN_REL ${OGRE_Plugin_OctreeZone_LIBRARY_REL}) + endif() + + set(PLUGINS_CONTENT_REL "# Defines plugins to load\n\n") + list(APPEND PLUGINS_CONTENT_REL "# Define plugin folder\n") + + list(APPEND PLUGINS_CONTENT_REL "PluginFolder=${OGRE_PLUGIN_DIR_REL}/\n\n") + list(APPEND PLUGINS_CONTENT_REL "# Define plugins\n") + foreach(PLUGIN ${PLUGIN_REL}) + if(PLUGIN) + get_filename_component(PLUGIN_NAME ${PLUGIN} NAME_WE) + list(APPEND PLUGINS_CONTENT_REL " Plugin=${PLUGIN_NAME}\n") + endif() + endforeach() + #MESSAGE("PLUGINS_CONTENT_REL: ${PLUGINS_CONTENT_REL}") + file(WRITE "${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins.cfg" ${PLUGINS_CONTENT_REL}) + endif() + + if(OGRE_PLUGIN_DIR_DBG) + list(APPEND PLUGIN_DBG ${OGRE_RenderSystem_Direct3D9_LIBRARY_DBG}) + list(APPEND PLUGIN_DBG ${OGRE_RenderSystem_Direct3D10_LIBRARY_DBG}) + list(APPEND PLUGIN_DBG ${OGRE_RenderSystem_Direct3D11_LIBRARY_DBG}) + list(APPEND PLUGIN_DBG ${OGRE_RenderSystem_GL_LIBRARY_DBG}) + list(APPEND PLUGIN_DBG ${OGRE_RenderSystem_GLES_LIBRARY_DBG}) + list(APPEND PLUGIN_DBG ${OGRE_Plugin_ParticleFX_LIBRARY_DBG}) + list(APPEND PLUGIN_DBG ${OGRE_Plugin_BSPSceneManager_LIBRARY_DBG}) + list(APPEND PLUGIN_DBG ${OGRE_Plugin_CgProgramManager_LIBRARY_DBG}) + list(APPEND PLUGIN_DBG ${OGRE_Plugin_PCZSceneManager_LIBRARY_DBG}) + list(APPEND PLUGIN_DBG ${OGRE_Plugin_OctreeSceneManager_LIBRARY_DBG}) + if(NOT APPLE) + # Since the plugin Plugin_Octree causes problems on OSX, we take + # it only into account on non Apple platforms + list(APPEND PLUGIN_DBG ${OGRE_Plugin_OctreeZone_LIBRARY_DBG}) + endif() + + set(PLUGINS_CONTENT_DBG "# Defines plugins to load\n\n") + list(APPEND PLUGINS_CONTENT_DBG "# Define plugin folder\n") + list(APPEND PLUGINS_CONTENT_DBG "PluginFolder=${OGRE_PLUGIN_DIR_DBG}/\n\n") + list(APPEND PLUGINS_CONTENT_DBG "# Define plugins\n") + foreach(PLUGIN ${PLUGIN_DBG}) + if(PLUGIN) + get_filename_component(PLUGIN_NAME ${PLUGIN} NAME_WE) + list(APPEND PLUGINS_CONTENT_DBG " Plugin=${PLUGIN_NAME}\n") + endif() + endforeach() + + #MESSAGE("PLUGINS_CONTENT_DBG: ${PLUGINS_CONTENT_DBG}") + file(WRITE "${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins_d.cfg" ${PLUGINS_CONTENT_DBG}) + endif() +endmacro() + +function(vp_set_ogre_media) + # if OGRE_MEDIA_DIR is empty, try to find the path by searching for plugins.cfg + # Introduced since Ubuntu 12.04 + if(NOT OGRE_MEDIA_DIR) + find_path(OGRE_MEDIA_DIR ../plugins.cfg + $ENV{OGRE_MEDIA_DIR} + /usr/share/OGRE-1.7.4/media + /usr/share/OGRE-1.8.0/media + /usr/share/OGRE-1.8.1/media + /usr/share/OGRE-1.9.0/media + ) + endif() + + # If Ogre media are not available we provide the minimal material to run the examples: + # - resources.cfg + # - plugins.cfg + # - media/materials/... + # - media/models/... + # + # We need to introduce OGRE_MEDIA_NOT_AVAILABLE to memorize when OGRE_MEDIA_DIR is not set. + # Because in that case, OGRE_MEDIA_DIR should be set first to VISP_HAVE_OGRE_RESOURCES_PATH + # (for the "make all" case) then to VISP_INSTALL_DIR_OGRE_RESOURCES (for the "make install" case) + if(NOT OGRE_MEDIA_DIR) + set(OGRE_MEDIA_NOT_AVAILABLE "TRUE") + endif() + + # Try to search for an existing plugins.cfg file + # Here we cannot use OGRE_PLUGIN_DIR_REL or OGRE_PLUGIN_DIR_DBG where + # we may find an existing plugins.cfg file, since under Windows in these + # files the PluginFolder is set to a relative path. We need an absolute + # path to avoid recopy of the plugins in ViSP. + # Under Linux or OSX, we may find plugins.cfg with a PluginFolder set + # to an absolute path in OGRE_MEDIA_DIR/.. + find_path(ogre_plugings_cfg_exists + NAMES plugins.cfg + PATHS ${OGRE_MEDIA_DIR}/.. + NO_SYSTEM_ENVIRONMENT_PATH + ) + mark_as_advanced(ogre_plugings_cfg_exists) + + #message("OGRE_PLUGIN_DIR_REL: ${OGRE_PLUGIN_DIR_REL}") + #message("OGRE_PLUGIN_DIR_DBG: ${OGRE_PLUGIN_DIR_DBG}") + if(ogre_plugings_cfg_exists) + set(VISP_HAVE_OGRE_PLUGINS_PATH "${ogre_plugings_cfg_exists}" CACHE INTERNAL "Ogre plugins location") + else(NOT ogre_plugings_cfg_exists) + # If no plugins.cfg file is found, we create one with absolute path + + # case 1: normal case + #-------------- + vp_create_ogre_plugin_config_file() + + # case 2: install or packaging case + #-------------- + # install rule for plugins.cfg: + if(UNIX) + if(OGRE_PLUGIN_DIR_REL) + install(FILES + ${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins.cfg + DESTINATION ${CMAKE_INSTALL_LIBDIR}/visp/data/ogre-simulator + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + COMPONENT dev + ) + endif() + if(OGRE_PLUGIN_DIR_DBG) + install(FILES + ${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins_d.cfg + DESTINATION ${CMAKE_INSTALL_LIBDIR}/visp/data/ogre-simulator + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + COMPONENT dev + ) + endif() + + else() + if(OGRE_PLUGIN_DIR_REL) + install(FILES + ${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins.cfg + DESTINATION data/ogre-simulator + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + COMPONENT dev + ) + endif() + if(OGRE_PLUGIN_DIR_DBG) + install(FILES + ${VISP_HAVE_OGRE_PLUGINS_PATH}/plugins_d.cfg + DESTINATION data/ogre-simulator + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + COMPONENT dev + ) + endif() + endif() + endif() + + # Try to search for an existing resources.cfg file + find_path(ogre_resources_cfg_exists + NAMES resources.cfg + PATHS ${OGRE_MEDIA_DIR}/.. + NO_SYSTEM_ENVIRONMENT_PATH + ) + mark_as_advanced(ogre_resources_cfg_exists) + # Here we copy all the minimal media files + # - media/materials/... + # - media/models/... + if(OGRE_MEDIA_NOT_AVAILABLE) + file(COPY modules/ar/data/ogre-simulator/media DESTINATION ${VISP_BINARY_DIR}/data/ogre-simulator) + endif() + + if(ogre_resources_cfg_exists) + set(VISP_HAVE_OGRE_RESOURCES_PATH "${ogre_resources_cfg_exists}" CACHE INTERNAL "Ogre resources location") + else() + # Here we create a resources.cfg if it was not found + + # we create a resources.cfg file for vpAROgre.cpp + # case 1: normal case + # If OGRE_MEDIA_DIR is not found, we set it to VISP_HAVE_OGRE_RESOURCES_PATH in order to use + # the minimal requested media to run the examples + #-------------- + set(VISP_HAVE_OGRE_RESOURCES_PATH "${VISP_BINARY_DIR}/data/ogre-simulator" CACHE INTERNAL "Ogre resources location") + + if(OGRE_MEDIA_NOT_AVAILABLE) + set(OGRE_MEDIA_DIR ${VISP_HAVE_OGRE_RESOURCES_PATH}/media) + endif() + + # Here we add all the subdirs in @OGRE_MEDIA_DIR@/* as resource location. + vp_get_relative_subdirs(media_subdirs ${OGRE_MEDIA_DIR}) + set(OGRE_RESOURCES_FileSystem "FileSystem=${OGRE_MEDIA_DIR}\n") + foreach(m ${media_subdirs}) + set(OGRE_RESOURCES_FileSystem "${OGRE_RESOURCES_FileSystem}FileSystem=${OGRE_MEDIA_DIR}/${m}\n") + endforeach() + + configure_file( + ${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in + ${VISP_HAVE_OGRE_RESOURCES_PATH}/resources.cfg + IMMEDIATE @ONLY + ) + + # case 2: install or packaging case + # If OGRE_MEDIA_DIR is not found, we set it to VISP_INSTALL_DIR_OGRE_RESOURCES in order to use + # the minimal requested media to run the examples + #-------------- + if(UNIX) + set(VISP_INSTALL_DIR_OGRE_RESOURCES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/data/ogre-simulator") + else() + set(VISP_INSTALL_DIR_OGRE_RESOURCES "${CMAKE_INSTALL_PREFIX}/data/ogre-simulator") + endif() + # make the var global + set(VISP_INSTALL_DIR_OGRE_RESOURCES ${VISP_INSTALL_DIR_OGRE_RESOURCES} CACHE INTERNAL "Ogre media install dir") + + if(OGRE_MEDIA_NOT_AVAILABLE) + set(OGRE_MEDIA_DIR ${VISP_INSTALL_DIR_OGRE_RESOURCES}/media) + endif() + + # Here we add all the subdirs in @OGRE_MEDIA_DIR@/* as resource location. + set(OGRE_RESOURCES_FileSystem "FileSystem=${OGRE_MEDIA_DIR}\n") + foreach(m ${media_subdirs}) + set(OGRE_RESOURCES_FileSystem "${OGRE_RESOURCES_FileSystem}FileSystem=${OGRE_MEDIA_DIR}/${m}\n") + endforeach() + + # install rule for resources.cfg and Ogre media if they are not available: + if(UNIX) + configure_file( + ${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in + ${VISP_BINARY_DIR}/unix-install/resources.cfg + IMMEDIATE @ONLY + ) + install(FILES + ${VISP_BINARY_DIR}/unix-install/resources.cfg + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/data/ogre-simulator + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + COMPONENT dev + ) + if(OGRE_MEDIA_NOT_AVAILABLE) + install(DIRECTORY + ${VISP_BINARY_DIR}/data/ogre-simulator/media + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/data/ogre-simulator + FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + COMPONENT dev + ) + endif() + else() + configure_file( + ${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in + ${VISP_BINARY_DIR}/win-install/resources.cfg + IMMEDIATE @ONLY + ) + install(FILES + ${VISP_BINARY_DIR}/win-install/resources.cfg + DESTINATION data/ogre-simulator + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + COMPONENT dev + ) + if(OGRE_MEDIA_NOT_AVAILABLE) + install(DIRECTORY + ${VISP_BINARY_DIR}/data/ogre-simulator/media + DESTINATION data/ogre-simulator + FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + COMPONENT dev + ) + endif() + endif() + endif() +endfunction() diff --git a/CMakeModules/VISPCRTLinkage.cmake b/cmake/VISPCRTLinkage.cmake similarity index 97% rename from CMakeModules/VISPCRTLinkage.cmake rename to cmake/VISPCRTLinkage.cmake index 20675fa78f4fbd1648ed148905c50c1bc840124d..a99b662014167751a0e26040634020fbb80aed9b 100644 --- a/CMakeModules/VISPCRTLinkage.cmake +++ b/cmake/VISPCRTLinkage.cmake @@ -1,44 +1,44 @@ -if(NOT MSVC) - message(FATAL_ERROR "CRT options are available only for MSVC") -endif() - -if(NOT BUILD_SHARED_LIBS AND BUILD_WITH_STATIC_CRT) - foreach(flag_var - CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO - CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) - if(${flag_var} MATCHES "/MD") - string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - endif() - if(${flag_var} MATCHES "/MDd") - string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}") - endif() - endforeach(flag_var) - - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib") - set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib") - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libcmtd.lib") -else() - foreach(flag_var - CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO - CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) - if(${flag_var} MATCHES "/MT") - string(REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}") - endif() - if(${flag_var} MATCHES "/MTd") - string(REGEX REPLACE "/MTd" "/MDd" ${flag_var} "${${flag_var}}") - endif() - endforeach(flag_var) -endif() - -if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8 AND NOT ${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} LESS 8.6) - include(ProcessorCount) - ProcessorCount(N) - if(NOT N EQUAL 0) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP${N} ") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${N} ") - endif() -endif() +if(NOT MSVC) + message(FATAL_ERROR "CRT options are available only for MSVC") +endif() + +if(NOT BUILD_SHARED_LIBS AND BUILD_WITH_STATIC_CRT) + foreach(flag_var + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + if(${flag_var} MATCHES "/MD") + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endif() + if(${flag_var} MATCHES "/MDd") + string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}") + endif() + endforeach(flag_var) + + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib") + set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libcmtd.lib") +else() + foreach(flag_var + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + if(${flag_var} MATCHES "/MT") + string(REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}") + endif() + if(${flag_var} MATCHES "/MTd") + string(REGEX REPLACE "/MTd" "/MDd" ${flag_var} "${${flag_var}}") + endif() + endforeach(flag_var) +endif() + +if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8 AND NOT ${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} LESS 8.6) + include(ProcessorCount) + ProcessorCount(N) + if(NOT N EQUAL 0) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP${N} ") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP${N} ") + endif() +endif() diff --git a/CMakeModules/VISPConfig.cmake b/cmake/VISPConfig.cmake similarity index 93% rename from CMakeModules/VISPConfig.cmake rename to cmake/VISPConfig.cmake index f4857511bed65951c4720b65f536335e4548500c..b0e7dc9b20c32e5a9847d357c28cb804541706bf 100644 --- a/CMakeModules/VISPConfig.cmake +++ b/cmake/VISPConfig.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: VISPConfig.cmake.in 4806 2014-07-30 08:55:55Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/cmake/VISPDetectPlatform.cmake b/cmake/VISPDetectPlatform.cmake new file mode 100644 index 0000000000000000000000000000000000000000..bf4e7306ed0aeabb387325cc11db6c1a4fbe45a6 --- /dev/null +++ b/cmake/VISPDetectPlatform.cmake @@ -0,0 +1,79 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +# ---------------------------------------------------------------------------- +# Similar code exist in VISPConfig.cmake +# ---------------------------------------------------------------------------- + +if(NOT DEFINED VISP_STATIC) + # look for global setting + if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS) + set(VISP_STATIC OFF) + else() + set(VISP_STATIC ON) + endif() +endif() + +if(MSVC) + if(CMAKE_CL_64) + set(VISP_ARCH x64) + else() + set(VISP_ARCH x86) + endif() + if(MSVC_VERSION EQUAL 1400) + set(VISP_RUNTIME vc8) + elseif(MSVC_VERSION EQUAL 1500) + set(VISP_RUNTIME vc9) + elseif(MSVC_VERSION EQUAL 1600) + set(VISP_RUNTIME vc10) + elseif(MSVC_VERSION EQUAL 1700) + set(VISP_RUNTIME vc11) + elseif(MSVC_VERSION EQUAL 1800) + set(VISP_RUNTIME vc12) + elseif(MSVC_VERSION EQUAL 1900) + set(VISP_RUNTIME vc14) + endif() +elseif(MINGW) + set(VISP_RUNTIME mingw) + + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine + OUTPUT_VARIABLE VISP_GCC_TARGET_MACHINE + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(VISP_GCC_TARGET_MACHINE MATCHES "64") + set(MINGW64 1) + set(VISP_ARCH x64) + else() + set(VISP_ARCH x86) + endif() +endif() diff --git a/CMakeModules/VISPExtraTargets.cmake b/cmake/VISPExtraTargets.cmake similarity index 67% rename from CMakeModules/VISPExtraTargets.cmake rename to cmake/VISPExtraTargets.cmake index b1ff04568e7a7d0c7b2909161ac24c3358633bbd..dc68f74c6bfc607c32c9bd5f655756eca745296d 100644 --- a/CMakeModules/VISPExtraTargets.cmake +++ b/cmake/VISPExtraTargets.cmake @@ -1,8 +1,42 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Authors: +# Fabien Spindler +# +############################################################################# + # ---------------------------------------------------------------------------- # Uninstall target, for "make uninstall" # ---------------------------------------------------------------------------- configure_file( - "${VISP_CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in" + cmake/templates/cmake_uninstall.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) @@ -25,14 +59,6 @@ if(DOXYGEN_FOUND) endif() endif() -# ---------------------------------------------------------------------------- -# Tests target, for make visp_library -# ---------------------------------------------------------------------------- -add_custom_target(visp_library) -if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(visp_library PROPERTIES FOLDER "extra") -endif() - # ---------------------------------------------------------------------------- # Tests target, for make visp_tests # ---------------------------------------------------------------------------- @@ -72,3 +98,12 @@ if(BUILD_TUTORIALS) set_target_properties(visp_tutorials PROPERTIES FOLDER "extra") endif() endif() + +# ---------------------------------------------------------------------------- +# Target building all ViSP modules +# ---------------------------------------------------------------------------- +add_custom_target(visp_modules) +if(ENABLE_SOLUTION_FOLDERS) + set_target_properties(visp_modules PROPERTIES FOLDER "extra") +endif() + diff --git a/CMakeModules/VISPGenerateConfig.cmake b/cmake/VISPGenerateConfig.cmake old mode 100755 new mode 100644 similarity index 63% rename from CMakeModules/VISPGenerateConfig.cmake rename to cmake/VISPGenerateConfig.cmake index d7d2ef502d1a1813ce8fd5249931f8688b770959..256f0b3b2058de14f686f0c5632592fcc3aec594 --- a/CMakeModules/VISPGenerateConfig.cmake +++ b/cmake/VISPGenerateConfig.cmake @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: GenerateConfigt.cmake 4676 2014-02-17 22:08:37Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -61,67 +58,83 @@ endmacro() # if CMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu, then VISP_INSTALL_LIBDIR_TO_PARENT=../.. get_path_to_parent(${CMAKE_INSTALL_LIBDIR} VISP_INSTALL_LIBDIR_TO_PARENT) +#build list of modules available for the ViSP user +set(VISP_LIB_COMPONENTS "") +foreach(m ${VISP_MODULES_PUBLIC}) + list(INSERT VISP_LIB_COMPONENTS 0 ${${m}_MODULE_DEPS_OPT} ${m}) +endforeach() +vp_list_unique(VISP_LIB_COMPONENTS) +#message("VISP_LIB_COMPONENTS: ${VISP_LIB_COMPONENTS}") +set(VISP_MODULES_CONFIGCMAKE ${VISP_LIB_COMPONENTS}) +vp_list_filterout(VISP_LIB_COMPONENTS "^visp_") +if(VISP_LIB_COMPONENTS) + list(REMOVE_ITEM VISP_MODULES_CONFIGCMAKE ${VISP_LIB_COMPONENTS}) +endif() + + # ------------------------------------------------------------------------------------------- # Part 1/3: ${BIN_DIR}/VISPConfig.cmake -> For use *without* "make install" # ------------------------------------------------------------------------------------------- # Export the library -export(TARGETS ${VISP_INTERN_LIBRARY} FILE "${PROJECT_BINARY_DIR}/VISPTargets.cmake") - -# Update include dirs -set(VISP_INCLUDE_DIRS_CONFIGCMAKE_ "${VISP_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}") -list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE_ ${VISP_EXTERN_INCLUDE_DIRS}) -set(VISP_INCLUDE_DIRS_CONFIGCMAKE "") -foreach(val ${VISP_INCLUDE_DIRS_CONFIGCMAKE_}) - set(VISP_INCLUDE_DIRS_CONFIGCMAKE "${VISP_INCLUDE_DIRS_CONFIGCMAKE} \"${val}\"") +export(TARGETS ${VISPModules_TARGETS} FILE "${PROJECT_BINARY_DIR}/VISPModules.cmake") + +## Update include dirs +set(VISP_INCLUDE_DIRS_CONFIGCMAKE "${VISP_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}") +foreach(m ${VISP_MODULES_BUILD}) + if(EXISTS "${VISP_MODULE_${m}_LOCATION}/include") + list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE "${VISP_MODULE_${m}_LOCATION}/include") + endif() + list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS}) endforeach() -#message("VISP_INCLUDE_DIRS_CONFIGCMAKE: ${VISP_INCLUDE_DIRS_CONFIGCMAKE}") +vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE) configure_file( - ${VISP_CMAKE_MODULE_PATH}/VISPConfig.cmake.in + cmake/templates/VISPConfig.cmake.in ${VISP_BINARY_DIR}/VISPConfig.cmake - IMMEDIATE @ONLY) + IMMEDIATE @ONLY +) configure_file( - ${VISP_CMAKE_MODULE_PATH}/VISPConfigVersion.cmake.in + cmake/templates/VISPConfigVersion.cmake.in ${VISP_BINARY_DIR}/VISPConfigVersion.cmake - IMMEDIATE @ONLY) + IMMEDIATE @ONLY +) configure_file( - ${VISP_CMAKE_MODULE_PATH}/VISPUse.cmake.in + cmake/VISPUse.cmake.in ${VISP_BINARY_DIR}/VISPUse.cmake - IMMEDIATE @ONLY) + IMMEDIATE @ONLY +) # -------------------------------------------------------------------------------------------- # Part 2/3: ${BIN_DIR}/unix-install/VISPConfig.cmake -> For use *with* "make install" # ------------------------------------------------------------------------------------------- if(UNIX) - set(VISP_INCLUDE_DIRS_CONFIGCMAKE_ "\${VISP_INSTALL_PATH}/${CMAKE_INSTALL_INCLUDEDIR}") - list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE_ ${VISP_EXTERN_INCLUDE_DIRS}) - set(VISP_INCLUDE_DIRS_CONFIGCMAKE "") - foreach(val ${VISP_INCLUDE_DIRS_CONFIGCMAKE_}) - set(VISP_INCLUDE_DIRS_CONFIGCMAKE "${VISP_INCLUDE_DIRS_CONFIGCMAKE} \"${val}\"") + set(VISP_INCLUDE_DIRS_CONFIGCMAKE "\${VISP_INSTALL_PATH}/${CMAKE_INSTALL_INCLUDEDIR}") + foreach(m ${VISP_MODULES_BUILD}) + list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS}) endforeach() - #message("VISP_INCLUDE_DIRS_CONFIGCMAKE: ${VISP_INCLUDE_DIRS_CONFIGCMAKE}") + vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE) configure_file( - ${VISP_CMAKE_MODULE_PATH}/VISPConfig.cmake.in + cmake/templates/VISPConfig.cmake.in ${VISP_BINARY_DIR}/unix-install/VISPConfig.cmake - IMMEDIATE @ONLY) + IMMEDIATE @ONLY + ) configure_file( - ${VISP_CMAKE_MODULE_PATH}/VISPConfigVersion.cmake.in + cmake/templates/VISPConfigVersion.cmake.in ${VISP_BINARY_DIR}/unix-install/VISPConfigVersion.cmake - IMMEDIATE @ONLY) + IMMEDIATE @ONLY + ) configure_file( - ${VISP_CMAKE_MODULE_PATH}/VISPUse.cmake.in + cmake/VISPUse.cmake.in ${VISP_BINARY_DIR}/unix-install/VISPUse.cmake - IMMEDIATE @ONLY) - - configure_file(${VISP_SOURCE_DIR}/include/vpConfig.h.cmake - ${VISP_BINARY_DIR}/unix-install/vpConfig.h @ONLY) + IMMEDIATE @ONLY + ) install(FILES ${VISP_BINARY_DIR}/unix-install/VISPConfig.cmake @@ -129,68 +142,72 @@ if(UNIX) ${VISP_BINARY_DIR}/unix-install/VISPUse.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/visp" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries) + COMPONENT dev + ) # Install the export set for use with the install-tree - install(EXPORT VISPTargets - FILE VISPTargets.cmake + install(EXPORT VISPModules + FILE VISPModules.cmake DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/visp" - COMPONENT libraries) + COMPONENT dev + ) endif() # -------------------------------------------------------------------------------------------- # Part 3/3: ${BIN_DIR}/win-install/VISPConfig.cmake -> For use within binary installers/packages # -------------------------------------------------------------------------------------------- if(WIN32) - set(VISP_INCLUDE_DIRS_CONFIGCMAKE_ "\${VISP_CONFIG_PATH}/${CMAKE_INSTALL_INCLUDEDIR}") - list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE_ ${VISP_EXTERN_INCLUDE_DIRS}) - set(VISP_INCLUDE_DIRS_CONFIGCMAKE "") - foreach(val ${VISP_INCLUDE_DIRS_CONFIGCMAKE_}) - set(VISP_INCLUDE_DIRS_CONFIGCMAKE "${VISP_INCLUDE_DIRS_CONFIGCMAKE} \"${val}\"") + set(VISP_INCLUDE_DIRS_CONFIGCMAKE "\${VISP_CONFIG_PATH}/${CMAKE_INSTALL_INCLUDEDIR}") + foreach(m ${VISP_MODULES_BUILD}) + list(APPEND VISP_INCLUDE_DIRS_CONFIGCMAKE ${VISP_MODULE_${m}_INC_DEPS}) endforeach() - #message("VISP_INCLUDE_DIRS_CONFIGCMAKE: ${VISP_INCLUDE_DIRS_CONFIGCMAKE}") + vp_list_unique(VISP_INCLUDE_DIRS_CONFIGCMAKE) configure_file( - ${VISP_CMAKE_MODULE_PATH}/VISPConfig.cmake.in + cmake/templates/VISPConfig.cmake.in ${VISP_BINARY_DIR}/win-install/VISPConfig.cmake - IMMEDIATE @ONLY) + IMMEDIATE @ONLY + ) configure_file( - ${VISP_CMAKE_MODULE_PATH}/VISPConfigVersion.cmake.in + cmake/templates/VISPConfigVersion.cmake.in ${VISP_BINARY_DIR}/win-install/VISPConfigVersion.cmake - IMMEDIATE @ONLY) + IMMEDIATE @ONLY + ) configure_file( - ${VISP_CMAKE_MODULE_PATH}/VISPUse.cmake.in + cmake/VISPUse.cmake.in ${VISP_BINARY_DIR}/win-install/VISPUse.cmake - IMMEDIATE @ONLY) + IMMEDIATE @ONLY + ) if(BUILD_SHARED_LIBS) install(FILES "${CMAKE_BINARY_DIR}/win-install/ViSPConfig.cmake" "${CMAKE_BINARY_DIR}/win-install/ViSPUse.cmake" DESTINATION "${VISP_INSTALL_BINARIES_PREFIX}${CMAKE_INSTALL_LIBDIR}" - COMPONENT libraries) - install(EXPORT VISPTargets + COMPONENT dev) + install(EXPORT VISPModules DESTINATION "${VISP_INSTALL_BINARIES_PREFIX}${CMAKE_INSTALL_LIBDIR}" - FILE VISPTargets.cmake - COMPONENT libraries) + FILE VISPModules.cmake + COMPONENT dev) else() install(FILES "${CMAKE_BINARY_DIR}/win-install/ViSPConfig.cmake" "${CMAKE_BINARY_DIR}/win-install/ViSPUse.cmake" DESTINATION "${VISP_INSTALL_BINARIES_PREFIX}static${CMAKE_INSTALL_LIBDIR}" - COMPONENT libraries) - install(EXPORT VISPTargets + COMPONENT dev) + install(EXPORT VISPModules DESTINATION "${VISP_INSTALL_BINARIES_PREFIX}static${CMAKE_INSTALL_LIBDIR}" - FILE VISPTargets.cmake - COMPONENT libraries) + FILE VISPModules.cmake + COMPONENT dev) endif() install(FILES - "${VISP_CMAKE_MODULE_PATH}/VISPConfig.cmake" + "cmake/VISPConfig.cmake" "${VISP_BINARY_DIR}/win-install/VISPConfigVersion.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT libraries) + COMPONENT dev + ) endif() diff --git a/cmake/VISPGenerateHeaders.cmake b/cmake/VISPGenerateHeaders.cmake new file mode 100644 index 0000000000000000000000000000000000000000..2110e9b643ae449df1ae0de8ad5c4612af294281 --- /dev/null +++ b/cmake/VISPGenerateHeaders.cmake @@ -0,0 +1,77 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +# platform-specific config file +configure_file("${VISP_SOURCE_DIR}/cmake/templates/vpConfig.h.in" "${VISP_INCLUDE_DIR}/visp3/core/vpConfig.h") +install(FILES "${VISP_INCLUDE_DIR}/visp3/core/vpConfig.h" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/visp3/core + COMPONENT dev +) + +#---------------------------------------------------------------------- +# information file +#---------------------------------------------------------------------- +configure_file(${VISP_SOURCE_DIR}/cmake/templates/ViSP-third-party.txt.in "${VISP_BINARY_DIR}/ViSP-third-party.txt") + +# ---------------------------------------------------------------------------- +# visp_modules.h based on actual modules list +# ---------------------------------------------------------------------------- +set(VISP_MODULE_DEFINITIONS_CONFIGMAKE "#ifndef __visp_modules_h__\n#define __visp_modules_h__\n\n") + +set(VISP_MOD_LIST ${VISP_MODULES_PUBLIC}) +vp_list_sort(VISP_MOD_LIST) +foreach(m ${VISP_MOD_LIST}) + if(m MATCHES "^visp_") + string(REGEX REPLACE "^visp_" "" m "${m}") + endif() + string(TOUPPER "${m}" m) + set(VISP_MODULE_DEFINITIONS_CONFIGMAKE "${VISP_MODULE_DEFINITIONS_CONFIGMAKE}#define VISP_HAVE_MODULE_${m}\n") +endforeach() + +set(VISP_MODULE_DEFINITIONS_CONFIGMAKE "${VISP_MODULE_DEFINITIONS_CONFIGMAKE}\n#endif\n") + +configure_file("${VISP_SOURCE_DIR}/cmake/templates/visp_modules.h.in" "${VISP_INCLUDE_DIR}/visp3/visp_modules.h") +install(FILES "${VISP_INCLUDE_DIR}/visp3/visp_modules.h" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/visp3 + COMPONENT dev +) + +# ---------------------------------------------------------------------------- +# install old headers +# ---------------------------------------------------------------------------- +file(GLOB old_hdrs "${VISP_INCLUDE_DIR}/visp/*.h") +install(FILES ${old_hdrs} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/visp + COMPONENT dev +) diff --git a/CMakeModules/VISPGeneratePkgConfigScript.cmake b/cmake/VISPGeneratePkgConfigScript.cmake similarity index 68% rename from CMakeModules/VISPGeneratePkgConfigScript.cmake rename to cmake/VISPGeneratePkgConfigScript.cmake index f33c2b2cd99fb6c98ed17d710a38fbd2a7737a45..c8b41ccc6020f8c0d7f0ede90e76d3770e22698f 100644 --- a/CMakeModules/VISPGeneratePkgConfigScript.cmake +++ b/cmake/VISPGeneratePkgConfigScript.cmake @@ -1,332 +1,302 @@ -############################################################################# -# -# $Id: VISPGeneratePkgConfigScript.cmake 5314 2015-02-12 08:32:30Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# This file generates the ViSP library config shell scripts: -# - visp-config in <build dir>/bin from visp-config.in -# - visp-config in <build dir>/install from visp-config.install.in -# When make install, this file is copied in <install dir>/bin -# - visp.pc in <build dir>/install from visp.pc.in -# When make install, this file is copied in <install dir>/lib/pkgconfig -# -# Authors: -# Fabien Spindler -# -############################################################################# - - -if (UNIX) - ####################################################################### - # - # for Unix platforms: Linux, OSX - # - ####################################################################### - set(FILE_VISP_CONFIG_SCRIPT_IN "${VISP_SOURCE_DIR}/CMakeModules/visp-config.in") - set(FILE_VISP_CONFIG_SCRIPT "${BINARY_OUTPUT_PATH}/visp-config") - - set(FILE_VISP_CONFIG_SCRIPT_INSTALL_IN "${VISP_SOURCE_DIR}/CMakeModules/visp-config.install.in") - set(FILE_VISP_CONFIG_SCRIPT_INSTALL "${VISP_BINARY_DIR}/unix-install/visp-config") - - set(FILE_VISP_CONFIG_PC_INSTALL_IN "${VISP_SOURCE_DIR}/CMakeModules/visp.pc.in") - set(FILE_VISP_CONFIG_PC_INSTALL "${VISP_BINARY_DIR}/unix-install/visp.pc") - - #--------------------------------------------------------------------- - # Updates VISP_CONFIG_SCRIPT_PREFIX - #---------------------------------------------------------------------- - set(VISP_CONFIG_SCRIPT_PREFIX "${CMAKE_INSTALL_PREFIX}") - - #--------------------------------------------------------------------- - # Updates VISP_CONFIG_CFLAGS - #---------------------------------------------------------------------- - foreach(INCDIR ${VISP_EXTERN_INCLUDE_DIRS}) - list(APPEND VISP_CONFIG_CFLAGS "-I${INCDIR}") - endforeach() - - # Suppress twins - if(VISP_CONFIG_CFLAGS) - list(REMOVE_DUPLICATES VISP_CONFIG_CFLAGS) - endif() - - # Format the string to suppress CMake separators ";" - set(VISP_CONFIG_CFLAGS_REFORMATED "") - foreach(element ${VISP_CONFIG_CFLAGS}) - set(VISP_CONFIG_CFLAGS_REFORMATED "${VISP_CONFIG_CFLAGS_REFORMATED} ${element}") - endforeach() - set(VISP_CONFIG_CFLAGS ${VISP_CONFIG_CFLAGS_REFORMATED}) -# message(": ${VISP_CONFIG_CFLAGS}") - - if(BUILD_TEST_COVERAGE) - # Add build options for test coverage. Currently coverage is only supported - # on gcc compiler - # Because using -fprofile-arcs with shared lib can cause problems like: - # hidden symbol `__bb_init_func', we add this option only for static - # library build - set(VISP_CONFIG_CFLAGS "${VISP_CONFIG_CFLAGS} -ftest-coverage -fprofile-arcs") - endif() - - #--------------------------------------------------------------------- - # Updates VISP_CONFIG_LIBS - # - # add "-l" to library names - # skip *.so, *.a, *.dylib, -framework*, -l* - # - #---------------------------------------------------------------------- - - # need to be improved - if(POLICY CMP0026) - cmake_policy(PUSH) - cmake_policy(SET CMP0026 OLD) - get_target_property(visp_libpath ${VISP_INTERN_LIBRARY} LOCATION_Release) - cmake_policy(POP) - else() - get_target_property(visp_libpath ${VISP_INTERN_LIBRARY} LOCATION_Release) - endif() - #message("ViSP libpath: ${vip_libpath}") - get_filename_component(visp_libname "${visp_libpath}" NAME) - - #message("ViSP libname: ${visp_libname}") - # Manage the libs - list(REMOVE_ITEM VISP_EXTERN_LIBRARIES "debug") - list(REMOVE_ITEM VISP_EXTERN_LIBRARIES "optimized") - set(TMP_LIBS) - foreach(lib ${VISP_EXTERN_LIBRARIES}) - if("${lib}" MATCHES "[-][f][r][a][m][e][w][o][r][k]+.") - # does nothing - list(APPEND TMP_LIBS ${lib}) - elseif("${lib}" MATCHES ".[.][f][r][a][m][e][w][o][r][k]+$") - # replace /path/name.framework by -framework name - get_filename_component(FRAMEWORK ${lib} NAME_WE) - #message("add -framework ${FRAMEWORK}") - list(APPEND TMP_LIBS "-framework ${FRAMEWORK}") - elseif("${lib}" MATCHES ".[.][s][o]+$" OR "${lib}" MATCHES ".[.][a]+$") - list(APPEND TMP_LIBS ${lib}) - elseif("${lib}" MATCHES ".[.][s][o][.][0123456789]+$") - # does nothing - list(APPEND TMP_LIBS ${lib}) - elseif("${lib}" MATCHES ".[.][s][o][.][0123456789]*[.][0123456789]+$") - # does nothing - list(APPEND TMP_LIBS ${lib}) - elseif("${lib}" MATCHES ".[.][s][o][.][0123456789]*[.][0123456789]*[.][0123456789]+$") - # does nothing - list(APPEND TMP_LIBS ${lib}) - elseif("${lib}" MATCHES ".[.][d][y][l][i][b]+$") - # does nothing - list(APPEND TMP_LIBS ${lib}) - elseif("${lib}" MATCHES "^(-l)") - # does nothing - list(APPEND TMP_LIBS ${lib}) - else() - # add -l prefix - #MESSAGE("add -l${lib}") - list(APPEND TMP_LIBS "${lib}") - endif() - endforeach() - - foreach(val ${TMP_LIBS}) - set(VISP_CONFIG_LIBS "${VISP_CONFIG_LIBS} ${val}") - endforeach(val) - - #--------------------------------------------------------------------- - # Updates the <build dir>/bin/visp-config shell script - # Updates VISP_CONFIG_LIBS_SCRIPT (for visp-config) - # Updates VISP_CONFIG_CFLAGS_SCRIPT (for visp-config) - #---------------------------------------------------------------------- - - # prepend with ViSP own include dir - set(VISP_CONFIG_CFLAGS_SCRIPT "-I$PREFIX/${CMAKE_INSTALL_INCLUDEDIR} ${VISP_CONFIG_CFLAGS}") - - # prepend with ViSP own lib - set(VISP_CONFIG_LIBS_SCRIPT "$PREFIX/${CMAKE_INSTALL_LIBDIR}/${visp_libname} ${VISP_CONFIG_LIBS}") - - set(VISP_ECHO_NO_NEWLINE_CHARACTER "") - set(VISP_ECHO_NO_NEWLINE_OPTION "") - if(APPLE) - set(VISP_ECHO_NO_NEWLINE_CHARACTER "\\c") - else() - set(VISP_ECHO_NO_NEWLINE_OPTION "-n") - endif() - - configure_file(${FILE_VISP_CONFIG_SCRIPT_IN} ${FILE_VISP_CONFIG_SCRIPT}) - - #--------------------------------------------------------------------- - # Updates the <build dir>/install/visp-config shell script - #---------------------------------------------------------------------- - - configure_file(${FILE_VISP_CONFIG_SCRIPT_INSTALL_IN} ${FILE_VISP_CONFIG_SCRIPT_INSTALL}) - - #--------------------------------------------------------------------- - # Updates the <build dir>/install/visp.pc pkg-config file - # Updates VISP_CONFIG_CFLAGS_PC (for libvisp.pc used by pkg-config) - # Updates VISP_CONFIG_LIBS_PC (for libvisp.pc used by pkg-config) - #---------------------------------------------------------------------- - set(exec_prefix "\${prefix}") - set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") - set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}") - - # prepend with ViSP own include dir - set(VISP_CONFIG_CFLAGS_PC "-I\${includedir} ${VISP_CONFIG_CFLAGS}") - - # prepend with ViSP own lib dir and append -L<lib dir> - set(VISP_CONFIG_LIBS_PC "\${libdir}/${visp_libname} ${VISP_CONFIG_LIBS}") - configure_file(${FILE_VISP_CONFIG_PC_INSTALL_IN} ${FILE_VISP_CONFIG_PC_INSTALL}) - -else(UNIX) - ####################################################################### - # - # for windows platforms - # - ####################################################################### - set(FILE_VISP_CONFIG_SCRIPT_IN "${VISP_SOURCE_DIR}/CMakeModules/visp-config.bat.in") - set(FILE_VISP_CONFIG_SCRIPT "${BINARY_OUTPUT_PATH}/visp-config.bat") - - set(FILE_VISP_CONFIG_SCRIPT_INSTALL_IN "${VISP_SOURCE_DIR}/CMakeModules/visp-config.bat.in") - set(FILE_VISP_CONFIG_SCRIPT_INSTALL "${VISP_BINARY_DIR}/win-install/visp-config-${VISP_ARCH}-${VISP_RUNTIME}.bat") - - #--------------------------------------------------------------------- - # Updates VISP_CONFIG_SCRIPT_PREFIX - #---------------------------------------------------------------------- - set(VISP_CONFIG_SCRIPT_PREFIX "${CMAKE_INSTALL_PREFIX}") - - #--------------------------------------------------------------------- - # Updates VISP_CONFIG_SCRIPT_DEF - #---------------------------------------------------------------------- - set(VISP_CONFIG_SCRIPT_DEFS "") - set(VISP_OPENMP_SUPPORT "no") - if(NOT ${VISP_OPENMP_FLAGS} STREQUAL "") - set(VISP_CONFIG_SCRIPT_DEFS "${VISP_OPENMP_FLAGS}") - set(VISP_OPENMP_SUPPORT "yes") - endif() - if(NOT ${VISP_CPP11_FLAGS} STREQUAL "") - set(VISP_CONFIG_SCRIPT_DEFS "${VISP_CPP11_FLAGS}, ${VISP_CONFIG_SCRIPT_DEFS}") - endif() - - #--------------------------------------------------------------------- - # Updates VISP_CONFIG_SCRIPT_INCLUDE - #---------------------------------------------------------------------- - list(APPEND VISP_EXTERN_INCLUDE_DIRS "%PREFIX%/${CMAKE_INSTALL_INCLUDEDIR}") - list(REMOVE_DUPLICATES VISP_EXTERN_INCLUDE_DIRS) - - # Format the string - set(VISP_CONFIG_SCRIPT_INC ${VISP_EXTERN_INCLUDE_DIRS}) - #message(VISP_CONFIG_SCRIPT_INC ${VISP_CONFIG_SCRIPT_INC}) - - #--------------------------------------------------------------------- - # Updates VISP_CONFIG_SCRIPT_LIBDIR - # 1/ For usage with the build tree - # 2/ For usage with the install tree - # - # and updates VISP_CONFIG_SCRIPT_LIBS_${config} - #---------------------------------------------------------------------- - set(TMP_SCRIPT_LIBS_DEBUG "${VISP_INTERN_LIBRARY}${VISP_DLLVERSION}${VISP_DEBUG_POSTFIX}.lib") - set(TMP_SCRIPT_LIBS_OPTIMIZED "${VISP_INTERN_LIBRARY}${VISP_DLLVERSION}.lib") - - #MESSAGE(VISP_EXTERN_LIBRARIES: ${VISP_EXTERN_LIBRARIES}) - set(TMP_IS_DEBUG FALSE) - set(TMP_IS_OPTIMIZED FALSE) - foreach(lib ${VISP_EXTERN_LIBRARIES}) - if("${lib}" MATCHES "[d][e][b][u][g]") - set(TMP_IS_DEBUG TRUE) - elseif("${lib}" MATCHES "[o][p][t][i][m][i][z][e][d]") - set(TMP_IS_OPTIMIZED TRUE) - else() - # Get the library name - get_filename_component(libname ${lib} NAME) - if("${libname}" MATCHES ".+[.][l][i][b]" OR "${libname}" MATCHES ".+[.][L][i][b]") - #MESSAGE("${libname} matches .lib or .Lib") - else() - # We need to add .lib suffix - #MESSAGE("For ${libname} we add .lib suffix") - set(libname "${libname}.lib") - endif() - - # Get the library path - get_filename_component(libpath ${lib} PATH) - list(APPEND VISP_CONFIG_SCRIPT_LIBDIR_ "${libpath}") - - if(TMP_IS_DEBUG) - set(TMP_IS_DEBUG FALSE) - list(APPEND TMP_SCRIPT_LIBS_DEBUG ${libname}) - elseif(TMP_IS_OPTIMIZED) - set(TMP_IS_OPTIMIZED FALSE) - list(APPEND TMP_SCRIPT_LIBS_OPTIMIZED ${libname}) - else() - list(APPEND TMP_SCRIPT_LIBS_DEBUG ${libname}) - list(APPEND TMP_SCRIPT_LIBS_OPTIMIZED ${libname}) - endif() - endif() - endforeach(lib) - - # Format the string - set(VISP_CONFIG_SCRIPT_LIBS_DEBUG "${TMP_SCRIPT_LIBS_DEBUG}") - set(VISP_CONFIG_SCRIPT_LIBS_OPTIMIZED "${TMP_SCRIPT_LIBS_OPTIMIZED}") - - # Format the string - string(REGEX REPLACE "lib/Release" "lib/$(ConfigurationName)" VISP_CONFIG_SCRIPT_LIBDIR_ "${VISP_CONFIG_SCRIPT_LIBDIR_}") - string(REGEX REPLACE "lib/Debug" "lib/$(ConfigurationName)" VISP_CONFIG_SCRIPT_LIBDIR_ "${VISP_CONFIG_SCRIPT_LIBDIR_}") - - # 1/ For usage with the build tree - set(VISP_CONFIG_SCRIPT_LIBDIR "%PREFIX%/lib") - list(APPEND VISP_CONFIG_SCRIPT_LIBDIR "%PREFIX%/lib/$(ConfigurationName)") - list(APPEND VISP_CONFIG_SCRIPT_LIBDIR ${VISP_CONFIG_SCRIPT_LIBDIR_}) - list(REMOVE_DUPLICATES VISP_CONFIG_SCRIPT_LIBDIR) - configure_file(${FILE_VISP_CONFIG_SCRIPT_IN} ${FILE_VISP_CONFIG_SCRIPT}) - - # 2/ For usage with the install tree - set(VISP_CONFIG_SCRIPT_LIBDIR "%PREFIX%/${VISP_ARCH}/${VISP_RUNTIME}/lib") - list(APPEND VISP_CONFIG_SCRIPT_LIBDIR ${VISP_CONFIG_SCRIPT_LIBDIR_}) - list(REMOVE_DUPLICATES VISP_CONFIG_SCRIPT_LIBDIR) - configure_file(${FILE_VISP_CONFIG_SCRIPT_INSTALL_IN} ${FILE_VISP_CONFIG_SCRIPT_INSTALL}) -endif(UNIX) - -#---------------------------------------------------------------------- -# customize install target -#---------------------------------------------------------------------- -# install rule for visp-config shell script -install(FILES ${FILE_VISP_CONFIG_SCRIPT_INSTALL} - DESTINATION ${CMAKE_INSTALL_BINDIR} - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE - OWNER_WRITE - COMPONENT libraries) - -# install rule for visp.pc pkg-config file -if(UNIX) - install(FILES ${FILE_VISP_CONFIG_PC_INSTALL} - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - OWNER_WRITE - COMPONENT libraries) -else() - # not implemented yet -endif() - - +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# This file generates the ViSP library config shell scripts: +# - visp-config in <build dir>/bin from visp-config.in +# - visp-config in <build dir>/install from visp-config.install.in +# When make install, this file is copied in <install dir>/bin +# - visp.pc in <build dir>/install from visp.pc.in +# When make install, this file is copied in <install dir>/lib/pkgconfig +# +# Authors: +# Fabien Spindler +# +############################################################################# + + +if (UNIX) + ####################################################################### + # + # for Unix platforms: Linux, OSX + # + ####################################################################### + set(FILE_VISP_CONFIG_SCRIPT_IN "cmake/templates/visp-config.in") + set(FILE_VISP_CONFIG_SCRIPT "${BINARY_OUTPUT_PATH}/visp-config") + + set(FILE_VISP_CONFIG_SCRIPT_INSTALL_IN "cmake/templates/visp-config.install.in") + set(FILE_VISP_CONFIG_SCRIPT_INSTALL "${VISP_BINARY_DIR}/unix-install/visp-config") + + set(FILE_VISP_CONFIG_PC_INSTALL_IN "cmake/templates/visp.pc.in") + set(FILE_VISP_CONFIG_PC_INSTALL "${VISP_BINARY_DIR}/unix-install/visp.pc") + + #--------------------------------------------------------------------- + # Updates VISP_CONFIG_SCRIPT_PREFIX + #---------------------------------------------------------------------- + set(VISP_CONFIG_SCRIPT_PREFIX "${CMAKE_INSTALL_PREFIX}") + + #--------------------------------------------------------------------- + # Updates VISP_CONFIG_CFLAGS + #---------------------------------------------------------------------- + foreach(m ${VISP_MODULES_BUILD}) + foreach(inc ${VISP_MODULE_${m}_INC_DEPS}) + list(APPEND VISP_CONFIG_CFLAGS "-I${inc}") + endforeach() + endforeach() + vp_list_unique(VISP_CONFIG_CFLAGS) + + # Format the string to suppress CMake separators ";" + vp_list_remove_separator(VISP_CONFIG_CFLAGS) + + if(BUILD_TEST_COVERAGE) + # Add build options for test coverage. Currently coverage is only supported + # on gcc compiler + # Because using -fprofile-arcs with shared lib can cause problems like: + # hidden symbol `__bb_init_func', we add this option only for static + # library build + set(VISP_CONFIG_CFLAGS "${VISP_CONFIG_CFLAGS} -ftest-coverage -fprofile-arcs") + endif() + + #--------------------------------------------------------------------- + # Updates the <build dir>/bin/visp-config shell script + # Updates VISP_CONFIG_LIBS_SCRIPT (for visp-config) + # Updates VISP_CONFIG_CFLAGS_SCRIPT (for visp-config) + #---------------------------------------------------------------------- + + # prepend with ViSP own include dir + set(VISP_CONFIG_CFLAGS_SCRIPT "-I$PREFIX/${CMAKE_INSTALL_INCLUDEDIR} ${VISP_CONFIG_CFLAGS}") + + # prepend with ViSP own modules first + set(VISP_CONFIG_LIBS_SCRIPT "") + foreach(m ${VISP_MODULES_BUILD}) + # need to be improved + if(POLICY CMP0026) + cmake_policy(PUSH) + cmake_policy(SET CMP0026 OLD) + get_target_property(m_libpath ${m} LOCATION_Release) + cmake_policy(POP) + else() + get_target_property(m_libpath ${m} LOCATION_Release) + endif() + get_filename_component(m_libname "${m_libpath}" NAME) + list(APPEND VISP_CONFIG_LIBS_SCRIPT "$PREFIX/${CMAKE_INSTALL_LIBDIR}/${m_libname}") + endforeach() + # append deps + foreach(m ${VISP_MODULES_BUILD}) + list(APPEND VISP_CONFIG_LIBS_SCRIPT ${VISP_MODULE_${m}_LINK_DEPS}) + endforeach() + vp_list_unique(VISP_CONFIG_LIBS_SCRIPT) +# message("VISP_CONFIG_LIBS_SCRIPT: ${VISP_CONFIG_LIBS_SCRIPT}") + + set(VISP_ECHO_NO_NEWLINE_CHARACTER "") + set(VISP_ECHO_NO_NEWLINE_OPTION "") + if(APPLE) + set(VISP_ECHO_NO_NEWLINE_CHARACTER "\\c") + else() + set(VISP_ECHO_NO_NEWLINE_OPTION "-n") + endif() + + configure_file(${FILE_VISP_CONFIG_SCRIPT_IN} ${FILE_VISP_CONFIG_SCRIPT}) + + #--------------------------------------------------------------------- + # Updates the <build dir>/install/visp-config shell script + #---------------------------------------------------------------------- + + configure_file(${FILE_VISP_CONFIG_SCRIPT_INSTALL_IN} ${FILE_VISP_CONFIG_SCRIPT_INSTALL}) + + #--------------------------------------------------------------------- + # Updates the <build dir>/install/visp.pc pkg-config file + # Updates VISP_CONFIG_CFLAGS_PC (for libvisp.pc used by pkg-config) + # Updates VISP_CONFIG_LIBS_PC (for libvisp.pc used by pkg-config) + #---------------------------------------------------------------------- + set(exec_prefix "\${prefix}") + set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") + set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}") + + # prepend with ViSP own include dir + set(VISP_CONFIG_CFLAGS_PC "-I\${includedir} ${VISP_CONFIG_CFLAGS}") + + # prepend with ViSP own modules first + set(VISP_CONFIG_LIBS_PC "") + foreach(m ${VISP_MODULES_BUILD}) + # need to be improved + if(POLICY CMP0026) + cmake_policy(PUSH) + cmake_policy(SET CMP0026 OLD) + get_target_property(m_libpath ${m} LOCATION_Release) + cmake_policy(POP) + else() + get_target_property(m_libpath ${m} LOCATION_Release) + endif() + get_filename_component(m_libname "${m_libpath}" NAME) + list(APPEND VISP_CONFIG_LIBS_PC "\${libdir}/${m_libname}") + endforeach() + # append deps + foreach(m ${VISP_MODULES_BUILD}) + list(APPEND VISP_CONFIG_LIBS_PC ${VISP_MODULE_${m}_LINK_DEPS}) + endforeach() + vp_list_remove_separator(VISP_CONFIG_LIBS_PC) + + configure_file(${FILE_VISP_CONFIG_PC_INSTALL_IN} ${FILE_VISP_CONFIG_PC_INSTALL}) + +else(UNIX) + ####################################################################### + # + # for windows platforms + # + ####################################################################### + set(FILE_VISP_CONFIG_SCRIPT_IN "cmake/templates/visp-config.bat.in") + set(FILE_VISP_CONFIG_SCRIPT "${BINARY_OUTPUT_PATH}/visp-config.bat") + + set(FILE_VISP_CONFIG_SCRIPT_INSTALL_IN "cmake/templates/visp-config.bat.in") + set(FILE_VISP_CONFIG_SCRIPT_INSTALL "${VISP_BINARY_DIR}/win-install/visp-config-${VISP_ARCH}-${VISP_RUNTIME}.bat") + + #--------------------------------------------------------------------- + # Updates VISP_CONFIG_SCRIPT_PREFIX + #---------------------------------------------------------------------- + set(VISP_CONFIG_SCRIPT_PREFIX "${CMAKE_INSTALL_PREFIX}") + + #--------------------------------------------------------------------- + # Updates VISP_CONFIG_SCRIPT_DEF + #---------------------------------------------------------------------- + set(VISP_CONFIG_SCRIPT_DEFS "") + set(VISP_OPENMP_SUPPORT "no") + if(NOT ${VISP_OPENMP_FLAGS} STREQUAL "") + set(VISP_CONFIG_SCRIPT_DEFS "${VISP_OPENMP_FLAGS}") + set(VISP_OPENMP_SUPPORT "yes") + endif() + if(NOT ${VISP_CPP11_FLAGS} STREQUAL "") + set(VISP_CONFIG_SCRIPT_DEFS "${VISP_CPP11_FLAGS}, ${VISP_CONFIG_SCRIPT_DEFS}") + endif() + + #--------------------------------------------------------------------- + # Updates VISP_CONFIG_SCRIPT_INCL + #---------------------------------------------------------------------- + set(VISP_CONFIG_SCRIPT_INC "%PREFIX%/${CMAKE_INSTALL_INCLUDEDIR}") + foreach(m ${VISP_MODULES_BUILD}) + foreach(inc ${VISP_MODULE_${m}_INC_DEPS}) + list(APPEND VISP_CONFIG_SCRIPT_INC "${inc}") + endforeach() + endforeach() + vp_list_unique(VISP_CONFIG_SCRIPT_INC) + #message(VISP_CONFIG_SCRIPT_INC ${VISP_CONFIG_SCRIPT_INC}) + + #--------------------------------------------------------------------- + # Updates VISP_CONFIG_SCRIPT_LIBDIR + # 1/ For usage with the build tree + # 2/ For usage with the install tree + # + # and updates VISP_CONFIG_SCRIPT_LIBS_${config} + #---------------------------------------------------------------------- + set(TMP_SCRIPT_LIBS_DEBUG "${VISP_INTERN_LIBRARY}${VISP_DLLVERSION}${VISP_DEBUG_POSTFIX}.lib") + set(TMP_SCRIPT_LIBS_OPTIMIZED "${VISP_INTERN_LIBRARY}${VISP_DLLVERSION}.lib") + + #MESSAGE(VISP_EXTERN_LIBRARIES: ${VISP_EXTERN_LIBRARIES}) + set(TMP_IS_DEBUG FALSE) + set(TMP_IS_OPTIMIZED FALSE) + foreach(lib ${VISP_EXTERN_LIBRARIES}) + if("${lib}" MATCHES "[d][e][b][u][g]") + set(TMP_IS_DEBUG TRUE) + elseif("${lib}" MATCHES "[o][p][t][i][m][i][z][e][d]") + set(TMP_IS_OPTIMIZED TRUE) + else() + # Get the library name + get_filename_component(libname ${lib} NAME) + if("${libname}" MATCHES ".+[.][l][i][b]" OR "${libname}" MATCHES ".+[.][L][i][b]") + #MESSAGE("${libname} matches .lib or .Lib") + else() + # We need to add .lib suffix + #MESSAGE("For ${libname} we add .lib suffix") + set(libname "${libname}.lib") + endif() + + # Get the library path + get_filename_component(libpath ${lib} PATH) + list(APPEND VISP_CONFIG_SCRIPT_LIBDIR_ "${libpath}") + + if(TMP_IS_DEBUG) + set(TMP_IS_DEBUG FALSE) + list(APPEND TMP_SCRIPT_LIBS_DEBUG ${libname}) + elseif(TMP_IS_OPTIMIZED) + set(TMP_IS_OPTIMIZED FALSE) + list(APPEND TMP_SCRIPT_LIBS_OPTIMIZED ${libname}) + else() + list(APPEND TMP_SCRIPT_LIBS_DEBUG ${libname}) + list(APPEND TMP_SCRIPT_LIBS_OPTIMIZED ${libname}) + endif() + endif() + endforeach(lib) + + # Format the string + set(VISP_CONFIG_SCRIPT_LIBS_DEBUG "${TMP_SCRIPT_LIBS_DEBUG}") + set(VISP_CONFIG_SCRIPT_LIBS_OPTIMIZED "${TMP_SCRIPT_LIBS_OPTIMIZED}") + + # Format the string + string(REGEX REPLACE "lib/Release" "lib/$(ConfigurationName)" VISP_CONFIG_SCRIPT_LIBDIR_ "${VISP_CONFIG_SCRIPT_LIBDIR_}") + string(REGEX REPLACE "lib/Debug" "lib/$(ConfigurationName)" VISP_CONFIG_SCRIPT_LIBDIR_ "${VISP_CONFIG_SCRIPT_LIBDIR_}") + + # 1/ For usage with the build tree + set(VISP_CONFIG_SCRIPT_LIBDIR "%PREFIX%/lib") + list(APPEND VISP_CONFIG_SCRIPT_LIBDIR "%PREFIX%/lib/$(ConfigurationName)") + list(APPEND VISP_CONFIG_SCRIPT_LIBDIR ${VISP_CONFIG_SCRIPT_LIBDIR_}) + list(REMOVE_DUPLICATES VISP_CONFIG_SCRIPT_LIBDIR) + configure_file(${FILE_VISP_CONFIG_SCRIPT_IN} ${FILE_VISP_CONFIG_SCRIPT}) + + # 2/ For usage with the install tree + set(VISP_CONFIG_SCRIPT_LIBDIR "%PREFIX%/${VISP_ARCH}/${VISP_RUNTIME}/lib") + list(APPEND VISP_CONFIG_SCRIPT_LIBDIR ${VISP_CONFIG_SCRIPT_LIBDIR_}) + list(REMOVE_DUPLICATES VISP_CONFIG_SCRIPT_LIBDIR) + configure_file(${FILE_VISP_CONFIG_SCRIPT_INSTALL_IN} ${FILE_VISP_CONFIG_SCRIPT_INSTALL}) +endif(UNIX) + +#---------------------------------------------------------------------- +# customize install target +#---------------------------------------------------------------------- +# install rule for visp-config shell script +install(FILES ${FILE_VISP_CONFIG_SCRIPT_INSTALL} + DESTINATION ${CMAKE_INSTALL_BINDIR} + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE + OWNER_WRITE + COMPONENT dev +) + +# install rule for visp.pc pkg-config file +if(UNIX) + install(FILES ${FILE_VISP_CONFIG_PC_INSTALL} + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + OWNER_WRITE + COMPONENT dev + ) +else() + # not implemented yet +endif() + + diff --git a/cmake/VISPModule.cmake b/cmake/VISPModule.cmake new file mode 100644 index 0000000000000000000000000000000000000000..9e0d8eab6a30abef965f3a6288617ba2db6f8b46 --- /dev/null +++ b/cmake/VISPModule.cmake @@ -0,0 +1,966 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +# Local variables (set for each module): +# +# name - short name in lower case i.e. core +# the_module - full name in lower case i.e. visp_core + +# Global variables: +# +# VISP_MODULE_${the_module}_LOCATION +# VISP_MODULE_${the_module}_BINARY_DIR +# VISP_MODULE_${the_module}_DESCRIPTION +# VISP_MODULE_${the_module}_CLASS - PUBLIC|INTERNAL|BINDINGS +# VISP_MODULE_${the_module}_HEADERS +# VISP_MODULE_${the_module}_SOURCES +# VISP_MODULE_${the_module}_DEPS - final flattened set of module dependencies +# VISP_MODULE_${the_module}_DEPS_TO_LINK - differs from above for world build only +# VISP_MODULE_${the_module}_DEPS_EXT - non-module dependencies +# VISP_MODULE_${the_module}_REQ_DEPS +# VISP_MODULE_${the_module}_OPT_DEPS +# VISP_MODULE_${the_module}_PRIVATE_REQ_DEPS +# VISP_MODULE_${the_module}_PRIVATE_OPT_DEPS +# VISP_MODULE_${the_module}_CHILDREN - list of submodules for compound modules (cmake >= 2.8.8) +# HAVE_${the_module} - for fast check of module availability + +# To control the setup of the module you could also set: +# the_description - text to be used as current module description +# VISP_MODULE_TYPE - STATIC|SHARED - set to force override global settings for current module +# BUILD_${the_module}_INIT - ON|OFF (default ON) - initial value for BUILD_${the_module} +# VISP_MODULE_CHILDREN - list of submodules + +# The verbose template for ViSP module: +# +# vp_add_module(modname <dependencies>) +# vp_glob_module_sources((<extra sources&headers>) +# or glob them manually and vp_set_module_sources(...) +# vp_module_include_directories(<extra include directories>) +# vp_create_module() +# +# If module have no "extra" then you can define it in one line: +# +# vp_define_module(modname <dependencies>) + +# clean flags for modules enabled on previous cmake run +# this is necessary to correctly handle modules removal +foreach(mod ${VISP_MODULES_BUILD} ${VISP_MODULES_DISABLED_USER} ${VISP_MODULES_DISABLED_AUTO} ${VISP_MODULES_DISABLED_FORCE}) + if(HAVE_${mod}) + unset(HAVE_${mod} CACHE) + endif() + unset(VISP_MODULE_${mod}_REQ_DEPS CACHE) + unset(VISP_MODULE_${mod}_OPT_DEPS CACHE) + unset(VISP_MODULE_${mod}_PRIVATE_REQ_DEPS CACHE) + unset(VISP_MODULE_${mod}_PRIVATE_OPT_DEPS CACHE) + unset(VISP_MODULE_${mod}_LINK_DEPS CACHE) + unset(VISP_MODULE_${mod}_INC_DEPS CACHE) +endforeach() + +# clean modules info which needs to be recalculated +set(VISP_MODULES_PUBLIC "" CACHE INTERNAL "List of ViSP modules marked for export") +set(VISP_MODULES_BUILD "" CACHE INTERNAL "List of ViSP modules included into the build") +set(VISP_MODULES_DISABLED_USER "" CACHE INTERNAL "List of ViSP modules explicitly disabled by user") +set(VISP_MODULES_DISABLED_AUTO "" CACHE INTERNAL "List of ViSP modules implicitly disabled due to dependencies") +set(VISP_MODULES_DISABLED_FORCE "" CACHE INTERNAL "List of ViSP modules which can not be build in current configuration") + +# adds dependencies to ViSP module +# Usage: +# add_dependencies(visp_<name> [REQUIRED] [<list of dependencies>] [OPTIONAL <list of modules>]) +# Notes: +# * <list of dependencies> - can include full names of modules or full pathes to shared/static libraries or cmake targets +macro(vp_add_dependencies full_modname) + vp_debug_message("vp_add_dependencies(" ${full_modname} ${ARGN} ")") + #we don't clean the dependencies here to allow this macro several times for every module + foreach(d "REQUIRED" ${ARGN}) + if(d STREQUAL "REQUIRED") + set(__depsvar VISP_MODULE_${full_modname}_REQ_DEPS) + elseif(d STREQUAL "OPTIONAL") + set(__depsvar VISP_MODULE_${full_modname}_OPT_DEPS) + elseif(d STREQUAL "PRIVATE_REQUIRED") + set(__depsvar VISP_MODULE_${full_modname}_PRIVATE_REQ_DEPS) + elseif(d STREQUAL "PRIVATE_OPTIONAL") + set(__depsvar VISP_MODULE_${full_modname}_PRIVATE_OPT_DEPS) + else() + list(APPEND ${__depsvar} "${d}") + endif() + endforeach() + unset(__depsvar) + + vp_list_unique(VISP_MODULE_${full_modname}_REQ_DEPS) + vp_list_unique(VISP_MODULE_${full_modname}_OPT_DEPS) + vp_list_unique(VISP_MODULE_${full_modname}_PRIVATE_REQ_DEPS) + vp_list_unique(VISP_MODULE_${full_modname}_PRIVATE_OPT_DEPS) + + set(VISP_MODULE_${full_modname}_REQ_DEPS ${VISP_MODULE_${full_modname}_REQ_DEPS} + CACHE INTERNAL "Required dependencies of ${full_modname} module") + set(VISP_MODULE_${full_modname}_OPT_DEPS ${VISP_MODULE_${full_modname}_OPT_DEPS} + CACHE INTERNAL "Optional dependencies of ${full_modname} module") + set(VISP_MODULE_${full_modname}_PRIVATE_REQ_DEPS ${VISP_MODULE_${full_modname}_PRIVATE_REQ_DEPS} + CACHE INTERNAL "Required private dependencies of ${full_modname} module") + set(VISP_MODULE_${full_modname}_PRIVATE_OPT_DEPS ${VISP_MODULE_${full_modname}_PRIVATE_OPT_DEPS} + CACHE INTERNAL "Optional private dependencies of ${full_modname} module") +endmacro() + +# declare new ViSP module in current folder +# Usage: +# vp_add_module(<name> [INTERNAL|BINDINGS] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>]) +# Example: +# vp_add_module(mymodule INTERNAL visp_core OPTIONAL visp_ar) +macro(vp_add_module _name) + vp_debug_message("vp_add_module(" ${_name} ${ARGN} ")") + string(TOLOWER "${_name}" name) + set(the_module visp_${name}) + #message("Found module: ${the_module}") + + # the first pass - collect modules info, the second pass - create targets + if(VISP_INITIAL_PASS) + #guard agains redefinition + if(";${VISP_MODULES_BUILD};${VISP_MODULES_DISABLED_USER};" MATCHES ";${the_module};") + message(FATAL_ERROR "Redefinition of the ${the_module} module. + at: ${CMAKE_CURRENT_SOURCE_DIR} + previously defined at: ${VISP_MODULE_${the_module}_LOCATION} +") + endif() + + if(NOT DEFINED the_description) + set(the_description "The ViSP ${name} module") + endif() + + if(NOT DEFINED BUILD_${the_module}_INIT) + set(BUILD_${the_module}_INIT ON) + endif() + + # create option to enable/disable this module + option(BUILD_MODULE_${the_module} "Include ${the_module} module into ViSP build" ${BUILD_${the_module}_INIT}) + + # remember the module details + set(VISP_MODULE_${the_module}_DESCRIPTION "${the_description}" CACHE INTERNAL "Brief description of ${the_module} module") + set(VISP_MODULE_${the_module}_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Location of ${the_module} module sources") + + set(VISP_MODULE_${the_module}_LINK_DEPS "" CACHE INTERNAL "") + set(VISP_MODULE_${the_module}_INC_DEPS "" CACHE INTERNAL "") + + # parse list of dependencies + if("${ARGV1}" STREQUAL "INTERNAL" OR "${ARGV1}" STREQUAL "BINDINGS") + set(VISP_MODULE_${the_module}_CLASS "${ARGV1}" CACHE INTERNAL "The category of the module") + set(__vp_argn__ ${ARGN}) + list(REMOVE_AT __vp_argn__ 0) + vp_add_dependencies(${the_module} ${__vp_argn__}) + unset(__vp_argn__) + else() + set(VISP_MODULE_${the_module}_CLASS "PUBLIC" CACHE INTERNAL "The category of the module") + vp_add_dependencies(${the_module} ${ARGN}) + if(BUILD_MODULE_${the_module}) + set(VISP_MODULES_PUBLIC ${VISP_MODULES_PUBLIC} "${the_module}" CACHE INTERNAL "List of ViSP modules marked for export") + endif() + endif() + + if(BUILD_MODULE_${the_module}) + set(VISP_MODULES_BUILD ${VISP_MODULES_BUILD} "${the_module}" CACHE INTERNAL "List of ViSP modules included into the build") + else() + set(VISP_MODULES_DISABLED_USER ${VISP_MODULES_DISABLED_USER} "${the_module}" CACHE INTERNAL "List of ViSP modules explicitly disabled by user") + endif() + + # add submodules if any + set(VISP_MODULE_${the_module}_CHILDREN "${VISP_MODULE_CHILDREN}" CACHE INTERNAL "List of ${the_module} submodules") + + # stop processing of current file + return() + else() + set(VISP_MODULE_${the_module}_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "") + if(NOT BUILD_MODULE_${the_module}) + return() # extra protection from redefinition + endif() + endif() +endmacro() + +# remove visp_ prefix from name +macro(vp_short_module_name name) + if(${name} MATCHES "^visp_") + string(REGEX REPLACE "^visp_" "" ${name} "${${name}}") + endif() +endmacro() + +# collect modules from specified directories +# NB: must be called only once! +macro(vp_glob_modules) + if(DEFINED VISP_INITIAL_PASS) + message(FATAL_ERROR "ViSP has already loaded its modules. Calling vp_glob_modules second time is not allowed.") + endif() + set(__directories_observed "") + + # collect modules + set(VISP_INITIAL_PASS ON) + set(VISP_PROCESSING_EXTRA_MODULES 0) + foreach(__path ${ARGN}) + if("${__path}" STREQUAL "EXTRA") + set(VISP_PROCESSING_EXTRA_MODULES 1) + endif() + get_filename_component(__path "${__path}" ABSOLUTE) + + list(FIND __directories_observed "${__path}" __pathIdx) + if(__pathIdx GREATER -1) + message(FATAL_ERROR "The directory ${__path} is observed for ViSP modules second time.") + endif() + list(APPEND __directories_observed "${__path}") + + file(GLOB __vpmodules RELATIVE "${__path}" "${__path}/*") + + if(__vpmodules) + list(SORT __vpmodules) + foreach(mod ${__vpmodules}) + get_filename_component(__modpath "${__path}/${mod}" ABSOLUTE) + if(EXISTS "${__modpath}/CMakeLists.txt") + + list(FIND __directories_observed "${__modpath}" __pathIdx) + if(__pathIdx GREATER -1) + message(FATAL_ERROR "The module from ${__modpath} is already loaded.") + endif() + list(APPEND __directories_observed "${__modpath}") + + add_subdirectory("${__modpath}" "${CMAKE_CURRENT_BINARY_DIR}/${mod}/.${mod}") + else() + # modules in tracker + get_filename_component(__subpath "${__path}/${mod}" ABSOLUTE) + file(GLOB __vpsubmodules RELATIVE "${__subpath}" "${__subpath}/*") + if(__vpsubmodules) + list(SORT __vpsubmodules) + foreach(submod ${__vpsubmodules}) + get_filename_component(__submodpath "${__subpath}/${submod}" ABSOLUTE) + if(EXISTS "${__submodpath}/CMakeLists.txt") + list(FIND __directories_observed "${__submodpath}" __pathIdx) + if(__pathIdx GREATER -1) + message(FATAL_ERROR "The module from ${__submodpath} is already loaded.") + endif() + list(APPEND __directories_observed "${__submodpath}") + add_subdirectory("${__submodpath}" "${CMAKE_CURRENT_BINARY_DIR}/${submod}/.${submod}") + endif() + endforeach() + endif() + endif() + endforeach() + endif() + endforeach() + vp_clear_vars(__vpmodules __directories_observed __path __modpath __pathIdx __vpsubmodules __subpath __submodpath) + + # resolve dependencies + __vp_resolve_dependencies() + + # create modules + set(VISP_INITIAL_PASS OFF PARENT_SCOPE) + set(VISP_INITIAL_PASS OFF) + + foreach(m ${VISP_MODULES_BUILD}) + if(m MATCHES "^visp_") + string(REGEX REPLACE "^visp_" "" __shortname "${m}") + add_subdirectory("${VISP_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${__shortname}") + else() + message(WARNING "Check module name: ${m}") + add_subdirectory("${VISP_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${m}") + endif() + endforeach() + + unset(__shortname) +endmacro() + +# disables ViSP module with missing dependencies +function(__vp_module_turn_off the_module) + list(REMOVE_ITEM VISP_MODULES_DISABLED_AUTO "${the_module}") + list(APPEND VISP_MODULES_DISABLED_AUTO "${the_module}") + list(REMOVE_ITEM VISP_MODULES_BUILD "${the_module}") + list(REMOVE_ITEM VISP_MODULES_PUBLIC "${the_module}") + set(HAVE_${the_module} OFF CACHE INTERNAL "Module ${the_module} can not be built in current configuration") + + set(VISP_MODULES_DISABLED_AUTO "${VISP_MODULES_DISABLED_AUTO}" CACHE INTERNAL "") + set(VISP_MODULES_BUILD "${VISP_MODULES_BUILD}" CACHE INTERNAL "") + set(VISP_MODULES_PUBLIC "${VISP_MODULES_PUBLIC}" CACHE INTERNAL "") +endfunction() + +# sort modules by dependencies +function(__vp_sort_modules_by_deps __lst) + vp_list_sort(${__lst}) + set(input ${${__lst}}) + set(result "") + while(input) + list(LENGTH input length_before) + foreach (m ${input}) + # check if module is in the result already + if (NOT ";${result};" MATCHES ";${m};") + # scan through module dependencies... + set(unresolved_deps_found FALSE) + foreach (d ${VISP_MODULE_${m}_CHILDREN} ${VISP_MODULE_${m}_DEPS}) + # ... which are not already in the result and are enabled + if ((NOT ";${result};" MATCHES ";${d};") AND HAVE_${d}) + set(unresolved_deps_found TRUE) + break() + endif() + endforeach() + # chek if all dependencies for this module has been resolved + if (NOT unresolved_deps_found) + list(APPEND result ${m}) + list(REMOVE_ITEM input ${m}) + endif() + endif() + endforeach() + list(LENGTH input length_after) + # check for infinite loop or unresolved dependencies + if (NOT length_after LESS length_before) + message(WARNING "Unresolved dependencies or loop in dependency graph (${length_after})\n" + "Processed ${__lst}: ${${__lst}}\n" + "Good modules: ${result}\n" + "Bad modules: ${input}" + ) + list(APPEND result ${input}) + break() + endif() + endwhile() + set(${__lst} "${result}" PARENT_SCOPE) +endfunction() + +# resolve dependensies +function(__vp_resolve_dependencies) + foreach(m ${VISP_MODULES_DISABLED_USER}) + set(HAVE_${m} OFF CACHE INTERNAL "Module ${m} will not be built in current configuration") + endforeach() + foreach(m ${VISP_MODULES_BUILD}) + set(HAVE_${m} ON CACHE INTERNAL "Module ${m} will be built in current configuration") + endforeach() + + # disable MODULES with unresolved dependencies + set(has_changes ON) + while(has_changes) + set(has_changes OFF) + foreach(m ${VISP_MODULES_BUILD}) + set(__deps ${VISP_MODULE_${m}_REQ_DEPS} ${VISP_MODULE_${m}_PRIVATE_REQ_DEPS}) + while(__deps) + vp_list_pop_front(__deps d) + string(TOLOWER "${d}" upper_d) + if(NOT (HAVE_${d} OR HAVE_${upper_d} OR TARGET ${d} OR EXISTS ${d})) + if(d MATCHES "^visp_") # TODO Remove this condition in the future and use HAVE_ variables only + message(STATUS "Module ${m} disabled because ${d} dependency can't be resolved!") + __vp_module_turn_off(${m}) + set(has_changes ON) + break() + else() + message(STATUS "Assume that non-module dependency is available: ${d} (for module ${m})") + endif() + endif() + endwhile() + endforeach() + endwhile() + +# message(STATUS "List of active modules: ${VISP_MODULES_BUILD}") + + foreach(m ${VISP_MODULES_BUILD}) + set(deps_${m} ${VISP_MODULE_${m}_REQ_DEPS}) + foreach(d ${VISP_MODULE_${m}_OPT_DEPS}) + if(NOT (";${deps_${m}};" MATCHES ";${d};")) + if(HAVE_${d} OR TARGET ${d}) + list(APPEND deps_${m} ${d}) + endif() + endif() + endforeach() +# message(STATUS "Initial deps of ${m} (w/o private deps): ${deps_${m}}") + endforeach() + + # propagate dependencies + set(has_changes ON) + while(has_changes) + set(has_changes OFF) + foreach(m2 ${VISP_MODULES_BUILD}) # transfer deps of m2 to m + foreach(m ${VISP_MODULES_BUILD}) + if((NOT m STREQUAL m2) AND ";${deps_${m}};" MATCHES ";${m2};") + foreach(d ${deps_${m2}}) + if(NOT (";${deps_${m}};" MATCHES ";${d};")) +# message(STATUS " Transfer dependency ${d} from ${m2} to ${m}") + list(APPEND deps_${m} ${d}) + set(has_changes ON) + endif() + endforeach() + endif() + endforeach() + endforeach() + endwhile() + + # process private deps + foreach(m ${VISP_MODULES_BUILD}) + foreach(d ${VISP_MODULE_${m}_PRIVATE_REQ_DEPS}) + if(NOT (";${deps_${m}};" MATCHES ";${d};")) + list(APPEND deps_${m} ${d}) + endif() + endforeach() + foreach(d ${VISP_MODULE_${m}_PRIVATE_OPT_DEPS}) + if(NOT (";${deps_${m}};" MATCHES ";${d};")) + if(HAVE_${d} OR TARGET ${d}) + list(APPEND deps_${m} ${d}) + endif() + endif() + endforeach() + endforeach() + + vp_list_sort(VISP_MODULES_BUILD) + + foreach(m ${VISP_MODULES_BUILD}) + #message(STATUS "FULL deps of ${m}: ${deps_${m}}") + set(VISP_MODULE_${m}_DEPS ${deps_${m}}) + set(VISP_MODULE_${m}_DEPS_EXT ${deps_${m}}) + vp_list_filterout(VISP_MODULE_${m}_DEPS_EXT "^visp_[^ ]+$") + if(VISP_MODULE_${m}_DEPS_EXT AND VISP_MODULE_${m}_DEPS) + list(REMOVE_ITEM VISP_MODULE_${m}_DEPS ${VISP_MODULE_${m}_DEPS_EXT}) + endif() + endforeach() + + # reorder dependencies + foreach(m ${VISP_MODULES_BUILD}) + __vp_sort_modules_by_deps(VISP_MODULE_${m}_DEPS) + vp_list_sort(VISP_MODULE_${m}_DEPS_EXT) + + set(LINK_DEPS ${VISP_MODULE_${m}_DEPS}) + + set(VISP_MODULE_${m}_DEPS ${VISP_MODULE_${m}_DEPS} CACHE INTERNAL "Flattened dependencies of ${m} module") + set(VISP_MODULE_${m}_DEPS_EXT ${VISP_MODULE_${m}_DEPS_EXT} CACHE INTERNAL "Extra dependencies of ${m} module") + set(VISP_MODULE_${m}_DEPS_TO_LINK ${LINK_DEPS} CACHE INTERNAL "Flattened dependencies of ${m} module (for linker)") + +# message(STATUS " module deps of ${m}: ${VISP_MODULE_${m}_DEPS}") +# message(STATUS " module link deps of ${m}: ${VISP_MODULE_${m}_DEPS_TO_LINK}") +# message(STATUS " extra deps of ${m}: ${VISP_MODULE_${m}_DEPS_EXT}") +# message(STATUS "") + endforeach() + + __vp_sort_modules_by_deps(VISP_MODULES_BUILD) + + set(VISP_MODULES_PUBLIC ${VISP_MODULES_PUBLIC} CACHE INTERNAL "List of ViSP modules marked for export") + set(VISP_MODULES_BUILD ${VISP_MODULES_BUILD} CACHE INTERNAL "List of ViSP modules included into the build") + set(VISP_MODULES_DISABLED_AUTO ${VISP_MODULES_DISABLED_AUTO} CACHE INTERNAL "List of ViSP modules implicitly disabled due to dependencies") +endfunction() + +# setup include paths for the list of passed modules +macro(vp_target_include_modules target) + foreach(d ${ARGN}) + if(d MATCHES "^visp_" AND HAVE_${d}) + if (EXISTS "${VISP_MODULE_${d}_LOCATION}/include") + vp_target_include_directories(${target} "${VISP_MODULE_${d}_LOCATION}/include") + # Work arround to be able to build the modules without INTERFACE_INCLUDE_DIRECTORIES + # that was only introduces since CMake 2.8.12 + if (CMAKE_VERSION VERSION_LESS 2.8.12) + vp_target_include_directories(${target} "${VISP_MODULE_${d}_INC_DEPS}") + endif() + endif() + elseif(EXISTS "${d}") + # FS keep external deps inc + set(VISP_MODULE_${the_module}_INC_DEPS "${VISP_MODULE_${the_module}_INC_DEPS};${d}" CACHE INTERNAL "") + vp_target_include_directories(${target} "${d}") + endif() + endforeach() + vp_list_unique(VISP_MODULE_${the_module}_INC_DEPS) +endmacro() + +# setup include path for ViSP headers for specified module +# vp_module_include_directories(<extra include directories/extra include modules>) +macro(vp_module_include_directories) + vp_target_include_directories(${the_module} + "${VISP_MODULE_${the_module}_LOCATION}/include" + "${VISP_MODULE_${the_module}_LOCATION}/src" + ) + vp_target_include_modules(${the_module} ${VISP_MODULE_${the_module}_DEPS} ${ARGN}) +endmacro() + +# sets header and source files for the current module +# NB: all files specified as headers will be installed +# Usage: +# ocv_set_module_sources([HEADERS] <list of files> [SOURCES] <list of files>) +macro(vp_set_module_sources) + vp_debug_message("vp_set_module_sources(" ${ARGN} ")") + + set(VISP_MODULE_${the_module}_HEADERS "") + set(VISP_MODULE_${the_module}_SOURCES "") + + foreach(f "HEADERS" ${ARGN}) + if(f STREQUAL "HEADERS" OR f STREQUAL "SOURCES") + set(__filesvar "VISP_MODULE_${the_module}_${f}") + else() + list(APPEND ${__filesvar} "${f}") + endif() + endforeach() + + # use full paths for module to be independent from the module location + vp_convert_to_full_paths(VISP_MODULE_${the_module}_HEADERS) + + if(${the_module} MATCHES visp_core) + list(APPEND VISP_MODULE_${the_module}_HEADERS "${VISP_INCLUDE_DIR}/visp3/core/vpConfig.h") + list(APPEND VISP_MODULE_${the_module}_HEADERS "${VISP_INCLUDE_DIR}/visp3/visp_modules.h") + endif() + + + set(VISP_MODULE_${the_module}_HEADERS ${VISP_MODULE_${the_module}_HEADERS} CACHE INTERNAL "List of header files for ${the_module}") + set(VISP_MODULE_${the_module}_SOURCES ${VISP_MODULE_${the_module}_SOURCES} CACHE INTERNAL "List of source files for ${the_module}") +endmacro() + +# finds and sets headers and sources for the standard ViSP module +# Usage: +# vp_glob_module_sources(<extra sources&headers in the same format as used in vp_set_module_sources>) +macro(vp_glob_module_sources) + vp_debug_message("vp_glob_module_sources(" ${ARGN} ")") + set(_argn ${ARGN}) + + file(GLOB_RECURSE lib_srcs + "${CMAKE_CURRENT_LIST_DIR}/src/*.cpp" + ) + file(GLOB_RECURSE lib_int_hdrs + "${CMAKE_CURRENT_LIST_DIR}/src/*.hpp" + "${CMAKE_CURRENT_LIST_DIR}/src/*.h" + ) + file(GLOB lib_hdrs + "${CMAKE_CURRENT_LIST_DIR}/include/visp3/*.h" + "${CMAKE_CURRENT_LIST_DIR}/include/visp3/${name}/*.h" + ) + + vp_source_group("Src" DIRBASE "${CMAKE_CURRENT_LIST_DIR}/src" FILES ${lib_srcs} ${lib_int_hdrs}) + vp_source_group("Include" DIRBASE "${CMAKE_CURRENT_LIST_DIR}/include" FILES ${lib_hdrs}) + + vp_set_module_sources(${_argn} HEADERS ${lib_hdrs} + SOURCES ${lib_srcs} ${lib_int_hdrs}) +endmacro() + +# finds and copy data from a source to a destination +# Usage: +# vp_glob_module_data(<source> <destination>) +macro(vp_glob_module_copy_data src dst) + set(__data "") + file(GLOB_RECURSE __data + "${CMAKE_CURRENT_LIST_DIR}/${src}" + ) + + foreach(__d ${__data}) + file(COPY ${__d} + DESTINATION "${VISP_BINARY_DIR}/${dst}" + FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + OWNER_WRITE + ) + + # install + if(UNIX) + set(__install_dst "${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/${dst}") + else() + set(__install_dst "${dst}") + endif() + + install(FILES ${__d} + DESTINATION "${__install_dst}" + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + OWNER_WRITE + ) + endforeach() +endmacro() + +# creates old headers for compat with previous releases in include/visp +# Usage: +# vp_create_compat_headers(<list of new headers>) +macro(vp_create_compat_headers) + vp_debug_message("vp_create_compat_headers(" ${ARGN} ")") + + set(VISP_HEADER_CONTENT_CONFIGMAKE "") + + foreach(h ${ARGN}) + get_filename_component(__h_name_we ${h} NAME_WE) + get_filename_component(__h_name ${h} NAME) + set(VISP_HEADER_CONTENT_CONFIGMAKE "#ifndef __${__h_name_we}_h_\n#define __${__h_name_we}_h_\n\n#include <visp3/${name}/${__h_name}>\n\n#endif\n") + set(__compat_header_dst "${VISP_INCLUDE_DIR}/visp/${__h_name_we}.h") + configure_file("${VISP_SOURCE_DIR}/cmake/templates/vpHeader.h.in" ${__compat_header_dst}) + endforeach() + + unset(__h_name_we) + unset(__h_name) + unset(__compat_header_dst) +endmacro() + +# creates headers for modules include/visp3/<module>/vp<module>.h +# Usage: +# vp_create_global_module_header(<module>) +macro(vp_create_global_module_header module) + vp_debug_message("vp_create_global_module_header(" ${module} ")") + + set(__name ${module}) + vp_short_module_name(__name) + set(__module_header_dst "${VISP_INCLUDE_DIR}/visp3/${__name}/${module}.h") + set(VISP_HEADER_CONTENT_CONFIGMAKE "#ifndef __${module}_h_\n#define __${module}_h_\n") + + # when core, include also vpConfig.h + if(__name MATCHES "core") + set(VISP_HEADER_CONTENT_CONFIGMAKE "${VISP_HEADER_CONTENT_CONFIGMAKE}\n#include <visp3/${__name}/vpConfig.h>") + endif() + + # include the modules we depend on + if(VISP_MODULE_${module}_REQ_DEPS) + foreach(dep ${VISP_MODULE_${module}_REQ_DEPS}) + vp_short_module_name(dep) + set(VISP_HEADER_CONTENT_CONFIGMAKE "${VISP_HEADER_CONTENT_CONFIGMAKE}\n#include <visp3/${dep}/vp${dep}.h>") + endforeach() + endif() + + foreach(h ${VISP_MODULE_${module}_HEADERS}) + get_filename_component(__h_name_we ${h} NAME_WE) + get_filename_component(__h_name ${h} NAME) + set(VISP_HEADER_CONTENT_CONFIGMAKE "${VISP_HEADER_CONTENT_CONFIGMAKE}\n#include <visp3/${__name}/${__h_name}>") + endforeach() + + set(VISP_HEADER_CONTENT_CONFIGMAKE "${VISP_HEADER_CONTENT_CONFIGMAKE}\n\n#endif\n") + configure_file("${VISP_SOURCE_DIR}/cmake/templates/vpHeader.h.in" ${__module_header_dst}) + + unset(__h_name_we) + unset(__h_name) + unset(__module_header_dst) +endmacro() + +# creates ViSP module in current folder +# creates new target, configures standard dependencies, compilers flags, install rules +# Usage: +# vp_create_module(<extra link dependencies>) +# vp_create_module() +macro(vp_create_module) + vp_debug_message("vp_create_module(" ${ARGN} ")") + set(VISP_MODULE_${the_module}_LINK_DEPS "${VISP_MODULE_${the_module}_LINK_DEPS};${ARGN}" CACHE INTERNAL "") + _vp_create_module(${ARGN}) + set(the_module_target ${the_module}) +endmacro() + +macro(_vp_create_module) + vp_create_compat_headers(${VISP_MODULE_${the_module}_HEADERS}) + vp_create_global_module_header(${the_module}) + + vp_add_library(${the_module} ${VISP_MODULE_TYPE} ${VISP_MODULE_${the_module}_HEADERS} ${VISP_MODULE_${the_module}_SOURCES}) + + vp_target_link_libraries(${the_module} ${VISP_MODULE_${the_module}_DEPS_TO_LINK}) + #vp_target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${VISP_MODULE_${the_module}_DEPS_TO_LINK}) + vp_target_link_libraries(${the_module} ${VISP_MODULE_${the_module}_DEPS_EXT} ${VISP_LINKER_LIBS} ${ARGN}) + + add_dependencies(visp_modules ${the_module}) + + if(ENABLE_SOLUTION_FOLDERS) + set_target_properties(${the_module} PROPERTIES FOLDER "modules") + endif() + + set_target_properties(${the_module} PROPERTIES + OUTPUT_NAME "${the_module}${VISP_DLLVERSION}" + DEBUG_POSTFIX "${VISP_DEBUG_POSTFIX}" + ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH} + LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH} + RUNTIME_OUTPUT_DIRECTORY ${BINARY_OUTPUT_PATH} + ) + + set_property(TARGET ${the_module} APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${VISP_MODULE_${the_module}_INC_DEPS} + ) + + # For dynamic link numbering convenions + if(NOT ANDROID) + # Android SDK build scripts can include only .so files into final .apk + # As result we should not set version properties for Android + set_target_properties(${the_module} PROPERTIES + VERSION ${VISP_VERSION} + SOVERSION ${VISP_VERSION_MAJOR}.${VISP_VERSION_MINOR} + ) + endif() + + if((NOT DEFINED VISP_MODULE_TYPE AND BUILD_SHARED_LIBS) + OR (DEFINED VISP_MODULE_TYPE AND VISP_MODULE_TYPE STREQUAL SHARED)) + set_target_properties(${the_module} PROPERTIES COMPILE_DEFINITIONS visp_EXPORTS) + set_target_properties(${the_module} PROPERTIES DEFINE_SYMBOL visp_EXPORTS) + endif() + + if(MSVC) + if(CMAKE_CROSSCOMPILING) + set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:secchk") + endif() + set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libc /DEBUG") + endif() + + vp_install_target(${the_module} EXPORT VISPModules OPTIONAL + RUNTIME DESTINATION ${VISP_BIN_INSTALL_PATH} COMPONENT libs + LIBRARY DESTINATION ${VISP_LIB_INSTALL_PATH} COMPONENT libs + ARCHIVE DESTINATION ${VISP_LIB_INSTALL_PATH} COMPONENT dev + ) + + foreach(m ${VISP_MODULE_${the_module}_CHILDREN} ${the_module}) + # only "public" headers need to be installed + if(VISP_MODULE_${m}_HEADERS AND ";${VISP_MODULES_PUBLIC};" MATCHES ";${m};") + foreach(hdr ${VISP_MODULE_${m}_HEADERS}) + string(REGEX REPLACE "^.*visp3/" "visp3/" hdr2 "${hdr}") + if(NOT hdr2 MATCHES "visp3/${m}/private.*" AND hdr2 MATCHES "^(visp3/?.*)/[^/]+.h(..)?$" ) + install(FILES ${hdr} OPTIONAL DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_MATCH_1}" COMPONENT dev) + endif() + endforeach() + endif() + endforeach() + +endmacro() + + +# short command for adding simple ViSP module +# see vp_add_module for argument details +# Usage: +# vp_define_module(module_name [INTERNAL] [REQUIRED] [<list of dependencies>] [OPTIONAL <list of optional dependencies>]) +macro(vp_define_module module_name) + vp_debug_message("vp_define_module(" ${module_name} ${ARGN} ")") + set(_argn ${ARGN}) + + vp_add_module(${module_name} ${_argn}) + vp_glob_module_sources() + vp_module_include_directories() + vp_create_module() +endmacro() + +# ensures that all passed modules are available +# sets VP_DEPENDENCIES_FOUND variable to TRUE/FALSE +macro(vp_check_dependencies) + set(VP_DEPENDENCIES_FOUND TRUE) + foreach(d ${ARGN}) + if(d MATCHES "^visp_[^ ]+$" AND NOT HAVE_${d}) + set(VP_DEPENDENCIES_FOUND FALSE) + break() + endif() + endforeach() +endmacro() + +# auxiliary macro to parse arguments of vp_add_tests commands +macro(__vp_parse_test_sources tests_type) + set(VISP_${tests_type}_${the_module}_SOURCES "") + set(VISP_${tests_type}_${the_module}_SOURCES_EXCLUDE "") + set(VISP_${tests_type}_${the_module}_DEPS "") + set(VISP_${tests_type}_${the_module}_CTEST_EXCLUDE_FOLDER "") + set(__file_group_name "") + set(__file_group_sources "") + foreach(arg "DEPENDS_ON" ${ARGN} "FILES") + if(arg STREQUAL "FILES") + set(__currentvar "__file_group_sources") + if(__file_group_name AND __file_group_sources) + source_group("${__file_group_name}" FILES ${__file_group_sources}) + list(APPEND VISP_${tests_type}_${the_module}_SOURCES ${__file_group_sources}) + endif() + set(__file_group_name "") + set(__file_group_sources "") + elseif(arg STREQUAL "DEPENDS_ON") + set(__currentvar "VISP_${tests_type}_${the_module}_DEPS") + elseif(" ${__currentvar}" STREQUAL " __file_group_sources" AND NOT __file_group_name) # spaces to avoid CMP0054 + set(__file_group_name "${arg}") + elseif(arg STREQUAL "CTEST_EXCLUDE_PATH") + set(__currentvar "VISP_${tests_type}_${the_module}_CTEST_EXCLUDE_FOLDER") + elseif(arg STREQUAL "SOURCES_EXCLUDE") + set(__currentvar "VISP_${tests_type}_${the_module}_SOURCES_EXCLUDE") + else() + list(APPEND ${__currentvar} "${arg}") + endif() + endforeach() + unset(__file_group_name) + unset(__file_group_sources) + unset(__currentvar) +endmacro() + +# this is a command for adding ViSP tests to the module +# vp_add_tests([FILES <source group name> <list of sources>] +# [FILES_EXCLUDE <list of sources>] +# [DEPENDS_ON] <list of extra dependencies> +# [CTEST_EXCLUDE_FOLDER] <list of folder to exclude from ctest>) +macro(vp_add_tests) + vp_debug_message("vp_add_tests(" ${ARGN} ")") + + set(test_path "${CMAKE_CURRENT_LIST_DIR}/test") + if(BUILD_TESTS AND EXISTS "${test_path}") + __vp_parse_test_sources(TEST ${ARGN}) + + set(__exclude_ctest "") + foreach(__folder ${VISP_TEST_${the_module}_CTEST_EXCLUDE_FOLDER} ) + file(GLOB_RECURSE __files "${CMAKE_CURRENT_LIST_DIR}/test/${__folder}/*.cpp") + list(APPEND __exclude_ctest ${__files}) + endforeach() + set(__exclude_sources "") + foreach(__source ${VISP_TEST_${the_module}_SOURCES_EXCLUDE} ) + file(GLOB __files "${CMAKE_CURRENT_LIST_DIR}/test/${__source}") + list(APPEND __exclude_sources ${__files}) + endforeach() + + set(test_deps ${the_module} ${VISP_MODULE_${the_module}_DEPS}) + + foreach(d ${VISP_TEST_${the_module}_DEPS}) + list(APPEND test_deps ${d}) + list(APPEND test_deps ${VISP_MODULE_${d}_DEPS}) + # Work arround to be able to build the modules without INTERFACE_INCLUDE_DIRECTORIES + # that was only introduces since CMake 2.8.12 + if(CMAKE_VERSION VERSION_LESS 2.8.12) + list(APPEND test_deps "${VISP_MODULE_${__m}_INC_DEPS}") + endif() + endforeach() + + vp_check_dependencies(${test_deps}) + if(VP_DEPENDENCIES_FOUND) + if(NOT VISP_TEST_${the_module}_SOURCES) + file(GLOB_RECURSE test_srcs "${test_path}/*.cpp") + vp_source_group("Src" DIRBASE "${test_path}" FILES ${test_srcs}) + set(VISP_TEST_${the_module}_SOURCES ${test_srcs}) + endif() + + foreach(t ${VISP_TEST_${the_module}_SOURCES}) + # check if source is not in exclude list + list(FIND __exclude_sources ${t} __to_exclude_from_sources) + if(${__to_exclude_from_sources} EQUAL -1) + # Compute the name of the binary to create + get_filename_component(the_target ${t} NAME_WE) + # From source compile the binary and add link rules + vp_add_executable(${the_target} ${t}) + vp_target_include_modules(${the_target} ${test_deps}) + vp_target_link_libraries(${the_target} ${test_deps} ${VISP_MODULE_${the_module}_DEPS} ${VISP_LINKER_LIBS}) + + # ctest only if not in the exclude list + list(FIND __exclude_ctest ${t} __to_exclude_from_ctest) + if(${__to_exclude_from_ctest} EQUAL -1) + add_test(${the_target} ${the_target} -c ${OPTION_TO_DESACTIVE_DISPLAY}) + endif() + # TODO FS add visp_test_${name} target to group all the tests + add_dependencies(visp_tests ${the_target}) + if(ENABLE_SOLUTION_FOLDERS) + set_target_properties(${the_target} PROPERTIES FOLDER "tests") + endif() + endif() + endforeach() + + else(VP_DEPENDENCIES_FOUND) + # TODO: warn about unsatisfied dependencies + endif(VP_DEPENDENCIES_FOUND) + + endif() +endmacro() + +# setup include paths for the list of passed modules +macro(vp_include_modules) + foreach(d ${ARGN}) + if(d MATCHES "^visp_" AND HAVE_${d}) + if (EXISTS "${VISP_MODULE_${d}_LOCATION}/include") + vp_include_directories("${VISP_MODULE_${d}_LOCATION}/include") + endif() + elseif(EXISTS "${d}") + vp_include_directories("${d}") + endif() + endforeach() +endmacro() + +# same as previous but with dependencies +macro(vp_include_modules_recurse) + vp_include_modules(${ARGN}) + foreach(d ${ARGN}) + if(d MATCHES "^visp_" AND HAVE_${d} AND DEFINED VISP_MODULE_${d}_DEPS) + foreach (sub ${VISP_MODULE_${d}_DEPS}) + vp_include_modules(${sub}) + endforeach() + endif() + endforeach() +endmacro() + +# This is a command to configure files as include headers of the corresponding module. +# vp_add_config_file(<list of header config files>) +# +# If the input config filename is suffixed by .in or .cmake the suffix is removed +# in the configured file. +# +# Example: +# vp_add_config_file(cmake/template/vpConfigModule.h.in) +# creates include/visp3/module_name/vpConfigModule.h +macro(vp_add_config_file) + foreach(d ${ARGN}) + # Removes first "/" if it exists + string(FIND ${d} "/" FIRST_SEPARATOR_POS) + if(${FIRST_SEPARATOR_POS} EQUAL 0) + string(SUBSTRING ${d} 1 -1 d) + endif() + + # Find start of file name + string(FIND ${d} "/" LAST_SEPARATOR_POS REVERSE) + if(${LAST_SEPARATOR_POS} EQUAL -1) + set(START 0) + else() + math(EXPR START "${LAST_SEPARATOR_POS}+1") + endif() + + # Save entire path + set(FILENAME_CONFIG ${d}) + + # Find file name + string(FIND ${d} "." EXTENSION_POS REVERSE) + + if(${EXTENSION_POS} EQUAL -1) + string(SUBSTRING ${d} ${START} -1 FILENAME_CONFIG_SHORT) + else() + string(SUBSTRING ${d} ${EXTENSION_POS} -1 EXT_CONFIG_FILE) + if(EXT_CONFIG_FILE MATCHES ".cmake" OR EXT_CONFIG_FILE MATCHES ".in") + math(EXPR LENGTH "${EXTENSION_POS} - ${START}") + string(SUBSTRING ${d} ${START} ${LENGTH} FILENAME_CONFIG_SHORT) + else() + string(SUBSTRING ${d} ${START} -1 FILENAME_CONFIG_SHORT) + endif() + endif() + + set(MODULE_NAME ${the_module}) + if(MODULE_NAME MATCHES "^visp_") + string(REGEX REPLACE "^visp_" "" MODULE_NAME "${MODULE_NAME}") + endif() + + configure_file("${VISP_MODULE_${the_module}_LOCATION}/${FILENAME_CONFIG}" "${VISP_INCLUDE_DIR}/visp3/${MODULE_NAME}/${FILENAME_CONFIG_SHORT}") + + vp_create_compat_headers("${VISP_INCLUDE_DIR}/visp3/${MODULE_NAME}/${FILENAME_CONFIG_SHORT}") + + install(FILES "${VISP_INCLUDE_DIR}/visp3/${MODULE_NAME}/${FILENAME_CONFIG_SHORT}" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/visp3/${MODULE_NAME} + COMPONENT dev + ) + + endforeach() +endmacro() + +# This is a command to add a list of paths associated to the corresponding module +# to the CMAKE_MODULE_PATH global var to find specific cmake material +# vp_add_cmake_module_path(<list of cmake module paths>) +# Example: +# vp_add_cmake_module_path(cmake) +# Appends the cmake full path to CMAKE_MODULE_PATH var. +macro(vp_add_cmake_module_path) + foreach(d ${ARGN}) + # Removes first "/" if it exists + string(FIND ${d} "/" FIRST_SEPARATOR_POS) + if(${FIRST_SEPARATOR_POS} EQUAL 0) + string(SUBSTRING ${d} 1 -1 d) + endif() + if(EXISTS "${VISP_MODULE_${the_module}_LOCATION}/${d}") + list(APPEND CMAKE_MODULE_PATH "${VISP_MODULE_${the_module}_LOCATION}/${d}") + endif() + endforeach() +endmacro() diff --git a/CMakeModules/VISPUse.cmake.in b/cmake/VISPUse.cmake.in similarity index 78% rename from CMakeModules/VISPUse.cmake.in rename to cmake/VISPUse.cmake.in index 36ab38f845875325b47193bdc934166d72da0f3a..016dae2561951bc3ee134ebe0e78d4ef9ef7d320 100644 --- a/CMakeModules/VISPUse.cmake.in +++ b/cmake/VISPUse.cmake.in @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: VISPUse.cmake.in 4616 2014-01-24 18:43:25Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/cmake/VISPUtils.cmake b/cmake/VISPUtils.cmake new file mode 100644 index 0000000000000000000000000000000000000000..eb817aa439eaacd27670e602a1d40d9de45920a6 --- /dev/null +++ b/cmake/VISPUtils.cmake @@ -0,0 +1,457 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +# adds include directories in such way that directories from the ViSP source tree go first +function(vp_include_directories) + vp_debug_message("vp_include_directories( ${ARGN} )") + set(__add_before "") + foreach(dir ${ARGN}) + get_filename_component(__abs_dir "${dir}" ABSOLUTE) + string(REPLACE "+" "\\+" __VISP_BINARY_DIR_filtered ${VISP_BINARY_DIR}) +# if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${VISP_BINARY_DIR}") + if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") + list(APPEND __add_before "${dir}") + else() + include_directories(AFTER SYSTEM "${dir}") + endif() + endforeach() + include_directories(BEFORE ${__add_before}) +endfunction() + +# adds include directories in such way that directories from the ViSP source tree go first +function(vp_target_include_directories target) + set(__params "") + foreach(dir ${ARGN}) + get_filename_component(__abs_dir "${dir}" ABSOLUTE) + string(REPLACE "+" "\\+" __VISP_BINARY_DIR_filtered ${VISP_BINARY_DIR}) +# if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${VISP_BINARY_DIR}") + if("${__abs_dir}" MATCHES "^${VISP_SOURCE_DIR}" OR "${__abs_dir}" MATCHES "^${__VISP_BINARY_DIR_filtered}") + list(APPEND __params "${__abs_dir}") + else() + list(APPEND __params "${dir}") + endif() + endforeach() + if(__params) + if(CMAKE_VERSION VERSION_LESS 2.8.11) + include_directories(${__params}) + else() + if(TARGET ${target}) + target_include_directories(${target} PRIVATE ${__params}) + else() + set(__new_inc "${VP_TARGET_INCLUDE_DIRS_${target}};${__params}") + set(VP_TARGET_INCLUDE_DIRS_${target} "${__new_inc}" CACHE INTERNAL "") + endif() + endif() + endif() +endfunction() + +# clears all passed variables +macro(vp_clear_vars) + foreach(_var ${ARGN}) + unset(${_var} CACHE) + endforeach() +endmacro() + +# print message +macro(vp_debug_message) + #string(REPLACE ";" " " __msg "${ARGN}") + #message(STATUS "${__msg}") +endmacro() + +# remove all matching elements from the list +macro(vp_list_filterout lst regex) + foreach(item ${${lst}}) + if(item MATCHES "${regex}") + list(REMOVE_ITEM ${lst} "${item}") + endif() + endforeach() +endmacro() + +# stable & safe duplicates removal macro +macro(vp_list_unique __lst) + if(${__lst}) + list(REMOVE_DUPLICATES ${__lst}) + endif() +endmacro() + +# safe list sorting macro +macro(vp_list_sort __lst) + if(${__lst}) + list(SORT ${__lst}) + endif() +endmacro() + +# gets and removes the first element from list +macro(vp_list_pop_front LST VAR) + if(${LST}) + list(GET ${LST} 0 ${VAR}) + list(REMOVE_AT ${LST} 0) + else() + set(${VAR} "") + endif() +endmacro() + +# remove cmake ; list separator +macro(vp_list_remove_separator __lst) + if(${__lst}) + set(__lst_reformated "") + foreach(element ${${__lst}}) + set(__lst_reformated "${__lst_reformated} ${element}") + endforeach() + set(${__lst} ${__lst_reformated}) + endif() +endmacro() + +# Provides an option that the user can optionally select. +# Can accept condition to control when option is available for user. +# Usage: +# vp_option(<option_variable> +# <package to find to activate the option> +# <QUIET or ""> +# "help string describing the option" +# "advanced list of vars separated by ;" +# <initial value or boolean expression> [IF <condition>]) +macro(VP_OPTION variable package quiet description advanced value) + set(__option TRUE) + set(__value ${value}) + set(__condition "") + set(__varname "__value") + set(__p ${package}) + + # get the first package considered as the main package from a list: ie "Zlib;MyZlib" + set(__first_package "") + foreach(p ${package}) + if(${p} MATCHES "^My") + string(REGEX REPLACE "^My" "" p "${p}") + endif() + set(__first_package ${p}) + break() + endforeach() + + if(NOT ${__first_package} STREQUAL "") + # get the first package name from the list + #list(GET ${package} 0 ${__package}) + string(TOLOWER "${__first_package}" __package_lower) + string(TOUPPER "${__first_package}" __package_upper) # useful for Qt -> QT_FOUND + endif() + + # set VISP_HAVE_<package>_FOUND="no" + set(__alias_have_found_str VISP_HAVE_${__package_upper}_FOUND) + set(${__alias_have_found_str} "no") + + foreach(arg ${ARGN}) + if(arg STREQUAL "IF" OR arg STREQUAL "if") + set(__varname "__condition") + else() + list(APPEND ${__varname} ${arg}) + endif() + endforeach() + unset(__varname) + if(__condition STREQUAL "") + set(__condition 2 GREATER 1) + endif() + if(${__condition}) + + if(NOT ${__first_package} STREQUAL "") + foreach(p ${package}) + if("${quiet}" STREQUAL "") + find_package(${p}) + else() + find_package(${p} ${quiet}) + endif() + if(${__package_upper}_FOUND OR ${__first_package}_FOUND) + set(__option TRUE) + break() + else() + set(__option FALSE) + endif() + endforeach() + endif() + if(${__option}) + if(__value MATCHES ";") + if(${__value}) + option(${variable} "${description}" ON) + else() + option(${variable} "${description}" OFF) + endif() + elseif(DEFINED ${__value}) + if(${__value}) + option(${variable} "${description}" ON) + else() + option(${variable} "${description}" OFF) + endif() + else() + option(${variable} "${description}" ${__value}) + endif() + else() + unset(${variable} CACHE) + endif() + unset(__condition) + unset(__value) + + else() + set(${variable} OFF) + endif() + foreach(a ${advanced}) + mark_as_advanced(${a}) + endforeach() + if(${variable} AND NOT ${__first_package} STREQUAL "") + # set VISP_HAVE_<package>=TRUE and VISP_HAVE_<package>_FOUND="yes" + message(STATUS "${__package_lower} found") + set(${__alias_have_found_str} "yes") # for ViSP-third-party.txt + endif() + unset(__option) + unset(__alias_have) + unset(__alias_have_found_str) +endmacro() + +# Provides a macro to set a var. +# Can accept condition to set var. +# Usage: +# vp_set(<option_variable> +# <initial value or boolean expression> [IF <condition>]) +macro(VP_SET variable value) + set(__value ${value}) + set(__condition "") + set(__varname "__value") + + foreach(arg ${ARGN}) + if(arg STREQUAL "IF" OR arg STREQUAL "if") + set(__varname "__condition") + else() + list(APPEND ${__varname} ${arg}) + endif() + endforeach() + unset(__varname) + if(__condition STREQUAL "") + set(__condition 2 GREATER 1) + endif() + if(${__condition}) + if(__value MATCHES ";") + if(${__value}) + set(${variable} TRUE) + else() + set(${variable} FALSE) + endif() + elseif(DEFINED ${__value}) + if(${__value}) + set(${variable} TRUE) + else() + set(${variable} FALSE) + endif() + else() + set(${variable} ${__value}) + endif() + endif() + unset(__condition) + unset(__value) +endmacro() + +# short command to setup source group +function(vp_source_group group) + cmake_parse_arguments(SG "" "DIRBASE" "GLOB;GLOB_RECURSE;FILES" ${ARGN}) + set(files "") + if(SG_FILES) + list(APPEND files ${SG_FILES}) + endif() + if(SG_GLOB) + file(GLOB srcs ${SG_GLOB}) + list(APPEND files ${srcs}) + endif() + if(SG_GLOB_RECURSE) + file(GLOB_RECURSE srcs ${SG_GLOB_RECURSE}) + list(APPEND files ${srcs}) + endif() + if(SG_DIRBASE) + foreach(f ${files}) + file(RELATIVE_PATH fpart "${SG_DIRBASE}" "${f}") + if(fpart MATCHES "^\\.\\.") + message(AUTHOR_WARNING "Can't detect subpath for source_group command: Group=${group} FILE=${f} DIRBASE=${SG_DIRBASE}") + set(fpart "") + else() + get_filename_component(fpart "${fpart}" PATH) + if(fpart) + set(fpart "/${fpart}") # add '/' + string(REPLACE "/" "\\" fpart "${fpart}") + endif() + endif() + source_group("${group}${fpart}" FILES ${f}) + endforeach() + else() + source_group(${group} FILES ${files}) + endif() +endfunction() + +# convert list of paths to full paths +macro(vp_convert_to_full_paths VAR) + if(${VAR}) + set(__tmp "") + foreach(path ${${VAR}}) + get_filename_component(${VAR} "${path}" ABSOLUTE) + list(APPEND __tmp "${${VAR}}") + endforeach() + set(${VAR} ${__tmp}) + unset(__tmp) + endif() +endmacro() + +# add install command +function(vp_install_target) + install(TARGETS ${ARGN}) + + set(isPackage 0) + unset(__package) + unset(__target) + foreach(e ${ARGN}) + if(NOT DEFINED __target) + set(__target "${e}") + endif() + if(isPackage EQUAL 1) + set(__package "${e}") + break() + endif() + if(e STREQUAL "EXPORT") + set(isPackage 1) + endif() + endforeach() + + if(DEFINED __package) + list(APPEND ${__package}_TARGETS ${__target}) + set(${__package}_TARGETS "${${__package}_TARGETS}" CACHE INTERNAL "List of ${__package} targets") + endif() + + if(INSTALL_CREATE_DISTRIB) + if(MSVC AND NOT BUILD_SHARED_LIBS) + set(__target "${ARGV0}") + + set(isArchive 0) + set(isDst 0) + unset(__dst) + foreach(e ${ARGN}) + if(isDst EQUAL 1) + set(__dst "${e}") + break() + endif() + if(isArchive EQUAL 1 AND e STREQUAL "DESTINATION") + set(isDst 1) + endif() + if(e STREQUAL "ARCHIVE") + set(isArchive 1) + else() + set(isArchive 0) + endif() + endforeach() + +# message(STATUS "Process ${__target} dst=${__dst}...") + if(DEFINED __dst) + if(CMAKE_VERSION VERSION_LESS 2.8.12) + get_target_property(fname ${__target} LOCATION_DEBUG) + if(fname MATCHES "\\.lib$") + string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}") + install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Debug) + endif() + + get_target_property(fname ${__target} LOCATION_RELEASE) + if(fname MATCHES "\\.lib$") + string(REGEX REPLACE "\\.lib$" ".pdb" fname "${fname}") + install(FILES ${fname} DESTINATION ${__dst} CONFIGURATIONS Release) + endif() + else() + # CMake 2.8.12 brokes PDB support in STATIC libraries for MSVS + endif() + endif() + endif() + endif() +endfunction() + +function(vp_target_link_libraries target) + set(LINK_DEPS ${ARGN}) + target_link_libraries(${target} ${LINK_DEPS}) +endfunction() + +function(_vp_append_target_includes target) + if(DEFINED VP_TARGET_INCLUDE_DIRS_${target}) + target_include_directories(${target} PRIVATE ${VP_TARGET_INCLUDE_DIRS_${target}}) + unset(VP_TARGET_INCLUDE_DIRS_${target} CACHE) + endif() +endfunction() + +function(vp_add_executable target) + add_executable(${target} ${ARGN}) + _vp_append_target_includes(${target}) +endfunction() + +function(vp_add_library target) + add_library(${target} ${ARGN}) + + _vp_append_target_includes(${target}) +endfunction() + +# Macros that checks if package have been installed. +# After it set vars: +# <package>_FOUND +# <package>_INCLUDE_DIRS +# <package>_LIBRARIES +# VISP_HAVE_<package> +macro(VP_CHECK_PACKAGE package) + set(ALIAS ${package}) + string(TOUPPER "${ALIAS}" ALIAS_UPPER) # useful for OpenGL + set(ALIAS_FOUND ${ALIAS}_FOUND) + set(ALIAS_UPPER_FOUND ${ALIAS_UPPER}_FOUND) + set(ALIAS_INCLUDE_DIRS ${ALIAS}_INCLUDE_DIRS) + set(ALIAS_LIBRARIES ${ALIAS}_LIBRARIES) + set(ALIAS_VISP_HAVE VISP_HAVE_${ALIAS}) + set(ALIAS_UPPER_VISP_HAVE VISP_HAVE_${ALIAS_UPPER}) + + find_package(${ALIAS}) + + if(${ALIAS_FOUND} OR ${ALIAS_UPPER_FOUND}) + set(${ALIAS_VISP_HAVE} 1) + set(${ALIAS_UPPER_VISP_HAVE} 1) + endif() +endmacro() + +# Macro the get the list of subdirs from the path +# var: returned variable name +# path: path from witch relative subdirs are +macro(vp_get_relative_subdirs var path) + set(ALIAS ${var}) + file(GLOB_RECURSE rel_path_lst_ RELATIVE ${path} ${path}/*) + set(${ALIAS} "") + foreach(f ${rel_path_lst_}) + get_filename_component(d ${f} PATH) + list(APPEND ${ALIAS} ${d}) + endforeach() + list(REMOVE_DUPLICATES ${ALIAS}) +endmacro() diff --git a/CMakeModules/VISPConfig.cmake.in b/cmake/templates/VISPConfig.cmake.in similarity index 70% rename from CMakeModules/VISPConfig.cmake.in rename to cmake/templates/VISPConfig.cmake.in index f42084305771c6a012db589447110a0063c36c06..224df4e28694b42f18b2a557fc19cf25f7b1c68e 100644 --- a/CMakeModules/VISPConfig.cmake.in +++ b/cmake/templates/VISPConfig.cmake.in @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: VISPConfig.cmake.in 5011 2014-11-28 10:11:48Z ayol $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -36,9 +33,10 @@ # ** File generated automatically, do not modify ** # # This file will define the following CMake variables: +# - VISP_LIBS : The list of all imported targets for VISP modules. # - VISP_INCLUDE_DIRS : ViSP and third-party include directories # - VISP_LIBRARIES : ViSP library to link against. Third-party libraries are -# linked automatically thanks to cmake export file VISPTargets.cmake +# linked automatically thanks to cmake export file VISPModules.cmake # - VISP_VERSION_STRING : Full ViSP version that is build, "@VISP_VERSION@" # - VISP_VERSION_MAJOR : Major version part of VISP_VERSION: "@VISP_VERSION_MAJOR@" # - VISP_VERSION_MINOR : Minor version part of VISP_VERSION: "@VISP_VERSION_MINOR@" @@ -48,10 +46,11 @@ # - VISP_SHARED : Use ViSP as shared library # - VISP_CONFIG_PATH : Path to this VISPConfig.cmake # - VISP_USE_FILE : File to include to use ViSP without specific cmake code +# - VISP_LIB_COMPONENTS: Present VISP modules list # # Typical usage in user project: # -# find_package(VISP) +# find_package(VISP REQUIRED) # include_directories(${VISP_INCLUDE_DIRS}) # target_link_libraries(MY_TARGET_NAME ${VISP_LIBRARIES}) # @@ -62,6 +61,12 @@ # include(${VISP_USE_FILE}) # endif() # +# Or you can search for specific OpenCV modules: +# +# find_package(VISP REQUIRED core videoio) +# +# If the module is found then VISP_<MODULE>_FOUND is set to TRUE. +# # Authors: # Fabien Spindler # @@ -79,11 +84,54 @@ set(VISP_VERSION_MAJOR "@VISP_VERSION_MAJOR@") set(VISP_VERSION_MINOR "@VISP_VERSION_MINOR@") set(VISP_VERSION_PATCH "@VISP_VERSION_PATCH@") +set(VISP_LIB_COMPONENTS @VISP_MODULES_CONFIGCMAKE@) + +# Form list of modules (components) to find +if(NOT VISP_FIND_COMPONENTS) + set(VISP_FIND_COMPONENTS ${VISP_LIB_COMPONENTS}) +endif() + +# expand short module names and see if requested components exist +set(VISP_FIND_COMPONENTS_ "") +foreach(__vpcomponent ${VISP_FIND_COMPONENTS}) + if(NOT __vpcomponent MATCHES "^visp_") + set(__vpcomponent visp_${__vpcomponent}) + endif() + list(FIND VISP_LIB_COMPONENTS ${__vpcomponent} __vpcomponentIdx) + if(__vpcomponentIdx LESS 0) + #requested component is not found... + if(VISP_FIND_REQUIRED) + message(FATAL_ERROR "${__vpcomponent} is required but was not found") + elseif(NOT VISP_FIND_QUIETLY) + message(WARNING "${__vpcomponent} is required but was not found") + endif() + #indicate that module is NOT found + string(TOUPPER "${__vpcomponent}" __vpcomponentUP) + set(${__vpcomponentUP}_FOUND "${__vpcomponentUP}_FOUND-NOTFOUND") + else() + list(APPEND VISP_FIND_COMPONENTS_ ${__vpcomponent}) + # Not using list(APPEND) here, because VISP_LIBS may not exist yet. + # Also not clearing VISP_LIBS anywhere, so that multiple calls + # to find_package(VISP) with different component lists add up. + set(VISP_LIBS ${VISP_LIBS} "${__vpcomponent}") + #indicate that module is found + string(TOUPPER "${__vpcomponent}" __vpcomponentUP) + set(${__vpcomponentUP}_FOUND 1) + endif() +endforeach() +set(VISP_FIND_COMPONENTS ${VISP_FIND_COMPONENTS_}) +#message("VISP_FIND_COMPONENTS: ${VISP_FIND_COMPONENTS}") + +# Resolve dependencies +foreach(__opttype OPT DBG) + set(VISP_LIBS_${__opttype} "${VISP_LIBS}") +endforeach() + # Some additional settings are required if ViSP is built as static libs set(VISP_SHARED @BUILD_SHARED_LIBS@) # Extract the directory where *this* file has been installed (determined at cmake run-time) -get_filename_component(VISP_CONFIG_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH CACHE) +set(VISP_CONFIG_PATH ${VISP_DIR} CACHE PATH "ViSPConfig.cmake path location" FORCE) mark_as_advanced(VISP_CONFIG_PATH) if(NOT WIN32) @@ -100,26 +148,26 @@ if(NOT WIN32) endif() # Tells the user project where to find ViSP headers -set(VISP_INCLUDE_DIRS @VISP_INCLUDE_DIRS_CONFIGCMAKE@) +set(VISP_INCLUDE_DIRS "@VISP_INCLUDE_DIRS_CONFIGCMAKE@") # Tells the user project ViSP library name -set(VISP_LIBRARIES "@VISP_INTERN_LIBRARY@") +set(VISP_LIBRARIES ${VISP_LIBS}) # need to be improved if(POLICY CMP0024) # Fix to prevent multiple includes - if(NOT TARGET @VISP_INTERN_LIBRARY@) + if(NOT TARGET visp_core) cmake_policy(PUSH) cmake_policy(SET CMP0024 OLD) # Our library dependencies (contains definitions for IMPORTED targets) - include("${CMAKE_CURRENT_LIST_DIR}/VISPTargets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/VISPModules.cmake") cmake_policy(POP) endif() else() # Fix for cmake 2.8.7 to prevent multiple includes - if(NOT TARGET @VISP_INTERN_LIBRARY@) + if(NOT TARGET visp_core) # Our library dependencies (contains definitions for IMPORTED targets) - include("${CMAKE_CURRENT_LIST_DIR}/VISPTargets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/VISPModules.cmake") endif() endif() @@ -145,7 +193,7 @@ SET(VISP_HAVE_GDI "@VISP_HAVE_GDI@") SET(VISP_HAVE_D3D9 "@VISP_HAVE_D3D9@") SET(VISP_HAVE_DISPLAY "@VISP_HAVE_DISPLAY@") SET(VISP_HAVE_GSL "@VISP_HAVE_GSL@") -SET(VISP_HAVE_LAPACK "@VISP_HAVE_LAPACK@") +SET(VISP_HAVE_LAPACK_C "@VISP_HAVE_LAPACK_C@") SET(VISP_HAVE_LIBFREENECT "@VISP_HAVE_LIBFREENECT@") SET(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES "@VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES@") SET(VISP_HAVE_LIBFREENECT_OLD "@VISP_HAVE_LIBFREENECT_OLD@") @@ -156,13 +204,13 @@ SET(VISP_HAVE_OPENCV_VERSION "@VISP_HAVE_OPENCV_VERSION@") SET(VISP_HAVE_OGRE "@VISP_HAVE_OGRE@") SET(VISP_HAVE_OPENGL "@VISP_HAVE_OPENGL@") SET(VISP_HAVE_OIS "@VISP_HAVE_OIS@") -SET(VISP_HAVE_COIN_AND_GUI "@VISP_HAVE_COIN_AND_GUI@") -SET(VISP_HAVE_COIN "@VISP_HAVE_COIN@") +SET(VISP_HAVE_COIN3D_AND_GUI "@VISP_HAVE_COIN3D_AND_GUI@") +SET(VISP_HAVE_COIN3D "@VISP_HAVE_COIN3D@") SET(VISP_HAVE_QT "@VISP_HAVE_QT@") SET(VISP_HAVE_SOQT "@VISP_HAVE_SOQT@") SET(VISP_HAVE_SOWIN "@VISP_HAVE_SOWIN@") SET(VISP_HAVE_SOXT "@VISP_HAVE_SOXT@") -SET(VISP_HAVE_DC1394_2 "@VISP_HAVE_DC1394_2@") +SET(VISP_HAVE_DC1394 "@VISP_HAVE_DC1394@") SET(VISP_HAVE_CMU1394 "@VISP_HAVE_CMU1394@") SET(VISP_HAVE_V4L2 "@VISP_HAVE_V4L2@") SET(VISP_HAVE_DIRECTSHOW "@VISP_HAVE_DIRECTSHOW@") @@ -175,8 +223,8 @@ SET(VISP_HAVE_VIPER850 "@VISP_HAVE_VIPER850@") SET(VISP_HAVE_PIONEER "@VISP_HAVE_PIONEER@") SET(VISP_HAVE_PARPORT "@VISP_HAVE_PARPORT@") SET(VISP_HAVE_XML2 "@VISP_HAVE_XML2@") -SET(VISP_HAVE_LIBJPEG "@VISP_HAVE_LIBJPEG@") -SET(VISP_HAVE_LIBPNG "@VISP_HAVE_LIBPNG@") +SET(VISP_HAVE_JPEG "@VISP_HAVE_JPEG@") +SET(VISP_HAVE_PNG "@VISP_HAVE_PNG@") SET(VISP_HAVE_FFMPEG "@VISP_HAVE_FFMPEG@") SET(VISP_HAVE_YARP "@VISP_HAVE_YARP@") SET(VISP_HAVE_OPENMP "@VISP_HAVE_OPENMP@") @@ -193,9 +241,6 @@ macro(visp_add_target file_cpp) include_directories(${VISP_INCLUDE_DIRS}) add_executable(${target} ${file_cpp}) target_link_libraries(${target} ${VISP_LIBRARIES}) - if(VISP_INTERN_LIBRARY) - add_dependencies(${target} ${VISP_INTERN_LIBRARY}) - endif() endmacro() # Create a dependency to the target extracted from the *.cpp file and put the target in the solution dependency folder. @@ -236,3 +281,40 @@ else() ) endmacro() endif() + +# Check dependencies for examples +macro(visp_check_dependencies) + set(VP_DEPENDENCIES_FOUND TRUE) + foreach(d ${ARGN}) + if(NOT TARGET ${d}) + #message(WARNING "ViSP: Can't resolve dependency: ${d}") + set(VP_DEPENDENCIES_FOUND FALSE) + break() + endif() + endforeach() +endmacro() + +# add subdirectory if dependencies are found +# visp_add_subdirectory(<subdir> REQUIRED_DEPS <deps>) +macro(visp_add_subdirectory subdir) + set(__deps "") + + foreach(arg ${ARGN}) + if(arg STREQUAL "REQUIRED_DEPS") + set(__varname "__deps") + else() + list(APPEND ${__varname} ${arg}) + endif() + endforeach() + unset(__varname) + + if(__deps STREQUAL "") + set(VP_DEPENDENCIES_FOUND TRUE) + else() + visp_check_dependencies(${__deps}) + endif() + + if(VP_DEPENDENCIES_FOUND) + add_subdirectory(${subdir}) + endif() +endmacro() diff --git a/CMakeModules/VISPConfigVersion.cmake.in b/cmake/templates/VISPConfigVersion.cmake.in similarity index 100% rename from CMakeModules/VISPConfigVersion.cmake.in rename to cmake/templates/VISPConfigVersion.cmake.in diff --git a/ViSP-third-party.txt.cmake b/cmake/templates/ViSP-third-party.txt.in similarity index 82% rename from ViSP-third-party.txt.cmake rename to cmake/templates/ViSP-third-party.txt.in index f8c19ead381a6f08267f2a62904a034e2ea25acc..4c103b736d26a1305dc8e7f36cf76e43dbd7ea7a 100644 --- a/ViSP-third-party.txt.cmake +++ b/cmake/templates/ViSP-third-party.txt.in @@ -5,13 +5,13 @@ build ViSP on your computer. Mathematics: Gnu Scientific Library : ${VISP_HAVE_GSL_FOUND} - Lapack/blas : ${VISP_HAVE_LAPACK_FOUND} + Lapack/blas : ${VISP_HAVE_LAPACK_C_FOUND} Simulator: Ogre simulator : ${VISP_HAVE_OGRE_FOUND} \- Ogre3D : ${VISP_HAVE_OGRE_FOUND} \- OIS : ${VISP_HAVE_OIS_FOUND} - Coin simulator : ${VISP_HAVE_COIN_AND_GUI_FOUND} - \- Coin3D : ${VISP_HAVE_COIN_FOUND} + Coin simulator : ${VISP_HAVE_COIN3D_AND_GUI_FOUND} + \- Coin3D : ${VISP_HAVE_COIN3D_FOUND} \- SoWin : ${VISP_HAVE_SOWIN_FOUND} \- SoXt : ${VISP_HAVE_SOXT_FOUND} \- SoQt : ${VISP_HAVE_SOQT_FOUND} @@ -27,12 +27,12 @@ Robots Viper S850 : ${VISP_HAVE_VIPER850_FOUND} Video devices (display) X11 : ${VISP_HAVE_X11_FOUND} - GTK : ${VISP_HAVE_GTK_FOUND} + GTK : ${VISP_HAVE_GTK2_FOUND} OpenCV : ${VISP_HAVE_OPENCV_FOUND} GDI : ${VISP_HAVE_GDI_FOUND} - Direct3D : ${VISP_HAVE_D3D9_FOUND} + Direct3D : ${VISP_HAVE_DIRECT3D_FOUND} Framegrabbers - Firewire libdc1394-2.x : ${VISP_HAVE_DC1394_2_FOUND} + Firewire libdc1394-2.x : ${VISP_HAVE_DC1394_FOUND} Video For Linux Two : ${VISP_HAVE_V4L2_FOUND} DirectShow : ${VISP_HAVE_DIRECTSHOW_FOUND} CMU 1394 Digital Camera SDK : ${VISP_HAVE_CMU1394_FOUND} @@ -45,8 +45,8 @@ Specific devices \-pthread : ${VISP_HAVE_PTHREAD_FOUND} Video and image Read/Write: FFMPEG : ${VISP_HAVE_FFMPEG_FOUND} - libjpeg : ${VISP_HAVE_LIBJPEG_FOUND} - libpng : ${VISP_HAVE_LIBPNG_FOUND} + libjpeg : ${VISP_HAVE_JPEG_FOUND} + libpng : ${VISP_HAVE_PNG_FOUND} Misc: XML2 : ${VISP_HAVE_XML2_FOUND} pthread : ${VISP_HAVE_PTHREAD_FOUND} @@ -55,6 +55,5 @@ Misc: dmtx : ${VISP_HAVE_DMTX_FOUND} Documentation: Doxygen : ${VISP_HAVE_DOXYGEN_FOUND} - Graphviz dot : ${VISP_HAVE_DOT_FOUND} ViSP built with C++11 features: ${VISP_HAVE_CPP11_COMPATIBILITY_FOUND} diff --git a/CMakeModules/cmake_uninstall.cmake.in b/cmake/templates/cmake_uninstall.cmake.in similarity index 85% rename from CMakeModules/cmake_uninstall.cmake.in rename to cmake/templates/cmake_uninstall.cmake.in index fb9072b671d2bdb00d0560539f6247c29976c411..b32e083dcf1d8f70170302bdb63103e36a7402f7 100644 --- a/CMakeModules/cmake_uninstall.cmake.in +++ b/cmake/templates/cmake_uninstall.cmake.in @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: cmake_uninstall.cmake.in 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/cmake/templates/resources.cfg.in b/cmake/templates/resources.cfg.in new file mode 100644 index 0000000000000000000000000000000000000000..8160b53cad5cc72c29b974f2b731ea6fea8a3bad --- /dev/null +++ b/cmake/templates/resources.cfg.in @@ -0,0 +1,7 @@ +# Resources required by the sample browser and most samples. +[Essential] +#Zip=@OGRE_MEDIA_DIR@/packs/SdkTrays.zip + +# Resource locations to be added to the default path +[General] +@OGRE_RESOURCES_FileSystem@ diff --git a/CMakeModules/visp-config.bat.in b/cmake/templates/visp-config.bat.in similarity index 85% rename from CMakeModules/visp-config.bat.in rename to cmake/templates/visp-config.bat.in index 6c8167a2a1ea6010bba084da04fde55912679198..688a747005b1f7123912dab13013eb14c63ce2f5 100755 --- a/CMakeModules/visp-config.bat.in +++ b/cmake/templates/visp-config.bat.in @@ -1,10 +1,8 @@ @rem ############################################################################# @rem # -@rem # $Id: visp-config.bat.in 4961 2014-11-14 13:06:26Z fspindle $ -@rem # @rem # This file is part of the ViSP software. -@rem # Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -@rem # +@rem # Copyright (C) 2005 - 2015 by Inria. All rights reserved. +@rem # @rem # This software is free software; you can redistribute it and/or @rem # modify it under the terms of the GNU General Public License @rem # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ @rem # distribution for additional information about the GNU GPL. @rem # @rem # For using ViSP with software that can not be combined with the GNU -@rem # GPL, please contact INRIA about acquiring a ViSP Professional +@rem # GPL, please contact Inria about acquiring a ViSP Professional @rem # Edition License. @rem # -@rem # See http://www.irisa.fr/lagadic/visp/visp.html for more information. -@rem # +@rem # See http://visp.inria.fr for more information. +@rem # @rem # This software was developed at: -@rem # INRIA Rennes - Bretagne Atlantique +@rem # Inria Rennes - Bretagne Atlantique @rem # Campus Universitaire de Beaulieu @rem # 35042 Rennes Cedex @rem # France -@rem # http://www.irisa.fr/lagadic @rem # @rem # If you have questions regarding the use of this file, please contact -@rem # INRIA at visp@inria.fr -@rem # +@rem # Inria at visp@inria.fr +@rem # @rem # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE @rem # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @rem # -@rem # @rem # Description: @rem # visp-config.bat script for Windows. @rem # Auto-generated from visp-config.bat.in by cmake. @@ -106,7 +102,7 @@ for %%a in (%*) do ( if "%%a" == "--version" ( echo ViSP %VERSION% Visual Servoing Platform echo. - echo Copyright 2005 - 2014 Inria. All rights reserved. + echo Copyright 2005 - 2015 Inria. All rights reserved. goto END ) if "%%a" == "--dumpversion" ( @@ -118,7 +114,7 @@ for %%a in (%*) do ( :USAGE echo ViSP %VERSION% (Visual Servoing Platform) -echo Copyright (C) 2005 - 2014 Inria. All rights reserved. +echo Copyright (C) 2005 - 2015 Inria. All rights reserved. echo. echo Usage: %0 [--prefix] [--def] [--include] [--openmp] [--libpath] echo [--libs-debug] [--libs-optimized] [--version] [--dumpversion] [--help] @@ -135,4 +131,4 @@ echo --help Display this help and exit. echo. goto END -:End \ No newline at end of file +:End diff --git a/CMakeModules/visp-config.in b/cmake/templates/visp-config.in similarity index 83% rename from CMakeModules/visp-config.in rename to cmake/templates/visp-config.in index 8f11a5a85aa1a134c37ab5647fadc10807931c44..319d5260fca03037dabf5098e0717d605a3aeb69 100755 --- a/CMakeModules/visp-config.in +++ b/cmake/templates/visp-config.in @@ -2,11 +2,9 @@ ############################################################################# # -# $Id: visp-config.in 5043 2014-12-08 16:14:15Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -14,21 +12,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -61,7 +58,7 @@ usage() cat <<EOF ViSP $VERSION (Visual Servoing Platform) -Copyright (C) 2005 - 2014 Inria. All rights reserved. +Copyright (C) 2005 - 2015 Inria. All rights reserved. Usage: $0 [--prefix] [--cflags] [--libs] [--version] [--dumpversion] [--help] @@ -91,7 +88,7 @@ for arg in $@; do --version) echo "ViSP $VERSION (Visual Servoing Platform)" echo "" - echo "Copyright (C) 2005 - 2014 Inria. All rights reserved.";; + echo "Copyright (C) 2005 - 2015 Inria. All rights reserved.";; --dumpversion) echo $NO_NEWLINE_OPTION "$VERSION$NO_NEWLINE_CHARACTER";; *) usage; exit 0 ;; esac; diff --git a/CMakeModules/visp-config.install.in b/cmake/templates/visp-config.install.in similarity index 84% rename from CMakeModules/visp-config.install.in rename to cmake/templates/visp-config.install.in index 6bd8a10344adaff748c8eb8d7f9016fa67d452ef..e3f2cf4a63c88ad4d1ef9bc2e78e9be971e9be24 100755 --- a/CMakeModules/visp-config.install.in +++ b/cmake/templates/visp-config.install.in @@ -2,11 +2,9 @@ ############################################################################# # -# $Id: visp-config.in 4057 2013-01-05 13:10:29Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -14,21 +12,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -65,7 +62,7 @@ usage() cat <<EOF ViSP $VERSION (Visual Servoing Platform) -Copyright (C) 2005 - 2014 Inria. All rights reserved. +Copyright (C) 2005 - 2015 Inria. All rights reserved. Usage: $0 [--prefix] [--cflags] [--libs] [--version] [--dumpversion] [--help] @@ -95,7 +92,7 @@ for arg in $@; do --version) echo "ViSP $VERSION (Visual Servoing Platform)" echo "" - echo "Copyright (C) 2005 - 2014 Inria. All rights reserved.";; + echo "Copyright (C) 2005 - 2015 Inria. All rights reserved.";; --dumpversion) echo $NO_NEWLINE_OPTION "$VERSION$NO_NEWLINE_CHARACTER";; *) usage; exit 0 ;; esac; diff --git a/CMakeModules/visp.pc.in b/cmake/templates/visp.pc.in similarity index 87% rename from CMakeModules/visp.pc.in rename to cmake/templates/visp.pc.in index 4594265e00382b6e78d5b5a3288dcb5e4f069ffc..4941a6a97c841f8b279c907a990d960cbd6a06aa 100644 --- a/CMakeModules/visp.pc.in +++ b/cmake/templates/visp.pc.in @@ -7,7 +7,7 @@ includedir=@includedir@ Name: ViSP Description: Visual Servoing Platform -URL: http://team.inria.fr/lagadic/visp +URL: http://visp.inria.fr Version: ${VISP_VERSION} Libs: ${VISP_CONFIG_LIBS_PC} diff --git a/cmake/templates/visp_modules.h.in b/cmake/templates/visp_modules.h.in new file mode 100644 index 0000000000000000000000000000000000000000..408a36d308ceff83b83adb9920ed3fb497e26bdb --- /dev/null +++ b/cmake/templates/visp_modules.h.in @@ -0,0 +1,8 @@ +/* + * ** File generated automatically, do not modify ** + * + * This file defines the list of modules available in current build configuration + * +*/ + +@VISP_MODULE_DEFINITIONS_CONFIGMAKE@ diff --git a/include/vpConfig.h.cmake b/cmake/templates/vpConfig.h.in similarity index 85% rename from include/vpConfig.h.cmake rename to cmake/templates/vpConfig.h.in index 192b8467b2181d3842aab7e7cb507858400d3bd7..c1cf464dbcd5524228fd4d36e0923730c46f169d 100644 --- a/include/vpConfig.h.cmake +++ b/cmake/templates/vpConfig.h.in @@ -1,368 +1,411 @@ -/**************************************************************************** - * - * $Id: vpConfig.h.cmake 5324 2015-02-13 16:11:04Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Description: - * ViSP configuration. - * - * Authors: - * Fabien Spindler - * - *****************************************************************************/ - -#ifndef vpConfig_h -#define vpConfig_h - -#if defined _MSC_VER && _MSC_VER >= 1200 - #pragma warning( disable: 4100 4127 4251 4275 4514 4668 4710 4820 ) - #if _MSC_VER >= 1400 // 1400 = MSVC 8 2005 - #pragma warning( disable: 4548 ) - #endif - #if _MSC_VER > 1500 // 1500 = MSVC 9 2008 - #pragma warning( disable: 4986 ) - #endif - - // 4100 : undocumented ("unreferenced formal parameter") - // 4127 : conditional expression is constant - // 4251 : 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2', ie. disable warnings related to inline functions - // 4275 : non – DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' - // 4514 : 'function' : unreferenced inline function has been removed - // 4548 : expression before comma has no effect - // 4668 : 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives' - // 4710 : 'function' : function not inlined - // 4820 : 'bytes' bytes padding added after construct 'member_name' - // 4986 : undocumented -#endif - -#if defined _MSC_VER && (_MSC_VER == 1500) -// Visual Studio 9 2008 specific stuff -// Fix running 64-bit OpenMP Debug Builds compiled with Visual Studio 2008 SP1 -// See discussion on https://gforge.inria.fr/forum/message.php?msg_id=149273&group_id=397 -// and the proposed fix: http://www.johanseland.com/2010/08/running-64-bit-openmp-debug-builds.html -# define _BIND_TO_CURRENT_OPENMP_VERSION 1 -#endif - -#if defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__) -// Work arround to fix build issues that may occur with Mingw: -// error: 'DBL_EPSILON' was not declared in this scope -// error: 'FLT_EPSILON' was not declared in this scope - -# include <float.h> - -# ifndef DBL_EPSILON -# define DBL_EPSILON __DBL_EPSILON__ -# endif -# ifndef FLT_EPSILON -# define FLT_EPSILON __FLT_EPSILON__ -# endif -#endif - -// ViSP major version. -#define VISP_VERSION_MAJOR ${VISP_VERSION_MAJOR} - -// ViSP minor version. -#define VISP_VERSION_MINOR ${VISP_VERSION_MINOR} - -// ViSP patch version. -#define VISP_VERSION_PATCH ${VISP_VERSION_PATCH} - -// ViSP version with dots "${VISP_VERSION_MAJOR}.${VISP_VERSION_MINOR}.${VISP_VERSION_PATCH}". -#cmakedefine VISP_VERSION ${VISP_VERSION} - -// ViSP version as an integer -#define VP_VERSION_INT(a, b, c) (a<<16 | b<<8 | c) -#define VISP_VERSION_INT VP_VERSION_INT(VISP_VERSION_MAJOR, \ - VISP_VERSION_MINOR, \ - VISP_VERSION_PATCH) - -// ViSP library is either compiled static or shared -// Used to set declspec(import, export) in headers if required under Windows -#cmakedefine VISP_BUILD_SHARED_LIBS - -// Defined if deprecated functionalities are requested to build -#cmakedefine VISP_BUILD_DEPRECATED_FUNCTIONS - -// Defined if MSVC is the compiler -#cmakedefine VISP_USE_MSVC - -// Defined if X11 library available. -#cmakedefine VISP_HAVE_X11 - -// Defined if XML2 library available. -#cmakedefine VISP_HAVE_XML2 - -// Defined if pthread library available. -#cmakedefine VISP_HAVE_PTHREAD - -// Defined if YARP available. -#cmakedefine VISP_HAVE_YARP - -// Defined if OpenCV available. -#cmakedefine VISP_HAVE_OPENCV - -// Defined if OpenCV nonfree module available. Only with OpenCV < 3.0.0 -#cmakedefine VISP_HAVE_OPENCV_NONFREE - -// Defined if OpenCV xfeatures2d module available. Only since OpenCV >= 3.0.0 -#cmakedefine VISP_HAVE_OPENCV_XFEATURES2D - -// OpenCV version in hexadecimal (for example 2.1.0 gives 0x020100). -#ifdef VISP_HAVE_OPENCV -# define VISP_HAVE_OPENCV_VERSION ${VISP_HAVE_OPENCV_VERSION} -#endif - -// Defined if GTK2 library available -#cmakedefine VISP_HAVE_GTK - -// Defined if GDI (Graphics Device Interface) library available -#cmakedefine VISP_HAVE_GDI - -// Defined if Direct3D9 library available -#cmakedefine VISP_HAVE_D3D9 - -// Defined if one of the display device is available -#if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK) -# define VISP_HAVE_DISPLAY -#endif - -// Defined if GSL library available (-lgsl -lgslcblas). -#cmakedefine VISP_HAVE_GSL - -// Defined if lapack/blas libraries are available (-lblas -llapack). -#cmakedefine VISP_HAVE_LAPACK - -// Defined the path to the basic scenes used by the simulator -#cmakedefine VISP_SCENES_DIR "${VISP_SCENES_DIR}" - -// Defined the path to the robot's arms 3D model used by the robot simulators -#cmakedefine VISP_ROBOT_ARMS_DIR "${VISP_ROBOT_ARMS_DIR}" - -// Defined if Ogre3d is available. -#cmakedefine VISP_HAVE_OGRE - -// Defined if Ogre3d plugins.cfg is available. -#cmakedefine VISP_HAVE_OGRE_PLUGINS_PATH "${VISP_HAVE_OGRE_PLUGINS_PATH}" - -// Defined if Ogre3d resources.cfg is available. -#cmakedefine VISP_HAVE_OGRE_RESOURCES_PATH "${VISP_HAVE_OGRE_RESOURCES_PATH}" - -// Defined if OIS (Object Oriented Input System) library available. -#cmakedefine VISP_HAVE_OIS - -// Defined if Coin3D and one of the GUI (SoXt, SoWin, SoQt + Qt) -// libraries are available. -#cmakedefine VISP_HAVE_COIN_AND_GUI - -// Defined if Coin3D library available. -#cmakedefine VISP_HAVE_COIN - -// Defined if OpenGL library available. -#cmakedefine VISP_HAVE_OPENGL - -// Defined if Qt library available (either Qt-3 or Qt-4). -#cmakedefine VISP_HAVE_QT - -// Defined if SoQt library available. -#cmakedefine VISP_HAVE_SOQT - -// Defined if SoWin library available. -#cmakedefine VISP_HAVE_SOWIN - -// Defined if SoXt library available. -#cmakedefine VISP_HAVE_SOXT - -// Defined if libjpeg library available. -#cmakedefine VISP_HAVE_LIBJPEG - -// Defined if libpng library available. -#cmakedefine VISP_HAVE_LIBPNG - -// Defined if libfreenect, libusb-1.0 and libpthread libraries available. -#cmakedefine VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES - -// Defined if libfreenect library available. -#cmakedefine VISP_HAVE_LIBFREENECT - -// Defined if libfreenect library in an old version package for -// ubuntu 10.04 lucid is available. -// This is a workaround useful to initialise vpKinect depending on the -// libfreenect version -//#ifdef VISP_HAVE_LIBFREENECT_OLD -// Freenect::Freenect<vpKinect> freenect; -// vpKinect & kinect = freenect.createDevice(0); -//#else -// Freenect::Freenect freenect; -// vpKinect & kinect = freenect.createDevice<vpKinect>(0); -//#endif -#cmakedefine VISP_HAVE_LIBFREENECT_OLD - -// Defined if libusb-1.0 library available. -#cmakedefine VISP_HAVE_LIBUSB_1 - -// Defined if ffmpeg library available. -#cmakedefine VISP_HAVE_FFMPEG - -// Defined if raw1394 and dc1394-2.x libraries available. -#cmakedefine VISP_HAVE_DC1394_2 - -// Defined if dc1394_camera_enumerate() is available in dc1394-2.x. -// dc1394_camera_enumerate() was introduced after libdc1394-2.0.0-rc7. -#cmakedefine VISP_HAVE_DC1394_2_CAMERA_ENUMERATE - -// Defined if dc1394_find_cameras() is available in dc1394-2.x -// dc1394_find_cameras() is still present until libdc1394-2.0.0-rc7. -// This function was suppress and replace by dc1394_camera_enumerate() -// in more recent releases. -#cmakedefine VISP_HAVE_DC1394_2_FIND_CAMERAS - -// Defined if CMU 1394 Digital Camera SDK available. -#cmakedefine VISP_HAVE_CMU1394 - -// Defined if Video For Linux Two available. -#cmakedefine VISP_HAVE_V4L2 - -// Defined if DirectShow library is available (only under Windows). -#cmakedefine VISP_HAVE_DIRECTSHOW - -// Defined if Irisa's Afma4 robot available. -#cmakedefine VISP_HAVE_AFMA4 - -// Defined if Irisa's Afma6 robot available. -#cmakedefine VISP_HAVE_AFMA6 - -// Defined if Biclops pan-tilt head available. -#cmakedefine VISP_HAVE_BICLOPS -#cmakedefine VISP_HAVE_BICLOPS_AND_GET_HOMED_STATE_FUNCTION - -// Defined if Irisa's Ptu-46 pan-tilt head available. -#cmakedefine VISP_HAVE_PTU46 - -// Defined if Irisa's Viper S650 robot available. -#cmakedefine VISP_HAVE_VIPER650 - -// Defined if Irisa's Viper S850 robot available. -#cmakedefine VISP_HAVE_VIPER850 - -// Defined if the Aria library and (pthread, rt, dl libraries under Unix) is found. -// These libraries are used to control Pioneer mobile robots. -#cmakedefine VISP_HAVE_PIONEER - -// Defined if linux/parport.h is available for parallel port usage. -#cmakedefine VISP_HAVE_PARPORT - -// Defined if libzbar is available for bar code detection -#cmakedefine VISP_HAVE_ZBAR - -// Defined if libdmtx is available for bar code detection -#cmakedefine VISP_HAVE_DMTX - -// Defined if Inria's NAS server hosting /udd/ is available -// Used for the moment in vpAfma6 class to check if config files are -// available in /udd/fspindle/robot/Afma6/current/include/ -#cmakedefine VISP_HAVE_ACCESS_TO_NAS - -// Defined if Doxygen documentation tool is found -#cmakedefine VISP_HAVE_DOXYGEN - -// Defined if dot documentation tool used by Doxygen is found -#cmakedefine VISP_HAVE_DOT - -// Defined if we want to compute interaction matrices by combining -// other interaction matrices -#cmakedefine VISP_MOMENTS_COMBINE_MATRICES - -//Defined if we want to use openmp -#cmakedefine VISP_HAVE_OPENMP - -//Defined if we want to use c++ 11 -#cmakedefine VISP_HAVE_CPP11_COMPATIBILITY - -// Handle portable symbol export. -// Defining manually which symbol should be exported is required -// under Windows whether MinGW or MSVC is used. -// -// The headers then have to be able to work in two different modes: -// - dllexport when one is building the library, -// - dllimport for clients using the library. -// -// On Linux, set the visibility accordingly. If C++ symbol visibility -// is handled by the compiler, see: http://gcc.gnu.org/wiki/Visibility -# if defined(_WIN32) || defined(__CYGWIN__) -// On Microsoft Windows, use dllimport and dllexport to tag symbols. -# define VISP_DLLIMPORT __declspec(dllimport) -# define VISP_DLLEXPORT __declspec(dllexport) -# define VISP_DLLLOCAL -# else -// On Linux, for GCC >= 4, tag symbols using GCC extension. -# if __GNUC__ >= 4 -# define VISP_DLLIMPORT __attribute__ ((visibility("default"))) -# define VISP_DLLEXPORT __attribute__ ((visibility("default"))) -# define VISP_DLLLOCAL __attribute__ ((visibility("hidden"))) -# else -// Otherwise (GCC < 4 or another compiler is used), export everything. -# define VISP_DLLIMPORT -# define VISP_DLLEXPORT -# define VISP_DLLLOCAL -# endif // __GNUC__ >= 4 -# endif // defined(_WIN32) || defined(__CYGWIN__) - -// Under Windows, for shared libraries (DLL) we need to define export on -// compilation or import on use (like a third party project). -// We exploit here the fact that cmake auto set xxx_EXPORTS (with S) on -// compilation. -#if defined(VISP_BUILD_SHARED_LIBS) -// Depending on whether one is building or using the -// library define VISP_EXPORT to import or export. -# ifdef visp_EXPORTS -# define VISP_EXPORT VISP_DLLEXPORT -# else -# define VISP_EXPORT VISP_DLLIMPORT -# endif -# define VISP_LOCAL VISP_DLLLOCAL -#else -// If one is using the library statically, get rid of -// extra information. -# define VISP_EXPORT -# define VISP_LOCAL -#endif - -// Add the material to produce a warning when deprecated functions are used -#ifndef vp_deprecated -# if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX -# define vp_deprecated __attribute__((deprecated)) -# else -# define vp_deprecated __declspec(deprecated) -# endif -#endif - -#endif - - +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * ViSP configuration. + * + * Authors: + * Fabien Spindler + * + *****************************************************************************/ + +#ifndef vpConfig_h +#define vpConfig_h + +#if defined _MSC_VER && _MSC_VER >= 1200 + #pragma warning( disable: 4100 4127 4251 4275 4514 4668 4710 4820 ) + #if _MSC_VER >= 1400 // 1400 = MSVC 8 2005 + #pragma warning( disable: 4548 ) + #endif + #if _MSC_VER > 1500 // 1500 = MSVC 9 2008 + #pragma warning( disable: 4986 ) + #endif + + // 4100 : undocumented ("unreferenced formal parameter") + // 4127 : conditional expression is constant + // 4251 : 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2', ie. disable warnings related to inline functions + // 4275 : non – DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier' + // 4514 : 'function' : unreferenced inline function has been removed + // 4548 : expression before comma has no effect + // 4668 : 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives' + // 4710 : 'function' : function not inlined + // 4820 : 'bytes' bytes padding added after construct 'member_name' + // 4986 : undocumented +#endif + +#if defined _MSC_VER && (_MSC_VER == 1500) +// Visual Studio 9 2008 specific stuff +// Fix running 64-bit OpenMP Debug Builds compiled with Visual Studio 2008 SP1 +// See discussion on https://gforge.inria.fr/forum/message.php?msg_id=149273&group_id=397 +// and the proposed fix: http://www.johanseland.com/2010/08/running-64-bit-openmp-debug-builds.html +# define _BIND_TO_CURRENT_OPENMP_VERSION 1 +#endif + +#if defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__) +// Work arround to fix build issues that may occur with Mingw: +// error: 'DBL_EPSILON' was not declared in this scope +// error: 'FLT_EPSILON' was not declared in this scope + +# include <float.h> + +# ifndef DBL_EPSILON +# define DBL_EPSILON __DBL_EPSILON__ +# endif +# ifndef FLT_EPSILON +# define FLT_EPSILON __FLT_EPSILON__ +# endif +#endif + +#include <visp3/visp_modules.h> + +// ViSP major version. +#define VISP_VERSION_MAJOR ${VISP_VERSION_MAJOR} + +// ViSP minor version. +#define VISP_VERSION_MINOR ${VISP_VERSION_MINOR} + +// ViSP patch version. +#define VISP_VERSION_PATCH ${VISP_VERSION_PATCH} + +// ViSP version with dots "${VISP_VERSION_MAJOR}.${VISP_VERSION_MINOR}.${VISP_VERSION_PATCH}". +#cmakedefine VISP_VERSION ${VISP_VERSION} + +// ViSP version as an integer +#define VP_VERSION_INT(a, b, c) (a<<16 | b<<8 | c) +#define VISP_VERSION_INT VP_VERSION_INT(VISP_VERSION_MAJOR, \ + VISP_VERSION_MINOR, \ + VISP_VERSION_PATCH) + +// ViSP library is either compiled static or shared +// Used to set declspec(import, export) in headers if required under Windows +#cmakedefine VISP_BUILD_SHARED_LIBS + +// Defined if deprecated functionalities are requested to build +#cmakedefine VISP_BUILD_DEPRECATED_FUNCTIONS + +// Defined if MSVC is the compiler +#cmakedefine VISP_USE_MSVC + +// Defined if X11 library available. +#cmakedefine VISP_HAVE_X11 + +// Defined if XML2 library available. +#cmakedefine VISP_HAVE_XML2 + +// Defined if pthread library available. +#cmakedefine VISP_HAVE_PTHREAD + +// Defined if YARP available. +#cmakedefine VISP_HAVE_YARP + +// Defined if OpenCV available. +#cmakedefine VISP_HAVE_OPENCV + +// Defined if OpenCV nonfree module available. Only with OpenCV < 3.0.0 +#cmakedefine VISP_HAVE_OPENCV_NONFREE + +// Defined if OpenCV xfeatures2d module available. Only since OpenCV >= 3.0.0 +#cmakedefine VISP_HAVE_OPENCV_XFEATURES2D + +// OpenCV version in hexadecimal (for example 2.1.0 gives 0x020100). +#ifdef VISP_HAVE_OPENCV +# define VISP_HAVE_OPENCV_VERSION ${VISP_HAVE_OPENCV_VERSION} +#endif + +// Defined if GTK2 library available +#cmakedefine VISP_HAVE_GTK + +// Defined if GDI (Graphics Device Interface) library available +#cmakedefine VISP_HAVE_GDI + +// Defined if Direct3D9 library available +#cmakedefine VISP_HAVE_D3D9 + +// Defined if one of the display device is available +#if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK) +# define VISP_HAVE_DISPLAY +#endif + +// Defined if GSL library available (-lgsl -lgslcblas). +#cmakedefine VISP_HAVE_GSL + +// Defined if lapack/blas libraries are available (-lblas -llapack). +#cmakedefine VISP_HAVE_LAPACK_C + +// Defined the path to the basic scenes used by the simulator +#cmakedefine VISP_SCENES_DIR "${VISP_SCENES_DIR}" + +// Defined the path to the robot's arms 3D model used by the robot simulators +#cmakedefine VISP_ROBOT_ARMS_DIR "${VISP_ROBOT_ARMS_DIR}" + +// Defined if Ogre3d is available. +#cmakedefine VISP_HAVE_OGRE + +// Defined if Ogre3d plugins.cfg is available. +#cmakedefine VISP_HAVE_OGRE_PLUGINS_PATH "${VISP_HAVE_OGRE_PLUGINS_PATH}" + +// Defined if Ogre3d resources.cfg is available. +#cmakedefine VISP_HAVE_OGRE_RESOURCES_PATH "${VISP_HAVE_OGRE_RESOURCES_PATH}" + +// Defined if OIS (Object Oriented Input System) library available. +#cmakedefine VISP_HAVE_OIS + +// Defined if Coin3D and one of the GUI (SoXt, SoWin, SoQt + Qt) +// libraries are available. +#cmakedefine VISP_HAVE_COIN3D_AND_GUI +// provided for compat with previous releases +#ifdef VISP_HAVE_COIN3D_AND_GUI +# define VISP_HAVE_COIN_AND_GUI +#endif + +// Defined if Coin3D library available. +#cmakedefine VISP_HAVE_COIN3D +// provided for compat with previous releases +#ifdef VISP_HAVE_COIN3D +# define VISP_HAVE_COIN +#endif + +// Defined if OpenGL library available. +#cmakedefine VISP_HAVE_OPENGL + +// Defined if Qt library available (either Qt-3 or Qt-4). +#cmakedefine VISP_HAVE_QT + +// Defined if SoQt library available. +#cmakedefine VISP_HAVE_SOQT + +// Defined if SoWin library available. +#cmakedefine VISP_HAVE_SOWIN + +// Defined if SoXt library available. +#cmakedefine VISP_HAVE_SOXT + +// Defined if libjpeg library available. +#cmakedefine VISP_HAVE_JPEG +#ifdef VISP_HAVE_JPEG +# define VISP_HAVE_LIBJPEG +#endif + +// Defined if libpng library available. +#cmakedefine VISP_HAVE_PNG +#ifdef VISP_HAVE_PNG +# define VISP_HAVE_LIBPNG +#endif + +// Defined if libfreenect, libusb-1.0 and libpthread libraries available. +#cmakedefine VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES + +// Defined if libfreenect library available. +#cmakedefine VISP_HAVE_LIBFREENECT + +// Defined if libfreenect library in an old version package for +// ubuntu 10.04 lucid is available. +// This is a workaround useful to initialise vpKinect depending on the +// libfreenect version +//#ifdef VISP_HAVE_LIBFREENECT_OLD +// Freenect::Freenect<vpKinect> freenect; +// vpKinect & kinect = freenect.createDevice(0); +//#else +// Freenect::Freenect freenect; +// vpKinect & kinect = freenect.createDevice<vpKinect>(0); +//#endif +#cmakedefine VISP_HAVE_LIBFREENECT_OLD + +// Defined if libusb-1.0 library available. +#cmakedefine VISP_HAVE_LIBUSB_1 + +// Defined if ffmpeg library available. +#cmakedefine VISP_HAVE_FFMPEG + +// Defined if raw1394 and dc1394-2.x libraries available. +#cmakedefine VISP_HAVE_DC1394 +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(VISP_HAVE_DC1394) +# define VISP_HAVE_DC1394_2 +#endif + +// Defined if dc1394_camera_enumerate() is available in dc1394-2.x. +// dc1394_camera_enumerate() was introduced after libdc1394-2.0.0-rc7. +#cmakedefine VISP_HAVE_DC1394_CAMERA_ENUMERATE +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(VISP_HAVE_DC1394_CAMERA_ENUMERATE) +# define VISP_HAVE_DC1394_2_CAMERA_ENUMERATE +#endif + +// Defined if dc1394_find_cameras() is available in dc1394-2.x +// dc1394_find_cameras() is still present until libdc1394-2.0.0-rc7. +// This function was suppress and replace by dc1394_camera_enumerate() +// in more recent releases. +#cmakedefine VISP_HAVE_DC1394_FIND_CAMERAS +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) && defined(VISP_HAVE_DC1394_FIND_CAMERAS) +# define VISP_HAVE_DC1394_2_FIND_CAMERAS +#endif + +// Defined if CMU 1394 Digital Camera SDK available. +#cmakedefine VISP_HAVE_CMU1394 + +// Defined if Video For Linux Two available. +#cmakedefine VISP_HAVE_V4L2 + +// Defined if DirectShow library is available (only under Windows). +#cmakedefine VISP_HAVE_DIRECTSHOW + +// Defined if Irisa's Afma4 robot available. +#cmakedefine VISP_HAVE_AFMA4 + +// Defined if Irisa's Afma6 robot available. +#cmakedefine VISP_HAVE_AFMA6 + +// Defined if Biclops pan-tilt head available. +#cmakedefine VISP_HAVE_BICLOPS +#cmakedefine VISP_HAVE_BICLOPS_AND_GET_HOMED_STATE_FUNCTION + +// Defined if Irisa's Ptu-46 pan-tilt head available. +#cmakedefine VISP_HAVE_PTU46 + +// Defined if Irisa's Viper S650 robot available. +#cmakedefine VISP_HAVE_VIPER650 + +// Defined if Irisa's Viper S850 robot available. +#cmakedefine VISP_HAVE_VIPER850 + +// Defined if the Aria library and (pthread, rt, dl libraries under Unix) is found. +// These libraries are used to control Pioneer mobile robots. +#cmakedefine VISP_HAVE_PIONEER + +// Defined if linux/parport.h is available for parallel port usage. +#cmakedefine VISP_HAVE_PARPORT + +// Defined if libzbar is available for bar code detection +#cmakedefine VISP_HAVE_ZBAR + +// Defined if libdmtx is available for bar code detection +#cmakedefine VISP_HAVE_DMTX + +// Defined if Inria's NAS server hosting /udd/ is available +// Used for the moment in vpAfma6 class to check if config files are +// available in /udd/fspindle/robot/Afma6/current/include/ +#cmakedefine VISP_HAVE_ACCESS_TO_NAS + +// Defined if Doxygen documentation tool is found +#cmakedefine VISP_HAVE_DOXYGEN + +// Defined if we want to compute interaction matrices by combining +// other interaction matrices +#cmakedefine VISP_MOMENTS_COMBINE_MATRICES + +//Defined if we want to use openmp +#cmakedefine VISP_HAVE_OPENMP + +//Defined if we want to use c++ 11 +#cmakedefine VISP_HAVE_CPP11_COMPATIBILITY + +// Defined if isnan macro is available +#cmakedefine VISP_HAVE_FUNC_ISNAN + +// Defined if std::isnan function is available +#cmakedefine VISP_HAVE_FUNC_STD_ISNAN + +// Defined if _isnan (Microsoft version) is available +#cmakedefine VISP_HAVE_FUNC__ISNAN + +// Defined if isinf macro is available +#cmakedefine VISP_HAVE_FUNC_ISINF + +// Defined if std::isinf function is available +#cmakedefine VISP_HAVE_FUNC_STD_ISINF + +// Defined if _finite (Microsoft version) function is available +#cmakedefine VISP_HAVE_FUNC__FINITE + +// Defined if round function is available +#cmakedefine VISP_HAVE_FUNC_ROUND + +// Defined if std::round function is available +#cmakedefine VISP_HAVE_FUNC_STD_ROUND + +// Handle portable symbol export. +// Defining manually which symbol should be exported is required +// under Windows whether MinGW or MSVC is used. +// +// The headers then have to be able to work in two different modes: +// - dllexport when one is building the library, +// - dllimport for clients using the library. +// +// On Linux, set the visibility accordingly. If C++ symbol visibility +// is handled by the compiler, see: http://gcc.gnu.org/wiki/Visibility +# if defined(_WIN32) || defined(__CYGWIN__) +// On Microsoft Windows, use dllimport and dllexport to tag symbols. +# define VISP_DLLIMPORT __declspec(dllimport) +# define VISP_DLLEXPORT __declspec(dllexport) +# define VISP_DLLLOCAL +# else +// On Linux, for GCC >= 4, tag symbols using GCC extension. +# if __GNUC__ >= 4 +# define VISP_DLLIMPORT __attribute__ ((visibility("default"))) +# define VISP_DLLEXPORT __attribute__ ((visibility("default"))) +# define VISP_DLLLOCAL __attribute__ ((visibility("hidden"))) +# else +// Otherwise (GCC < 4 or another compiler is used), export everything. +# define VISP_DLLIMPORT +# define VISP_DLLEXPORT +# define VISP_DLLLOCAL +# endif // __GNUC__ >= 4 +# endif // defined(_WIN32) || defined(__CYGWIN__) + +// Under Windows, for shared libraries (DLL) we need to define export on +// compilation or import on use (like a third party project). +// We exploit here the fact that cmake auto set xxx_EXPORTS (with S) on +// compilation. +#if defined(VISP_BUILD_SHARED_LIBS) +// Depending on whether one is building or using the +// library define VISP_EXPORT to import or export. +# ifdef visp_EXPORTS +# define VISP_EXPORT VISP_DLLEXPORT +# else +# define VISP_EXPORT VISP_DLLIMPORT +# endif +# define VISP_LOCAL VISP_DLLLOCAL +#else +// If one is using the library statically, get rid of +// extra information. +# define VISP_EXPORT +# define VISP_LOCAL +#endif + +// Add the material to produce a warning when deprecated functions are used +#ifndef vp_deprecated +# if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX +# define vp_deprecated __attribute__((deprecated)) +# else +# define vp_deprecated __declspec(deprecated) +# endif +#endif + +#endif + + diff --git a/cmake/templates/vpHeader.h.in b/cmake/templates/vpHeader.h.in new file mode 100644 index 0000000000000000000000000000000000000000..128c4db52a35f68fef88f2d41419352bc20ecff7 --- /dev/null +++ b/cmake/templates/vpHeader.h.in @@ -0,0 +1,6 @@ +/* + * ** File generated automatically, do not modify ** + * +*/ + +@VISP_HEADER_CONTENT_CONFIGMAKE@ diff --git a/demo/CMakeLists.txt b/demo/CMakeLists.txt index 3d98dfad389d052277f2603a5d5f7935b7cd2a36..bd0b505008349456f8a1af5e9051fb05f8872d03 100644 --- a/demo/CMakeLists.txt +++ b/demo/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,14 +35,31 @@ # ############################################################################# -# Set SRC_SUBDIRS variable to all the sub directories we want to parse during -# the build process. -# -# If you add/remove a directory, modify here -SET (SRC_SUBDIRS - wireframe-simulator -) +project(ViSP-demo) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP) + +if(MSVC) + if(NOT VISP_SHARED) + foreach(flag_var + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + if(${flag_var} MATCHES "/MD") + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endif() + if(${flag_var} MATCHES "/MDd") + string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}") + endif() + endforeach(flag_var) -# Build process propagation in the sub directories -SUBDIRS(${SRC_SUBDIRS}) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib") + set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libcmtd.lib") + endif() +endif() +visp_add_subdirectory(wireframe-simulator REQUIRED_DEPS visp_core visp_robot visp_vs visp_io visp_gui) diff --git a/demo/wireframe-simulator/CMakeLists.txt b/demo/wireframe-simulator/CMakeLists.txt index ff71aa1addab651a1d4e75048f7293fab3b071c1..3337c239eabf2402825ecaeb60fac682b17c3149 100644 --- a/demo/wireframe-simulator/CMakeLists.txt +++ b/demo/wireframe-simulator/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,42 +35,27 @@ # ############################################################################# +project(demo-wireframe-simulator) + +cmake_minimum_required(VERSION 2.8) + +find_package(VISP REQUIRED visp_core visp_robot visp_vs visp_io visp_gui) + # SOURCE variable corresponds to the list of all the sources to build binaries. # The generate binary comes by removing the .cpp extension to # the source name. # # If you want to add/remove a source, modify here -set (SOURCE +set(demo_cpp servoSimu4Points.cpp servoSimuCylinder.cpp servoSimuSphere.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - add_dependencies(visp_demos ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "demos") - endif() - - if(UNIX) - install(TARGETS ${binary} - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/visp-${VISP_VERSION}/demo/wireframe-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE - OWNER_WRITE) - else() - install(TARGETS ${binary} - DESTINATION demo/wireframe-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE - OWNER_WRITE) +foreach(cpp ${demo_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "demos") endif() endforeach() diff --git a/demo/wireframe-simulator/servoSimu4Points.cpp b/demo/wireframe-simulator/servoSimu4Points.cpp index 1e2fbbfeaa453e1464f2ed2b60ed430c8e810dc9..5b1408e832b3f1af72d21e16daab1b1981f15d23 100644 --- a/demo/wireframe-simulator/servoSimu4Points.cpp +++ b/demo/wireframe-simulator/servoSimu4Points.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimu4Points.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Demonstration of the wireframe simulator with a simple visual servoing * @@ -47,25 +43,25 @@ #include <stdlib.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> -#include <visp/vpTime.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpWireFrameSimulator.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/core/vpTime.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/robot/vpWireFrameSimulator.h> #define GETOPTARGS "dh" @@ -226,9 +222,8 @@ main(int argc, const char ** argv) // Set initial position of the object in the world frame vpHomogeneousMatrix wMo(0.0,0.0,0.2,0,0,0); // Position of the camera in the world frame - vpHomogeneousMatrix wMc, cMw; + vpHomogeneousMatrix wMc; wMc = wMo * cMo.inverse(); - cMw = wMc.inverse(); //The four point used as visual features vpPoint point[4] ; @@ -382,7 +377,7 @@ main(int argc, const char ** argv) robot.get_eJe(eJe) ; task.set_eJe(eJe) ; - robot.getPosition(wMc) ; + wMc = robot.getPosition() ; cMo = wMc.inverse() * wMo; for (int i = 0 ; i < 4 ; i++) { diff --git a/demo/wireframe-simulator/servoSimuCylinder.cpp b/demo/wireframe-simulator/servoSimuCylinder.cpp index 6e3fd3522514d3c2f1d7557ec01776e2ac65d61b..b436098551cfe2a2da10e95552825049f3a294ac 100644 --- a/demo/wireframe-simulator/servoSimuCylinder.cpp +++ b/demo/wireframe-simulator/servoSimuCylinder.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuCylinder.cpp 4659 2014-02-09 14:11:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Demonstration of the wireframe simulator with a simple visual servoing * @@ -48,25 +44,25 @@ #include <stdlib.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpCylinder.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpServo.h> -#include <visp/vpTime.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpWireFrameSimulator.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpCylinder.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/vs/vpServo.h> +#include <visp3/core/vpTime.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/robot/vpWireFrameSimulator.h> #define GETOPTARGS "dh" @@ -194,7 +190,7 @@ main(int argc, const char ** argv) } vpServo task; - vpRobotCamera robot ; + vpSimulatorCamera robot ; float sampling_time = 0.040f; // Sampling period in second robot.setSamplingTime(sampling_time); @@ -205,9 +201,8 @@ main(int argc, const char ** argv) // Set initial position of the object in the world frame vpHomogeneousMatrix wMo(0.0,0.0,0,0,0,0); // Position of the camera in the world frame - vpHomogeneousMatrix wMc, cMw; + vpHomogeneousMatrix wMc; wMc = wMo * cMo.inverse(); - cMw = wMc.inverse(); // Create a cylinder vpCylinder cylinder(0,0,1,0,0,0,0.1); @@ -288,7 +283,7 @@ main(int argc, const char ** argv) while (!vpDisplay::getClick(Iint,false) && !vpDisplay::getClick(Iext,false)){}; } - robot.setPosition( cMw ); + robot.setPosition( wMc ); //Print the task task.print(); @@ -319,8 +314,8 @@ main(int argc, const char ** argv) robot.get_eJe(eJe) ; task.set_eJe(eJe) ; - robot.getPosition(cMw) ; - cMo = cMw * wMo; + wMc = robot.getPosition(); + cMo = wMc.inverse() * wMo; cylinder.track(cMo) ; vpFeatureBuilder::create(l[0], cylinder, vpCylinder::line1); diff --git a/demo/wireframe-simulator/servoSimuSphere.cpp b/demo/wireframe-simulator/servoSimuSphere.cpp index b26af02a42ad1852e1ff42641f178f1b1acf1b1d..8e0b0fe19d9500386d44b63787c125ba157f21e1 100644 --- a/demo/wireframe-simulator/servoSimuSphere.cpp +++ b/demo/wireframe-simulator/servoSimuSphere.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuSphere.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Demonstration of the wireframe simulator with a simple visual servoing * @@ -49,26 +45,26 @@ #include <cmath> // std::fabs #include <limits> // numeric_limits -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpGenericFeature.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpServo.h> -#include <visp/vpSphere.h> -#include <visp/vpTime.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpWireFrameSimulator.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpGenericFeature.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/vs/vpServo.h> +#include <visp3/core/vpSphere.h> +#include <visp3/core/vpTime.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/robot/vpWireFrameSimulator.h> #define GETOPTARGS "dh" @@ -255,7 +251,7 @@ main(int argc, const char ** argv) } vpServo task; - vpRobotCamera robot ; + vpSimulatorCamera robot ; float sampling_time = 0.040f; // Sampling period in second robot.setSamplingTime(sampling_time); @@ -270,11 +266,10 @@ main(int argc, const char ** argv) // Set initial position of the object in the world frame vpHomogeneousMatrix wMo(0.0,0.0,0,0,0,0); // Position of the camera in the world frame - vpHomogeneousMatrix wMc, cMw; + vpHomogeneousMatrix wMc; wMc = wMo * cMo.inverse(); - cMw = wMc.inverse(); - robot.setPosition( cMw ); + robot.setPosition( wMc ); //The sphere vpSphere sphere(0,0,0,0.15); @@ -385,8 +380,8 @@ main(int argc, const char ** argv) robot.get_eJe(eJe) ; task.set_eJe(eJe) ; - robot.getPosition(cMw) ; - cMo = cMw * wMo; + wMc = robot.getPosition() ; + cMo = wMc.inverse() * wMo; sphere.track(cMo); diff --git a/doc/biblio/references.bib b/doc/biblio/references.bib index e651b967ef7701a4811910653523772d0ec5f4fb..7afecccddb0d631fadabf8d06d1b2918d0d5e597 100644 --- a/doc/biblio/references.bib +++ b/doc/biblio/references.bib @@ -375,3 +375,31 @@ x-advisor = {Chaumette, F.}, address = {New York, NY, USA}, } +@inproceedings{Marey:2010, + TITLE = {{A new large projection operator for the redundancy framework}}, + AUTHOR = {Marey, Mohammed and Chaumette, Francois}, + URL = {https://hal.inria.fr/inria-00544789}, + BOOKTITLE = {{IEEE Int. Conf. on Robotics and Automation, ICRA'10}}, + ADDRESS = {Anchorage, Alaska, United States}, + PAGES = {3727-3732}, + YEAR = {2010}, + KEYWORDS = {Visual Servoing}, + PDF = {https://hal.inria.fr/inria-00544789/file/2010_icra_marey.pdf}, + HAL_ID = {inria-00544789}, + HAL_VERSION = {v1}, +} + +@inproceedings{Marey:2010b, + TITLE = {{New strategies for avoiding robot joint limits: Application to visual servoing using a large projection operator}}, + AUTHOR = {Marey, Mohammed and Chaumette, Fran{\c c}ois}, + URL = {https://hal.inria.fr/inria-00544790}, + BOOKTITLE = {{IEEE/RSJ Int. Conf. on Intelligent Robots and Systems, IROS'10}}, + ADDRESS = {Taipei, Taiwan, Taiwan}, + PAGES = {6222-6227}, + YEAR = {2010}, + PDF = {https://hal.inria.fr/inria-00544790/file/2010_iros_marey.pdf}, + HAL_ID = {inria-00544790}, + HAL_VERSION = {v1}, +} + + diff --git a/doc/config-doxygen.in b/doc/config-doxygen.in index 2a21e8e21501eddda0cdb43edfd0d552c6c34297..fbd86bd143366805d2b7736ba870cab5596c6b9e 100644 --- a/doc/config-doxygen.in +++ b/doc/config-doxygen.in @@ -32,7 +32,7 @@ PROJECT_NAME = ViSP # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = +PROJECT_NUMBER = "@VISP_VERSION@" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer @@ -45,7 +45,7 @@ PROJECT_BRIEF = # exceed 55 pixels and the maximum width should not exceed 200 pixels. # Doxygen will copy the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = "@VISP_SOURCE_DIR@/doc/image/img-logo-visp.png" # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. @@ -61,7 +61,7 @@ OUTPUT_DIRECTORY = doc # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. -CREATE_SUBDIRS = YES +CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this @@ -130,7 +130,7 @@ FULL_PATH_NAMES = YES # relative paths, which will be relative from the directory where doxygen is # started. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells @@ -139,7 +139,22 @@ STRIP_FROM_PATH = # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = "@VISP_SOURCE_DIR@/modules/ar/include" \ + "@VISP_SOURCE_DIR@/modules/core/include" \ + "@VISP_SOURCE_DIR@/modules/detection/include" \ + "@VISP_SOURCE_DIR@/modules/gui/include" \ + "@VISP_SOURCE_DIR@/modules/io/include" \ + "@VISP_SOURCE_DIR@/modules/robot/include" \ + "@VISP_SOURCE_DIR@/modules/sensor/include" \ + "@VISP_SOURCE_DIR@/modules/tracker/blob/include" \ + "@VISP_SOURCE_DIR@/modules/tracker/klt/include" \ + "@VISP_SOURCE_DIR@/modules/tracker/mbt/include" \ + "@VISP_SOURCE_DIR@/modules/tracker/me/include" \ + "@VISP_SOURCE_DIR@/modules/tracker/tt/include" \ + "@VISP_SOURCE_DIR@/modules/tracker/tt_mi/include" \ + "@VISP_SOURCE_DIR@/modules/vision/include" \ + "@VISP_SOURCE_DIR@/modules/visual_features/include" + "@VISP_SOURCE_DIR@/modules/vs/include" # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful if your file system @@ -667,13 +682,13 @@ WARN_LOGFILE = warning.log # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = "@VISP_SOURCE_DIR@/src" \ +INPUT = "@VISP_SOURCE_DIR@/modules" \ "@VISP_SOURCE_DIR@/example" \ "@VISP_SOURCE_DIR@/tutorial" \ "@VISP_SOURCE_DIR@/demo" \ - "@VISP_SOURCE_DIR@/test" \ "@VISP_SOURCE_DIR@/doc" \ - "@VISP_BINARY_DIR@/doc" + "@VISP_BINARY_DIR@/doc" \ + "@VISP_CONTRIB_MODULES_PATH@" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is @@ -738,7 +753,7 @@ EXCLUDE_SYMBOLS = EXAMPLE_PATH = "@VISP_SOURCE_DIR@/example" \ "@VISP_SOURCE_DIR@/tutorial" \ "@VISP_SOURCE_DIR@/demo" \ - "@VISP_SOURCE_DIR@/test" + "@VISP_SOURCE_DIR@/modules" # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp @@ -972,7 +987,7 @@ HTML_COLORSTYLE_GAMMA = 80 # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. -HTML_TIMESTAMP = YES +HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the @@ -1550,7 +1565,7 @@ PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \ VISP_HAVE_D3D9 \ VISP_HAVE_GSL \ VISP_HAVE_DISPLAY \ - VISP_HAVE_LAPACK \ + VISP_HAVE_LAPACK_C \ VISP_HAVE_OPENCV \ VISP_HAVE_OPENCV_NONFREE \ VISP_HAVE_OPENCV_VERSION=0x020408 \ @@ -1558,14 +1573,14 @@ PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \ VISP_HAVE_OGRE_PLUGINS_PATH \ VISP_HAVE_OGRE_RESOURCES_PATH \ VISP_HAVE_OIS \ - VISP_HAVE_COIN_AND_GUI \ - VISP_HAVE_COIN \ + VISP_HAVE_COIN3D_AND_GUI \ + VISP_HAVE_COIN3D \ VISP_HAVE_OPENGL \ VISP_HAVE_QT \ VISP_HAVE_SOQT \ VISP_HAVE_SOWIN \ VISP_HAVE_SOXT \ - VISP_HAVE_DC1394_2 \ + VISP_HAVE_DC1394 \ VISP_HAVE_CMU1394 \ VISP_HAVE_V4L2 \ VISP_HAVE_DIRECTSHOW \ @@ -1578,8 +1593,8 @@ PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \ VISP_HAVE_PIONEER \ VISP_HAVE_PARPORT \ VISP_HAVE_XML2 \ - VISP_HAVE_LIBJPEG \ - VISP_HAVE_LIBPNG \ + VISP_HAVE_JPEG \ + VISP_HAVE_PNG \ VISP_HAVE_FFMPEG \ VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES \ VISP_HAVE_LIBFREENECT \ @@ -1589,12 +1604,30 @@ PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \ VISP_HAVE_DMTX \ VISP_HAVE_ACCESS_TO_NAS \ VISP_HAVE_CPP11_COMPATIBILITY \ + VISP_HAVE_MODULE_AR \ + VISP_HAVE_MODULE_CORE \ + VISP_HAVE_MODULE_DETECTION \ + VISP_HAVE_MODULE_GUI \ + VISP_HAVE_MODULE_IO \ + VISP_HAVE_MODULE_ROBOT \ + VISP_HAVE_MODULE_SENSOR \ + VISP_HAVE_MODULE_BLOB \ + VISP_HAVE_MODULE_KLT \ + VISP_HAVE_MODULE_MBT \ + VISP_HAVE_MODULE_ME \ + VISP_HAVE_MODULE_TT \ + VISP_HAVE_MODULE_TT_MI \ + VISP_HAVE_MODULE_VISION \ + VISP_HAVE_MODULE_VISUAL_FEATURES \ + VISP_HAVE_MODULE_VS \ VISP_BUILD_DEPRECATED_FUNCTIONS \ WIN32 \ APPLE \ UNIX \ VP_DEBUG \ - VP_TRACE + VP_TRACE \ + __APPLE__ \ + __MACH__ # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. @@ -1684,7 +1717,7 @@ HIDE_UNDOC_RELATIONS = YES # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) -HAVE_DOT = @VISP_HAVE_DOT@ +HAVE_DOT = NO # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is # allowed to run in parallel. When set to 0 (the default) doxygen will @@ -1874,4 +1907,4 @@ GENERATE_LEGEND = YES # remove the intermediate dot files that are used to generate # the various graphs. -DOT_CLEANUP = NO +DOT_CLEANUP = YES diff --git a/doc/image/img-ccmake-centos-all.png b/doc/image/img-ccmake-centos-all.png index b9ecef6d9cdb970ae43a7a38b839aeeb18f6656a..56a9a7d078302b53a7b83fe7409804b0836be660 100644 Binary files a/doc/image/img-ccmake-centos-all.png and b/doc/image/img-ccmake-centos-all.png differ diff --git a/doc/image/img-ccmake-centos.png b/doc/image/img-ccmake-centos.png deleted file mode 100644 index 49c361cb676fdd4e73aa91a0908e87c87dfe152a..0000000000000000000000000000000000000000 Binary files a/doc/image/img-ccmake-centos.png and /dev/null differ diff --git a/doc/image/img-ccmake-opensuse-all.png b/doc/image/img-ccmake-opensuse-all.png deleted file mode 100644 index 6180b974162825094b5b91fc8df59079c6aaffb6..0000000000000000000000000000000000000000 Binary files a/doc/image/img-ccmake-opensuse-all.png and /dev/null differ diff --git a/doc/image/img-ccmake-opensuse.png b/doc/image/img-ccmake-opensuse.png deleted file mode 100644 index 0b780d17914e2fd2a2b58325bb55318466bfe8b3..0000000000000000000000000000000000000000 Binary files a/doc/image/img-ccmake-opensuse.png and /dev/null differ diff --git a/doc/image/img-ccmake-raspberry-pi.png b/doc/image/img-ccmake-raspberry-pi.png deleted file mode 100644 index 385477527b2d50f455b3e8ac8982d44bf89f21aa..0000000000000000000000000000000000000000 Binary files a/doc/image/img-ccmake-raspberry-pi.png and /dev/null differ diff --git a/doc/image/img-ccmake-ubuntu-all.png b/doc/image/img-ccmake-ubuntu-all.png index 258f782893d227a2b030c0b39c5fa30d1b98b3b1..f20fadab5285ad954734d677461224ba8144c970 100644 Binary files a/doc/image/img-ccmake-ubuntu-all.png and b/doc/image/img-ccmake-ubuntu-all.png differ diff --git a/doc/image/img-ccmake-ubuntu.png b/doc/image/img-ccmake-ubuntu.png deleted file mode 100644 index 6f59981e5189e7f50ba95574503856d7585a0587..0000000000000000000000000000000000000000 Binary files a/doc/image/img-ccmake-ubuntu.png and /dev/null differ diff --git a/doc/image/img-cmake-win10-config-end.png b/doc/image/img-cmake-win10-config-end.png new file mode 100644 index 0000000000000000000000000000000000000000..bb7cd97ba19b7907f86c152f4dd1c3da7fa17e91 Binary files /dev/null and b/doc/image/img-cmake-win10-config-end.png differ diff --git a/doc/image/img-cmake-win10-config.png b/doc/image/img-cmake-win10-config.png new file mode 100644 index 0000000000000000000000000000000000000000..ba44f9bdfd70fc73b389b85198d46a9cbeecf4ea Binary files /dev/null and b/doc/image/img-cmake-win10-config.png differ diff --git a/doc/image/img-cmake-win10-create-build-folder.png b/doc/image/img-cmake-win10-create-build-folder.png new file mode 100644 index 0000000000000000000000000000000000000000..9c5cecf9857ffb41371db8b2208a8b6bc83d5ab3 Binary files /dev/null and b/doc/image/img-cmake-win10-create-build-folder.png differ diff --git a/doc/image/img-cmake-win10-msvc-generate.png b/doc/image/img-cmake-win10-msvc-generate.png new file mode 100644 index 0000000000000000000000000000000000000000..5d99682660ffc36c86974a034142099b86451d49 Binary files /dev/null and b/doc/image/img-cmake-win10-msvc-generate.png differ diff --git a/doc/image/img-cmake-win10-msvc-launch.png b/doc/image/img-cmake-win10-msvc-launch.png new file mode 100644 index 0000000000000000000000000000000000000000..ef8ec9de678cbafd23c966dd73dab311876a21aa Binary files /dev/null and b/doc/image/img-cmake-win10-msvc-launch.png differ diff --git a/doc/image/img-cmake-win10-msvc-version.png b/doc/image/img-cmake-win10-msvc-version.png new file mode 100644 index 0000000000000000000000000000000000000000..a56df1e505594e400130e8944110236ff76ef6b3 Binary files /dev/null and b/doc/image/img-cmake-win10-msvc-version.png differ diff --git a/doc/image/img-cmake-win7-create-build-folder.jpg b/doc/image/img-cmake-win7-create-build-folder.jpg index 2c07e4bc19a57bab8f0c546ab6fe753339e4ff3c..19606afb618dd989fa8cce20f1ccfc24e4b16d2a 100644 Binary files a/doc/image/img-cmake-win7-create-build-folder.jpg and b/doc/image/img-cmake-win7-create-build-folder.jpg differ diff --git a/doc/image/img-cmake-win7-generate.jpg b/doc/image/img-cmake-win7-generate.jpg index 4beeaed7dfdad0f607bc70ba3bc159e577fabf93..2c3748377bcdb717b449d3eb82e7b69c377e1bce 100644 Binary files a/doc/image/img-cmake-win7-generate.jpg and b/doc/image/img-cmake-win7-generate.jpg differ diff --git a/doc/image/img-cmake-win7-msvc-config-end.jpg b/doc/image/img-cmake-win7-msvc-config-end.jpg index 54dee35bd01f1240e7fa5139826e4ec62f5a0831..fade2b1a2f6833f061a258b0a012c81895c0c937 100644 Binary files a/doc/image/img-cmake-win7-msvc-config-end.jpg and b/doc/image/img-cmake-win7-msvc-config-end.jpg differ diff --git a/doc/image/img-cmake-win7-msvc-config.jpg b/doc/image/img-cmake-win7-msvc-config.jpg index acf85cde33989017aeac34c749f833a1ff5756ec..26601bdaf9dd343554c91b199ba3e6572a09951c 100644 Binary files a/doc/image/img-cmake-win7-msvc-config.jpg and b/doc/image/img-cmake-win7-msvc-config.jpg differ diff --git a/doc/image/img-cmake-win7-msvc-launch.jpg b/doc/image/img-cmake-win7-msvc-launch.jpg index 8a382d3887d4490bdf0b28a6ea8e022b971d0eff..6a2e07bc32253cd189995957d02239e1402aa2e1 100644 Binary files a/doc/image/img-cmake-win7-msvc-launch.jpg and b/doc/image/img-cmake-win7-msvc-launch.jpg differ diff --git a/doc/image/img-cmake-win7-msvc-version.jpg b/doc/image/img-cmake-win7-msvc-version.jpg index a480e0f32105e703fb4e1a944cf50f46e6917a78..3fa3fcbf336bcb88faa6c6dedd25e9428aec9887 100644 Binary files a/doc/image/img-cmake-win7-msvc-version.jpg and b/doc/image/img-cmake-win7-msvc-version.jpg differ diff --git a/doc/image/img-cmake-win7-opencv-advanced.jpg b/doc/image/img-cmake-win7-opencv-advanced.jpg deleted file mode 100644 index 5c816a10967b0566fa901d1740b51fc3796ae8e2..0000000000000000000000000000000000000000 Binary files a/doc/image/img-cmake-win7-opencv-advanced.jpg and /dev/null differ diff --git a/doc/image/img-cmake-win7-opencv.jpg b/doc/image/img-cmake-win7-opencv.jpg deleted file mode 100644 index eb8f9bdc530061a8a303b05ed05758579c951c3a..0000000000000000000000000000000000000000 Binary files a/doc/image/img-cmake-win7-opencv.jpg and /dev/null differ diff --git a/doc/image/img-cmake-win7-solution.jpg b/doc/image/img-cmake-win7-solution.jpg index 2bb2ccda27510d5b0b683c1b185792615e316487..34c2382990dc0797b2e906776eb4063d59afad07 100644 Binary files a/doc/image/img-cmake-win7-solution.jpg and b/doc/image/img-cmake-win7-solution.jpg differ diff --git a/doc/image/img-cmake-win8.1-4.jpg b/doc/image/img-cmake-win8.1-4.jpg deleted file mode 100644 index 4c18a1541165a060e534262de7bd1d85eb37a777..0000000000000000000000000000000000000000 Binary files a/doc/image/img-cmake-win8.1-4.jpg and /dev/null differ diff --git a/doc/image/img-cmake-win8.1-6.jpg b/doc/image/img-cmake-win8.1-6.jpg deleted file mode 100644 index 8dbd4e77822ab365b422c19b4a0ccb85a8278fec..0000000000000000000000000000000000000000 Binary files a/doc/image/img-cmake-win8.1-6.jpg and /dev/null differ diff --git a/doc/image/img-cmake-win8.1-config-end.jpg b/doc/image/img-cmake-win8.1-config-end.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9e536f8f48df689a51817ec6add0883bfc948ee5 Binary files /dev/null and b/doc/image/img-cmake-win8.1-config-end.jpg differ diff --git a/doc/image/img-cmake-win8.1-config.jpg b/doc/image/img-cmake-win8.1-config.jpg new file mode 100644 index 0000000000000000000000000000000000000000..777fa5e3856d86fea05217eaacfa427bab196316 Binary files /dev/null and b/doc/image/img-cmake-win8.1-config.jpg differ diff --git a/doc/image/img-cmake-win8.1-create-build-folder.jpg b/doc/image/img-cmake-win8.1-create-build-folder.jpg index 3de022432a14de1abf4978ae8fd5f000e735e43d..2aa758b6dd9ca3e1a896d1799ec049545168f8dc 100644 Binary files a/doc/image/img-cmake-win8.1-create-build-folder.jpg and b/doc/image/img-cmake-win8.1-create-build-folder.jpg differ diff --git a/doc/image/img-cmake-win8.1-gdi.jpg b/doc/image/img-cmake-win8.1-gdi.jpg deleted file mode 100644 index 03eb63ce8f3b8dfcd9fcb0d2335b4670e1720f15..0000000000000000000000000000000000000000 Binary files a/doc/image/img-cmake-win8.1-gdi.jpg and /dev/null differ diff --git a/doc/image/img-cmake-win8.1-mingw-configure-end.jpg b/doc/image/img-cmake-win8.1-mingw-configure-end.jpg index 948f78412099bcd64bdbc246b56d6acfd84ec213..75cfaa84ba5af42caf03a3f78f1e39e4dadcc4e7 100644 Binary files a/doc/image/img-cmake-win8.1-mingw-configure-end.jpg and b/doc/image/img-cmake-win8.1-mingw-configure-end.jpg differ diff --git a/doc/image/img-cmake-win8.1-mingw-configure.jpg b/doc/image/img-cmake-win8.1-mingw-configure.jpg index 925560ad9609d052c11e2b94403cff4078bf5921..846699bccfe0ecd948c4cc8317473ed734616d3b 100644 Binary files a/doc/image/img-cmake-win8.1-mingw-configure.jpg and b/doc/image/img-cmake-win8.1-mingw-configure.jpg differ diff --git a/doc/image/img-cmake-win8.1-mingw-generate.jpg b/doc/image/img-cmake-win8.1-mingw-generate.jpg index a6bf443c643314e69c091aa6d518c991e95832d7..af6b7d0032788c122cc588b7eafd2c2a4613ec61 100644 Binary files a/doc/image/img-cmake-win8.1-mingw-generate.jpg and b/doc/image/img-cmake-win8.1-mingw-generate.jpg differ diff --git a/doc/image/img-cmake-win8.1-mingw-launch.jpg b/doc/image/img-cmake-win8.1-mingw-launch.jpg deleted file mode 100644 index 277ae0334b7c04c07cc24af99dcb8001e5c62414..0000000000000000000000000000000000000000 Binary files a/doc/image/img-cmake-win8.1-mingw-launch.jpg and /dev/null differ diff --git a/doc/image/img-cmake-win8.1-mingw-opencv-detected-advanced.jpg b/doc/image/img-cmake-win8.1-mingw-opencv-detected-advanced.jpg deleted file mode 100644 index 32ef3c281400de4d18eb881d9f5174c4e55217a6..0000000000000000000000000000000000000000 Binary files a/doc/image/img-cmake-win8.1-mingw-opencv-detected-advanced.jpg and /dev/null differ diff --git a/doc/image/img-cmake-win8.1-mingw-opencv-detected.jpg b/doc/image/img-cmake-win8.1-mingw-opencv-detected.jpg deleted file mode 100644 index df0312fe0123136f8b608a8116e6d38cd5008704..0000000000000000000000000000000000000000 Binary files a/doc/image/img-cmake-win8.1-mingw-opencv-detected.jpg and /dev/null differ diff --git a/doc/image/img-cmake-win8.1-msvc-generate.jpg b/doc/image/img-cmake-win8.1-msvc-generate.jpg index be57b42c13ebd5f4f0d71d14cdfd81e47c5fb55b..83e03a0d5cf88c29ced942d171665d7cdeaebbb9 100644 Binary files a/doc/image/img-cmake-win8.1-msvc-generate.jpg and b/doc/image/img-cmake-win8.1-msvc-generate.jpg differ diff --git a/doc/image/img-cmake-win8.1-msvc-launch.jpg b/doc/image/img-cmake-win8.1-msvc-launch.jpg index 59c8289a24553816a90e8dadfa13adcfe0a72fcf..966d638ab6c2021800122455b400456ba267244f 100644 Binary files a/doc/image/img-cmake-win8.1-msvc-launch.jpg and b/doc/image/img-cmake-win8.1-msvc-launch.jpg differ diff --git a/doc/image/img-cmake-win8.1-opencv-advanced.jpg b/doc/image/img-cmake-win8.1-opencv-advanced.jpg deleted file mode 100644 index c9fdbcece2466408275bd02521198489fe16cf3c..0000000000000000000000000000000000000000 Binary files a/doc/image/img-cmake-win8.1-opencv-advanced.jpg and /dev/null differ diff --git a/doc/image/img-cmake-win8.1-opencv.jpg b/doc/image/img-cmake-win8.1-opencv.jpg deleted file mode 100644 index e49a416d7a0c25494d194fa9d9d2b230891be3bc..0000000000000000000000000000000000000000 Binary files a/doc/image/img-cmake-win8.1-opencv.jpg and /dev/null differ diff --git a/doc/image/img-logo-visp.png b/doc/image/img-logo-visp.png new file mode 100644 index 0000000000000000000000000000000000000000..c5a3a9650669b159886f4d30f2d777ad84a8cc41 Binary files /dev/null and b/doc/image/img-logo-visp.png differ diff --git a/doc/image/img-mingw64-installer-finished.jpg b/doc/image/img-mingw64-installer-finished.jpg deleted file mode 100644 index a38a755d666e350d7ab83df3e296c43223ed2438..0000000000000000000000000000000000000000 Binary files a/doc/image/img-mingw64-installer-finished.jpg and /dev/null differ diff --git a/doc/image/img-monkey-blured-default.png b/doc/image/img-monkey-blured-default.png new file mode 100644 index 0000000000000000000000000000000000000000..812d29639a6c4a192167301e87c7f80d79bb0cc7 Binary files /dev/null and b/doc/image/img-monkey-blured-default.png differ diff --git a/doc/image/img-monkey-blured-var2.png b/doc/image/img-monkey-blured-var2.png new file mode 100644 index 0000000000000000000000000000000000000000..efd67c416e63b95bd2ca3975b3c18c4502e9509b Binary files /dev/null and b/doc/image/img-monkey-blured-var2.png differ diff --git a/doc/image/img-monkey-canny.png b/doc/image/img-monkey-canny.png new file mode 100644 index 0000000000000000000000000000000000000000..9fef772d844d152a93e9edea4f6fc43d8bc77ac8 Binary files /dev/null and b/doc/image/img-monkey-canny.png differ diff --git a/doc/image/img-monkey-dIxy.png b/doc/image/img-monkey-dIxy.png new file mode 100644 index 0000000000000000000000000000000000000000..ec00669407d43fdeefd766762b0fbc452df38c1b Binary files /dev/null and b/doc/image/img-monkey-dIxy.png differ diff --git a/doc/image/img-monkey-gray.png b/doc/image/img-monkey-gray.png new file mode 100644 index 0000000000000000000000000000000000000000..349d78f1d3b396f81b29061a53d37d4de2ab8891 Binary files /dev/null and b/doc/image/img-monkey-gray.png differ diff --git a/doc/image/img-monkey-pyr.png b/doc/image/img-monkey-pyr.png new file mode 100644 index 0000000000000000000000000000000000000000..dc6fd0ecf3876f3bc137758d8b8ddcad79597be9 Binary files /dev/null and b/doc/image/img-monkey-pyr.png differ diff --git a/doc/image/img-monkey-sobel.png b/doc/image/img-monkey-sobel.png new file mode 100644 index 0000000000000000000000000000000000000000..c308ddb14513fee1891a8de0eeaf40f7dcd9d8bd Binary files /dev/null and b/doc/image/img-monkey-sobel.png differ diff --git a/doc/image/img-monkey-win.jpg b/doc/image/img-monkey-win.jpg new file mode 100755 index 0000000000000000000000000000000000000000..2c8cd007e342494e412ab56b4b7803ca1bcee712 Binary files /dev/null and b/doc/image/img-monkey-win.jpg differ diff --git a/doc/image/img-monkey.png b/doc/image/img-monkey.png new file mode 100644 index 0000000000000000000000000000000000000000..81bd2dc7e815535d9f0a62f78510524d882ff286 Binary files /dev/null and b/doc/image/img-monkey.png differ diff --git a/doc/image/img-opencv-issue-dshow.jpg b/doc/image/img-opencv-issue-dshow.jpg deleted file mode 100644 index 4de4fd57f4ce081bc60e9f450d23c14d981a4f9e..0000000000000000000000000000000000000000 Binary files a/doc/image/img-opencv-issue-dshow.jpg and /dev/null differ diff --git a/doc/image/img-started-win-run.jpg b/doc/image/img-started-win-run.jpg index 018832ebedd9931cbc389721f46fd946288a9588..6b93168a1b5eecc90f54b90c578f6366c4f9743a 100644 Binary files a/doc/image/img-started-win-run.jpg and b/doc/image/img-started-win-run.jpg differ diff --git a/doc/image/img-tracker-mb-visibility-ogre-advanced.png b/doc/image/img-tracker-mb-visibility-ogre-advanced.png new file mode 100644 index 0000000000000000000000000000000000000000..938796e1f0d7bcdd20a1c12fcbc1ec72590eb2a5 Binary files /dev/null and b/doc/image/img-tracker-mb-visibility-ogre-advanced.png differ diff --git a/doc/image/img-tracker-mb-visibility-ogre.png b/doc/image/img-tracker-mb-visibility-ogre.png new file mode 100644 index 0000000000000000000000000000000000000000..d6c83b424ebcaf4513e20a440675b8dc7a9644e4 Binary files /dev/null and b/doc/image/img-tracker-mb-visibility-ogre.png differ diff --git a/doc/image/img-tracker-mb-visibility-scanline.png b/doc/image/img-tracker-mb-visibility-scanline.png new file mode 100644 index 0000000000000000000000000000000000000000..a4e2ad25f1e5fe5165286c85aa9de71615feb0d8 Binary files /dev/null and b/doc/image/img-tracker-mb-visibility-scanline.png differ diff --git a/doc/image/img-win10-cmake-error-sdk-missing.png b/doc/image/img-win10-cmake-error-sdk-missing.png new file mode 100644 index 0000000000000000000000000000000000000000..2bb185fa038d1c126c58e8ed8fddff0ae68ee103 Binary files /dev/null and b/doc/image/img-win10-cmake-error-sdk-missing.png differ diff --git a/doc/image/img-win10-explorer-install-end.png b/doc/image/img-win10-explorer-install-end.png new file mode 100644 index 0000000000000000000000000000000000000000..93164ce821cfb7f756e11bfc494201363500f33f Binary files /dev/null and b/doc/image/img-win10-explorer-install-end.png differ diff --git a/doc/image/img-win10-msvc-build-end.png b/doc/image/img-win10-msvc-build-end.png new file mode 100644 index 0000000000000000000000000000000000000000..860d4cc38f2efaaa90441e8b88e088eee0e232a5 Binary files /dev/null and b/doc/image/img-win10-msvc-build-end.png differ diff --git a/doc/image/img-win10-msvc-build.png b/doc/image/img-win10-msvc-build.png new file mode 100644 index 0000000000000000000000000000000000000000..9945b7beb2940f62479c72decad6c2e2e9c5db34 Binary files /dev/null and b/doc/image/img-win10-msvc-build.png differ diff --git a/doc/image/img-win10-msvc-install-end.png b/doc/image/img-win10-msvc-install-end.png new file mode 100644 index 0000000000000000000000000000000000000000..1e188bea141401cee2330403153712df4b9c2146 Binary files /dev/null and b/doc/image/img-win10-msvc-install-end.png differ diff --git a/doc/image/img-win10-msvc-install.png b/doc/image/img-win10-msvc-install.png new file mode 100644 index 0000000000000000000000000000000000000000..7220c3470df4664f9098809911144b59160c3c33 Binary files /dev/null and b/doc/image/img-win10-msvc-install.png differ diff --git a/doc/image/img-win10-msvc-open.png b/doc/image/img-win10-msvc-open.png new file mode 100644 index 0000000000000000000000000000000000000000..7c096c1699b5895596932e9cf1451b7029a7e901 Binary files /dev/null and b/doc/image/img-win10-msvc-open.png differ diff --git a/doc/image/img-win10-msvc-release.png b/doc/image/img-win10-msvc-release.png new file mode 100644 index 0000000000000000000000000000000000000000..d16c5c80f1d502b8b1812d718491a5d68cf92047 Binary files /dev/null and b/doc/image/img-win10-msvc-release.png differ diff --git a/doc/image/img-win7-ViSP-images.jpg b/doc/image/img-win7-ViSP-images.jpg index 7bc78d55786c2e33554b0d535c524bab5052b295..1917f621a564fc663a80d71a2263390880e1f377 100644 Binary files a/doc/image/img-win7-ViSP-images.jpg and b/doc/image/img-win7-ViSP-images.jpg differ diff --git a/doc/image/img-win7-cmd-displayGDI.jpg b/doc/image/img-win7-cmd-displayGDI.jpg index 0be1bb84566d31b3816073c482d9bd0188a93103..f98b2352a3d3a7bba4911c5d96cdf568b179623a 100644 Binary files a/doc/image/img-win7-cmd-displayGDI.jpg and b/doc/image/img-win7-cmd-displayGDI.jpg differ diff --git a/doc/image/img-win7-cygwin-git.jpg b/doc/image/img-win7-cygwin-git.jpg new file mode 100644 index 0000000000000000000000000000000000000000..58a6e3160ce0f0753935f53fd28cdca020edd6f7 Binary files /dev/null and b/doc/image/img-win7-cygwin-git.jpg differ diff --git a/doc/image/img-win7-msvc-build-succeed.jpg b/doc/image/img-win7-msvc-build-succeed.jpg index d894f880f77070cb4f93a6e3e142336c10235028..7dfa5c865d8ff8a8cc96fdb4c97b1db187c00515 100644 Binary files a/doc/image/img-win7-msvc-build-succeed.jpg and b/doc/image/img-win7-msvc-build-succeed.jpg differ diff --git a/doc/image/img-win7-msvc-build.jpg b/doc/image/img-win7-msvc-build.jpg index 0382d6d5c2b7c1d43e06d3d939b4e8def3ba9d2e..066339aa6b2b7a5d633fbf471655a02cf083174d 100644 Binary files a/doc/image/img-win7-msvc-build.jpg and b/doc/image/img-win7-msvc-build.jpg differ diff --git a/doc/image/img-win7-msvc-install-end.jpg b/doc/image/img-win7-msvc-install-end.jpg index f11a3a154ccf3d6f7a8532be64a0c24cc4d26826..3bfa47dded830d3b9351bb0e9d3d3520dbd32fa4 100644 Binary files a/doc/image/img-win7-msvc-install-end.jpg and b/doc/image/img-win7-msvc-install-end.jpg differ diff --git a/doc/image/img-win7-msvc-install-succeed.jpg b/doc/image/img-win7-msvc-install-succeed.jpg index 9701b64b95254fe34fd8f9a7f6fb2ad8533675bf..84c74b25568a72fe37719fb648f4ac8da0bff415 100644 Binary files a/doc/image/img-win7-msvc-install-succeed.jpg and b/doc/image/img-win7-msvc-install-succeed.jpg differ diff --git a/doc/image/img-win7-msvc-install.jpg b/doc/image/img-win7-msvc-install.jpg index 5ded148212261b92126383e0a1fc6966c42cf99f..e40a5fc2a64c21b201f3aa92f1e7e3112d7901c9 100644 Binary files a/doc/image/img-win7-msvc-install.jpg and b/doc/image/img-win7-msvc-install.jpg differ diff --git a/doc/image/img-win7-msvc-open.jpg b/doc/image/img-win7-msvc-open.jpg index 957cf0c093509a16359c207df70a252aa420260d..bce38c2c4429a334ba0f52e8a977d68363856a58 100644 Binary files a/doc/image/img-win7-msvc-open.jpg and b/doc/image/img-win7-msvc-open.jpg differ diff --git a/doc/image/img-win7-msvc-release.jpg b/doc/image/img-win7-msvc-release.jpg index fec3a95c925d20e11dd35c3cd92435147843227d..63b8cbda1e48352d84c55b67faa64dc656a50798 100644 Binary files a/doc/image/img-win7-msvc-release.jpg and b/doc/image/img-win7-msvc-release.jpg differ diff --git a/doc/image/img-win8.1-cmake-ogre.jpg b/doc/image/img-win8.1-cmake-ogre.jpg new file mode 100644 index 0000000000000000000000000000000000000000..79ffcc7e0db67c09ef56d05b9dca27a64a84910b Binary files /dev/null and b/doc/image/img-win8.1-cmake-ogre.jpg differ diff --git a/doc/image/img-win8.1-cmake-ogredeps-issue.jpg b/doc/image/img-win8.1-cmake-ogredeps-issue.jpg new file mode 100644 index 0000000000000000000000000000000000000000..501e8ab86c3518082a950ddfa0621ee52b15cee6 Binary files /dev/null and b/doc/image/img-win8.1-cmake-ogredeps-issue.jpg differ diff --git a/doc/image/img-win8.1-cmake-ogredeps.jpg b/doc/image/img-win8.1-cmake-ogredeps.jpg new file mode 100644 index 0000000000000000000000000000000000000000..21af130dbf1f245b7eaf78db6f2d07955ceada2e Binary files /dev/null and b/doc/image/img-win8.1-cmake-ogredeps.jpg differ diff --git a/doc/image/img-win8.1-cmd-displayGDI.jpg b/doc/image/img-win8.1-cmd-displayGDI.jpg index a23766fa4b6c46dee56175fd2490b1355b1196e5..231862d4a25571f51fed7221d333b14a987bb412 100644 Binary files a/doc/image/img-win8.1-cmd-displayGDI.jpg and b/doc/image/img-win8.1-cmd-displayGDI.jpg differ diff --git a/doc/image/img-win8.1-cygwin-svn.jpg b/doc/image/img-win8.1-cygwin-svn.jpg deleted file mode 100644 index 44ddfdac8b73f0b374a4bb34866ae9e43a66c2c1..0000000000000000000000000000000000000000 Binary files a/doc/image/img-win8.1-cygwin-svn.jpg and /dev/null differ diff --git a/doc/image/img-win8.1-explorer-install-end.jpg b/doc/image/img-win8.1-explorer-install-end.jpg index 95458c4a806501193c0d069aa1ecd4680817a98e..7133f83c026feb701ca58fefd93eeaa53b4c1776 100644 Binary files a/doc/image/img-win8.1-explorer-install-end.jpg and b/doc/image/img-win8.1-explorer-install-end.jpg differ diff --git a/doc/image/img-win8.1-mingw-cmd-displayGDI.jpg b/doc/image/img-win8.1-mingw-cmd-displayGDI.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a1d9626287eacdfa7a345e44fa9a2338949a30b2 Binary files /dev/null and b/doc/image/img-win8.1-mingw-cmd-displayGDI.jpg differ diff --git a/doc/image/img-win8.1-mingw-opencv-cmake-configure-install.jpg b/doc/image/img-win8.1-mingw-opencv-cmake-configure-install.jpg index 301047fb210c908e7b587f424f57f9b246b6e27c..9868b951210143149207f68067e981cfdc2855a4 100644 Binary files a/doc/image/img-win8.1-mingw-opencv-cmake-configure-install.jpg and b/doc/image/img-win8.1-mingw-opencv-cmake-configure-install.jpg differ diff --git a/doc/image/img-win8.1-mingw-opencv-cmake-configure.jpg b/doc/image/img-win8.1-mingw-opencv-cmake-configure.jpg index 3723af74860c5d005579a8e7b5fb17cd3ecf7243..2aacbe51a03735a35168a4c5274b1c9a29adc7b8 100644 Binary files a/doc/image/img-win8.1-mingw-opencv-cmake-configure.jpg and b/doc/image/img-win8.1-mingw-opencv-cmake-configure.jpg differ diff --git a/doc/image/img-win8.1-mingw-opencv-issue-dtor.jpg b/doc/image/img-win8.1-mingw-opencv-issue-dtor.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d9aa0739b4ddfb22bba14fd26403b302d76f55d8 Binary files /dev/null and b/doc/image/img-win8.1-mingw-opencv-issue-dtor.jpg differ diff --git a/doc/image/img-win8.1-msvc-build-end.jpg b/doc/image/img-win8.1-msvc-build-end.jpg index 1cf3ef0518ccab2b21c2fb8862a512d5319905b3..5772b34f8a19437adc6e3ab2bb99b652b3b6910c 100644 Binary files a/doc/image/img-win8.1-msvc-build-end.jpg and b/doc/image/img-win8.1-msvc-build-end.jpg differ diff --git a/doc/image/img-win8.1-msvc-build-ogredeps.jpg b/doc/image/img-win8.1-msvc-build-ogredeps.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cf3e40992cd2fec95bd6b8a1ce435eef2a7cc473 Binary files /dev/null and b/doc/image/img-win8.1-msvc-build-ogredeps.jpg differ diff --git a/doc/image/img-win8.1-msvc-build.jpg b/doc/image/img-win8.1-msvc-build.jpg index e4ef2b2406a0db90493013bcae627f2771803104..398b84873bab18010f37ab4bb1175934b2307110 100644 Binary files a/doc/image/img-win8.1-msvc-build.jpg and b/doc/image/img-win8.1-msvc-build.jpg differ diff --git a/doc/image/img-win8.1-msvc-install-end.jpg b/doc/image/img-win8.1-msvc-install-end.jpg index f26f6987c4fce9a1665da83d9fcb9b0a25340dc0..208e0a0d312390ea962361b60a0ac9ff7f220973 100644 Binary files a/doc/image/img-win8.1-msvc-install-end.jpg and b/doc/image/img-win8.1-msvc-install-end.jpg differ diff --git a/doc/image/img-win8.1-msvc-install.jpg b/doc/image/img-win8.1-msvc-install.jpg index ed2f5612d986a4e1bb79c104a93d5f2058294f7e..d2c3a8ec3e33e6836c9a4b677787be983b3a8c25 100644 Binary files a/doc/image/img-win8.1-msvc-install.jpg and b/doc/image/img-win8.1-msvc-install.jpg differ diff --git a/doc/image/img-win8.1-msvc-mbtracker-ogre-issue.jpg b/doc/image/img-win8.1-msvc-mbtracker-ogre-issue.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b5d51a95191ba67237600a21fb27b0b34efa611b Binary files /dev/null and b/doc/image/img-win8.1-msvc-mbtracker-ogre-issue.jpg differ diff --git a/doc/image/img-win8.1-msvc-mbtracker-ogre-opengl.jpg b/doc/image/img-win8.1-msvc-mbtracker-ogre-opengl.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f182adcb36cfb0d135d04653a73b3421fc064941 Binary files /dev/null and b/doc/image/img-win8.1-msvc-mbtracker-ogre-opengl.jpg differ diff --git a/doc/image/img-win8.1-msvc-ogredeps-issue.jpg b/doc/image/img-win8.1-msvc-ogredeps-issue.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2c2e03b37bf1557fb39e7d6a1839f6d281b935ca Binary files /dev/null and b/doc/image/img-win8.1-msvc-ogredeps-issue.jpg differ diff --git a/doc/image/img-win8.1-msvc-open.jpg b/doc/image/img-win8.1-msvc-open.jpg index c7b8222906ed410032bee81b8c9001b2ed19916d..282605de1dda584a40b8d8e7f6c6ed1c199a112a 100644 Binary files a/doc/image/img-win8.1-msvc-open.jpg and b/doc/image/img-win8.1-msvc-open.jpg differ diff --git a/doc/image/img-win8.1-msvc-release.jpg b/doc/image/img-win8.1-msvc-release.jpg index 4a63729c9b34918883c28632822b0beb60fc083c..476163a951cb95976b9e33a230f0c2818a24a6e0 100644 Binary files a/doc/image/img-win8.1-msvc-release.jpg and b/doc/image/img-win8.1-msvc-release.jpg differ diff --git a/doc/image/img-win8.1-msvc-solution.jpg b/doc/image/img-win8.1-msvc-solution.jpg index b09305b19abd894f206ab199cc81d26179ef868a..ad854c3458078abfdcf9da490f8d063df9eb97df 100644 Binary files a/doc/image/img-win8.1-msvc-solution.jpg and b/doc/image/img-win8.1-msvc-solution.jpg differ diff --git a/doc/image/img-win8.1-ogre-explorer.jpg b/doc/image/img-win8.1-ogre-explorer.jpg new file mode 100644 index 0000000000000000000000000000000000000000..efbf4bafdc4fe2ed5412ae5b78a5829b84731288 Binary files /dev/null and b/doc/image/img-win8.1-ogre-explorer.jpg differ diff --git a/doc/image/img-win8.1-ogre-tortoisehg.jpg b/doc/image/img-win8.1-ogre-tortoisehg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6a5d82b20c4565f8d55a52f210a100c511e7f1f1 Binary files /dev/null and b/doc/image/img-win8.1-ogre-tortoisehg.jpg differ diff --git a/doc/image/img-win8.1-ogredeps-explorer.jpg b/doc/image/img-win8.1-ogredeps-explorer.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c77d60dd3f573249748ee4433a57488c22d6fb3e Binary files /dev/null and b/doc/image/img-win8.1-ogredeps-explorer.jpg differ diff --git a/doc/image/img-win8.1-ogredeps-tortoisehg.jpg b/doc/image/img-win8.1-ogredeps-tortoisehg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e18955a58eb99e90ec80a496148c139dbb162cc0 Binary files /dev/null and b/doc/image/img-win8.1-ogredeps-tortoisehg.jpg differ diff --git a/doc/image/img-win8.1-visp-images.jpg b/doc/image/img-win8.1-visp-images.jpg index ddccad86014ad9ce0ce13b03880f019bfc1d8ec6..b7596d9fb777346e06372ff8e0369723f6e1541d 100644 Binary files a/doc/image/img-win8.1-visp-images.jpg and b/doc/image/img-win8.1-visp-images.jpg differ diff --git a/doc/mainpage.doc.in b/doc/mainpage.doc.in index 83092b3ff8643d079870dcbd6785b692cd8ab43b..5605b5b13a04bb904b7157bcddc497761f5ba991 100644 --- a/doc/mainpage.doc.in +++ b/doc/mainpage.doc.in @@ -1,6 +1,6 @@ /*! -\mainpage Online documentation for ViSP @VISP_VERSION@ +\mainpage ViSP @VISP_VERSION@ main page \tableofcontents @@ -11,20 +11,23 @@ servoing applications. ViSP is developed and maintained by the Inria <a href="http://team.inria.fr/lagadic" target="_parent">Lagadic</a> team located at <a href="http://www.inria.fr/en/centre/rennes" target="_parent">Inria Rennes</a>.</p> -<p>ViSP official site is <a -href="http://team.inria.fr/lagadic/visp" target="_parent">http://team.inria.fr/lagadic/visp</a></p> +<p>ViSP official site is <a href="http://visp.inria.fr" target="_parent">http://visp.inria.fr</a></p> + +<p>ViSP wiki is <a href="https://github.com/lagadic/visp/wiki" target="_parent">https://github.com/lagadic/visp/wiki</a></p> + +<p>ViSP source code is now available on GitHub <a href="http://github.org/lagadic/visp" target="_parent">http://github.org/lagadic/visp</a></p> -<p>If you have any problems or find any bugs, please report them at -<a href="http://gforge.inria.fr/tracker/?group_id=397" target="_parent">http://gforge.inria.fr/tracker/?group_id=397</a>. If you may need help, please use the available forums <a href="http://gforge.inria.fr/forum/?group_id=397" target="_parent">http://gforge.inria.fr/forum/?group_id=397</a> or mailing lists <a href="http://gforge.inria.fr/mail/?group_id=397" target="_parent">http://gforge.inria.fr/mail/?group_id=397</a>.<p> +<p>If you have any problems or find any bugs, please report them in +<a href="https://github.com/lagadic/visp/issues">the bug tracker</a>. If you may need help, please use the available <a href="http://gforge.inria.fr/forum/?group_id=397" target="_parent">forums</a>.<p> It is also possible to contact ViSP main developers using: <a href="mailto:visp@inria.fr?subject=[visp]">visp@inria.fr</a> \section download_sec Download <p>From <a -href="http://team.inria.fr/lagadic/visp/download.html" target="_parent">http://team.inria.fr/lagadic/visp/download.html</a> -you can either download the latest stable release or the current -development distribution using Subversion.</p> +href="http://visp.inria.fr/download" target="_parent">http://visp.inria.fr/download</a> +you can either download the latest stable release, a daily snapshot or the current +development distribution using git.</p> \section install_sec Installation @@ -35,10 +38,10 @@ href="http://www.cmake.org" target="_parent">http://www.cmake.org</a>. Furthermo depending on your operation system and the capabilities (framegrabber, display, simulation, ...) you need, prior to install ViSP you may install third party libraries <a -href="http://team.inria.fr/lagadic/visp/libraries.html" target="_parent">http://team.inria.fr/lagadic/visp/libraries.html</a>.</p> +href="http://visp.inria.fr/software-architecture" target="_parent">http://visp.inria.fr/software-architecture</a>.</p> <p>ViSP full installation procedure using CMake is detailed in the \ref tuto_install_sdk "Installation from prebuild SDK tutorials" and \ref tuto_install_src "Installation from source tutorials". \ref tuto_started "Getting started tutorials" and documents in pdf are also available from <a -href="http://team.inria.fr/lagadic/visp/publication.html" target="_parent">http://team.inria.fr/lagadic/visp/publication.html</a>.</p> +href="http://visp.inria.fr/publications" target="_parent">http://visp.inria.fr/publications</a>.</p> \section tutorial Tutorials @@ -50,14 +53,16 @@ href="http://team.inria.fr/lagadic/visp/publication.html" target="_parent">http: \subsection tuto_install_src Installation from source -- \ref tutorial-install-ubuntu <br>In this first tutorial you will learn how to install ViSP from source on Linux Ubuntu. +- \ref tutorial-install-ubuntu <br>In this tutorial you will learn how to install ViSP from source on Linux Ubuntu. - \ref tutorial-install-fedora <br>In this other tutorial you will learn how to install ViSP from source on Linux Fedora. - \ref tutorial-install-centos <br>In this other tutorial you will learn how to install ViSP from source on Linux CentOS. - \ref tutorial-install-opensuse <br>In this other tutorial you will learn how to install ViSP from source on Linux openSUSE. - \ref tutorial-install-raspberry <br>In this tutorial you will learn how to install ViSP from source on Raspberry Pi. - \ref tutorial-install-win7 <br>In this tutorial you will learn how to install ViSP from source on Windows 7 with Visual C++ 2012. - \ref tutorial-install-win81-msvc <br>In this tutorial you will learn how to install ViSP from source on Windows 8.1 with Visual C++ 2013. +- \ref tutorial-install-win10-msvc14 <br>In this tutorial you will learn how to install ViSP from source on Windows 10 with Visual C++ 2015. - \ref tutorial-install-win81-mingw64 <br>In this tutorial you will learn how to install ViSP from source on Windows 8.1 with Mingw-w64. +- \ref tutorial-install-osx-homebrew <br>In this tutorial you will learn how to install ViSP from source on OSX with Homebrew. - \ref tutorial-install-iOS <br>In this tutorial you will learn how to install ViSP from source on OSX for iOS project. \subsection tuto_started Getting started @@ -103,6 +108,10 @@ href="http://team.inria.fr/lagadic/visp/publication.html" target="_parent">http: - \ref tutorial-simu-robot-pioneer <br>This tutorial focuses on visual servoing simulation on a unicycle robot. The study case is a Pioneer P3-DX mobile robot equipped with a camera. - \ref tutorial-boost-vs <br>This tutorial explains how to speed up the time to convergence of a visual servo. +\subsection tuto_bridge Bridges over other frameworks + +- \ref tutorial-bridge-opencv <br>This tutorial explicit how to convert OpenCV to/from ViSP structures such as camera parameters, images... + \subsection tuto_tools Other tools - \ref tutorial-plotter <br>This tutorial explains how to plot curves in real-time during a visual servo. @@ -122,423 +131,473 @@ scheme, ...</p> <p>ViSP library is an open source C++ library which is developed at <a href="http://www.inria.fr/en/centre/rennes">Inria</a> by <a href="http://team.inria.fr/lagadic/welcome-eng.html">Lagadic team</a>. If you enjoy using ViSP, you may contribute to the project in different ways. This will motivate us to continue the efforts. -- You can help VISP to be more widely known, by displaying a <a href="http://team.inria.fr/lagadic/visp/documentation/visp-flyers.pdf">ViSP flyer</a> at work, in your lab or school. -- You can submit a <a href="https://gforge.inria.fr/tracker/?atid=1867&group_id=397&func=browse">bug report using the tracker</a>. -- You can submit <a href="https://gforge.inria.fr/tracker/?func=browse&group_id=397&atid=1660">patches or new functionalities here</a>. +- You can submit a <a href="https://github.com/lagadic/visp/issues">bug report using the tracker</a>. +- You can submit patches or new functionalities using GitHub Pull Request mechanism. - You can write new tutorials, new documentations or simply improve the existing documentation. - If you just want to say you've been happy with the library, you can send us a postcard from your place, to the following address: <em>Inria Rennes Bretagne Atlantique, Lagadic team, Campus de Beaulieu, 35042 Rennes Cedex, FRANCE.</em> -<p>You can also ask for help using either <a href="https://gforge.inria.fr/forum/?group_id=397">the french or the english forum</a>, or <a href="https://gforge.inria.fr/mail/?group_id=397">ViSP users mailing list</a>. +<p>You can also ask for help using either <a href="https://gforge.inria.fr/forum/?group_id=397">the french or the english forum</a>. */ -/* - ****************************************** - * ViSP capabilities - ****************************************** - */ + +/******************************************* + * Module core + *******************************************/ /*! - \defgroup Capabilities ViSP capabilities + \defgroup module_core core: Core module + Core module content. */ -/* - ****************************************** - * Data representation - ****************************************** - */ /*! - \ingroup Capabilities - \defgroup DataRepresentation Data representation + \ingroup module_core + \defgroup group_core_camera Camera model + Camera model. */ /*! - \ingroup DataRepresentation - \defgroup ImageDataRepresentation Image + \ingroup module_core + \defgroup group_core_image Image manipulation + Image manipulation, including I/O from image files or videos. */ /*! - \ingroup DataRepresentation - \defgroup List List + \ingroup module_core + \defgroup group_core_math Mathematics + Mathematics. */ -/* - ****************************************** - * Mathematics - ****************************************** - */ /*! - \ingroup Capabilities - \defgroup Math Mathematics + \ingroup group_core_math + \defgroup group_core_robust Robust estimation + Robust estimation. */ /*! - \ingroup Math - \defgroup Matrix Matrices and vectors + \ingroup group_core_math + \defgroup group_core_random Random number generator + Random number generator. */ /*! - \ingroup Math - \defgroup Geometry Geometry + \ingroup group_core_math + \defgroup group_core_matrices Matrices and vectors + Matrices and vectors. */ /*! - \ingroup Geometry - \defgroup GeometryPlane Plane + \ingroup group_core_math + \defgroup group_core_transformations Tranformations + Transformations. */ /*! - \ingroup Geometry - \defgroup GeometryFeature Geometric feature (3D transformation and forward projection) + \ingroup group_core_math + \defgroup group_core_math_tools Other tools + Other tools. */ /*! - \ingroup Math - \defgroup Transformations Transformations + \ingroup group_core_math + \defgroup group_core_math_spline Spline + Spline. */ /*! - \ingroup Math - \defgroup Hinkley Hinkley's cumulative sum test + \ingroup group_core_math + \defgroup group_core_kalman Kalman filter + Kalman filter. */ /*! - \ingroup Math - \defgroup Robust Robust estimation + \ingroup module_core + \defgroup group_core_tools Tools + Tools. */ /*! - \ingroup Math - \defgroup Random Random number generator + \ingroup group_core_tools + \defgroup group_core_moments Image moments + Image moments. */ /*! - \ingroup Math - \defgroup MathTools Other tools + \ingroup group_core_tools + \defgroup group_core_gui Generic GUI + Generic graphical user interface tools. */ - /*! - \ingroup Transformations - \defgroup Transformation 3D transformations + \ingroup group_core_tools + \defgroup group_core_trackers Generic tracker + Generic tracker tools. */ /*! - \ingroup Transformation - \defgroup RotTransformation Rotation and their representation + \ingroup group_core_tools + \defgroup group_core_geometry 2D and 3D geometry + 2D and 3D geometry. */ /*! - \ingroup Transformation - \defgroup TransTransformation Translation + \ingroup group_core_tools + \defgroup group_core_bridges Bridges over other frameworks + Conversion from/to OpenCV... */ /*! - \ingroup Transformation - \defgroup PoseTransformation Pose + \ingroup group_core_tools + \defgroup group_core_mutex Mutex + Mutex. */ /*! - \ingroup Transformation - \defgroup HomographyTransformation Homography + \ingroup group_core_tools + \defgroup group_core_debug Debug and exceptions + Debug and exceptions. */ /*! - \ingroup Transformation - \defgroup TwistTransformation Twist transformation matrix + \ingroup group_core_tools + \defgroup group_core_network Networking + Networking. */ /*! - \ingroup Transformation - \defgroup ExpMapTransformation Exponential map + \ingroup group_core_tools + \defgroup group_core_histogram Histogram + Histogram. */ /*! - \ingroup Transformations - \defgroup VisionTransformation Other related transformations + \ingroup group_core_tools + \defgroup group_core_files_io Files and directories + Files and directories. */ /*! - \ingroup VisionTransformation - \defgroup CameraModelTransformation Camera models + \ingroup group_core_tools + \defgroup group_core_time Time management + Time management. */ -/* - ****************************************** - * Image - ****************************************** - */ -/*! - \ingroup Capabilities - \defgroup Image Image -*/ +/******************************************* + * Module io + *******************************************/ /*! - \ingroup Image - \defgroup ImageManipulation Image manipulation + \defgroup module_io io: I/O module + I/O module content. */ /*! - \ingroup ImageManipulation - \defgroup ImageContainer Image representation + \ingroup module_io + \defgroup group_io_image Image I/O + Image reading and writing. */ /*! - \ingroup ImageManipulation - \defgroup ImageRW Reading and writing images + \ingroup module_io + \defgroup group_io_video Video I/O + Video reading and writing. */ /*! - \ingroup ImageManipulation - \defgroup ImageGUI Graphical user interface + \ingroup module_io + \defgroup group_io_keyboard Keyboard I/O + Keyboard management. */ /*! - \ingroup ImageManipulation - \defgroup ImageConversion Image conversion + \ingroup module_io + \defgroup module_io_cmd_parser Command line parser I/O + Command line parser. */ /*! - \ingroup ImageManipulation - \defgroup ImageTool Image tools -*/ -/*! - \ingroup ImageManipulation - \defgroup Framegrabber Image acquisition + \ingroup module_io + \defgroup group_io_parallel_port Parallel port I/O + Parallel port I/O. */ +/******************************************* + * Module visual_features + *******************************************/ /*! - \ingroup Image - \defgroup ImageProcessing Image processing -*/ -/*! - \ingroup ImageProcessing - \defgroup ImageFiltering Image filtering + \defgroup module_visual_features visual_features: Visual features module + Visual features module content. */ /*! - \ingroup ImageProcessing - \defgroup Histogram Image histogram + \ingroup module_visual_features + \defgroup group_visual_features Visual features + Visual features. */ /*! - \ingroup Image - \defgroup ImageSimulator Image simulator + \ingroup module_visual_features + \defgroup group_visual_features_builder Visual features builder + Visual features builder. */ - -/* - ****************************************** - * Tracking - ****************************************** - */ -/*! - \ingroup Capabilities - \defgroup Tracking Tracking -*/ -/*! - \ingroup Tracking - \defgroup TrackingFeature Tracking features (3D transformation and forward projection) -*/ -/*! - \ingroup Tracking - \defgroup TrackingMoments Tracking 2D image moments -*/ -/*! - \ingroup Tracking - \defgroup TrackingImage Tracking in image sequences -*/ +/******************************************* + * Module gui + *******************************************/ /*! - \ingroup TrackingImage - \defgroup TrackingImageBasic Basic algorithms + \defgroup module_gui gui: Graphical user interface module + Graphical user interface module content. */ /*! - \ingroup TrackingImage - \defgroup TrackingImagePoint Point tracker + \ingroup module_gui + \defgroup group_gui_display Display device + Display device interface. */ /*! - \ingroup TrackingImage - \defgroup TrackingImageME Moving edges tracker + \ingroup module_gui + \defgroup group_gui_plotter Drawing of 2D or 3D graphics + Drawing of 2D or 3D graphics. */ /*! - \ingroup TrackingImage - \defgroup ModelBasedTracking Model based tracker + \ingroup module_gui + \defgroup group_gui_projection Forward projection + Forward projection interface. */ -/* - ****************************************** - * Computer vision - ****************************************** - */ + +/******************************************* + * Module ar + *******************************************/ /*! - \ingroup Capabilities - \defgroup ComputerVision Computer Vision + \defgroup module_ar ar: Augmented reality module + Augmented reality module content. */ /*! - \ingroup ComputerVision - \defgroup Calibration Calibration + \ingroup module_ar + \defgroup group_ar_renderer Renderer + Renderer interfaces. */ /*! - \ingroup ComputerVision - \defgroup CameraModel Camera models + \ingroup module_ar + \defgroup group_ar_simulator Simulator + Simulator interfaces. */ + +/******************************************* + * Module detection + *******************************************/ /*! - \ingroup ComputerVision - \defgroup Homography Homography estimation + \defgroup module_detection detection: Detection module + Detection module content. */ /*! - \ingroup ComputerVision - \defgroup PlanarSurfaceDetector Planar surface detector + \ingroup module_detection + \defgroup group_detection_barcode Bar code detection + Bar code detection. */ /*! - \ingroup ComputerVision - \defgroup Pose Pose estimation + \ingroup module_detection + \defgroup group_detection_face Face detection + Face detection. */ -/* - ****************************************** - * Building a visual feature task - ****************************************** + +/******************************************* + * Module tracker + *******************************************/ + /*! + \defgroup module_tracker tracker: ViSP trackers + ViSP trackers. */ + +/******************************************* + * Module mbt + *******************************************/ /*! - \ingroup Capabilities - \defgroup Vs Building a visual servoing task + \ingroup module_tracker + \defgroup module_mbt mbt: Model-based tracker module + Model-based tracker module content. */ /*! - \ingroup Vs - \defgroup VsFeature Visual features + \ingroup module_mbt + \defgroup group_mbt_trackers Trackers + Model-based trackers. */ /*! - \ingroup VsFeature - \defgroup VsFeature2 2D visual features + \ingroup module_mbt + \defgroup group_mbt_features Features + Model-based trackers features. */ /*! - \ingroup VsFeature - \defgroup VsFeature3 3D visual features + \ingroup module_mbt + \defgroup group_mbt_faces Faces management + Faces management including visibility. */ /*! - \ingroup VsFeature - \defgroup VsFeatureGeneric Generic visual features + \ingroup module_mbt + \defgroup group_mbt_xml_parser XML parsers + XML parsers dedicated to model-based trackers. */ +/******************************************* + * Module robot + *******************************************/ /*! - \ingroup VsFeature - \defgroup VsFeatureDisplay Display of visual features + \defgroup module_robot robot: Robot module + Robot module content. */ /*! - \ingroup VsFeature - \defgroup VsFeatureBuilder Visual features builder + \ingroup module_robot + \defgroup group_robot_real Real robots + Real robots interfaces. */ /*! - \ingroup Vs - \defgroup VsTask Task and control laws + \ingroup group_robot_real + \defgroup group_robot_real_gantry Gantry robot + Afma6 gantry robot interfaces. */ - -/* - ****************************************** - * Working with robots - ****************************************** - */ /*! - \ingroup Capabilities - \defgroup Robot Working with robots + \ingroup group_robot_real + \defgroup group_robot_real_cylindrical Cylindrical robot + Afma4 cylindrical robot interfaces. */ /*! - \ingroup Robot - \defgroup RobotSimu Robot simulation + \ingroup group_robot_real + \defgroup group_robot_real_unicycle Unicycle robot + Pioneer P3DX unicycle robot interfaces. */ /*! - \ingroup RobotSimu - \defgroup RobotSimuWithVisu Simulation with 3D visualization + \ingroup group_robot_real + \defgroup group_robot_real_ptu Pan-tilt unit + Pan-tilt unit interfaces. */ /*! - \ingroup RobotSimu - \defgroup RobotSimuWithoutVisu Simulation without visualization. + \ingroup group_robot_real + \defgroup group_robot_real_arm Anthropomorphic arm + Anthropomorphic arm interfaces. */ - /*! - \ingroup Robot - \defgroup RealRobot Real robots + \ingroup group_robot_real + \defgroup group_robot_real_template New robot interface (template) + Template for users that want to integrate their own real-robot. */ /*! - \ingroup RealRobot - \defgroup Afma4 Afma4 cylindrical robot + \ingroup module_robot + \defgroup group_robot_simu Robot simulation + Simulated robots interfaces. */ /*! - \ingroup RealRobot - \defgroup Afma6 Afma6 gantry robot + \ingroup group_robot_simu + \defgroup group_robot_simu_gantry Gantry robot simulation + Gantry robot interfaces. */ /*! - \ingroup RealRobot - \defgroup Biclops Biclops pan-tilt head + \ingroup group_robot_simu + \defgroup group_robot_simu_arm Anthropomorphic arm simulation + Anthropomorphic arm interfaces. */ /*! - \ingroup RealRobot - \defgroup Ptu46 Ptu-46 pan-tilt head + \ingroup group_robot_simu + \defgroup group_robot_simu_unicycle Unicycle robot simulation + Pioneer P3DX unicycle robot interfaces. */ /*! - \ingroup RealRobot - \defgroup Viper Adept Viper 6 dof robot + \ingroup group_robot_simu + \defgroup group_robot_simu_camera Free flying camera simulation + Free flying camera interfaces. */ /*! - \ingroup RealRobot - \defgroup Cycab Cycab car-like mobile robot + \ingroup module_robot + \defgroup group_robot_image_simu Image simulation + Image simulation. */ + +/******************************************* + * Module sensor + *******************************************/ /*! - \ingroup RealRobot - \defgroup Pioneer Pioneer mobile robot + \defgroup module_sensor sensor: Sensor module + Sensor module content. It provides bridges over drivers to acquire data from some sensors. */ -/* - ****************************************** - * Tools - ****************************************** - */ /*! - \ingroup Capabilities - \defgroup Tool Tools + \ingroup module_sensor + \defgroup group_sensor_laserscanner Laser scanner + Laser scanner interfaces. */ -/*! - \ingroup Tool - \defgroup ArgumentParser Command line parsing +/*! + \ingroup module_sensor + \defgroup group_sensor_camera Camera + Camera interfaces. */ -/*! - \ingroup Tool - \defgroup Mutex Mutex +/*! + \ingroup module_sensor + \defgroup group_sensor_rgbd RGB-D sensor + RGB-D sensor interfaces. */ +/******************************************* + * Module tt + *******************************************/ /*! - \ingroup Tool - \defgroup Network Network + \ingroup module_tracker + \defgroup module_tt tt: Template tracker module + Template tracker module content. */ /*! - \ingroup Tool - \defgroup plot Drawing of 2D or 3D graphics + \ingroup module_tt + \defgroup group_tt_tracker Trackers + Classes dedicated to template tracking. */ /*! - \ingroup Tool - \defgroup System System + \ingroup module_tt + \defgroup group_tt_warp Warping function + Classes that implement warping functions that are estimated by the template trackers. */ /*! - \ingroup System - \defgroup Time Time management + \ingroup module_tt + \defgroup group_tt_tools Tools + Tools used by template trackers. */ -/*! - \ingroup System - \defgroup ParallelPort Parallel port +/******************************************* + * Module tt_mi + *******************************************/ + /*! + \ingroup module_tracker + \defgroup module_tt_mi tt_mi: Template tracker based on mutual information module + Template tracker based on mutual information module content. This module is an + extension of \ref module_tt where mutual information cost function is introduced. */ /*! - \ingroup System - \defgroup Keyboard Keyboard + \ingroup module_tt_mi + \defgroup group_tt_mi_tracker Trackers + Classes dedicates to template tracking with mutual information cost function. */ -/*! - \ingroup Tool - \defgroup IO Input/output +/******************************************* + * Module me + *******************************************/ + /*! + \ingroup module_tracker + \defgroup module_me me: Moving-edges tracker module + Moving-edges tracker module. */ -/*! - \ingroup IO - \defgroup FileDirectories File and directories +/******************************************* + * Module blob + *******************************************/ + /*! + \ingroup module_tracker + \defgroup module_blob blob: Blob tracker module + Blob tracker module. */ -/*! - \ingroup Tool - \defgroup DebugException Debug and exceptions +/******************************************* + * Module klt + *******************************************/ + /*! + \ingroup module_tracker + \defgroup module_klt klt: Kanade Lucas tracker module + Kanade Lucas tracker module. */ -/*! - \ingroup DebugException - \defgroup Debug Debug +/******************************************* + * Module vision + *******************************************/ + /*! + \defgroup module_vision vision: Computer vision module + Computer vision module content. */ /*! - \ingroup DebugException - \defgroup Exception Exceptions + \ingroup module_vision + \defgroup group_vision_calib Camera calibration + Camera calibration algorithms. */ - -/* - ****************************************** - * Drivers - ****************************************** - */ /*! - \ingroup Capabilities - \defgroup Driver Drivers + \ingroup module_vision + \defgroup group_vision_homography Homography estimation + Homography estimation algorithms. */ /*! - \ingroup Driver - \defgroup RobotDriver Robot drivers + \ingroup module_vision + \defgroup group_vision_pose Pose estimation + Pose estimation algorithms. */ /*! - \ingroup Driver - \defgroup CameraDriver Camera drivers + \ingroup module_vision + \defgroup group_vision_keypoints Keypoints detection, matching and classifiers + Keypoints detection and matching algorithms but also classifiers. */ -/*! - \ingroup Driver - \defgroup LaserDriver Laser scanner drivers +/******************************************* + * Module vs + *******************************************/ + /*! + \defgroup module_vs vs: Visual servoing module + Visual servoing module content. */ /*! - \ingroup Driver - \defgroup KinectDriver Kinect driver + \ingroup module_vs + \defgroup group_task Task and control laws + Classes used to define task and control laws. */ diff --git a/doc/tutorial-bridge-opencv.doc b/doc/tutorial-bridge-opencv.doc new file mode 100644 index 0000000000000000000000000000000000000000..e7c4993722506dfa7a2dc4a450ea095d2a0371c5 --- /dev/null +++ b/doc/tutorial-bridge-opencv.doc @@ -0,0 +1,114 @@ +/** + +\page tutorial-bridge-opencv Tutorial: Bridge over OpenCV +\tableofcontents + +ViSP is interfaced with OpenCV third party. In this tutorial we explain how to convert data such as camera parameters or images from ViSP to OpenCV or \e vice \e versa. + +\section tutorial_bridge_opencv_cam Camera parameters conversions + +ViSP camera parameters are implemented in vpCameraParameters class. If you want to calibrate a camera with ViSP tools follow \ref tutorial-calibration. + +Let us recall the pinhole camera model implemented in ViSP. In this model, a scene view is formed by projecting 3D points into the image plane using a perspective transformation. + + +\f[ + \left[ \begin{array}{c} + u \\ + v \\ + 1 + \end{array}\right] = + \left[ \begin{array}{ccc} + u_0 & 0 & p_x \\ + 0 & v_0 & p_y \\ + 0 & 0 & 1 + \end{array}\right] + \left[ \begin{array}{c} + X_c \\ + Y_c \\ + Z_c + \end{array}\right] + \f] + +where: + +- \f$(X_c,Y_c,Z_c)\f$ are the coordinates of a 3D point in the camera frame +- \f$(u,v)\f$ are the coordinates in pixels of the projected 3D point +- \f$(u_0,v_0)\f$ is a principal point that is usually near the image center +- \f$(p_x,p_y)\f$ are the focal lengths expressed in pixel units. + +When \f$Z_c \neq 0\f$, the previous equation si equivalent to the following: +\f[ + \begin{array}{lcl} + x &=& X_c / Z_c \\ + y &=& Y_c / Z_c \\ + u &=& u_0 + x \; p_x \\ + v &=& v_0 + y \; p_y + \end{array} + \f] + +Real lenses usually have some radial distortion. So, the above model is extended as: + +\f[ + \begin{array}{lcl} + x &=& X_c / Z_c \\ + y &=& Y_c / Z_c \\ + x^{'} &=& x (1 + k_{ud} r^2) \\ + y^{'} &=& y (1 + k_{ud} r^2) \\ + r^2 &=& x^2 + y^2 \\ + u &=& u_0 + x^{'} \; p_x \\ + v &=& v_0 + y^{'} \; p_y + \end{array} + \f] + +where \f$k_{ud}\f$ is the first order radial distorsion. Higher order distorsion coefficients are not considered in ViSP. + +\note In ViSP we introduce an extra parameter named \f$k_{du}\f$ which is the radial first order distorsion that allows to transform pixels in meters. If this parameter is unknown as in OpenCV a good approximation is to consider \f$k_{du} = - k_{ud}\f$ + +Even if OpenCV notations are different, this model is exactly the same then the one used in OpenCV and described <a href="http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html">here</a> where higher order OpenCV distorsion parameters are turned to 0. + +The following table gives the correspondances between ViSP and OpenCV parameters: + + +\f[ + \begin{array}{l|l} + ViSP & OpenCV \\ \hline + u_0 & c_x\\ + v_0 & c_y \\ + p_x & f_x \\ + p_y & f_y \\ + k_{ud} & k_1 \\ + k_{du} & -k_1 \\ + & k_2 = 0 \\ + & k_3 = 0 \\ + & k_4 = 0 \\ + & k_5 = 0 \\ + & k_6 = 0 \\ + & p_1 = 0 \\ + & p_2 = 0 + \end{array} + \f] + +From a coding point of view, let us consider the following code also available in tutorial-bridge-opencv.cpp where we initialize camera parameters using ViSP: + +\snippet tutorial-bridge-opencv.cpp Set ViSP camera parameters + +These parameters could be used to initialize OpenCV camera parameters: + +\snippet tutorial-bridge-opencv.cpp Set OpenCV camera parameters + +\section tutorial_bridge_opencv_image Image conversions + +ViSP image is implemented in vpImage class, while OpenCV images in cv::Mat class. All the functions that allow image conversion from ViSP to OpenCV or \e vice \e versa are implemented in vpImageConvert. + +Some examples are available in tutorial-bridge-opencv.cpp. + +For example, the following code allow to read an image with ViSP: + +\snippet tutorial-bridge-opencv.cpp Load ViSP image + +and then convert the image in OpenCV using: + +\snippet tutorial-bridge-opencv.cpp Convert ViSP 2 OpenCV image + +**/ \ No newline at end of file diff --git a/doc/tutorial-calibration.doc b/doc/tutorial-calibration.doc index f4d4bca08bddba125ab06c830172dc1dbc4b1ffd..d9bb20a8a028f2dfaee009e694293b725eaf1d29 100644 --- a/doc/tutorial-calibration.doc +++ b/doc/tutorial-calibration.doc @@ -33,7 +33,9 @@ In this model we consider the parameters \f$(u_0,v_0,p_x,p_y, k_{ud}, k_{du})\f$ - \f$(p_x, p_y)\f$ are the ratio between the focal length and the size of a pixel; - \f$(k_{ud}, k_{du})\f$ are the parameters used to correct the distortion. -Note that the container dedicated to camera parameters is implemented in the vpCameraParameters class. It allows to consider two kind of models; with or without distortion. +\note It may be useful to make a tour in \ref tutorial-bridge-opencv that makes in relation the camera model used in ViSP with the one proposed by OpenCV. + +\note Note also that the container dedicated to camera parameters is implemented in the vpCameraParameters class. It allows to consider two kind of models; with or without distortion. The calibration process allows to estimate the values of these parameters. To this end, one of the following calibration grid can be used: - a black and white chessboard [<a href="http://www.irisa.fr/lagadic/visp/img/OpenCV_Chessboard.pdf">OpenCV_Chessboard.pdf</a>]; diff --git a/doc/tutorial-detection-object.doc b/doc/tutorial-detection-object.doc index 553c9527431c4a726144448af5d7e0a90261ddf7..08fc9608a1e23f73149fed140b8a75e3f013df58 100644 --- a/doc/tutorial-detection-object.doc +++ b/doc/tutorial-detection-object.doc @@ -35,7 +35,12 @@ The next section presents an example of the detection and the pose estimation of \subsection detection_object_teabox_example Teabox detection and pose estimation -The following example comes from tutorial-detection-object-mbt.cpp and shows the different steps to detect and get the pose of a teabox. +The following video shows the resulting detection and localization of a teabox that is learned on the first image of the video. + +\htmlonly<iframe width="420" height="315" src="https://www.youtube.com/embed/3rCvq5_UJvw" frameborder="0" allowfullscreen></iframe> +\endhtmlonly + +The corresponding code is available in tutorial-detection-object-mbt.cpp. It contains the different steps to learn the teabox object on one image (the first image of the video) and then detect and get the pose of the teabox in the rest of the video. \include tutorial-detection-object-mbt.cpp @@ -118,8 +123,91 @@ Now, for the Ransac pose estimation part : - basically, a Ransac method is composed of two steps repeated a certain number of iterations: first we pick randomly 4 points and estimate the pose, the second step is to keep all points which sufficienly "agree" (the reprojection error is below a threshold) with the pose determinated in the first step. These points are inliers and form the consensus set, the other are outliers. If enough points are in the consensus set (here 20 % of all the points), the pose is refined and returned, otherwise another iteration is made (here 200 iterations maximum). -Below you will also find the content of detection-config.xml configuration file, also provided in this example. It allows to use FAST detector and ORB extractor. +Below you will also find the content of detection-lconfig.xml configuration file, also provided in this example. It allows to use FAST detector and ORB extractor. \include detection-config.xml +\section detection_object_additional_functionalities Additional functionalities + +\subsection detection_object_multiple_learning How to learn keypoints from multiple images + +The following video shows an extension of the previous example where here we learn a cube from 3 images and then detect an localize the cube in all the images of the video. + +\htmlonly +<iframe width="420" height="315" src="https://www.youtube.com/embed/7akuCtViznE" frameborder="0" allowfullscreen></iframe> +\endhtmlonly + +The corresponding source code is given in tutorial-detection-object-mbt2.cpp. If you have a look on this file you will find the following. + +Before starting with the keypoints detection and learning part, we have to set the correct pose for the tracker using a predefined pose: + +\snippet tutorial-detection-object-mbt2.cpp Set tracker pose + +One good thing to do is to refine the pose by running one iteration of the model-based tracker: + +\snippet tutorial-detection-object-mbt2.cpp Refine pose + +The vpKeyPoint::buildReference() allows to append the current detected keypoints with those already present by setting the function parameter append to true. + +But before that, the same learning procedure must be done in order to train on multiple images. We detect keypoints on the desired image: + +\snippet tutorial-detection-object-mbt2.cpp Keypoints reference detection + +Then, we keep only keypoints that are located on the object faces: + +\snippet tutorial-detection-object-mbt2.cpp Keypoints selection on faces + +And finally, we build the reference keypoints and we set the flag append to true to say that we want to keep the previously learned keypoints: + +\snippet tutorial-detection-object-mbt2.cpp Keypoints build reference + +\subsection detection_object_display_multiple_images How to display the matching when the learning is done on multiple images + +In this section we will explain how to display the matching between keypoints detected in the current image and their correspondances in the reference images that are used during the learning stage, as given in the next video: + +\htmlonly +<iframe width="420" height="315" src="https://www.youtube.com/embed/q16lXMIVDbM" frameborder="0" allowfullscreen></iframe> +\endhtmlonly + +\warning If you want to load the learning data from a file, you have to use a learning file that contains training images (with the parameter saveTrainingImages vpKeyPoint::saveLearningData() set to true when saving the file, by default it is). + +Before showing how to display the matching for all the training images, we have to attribute an unique identifier (a positive integer) for the set of keypoints learned for a particular image during the training process: + +\snippet tutorial-detection-object-mbt2.cpp Keypoints build reference + +It permits to link the training keypoints with the correct corresponding training image. + +After that, the first thing to do is to create the image that will contain the keypoints matching with: + +\snippet tutorial-detection-object-mbt2.cpp Create image matching + +The previous line allows to allocate an image with the correct size according to the number of training images used. + +Then, we have to update for each new image the matching image with the current image: + +\snippet tutorial-detection-object-mbt2.cpp Insert image matching + +\note The current image will be inserted preferentially at the center of the matching image if it possible. + +And to display the matching we use: + +\snippet tutorial-detection-object-mbt2.cpp Display image matching + +We can also display the RANSAC inliers / outliers in the current image and in the matching image: + +\snippet tutorial-detection-object-mbt2.cpp Display RANSAC inliers + +\snippet tutorial-detection-object-mbt2.cpp Display RANSAC outliers + +The following code shows how to retrieve the RANSAC inliers and outliers: + +\snippet tutorial-detection-object-mbt2.cpp Get RANSAC inliers outliers + +Finally, we can also display the model in the matching image. For that, we have to modify the principal point offset of the intrinsic parameter. +This is more or less an hack as you have to manually change the principal point coordinate to make it works. + +\snippet tutorial-detection-object-mbt2.cpp Display model image matching + +\note You can refer to the full code in the section \ref detection_object_multiple_learning to have an example of how to learn from multiple images and how to display all the matching. + */ diff --git a/doc/tutorial-getting-started-iOS.doc b/doc/tutorial-getting-started-iOS.doc index c36ea6c9bf3e080d0b48f1b8021baec83bddbe5b..cd1ff551995ff74ef23cbb57afcfc892454f6659 100644 --- a/doc/tutorial-getting-started-iOS.doc +++ b/doc/tutorial-getting-started-iOS.doc @@ -43,9 +43,9 @@ Here is the detailed explanation of the source, line by line : \code #include <vector> -#include <visp/vpConfig.h> -#include <visp/vpHomography.h> -#include <visp/vpMeterPixelConversion.h> +#include <visp3/core/vpConfig.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpMeterPixelConversion.h> \endcode Include all the headers for homography computation in ViewController.mm. diff --git a/doc/tutorial-getting-started.doc b/doc/tutorial-getting-started.doc index 2a51888a323f75cb049e307960e05654c5bf9153..7d386ce167b6314150f3204d60aebe2963c56560 100644 --- a/doc/tutorial-getting-started.doc +++ b/doc/tutorial-getting-started.doc @@ -3,17 +3,7 @@ \page tutorial-getting-started Tutorial: How to create and build a CMake project that uses ViSP on Unix or Windows \tableofcontents -\note We assume in this tutorial that you have successfully installed ViSP. Information on ViSP installation is provided in: -- \ref tutorial-install-ubuntu -- \ref tutorial-install-fedora -- \ref tutorial-install-opensuse -- \ref tutorial-install-raspberry -- \ref tutorial-install-win7 -- \ref tutorial-install-win81-msvc -- \ref tutorial-install-win81-mingw64 -- \ref tutorial-install-iOS -- \ref tutorial-install-ubuntu-package -- or on <a href="http://www.irisa.fr/lagadic/visp/install.html">Install from source page</a> +\note We assume in this tutorial that you have successfully installed ViSP either with an \ref tuto_install_sdk or with an \ref tuto_install_src. In this tutorial you will learn how to use ViSP either on Unix-like systems (including OSX, Fedora, Ubuntu, Debian, ...) or on Windows. @@ -148,17 +138,17 @@ make By now you should have an executable called \c tutorial-viewer. You just have to run it giving an image location as an argument: \code -./tutorial_viewer lena.ppm +./tutorial_viewer monkey.ppm \endcode Here is a screen shot of the resulting output window : - \image html img-lena.png + \image html img-monkey.png \section image_win On Windows -We suppose from now, that you have created a folder (let say \c C:/ViSP/ViSP-started) that contains the following files: CMakeLists.txt, tutorial_viewer.cpp and lena.ppm. These files are also provider in ViSP source code, in \c tutorial/image folder. +We suppose from now, that you have created a folder (let say \c C:/ViSP/ViSP-started) that contains the following files: CMakeLists.txt, tutorial_viewer.cpp and monkey.ppm. These files are also provider in ViSP source code, in \c tutorial/image folder. \subsection image_win_config Configure your project @@ -202,8 +192,9 @@ We suppose from now, that you have created a folder (let say \c C:/ViSP/ViSP-sta - Here is a screen shot of the resulting output window : - \image html img-lena-win.jpg + \image html img-monkey-win.jpg +\subsection image_next Next tutorial You are now ready to see the \ref tutorial-grabber or \ref tutorial-image-filtering. */ diff --git a/doc/tutorial-grabber.doc b/doc/tutorial-grabber.doc index 3c2cf4df648651f09e7165ea3c2c82eb4c92ff93..eefc95084a24813d96a98cf6b6c5278ddd87fdb2 100644 --- a/doc/tutorial-grabber.doc +++ b/doc/tutorial-grabber.doc @@ -4,7 +4,7 @@ \tableofcontents - \section grabber-camera-firewire-unix Images from firewire cameras +\section grabber-camera-firewire-unix Images from firewire cameras The next example also available in tutorial-grabber-1394.cpp shows how to use a framegrabber to acquire color images from a firewire camera under Unix. The following example suppose that libX11 and libdc1394-2 3rd party are available. @@ -102,5 +102,6 @@ To synchronize the video decoding with the video framerate, we measure the begin The synchronization is done by waiting from the beginning of the iteration the corresponding time expressed in milliseconds by using: \snippet tutorial-video-reader.cpp vpVideoReader loop rate +\section grabber-next Next tutorial You are now ready to see the next \ref tutorial-tracking-blob. */ diff --git a/doc/tutorial-ibvs.doc b/doc/tutorial-ibvs.doc index be371d3c41281fed77098cf318deb12fd0bec95a..0f5cc157179ef0f4d588a824e4bd9a7204de0442 100644 --- a/doc/tutorial-ibvs.doc +++ b/doc/tutorial-ibvs.doc @@ -56,19 +56,19 @@ The following example available in tutorial-ibvs-4pts.cpp shows how to use ViSP Now we give a line by line description of the source: \code -#include <visp/vpFeatureBuilder.h> +#include <visp3/core/vpFeatureBuilder.h> \endcode Include a kind of common header for all the classes that implement visual features, especially in our case vpFeaturePoint that will allow us to handle \f${\bf x} = (x,y)\f$ described in the \ref ibvs_intro. \code -#include <visp/vpServo.h> +#include <visp3/vs/vpServo.h> \endcode Include the header of the vpServo class that implements the control law \f[ {\bf v}_c = -\lambda {\bf L}_{\bf x}^{+} {\bf e} \f] described in the \ref ibvs_intro. \code -#include <visp/vpSimulatorCamera.h> +#include <visp3/robot/vpSimulatorCamera.h> \endcode Include the header of the vpSimulatorCamera class that allows to simulate a 6 dof free flying camera. @@ -183,10 +183,10 @@ We explain now the new lines that were introduced. First, we add the headers of the classes that are used to introduce the viewers and some display functionality. vpProjectionDisplay is the class that allows to handle the external view from a given camera position, while vpServoDisplay allows to display in overlay the position of the current and desired features in the internal camera view. \code -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpProjectionDisplay.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpDisplayX.h> +#include <visp3/core/vpDisplayGDI.h> +#include <visp3/core/vpProjectionDisplay.h> +#include <visp3/vs/vpServoDisplay.h> \endcode Secondly, we introduce the function display_trajectory() that allows to display the trajectory of the current features in the image. From the 3D coordinates of the points given in the object frame, we compute their respective position in the camera frame, then we apply the perspective projection before retrieving their positions in sub-pixels in the image thanks to the camera parameters. The successive sub-pixel positions are stored in a vector named \c traj and displayed as a green trajectory. @@ -279,7 +279,7 @@ We explain now the new lines that were introduced. First we include the header of the wireframe simulator. \code -#include <visp/vpWireFrameSimulator.h> +#include <visp3/robot/vpWireFrameSimulator.h> \endcode Then in the main(), we create an instance of the simulator. First we initialize the object in the scene. We recall that the target is a 20cm by 20cm square. This is exactly an object handled by the simulator and defined as a vpWireFrameSimulator::PLATE. By vpWireFrameSimulator::D_STANDARD we indicate that the object displayed at the desired position is also a PLATE. Secondly we initialize the camera position wrt to the object using \c cMo, and also the desired camera position, the one the camera has to reach at the end of the servo, using \c cdMo. Next we initialize the position of a static external camera that will observe the simulated camera during the servoing using \c cextMo. All these poses are define wrt the object frame. Finally, we set the intrinsic camera parameters used for the internal and external viewers. @@ -387,5 +387,6 @@ depends on \f$(x,y)\f$ but also on \f$Z\f$ the depth of the feature, we need to } \endcode +\section ibvs_next Next tutorial You are now ready to see the \ref tutorial-simu-robot-pioneer and \ref tutorial-boost-vs. */ diff --git a/doc/tutorial-image-filtering.doc b/doc/tutorial-image-filtering.doc index df5b59e57290d579430ee11c9dd26746b86e589a..44ddd7298a6639d1838fa51d405f98814214a0e1 100644 --- a/doc/tutorial-image-filtering.doc +++ b/doc/tutorial-image-filtering.doc @@ -13,21 +13,21 @@ Let us consider the following source code that comes from tutorial-image-filter. \include tutorial-image-filter.cpp -Once build, you should have \c tutorial-image-filter binary. It shows how to apply different filters on an input image. Here we will consider lena.pgm as input image. +Once build, you should have \c tutorial-image-filter binary. It shows how to apply different filters on an input image. Here we will consider monkey.pgm as input image. -\image html img-lena-gray.png +\image html img-monkey-gray.png To see the resulting filtered images, just run: \code -./tutorial-image-filter lena.pgm +./tutorial-image-filter monkey.pgm \endcode The following sections give a line by line explanation of the source code dedicated to image filtering capabilities. \section blur Gaussian blur -Lena input image is read from disk and is stored in \c I which is a gray level image declared as +Monkey input image is read from disk and is stored in \c I which is a gray level image declared as \snippet tutorial-image-filter.cpp vpImage construction @@ -37,7 +37,7 @@ To apply a Gaussian blur to this image we first have to declare a resulting floa The resulting image is the following: -\image html img-lena-blured-default.png +\image html img-monkey-blured-default.png It is also possible to specify the Gaussian filter kernel size and the Gaussian standard deviation (sigma) using: @@ -47,7 +47,7 @@ vpImageFilter::gaussianBlur(I, F, 7, 2); // Kernel size: 7, sigma: 2 We thus obtain the following image: -\image html img-lena-blured-var2.png +\image html img-monkey-blured-var2.png \section gradient Gradients computation @@ -61,7 +61,7 @@ Gradients along Y could be obtained using: The resulting floating-point images \c dIx, \c dIy are the following: -\image html img-lena-dIxy.png +\image html img-monkey-dIxy.png \section canny Canny edge detector @@ -77,7 +77,7 @@ Where: The resulting image \c C is the following: -\image html img-lena-canny.png +\image html img-monkey-canny.png \section convolution Convolution @@ -103,7 +103,7 @@ After the declaration of a new floating-point image \c Gx, the convolution is ob The content of the filtered image \c Gx is the following. -\image html img-lena-sobel.png +\image html img-monkey-sobel.png \section pyramid Gaussian image pyramid @@ -111,8 +111,9 @@ To construct a pyramid of Gaussian filtered images as a vector of images impleme \snippet tutorial-image-filter.cpp Gaussian pyramid The content of \c pyr[0], \c pyr[1], \c pyr[2] is the following: -\image html img-lena-pyr.png +\image html img-monkey-pyr.png +\section img_filtering_next Next tutorial You are now ready to see the next \ref tutorial-tracking-blob. */ diff --git a/doc/tutorial-install-centos.doc b/doc/tutorial-install-centos.doc index 5f59d50c28db6ea729cb3101a20eae7c9408bb6b..cc1ad3a0a41bebf99d752400d478e3c2abad16f2 100644 --- a/doc/tutorial-install-centos.doc +++ b/doc/tutorial-install-centos.doc @@ -7,7 +7,7 @@ In this tutorial you will learn how to install ViSP from source on CentOS. These \note Concerning ViSP installation, we provide also other \ref tutorial. -\section install_centos_required Required packages +\section install_centos_required Install prerequisities - gcc 4.4.x or later. This can be installed with: \code @@ -18,60 +18,217 @@ sudo yum install gcc-c++ sudo yum install cmake \endcode -ViSP is interfaced with several optional <a href="http://www.irisa.fr/lagadic/visp/libraries.html">third-party libraries</a>. The installation of the corresponding packages is described in \ref install_centos_3rdparty section. -\section install_centos_get_source Getting ViSP source code +\section install_centos_3rdparty Install 3rd parties + +ViSP is interfaced with several 3rd party libraries. The <a href="http://visp.inria.fr/software-architecture">complete list is provided here</a>. + +\subsection install_centos_3rdparty_recommended Recommended 3rd parties + +We recommend to install the following: + +- OpenCV +\code +sudo yum install opencv-devel +\endcode +- libX11 to be able to open a window to display images +\code +sudo yum install libX11-devel +\endcode +- lapack to benefit from optimized mathematical capabilities +\code +sudo yum install lapack-devel +\endcode +- libdc1394 to grab images from firewire cameras +\code +sudo yum install libdc1394-devel +\endcode +- libv4l to grab images from usb or analogic cameras +\code +sudo yum install libv4l-devel +\endcode +- libxml2 to be able to configure the model-based trackers from xml files +\code +sudo yum install libxml2-devel +\endcode + +\subsection install_centos_3rdparty_other Other optional 3rd parties + +We give also the way to install other 3rd party libraries to enable specific capabilities. + +- Coin, to be able to support vrml cad model used by the model-based trackers +\code +sudo yum install Coin2-devel +\endcode +- libjpeg and libpng to support jpeg and png images respectively (only useful if OpenCV is not installed) +\code +sudo yum install libjpeg-devel libpng-devel +\endcode + + +\section install_centos_install_visp Install ViSP from source code +\subsection install_centos_get_source Getting ViSP source code There are different ways to get ViSP source code: -- You can download the <a href="http://www.irisa.fr/lagadic/visp/download.html#latest">latest stable release</a> as a zip or a tarball. Once downloaded, uncompress the file using either +- You can download the <a href="http://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once downloaded, uncompress the file using either \code -tar xvzf ViSP-2.10.0.tar.gz +tar xvzf visp-x.y.z.tar.gz \endcode or \code -unzip ViSP-2.10.0.zip +unzip visp-x.y.z.zip \endcode -- You can also download a more <a href="http://www.irisa.fr/lagadic/visp/download.html#snapshot">recent snapshot</a>. Once downloaded, uncompress the file using +- You can also download a <a href="http://visp.inria.fr/download#snapshot">daily snapshot</a>. Once downloaded, uncompress the file using \code -unzip ViSP-2.y.z-snapshot-2015.mm.dd.zip +tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz \endcode -- Or you get the cutting-edge ViSP from Subversion repository. To this end you have first to install subversion + +- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> using the following command \code -sudo yum install subversion +$ git clone https://github.com/lagadic/visp.git \endcode -and then use the following command + +We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c $HOME/visp + +\subsection install_centos_config Configuring ViSP from source + +- Create first a directory denoted \<binary_dir\> where you want to build ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries. \code -svn checkout svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP ViSP-trunk +cd $HOME; mkdir visp-build \endcode -We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c $HOME/ViSP-2.10.0 +- Enter the \<binary_dir\> and configure the build: +\code +cd $HOME/visp-build +cmake ../visp +\endcode +A more versatile way to configure the build is to use \c ccmake, the CMake GUI: +\code +ccmake ../visp +\endcode +The following image shows that this command allows to configure (just by pressing [c] key) the build in a more advanced way where some options could be easily turned On/Off. It allows also to see which are the 3rd parties that will be used. To generate the makefiles, just press [g] key in the ccmake gui. +\image html img-ccmake-centos-all.png Snapshot of the ccmake \c ../visp command used to configure ViSP. -\section install_centos_config Configuring ViSP from source +\subsection install_centos_build Building ViSP from source -- Create first a directory denoted \<binary_dir\> where you want to build ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries. +- To build ViSP proceed with: \code -cd $HOME; mkdir ViSP-build-release +make -j4 \endcode -- Enter the \<binary_dir\> and to configure the build type: +- To install ViSP proceed with: \code -cmake [<optional parameters>] <source_dir> +sudo make install \endcode -For example: + +- To build ViSP documentation, you have first to install Doxygen package: \code -cd $HOME/ViSP-build-release -cmake -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON ../ViSP-2.10.0 +sudo yum install doxygen graphviz \endcode -A more versatile way to configure the build is to use \c ccmake, the CMake GUI: +Then you can proceed with: +\code +make -j4 visp_doc +\endcode + +\section install_centos_dataset Install ViSP dataset +Some ViSP examples and tests require data (images, video, models) that are not part of ViSP source code but available in a separate archive named \c ViSP-images-x.y.z.zip. This archive could be downloaded from http://visp.inria.fr/download page. We provide here after the way to install these data if you want to run ViSP examples. + +\code +cd $HOME +unzip ViSP-images-x.y.z.zip +\endcode + +We suppose now that the data are located in \c $HOME/ViSP-images. +\code +$ ls $HOME/ViSP-images +Klimt README.md circle ellipse iv mbt mire-2 +LICENSE.txt calibration cube ellipse-1 line mire video +\endcode + +Set \c VISP_INPUT_IMAGE_PATH environment variable to help ViSP examples and tests to find the location of the data set. It's convenient if the environment variables is automatically added to your bash session every time a new shell is launched: + +\code +echo "export VISP_INPUT_IMAGE_PATH=$HOME" >> ~/.bashrc +source ~/.bashrc +\endcode + +\note For historical reasons \c VISP_INPUT_IMAGE_PATH should not contain the folder \c ViSP-images, but the parent folder. + +From now, you can try to run ViSP examples and tests. For example you can run \c displayX example that should open a windows with Klimt painting image and some overlay drawings: + +\code +$ cd $HOME/visp-build +$ ./example/device/display/displayX + +A click to close the windows... + +A click to display a cross... +Cross position: 201, 441 + +A click to exit the program... +Bye +\endcode + +\section install_centos_tips Tips and tricks + +\subsection install_centos_tips_uninstall How to uninstall ViSP +After ViSP installation, you can remove installed material using: +\code +$ sudo make uninstall +\endcode + +\subsection install_centos_tips_modules How to build only ViSP libraries + +If you want to build only ViSP modules libraries, nor the examples, tutorials and tests: +\code +$ make -j4 visp_modules +\endcode + +\subsection install_centos_tips_module_once How to build a ViSP specific module + +If you want to build a given module and all the dependencies: +\code +$ make -j4 visp_<module_name> +\endcode +For example to build the model-based tracker module named mbt, run: +\code +$ make -j4 visp_mbt +\endcode + +\subsection install_centos_tips_target Which are the targets that could be run with make ? + +To know which are the target available with \c make: \code -ccmake ../ViSP-2.10.0 +$ make help | grep visp +... visp_tests +... visp_demos +... visp_tutorials +... visp_examples +... visp_modules +... visp_doc +... visp_core +... visp_detection +... visp_gui +... visp_io +... visp_klt +... visp_me +... visp_robot +... visp_sensor +... visp_ar +... visp_blob +... visp_visual_features +... visp_vs +... visp_vision +... visp_mbt +... visp_tt +... visp_tt_mi \endcode -The following image shows that this command allows to configure (just by pressing [c] key) the build in a more advanced way where some options could be easily turned On/Off. It allows also to see which are the 3rd parties that will be used. -\image html img-ccmake-centos.png Snapshot of the ccmake \c ../ViSP-2.10.0 command used to configure ViSP. -- There is an other way to see which are the 3rd parties that are found during the configuration stage and that will be used by ViSP during the build. To this end you can have a look to the text file named ViSP-third-party.txt and located in \<binary_dir\>. We provide hereafter an example of a possible content of this file: +\subsection install_centos_tips_3rd_party Which are the 3rd party libraries that are used in ViSP ? + +To see which are the optional 3rd parties that are found during the configuration stage and that will be used by ViSP during the build you can have a look to the text file named \c ViSP-third-party.txt and located in \<binary_dir\>. We provide hereafter an example of a possible content of this file: \code ViSP third-party libraries @@ -80,12 +237,12 @@ build ViSP on your computer. Mathematics: Gnu Scientific Library : no - Lapack/blas : no + Lapack/blas : yes Simulator: Ogre simulator : no \- Ogre3D : no \- OIS : no - Coin simulator : + Coin simulator : no \- Coin3D : no \- SoWin : no \- SoXt : no @@ -100,19 +257,18 @@ Robots Pioneer : no Viper S650 : no Viper S850 : no -Video devices (display) - X11 : no - GTK : no - OpenCV : no +Video devices (display) + X11 : yes + GTK : no + OpenCV : yes GDI : no Direct3D : no Framegrabbers - Firewire libdc1394-1.x : no - Firewire libdc1394-2.x : no - Video For Linux Two : no + Firewire libdc1394-2.x : yes + Video For Linux Two : yes DirectShow : no CMU 1394 Digital Camera SDK : no - OpenCV : no + OpenCV : yes Specific devices Yarp : no Kinect : no @@ -124,7 +280,7 @@ Video and image Read/Write: libjpeg : no libpng : no Misc: - XML2 : no + XML2 : yes pthread : yes OpenMP : yes zbar : no @@ -134,56 +290,11 @@ Documentation: Graphviz dot : no ViSP built with C++11 features: no \endcode -In our case, only \c pthread an OpenMP 3rd parties are detected. -\subsection install_centos_3rdparty Optional 3rd party packages +\section install_centos_issues Known issues +\subsection install_centos_issues_pthread libpthread may be hidden by files in //lib64 -As mentioned previously, ViSP is interfaced with some 3rd party libraries. The <a href="http://www.irisa.fr/lagadic/visp/libraries.html">complete list is provided here</a>. We recommend to install the following: - -- OpenCV -\code -sudo yum install opencv-devel -\endcode -- libX11 to be able to open a window to display images -\code -sudo yum install libX11-devel -\endcode -- lapack and gsl to benefit from optimized mathematical capabilities -\code -sudo yum install lapack-devel gsl-devel -\endcode -- libv4l to grab images from usb or analogic cameras -\code -sudo yum install libv4l-devel -\endcode -- libxml2 to be able to configure the model-based trackers from xml files -\code -sudo yum install libxml2-devel -\endcode -- libjpeg, libpng to support jpeg and png images -\code -sudo yum install libjpeg-devel libpng-devel -\endcode - -Once installed, if you want that ViSP exploit the new 3rd parties, you have to configure ViSP again. - -\code -ccmake ../ViSP-2.10.0 -\endcode -The following image shows now that all the previous optional 3rd parties are detected. -\image html img-ccmake-centos-all.png Snapshot of the ccmake \c ../ViSP-2.10.0 command used to configure ViSP after installation of optional 3rd party libraries. - -\note Other <a href="http://www.irisa.fr/lagadic/visp/libraries.html">3rd party libraries</a> are interfaced with ViSP. This is for example the case of <a href="http://www.irisa.fr/lagadic/visp/librarieslist.html#Ogre">Ogre</a> that can be used to enhance the visibility computation of the faces that are tracked with the model-based tracker (see \ref tutorial-tracking-mb), or <a href="http://www.irisa.fr/lagadic/visp/librarieslist.html#Coin">Coin</a> that can be used to parse vrml files that describe the 3D model of the object to track using the same model-based tracker. It seems that these 3rd parties are not packaged on CentOS. If you want to use these 3rd parties, you have to install them from source code. - -\subsection install_centos_generate Generating Makefiles - -To generate the makefiles, just press [g] key in the ccmake gui. - -Now we can build ViSP. - -\subsection install_centos_issues Known issues - -- On CentOS 7.0 with cmake 2.8.11, during cmake configuration you may encounter the following issue: +On CentOS 7.0 with cmake 2.8.11, during cmake configuration you may encounter the following issue: \code CMake Warning at src/CMakeLists.txt:80 (add_library): Cannot generate a safe runtime search path for target visp because files in @@ -214,32 +325,16 @@ $ ls -als libpthread* 0 lrwxrwxrwx. 1 root root 18 Feb 4 12:34 libpthread.so.0 -> libpthread-2.17.so \endcode -- On CentOS 7.0, vpVideoReader is not able to read mpeg videos. If ffmpeg is not installed (this is our case since ffmpeg is not packaged for CentOS 7.0), this class uses OpenCV to read and decode videos. Some examples or tutorials provided in ViSP hang during cv::Capture::open() call. The reason is that OpenCV 2.4.5 cv::Capture seams buggy. This is for example the case if you run: +\subsection install_centos_issues_videoreader vpVideoReader is not able to read mpeg videos + +On CentOS 7.0, vpVideoReader is not able to read mpeg videos. If ffmpeg is not installed (this is our case since ffmpeg is not packaged for CentOS 7.0), this class uses OpenCV to read and decode videos. Some examples or tutorials provided in ViSP hang during cv::Capture::open() call. The reason is that OpenCV 2.4.5 cv::Capture seams buggy. This is for example the case if you run: \code $ ./example/video/videoReader \endcode A work arround consists in installing a more recent OpenCV version from source. -\section install_centos_build Building ViSP from source -- To build ViSP proceed with: -\code -make -j4 -\endcode - -- To install ViSP proceed with: -\code -sudo make install -\endcode - -- To build ViSP documentation, you have first to install Doxygen package: -\code -sudo yum install doxygen graphviz -\endcode -Then you can proceed with: -\code -make visp_doc -\endcode +\section install_centos_next Next tutorial You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project. diff --git a/doc/tutorial-install-fedora.doc b/doc/tutorial-install-fedora.doc index a9d4d85ba452bd31d8aba0ee61879ca7a7a64b32..7053d31d500f7c7ce0916cb46184fee3566484fb 100644 --- a/doc/tutorial-install-fedora.doc +++ b/doc/tutorial-install-fedora.doc @@ -7,9 +7,9 @@ In this tutorial you will learn how to install ViSP from source on Linux Fedora. \note Concerning ViSP installation, we provide also other \ref tutorial. -\section install_fedora_required Required packages +\section install_fedora_required Install prerequisities -- gcc 4.4.x or later. This can be installed with: +- gcc 4.4.x or later. This can be istalled with: \code su -c "yum install gcc-c++" \endcode @@ -18,61 +18,233 @@ su -c "yum install gcc-c++" su -c "yum install cmake" \endcode +\section install_fedora_3rdparty Install 3rd parties -ViSP is interfaced with several optional <a href="http://www.irisa.fr/lagadic/visp/libraries.html">third-party libraries</a>. The installation of the corresponding packages is described in \ref install_fedora_3rdparty section. +ViSP is interfaced with several optional 3rd party libraries. The <a href="http://visp.inria.fr/software-architecture">complete list is provided here</a>. -\section install_fedora_get_source Getting ViSP source code +\subsection install_fedora_3rdparty_recommended Recommended 3rd parties + +We recommend to install the following: + +- OpenCV +\code +su -c "yum install opencv-devel" +\endcode +- libX11 to be able to open a window to display images +\code +su -c "yum install libX11-devel" +\endcode +- lapack to benefit from optimized mathematical capabilities +\code +su -c "yum install lapack-devel" +\endcode +- libdc1394 to grab images from firewire cameras +\code +su -c "yum install libdc1394-devel" +\endcode +- libv4l to grab images from usb or analogic cameras +\code +su -c "yum install libv4l-devel" +\endcode +- libxml2 to be able to configure the model-based trackers from xml files +\code +su -c "yum install libxml2-devel" +\endcode +- QR code detection +\code +su -c "yum install zbar-devel" +\endcode + +\subsection install_fedora_3rdparty_other Other optional 3rd parties + +We give also the way to install other 3rd party libraries to enable specific capabilities. + +- Coin, to be able to support vrml cad model used by the model-based trackers +\code +su -c "yum install Coin2-devel" +\endcode +- libjpeg, libpng to support jpeg and png images (only useful if OpenCV is not installed) +\code +su -c "yum install libjpeg-devel libpng-devel" +\endcode +- ffmpeg, to be able to read or encode compressed video streams (only useful if OpenCV is not installed) +\code +su -c "yum install ffmpeg-devel" +\endcode +- Ogre 3D if you want to do augmented reality or simulation +\code +su -c "yum install ogre-devel ogre-samples ois-devel" +\endcode +- Datamatrix code detection +\code +su -c "yum install libdmtx-devel" +\endcode + +\section install_fedora_install_visp Install ViSP from source code +\subsection install_fedora_get_source Getting ViSP source code There are different ways to get ViSP source code: -- You can download the <a href="http://www.irisa.fr/lagadic/visp/download.html#latest">latest stable release</a> as a zip or a tarball. Once downloaded, uncompress the file using either +- You can download the <a href="http://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once downloaded, uncompress the file using either \code -tar xvzf ViSP-2.10.0.tar.gz +tar xvzf visp-x.y.z.tar.gz \endcode or \code -unzip ViSP-2.10.0.zip +unzip visp-x.y.z.zip +\endcode + +- You can also download a <a href="http://visp.inria.fr/download#snapshot">daily snapshot</a>. Once downloaded, uncompress the file using +\code +tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz \endcode -- You can also download a more <a href="http://www.irisa.fr/lagadic/visp/download.html#snapshot">recent snapshot</a>. Once downloaded, uncompress the file using +- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> using the following command +\code +$ git clone https://github.com/lagadic/visp.git +\endcode + +We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c $HOME/visp + +\subsection install_fedora_config Configuring ViSP from source + +- Create first a directory denoted \<binary_dir\> where you want to build ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries. \code -unzip ViSP-2.y.z-snapshot-2015.mm.dd.zip +cd $HOME; mkdir visp-build \endcode -- Or you get the cutting-edge ViSP from Subversion repository. To this end you have first to install subversion + +- Enter the \<binary_dir\> and configure the build: \code -su -c "yum install subversion" +cd $HOME/visp-build +cmake ../visp \endcode -and then use the following command +A more versatile way to configure the build is to use \c ccmake, the CMake GUI: \code -svn checkout svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP ViSP-trunk +ccmake ../visp \endcode +The following image shows that this command allows to configure (just by pressing [c] key) the build in a more advanced way where some options could be easily turned On/Off. It allows also to see which are the 3rd parties that will be used. To generate the makefiles, just press [g] key in the ccmake gui. +\image html img-ccmake-ubuntu-all.png Snapshot of the ccmake \c ../visp command used to configure ViSP. -We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c $HOME/ViSP-2.10.0 +Now we can build ViSP. -\section install_fedora_config Configuring ViSP from source +\subsection install_fedora_build Building ViSP from source -- Create first a directory denoted \<binary_dir\> where you want to build ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries. +- To build ViSP proceed with: \code -cd $HOME; mkdir ViSP-build-release +make -j4 \endcode -- Enter the \<binary_dir\> and to configure the build type: +- To install ViSP proceed with: \code -cmake [<optional parameters>] <source_dir> +sudo make install \endcode -For example: + +- To build ViSP documentation, you have first to install Doxygen package: \code -cd $HOME/ViSP-build-release -cmake -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON ../ViSP-2.10.0 +su -c "yum install doxygen graphviz" \endcode -A more versatile way to configure the build is to use \c ccmake, the CMake GUI: +Then you can proceed with: +\code +make -j4 visp_doc +\endcode + +\section install_fedora_dataset Install ViSP dataset +Some ViSP examples and tests require data (images, video, models) that are not part of ViSP source code but available in a separate archive named \c ViSP-images-x.y.z.zip. This archive could be downloaded from http://visp.inria.fr/download page. We provide here after the way to install these data if you want to run ViSP examples. + \code -ccmake ../ViSP-2.10.0 +cd $HOME +unzip ViSP-images-x.y.z.zip \endcode -The following image shows that this command allows to configure (just by pressing [c] key) the build in a more advanced way where some options could be easily turned On/Off. It allows also to see which are the 3rd parties that will be used. -\image html img-ccmake-ubuntu.png Snapshot of the ccmake \c ../ViSP-2.10.0 command used to configure ViSP. -- There is an other way to see which are the 3rd parties that are found during the configuration stage and that will be used by ViSP during the build. To this end you can have a look to the text file named ViSP-third-party.txt and located in \<binary_dir\>. We provide hereafter an example of a possible content of this file: +We suppose now that the data are located in \c $HOME/ViSP-images. +\code +$ ls $HOME/ViSP-images +Klimt README.md circle ellipse iv mbt mire-2 +LICENSE.txt calibration cube ellipse-1 line mire video +\endcode + +Set \c VISP_INPUT_IMAGE_PATH environment variable to help ViSP examples and tests to find the location of the data set. It's convenient if the environment variables is automatically added to your bash session every time a new shell is launched: + +\code +echo "export VISP_INPUT_IMAGE_PATH=$HOME" >> ~/.bashrc +source ~/.bashrc +\endcode + +\note For historical reasons \c VISP_INPUT_IMAGE_PATH should not contain the folder \c ViSP-images, but the parent folder. + +From now, you can try to run ViSP examples and tests. For example you can run \c displayX example that should open a windows with Klimt painting image and some overlay drawings: + +\code +$ cd $HOME/visp-build +$ ./example/device/display/displayX + +A click to close the windows... + +A click to display a cross... +Cross position: 201, 441 + +A click to exit the program... +Bye +\endcode + +\section install_fedora_tips Tips and tricks + +\subsection install_fedora_tips_uninstall How to uninstall ViSP +After ViSP installation, you can remove installed material using: +\code +$ sudo make uninstall +\endcode + +\subsection install_fedora_tips_modules How to build only ViSP libraries + +If you want to build only ViSP modules libraries, nor the examples, tutorials and tests: +\code +$ make -j4 visp_modules +\endcode + +\subsection install_fedora_tips_module_once How to build a ViSP specific module + +If you want to build a given module and all the dependencies: +\code +$ make -j4 visp_<module_name> +\endcode +For example to build the model-based tracker module named mbt, run: +\code +$ make -j4 visp_mbt +\endcode + +\subsection install_fedora_tips_target Which are the targets that could be run with make ? + +To know which are the target available with \c make: +\code +$ make help | grep visp +... visp_tests +... visp_demos +... visp_tutorials +... visp_examples +... visp_modules +... visp_doc +... visp_core +... visp_detection +... visp_gui +... visp_io +... visp_klt +... visp_me +... visp_robot +... visp_sensor +... visp_ar +... visp_blob +... visp_visual_features +... visp_vs +... visp_vision +... visp_mbt +... visp_tt +... visp_tt_mi +\endcode + +\subsection install_fedora_tips_3rd_party Which are the 3rd party libraries that are used in ViSP ? + +To see which are the optional 3rd parties that are found during the configuration stage and that will be used by ViSP during the build you can have a look to the text file named \c ViSP-third-party.txt and located in \<binary_dir\>. We provide hereafter an example of a possible content of this file: \code ViSP third-party libraries @@ -81,12 +253,12 @@ build ViSP on your computer. Mathematics: Gnu Scientific Library : no - Lapack/blas : no + Lapack/blas : yes Simulator: Ogre simulator : no \- Ogre3D : no \- OIS : no - Coin simulator : + Coin simulator : no \- Coin3D : no \- SoWin : no \- SoXt : no @@ -101,19 +273,18 @@ Robots Pioneer : no Viper S650 : no Viper S850 : no -Video devices (display) - X11 : no - GTK : no - OpenCV : no +Video devices (display) + X11 : yes + GTK : no + OpenCV : yes GDI : no Direct3D : no Framegrabbers - Firewire libdc1394-1.x : no - Firewire libdc1394-2.x : no - Video For Linux Two : no + Firewire libdc1394-2.x : yes + Video For Linux Two : yes DirectShow : no CMU 1394 Digital Camera SDK : no - OpenCV : no + OpenCV : yes Specific devices Yarp : no Kinect : no @@ -125,101 +296,18 @@ Video and image Read/Write: libjpeg : no libpng : no Misc: - XML2 : no + XML2 : yes pthread : yes OpenMP : yes - zbar : no + zbar : yes dmtx : no Documentation: Doxygen : no Graphviz dot : no ViSP built with C++11 features: no \endcode -In our case, only \c pthread an OpenMP 3rd parties are detected. - -\subsection install_fedora_3rdparty Optional 3rd party packages - -As mentioned previously, ViSP is interfaced with some 3rd party libraries. The <a href="http://www.irisa.fr/lagadic/visp/libraries.html">complete list is provided here</a>. We recommend to install the following: - -- OpenCV -\code -su -c "yum install opencv-devel" -\endcode -- libX11 to be able to open a window to display images -\code -su -c "yum install libX11-devel" -\endcode -- lapack and gsl to benefit from optimized mathematical capabilities -\code -su -c "yum install lapack-devel gsl-devel" -\endcode -- libdc1394 to grab images from firewire cameras -\code -su -c "yum install libdc1394-devel" -\endcode -- libv4l to grab images from usb or analogic cameras -\code -su -c "yum install libv4l-devel" -\endcode -- Coin, to be able to support vrml cad model used by the model-based trackers -\code -su -c "yum install Coin2-devel" -\endcode -- libxml2 to be able to configure the model-based trackers from xml files -\code -su -c "yum install libxml2-devel" -\endcode -- libjpeg, libpng to support jpeg and png images -\code -su -c "yum install libjpeg-devel libpng-devel" -\endcode -- ffmpeg, to be able to read or encode compressed video streams -\code -su -c "yum install ffmpeg-devel" -\endcode -- Ogre 3D if you want to do augmented reality or simulation -\code -su -c "yum install ogre-devel ogre-samples ois-devel" -\endcode -- Bar code detection -\code -su -c "yum install zbar-devel libdmtx-devel" -\endcode - -Once installed, if you want that ViSP exploit the new 3rd parties, you have to configure ViSP again. - -\code -ccmake ../ViSP-2.10.0 -\endcode -The following image shows now that all the previous optional 3rd parties are detected. -\image html img-ccmake-ubuntu-all.png Snapshot of the ccmake \c ../ViSP-2.10.0 command used to configure ViSP after installation of optional 3rd party libraries. - -\subsection install_fedora_generate Generating Makefiles -To generate the makefiles, just press [g] key in the ccmake gui. - -Now we can build ViSP. - -\section install_fedora_build Building ViSP from source - -- To build ViSP proceed with: -\code -make -j4 -\endcode - -- To install ViSP proceed with: -\code -sudo make install -\endcode - -- To build ViSP documentation, you have first to install Doxygen package: -\code -su -c "yum install doxygen graphviz" -\endcode -Then you can proceed with: -\code -make visp_doc -\endcode +\section install_fedora_next Next tutorial You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project. diff --git a/doc/tutorial-install-iOS.doc b/doc/tutorial-install-iOS.doc index 040da89d3bbe595beaadad465f20432fad1833e2..cec266f4ca88ee1a679e01bd366d39b3ecee55ef 100644 --- a/doc/tutorial-install-iOS.doc +++ b/doc/tutorial-install-iOS.doc @@ -7,38 +7,45 @@ In this tutorial you will learn how to install ViSP from source on OSX in order \note Concerning ViSP installation, we provide also other \ref tutorial. -\section install_iOS_required Required software +\section install_iOS_required Install required software -- CMake gui 2.8 for OSX or higher that could be download at : http://www.cmake.org/cmake/resources/software.html +- CMake gui 2.8 for OSX or higher that could be download at : http://www.cmake.org +\section install_iOS_3rd_party Install optional packages -ViSP is interfaced with several optional <a href="http://www.irisa.fr/lagadic/visp/libraries.html">third-party libraries</a>. The installation of the corresponding packages is described in \ref install_iOS_3rdparty section. +ViSP is interfaced with several 3rd party libraries. The <a href="http://visp.inria.fr/software-architecture">complete list is provided here</a>. We recommend to install the following: -\section install_iOS_get_source Getting ViSP source code +- OpenCV: get OpenCV for iOS Version 2.4.3 or later in http://opencv.org/downloads.html + +- liblapack, libxml2, libjpeg, libpng, ffmpeg should be already included in your OS X package + +\section install_iOS_install_visp Install ViSP from source code +\subsection install_iOS_get_source Getting ViSP source code There are different ways to get ViSP source code: -- You can download the <a href="http://www.irisa.fr/lagadic/visp/download.html#latest">latest stable release</a> as a zip or a tarball. Once downloaded, uncompress the file using either +- You can download the <a href="http://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once downloaded, uncompress the file using either \code -tar xvzf ViSP-2.10.0.tar.gz +tar xvzf visp-x.y.z.tar.gz \endcode or \code -unzip ViSP-2.10.0.zip +unzip visp-x.y.z.zip \endcode -- You can also download a more <a href="http://www.irisa.fr/lagadic/visp/download.html#snapshot">recent snapshot</a>. Once downloaded, uncompress the file using +- You can also download a <a href="http://visp.inria.fr/download#snapshot">daily snapshot</a>. Once downloaded, uncompress the file using \code -unzip ViSP-2.y.z-snapshot-2015.mm.dd.zip +tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz \endcode -- Or you get the cutting-edge ViSP from Subversion repository. To this end you have first to install subversion and then use the following command + +- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> using the following command \code -svn checkout svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP ViSP-trunk +$ git clone https://github.com/lagadic/visp.git \endcode -We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c $HOME/ViSP-2.10.0 +We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c $HOME/visp -\section install_iOS_config Configuring ViSP from source +\subsection install_iOS_config Configuring ViSP from source - Choose the right path for the \<source_dir\> and the \<binary_dir\> in c-make gui. @@ -52,26 +59,11 @@ We suppose now that ViSP source is in a directory denoted \<source_dir\>, for e \image html img-configure-options-iOS.png -- Press Configure again. - -\subsection install_iOS_3rdparty Optional 3rd party packages - -As mentioned previously, ViSP is interfaced with some 3rd party libraries. The <a href="http://www.irisa.fr/lagadic/visp/libraries.html">complete list is provided here</a>. We recommend to install the following: - -- OpenCV: get OpenCV for iOS Version 2.4.3 or later in http://opencv.org/downloads.html - -- liblapack, libxml2, libjpeg, libpng, ffmpeg should be already included in your OS X package - -Once installed, if you want that ViSP exploit the new 3rd parties, you have to configure ViSP again. +- Press Configure again. Now we can finish the configuration stage by generating the Xcode project. +- To generate the Xcode project press Generate on c-make gui. From now, c-make gui can be closed. -Now we can finish the configuration stage by generating the Xcode project. - -\subsection install_iOS_generate_xcode Generate Xcode project - -To generate the Xcode project press Generate on c-make gui. From now, c-make gui can be closed. - -\section install_iOS_build Building ViSP library -\subsection getting-started-iOS-configure Open and configure ViSP Xcode project +\subsection install_iOS_build Building ViSP library +\subsubsection getting-started-iOS-configure Open and configure ViSP Xcode project Launch Xcode (Version 4.6.2) and open ViSP.xcodeproj that should be in the \<binary_dir\> where you previously built ViSP sources. @@ -86,12 +78,14 @@ In the Architectures group, edit the following information in this order : \image html img-getting-started-iOS-architectures.png -\subsection getting-started-iOS-generate Generate ViSP library +\subsubsection getting-started-iOS-generate Generate ViSP library Now that you have correctly configured your project, choose the visp target and press run. \image html img-getting-started-iOS-run.png +\section install_iOS_next Next tutorial + You are now ready to see the next \ref tutorial-getting-started-iOS that will show you how to use ViSP as a 3rd party to build your own project. */ diff --git a/doc/tutorial-install-opensuse.doc b/doc/tutorial-install-opensuse.doc index e1f3340b88d9b41e2f582c664cb01131d00a2cc7..0861c12593b7c4a072bfa652425f6a2659176b00 100644 --- a/doc/tutorial-install-opensuse.doc +++ b/doc/tutorial-install-opensuse.doc @@ -3,11 +3,11 @@ \page tutorial-install-opensuse Tutorial: Installation from source on Linux openSUSE \tableofcontents -In this tutorial you will learn how to install ViSP from source on openSUSE. These steps have been tested for openSUSE 13.2 (x86_64) distribution, but should work with any other distribution as well. +In this tutorial you will learn how to install ViSP from source on openSUSE. These steps have been tested for openSUSE 14.1 (x86_64) distribution, but should work with any other distribution as well. \note Concerning ViSP installation, we provide also other \ref tutorial. -\section install_opensuse_required Required packages +\section install_opensuse_required Install prerequisities - gcc 4.4.x or later. This can be installed with: \code @@ -17,61 +17,205 @@ sudo zypper install gcc-c++ \code sudo zypper install cmake \endcode +- Git if you want to get the source code from http://github.com/lagadic/visp +\code +sudo zypper install git-core +\endcode + +\section install_opensuse_3rdparty Install 3rd parties -ViSP is interfaced with several optional <a href="http://www.irisa.fr/lagadic/visp/libraries.html">third-party libraries</a>. The installation of the corresponding packages is described in \ref install_opensuse_3rdparty section. +ViSP is interfaced with several 3rd party libraries. The <a href="http://visp.inria.fr/software-architecture">complete list is provided here</a>. -\section install_opensuse_get_source Getting ViSP source code +\subsection install_opensuse_3rdparty_recommended Recommended 3rd parties + +We recommend to install the following: + +- OpenCV +\code +sudo zypper install opencv-devel +\endcode +- libX11 to be able to open a window to display images +\code +sudo zypper install libX11-devel +\endcode +- lapack to benefit from optimized mathematical capabilities +\code +sudo zypper install lapack-devel +\endcode +- libv4l to grab images from usb or analogic cameras +\code +sudo zypper install libv4l-devel +\endcode +- libxml2 to be able to configure the model-based trackers from xml files +\code +sudo zypper install libxml2-devel +\endcode + +\subsection install_opensuse_3rdparty_other Other optional 3rd parties + +We give also the way to install other 3rd party libraries to enable specific capabilities. + +- libjpeg and libpng to support jpeg and png images (only useful if OpenCV is not installed) +\code +sudo zypper install libjpeg8-devel libpng-devel +\endcode + +\section install_opensuse_install_visp Install ViSP from source code +\subsection install_opensuse_get_source Getting ViSP source code There are different ways to get ViSP source code: -- You can download the <a href="http://www.irisa.fr/lagadic/visp/download.html#latest">latest stable release</a> as a zip or a tarball. Once downloaded, uncompress the file using either +- You can download the <a href="http://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once downloaded, uncompress the file using either \code -tar xvzf ViSP-2.10.0.tar.gz +tar xvzf visp-x.y.z.tar.gz \endcode or \code -unzip ViSP-2.10.0.zip +unzip visp-x.y.z.zip \endcode -- You can also download a more <a href="http://www.irisa.fr/lagadic/visp/download.html#snapshot">recent snapshot</a>. Once downloaded, uncompress the file using +- You can also download a <a href="http://visp.inria.fr/download#snapshot">daily snapshot</a>. Once downloaded, uncompress the file using \code -unzip ViSP-2.y.z-snapshot-2015.mm.dd.zip +tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz \endcode -- Or you get the cutting-edge ViSP from Subversion repository. To this end you have first to install subversion + +- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> using the following command \code -sudo zypper install subversion +$ git clone https://github.com/lagadic/visp.git \endcode -and then use the following command + +We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c $HOME/visp + +\subsection install_opensuse_config Configuring ViSP from source + +- Create first a directory denoted \<binary_dir\> where you want to build ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries. \code -svn checkout svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP ViSP-trunk +cd $HOME; mkdir visp-build \endcode -We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c $HOME/ViSP-2.10.0 +- Enter the \<binary_dir\> and configure the build: +\code +cd $HOME/Vvisp-build +cmake ../visp +\endcode +A more versatile way to configure the build is to use \c ccmake, the CMake GUI: +\code +ccmake ../visp +\endcode +The following image shows that this command allows to configure (just by pressing [c] key) the build in a more advanced way where some options could be easily turned On/Off. It allows also to see which are the 3rd parties that will be used. To generate the makefiles, just press [g] key in the ccmake gui. +\image html img-ccmake-ubuntu-all.png Snapshot of the ccmake \c ../visp command used to configure ViSP. -\section install_opensuse_config Configuring ViSP from source +\subsection install_opensuse_build Building ViSP from source -- Create first a directory denoted \<binary_dir\> where you want to build ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries. +- To build ViSP proceed with: \code -cd $HOME; mkdir ViSP-build-release +make -j4 \endcode -- Enter the \<binary_dir\> and to configure the build type: +- To install ViSP proceed with: \code -cmake [<optional parameters>] <source_dir> +sudo make install +\endcode + +- To build ViSP documentation, you have first to install Doxygen package: +\code +sudo zypper install doxygen graphviz \endcode -For example: +Then you can proceed with: \code -cd $HOME/ViSP-build-release -cmake -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON ../ViSP-2.10.0 +make -j4 visp_doc \endcode -A more versatile way to configure the build is to use \c ccmake, the CMake GUI: +\section install_opensuse_dataset Install ViSP dataset +Some ViSP examples and tests require data (images, video, models) that are not part of ViSP source code but available in a separate archive named \c ViSP-images-x.y.z.zip. This archive could be downloaded from http://visp.inria.fr/download page. We provide here after the way to install these data if you want to run ViSP examples. + \code -ccmake ../ViSP-2.10.0 +cd $HOME +unzip ViSP-images-x.y.z.zip \endcode -The following image shows that this command allows to configure (just by pressing [c] key) the build in a more advanced way where some options could be easily turned On/Off. It allows also to see which are the 3rd parties that will be used. -\image html img-ccmake-opensuse.png Snapshot of the ccmake \c ../ViSP-2.10.0 command used to configure ViSP. -- There is an other way to see which are the 3rd parties that are found during the configuration stage and that will be used by ViSP during the build. To this end you can have a look to the text file named ViSP-third-party.txt and located in \<binary_dir\>. We provide hereafter an example of a possible content of this file: +We suppose now that the data are located in \c $HOME/ViSP-images. +\code +$ ls $HOME/ViSP-images +Klimt README.md circle ellipse iv mbt mire-2 +LICENSE.txt calibration cube ellipse-1 line mire video +\endcode + +Set \c VISP_INPUT_IMAGE_PATH environment variable to help ViSP examples and tests to find the location of the data set. It's convenient if the environment variables is automatically added to your bash session every time a new shell is launched: + +\code +echo "export VISP_INPUT_IMAGE_PATH=$HOME" >> ~/.bashrc +source ~/.bashrc +\endcode + +\note For historical reasons \c VISP_INPUT_IMAGE_PATH should not contain the folder \c ViSP-images, but the parent folder. + +From now, you can try to run ViSP examples and tests. For example you can run \c displayX example that should open a windows with Klimt painting image and some overlay drawings: + +\code +$ cd $HOME/visp-build +$ ./example/device/display/displayX + +A click to close the windows... + +A click to display a cross... +Cross position: 201, 441 + +A click to exit the program... +Bye +\endcode + +\section install_opensuse_tips Tips and tricks + +\subsection install_opensuse_tips_uninstall How to uninstall ViSP +After ViSP installation, you can remove installed material using: +\code +$ sudo make uninstall +\endcode + +\subsection install_opensuse_tips_modules How to build only ViSP libraries + +If you want to build only ViSP modules libraries, nor the examples, tutorials and tests: +\code +$ make -j4 visp_modules +\endcode + +\subsection install_opensuse_tips_module_once How to build a ViSP specific module + +If you want to build a given module and all the dependencies: +\code +$ make -j4 visp_<module_name> +\endcode +For example to build the model-based tracker module named mbt, run: +\code +$ make -j4 visp_mbt +\endcode + +\subsection install_opensuse_tips_target Which are the targets that could be run with make ? + +To know which are the target available with \c make: +\code +$ make help | grep visp +... visp_tests +... visp_demos +... visp_tutorials +... visp_examples +... visp_modules +... visp_doc +... visp_core +... visp_detection +... visp_robot +... visp_sensor +... visp_vision +... visp_vs +... visp_ar +... visp_mbt +... visp_tt +... visp_tt_mi +\endcode + +\subsection install_opensuse_tips_3rd_party Which are the 3rd party libraries that are used in ViSP ? + +To see which are the optional 3rd parties that are found during the configuration stage and that will be used by ViSP during the build you can have a look to the text file named \c ViSP-third-party.txt and located in \<binary_dir\>. We provide hereafter an example of a possible content of this file: \code ViSP third-party libraries @@ -79,13 +223,13 @@ Below you will find the list of third party libraries used to build ViSP on your computer. Mathematics: - Gnu Scientific Library : no - Lapack/blas : no + Gnu Scientific Library : yes + Lapack/blas : yes Simulator: Ogre simulator : no \- Ogre3D : no \- OIS : no - Coin simulator : + Coin simulator : no \- Coin3D : no \- SoWin : no \- SoXt : no @@ -100,115 +244,50 @@ Robots Pioneer : no Viper S650 : no Viper S850 : no -Video devices (display) +Video devices (display) X11 : no - GTK : no - OpenCV : no + GTK : no + OpenCV : yes GDI : no Direct3D : no Framegrabbers - Firewire libdc1394-1.x : no - Firewire libdc1394-2.x : no + Firewire libdc1394-2.x : yes Video For Linux Two : no DirectShow : no CMU 1394 Digital Camera SDK : no - OpenCV : no + OpenCV : yes Specific devices Yarp : no - Kinect : no - \-libfreenect : no - \-libusb-1.0 : no + Kinect : yes + \-libfreenect : yes + \-libusb-1.0 : yes \-pthread : yes Video and image Read/Write: FFMPEG : no - libjpeg : no - libpng : no + libjpeg : yes + libpng : yes Misc: - XML2 : no + XML2 : yes pthread : yes - OpenMP : yes + OpenMP : no zbar : no - dmtx : no + dmtx : yes Documentation: Doxygen : no Graphviz dot : no ViSP built with C++11 features: no \endcode -In our case, only \c pthread an OpenMP 3rd parties are detected. - -\subsection install_opensuse_3rdparty Optional 3rd party packages - -As mentioned previously, ViSP is interfaced with some 3rd party libraries. The <a href="http://www.irisa.fr/lagadic/visp/libraries.html">complete list is provided here</a>. We recommend to install the following: - -- OpenCV -\code -sudo zypper install opencv-devel -\endcode -- libX11 to be able to open a window to display images -\code -sudo zypper install libX11-devel -\endcode -- lapack and gsl to benefit from optimized mathematical capabilities -\code -sudo zypper install lapack-devel gsl-devel -\endcode -- libv4l to grab images from usb or analogic cameras -\code -sudo zypper install libv4l-devel -\endcode -- libxml2 to be able to configure the model-based trackers from xml files -\code -sudo zypper install libxml2-devel -\endcode -- libjpeg and libpng to support jpeg and png images -\code -sudo zypper install libjpeg8-devel libpng-devel -\endcode -Once installed, if you want that ViSP exploit the new 3rd parties, you have to configure ViSP again. +\section install_opensuse_issues Known issues +\subsection install_opensuse_issues_libjpeg libjpeg.so.8 may conflict with libjpeg.so.62 -\code -ccmake ../ViSP-2.10.0 -\endcode -The following image shows now that all the previous optional 3rd parties are detected. -\image html img-ccmake-opensuse-all.png Snapshot of the ccmake \c ../ViSP-2.10.0 command used to configure ViSP after installation of optional 3rd party libraries. - -\note Other <a href="http://www.irisa.fr/lagadic/visp/libraries.html">3rd party libraries</a> are interfaced with ViSP. This is for example the case of <a href="http://www.irisa.fr/lagadic/visp/librarieslist.html#Ogre">Ogre</a> that can be used to enhance the visibility computation of the faces that are tracked with the model-based tracker (see \ref tutorial-tracking-mb), or <a href="http://www.irisa.fr/lagadic/visp/librarieslist.html#Coin">Coin</a> that can be used to parse vrml files that describe the 3D model of the object to track using the same model-based tracker. It seems that these 3rd parties are not packaged on openSUSE. If you want to use these 3rd parties, you have to install them from source code. - -\subsection install_opensuse_generate Generating Makefiles - -To generate the makefiles, just press [g] key in the ccmake gui. - -Now we can build ViSP. - -\subsection install_opensuse_issues Known issues - -- Note that with openSUSE 12.04 but also with 13.02, libjpeg-devel package lead to libjpeg62.so installation, that may conflict with libjpeg8.so that is also installed. That's why we recommend to not install libjpeg-devel, but rather install libjpeg8-devel. +Note that with openSUSE 12.04 but also with 13.02, libjpeg-devel package lead to libjpeg62.so installation, that may conflict with libjpeg8.so that is also installed. That's why we recommend to not install libjpeg-devel, but rather install libjpeg8-devel. \code Linking CXX executable HelloWorld /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: warning: libjpeg.so.8, needed by /usr/lib64/libopencv_highgui.so.2.4.9, may conflict with libjpeg.so.62 \endcode -\section install_opensuse_build Building ViSP from source - -- To build ViSP proceed with: -\code -make -j4 -\endcode - -- To install ViSP proceed with: -\code -sudo make install -\endcode - -- To build ViSP documentation, you have first to install Doxygen package: -\code -sudo zypper install doxygen graphviz -\endcode -Then you can proceed with: -\code -make visp_doc -\endcode +\section install_opensuse_next Next tutorial You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project. diff --git a/doc/tutorial-install-osx-homebrew.doc b/doc/tutorial-install-osx-homebrew.doc new file mode 100644 index 0000000000000000000000000000000000000000..a134e5fe55706864a67884706fefb70c14dcd3a3 --- /dev/null +++ b/doc/tutorial-install-osx-homebrew.doc @@ -0,0 +1,365 @@ +/** + +\page tutorial-install-osx-homebrew Tutorial: Installation from source on OSX with Homebrew +\tableofcontents + +In this tutorial you will learn how to install ViSP from source on OSX with Homebrew. These steps have been tested with Mac OS X 10.9.5 Mavericks and with 10.10.3 Yosemite. + +\note Concerning ViSP installation, we provide also other \ref tutorial. + +\section install_osx_brew_required Install prerequisities + +First, go to http://brew.sh to install Homebrew. + +Next use homebrew to install additional software. + +\code +$ brew update +$ brew install cmake +\endcode + +You will need to add the next line to your ~/.bashrc or ~/.bash_profile to have Homebrew be at the front of the PATH. +\code +export PATH=/usr/local/bin:$PATH +\endcode + +In order for the above changes to take effect reopen the terminal or run this command: +\code +$ source ~/.bashrc +\endcode + + +\section install_osx_brew_3rdparty Install 3rd parties + +ViSP is interfaced with several 3rd party libraries. The <a href="http://visp.inria.fr/software-architecture">complete list is provided here</a>. + +\subsection install_osx_brew_3rdparty_recommended Recommended 3rd party + +We recommend to install the following packages. + +\subsubsection install_osx_brew_opencv OpenCV 3rd party + +\code +$ brew install homebrew/science/opencv3 +\endcode + +You can find OpenCV at: + +\code +/usr/local/opt/opencv3 +\endcode + +Now to indicate to CMake where OpenCV is installed you will need to add the following line in your ~/.bashrc or ~/.bash_profile +\code +export OpenCV_DIR=/usr/local/opt/opencv3/share/OpenCV +\endcode +Note that OpenCV_DIR var gives now the location of OpenCVConfig.cmake file. + +In order for the above changes to take effect reopen the terminal or run this command: +\code +$ source ~/.bashrc +\endcode + +\subsubsection install_osx_brew_libxml2 libxml2 3rd party + +Just run the following instruction: +\code +$ brew install libxml2 +\endcode + +\subsubsection install_osx_brew_libdc1394 libdc1394 3rd party + +Just run the following instruction: +\code +$ brew install libdc1394 +\endcode + +\subsubsection install_osx_brew_zbar zbar 3rd party + +To install the zbar library used in detection module for QR code detection, run: +\code +$ brew install zbar +\endcode + +\subsection install_osx_brew_3rdparty_other Other 3rd party + +\subsubsection install_osx_brew_gsl GSL 3rd party + +If lapack 3rd party is not detected during CMake configuration it may be useful to install the Gnu Scientific Library (GSL) to benefit from optimized mathematical capabilities. To this end run the following instruction: +\code +$ brew install gsl +\endcode + +\section install_osx_brew_install_visp Install ViSP from source code +\subsection install_osx_brew_get_source Getting ViSP source code + +There are different ways to get ViSP source code: + +- You can download the <a href="http://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once downloaded, uncompress the file using either +\code +tar xvzf visp-x.y.z.tar.gz +\endcode +or +\code +unzip visp-x.y.z.zip +\endcode + +- You can also download a <a href="http://visp.inria.fr/download#snapshot">daily snapshot</a>. Once downloaded, uncompress the file using +\code +tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz +\endcode + +- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> repository using the following command +\code +$ git clone https://github.com/lagadic/visp.git +\endcode + +We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c $HOME/visp + +\subsection install_osx_brew_config Configuring ViSP from source + +- Create first a directory denoted \<binary_dir\> where you want to build ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries. +\code +cd $HOME; mkdir visp-build +\endcode + +- Enter the \<binary_dir\> and configure the build: +\code +cmake ../visp +\endcode +A more versatile way to configure the build is to use \c ccmake, the CMake GUI: +\code +ccmake ../visp +\endcode +The previous command allows to configure (just by pressing [c] key) the build in a more advanced way where some options could be easily turned On/Off. It allows also to see which are the 3rd party that will be used. +Then to generate the makefiles, just press [g] key in the ccmake gui. +Now we can build ViSP. + +\subsection install_osx_brew_build Building ViSP from source + +- To build ViSP proceed with: +\code +$ make -j4 +\endcode + +- To install ViSP proceed with: +\code +$ sudo make install +\endcode + +- To build ViSP documentation, you have first to install Doxygen package: +\code +$ brew install doxygen +\endcode +Then you can proceed with: +\code +$ make -j4 visp_doc +\endcode +\section install_brew_dataset Install ViSP dataset +Some ViSP examples and tests require data (images, video, models) that are not part of ViSP source code but available in a separate archive named \c ViSP-images-x.y.z.zip. This archive could be downloaded from http://visp.inria.fr/download page. We provide here after the way to install these data if you want to run ViSP examples. + +\code +cd $HOME +unzip ViSP-images-x.y.z.zip +\endcode + +We suppose now that the data are located in \c $HOME/ViSP-images. +\code +$ ls $HOME/ViSP-images +Klimt README.md circle ellipse iv mbt mire-2 +LICENSE.txt calibration cube ellipse-1 line mire video +\endcode + +Set \c VISP_INPUT_IMAGE_PATH environment variable to help ViSP examples and tests to find the location of the data set. It's convenient if the environment variables is automatically added to your bash session every time a new shell is launched: + +\code +echo "export VISP_INPUT_IMAGE_PATH=$HOME" >> ~/.bashrc +source ~/.bashrc +\endcode + +\note For historical reasons \c VISP_INPUT_IMAGE_PATH should not contain the folder \c ViSP-images, but the parent folder. + +From now, you can try to run ViSP examples and tests. For example you can run \c displayX example that should open a windows with Klimt painting image and some overlay drawings: + +\code +$ cd $HOME/visp-build +$ ./example/device/display/displayX + +A click to close the windows... + +A click to display a cross... +Cross position: 201, 441 + +A click to exit the program... +Bye +\endcode + +\section install_brew_tips Tips and tricks + +\subsection install_brew_tips_uninstall How to uninstall ViSP +After ViSP installation, you can remove installed material using: +\code +$ sudo make uninstall +\endcode + +\subsection install_brew_tips_modules How to build only ViSP libraries + +If you want to build only ViSP modules libraries, nor the examples, tutorials and tests: +\code +$ make -j4 visp_modules +\endcode + +\subsection install_brew_tips_module_once How to build a ViSP specific module + +If you want to build a given module and all the dependencies: +\code +$ make -j4 visp_<module_name> +\endcode +For example to build the model-based tracker module named mbt, run: +\code +$ make -j4 visp_mbt +\endcode + +\subsection install_brew_tips_target Which are the targets that could be run with make ? + +To know which are the target available with \c make: +\code +$ make help | grep visp +... visp_tests +... visp_demos +... visp_tutorials +... visp_examples +... visp_modules +... visp_doc +... visp_core +... visp_detection +... visp_gui +... visp_io +... visp_klt +... visp_me +... visp_robot +... visp_sensor +... visp_ar +... visp_blob +... visp_visual_features +... visp_vs +... visp_vision +... visp_mbt +... visp_tt +... visp_tt_mi +\endcode + +\subsection install_brew_tips_3rd_party Which are the 3rd party libraries that are used in ViSP ? + +To see which are the optional 3rd parties that are found during the configuration stage and that will be used by ViSP during the build you can have a look to the text file named \c ViSP-third-party.txt and located in \<binary_dir\>. We provide hereafter an example of a possible content of this file: +\code + ViSP third-party libraries + +Below you will find the list of third party libraries used to +build ViSP on your computer. + +Mathematics: + Gnu Scientific Library : yes + Lapack/blas : yes +Simulator: + Ogre simulator : no + \- Ogre3D : no + \- OIS : no + Coin simulator : no + \- Coin3D : no + \- SoWin : no + \- SoXt : no + \- SoQt : no + \- Qt4 : no + \- Qt3 : no +Robots + Afma6 : no + Afma4 : no + Biclops : no + Ptu46 : no + Pioneer : no + Viper S650 : no + Viper S850 : no +Video devices (display) + X11 : yes + GTK : no + OpenCV : yes + GDI : no + Direct3D : no +Framegrabbers + Firewire libdc1394-2.x : yes + Video For Linux Two : no + DirectShow : no + CMU 1394 Digital Camera SDK : no + OpenCV : yes +Specific devices + Yarp : no + Kinect : yes + \-libfreenect : yes + \-libusb-1.0 : yes + \-pthread : yes +Video and image Read/Write: + FFMPEG : no + libjpeg : yes + libpng : yes +Misc: + XML2 : yes + pthread : yes + OpenMP : no + zbar : no + dmtx : yes +Documentation: + Doxygen : no + Graphviz dot : no +ViSP built with C++11 features: no +\endcode + +\section install_osx_brew_issues Kwown issues +\subsection install_osx_brew_issues_opencv3 /usr/local/lib/pkgconfig is not writable + +- During OpenCV installation, if you get the following errors: +\code +$ brew install opencv3 +Could not symlink lib/pkgconfig/isl.pc +/usr/local/lib/pkgconfig is not writable. + +You can try again using: + brew link isl +... +\endcode +it means maybe that you install other softwares without brew in /usr/local. +A work arround is to change the owner of the corresponding folder like: +\code +$ sudo chown {your-user-name} /usr/local/lib/pkgconfig +\endcode + +- If you enter into troubles with the packages you install with brew, a good stating is to run: +\code +$ brew doctor +\endcode + +\subsection install_osx_brew_issues_libpng Application built with libpng-1.5.18 but running with 1.6.17 +- If you encounter the following issue +\code +$ ./modules/vision/testKeypoint-5 +libpng warning: Application built with libpng-1.5.18 but running with 1.6.17 +error: can't create a png read structure! +error reading png file +\endcode +It means that apparently there is a conflict between libpng version installed by "brew install opencv3" (1.6.17), and the one used by X11/XQuartz (1.5.18). +A work arround is to turn off libpng usage in ViSP. To configure and build again ViSP without png support: +\code +$ ccmake -DUSE_PNG=OFF ../ViSP +$ make -j4 +\endcode +An other work arround option is to turn off X11 usage in ViSP. Display capabilities will be then the one from OpenCV. To this end, configure and build again ViSP without X11 support: +\code +$ ccmake -DUSE_X11=OFF ../ViSP +$ make -j4 +\endcode + +\section install_osx_brew_next Next tutorial + +You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project. + +*/ diff --git a/doc/tutorial-install-raspberry.doc b/doc/tutorial-install-raspberry.doc index 212b44bcb9b7bebb6aaf861112b85c50a4ef9720..1556de18aab52d4db36a91808202a7ea7ebe98c9 100644 --- a/doc/tutorial-install-raspberry.doc +++ b/doc/tutorial-install-raspberry.doc @@ -13,7 +13,7 @@ In a first section we give some useful instructions to start with a Raspberry PI \section install_raspberry Raspberry Pi installation -\subsection raspberry Setting up Raspberry Pi +\subsection install_raspberry_setup Setting up Raspberry Pi There are a lot of documentation and tutorial that explain different ways to setup a Raspberry Pi. A good reference is the official page <a href="http://www.raspberrypi.org/">http://www.raspberrypi.org</a> @@ -28,7 +28,7 @@ We suggest to start with NOOBS (New Out Of the Box Software). Bellow we resume t - Your Raspberry Pi will boot, and a window will appear with a list of different operating systems that you can install. Select the "recommended Raspbian" checkbox and click on "Install" button. - When the install process has completed, the Raspberry Pi configuration menu (raspi-config) will load. Here you are able to set the time and date for your region and enable a Raspberry Pi camera board, or even create users. You can exit this menu by using Tab on your keyboard to move to Finish. -\subsection login Logging in +\subsection install_raspberry_login Logging in The default login for Raspbian is username \c pi with the password \c raspberry. @@ -40,7 +40,7 @@ sudo apt-get update sudo apt-get upgrade \endcode -\subsection camera Setting up a Raspberry Pi camera +\subsection install_raspberry_camera Setting up a Raspberry Pi camera If you have a Raspberry Pi camera module see <a href="http://www.raspberrypi.org/help/camera-module-setup/">http://www.raspberrypi.org/help/camera-module-setup</a>. To resume, enable the camera using: \code @@ -80,68 +80,226 @@ bcm2835-v4l2 \endcode -\subsection startx Start graphical user interface +\subsection install_raspberry_startx Start graphical user interface To load the graphical user interface, type \c startx and press Enter on your keyboard. This will later allow to use ViSP vpDisplayX or vpDisplayOpenCV classes useful to display images in a X11 window. -\section install_visp ViSP installation -\subsection prerequisities Prerequisities +\section install_raspberry_visp ViSP installation +\subsection install_raspberry_visp_prerequisities Install prerequisities -First you need to install the following packagages (g++, CMake, Subversion) that are requested to get and build ViSP: +First you need to install the following packagages (g++, CMake, Git) that are requested to get and build ViSP: \code -sudo apt-get install build-essential cmake-curses-gui subversion +sudo apt-get install build-essential cmake-curses-gui git \endcode -Then you can install the following packages (X11, lapack, gsl, v4l, xml, png, jpeg, opencv), that correspond to the optional 3rd party libraries that are interfaced with ViSP: +\subsection install_raspberry_visp_3rd_party Install 3rd parties + +ViSP is interfaced with several optional 3rd party libraries. The <a href="http://visp.inria.fr/software-architecture">complete list is provided here</a>. + +\subsubsection install_raspberry_visp_3rd_party_recommended Recommended 3rd parties + +We recommend to install the following: + +- OpenCV +\code +sudo apt-get install libopencv-dev +\endcode +- libX11 to be able to open a window to display images +\code +sudo apt-get install libx11-dev +\endcode +- lapack to benefit from optimized mathematical capabilities +\code +sudo apt-get install liblapack-dev +\endcode +- libv4l to grab images from usb or analogic cameras +\code +sudo apt-get install libv4l-dev +\endcode +- libxml2 to be able to configure the model-based trackers from xml files +\code +sudo apt-get install libxml2-dev +\endcode +- QR code detection \code -sudo apt-get install libx11-dev liblapack-dev libgsl0-dev libv4l-dev libxml2-dev libpng12-dev libjpeg-dev libopencv-dev +sudo apt-get install libzbar-dev \endcode -The complete list of 3rd party libraries is detailed following <a href="http://team.inria.fr/lagadic/visp/libraries.html">http://team.inria.fr/lagadic/visp/libraries.html</a> link. +\subsubsection install_raspberry_visp_3rd_party_other Other optional 3rd parties + +We give also the way to install other 3rd party libraries to enable specific capabilities. -\subsection get_source Getting ViSP source code +- libjpeg and libpng to support jpeg and png images respectively (only useful if OpenCV is not installed) +\code +sudo apt-get install libjpeg-dev libpng12-dev +\endcode + +\subsection install_raspberry_visp_install Install ViSP from source code +\subsubsection install_raspberry_visp_get_source Getting ViSP source code There are different ways to get ViSP source code on Raspberry Pi: -- You can download the <a href="http://team.inria.fr/lagadic/visp/download.html#latest">latest stable release</a> tarball. Once downloaded, uncompress the file using: +- You can download the <a href="http://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once downloaded, uncompress the file using either \code mkdir /home/pi/soft; cd /home/pi/soft -wget http://gforge.inria.fr/frs/download.php/latestfile/475/ViSP-2.10.0.tar.gz -tar xvzf ViSP-2.10.0.tar.gz +tar xvzf visp-x.y.z.tar.gz \endcode - -- You can also download the cutting-edge version of the source code from Subversion repository using: +or \code mkdir /home/pi/soft; cd /home/pi/soft -svn checkout svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP ViSP-code +unzip visp-x.y.z.zip \endcode -We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c /home/pi/soft/ViSP-2.10.0 or \c /home/pi/soft/ViSP-trunk - -\subsection config Configuring ViSP from source +- You can also download a <a href="http://visp.inria.fr/download#snapshot">daily snapshot</a>. Once downloaded, uncompress the file using +\code +tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz +\endcode -- Create first a directory denoted \<binary_dir\> where you want to build ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries. +- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> using the following command \code -cd /home/pi/soft; mkdir ViSP-build-release +$ git clone https://github.com/lagadic/visp.git \endcode -- Enter the \<binary_dir\> and configure the build type: +We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c /home/pi/soft/visp + +\subsubsection install_raspberry_visp_config Configuring ViSP from source + +- Create first a directory denoted \<binary_dir\> where you want to build ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries. \code -cmake [<optional parameters>] <source_dir> +cd /home/pi/soft; mkdir visp-build \endcode -For example: + +- Enter \<binary_dir\> and configure the build: \code -cd /home/pi/soft/ViSP-build-release -cmake -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON ../ViSP-2.10.0 +cd /home/pi/soft/visp-build +cmake ../visp \endcode A more versatile way to configure the build is to use \c ccmake, the CMake GUI: \code -ccmake ../ViSP-2.10.0 +ccmake ../visp \endcode The following image shows that this command allows to configure (just by pressing [c] key) the build in a more advanced way where some options could be easily turned On/Off. It allows also to see which are the 3rd parties that will be used. Then to generate the makefiles, just press [g] key in the ccmake gui. -\image html img-ccmake-raspberry-pi.png Snapshot of the ccmake \c ../ViSP-2.10.0 command used to configure ViSP. +\image html img-ccmake-ubuntu-all.png Snapshot of the ccmake \c ../visp command used to configure ViSP. + + +\subsubsection install_raspberry_visp_build Building ViSP from source + +- To build ViSP proceed with: +\code +make +\endcode + +- To install ViSP proceed with: +\code +sudo make install +\endcode -- There is an other way to see which are the 3rd parties that are found during the configuration stage and that will be used by ViSP during the build. To this end you can have a look to the text file named ViSP-third-party.txt and located in \<binary_dir\>. We provide hereafter an example of a possible content of this file: +- To build ViSP documentation, you have first to install Doxygen package: +\code +sudo apt-get install doxygen graphviz texlive-latex-base +\endcode +Then you can proceed with: +\code +make -j4 visp_doc +\endcode + +\subsection install_raspberry_dataset Install ViSP dataset +Some ViSP examples and tests require data (images, video, models) that are not part of ViSP source code but available in a separate archive named \c ViSP-images-x.y.z.zip. This archive could be downloaded from http://visp.inria.fr/download page. We provide here after the way to install these data if you want to run ViSP examples. + +\code +cd $HOME +unzip ViSP-images-x.y.z.zip +\endcode + +We suppose now that the data are located in \c $HOME/ViSP-images. +\code +$ ls $HOME/ViSP-images +Klimt README.md circle ellipse iv mbt mire-2 +LICENSE.txt calibration cube ellipse-1 line mire video +\endcode + +Set \c VISP_INPUT_IMAGE_PATH environment variable to help ViSP examples and tests to find the location of the data set. It's convenient if the environment variables is automatically added to your bash session every time a new shell is launched: + +\code +echo "export VISP_INPUT_IMAGE_PATH=$HOME" >> ~/.bashrc +source ~/.bashrc +\endcode + +\note For historical reasons \c VISP_INPUT_IMAGE_PATH should not contain the folder \c ViSP-images, but the parent folder. + +From now, you can try to run ViSP examples and tests. For example you can run \c displayX example that should open a windows with Klimt painting image and some overlay drawings: + +\code +$ cd $HOME/visp-build +$ ./example/device/display/displayX + +A click to close the windows... + +A click to display a cross... +Cross position: 201, 441 + +A click to exit the program... +Bye +\endcode + +\section install_raspberry_tips Tips and tricks + +\subsection install_raspberry_tips_uninstall How to uninstall ViSP +After ViSP installation, you can remove installed material using: +\code +$ sudo make uninstall +\endcode + +\subsection install_raspberry_tips_modules How to build only ViSP libraries + +If you want to build only ViSP modules libraries, nor the examples, tutorials and tests: +\code +$ make -j4 visp_modules +\endcode + +\subsection install_raspberry_tips_module_once How to build a ViSP specific module + +If you want to build a given module and all the dependencies: +\code +$ make -j4 visp_<module_name> +\endcode +For example to build the model-based tracker module named mbt, run: +\code +$ make -j4 visp_mbt +\endcode + +\subsection install_raspberry_tips_target Which are the targets that could be run with make ? + +To know which are the target available with \c make: +\code +$ make help | grep visp +... visp_tests +... visp_demos +... visp_tutorials +... visp_examples +... visp_modules +... visp_doc +... visp_core +... visp_detection +... visp_gui +... visp_io +... visp_klt +... visp_me +... visp_robot +... visp_sensor +... visp_ar +... visp_blob +... visp_visual_features +... visp_vs +... visp_vision +... visp_mbt +... visp_tt +... visp_tt_mi +\endcode + +\subsection install_raspberry_tips_3rd_party Which are the 3rd party libraries that are used in ViSP ? + +To see which are the optional 3rd parties that are found during the configuration stage and that will be used by ViSP during the build you can have a look to the text file named \c ViSP-third-party.txt and located in \<binary_dir\>. We provide hereafter an example of a possible content of this file: \code ViSP third-party libraries @@ -149,13 +307,13 @@ Below you will find the list of third party libraries used to build ViSP on your computer. Mathematics: - Gnu Scientific Library : yes + Gnu Scientific Library : no Lapack/blas : yes Simulator: Ogre simulator : no \- Ogre3D : no \- OIS : no - Coin simulator : + Coin simulator : no \- Coin3D : no \- SoWin : no \- SoXt : no @@ -173,7 +331,7 @@ Robots Video devices (display) X11 : yes GTK : no - OpenCV : yes + OpenCV : yes GDI : no Direct3D : no Framegrabbers @@ -181,13 +339,13 @@ Framegrabbers Video For Linux Two : yes DirectShow : no CMU 1394 Digital Camera SDK : no - OpenCV : yes + OpenCV : yes Specific devices Yarp : no Kinect : no \-libfreenect : no \-libusb-1.0 : no - \-pthread : yes + \-pthread : no Video and image Read/Write: FFMPEG : no libjpeg : yes @@ -195,8 +353,8 @@ Video and image Read/Write: Misc: XML2 : yes pthread : yes - OpenMP : yes - zbar : no + OpenMP : no + zbar : yes dmtx : no Documentation: Doxygen : no @@ -204,26 +362,7 @@ Documentation: ViSP built with C++11 features: no \endcode -\subsection build Building ViSP from source - -- To build ViSP proceed with: -\code -make -\endcode - -- To install ViSP proceed with: -\code -sudo make install -\endcode - -- To build ViSP documentation, you have first to install Doxygen package: -\code -sudo apt-get install doxygen graphviz texlive-latex-base -\endcode -Then you can proceed with: -\code -make visp_doc -\endcode +\section install_raspberry_next Next tutorial You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project on Raspberry Pi or on any other system. Then if you have a Raspberry Pi camera module, you can also follow the \ref tutorial-tracking-blob especially subsection Tracking form v4l2 live cameras. diff --git a/doc/tutorial-install-ubuntu-package.doc b/doc/tutorial-install-ubuntu-package.doc index 0e7eb6e0db892d910ee2ed9661c337521751c62a..0925e7613ea79b55ddc58d07864f84eadb33b5d4 100644 --- a/doc/tutorial-install-ubuntu-package.doc +++ b/doc/tutorial-install-ubuntu-package.doc @@ -7,60 +7,44 @@ In this tutorial you will learn how to install ViSP from prebuilt official packa \note Concerning ViSP installation, we provide also other \ref tutorial. +\section install_ubuntu_package_list ViSP official packages + Since Ubuntu 14.04 LTS, ViSP library can be installed from <a href="http://packages.ubuntu.com/search?keywords=visp&searchon=names&suite=trusty§ion=all">existing packages</a> on amd64 or i386 architectures. In Ubuntu 13.10, the packages are only available for amd64 architecture. The table below shows which are the packages available given the distribution and architecture. <table> <tr> - <th colspan="2">Ubuntu 13.10 - <th colspan="2">Ubuntu 14.04 LTS - <th colspan="2">Ubuntu 14.10 + <th>Ubuntu 14.04 LTS + <th>Ubuntu 14.10 and 15.04 + <th>Ubuntu 15.10 </tr> <tr> - <th>i386</th> - <th>amd64</th> - <th>i386</th> - <th>amd64</th> - <th>i386</th> - <th>amd64</th> + <th>trusty</th> + <th>utopic and vivid</th> + <th>wily</th> </tr> <tr> - <td></td> - <td>libvisp-dev</td> - <td>libvisp-dev</td> <td>libvisp-dev</td> <td>libvisp-dev</td> <td>libvisp-dev</td> </tr> <tr> - <td></td> - <td>libvisp2.8</td> <td>libvisp2.8</td> - <td>libvisp2.8</td> - <td>libvisp2.9</td> <td>libvisp2.9</td> + <td>libvisp2.10</td> </tr> <tr> - <td></td> - <td>libvisp2.8-dbg</td> <td>libvisp2.8-dbg</td> - <td>libvisp2.8-dbg</td> - <td>libvisp2.9-dbg</td> <td>libvisp2.9-dbg</td> + <td>libvisp2.10-dbg</td> </tr> <tr> - <td></td> - <td>libvisp-doc</td> - <td>libvisp-doc</td> <td>libvisp-doc</td> <td>libvisp-doc</td> <td>libvisp-doc</td> </tr> <tr> - <td></td> - <td>visp-images</td> - <td>visp-images</td> <td>visp-images</td> <td>visp-images</td> <td>visp-images</td> @@ -83,6 +67,7 @@ To install ViSP html documentation you can run: sudo apt-get install visp-doc \endcode +\section install_ubuntu_package_next Next tutorial You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project. diff --git a/doc/tutorial-install-ubuntu.doc b/doc/tutorial-install-ubuntu.doc index 94118777aecf69fbe8a748fc07ff1f07a0b5d06e..b9e61e1924913f9341fe6bd8ca80e9a9a61ea956 100644 --- a/doc/tutorial-install-ubuntu.doc +++ b/doc/tutorial-install-ubuntu.doc @@ -7,7 +7,7 @@ In this tutorial you will learn how to install ViSP from source on Linux Ubuntu. \note Concerning ViSP installation, we provide also other \ref tutorial. -\section install_ubuntu_required Required packages +\section install_ubuntu_required Install prerequisities - gcc 4.4.x or later. This can be installed with: \code @@ -18,61 +18,234 @@ sudo apt-get install build-essential sudo apt-get install cmake-curses-gui \endcode +\section install_ubuntu_3rdparty Install 3rd parties -ViSP is interfaced with several optional <a href="http://www.irisa.fr/lagadic/visp/libraries.html">third-party libraries</a>. The installation of the corresponding packages is described in \ref install_ubuntu_3rdparty section. +ViSP is interfaced with several optional 3rd party libraries. The <a href="http://visp.inria.fr/software-architecture">complete list is provided here</a>. -\section install_ubuntu_get_source Getting ViSP source code +\subsection install_ubuntu_3rdparty_recommended Recommended 3rd parties + +We recommend to install the following: + +- OpenCV +\code +sudo apt-get install libopencv-dev +\endcode +- libX11 to be able to open a window to display images +\code +sudo apt-get install libx11-dev +\endcode +- lapack to benefit from optimized mathematical capabilities +\code +sudo apt-get install liblapack-dev +\endcode +- libdc1394 to grab images from firewire cameras +\code +sudo apt-get install libdc1394-22-dev +\endcode +- libv4l to grab images from usb or analogic cameras +\code +sudo apt-get install libv4l-dev +\endcode +- libxml2 to be able to configure the model-based trackers from xml files +\code +sudo apt-get install libxml2-dev +\endcode +- QR code detection +\code +sudo apt-get install libzbar-dev +\endcode + +\subsection install_ubuntu_3rdparty_other Other optional 3rd parties + +We give also the way to install other 3rd party libraries to enable specific capabilities. + +- Coin, to be able to support vrml cad model used by the model-based trackers +\code +sudo apt-get install libcoin80-dev +\endcode +- libjpeg and libpng to support jpeg and png images respectively (only useful if OpenCV is not installed) +\code +sudo apt-get install libjpeg-dev libpng12-dev +\endcode +- ffmpeg, to be able to read or encode compressed video streams (only useful if OpenCV is not installed) +\code +sudo apt-get install libswscale-dev libavutil-dev libavformat-dev libavcodec-dev libbz2-dev libbz2-1.0 +\endcode +- Ogre 3D if you want to do augmented reality or simulation +\code +sudo apt-get install libogre-1.9-dev libois-dev +\endcode +- Datamatrix code detection +\code +sudo apt-get install libdmtx-dev +\endcode + +\section install_ubuntu_visp Install ViSP from source code +\subsection install_ubuntu_visp_get_source Getting ViSP source code There are different ways to get ViSP source code: -- You can download the <a href="http://www.irisa.fr/lagadic/visp/download.html#latest">latest stable release</a> as a zip or a tarball. Once downloaded, uncompress the file using either +- You can download the <a href="http://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once downloaded, uncompress the file using either \code -tar xvzf ViSP-2.10.0.tar.gz +tar xvzf visp-x.y.z.tar.gz \endcode or \code -unzip ViSP-2.10.0.zip +unzip visp-x.y.z.zip \endcode -- You can also download a more <a href="http://www.irisa.fr/lagadic/visp/download.html#snapshot">recent snapshot</a>. Once downloaded, uncompress the file using +- You can also download a <a href="http://visp.inria.fr/download#snapshot">daily snapshot</a>. Once downloaded, uncompress the file using \code -unzip ViSP-2.y.z-snapshot-2015.mm.dd.zip +tar xvzf visp-snapshot-yyyy-mm-dd.tar.gz \endcode -- Or you get the cutting-edge ViSP from Subversion repository. To this end you have first to install subversion + +- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> using the following command \code -sudo apt-get install subversion +$ git clone https://github.com/lagadic/visp.git \endcode -and then use the following command + +We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c $HOME/visp + +\subsection install_ubuntu_visp_config Configuring ViSP from source + +- Create first a directory denoted \<binary_dir\> where you want to build ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries. \code -svn checkout svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP ViSP-trunk +cd $HOME; mkdir visp-build \endcode -We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c $HOME/ViSP-2.10.0 +- Enter the \<binary_dir\> and configure the build: +\code +cd $HOME/visp-build +cmake ../visp +\endcode +A more versatile way to configure the build is to use \c ccmake, the CMake GUI: +\code +ccmake ../visp +\endcode +The following image shows that this command allows to configure (just by pressing [c] key) the build in a more advanced way where some options could be easily turned On/Off. It allows also to see which are the 3rd parties that will be used. To generate the makefiles, just press [g] key in the ccmake gui. +\image html img-ccmake-ubuntu-all.png Snapshot of the ccmake \c ../visp command used to configure ViSP. -\section install_ubuntu_config Configuring ViSP from source +Now we can build ViSP. -- Create first a directory denoted \<binary_dir\> where you want to build ViSP. This directory will contain generated Makefiles, object files, and output libraries and binaries. +\subsection install_ubuntu_visp_build Building ViSP from source + +- To build ViSP proceed with: +\code +make -j4 +\endcode + +- To install ViSP in \c /usr/local which is the default install location, proceed with: +\code +sudo make install +\endcode +\note The default install location is set to \c /usr/local. This location could be changed modifying \c CMAKE_INSTALL_PREFIX var. + +- To build ViSP documentation, you have first to install Doxygen package: \code -cd $HOME; mkdir ViSP-build-release +sudo apt-get install doxygen graphviz texlive-latex-base \endcode +Then you can proceed with: +\code +make -j4 visp_doc +\endcode + +\section install_ubuntu_dataset Install ViSP dataset +Some ViSP examples and tests require data (images, video, models) that are not part of ViSP source code but available in a separate archive named \c ViSP-images-x.y.z.zip. This archive could be downloaded from http://visp.inria.fr/download page. We provide here after the way to install these data if you want to run ViSP examples. -- Enter the \<binary_dir\> and to configure the build type: \code -cmake [<optional parameters>] <source_dir> +cd $HOME +unzip ViSP-images-x.y.z.zip \endcode -For example: + +We suppose now that the data are located in \c $HOME/ViSP-images. \code -cd $HOME/ViSP-build-release -cmake -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_SHARED_LIBS=ON ../ViSP-2.10.0 +$ ls $HOME/ViSP-images +Klimt README.md circle ellipse iv mbt mire-2 +LICENSE.txt calibration cube ellipse-1 line mire video \endcode -A more versatile way to configure the build is to use \c ccmake, the CMake GUI: + +Set \c VISP_INPUT_IMAGE_PATH environment variable to help ViSP examples and tests to find the location of the data set. It's convenient if the environment variables is automatically added to your bash session every time a new shell is launched: + \code -ccmake ../ViSP-2.10.0 +echo "export VISP_INPUT_IMAGE_PATH=$HOME" >> ~/.bashrc +source ~/.bashrc \endcode -The following image shows that this command allows to configure (just by pressing [c] key) the build in a more advanced way where some options could be easily turned On/Off. It allows also to see which are the 3rd parties that will be used. -\image html img-ccmake-ubuntu.png Snapshot of the ccmake \c ../ViSP-2.10.0 command used to configure ViSP. -- There is an other way to see which are the 3rd parties that are found during the configuration stage and that will be used by ViSP during the build. To this end you can have a look to the text file named ViSP-third-party.txt and located in \<binary_dir\>. We provide hereafter an example of a possible content of this file: +\note For historical reasons \c VISP_INPUT_IMAGE_PATH should not contain the folder \c ViSP-images, but the parent folder. + +From now, you can try to run ViSP examples and tests. For example you can run \c displayX example that should open a windows with Klimt painting image and some overlay drawings: + +\code +$ cd $HOME/visp-build +$ ./example/device/display/displayX + +A click to close the windows... + +A click to display a cross... +Cross position: 201, 441 + +A click to exit the program... +Bye +\endcode + +\section install_ubuntu_tips Tips and tricks + +\subsection install_ubuntu_tips_uninstall How to uninstall ViSP +After ViSP installation, you can remove installed material using: +\code +$ sudo make uninstall +\endcode + +\subsection install_ubuntu_tips_modules How to build only ViSP libraries + +If you want to build only ViSP modules libraries, nor the examples, tutorials and tests: +\code +$ make -j4 visp_modules +\endcode + +\subsection install_ubuntu_tips_module_once How to build a ViSP specific module + +If you want to build a given module and all the dependencies: +\code +$ make -j4 visp_<module_name> +\endcode +For example to build the model-based tracker module named mbt, run: +\code +$ make -j4 visp_mbt +\endcode + +\subsection install_ubuntu_tips_target Which are the targets that could be run with make ? + +To know which are the target available with \c make: +\code +$ make help | grep visp +... visp_tests +... visp_demos +... visp_tutorials +... visp_examples +... visp_modules +... visp_doc +... visp_core +... visp_detection +... visp_gui +... visp_io +... visp_klt +... visp_me +... visp_robot +... visp_sensor +... visp_ar +... visp_blob +... visp_visual_features +... visp_vs +... visp_vision +... visp_mbt +... visp_tt +... visp_tt_mi +\endcode + +\subsection install_ubuntu_tips_3rd_party Which are the 3rd party libraries that are used in ViSP ? + +To see which are the optional 3rd parties that are found during the configuration stage and that will be used by ViSP during the build you can have a look to the text file named \c ViSP-third-party.txt and located in \<binary_dir\>. We provide hereafter an example of a possible content of this file: \code ViSP third-party libraries @@ -81,12 +254,12 @@ build ViSP on your computer. Mathematics: Gnu Scientific Library : no - Lapack/blas : no + Lapack/blas : yes Simulator: Ogre simulator : no \- Ogre3D : no \- OIS : no - Coin simulator : + Coin simulator : no \- Coin3D : no \- SoWin : no \- SoXt : no @@ -101,19 +274,18 @@ Robots Pioneer : no Viper S650 : no Viper S850 : no -Video devices (display) - X11 : no - GTK : no - OpenCV : no +Video devices (display) + X11 : yes + GTK : no + OpenCV : yes GDI : no Direct3D : no Framegrabbers - Firewire libdc1394-1.x : no - Firewire libdc1394-2.x : no - Video For Linux Two : no + Firewire libdc1394-2.x : yes + Video For Linux Two : yes DirectShow : no CMU 1394 Digital Camera SDK : no - OpenCV : no + OpenCV : yes Specific devices Yarp : no Kinect : no @@ -125,101 +297,18 @@ Video and image Read/Write: libjpeg : no libpng : no Misc: - XML2 : no + XML2 : yes pthread : yes OpenMP : yes - zbar : no + zbar : yes dmtx : no Documentation: Doxygen : no Graphviz dot : no ViSP built with C++11 features: no \endcode -In our case, only \c pthread an OpenMP 3rd parties are detected. - -\subsection install_ubuntu_3rdparty Optional 3rd party packages - -As mentioned previously, ViSP is interfaced with some 3rd party libraries. The <a href="http://www.irisa.fr/lagadic/visp/libraries.html">complete list is provided here</a>. We recommend to install the following: - -- OpenCV -\code -sudo apt-get install libopencv-dev -\endcode -- libX11 to be able to open a window to display images -\code -sudo apt-get install libx11-dev -\endcode -- lapack and GSL to benefit from optimized mathematical capabilities -\code -sudo apt-get install liblapack-dev libgsl0-dev -\endcode -- libdc1394 to grab images from firewire cameras -\code -sudo apt-get install libdc1394-22-dev -\endcode -- libv4l to grab images from usb or analogic cameras -\code -sudo apt-get install libv4l-dev -\endcode -- Coin, to be able to support vrml cad model used by the model-based trackers -\code -sudo apt-get install libCoin80-dev -\endcode -- libxml2 to be able to configure the model-based trackers from xml files -\code -sudo apt-get install libxml2-dev -\endcode -- libjpeg, libpng to support jpeg and png images -\code -sudo apt-get install libjpeg-dev libpng12-dev -\endcode -- ffmpeg, to be able to read or encode compressed video streams -\code -sudo apt-get install libswscale-dev libavutil-dev libavformat-dev libavcodec-dev libbz2-dev libbz2-1.0 -\endcode -- Ogre 3D if you want to do augmented reality or simulation -\code -sudo apt-get install libogre-1.9-dev libois-dev -\endcode -- Bar code detection -\code -sudo apt-get install libzbar-dev libdmtx-dev -\endcode - -Once installed, if you want that ViSP exploit the new 3rd party, you have to configure ViSP again. - -\code -ccmake ../ViSP-2.10.0 -\endcode -The following image shows now that all the previous optional 3rd parties are detected. -\image html img-ccmake-ubuntu-all.png Snapshot of the ccmake \c ../ViSP-2.10.0 command used to configure ViSP after installation of optional 3rd party libraries. -\subsection install_ubuntu_generate Generating Makefiles - -To generate the makefiles, just press [g] key in the ccmake gui. - -Now we can build ViSP. - -\section install_ubuntu_build Building ViSP from source - -- To build ViSP proceed with: -\code -make -j4 -\endcode - -- To install ViSP proceed with: -\code -sudo make install -\endcode - -- To build ViSP documentation, you have first to install Doxygen package: -\code -sudo apt-get install doxygen graphviz texlive-latex-base -\endcode -Then you can proceed with: -\code -make visp_doc -\endcode +\section install_ubuntu_next Next tutorial You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project. diff --git a/doc/tutorial-install-win10-msvc14.doc b/doc/tutorial-install-win10-msvc14.doc new file mode 100644 index 0000000000000000000000000000000000000000..1d0b4d5acb379150854b1fe5a65402ad067b4c5e --- /dev/null +++ b/doc/tutorial-install-win10-msvc14.doc @@ -0,0 +1,174 @@ +/** + +\page tutorial-install-win10-msvc14 Tutorial: Installation from source on Windows 10 with Visual C++ 2015 +\tableofcontents + +In this tutorial you will learn how to install ViSP from source on Windows 10 with Visual C++. These steps have been tested on Windows 10 (64 bit), with CMake 3.3.2 and Visual Studio Community 2015. + +\note Concerning ViSP installation, we provide also other \ref tutorial. + +\section install_win10_msvc14_required Install prerequisities + +- Visual C++. Visual Studio Community 2015 that includes Visual C++ could be downloaded from https://www.visualstudio.com. After the installation, start Visual Studio and create an empty C++ project to install the common tools for Visual C++ 2015. +- CMake that could be download at : http://www.cmake.org. +\warning We notice that CMake 3.4.1 was not able to detect Visual C++ 2015. This issue is kwown by CMake developers and registered as a bug https://cmake.org/Bug/view.php?id=15831. That is why we suggest to install CMake 3.3.2 to work with Visual C++ 2015. + +To install CMake 3.3.2, download the previous release binary distribution installer for Windows. You will find it under <a href="https://cmake.org/download/">"Windows (Win32 Installer)"</a>. Install CMake just by double clicking on the binary cmake-3.3.2-win32-x86.exe you downloaded. +- Windows Software Developement Kit (SDK) for Windows 10. This SDK could be downloaded from https://dev.windows.com/en-US/downloads/windows-10-sdk. This SDK is requested by CMake and allows also to get the Graphical Device Interface (GDI) capabilities. The GDI is used in ViSP to display images in a window thanks to vpDisplayGDI class. + +\section install_win10_msvc14_3rdparty Install 3rd parties + +ViSP is interfaced with several 3rd party libraries. The <a href="http://visp.inria.fr/software-architecture">complete list is provided here</a>. + +\subsection install_win10_msvc14_3rdparty_recommended Recommended 3rd parties +We recommend to install OpenCV 3rd party. Other 3rd parties should be considered only by expert developers. + +\subsubsection install_win10_msvc10_3rdparty_opencv OpenCV 3rd party + +- From http://opencv.org/downloads.html download the latest OpenCV for Windows version. In our case we install \c opencv-3.1.0.exe pre-build SDK in \c C:\\OpenCV. The installer opencv-3.1.0.exe extracted all the material in \c C:\\OpenCV\\opencv. +\note OpenCV 3.1.0 windows installer contains pre-build libraries compatible with Visual C++ 2015 (in \c C:\\OpenCV\\opencv\\build\\x64\\vc14) and also libraries compatible with Visual C++ 2013 (in \c C:\\OpenCV\\opencv\\build\\x64\\vc12). With any other compiler version you need to build yourself OpenCV from source. + +\note There is an <a href="http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windows-install-prebuild">OpenCV tutorial: Installation Using the Pre-build Libraries</a> that may help if you encounter some difficulties. + +- Now in order that ViSP detects OpenCV you have to set \c OpenCV_DIR environment variable. Start up a command window (in your "Start" menu click on "Run" and type in \c cmd.exe) and enter: +\code +setx OpenCV_DIR C:\OpenCV\opencv\build +\endcode +where \c C:\\OpenCV\\opencv\\build is where you have the build directory (extracted or built). Inside this folder you should have a file named \c OpenCVConfig.cmake. + +- You have also to add the location of OpenCV libraries in the PATH environment variable following the indications mentioned in \ref install_win81_msvc_env_var. + +\section install_win10_msvc14_install_visp Install ViSP from source code +\subsection install_win10_msvc14_get_source Getting ViSP source code + +There are different ways to get ViSP source code. + +- You can download the <a href="http://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once visp-x.y.z.tar.gz or visp-x.y.z.zip is downloaded, uncompress the file. + +- You can also download a <a href="http://visp.inria.fr/download#snapshot">daily snapshot</a>. Once visp-snapshot-yyyy-mm-dd.tar.gz is downloaded, uncompress the file. + +- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> using the git command line (see \ref install_win7_tip_git): +\code +C:\ViSP> git clone https://github.com/lagadic/visp.git +\endcode + +We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c C:\\ViSP\\visp + +\subsection install_win10_msvc14_config Configuring ViSP from source + +The goal of the configuration step is now to use CMake to produce a Visual Studio C++ solution that will be located in \<binary_dir\>, for example \c C:/ViSP/visp-build. + +- Launch CMake (cmake-gui) and complete the \<source_dir\> and \<binary_dir\> locations as in the next image. + +\image html img-cmake-win10-msvc-launch.png + +- Click then on "Configure" button. + +\image html img-cmake-win10-create-build-folder.png + +- Click on "Yes" to create the \c C:/ViSP/visp-build folder. +- Select then your compiler, for example here Visual Studio Express 2013 Win64, and click on "Finish" button. + +\image html img-cmake-win10-msvc-version.png + +- This will start CMake configuration. As shown in the next image, GDI (Graphical Device Interface), OpenCV and OpenMP 3rd parties are automatically detected. + +\image html img-cmake-win10-config.png + +- As given in the previous image, note also that the installation folder is set to \c C:/ViSP/visp-build/install. +\warning If you want to change the installation forder to \c C:/Program \c Files \c (x86)/ViSP, make sure that you have administrator privileges to write in that folder. + +- Click then on "Configure" button. All the red lines should disappear. +\image html img-cmake-win10-config-end.png +\note The default configuration lead to the creation of a shared library (with \c .dll extension). This is the default configuration that is recommended. If you want to create rather a static library (with \c .lib extension) you have to uncheck the \c BUILD_SHARED_LIBS option to disable DLL creation. + +- To finish the configuration, click on "Generate" button. + +\image html img-cmake-win10-msvc-generate.png + +- Once the generation is done, in \c C:/ViSP/visp-build folder you have the Visual Studio \c VISP.sln generated solution file. + +\image html img-win8.1-msvc-solution.jpg + +\subsection install_win10_msvc14_build Building ViSP from source + +- To build ViSP just double click on \c C:/ViSP/visp-build/VISP.sln solution file. This action will open ViSP project in Visual Studio C++. As shown in the next image, by default, Visual Studio position the solution configuration to \c Debug. + +\image html img-win10-msvc-open.png + +- Enter menu "BUILD/Build Solution" to build ViSP. + +\image html img-win10-msvc-build.png + +- At the end of the build process you should have the following indicating that all the build succeeded. + +\image html img-win10-msvc-build-end.png + +- Now to install ViSP, build "INSTALL" project. To this end, apply a left click on "INSTALL" to select the project, then a right click to enter in the "Build" menu. + +\image html img-win10-msvc-install.png + +- At the end of the installation, you should have the following. + +\image html img-win10-msvc-install-end.png + +- As shown in the previous image, all the headers but also the generated library are copied in \c C:/ViSP/visp-build/install folder. + +- This ends ViSP installation with \c Debug configuration. + +- We recommend now to do the same with \c Release settings. As shown in the next image, select the \c Release configuration. + +\image html img-win10-msvc-release.png + +- Now, as previously, build and install ViSP again. + +- At the end, in \c C:/ViSP/visp-build/install/x64/vc14/bin folder you have two versions of ViSP DLL libraries corresponding to ViSP modules; the one suffixed by "d" with debug information, the other one optimized with release compiler options. + +\image html img-win10-explorer-install-end.png + +\subsection install_win10_msvc14_env_var Setting up PATH variable + +If you built static libraries then you are done. Otherwise, if you follow this tutorial step by step you need to add the bin folders path to the systems path. This is because you will use ViSP and OpenCV libraries in form of "Dynamic-link libraries" (also known as DLL). Inside these are stored all the algorithms and information the libraries contains. The operating system will load them only on demand, during runtime. However, to do this he needs to know where they are. The systems \c PATH variable contains a list of folders where DLLs can be found. Add ViSP and OpenCV libraries path to this and the OS will know where to look if he ever needs the libraries. Otherwise, you will need to copy the used DLLs right beside the applications executable file (exe) for the OS to find it. + +To modify the PATH var and add the path to ViSP library, open a cmd terminal and run: +\code +C:\> echo %PATH% +C:\> setx PATH "%PATH%;C:\ViSP\visp-build\install\x64\vc14\bin" +\endcode + +Then to add the path to OpenCV 3rd party libraries location, close and re-open a cmd-terminal and run: +\code +C:\> echo %PATH% +C:\> setx PATH "%PATH%;C:\OpenCV\opencv\build\x64\vc14\bin" +\endcode + +Then close and re-open a cmd terminal to check if the PATH var was well positioned. + +\code +C:\> echo %PATH% +\endcode + +\section install_win10_msvc14_dataset Install ViSP dataset + +Some ViSP examples and tests require data (images, video, models) that are not part of ViSP source code but available in a separate archive named \c ViSP-images-x.y.z.zip. This archive could be downloaded from http://visp.inria.fr/download page. We provide here after the way to install these data if you want to run ViSP examples. + +Download ViSP-images-x.y.z.zip from http://visp.inria.fr/download and uncompress it for example in \c C:/ViSP. + +\image html img-win8.1-visp-images.jpg + +ViSP examples and tests are able to detect automatically the location of the requested data if you position an environment variable called \c VISP_INPUT_IMAGE_PATH. In our case, this variable should be set to \c C:\\ViSP. +\code +setx VISP_INPUT_IMAGE_PATH C:\ViSP +\endcode + +\note For historical reasons \c VISP_INPUT_IMAGE_PATH should not contain the folder \c ViSP-images, but the parent folder. + +From now, you can try to run ViSP examples and tests. For example, if you want to run \c \<binary dir\>/example/device/display/Debug/displayGDI.exe, open a command window, enter in the right folder, and run: + +\image html img-win8.1-cmd-displayGDI.jpg + +\section install_win10_msvc14_next Next tutorial + +You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project. + +*/ diff --git a/doc/tutorial-install-win7.doc b/doc/tutorial-install-win7.doc index 97748a39699d972adb56d926899920e1d7f88aef..fe2fe360e56d0507726f87e3b96ccb21fd7993d8 100644 --- a/doc/tutorial-install-win7.doc +++ b/doc/tutorial-install-win7.doc @@ -3,58 +3,57 @@ \page tutorial-install-win7 Tutorial: Installation from source on Windows 7 with Visual C++ 2012 \tableofcontents -In this tutorial you will learn how to install ViSP from source on Windows with Visual C++. These steps have been tested on Windows 7 (64 bit), with CMake 3.1 and Visual Studio 2012 but should work with any other version as well. +In this tutorial you will learn how to install ViSP from source on Windows with Visual C++. These steps have been tested on Windows 7 (64 bit), with CMake 3.3.2 and Visual Studio 2012 but should work with any other version as well. \note Concerning ViSP installation, we provide also other \ref tutorial. -\section install_win7_required Required packages +\section install_win7_required Install prerequisities - Visual Studio C++. In this tutorial we use Visual Studio 2012. Note that ViSP can also be build with Visual Studio Express that could be downloaded from http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products -- CMake 2.8 or higher that could be download at : http://www.cmake.org/cmake/resources/software.html +\note If you want to use Visual Studio Express, you have to install <b>Express 2013 for Windows Desktop</b>. The \b Desktop version is important to work with CMake. +- CMake 2.8.3 or higher that could be download at : http://www.cmake.org. To install CMake, download the latest binary distribution installer for Windows. You will find it under <a href="https://cmake.org/download/">"Windows (Win32 Installer)"</a>. Install CMake just by double clicking on the binary cmake-x.y.z-win32-x86.exe you downloaded. -\section install_win7_get_source Getting ViSP source code +\section install_win7_3rdparty Install recommended 3rd party -There are different ways to get ViSP source code. +ViSP is interfaced with several 3rd party libraries. The <a href="http://visp.inria.fr/software-architecture">complete list is provided here</a>. We recommend to install the following: -\subsection install_win7_get_source_release Getting the latest release +\subsection install_win7_3rdparty_opencv OpenCV 3rd party -You can download the <a href="http://www.irisa.fr/lagadic/visp/download.html#latest">latest stable release</a> as a zip. +We recommend to install OpenCV. -\subsection install_win7_get_source_snapshot Getting the latest snapshot +- From http://opencv.org/downloads.html download the latest OpenCV for Windows version. In our case we install \c opencv-3.0.0.exe pre-build SDK in \c C:\\OpenCV. The installer opencv-3.0.0.exe extracted all the material in \c C:\\OpenCV\\opencv. +\note OpenCV 3.0.0 windows installer contains pre-build libraries compatible with Visual C++ 2013 (in \c C:\\OpenCV\\opencv\\build\\x86\\vc12 and in \c C:\\OpenCV\\opencv\\build\\x64\\vc12 for the Win64 compiler) and also libraries compatible with Visual C++ 2012 (in \c C:\\OpenCV\\opencv\\build\\x86\\vc11 and in \c C:\\OpenCV\\opencv\\build\\x64\\vc11 for the Win64 compiler). With any other compiler version you need to build yourself OpenCV from source. -When significant changes or bug fixes were introduced in the current developpement version of the source code, we provide snapshots. +\note There is an <a href="http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windows-install-prebuild">OpenCV tutorial: Installation Using the Pre-build Libraries</a> that may help if you encounter some difficulties. -If available, you can download a <a href="http://www.irisa.fr/lagadic/visp/download.html#snapshot">recent snapshot</a> following the link. +- Now in order that ViSP detects OpenCV you have to set \c OpenCV_DIR environment variable. Start up a command window (in your "Start" menu click on "Run" and type in \c cmd.exe) and enter: +\code +setx OpenCV_DIR C:\OpenCV\opencv\build +\endcode +where \c C:\\OpenCV\\opencv\\build is where you have the build directory (extracted or built). Inside this folder you should have a file named \c OpenCVConfig.cmake. -\subsection install_win7_get_source_svn Getting the source from Subversion +- You have also to add the location of OpenCV libraries in the PATH environment variable following the indications mentioned in \ref install_win7_env_var. -You can also get the cutting-edge ViSP version from Subversion repository svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP. +\section install_win7_install_visp Install ViSP from source code +\subsection install_win7_get_source Getting ViSP source code -One way to do that under Windows is to install Subversion that comes with Cygwin installer that is available on https://cygwin.com/install.html +There are different ways to get ViSP source code: -- From the previous link, download Cygwin installer for 32-bits or 64-bits version. -- Double click on the setup binary to start installation. Keep the default settings and select a mirror. -- As shown in the next image, in the window that allows to select the packages, search for "subversion" and select "subversion" package in "Devel": -\image html img-win8.1-cygwin-svn.jpg -- Click on Next button twice to start installation, and then on Finish button to exit installer. -- Now you should be able to use subversion -\code -C:\Users\...> C:\cygwin64\bin\svn.exe --version -svn, version 1.7.14 -\endcode +- You can download the <a href="http://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once visp-x.y.z.tar.gz or visp-x.y.z.zip is downloaded, uncompress the file using for example <a href="http://www.win-rar.com">WinRAR</a> + +- You can also download a <a href="http://visp.inria.fr/download#snapshot">daily snapshot</a>. Once visp-snapshot-yyyy-mm-dd.tar.gz is downloaded, uncompress the file using for example <a href="http://www.win-rar.com">WinRAR</a> -Once installed, to get ViSP source code run: +- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> using the git command line (see \ref install_win7_tip_git): \code -C:\Users\...> cd C:\ViSP -C:\Users\...> C:\cygwin64\bin\svn.exe checkout svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP ViSP-code +C:\ViSP> git clone https://github.com/lagadic/visp.git \endcode -\section install_win7_config Configuring ViSP from source +We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c C:\\ViSP\\visp -We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c C:\\ViSP\\ViSP-2.10.0 +\subsection install_win7_config Configuring ViSP from source -The goal of the configuration step is now to use CMake to produce a Visual Studio C++ solution that will be located in \<binary_dir\>, for example \c C:\\ViSP\\ViSP-2.10.0-build. +The goal of the configuration step is now to use CMake to produce a Visual Studio C++ solution that will be located in \<binary_dir\>, for example \c C:\\ViSP\\visp-build. - Launch CMake (cmake-gui) and complete the \<source_dir\> and \<binary_dir\> locations as in the next image. @@ -64,60 +63,33 @@ The goal of the configuration step is now to use CMake to produce a Visual Studi \image html img-cmake-win7-create-build-folder.jpg -- Click on "Yes" to create the \c C:\\ViSP\\ViSP-2.10.0-build folder. +- Click on "Yes" to create the \c C:\\ViSP\\visp-build folder. - Select then your compiler, for example here Visual Studio 11 Win64, and click on "Finish" button. \image html img-cmake-win7-msvc-version.jpg -- This will start CMake configuration. As shown in the next image, GDI (Graphical Device Interface) and OpenMP 3rd parties are automatically detected. +- This will start CMake configuration. As shown in the next image, GDI (Graphical Device Interface), OpenCV and OpenMP 3rd parties are automatically detected. \image html img-cmake-win7-msvc-config.jpg -- As given in the previous image, note also that the installation folder is set to \c C:\\ViSP\\ViSP-2.10.0-build\\install. +- As given in the previous image, note also that the installation folder is set to \c C:\\ViSP\\visp-build\\install. \warning If you want to change the installation forder to \c C:/Program \c Files \c (x86)/ViSP, make sure that you have administrator privileges to write in that folder. - Click then on "Configure" button. All the red lines should disappear. \image html img-cmake-win7-msvc-config-end.jpg \note The default configuration lead to the creation of a shared library (with \c .dll extension). This is the default configuration that is recommended. If you want to create rather a static library (with \c .lib extension) you have to uncheck the \c BUILD_SHARED_LIBS option to disable DLL creation. -\subsection install_win7_3rdparty Optional 3rd party packages - -ViSP is interfaced with some 3rd party libraries. The <a href="http://www.irisa.fr/lagadic/visp/libraries.html">complete list is provided here</a>. - -\subsubsection install_win7_3rdparty_opencv OpenCV 3rd party - -- We recommend to install OpenCV. From http://opencv.org/downloads.html download the latest OpenCV for Windows version. There is an <a href="http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windows-install-prebuild">OpenCV tutorial: Installation Using the Pre-build Libraries</a> that may help. In our case we install \c OpenCV-3.0.0-beta.exe pre-build SDK in \c C:\\OpenCV. The installer opencv-3.0.0-beta.exe copied all the material in \c C:\\OpenCV\\opencv. - -- Now in order that ViSP detects OpenCV you have to set \c OpenCV_DIR environment variable. Start up a command window (in your "Start" menu click on "Run" and type in \c cmd.exe) and enter: -\code -setx OpenCV_DIR C:\OpenCV\opencv-3.0.0-beta\build -\endcode - -- Here the directory is where you have the build directory (extracted or built). Inside this folder you should have a file named \c OpenCVConfig.cmake. - -- Quit and restart CMake (cmake gui). <b>It is important to quit CMake</b> in order to take into account the new \c OpenCV_DIR environment variable. Click "Configure" button. As shown in the next image, a new red line indicating that OpenCV is found should appear. - -\image html img-cmake-win7-opencv.jpg - -- As shown in the next image, if you enable the advanced view, you can see that we will use OpenCV libraries located in \c C:/OpenCV/opencv/build/x64/vc11/lib folder. - -\image html img-cmake-win-opencv-advanced.jpg - -- Press "Configure" button again. - -\subsection install_win7_gene Ending the configuration - - To finish the configuration, click on "Generate" button. \image html img-cmake-win7-generate.jpg -- Once the generation is done, in \c C:/ViSP/ViSP-2.10.0-build folder you have the Visual Studio \c VISP.sln generated solution file. +- Once the generation is done, in \c C:/ViSP/visp-build folder you have the Visual Studio \c VISP.sln generated solution file. \image html img-cmake-win7-solution.jpg -\section install_win7_build Building ViSP from source +\subsection install_win7_build Building ViSP from source -- To build ViSP just double click on \c C:/ViSP/ViSP-2.10.0-build/VISP.sln solution file. This action will open ViSP project in Visual Studio C++. As shown in the next image, by default, Visual Studio position the solution configuration to \c Debug. +- To build ViSP just double click on \c C:/ViSP/visp-build/VISP.sln solution file. This action will open ViSP project in Visual Studio C++. As shown in the next image, by default, Visual Studio position the solution configuration to \c Debug. \image html img-win7-msvc-open.jpg @@ -137,7 +109,7 @@ setx OpenCV_DIR C:\OpenCV\opencv-3.0.0-beta\build \image html img-win7-msvc-install-succeed.jpg -- As shown in the previous image, all the headers but also the generated library are copied in \c C:/ViSP/ViSP-install folder. +- As shown in the previous image, all the headers but also the generated library are copied in \c C:/ViSP/visp-build/install folder. - This ends ViSP installation with \c Debug configuration. @@ -147,55 +119,83 @@ setx OpenCV_DIR C:\OpenCV\opencv-3.0.0-beta\build - Now, as previously, build and install ViSP again. -- At the end, in \c C:/ViSP/ViSP-install/bin folder you have two versions of ViSP DLL library; the one suffixed by "d" with debug information, the other one optimized with release compiler options. +- At the end, in \c C:/ViSP/visp-build/install/bin folder you have two versions of ViSP DLL libraries for each module; the one suffixed by "d" with debug information, the other one optimized with release compiler options. \image html img-win7-msvc-install-end.jpg -\section install_win7_env_var Setting up PATH variable +\subsection install_win7_env_var Setting up PATH variable If you built static libraries then you are done. Otherwise, if you follow this tutorial step by step you need to add the bin folders path to the systems path. This is because you will use ViSP and OpenCV libraries in form of "Dynamic-link libraries" (also known as DLL). Inside these are stored all the algorithms and information the libraries contains. The operating system will load them only on demand, during runtime. However, to do this he needs to know where they are. The systems \c PATH variable contains a list of folders where DLLs can be found. Add ViSP and OpenCV libraries path to this and the OS will know where to look if he ever needs the libraries. Otherwise, you will need to copy the used DLLs right beside the applications executable file (exe) for the OS to find it. To modify the PATH var and add the path to ViSP library, open a cmd terminal and run: \code -C:\Users\...> echo %PATH% -C:\Users\...> setx PATH "%PATH%;C:\ViSP\ViSP-2.10.0-build\install\x64\vc12\bin" +C:\> echo %PATH% +C:\> setx PATH "%PATH%;C:\ViSP\visp-build\install\x64\vc11\bin" \endcode Then to add the path to OpenCV 3rd party libraries, close and re-open a cmd-terminal and run: \code -C:\Users\...> echo %PATH% -C:\Users\...> setx PATH "%PATH%;C:\OpenCV\opencv\build\x64\vc12\bin" +C:\> echo %PATH% +C:\> setx PATH "%PATH%;C:\OpenCV\opencv\build\x64\vc11\bin" \endcode Then close and re-open a cmd terminal to check if the PATH var was well positioned \code -C:\Users\...> echo %PATH% +C:\> echo %PATH% \endcode -\section install_win7_annex Appendix -\subsection install_win7_annex_data Installing testing data +\section install_win7_dataset Install ViSP dataset -Some ViSP examples and tests require data set (images, models). These data set is provided as a compressed zip files. +Some ViSP examples and tests require data (images, video, models) that are not part of ViSP source code but available in a separate archive named \c ViSP-images-x.y.z.zip. This archive could be downloaded from http://visp.inria.fr/download page. We provide here after the way to install these data if you want to run ViSP examples. -- Download ViSP-images-2.10.0.zip from http://www.irisa.fr/lagadic/visp/download.html#dataDownloadForExample and uncompress it for example in \c C:/ViSP. +Download ViSP-images-x.y.z.zip from http://visp.inria.fr/download and uncompress it for example in \c C:/ViSP. \image html img-win7-ViSP-images.jpg -\subsection install_win7_annex_usage Using testing data -- ViSP examples and tests are able to detect automatically the location of the requested data if you position an environment variable called \c VISP_INPUT_IMAGE_PATH. In our case, this variable should be set to \c C:\\ViSP. +We suppose now that the data are located in \c C:/ViSP/ViSP-images. \code -setx VISP_INPUT_IMAGE_PATH C:\ViSP +C:\> dir ViSP/ViSP-images +Klimt README.md circle ellipse iv mbt mire-2 +LICENSE.txt calibration cube ellipse-1 line mire video \endcode -- It is also possible to run the examples and tests without positioning \c VISP_INPUT_IMAGE_PATH by using command line option \c -i \<\c path \c to \c the \c data \c set\>. If you want to run \c \<binary dir\>/example/device/display/Debug/displayGDI.exe, open a command window, enter in the right folder, and run: +ViSP examples and tests are able to detect automatically the location of the requested data if you position an environment variable called \c VISP_INPUT_IMAGE_PATH. In our case, this variable should be set to \c C:\\ViSP. \code -displayGDI.exe -i C:\ViSP +setx VISP_INPUT_IMAGE_PATH C:\ViSP \endcode +\note For historical reasons \c VISP_INPUT_IMAGE_PATH should not contain the folder \c ViSP-images, but the parent folder. + +From now, you can try to run ViSP examples and tests. For example, if you want to run \c \<binary dir\>/example/device/display/Debug/displayGDI.exe, open a command window, enter in the right folder, and run: + \image html img-win7-cmd-displayGDI.jpg +\section install_win7_tip Tip and tricks + +\subsection install_win7_tip_git How to install Git + +One way to install Git as a command line tool under Windows is to install Git that comes with Cygwin installer that is available on https://cygwin.com/install.html + +- From the previous link, download Cygwin installer for 32-bits or 64-bits version. +- Double click on the setup binary to start installation in C:/cygwin64 as Root Directory. Keep the default settings and select a mirror. +- As shown in the next image, in the window that allows to select the packages, search for \c "git" and select \c "git" package in \c "Devel" category: +\image html img-win7-cygwin-git.jpg +- Click on Next button twice to start installation, and then on Finish button to exit installer. +- To complete the installation, dont forget to add \c C:\\cygwin64\\bin to the path. Open a cmd terminal and run: +\code +C:\> setx PATH "%PATH%;C:\cygwin64\bin" +\endcode +- Close and re-open a cmd terminal to take changes done in PATH variable. +- Now you should be able to use Git. +\code +C:\> git --version +git version 2.5.3 +\endcode + +\section install_win7_next Next tutorial + You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project. */ diff --git a/doc/tutorial-install-win8.1-mingw-w64.doc b/doc/tutorial-install-win8.1-mingw-w64.doc index 4166013e25eb5db82edb5b08407899ddf23b4a0d..98c71603e535024e36a501c98aab27c55c537cec 100644 --- a/doc/tutorial-install-win8.1-mingw-w64.doc +++ b/doc/tutorial-install-win8.1-mingw-w64.doc @@ -3,240 +3,203 @@ \page tutorial-install-win81-mingw64 Tutorial: Installation from source on Windows 8.1 with Mingw-w64 \tableofcontents -In this tutorial you will learn how to install ViSP from source on Windows 8.1 with Mingw-w64. These steps have been tested on Windows 8.1 (64 bit), with CMake 3.1.2 and Mingw-w64 - GCC for Windows 64 & 32 bits. +In this tutorial you will learn how to install ViSP from source on Windows 8.1 with Mingw-w64. These steps have been tested on Windows 8.1 (64 bit), with CMake 3.3.2 and Mingw-w64 - GCC for Windows 64 & 32 bits. \note Concerning ViSP installation, we provide also other \ref tutorial. -\section install_win81_mingw64_required Required packages +\section install_win81_mingw64_required Install prerequisities \subsection install_win81_mingw64_required_mingw Mingw-w64 Mingw-w64 could be found following http://mingw-w64.sourceforge.net. From that page, click on download "Win-builds" that will bring you to the page http://win-builds.org/download.html Here simply download and run the package manager, in our case we downloaded win-builds-1.5.0.exe file. - Once downloaded, double click on the the exe file. It will open an installation window. -- Select x86_64 and Mingw installation folder C:\\mingw as in the following image: +- Select x86_64 and Mingw installation folder \c C:\\mingw as in the following image: \image html img-mingw64-installer-started.jpg -\note It you want to install Mingw in an other folder, you have to set MINGW_DIR environment variable to your installation location in order to allow CMake to detect 3rd party libraries that come with Mingw installer. Fo example, if you install Mingw in C:\\folder\\mingw-w64, setting MINGW_DIR is simply done running in a cmd terminal: +\note It you want to install Mingw in an other folder, you have to set MINGW_DIR environment variable to your installation location in order to allow CMake to detect 3rd party libraries that come with Mingw installer. Fo example, if you install Mingw in \c C:\\folder\\mingw-w64, setting \c MINGW_DIR is simply done running in a cmd terminal: \code -C:\Users\...> setx MINGW_DIR "C:\mingw" +C:> setx MINGW_DIR "C:\folder\mingw-w64" \endcode - Click on "OK" button. It will open an other window: \image html img-mingw64-installer-process.jpg - Where you can click on "Process" button to start the installation -- A window shows the progression of the installation. When all the packages are installed (in our case 92/92 packages, see next image) you can close all the installation windows. -\image html img-mingw64-installer-finished.jpg -- To finish the installation, just add C:\\mingw\\bin folder to the PATH variable. To this end open a cmd terminal and do the following: +- A window shows the progression of the installation. When all the packages are installed you can close all the installation windows. +- To finish the installation, just add \c C:\\mingw\\bin folder to the PATH variable. To this end open a cmd terminal and do the following: \code -C:\Users\...> echo %PATH% -C:\Users\...> setx PATH "%PATH%;C:\mingw\bin" +C:> echo %PATH% +C:> setx PATH "%PATH%;C:\mingw\bin" \endcode - Close and re-open a cmd terminal, then run again \code -C:\Users\...> echo %PATH% +C:> echo %PATH% \endcode to check that C:\\mingw\\bin was added. \subsection install_win81_mingw64_required_cmake CMake -CMake 2.8 or higher that could be download at : http://www.cmake.org In our case we install CMake 3.1.2. +CMake 2.8.3 or higher that could be download at : http://www.cmake.org. +- Download the latest binary distribution installer for Windows. You will find it under <a href="https://cmake.org/download/">"Windows (Win32 Installer)"</a>. +- Install CMake just by double clicking on the binary \c cmake-x.y.z-win32-x86.exe you downloaded. -- Download the latest binary distribution installer for Windows from http://www.cmake.org/download. You will find it under "Windows (Win32 Installer)". -- Install CMake just by double click on the binary cmake-3.1.2-win32-x86.exe you downloaded. +\section install_win81_mingw64_3rdparty Install recommended 3rd parties +ViSP is interfaced with several 3rd party libraries. The <a href="http://visp.inria.fr/software-architecture">complete list is provided here</a>. Some of them are automatically detected since they are part of MinGW distribution. Other may be installed from source. We recommend to install the following: -\section install_win81_mingw64_get_source Getting ViSP source code +\subsection install_win81_mingw64_3rdparty_opencv OpenCV 3rd party -There are different ways to get ViSP source code. +We recommend to install OpenCV. + +- Since OpenCV is not packaged for Mingw, you have to install OpenCV from source. From http://opencv.org/downloads.html download the latest OpenCV for Windows version. In our case we install \c opencv-3.0.0.exe pre-build SDK in \c C:\\OpenCV. The installer opencv-3.0.0.exe extracted all the prebuilt binaries, <b>but also the source code</b> in \c C:\\OpenCV\\opencv. -\subsection install_win81_mingw64_get_source_release Getting the latest release +- Now we have to use CMake to configure OpenCV from source. As \<source_dir\> we will set \c C:\\OpenCV\\opencv\\sources and as \<binary_dir\> we set \c C:\\OpenCV\\opencv\\sources\\build-mingw. +\image html img-win8.1-mingw-opencv-cmake-configure.jpg + +- Click then on "Configure" button. +- Click on "Yes" to create \c C:\\OpenCV\\opencv\\sources\\build-mingw folder. +- Select then "MinGW Makefiles" and click on "Finish" button. +- Modify "CMAKE_INSTALL_PREFIX" to \c C:\\OpenCV\\opencv\\build folder. This is the location of the pre-build libraries that come with the installer. Doing that, allows to install OpenCV libraries in a same parent folder. +\image html img-win8.1-mingw-opencv-cmake-configure-install.jpg +- Click then on "Configure" button to remove the red lines. +- Click on "Generate" button to generate the Makefiles for Mingw. +- Open a cmd terminal, enter in the \<binary_dir\> folder and start mingw32-make +\code +C:\> cd C:\OpenCV\opencv\sources\build-mingw +C:\OpenCV\opencv\sources\build-mingw> mingw32-make +\endcode +\note Depending on OpenCV version you may encounter the following issues, for which we propose work arrounds; \ref issue_win81_mingw_opencv_dtor, \ref issue_win81_mingw_opencv_tiff, or \ref issue_win81_mingw_opencv_ipp. -You can download the <a href="http://www.irisa.fr/lagadic/visp/download.html#latest">latest stable release</a> as a zip. +- To install OpenCV run: +\code +C:\OpenCV\opencv\sources\build-mingw> mingw32-make install +\endcode -\subsection install_win81_mingw64_get_source_snapshot Getting the latest snapshot +- Now in order that ViSP detects OpenCV you have to set \c OpenCV_DIR environment variable. Start up cmd terminal and enter: +\code +setx OpenCV_DIR C:\OpenCV\opencv\build +\endcode +where \c C:\\OpenCV\\opencv\\build is where you have the build directory (extracted or built). Inside this folder you should have a file named \c OpenCVConfig.cmake. -When significant changes or bug fixes were introduced in the current developpement version of the source code, we provide snapshots. +- Here the directory is the one where you have installed OpenCV. Inside this folder you should have a file named \c OpenCVConfig.cmake. -If available, you can download a <a href="http://www.irisa.fr/lagadic/visp/download.html#snapshot">recent snapshot</a> following the link. +- You have also to add the location of OpenCV libraries in the PATH environment variable following the indications mentioned in \ref install_win81_mingw64_env_var. -\subsection install_win81_mingw64_get_source_svn Getting the source from Subversion +\section install_win81_mingw64_install_visp Install ViSP from source code +\subsection install_win81_mingw64_get_source Getting ViSP source code -You can also get the cutting-edge ViSP version from Subversion repository svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP. +There are different ways to get ViSP source code. -One way to do that under Windows is to install Subversion that comes with Cygwin installer that is available on https://cygwin.com/install.html +- You can download the <a href="http://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once visp-x.y.z.tar.gz or visp-x.y.z.zip is downloaded, uncompress the file using for example <a href="http://www.win-rar.com">WinRAR</a> -- From the previous link, download Cygwin installer for 32-bits or 64-bits version. -- Double click on the setup binary to start installation. Keep the default settings and select a mirror. -- As shown in the next image, in the window that allows to select the packages, search for "subversion" and select "subversion" package in "Devel": -\image html img-win8.1-cygwin-svn.jpg -- Click on Next button twice to start installation, and then on Finish button to exit installer. -- Now you should be able to use subversion -\code -C:\Users\...> C:\cygwin64\bin\svn.exe --version -svn, version 1.7.14 -\endcode +- You can also download a <a href="http://visp.inria.fr/download#snapshot">daily snapshot</a>. Once visp-snapshot-yyyy-mm-dd.tar.gz is downloaded, uncompress the file using for example <a href="http://www.win-rar.com">WinRAR</a> -Once installed, to get ViSP source code run: +- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> using the git command line (see \ref install_win7_tip_git): \code -C:\Users\...> cd C:\ViSP -C:\Users\...> C:\cygwin64\bin\svn.exe checkout svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP ViSP-code +C:\ViSP> git clone https://github.com/lagadic/visp.git \endcode +We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c C:\\ViSP\\visp -\section install_win81_mingw64_config Configuring ViSP from source +\subsection install_win81_mingw64_config Configuring ViSP from source -We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c C:\\ViSP\\ViSP-2.10.0 - -The goal of the configuration step is now to use CMake to produce all the material requested to build ViSP with Mingw. This material will be located in \<binary_dir\>, for example \c C:\\ViSP\\ViSP-2.10.0-build. +The goal of the configuration step is now to use CMake to produce all the material requested to build ViSP with Mingw. This material will be located in \<binary_dir\>, for example \c C:\\ViSP\\visp-build. - Launch CMake (cmake-gui) and complete the \<source_dir\> and \<binary_dir\> locations as in the next image. - -\image html img-cmake-win8.1-mingw-launch.jpg +\image html img-cmake-win8.1-msvc-launch.jpg - Click then on "Configure" button. - \image html img-cmake-win8.1-create-build-folder.jpg -- Click on "Yes" to create the \c C:\\ViSP\\ViSP-2.10.0-build folder. +- Click on "Yes" to create the \c C:\\ViSP\\visp-build folder. - Select then "MinGW Makefiles" and click on "Finish" button. - \image html img-cmake-win8.1-mingw-version.jpg -- This will start CMake configuration. As shown in the next image, ffmpeg, gdi, libjpeg, libpng, pthread and libxml2 3rd party are detected. - +- This will start CMake configuration. As shown in the next image, OpenCV, ffmpeg, gdi, libjpeg, libpng, pthread and libxml2 3rd party are detected. \image html img-cmake-win8.1-mingw-configure.jpg +\note If OpenCV is not detected, you may encounter the following issue \ref issue_win81_mingw_opencv_not_detected. -- As given in the previous image, note also that the installation folder is set to \c C:\\ViSP\\ViSP-2.10.0-build\\install. +- As given in the previous image, note also that the installation folder is set to \c C:\\ViSP\\visp-build\\install. \warning If you want to change the installation forder to \c C:/Program \c Files \c (x86)/ViSP, make sure that you have administrator privileges to write in that folder. - Click then on "Configure" button. All the red lines should disappear. \image html img-cmake-win8.1-mingw-configure-end.jpg \note The default configuration lead to the creation of a shared library (with \c .dll extension). This is the default configuration that is recommended. If you want to create rather a static library (with \c .lib extension) you have to uncheck the \c BUILD_SHARED_LIBS option to disable DLL creation. -\subsection install_win81_mingw64_3rdparty Optional 3rd party packages - -ViSP is interfaced with some 3rd party libraries. The <a href="http://www.irisa.fr/lagadic/visp/libraries.html">complete list is provided here</a>. Some of them are automatically detected since they are part of MinGW distribution. Other may be installed from source. - -\subsubsection install_win81_mingw64_3rdparty_opencv OpenCV 3rd party - -- We recommend to install OpenCV. Since OpenCV is not package for Mingw, you have to install OpenCV from source. From http://opencv.org/downloads.html download the latest OpenCV for Windows version. In our case we install \c OpenCV-2.4.10.exe pre-build SDK in \c C:\\OpenCV. The installer opencv-2.4.10.exe copied all the prebuilt binaries, <b>but also the source code</b> in \c C:\\OpenCV\\opencv. -\note You can also install OpenCV 3.0.0. The principle remains the same. - -- Now we have to use CMake to configure OpenCV from source. As \<source_dir\> we will set \c C:\\OpenCV\\opencv\\sources and as \<binary_dir\> we set \c C:\\OpenCV\\opencv\\sources\\build-mingw. -\image html img-win8.1-mingw-opencv-cmake-configure.jpg - -- Click then on "Configure" button. -- Click on "Yes" to create the \c C:\\OpenCV\\opencv\\sources\\build-mingw. -- Select then "MinGW Makefiles" and click on "Finish" button. -\note Here you should encounter a first issue \ref issue_win81_mingw_opencv_endianness. -- Modify "CMAKE_INSTALL_PREFIX" to \c C:\\OpenCV\\opencv\\build folder. This is the location of the pre-build libraries that come with the installer. Doing that, allows to install OpenCV libraries in a same parent folder. -\image html img-win8.1-mingw-opencv-cmake-configure-install.jpg -- Click on "Generate" button to generate the Makefiles for Mingw. -- Open a cmd terminal, enter in the \<binary_dir\> folder and start mingw32-make -\code -C:\Users\...> cd C:\OpenCV\opencv\sources\build-mingw -C:\OpenCV\opencv\sources\build-mingw> mingw32-make -\endcode -\note Here you may encounter an other issue \ref issue_win81_mingw_opencv_tiff and maybe the following if you try to build with OpenCV 3.0.0: \ref issue_win81_mingw_opencv_ipp and \ref issue_win81_mingw_opencv_dshow. - -- To install OpenCV run: -\code -C:\OpenCV\opencv\sources\build-mingw> mingw32-make install -\endcode - -- Now in order that ViSP detects OpenCV you have to set \c OpenCV_DIR environment variable. Start up cmd terminal and enter: -\code -setx OpenCV_DIR C:\OpenCV\opencv\build -\endcode - -- Here the directory is the one where you have installed OpenCV. Inside this folder you should have a file named \c OpenCVConfig.cmake. - -- Quit and restart CMake Gui on ViSP. <b>It is important to quit CMake</b> in order to take into account the new \c OpenCV_DIR environment variable. Click "Configure" button. As shown in the next image, a new red line indicating that OpenCV is found should appear. -\image html img-cmake-win8.1-mingw-opencv-detected.jpg -\note If OpenCV is not detected, you may encounter the following issue \ref issue_win81_mingw_opencv_not_detected. - -- If you enable the advanced view, you can see that we will use OpenCV libraries located in \c C:/OpenCV/opencv/build/x64/mingw/lib folder. - -\image html img-cmake-win8.1-mingw-opencv-detected-advanced.jpg - -- Press "Configure" button again. - -\subsection install_win81_mingw64_gene Ending the configuration - - To finish the configuration, click on "Generate" button. - \image html img-cmake-win8.1-mingw-generate.jpg -- Once the generation is done, in \c C:/ViSP/ViSP-2.10.0-build folder you have the Makefile file that will be used by Mingw to build the entire project. +- Once the generation is done, in \c C:/ViSP/visp-build folder you have the Makefile file that will be used by Mingw to build the entire project. -\section install_win81_mingw64_build Building ViSP from source +\subsection install_win81_mingw64_build Building ViSP from source -- To build ViSP, open a cmd terminal, change to C:\\ViSP\ViSP-2.10.0-build folder and run mingw32-make: +- To build ViSP, open a cmd terminal, change to \c C:\\ViSP\\visp-build folder and run mingw32-make: \code -C:\Users\...> cd C:\ViSP\ViSP-2.10.0-build -C:\ViSP\ViSP-2.10.0-build> mingw32-make +C:\> cd C:\ViSP\visp-build +C:\ViSP\visp-build> mingw32-make \endcode -\note To \ref issue_win81_mingw_warning_pragma just follow the link. - Now to install ViSP, in the same cmd terminal run: \code -C:\ViSP\ViSP-2.10.0-build> mingw32-make install +C:\ViSP\visp-build> mingw32-make install \endcode -- At the end, in \c C:/ViSP/ViSP-2.10.0-build/install/x64/mingw/bin folder you have ViSP DLL library in libvisp-2100.dll file. -\note When CMAKE\_BUILD\_TYPE is set to Debug, the library name is suffixed by "d". +- At the end, in \c C:/ViSP/visp-build/install/x64/mingw/bin folder you will find ViSP DLL libraries corresponding to the build modules. +\note When CMAKE\_BUILD\_TYPE is set to Debug, the library names are suffixed by "d". -\section install_win81_mingw64_env_var Setting up PATH variable +\subsection install_win81_mingw64_env_var Setting up PATH variable If you built static libraries then you are done. Otherwise, if you follow this tutorial step by step you need to add the bin folders path to the systems path. This is because you will use ViSP and OpenCV libraries in form of "Dynamic-link libraries" (also known as DLL). Inside these are stored all the algorithms and information the libraries contains. The operating system will load them only on demand, during runtime. However, to do this he needs to know where they are. The systems \c PATH variable contains a list of folders where DLLs can be found. Add ViSP and OpenCV libraries path to this and the OS will know where to look if he ever needs the libraries. Otherwise, you will need to copy the used DLLs right beside the applications executable file (exe) for the OS to find it. To modify the PATH var and add the path to ViSP library, open a cmd terminal and run: \code -C:\Users\...> echo %PATH% -C:\Users\...> setx PATH "%PATH%;C:\ViSP\ViSP-2.10.0-build\install\x64\mingw\bin" +C:\> echo %PATH% +C:\> setx PATH "%PATH%;C:\ViSP\visp-build\install\x64\mingw\bin" \endcode Then to add the path to OpenCV 3rd party library, close and re-open a cmd-terminal and run: \code -C:\Users\...> echo %PATH% -C:\Users\...> setx PATH "%PATH%;C:\OpenCV\opencv\build\x64\mingw\bin" +C:\> echo %PATH% +C:\> setx PATH "%PATH%;C:\OpenCV\opencv\build\x64\mingw\bin" \endcode Then close and re-open a cmd terminal to check if the PATH var was well positioned \code -C:\Users\...> echo %PATH% +C:\> echo %PATH% \endcode -\section install_win81_mingw64_annex Appendix -\subsection install_win81_mingw64_annex_data Installing testing data +\section install_win81_mingw64_dataset Install ViSP dataset -Some ViSP examples and tests require data set (images, models). These data set is provided as a compressed zip files. +Some ViSP examples and tests require data (images, video, models) that are not part of ViSP source code but available in a separate archive named \c ViSP-images-x.y.z.zip. This archive could be downloaded from http://visp.inria.fr/download page. We provide here after the way to install these data if you want to run ViSP examples. -- Download ViSP-images-2.10.0.zip from http://www.irisa.fr/lagadic/visp/download.html#dataDownloadForExample and uncompress it for example in \c C:/ViSP. +Download ViSP-images-x.y.z.zip from http://visp.inria.fr/download and uncompress it for example in \c C:/ViSP. \image html img-win8.1-visp-images.jpg -\subsection install_win81_mingw64_annex_usage Using testing data -- ViSP examples and tests are able to detect automatically the location of the requested data if you position an environment variable called \c VISP_INPUT_IMAGE_PATH. In our case, this variable should be set to \c C:\\ViSP. +We suppose now that the data are located in \c C:/ViSP/ViSP-images. \code -setx VISP_INPUT_IMAGE_PATH C:\ViSP +C:\> dir ViSP/ViSP-images +Klimt README.md circle ellipse iv mbt mire-2 +LICENSE.txt calibration cube ellipse-1 line mire video \endcode -- It is also possible to run the examples and tests without positioning \c VISP_INPUT_IMAGE_PATH by using command line option \c -i \<\c path \c to \c the \c data \c set\>. If you want to run \c \<binary dir\>/example/device/display/Debug/displayGDI.exe, open a command window, enter in the right folder, and run: +ViSP examples and tests are able to detect automatically the location of the requested data if you position an environment variable called \c VISP_INPUT_IMAGE_PATH. In our case, this variable should be set to \c C:\\ViSP. \code -displayGDI.exe -i C:\ViSP +setx VISP_INPUT_IMAGE_PATH C:\ViSP \endcode -\image html img-win8.1-cmd-displayGDI.jpg +\note For historical reasons \c VISP_INPUT_IMAGE_PATH should not contain the folder \c ViSP-images, but the parent folder. -You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project. +From now, you can try to run ViSP examples and tests. For example, if you want to run \c \<binary dir\>/example/device/display/Debug/displayGDI.exe, open a command window, enter in the right folder, and run: + +\image html img-win8.1-mingw-cmd-displayGDI.jpg \section issue_win81_mingw Known issues + \subsection issue_win81_mingw_opencv_endianness OpenCV endianness failure during CMake configuration -\note This issue occurs with OpenCV 2.4.10 and 2.3.0-beta. +\note This issue occurs with OpenCV 2.4.10, 2.3.0-beta and 2.3.0 releases. If you encounter the following issue during CMake configuration \image html img-opencv-issue-test-big-endian.jpg @@ -247,12 +210,13 @@ test_big_endian(WORDS_BIGENDIAN) \endcode by: \code +#test_big_endian(WORDS_BIGENDIAN) set(WORDS_BIGENDIAN 0) \endcode \subsection issue_win81_mingw_opencv_tiff OpenCV build error: cannot build with tiff support -\note This issue occurs with OpenCV 2.4.10 and 2.3.0-beta. +\note This issue occurs with OpenCV 2.4.10, 2.3.0-beta and 2.3.0 releases. If you encounter a build issue during libtiff build as given in the next image: \image html img-opencv-issue-tiff.jpg @@ -264,56 +228,48 @@ If you encounter a build issue during libtiff build as given in the next image: C:\OpenCV\opencv\sources\build-mingw> mingw32-make \endcode -\subsection issue_win81_mingw_opencv_not_detected OpenCV not detected with Mingw build - -\note This issue occurs with OpenCV 2.4.10 and 2.3.0-beta. - -- To fix this issue, edit C:\\OpenCV\\opencv\\sources\\cmake\\OpenCVConfig.cmake, and line 89 replace: -\code - if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "64") -\endcode -by: -\code - if(OPENCV_GCC_TARGET_MACHINE MATCHES "64") -\endcode - -- Then open a new cmd terminal to build and install OpenCV again: -\code -C:\OpenCV\opencv\sources\build-mingw> mingw32-make install -\endcode - \subsection issue_win81_mingw_opencv_ipp OpenCV link error: cannot find -lRunTmChk -\note This issue occurs with OpenCV 2.3.0-beta and with OpenCV master branch. +\note This issue occurs with OpenCV 2.3.0-beta and 2.3.0 releases. The following image shows the link issue that may appear when building OpenCV with mingw: \image html img-opencv-issue-ipp.jpg A work arround is to configure OpenCV without ipp support turning WITH_IPP=OFF and then trying to build again. -\subsection issue_win81_mingw_opencv_dshow OpenCV build error: cannot build with dshow support +\subsection issue_win81_mingw_opencv_dtor OpenCV build error: struct has virtual functions and accessible non-virtual destructor -\note This issue occurs with OpenCV 2.3.0-beta and with OpenCV master branch. +This error that occurs with OpenCV 3.0.0 during \c cap_dshow.cpp build is known and reported as an issue in https://github.com/Itseez/opencv/pull/5282/commits. +\image html img-win8.1-mingw-opencv-issue-dtor.jpg -The following image shows the link issue that may appear when building OpenCV with mingw: -\image html img-opencv-issue-dshow.jpg +- The fix consists in modifying \c modules/videoio/src/cap_dshow.cpp by adding near line 96: +\code +#ifdef __MINGW32__ +// MinGW does not understand COM interfaces +#pragma GCC diagnostic ignored "-Wnon-virtual-dtor" +#endif +\endcode -A work arround is to configure OpenCV without Direct Show support turning WITH_DSHOW=OFF and then trying to build again. +\subsection issue_win81_mingw_opencv_not_detected OpenCV not detected with Mingw build -\subsection issue_win81_mingw_warning_pragma Fix warning "ignoring #pragma comment(lib,"uuid.lib")" during build +\note This issue occurs with OpenCV 2.4.10 and 2.3.0-beta. -During the build of ViSP the following warning may occur: +- To fix this issue, edit \c C:\\OpenCV\\opencv\\sources\\cmake\\OpenCVConfig.cmake, and line 89 replace: \code -C:/mingw/mingw/include/urlmon.h:301:0: warning: ignoring #pragma comment [-Wunknown-pragmas] -#pragma comment(lib,"uuid.lib") -^ + if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "64") +\endcode +by: +\code + if(OPENCV_GCC_TARGET_MACHINE MATCHES "64") \endcode -To remove this warning, edit C:/mingw/mingw/include/urlmon.h and comment line 301: +- Then open a new cmd terminal to build and install OpenCV again: \code -//#pragma comment(lib,"uuid.lib") +C:\OpenCV\opencv\sources\build-mingw> mingw32-make install \endcode +\section install_win81_mingw_next Next tutorial +You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project. */ diff --git a/doc/tutorial-install-win8.1-msvc.doc b/doc/tutorial-install-win8.1-msvc.doc index f4bb0e23e9f4a798e50c4372a0399b8417d157b5..121fae59bf1d74fc3ccfd20ac7bb407ed868efa5 100644 --- a/doc/tutorial-install-win8.1-msvc.doc +++ b/doc/tutorial-install-win8.1-msvc.doc @@ -3,132 +3,160 @@ \page tutorial-install-win81-msvc Tutorial: Installation from source on Windows 8.1 with Visual C++ 2013 \tableofcontents -In this tutorial you will learn how to install ViSP from source on Windows 8.1 with Visual C++. These steps have been tested on Windows 8.1 (64 bit), with CMake 3.1.1 and Visual Studio Express 2013 but should work with any other version as well. +In this tutorial you will learn how to install ViSP from source on Windows 8.1 with Visual C++. These steps have been tested on Windows 8.1 (64 bit), with CMake 3.3.2 and Visual Studio Express 2013 but should work with any other version as well. \note Concerning ViSP installation, we provide also other \ref tutorial. -\section install_win81_msvc_required Required packages +\section install_win81_msvc_required Install prerequisities -- Visual Studio C++. Note that ViSP can also be build with Visual Studio Express that could be downloaded from http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products In this tutorial we use Visual Studio Express 2013. +- Visual Studio C++. Note that ViSP can also be build with Visual Studio Express that could be downloaded from http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products . In this tutorial we use Visual Studio Express 2013. \note If you want to use Visual Studio Express, you have to install <b>Express 2013 for Windows Desktop</b>. The \b Desktop version is important to work with CMake. -- CMake 2.8 or higher that could be download at : http://www.cmake.org/cmake/resources/software.html +- CMake 2.8.3 or higher that could be download at : http://www.cmake.org. To install CMake, download the latest binary distribution installer for Windows. You will find it under <a href="https://cmake.org/download/">"Windows (Win32 Installer)"</a>. Install CMake just by double clicking on the binary cmake-x.y.z-win32-x86.exe you downloaded. +\section install_win81_msvc_3rdparty Install 3rd parties -\section install_win81_msvc_get_source Getting ViSP source code +ViSP is interfaced with several 3rd party libraries. The <a href="http://visp.inria.fr/software-architecture">complete list is provided here</a>. -There are different ways to get ViSP source code. +\subsection install_win81_msvc_3rdparty_recommended Recommended 3rd parties +We recommend to install the following: -\subsection install_win81_msvc_get_source_release Getting the latest release +\subsubsection install_win81_msvc_3rdparty_gdi Windows SDK 3rd party -You can download the <a href="http://www.irisa.fr/lagadic/visp/download.html#latest">latest stable release</a> as a zip. +We recommend to install the "Windows Software Development Kit (SDK) for windows 8.1" to get the Graphical Device Interface (GDI) capabilities. The GDI is used in ViSP to display images in a window thanks to vpDisplayGDI class. -\subsection install_win81_msvc_get_source_snapshot Getting the latest snapshot +- This SDK can be downloaded from https://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx -When significant changes or bug fixes were introduced in the current developpement version of the source code, we provide snapshots. -If available, you can download a <a href="http://www.irisa.fr/lagadic/visp/download.html#snapshot">recent snapshot</a> following the link. +\subsubsection install_win81_msvc_3rdparty_opencv OpenCV 3rd party -\subsection install_win81_msvc_get_source_svn Getting the source from Subversion +We recommend also to install OpenCV. -You can also get the cutting-edge ViSP version from Subversion repository svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP. +- From http://opencv.org/downloads.html download the latest OpenCV for Windows version. In our case we install \c opencv-3.0.0.exe pre-build SDK in \c C:\\OpenCV. The installer opencv-3.0.0.exe extracted all the material in \c C:\\OpenCV\\opencv. +\note OpenCV 3.0.0 windows installer contains pre-build libraries compatible with Visual C++ 2013 (in \c C:\\OpenCV\\opencv\\build\\x86\\vc12 and in \c C:\\OpenCV\\opencv\\build\\x64\\vc12 for the Win64 compiler) and also libraries compatible with Visual C++ 2012 (in \c C:\\OpenCV\\opencv\\build\\x86\\vc11 and in \c C:\\OpenCV\\opencv\\build\\x64\\vc11 for the Win64 compiler). With any other compiler version you need to build yourself OpenCV from source. -One way to do that under Windows is to install Subversion that comes with Cygwin installer that is available on https://cygwin.com/install.html +\note There is an <a href="http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windows-install-prebuild">OpenCV tutorial: Installation Using the Pre-build Libraries</a> that may help if you encounter some difficulties. -- From the previous link, download Cygwin installer for 32-bits or 64-bits version. -- Double click on the setup binary to start installation. Keep the default settings and select a mirror. -- As shown in the next image, in the window that allows to select the packages, search for "subversion" and select "subversion" package in "Devel": -\image html img-win8.1-cygwin-svn.jpg -- Click on Next button twice to start installation, and then on Finish button to exit installer. -- Now you should be able to use subversion -\code -C:\Users\...> C:\cygwin64\bin\svn.exe --version -svn, version 1.7.14 -\endcode - -Once installed, to get ViSP source code run: +- Now in order that ViSP detects OpenCV you have to set \c OpenCV_DIR environment variable. Start up a command window (in your "Start" menu click on "Run" and type in \c cmd.exe) and enter: \code -C:\Users\...> cd C:\ViSP -C:\Users\...> C:\cygwin64\bin\svn.exe checkout svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP ViSP-code +setx OpenCV_DIR C:\OpenCV\opencv\build \endcode +where \c C:\\OpenCV\\opencv\\build is where you have the build directory (extracted or built). Inside this folder you should have a file named \c OpenCVConfig.cmake. -\section install_win81_msvc_config Configuring ViSP from source +- You have also to add the location of OpenCV libraries in the PATH environment variable following the indications mentioned in \ref install_win81_msvc_env_var. -We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c C:\\ViSP\\ViSP-2.10.0 +\subsection install_win81_msvc_3rdparty_other Other optional 3rd parties -The goal of the configuration step is now to use CMake to produce a Visual Studio C++ solution that will be located in \<binary_dir\>, for example \c C:\\ViSP\\ViSP-2.10.0-build. +We give also the way to install other 3rd party libraries to enable specific capabilities. +\subsubsection install_win81_msvc_3rdparty_ogre Ogre3D 3rd party -- Launch CMake (cmake-gui) and complete the \<source_dir\> and \<binary_dir\> locations as in the next image. - -\image html img-cmake-win8.1-msvc-launch.jpg +\warning Ogre3D installation from source code described in this section is reserved to expert users. -- Click then on "Configure" button. +If you are interested in augmented reality (see vpAROgre), or if you want to enable advanced visibility computation during model-based tracking (see vpMbTracker::setOgreVisibilityTest() and \ref tutorial-tracking-mb) we recommend to install Ogre3D. You can check if a <a href="http://www.ogre3d.org/download/sdk">prebuild SDK</A> matches your Visual C++ version, and follow the <a href="http://www.ogre3d.org/tikiwiki/Installing+the+Ogre+SDK">SDK installation instructions</a>. You can also install the lastest release from source. Based on our experience, this is what we recommend. -\image html img-cmake-win8.1-create-build-folder.jpg - -- Click on "Yes" to create the \c C:\\ViSP\\ViSP-2.10.0-build folder. -- Select then your compiler, for example here Visual Studio Express 2013 Win64, and click on "Finish" button. +Ogre source code is hosted on <a href="https://bitbucket.org/sinbad/ogre">BitBucket</a>. On Ogre wiki you will find useful information to <a href="http://www.ogre3d.org/tikiwiki/tiki-index.php?page=Building+Ogre">build and install Ogre from source</a>. Hereafter we give the main steps. -\image html img-cmake-win8.1-msvc-version.jpg +<b>Ogre prerequisities</b> +- To build Ogre on Windows you will need to install the DirectX SDK. Since Windows 8, DirectX is no longer a standalone package, rather it is bundled in the Windows 8.x SDK. The latest version is the <a href="https://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx">Windows 8.1 SDK</a>. +- To get the Ogre source code but also the source code of all the dependencies hosted on BitBucket and available with Mercurial, you have to install <a href="http://tortoisehg.bitbucket.org">TortoiseHg</a>. -- This will start CMake configuration. As shown in the next image, only OpenMP 3rd party is automatically detected. +<b>Getting Ogre dependencies</b> +- A repository containing Ogre dependencies source code is available <a href="https://bitbucket.org/cabalistic/ogredeps">here at BitBucket</a>. +- Open an explorer window, and enter in TortoiseHg Clone menu. Select as source https://bitbucket.org/cabalistic/ogredeps and as destination \c C:\\Ogre\\ogredeps as in the next image: +\image html img-win8.1-ogredeps-tortoisehg.jpg +- Click on Clone button to get dependencies source code in \c C:\\Ogre\\ogredeps -\image html img-cmake-win8.1-4.jpg +<b>Building Ogre dependencies</b> +- To build the dependencies, open CMake GUI and set source code location pointing to \c C:\\Ogre\\ogredeps and build location pointing to \c C:\\Ogre\\ogredeps\\build. Select Visual Studio 12 2013 Win64 as generator, click on "Configure" button twice and then on "Generate" button. You should have something similar to the next image: +\image html img-win8.1-cmake-ogredeps.jpg +- Open \c C:\\Ogre\\ogredeps\\build\\OGREDEPS.sln solution file with Visual C++. +- In Visual, select Debug configuration and build INSTALL project: +\image html img-win8.1-msvc-build-ogredeps.jpg +\note If the build fails due to the environment variable DXSDK_DIR that is not set, see \ref known_issues_win81_msvc_ogredeps for a work arround. +- In Visual, select also Release configuration and build again INSTALL project. +- Now in \c C:\\Ogre\\ogredeps\\build\\ogredeps\\bin you will find the Cg and OIS dependencies build in Debug and Release: +\image html img-win8.1-ogredeps-explorer.jpg +- To finish dependencies installation, set OGRE_DEPENDENCIES_DIR environment variable pointing to \c C:\\Ogre\\ogredeps\\build\\ogredeps +\code +setx OGRE_DEPENDENCIES_DIR C:\Ogre\ogredeps\build\ogredeps +\endcode + +<b>Getting Ogre source</b> + +- From <a href="http://www.ogre3d.org/download/source">Ogre download page</a>, identify the last release. In our case Ogre 1.9 that is on <a href="https://bitbucket.org/sinbad/ogre/branches">BitBucket repository</a> under branch v1-9. +- Open an explorer window, and enter in TortoiseHg Clone menu. Select as source https://bitbucket.org/sinbad/ogre, as destination \c C:\\Ogre\\ogre and select revision v1-9 corresponding to the branch of the latest release as presented in the next image: +\image html img-win8.1-ogre-tortoisehg.jpg +- Click on Clone button to get Ogre source code in \c C:\\Ogre\\ogre + +<b>Building Ogre source</b> + +- Close and re-open CMake Gui. Set source code location pointing to \c C:\\Ogre\\ogre and build location pointing to \c C:\\Ogre\\ogre\\build. Select Visual Studio 12 2013 Win64 as generator, click on "Configure" button and then on "Generate" button. You should have something similar to the next image: +\image html img-win8.1-cmake-ogre.jpg +\note As shown in the previous image, Ogre installation folder is set to \c C:\\Ogre\\ogre\\build\\sdk. +- Open \c C:\\Ogre\\ogre\\build\\OGRE.sln solution file with Visual C++. +- In Visual, select Debug configuration and build INSTALL project. +- In Visual, select also Release configuration and build again INSTALL project. +- Now in \c C:\\Ogre\\ogre\\build\\sdk\\bin you will find all the libraries in Debug and Release configuration, including Cg and OIS dependencies there where build previously. +\image html img-win8.1-ogre-explorer.jpg +- To finish Ogre installation set OGRE_HOME environment variables to \c C:\\Ogre\\ogre\\build\\sdk location. +\code +setx OGRE_HOME C:\Ogre\ogre\build\sdk +\endcode -- As given in the previous image, note also that the installation folder is set to \c C:\\ViSP\\ViSP-2.10.0-build\\install. -\warning If you want to change the installation forder to \c C:/Program \c Files \c (x86)/ViSP, make sure that you have administrator privileges to write in that folder. +\section install_win81_msvc_install_visp Install ViSP from source code +\subsection install_win81_msvc_get_source Getting ViSP source code -- Click then on "Configure" button. All the red lines should disappear. -\image html img-cmake-win8.1-6.jpg -\note The default configuration lead to the creation of a shared library (with \c .dll extension). This is the default configuration that is recommended. If you want to create rather a static library (with \c .lib extension) you have to uncheck the \c BUILD_SHARED_LIBS option to disable DLL creation. +There are different ways to get ViSP source code. -\subsection install_win81_msvc_3rdparty Optional 3rd party packages +- You can download the <a href="http://visp.inria.fr/download">latest release</a> as a zip or a tarball. Once visp-x.y.z.tar.gz or visp-x.y.z.zip is downloaded, uncompress the file using for example <a href="http://www.win-rar.com">WinRAR</a> -ViSP is interfaced with some 3rd party libraries. The <a href="http://www.irisa.fr/lagadic/visp/libraries.html">complete list is provided here</a>. +- You can also download a <a href="http://visp.inria.fr/download#snapshot">daily snapshot</a>. Once visp-snapshot-yyyy-mm-dd.tar.gz is downloaded, uncompress the file using for example <a href="http://www.win-rar.com">WinRAR</a> -\subsubsection install_win81_msvc_3rdparty_gdi Windows Software Development Kit +- Or you get the cutting-edge ViSP from <a href="https://github.com/lagadic/visp">GitHub repository</a> using the git command line (see \ref install_win7_tip_git): +\code +C:\ViSP> git clone https://github.com/lagadic/visp.git +\endcode -- We recommend to install the "Windows Software Development Kit (SDK) for windows 8.1" to get the Graphical Device Interface (GDI) capabilities. The GDi is used in ViSP to display images in a window thanks to vpDisplayGDI class. This SDK can be downloaded from https://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx +We suppose now that ViSP source is in a directory denoted \<source_dir\>, for example \c C:\\ViSP\\visp -- Once installed, return to CMake Gui and click on "Configure" button. As shown in the the next image, GDI should be detected. +\subsection install_win81_msvc_config Configuring ViSP from source -\image html img-cmake-win8.1-gdi.jpg +The goal of the configuration step is now to use CMake to produce a Visual Studio C++ solution that will be located in \<binary_dir\>, for example \c C:\\ViSP\\visp-build. -- Click again on "Configure" button. +- Launch CMake (cmake-gui) and complete the \<source_dir\> and \<binary_dir\> locations as in the next image. -\subsubsection install_win81_msvc_3rdparty_opencv OpenCV 3rd party +\image html img-cmake-win8.1-msvc-launch.jpg -- We recommend to install OpenCV. From http://opencv.org/downloads.html download the latest OpenCV for Windows version. There is an <a href="http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windows-install-prebuild">OpenCV tutorial: Installation Using the Pre-build Libraries</a> that may help. In our case we install \c OpenCV-2.4.10.exe pre-build SDK in \c C:\\OpenCV. The installer opencv-2.4.10.exe copied all the material in \c C:\\OpenCV\\opencv. +- Click then on "Configure" button. -- Now in order that ViSP detects OpenCV you have to set \c OpenCV_DIR environment variable. Start up a command window (in your "Start" menu click on "Run" and type in \c cmd.exe) and enter: -\code -setx OpenCV_DIR C:\OpenCV\opencv\build -\endcode +\image html img-cmake-win8.1-create-build-folder.jpg -- Here the directory is where you have the build directory (extracted or built). Inside this folder you should have a file named \c OpenCVConfig.cmake. +- Click on "Yes" to create the \c C:\\ViSP\\visp-build folder. +- Select then your compiler, for example here Visual Studio Express 2013 Win64, and click on "Finish" button. -- Quit and restart CMake (cmake gui). <b>It is important to quit CMake</b> in order to take into account the new \c OpenCV_DIR environment variable. Click "Configure" button. As shown in the next image, a new red line indicating that OpenCV is found should appear. +\image html img-cmake-win8.1-msvc-version.jpg -\image html img-cmake-win8.1-opencv.jpg +- This will start CMake configuration. As shown in the next image, GDI (Graphical Device Interface), OpenCV, Ogre and OpenMP 3rd parties are automatically detected. -- As shown in the next image, if you enable the advanced view, you can see that we will use OpenCV libraries located in \c C:/OpenCV/opencv/build/x64/vc12/lib folder. - -\image html img-cmake-win8.1-opencv-advanced.jpg +\image html img-cmake-win8.1-config.jpg -- Press "Configure" button again. +- As given in the previous image, note also that the installation folder is set to \c C:\\ViSP\\visp-build\\install. +\warning If you want to change the installation forder to \c C:/Program \c Files \c (x86)/ViSP, make sure that you have administrator privileges to write in that folder. -\subsection install_win81_msvc_gene Ending the configuration +- Click then on "Configure" button. All the red lines should disappear. +\image html img-cmake-win8.1-config-end.jpg +\note The default configuration lead to the creation of a shared library (with \c .dll extension). This is the default configuration that is recommended. If you want to create rather a static library (with \c .lib extension) you have to uncheck the \c BUILD_SHARED_LIBS option to disable DLL creation. - To finish the configuration, click on "Generate" button. \image html img-cmake-win8.1-msvc-generate.jpg -- Once the generation is done, in \c C:/ViSP/ViSP-2.10.0-build folder you have the Visual Studio \c VISP.sln generated solution file. +- Once the generation is done, in \c C:/ViSP/visp-build folder you have the Visual Studio \c VISP.sln generated solution file. \image html img-win8.1-msvc-solution.jpg -\section install_win81_msvc_build Building ViSP from source +\subsection install_win81_msvc_build Building ViSP from source -- To build ViSP just double click on \c C:/ViSP/ViSP-2.10.0-build/VISP.sln solution file. This action will open ViSP project in Visual Studio C++. As shown in the next image, by default, Visual Studio position the solution configuration to \c Debug. +- To build ViSP just double click on \c C:/ViSP/visp-build/VISP.sln solution file. This action will open ViSP project in Visual Studio C++. As shown in the next image, by default, Visual Studio position the solution configuration to \c Debug. \image html img-win8.1-msvc-open.jpg @@ -148,7 +176,7 @@ setx OpenCV_DIR C:\OpenCV\opencv\build \image html img-win8.1-msvc-install-end.jpg -- As shown in the previous image, all the headers but also the generated library are copied in \c C:/ViSP/ViSP-2.10.0-build/install folder. +- As shown in the previous image, all the headers but also the generated library are copied in \c C:/ViSP/visp-build/install folder. - This ends ViSP installation with \c Debug configuration. @@ -158,53 +186,96 @@ setx OpenCV_DIR C:\OpenCV\opencv\build - Now, as previously, build and install ViSP again. -- At the end, in \c C:/ViSP/ViSP-2.10.0-build/install/x64/vc12/bin folder you have two versions of ViSP DLL library; the one suffixed by "d" with debug information, the other one optimized with release compiler options. +- At the end, in \c C:/ViSP/visp-build/install/x64/vc12/bin folder you have two versions of ViSP DLL libraries corresponding to ViSP modules; the one suffixed by "d" with debug information, the other one optimized with release compiler options. \image html img-win8.1-explorer-install-end.jpg -\section install_win81_msvc_env_var Setting up PATH variable +\subsection install_win81_msvc_env_var Setting up PATH variable If you built static libraries then you are done. Otherwise, if you follow this tutorial step by step you need to add the bin folders path to the systems path. This is because you will use ViSP and OpenCV libraries in form of "Dynamic-link libraries" (also known as DLL). Inside these are stored all the algorithms and information the libraries contains. The operating system will load them only on demand, during runtime. However, to do this he needs to know where they are. The systems \c PATH variable contains a list of folders where DLLs can be found. Add ViSP and OpenCV libraries path to this and the OS will know where to look if he ever needs the libraries. Otherwise, you will need to copy the used DLLs right beside the applications executable file (exe) for the OS to find it. To modify the PATH var and add the path to ViSP library, open a cmd terminal and run: \code -C:\Users\...> echo %PATH% -C:\Users\...> setx PATH "%PATH%;C:\ViSP\ViSP-2.10.0-build\install\x64\vc12\bin" +C:\> echo %PATH% +C:\> setx PATH "%PATH%;C:\ViSP\visp-build\install\x64\vc12\bin" \endcode -Then to add the path to OpenCV 3rd party library, close and re-open a cmd-terminal and run: +Then to add the path to OpenCV 3rd party libraries location, close and re-open a cmd-terminal and run: \code -C:\Users\...> echo %PATH% -C:\Users\...> setx PATH "%PATH%;C:\OpenCV\opencv\build\x64\vc12\bin" +C:\> echo %PATH% +C:\> setx PATH "%PATH%;C:\OpenCV\opencv\build\x64\vc12\bin" \endcode -Then close and re-open a cmd terminal to check if the PATH var was well positioned +If installed, you have also to add the location of Ogre 3rd party libraries to the path. Close and re-open a cmd terminal to run: +\code +C:\> echo %PATH% +C:\> setx PATH "%PATH%;C:\Ogre\ogre\build\sdk\bin\release" +C:\> setx PATH "%PATH%;C:\Ogre\ogre\build\sdk\bin\debug" +\endcode + +Then close and re-open a cmd terminal to check if the PATH var was well positioned. \code -C:\Users\...> echo %PATH% +C:\> echo %PATH% \endcode -\section install_win81_msvc_annex Appendix -\subsection install_win81_msvc_annex_data Installing testing data +\section install_win81_msvc_dataset Install ViSP dataset -Some ViSP examples and tests require data set (images, models). These data set is provided as a compressed zip files. +Some ViSP examples and tests require data (images, video, models) that are not part of ViSP source code but available in a separate archive named \c ViSP-images-x.y.z.zip. This archive could be downloaded from http://visp.inria.fr/download page. We provide here after the way to install these data if you want to run ViSP examples. -- Download ViSP-images-2.10.0.zip from http://www.irisa.fr/lagadic/visp/download.html#dataDownloadForExample and uncompress it for example in \c C:/ViSP. +Download ViSP-images-x.y.z.zip from http://visp.inria.fr/download and uncompress it for example in \c C:/ViSP. \image html img-win8.1-visp-images.jpg -\subsection install_win81_msvc_annex_usage Using testing data -- ViSP examples and tests are able to detect automatically the location of the requested data if you position an environment variable called \c VISP_INPUT_IMAGE_PATH. In our case, this variable should be set to \c C:\\ViSP. +ViSP examples and tests are able to detect automatically the location of the requested data if you position an environment variable called \c VISP_INPUT_IMAGE_PATH. In our case, this variable should be set to \c C:\\ViSP. \code setx VISP_INPUT_IMAGE_PATH C:\ViSP \endcode -- It is also possible to run the examples and tests without positioning \c VISP_INPUT_IMAGE_PATH by using command line option \c -i \<\c path \c to \c the \c data \c set\>. If you want to run \c \<binary dir\>/example/device/display/Debug/displayGDI.exe, open a command window, enter in the right folder, and run: +\note For historical reasons \c VISP_INPUT_IMAGE_PATH should not contain the folder \c ViSP-images, but the parent folder. + +From now, you can try to run ViSP examples and tests. For example, if you want to run \c \<binary dir\>/example/device/display/Debug/displayGDI.exe, open a command window, enter in the right folder, and run: + +\image html img-win8.1-cmd-displayGDI.jpg + +\section known_issues_win81_msvc Known issues + +\subsection known_issues_win81_msvc_ogredeps Unable to build ogredeps: DXSDK_DIR missing + +During ogredeps build as described in \ref install_win81_msvc_3rdparty_ogre installation you may get in Visual C++ the following error when building SDL2 project: +\code +error: DIRECTX requires $DXSDK_DIR environment variable to be set +\endcode +\image html img-win8.1-msvc-ogredeps-issue.jpg + +To fix the issue: +- Quit Visual C++ and start again CMake over ogredeps project +- Disable SDL2 dependency build turning \c OGREDEPS_BUILD_SDL2 option off +\image html img-win8.1-cmake-ogredeps-issue.jpg +- Configure and generate again the project +- Open \c C:\\Ogre\\ogredeps\\build\\OGREDEPS.sln solution file with Visual C++ and try a new build as described in \ref install_win81_msvc_3rdparty_ogre + +\subsection known_issues_win81_msvc_ogre_mbtracker Model-based trackers are not working with Ogre visibility ckeck + +If you run \c mbtEdgeTracking.exe, \c mbtKltTracking.exe or \c mbtEdgeKltTracking.exe enabling Ogre visibility check (using "-o" option), you may encounter the following issue: \code -displayGDI.exe -i C:\ViSP +C:\ViSP\visp-build\example\Tracking\Debug> mbtEdgeTracking.exe -c -o +... +OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource VTFInstancing.cg in resource group General +... +*** Initializing OIS *** \endcode +and then a wonderful runtime issue as in the next image: +\image html img-win8.1-msvc-mbtracker-ogre-issue.jpg -\image html img-win8.1-cmd-displayGDI.jpg +It means maybe that Ogre version is not compatible with DirectX 11. This can be checked adding "-w" option to the command line: +\code +C:\ViSP\visp-build\example\Tracking\Debug> mbtEdgeTracking.exe -c -o -w +\endcode +Now the binary should open the Ogre configuration window where you have to select "OpenGL Rendering Subsystem" instead of "Direct3D11 Rendering Subsystem". Press then OK to continue and start the tracking of the cube. +\image html img-win8.1-msvc-mbtracker-ogre-opengl.jpg + +\section install_win81_msvc_next Next tutorial You are now ready to see the next \ref tutorial-getting-started that will show you how to use ViSP as a 3rd party to build your own project. diff --git a/doc/tutorial-plotter.doc b/doc/tutorial-plotter.doc index d9dca89d8dc1ef6fe45da25e7bbd2de528d8aa9b..7ced52acf4aba218170ebcfbccb7650f4d6604d0 100644 --- a/doc/tutorial-plotter.doc +++ b/doc/tutorial-plotter.doc @@ -17,7 +17,7 @@ The last image of the drawing is the following: Now we describe the new lines that were introduced: \code -#include <visp/vpPlot.h> +#include <visp3/core/vpPlot.h> \endcode Include the header of the vpPlot class that allows curves drawing. diff --git a/doc/tutorial-pose-estimation.doc b/doc/tutorial-pose-estimation.doc index 3e189bd8c6feffc9cf9961fcd45379841cf59a1d..06a48b2c1844452cd11bb064385ec9bbbc4f8093 100644 --- a/doc/tutorial-pose-estimation.doc +++ b/doc/tutorial-pose-estimation.doc @@ -26,8 +26,8 @@ And here is the detailed explanation of the new lines introduced in the source c First we include the headers of the vpPixelMeterConversion class that contains static functions able to convert coordinates of a point expressed in pixels in the image into meter in the image plane thanks to the camera intrinsic parameters. We also include the header of the vpPose class that is able to estimate a pose from points. \code -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpPose.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/vision/vpPose.h> \endcode Here we introduce the computePose() function that does the pose estimation. This function uses as input two vectors. The first one is a vpPoint that contains the 3D coordinates in meters of a point, while the second one is a vpDot2 that contains the 2D coordinates in pixels of a blob center of gravity. The 3D and 2D coordinates of the points need to be matched. That means that \c point[i] and \c dot[i] should refer to the same physical point. Other inputs are \c cam that corresponds to the camera intrinsic parameters, and \c init that indicates if the pose needs to be initialized the first time. We have \c cMo parameter that will contain the resulting pose estimated from the input points. diff --git a/doc/tutorial-simu-robot-pioneer.doc b/doc/tutorial-simu-robot-pioneer.doc index 2ffcdec814305ee5a2c8387c19f898ecd4824aa7..a2842b48d82d294f820224c4b73144bbd808df84 100644 --- a/doc/tutorial-simu-robot-pioneer.doc +++ b/doc/tutorial-simu-robot-pioneer.doc @@ -233,5 +233,6 @@ The following control law is used: \end{array}\right] = -0.2 \left( {\bf L_{s} {^c}V_e {^e}J_e}\right)^{+} ({\bf s} - {\bf s}^*) \f] +\section simu_robot_pioneer_next Next tutorial You are now ready to see the next \ref tutorial-boost-vs. */ diff --git a/doc/tutorial-trace.doc b/doc/tutorial-trace.doc index 2945ae325ebdf281e576b725aca2ee909e5a3c47..71138b4d103fac30bac080ddeaa5dd23ec367bdb 100644 --- a/doc/tutorial-trace.doc +++ b/doc/tutorial-trace.doc @@ -64,7 +64,7 @@ If you develop a project that uses ViSP library as a 3rd party, there are differ #define VP_TRACE #define VP_DEBUG -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> \endcode either by modifying your \c CMakeLists.txt file by adding an option as in ViSP: \code @@ -84,15 +84,15 @@ The following example also available in tutorial-trace.cpp shows how to use the \note In the previous example it is important to notice that the following lines have to be put prior to any other ViSP includes: \code #define VP_DEBUG_MODE 2 // Activate debug level 1 and 2 -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> \endcode -For example, if you modify the previous example just by including <visp/vpImage.h> on the top of the file, you will get the following warnings: +For example, if you modify the previous example just by including <visp3/core/vpImage.h> on the top of the file, you will get the following warnings: \code Building CXX object tutorial/trace/CMakeFiles/tutorial-trace.dir/tutorial-trace.cpp.o .../ViSP-code/tutorial/trace/tutorial-trace.cpp:5:1: warning: "VP_DEBUG_MODE" redefined -In file included from .../ViSP-build-debug/include/visp/vpImage.h:52, +In file included from .../ViSP-build-debug/include/visp3/core/vpImage.h:52, from .../ViSP-code/tutorial/trace/tutorial-trace.cpp:2: -.../ViSP-build-debug/include/visp/vpDebug.h:67:1: warning: this is the location of the previous definition +.../ViSP-build-debug/include/visp3/core/vpDebug.h:67:1: warning: this is the location of the previous definition \endcode diff --git a/doc/tutorial-tracking-blob.doc b/doc/tutorial-tracking-blob.doc index ed63c25713ac761eb57f3024069e6de7f6b1d118..6d5dbf300e8f0909f8d9e358b31783d3840a218a 100644 --- a/doc/tutorial-tracking-blob.doc +++ b/doc/tutorial-tracking-blob.doc @@ -90,6 +90,7 @@ Here \c blob_list contains the list of the blobs that are detected in the image Finally, when a new image is available we do the tracking of all the blobs: \snippet tutorial-blob-auto-tracker.cpp Display +\section tracking_blob_next Next tutorial You are now ready to see the next \ref tutorial-tracking-keypoint. */ diff --git a/doc/tutorial-tracking-keypoint.doc b/doc/tutorial-tracking-keypoint.doc index 25d041a0800629d24f540b9073344bbf8f67e1a0..a8530b8adf3f6bb9d48fe1c6edef68ac2d50ed89 100644 --- a/doc/tutorial-tracking-keypoint.doc +++ b/doc/tutorial-tracking-keypoint.doc @@ -143,8 +143,9 @@ The example tutorial-klt-tracker-with-reinit.cpp shows how to do that. In that e In this code we do the following: - save the features that are tracked until now - initialize the tracker to detect new features -- parse all the saved features and compare them to the newly detected features. If a previous feature is close in terms of geometric distanceto a newly detected one, it is rejected (in our case less than 2 pixels). If not, it is added to the list of detected features. - +- parse all the saved features and compare them to the newly detected features. If a previous feature is close in terms of geometric distance to a newly detected one, it is rejected (in our case less than 2 pixels). If not, it is added to the list of detected features. + +\section tracking_keypoint_next Next tutorial You are now ready to see the next \ref tutorial-tracking-me. */ diff --git a/doc/tutorial-tracking-mb.doc b/doc/tutorial-tracking-mb.doc index 50d6c0df8e4df18ba0fb255f0aebb19429edd303..125db5a2af6bc670c45fc406ca74700282783696 100644 --- a/doc/tutorial-tracking-mb.doc +++ b/doc/tutorial-tracking-mb.doc @@ -1,186 +1,119 @@ /** -\page tutorial-tracking-mb Tutorial: Model-based tracking +\page tutorial-tracking-mb Tutorial: Markerless model-based tracking \tableofcontents -With ViSP it is possible to track an object using its cad model. Considered objects should be modeled by lines, circles or cylinders. The model of the object could be defined in vrml format (except for circles), or in cao format. +ViSP allows simultaneously the tracking of a markerless object using the knowledge of its CAD model while providing its 3D localization (i.e., the object pose expressed in the camera frame) when a calibrated camera is used. Considered objects should be modeled by lines, circles or cylinders. The CAD model of the object could be defined in vrml format (except for circles), or in cao format. -Next section highlights the differents versions of the markerless model-based trackers that are implemented in ViSP. +Next sections highlight how to use the differents versions of the markerless model-based trackers that are implemented in ViSP. -\section tracking_mb Markerless model-based trackers +\section mb_started Getting started -The model-based tracker can consider moving-edges behind the lines of the model (see section \ref tracking_mb_edges). It can also consider keypoints that are detected and tracked on each visible face of the model (see section \ref tracking_mb_klt). The tracker can also handle moving-edges and keypoints in an hybrid scheme (see section \ref tracking_mb_hybrid). +In ViSP, depending on the visual features that are used three trackers are available: +- a tracker implemented in vpMbEdgeTracker that consider moving-edges behind the visible lines of the model. This tracker is appropriate to track untextured objects. +- an other tracker implemented in vpMbKltTracker that consider KLT keypoints that are detected and tracked on each visible face of the model. This tracker is more designed to track textured objects with edges that are not really visible. +- an hybrid version implemented in vpMbEdgeKltTracker that is able to consider moving-edges and KLT keypoints. This tracker is appropriate to track textured objects with visible edges. -While the \ref tracking_mb_edges is appropriate to track untextured object, the \ref tracking_mb_klt is more designed to exploit textured objects with edges that are not really visible. The \ref tracking_mb_hybrid is appropriate to track textured objects with visible edges. +\subsection mb_started_src Example source code +The following example that comes from tutorial-mb-tracker.cpp allows to track a tea box modeled in cao format using one of the markerless model-based tracker implemented in ViSP. -In the following sections, we consider the tracking of a tea box modeled in cao format. +\include tutorial-mb-tracker.cpp -\subsection tracking_mb_edges Model-based edges tracker +\note An extension of the previous getting started example is proposed in tutorial-mb-tracker-full.cpp where advanced functionalities such as reading tracker settings from an XML file or visibility computation are implemented. -The following example that comes from tutorial-mb-edge-tracker.cpp allows to track the tea box using vpMbEdgeTracker class. +\note Other tutorials that are specific to a given tracker are provided in tutorial-mb-edge-tracker.cpp, tutorial-mb-klt-tracker.cpp and tutorial-mb-hybrid-tracker.cpp. -\include tutorial-mb-edge-tracker.cpp +\subsection mb_started_input Example input data -The video below shows the result of the tea box model-based edges tracking. +The previous example uses the following data as input: +- a video file; "teabox.mpg" is the default video. +- a cad model that describes the object to track. In our case the file "teabox.cao" is the default one. See \ref mb_model section to learn how the teabox is modelled and section \ref mb_advanced_cao to learn how to model an other object. +- a file with extension "*.init" that contains the 3D coordinates of some points used to compute an initial pose which serves to initialize the tracker. The user has than to click in the image on the corresponding 2D points. The default file is named "teabox.init". The content of this file is detailed in \ref mb_started_src_explained section. +- an optional image with extension "*.ppm" that may help the user to remember the location of the corresponding 3D points specified in "*.init" file. -\htmlonly -<iframe width="420" height="315" src="http://www.youtube.com/embed/b__u_yGEbmc?rel=0" frameborder="0" allowfullscreen></iframe> -\endhtmlonly - -Hereafter is the description of the new lines introduced in this example. - -\snippet tutorial-mb-edge-tracker.cpp Include - -Here we include the header of the vpMbEdgeTracker class that allows to track an object from its cad model using moving-edges. The tracker will use image \c I and the intrinsic camera parameters \c cam as input. - -\snippet tutorial-mb-edge-tracker.cpp Image - -As output, it will estimate \c cMo, the pose of the object in the camera frame. - -\snippet tutorial-mb-edge-tracker.cpp cMo - -Once the input image \c teabox.pgm is loaded in \c I, a window is created and initialized with image \c I. Then we create an instance of the tracker. -\snippet tutorial-mb-edge-tracker.cpp Constructor +\subsection mb_started_exe Running the example -There are then two different ways to initialize the tracker. - -- The first one, if libxml2 is available, is to read the settings from \c teabox.xml input file if the file exists. -\snippet tutorial-mb-edge-tracker.cpp Load xml -The content of the xml file is the following: +Once build, to see the options that are available in the previous source code, just run: \code -<?xml version="1.0"?> -<conf> - <ecm> - <mask> - <size>5</size> - <nb_mask>180</nb_mask> - </mask> - <range> - <tracking>8</tracking> - </range> - <contrast> - <edge_threshold>10000</edge_threshold> - <mu1>0.5</mu1> - <mu2>0.5</mu2> - </contrast> - </ecm> - <sample> - <step>4</step> - <nb_sample>250</nb_sample> - </sample> - <camera> - <u0>325.66776</u0> - <v0>243.69727</v0> - <px>839.21470</px> - <py>839.44555</py> - </camera> - <face> - <angle_appear>70</angle_appear> - <angle_disappear>80</angle_disappear> - <near_clipping>0.1</near_clipping> - <far_clipping>100</far_clipping> - <fov_clipping>1</fov_clipping> - </face> -</conf> +$ ./tutorial-mb-tracker --help +Usage: ./tutorial-mb-tracker [--name <video name>] [--tracker <0=egde|1=keypoint|2=hybrid>] [--help] \endcode - -- The second one consists in initializing the parameters directly in the source code: -\snippet tutorial-mb-edge-tracker.cpp Set parameters - - -An important setting concerns the visibility test that is used to determine if a face is visible. Note that moving-edges are tracked only on visible faces. Two different visibility tests are implemented; with or without Ogre ray tracing. The default test is the one without Ogre. The function vpMbEdgeTracker::setOgreVisibilityTest() allow to select which test is to use. - -Let us now highlight how the visibility test works. As illustrated in the following figure, the angle \f$ \alpha \f$ between the normal of the face and the line going from the camera to the center of gravity of the face is used to determine if the face is visible. If we consider two parameters; the angle to determine if a face is appearing \f$ \alpha_{appear} \f$, and the angle to determine if the face is disappearing \f$ \alpha_{disappear} \f$, a face will be considered as visible if \f$ \alpha \leq \alpha_{disappear} \f$. We consider also that a new face is appearing if \f$ \alpha \geq \alpha_{appear} \f$. These two parameters can be set either in the xml file: +By default, teabox.mpg video is used as input. Using "--tracker" option, you can specify which tracker has to be used: +- Using vpMbEdgeTracker to track only moving-edges: \code -<conf> - ... - <face> - <angle_appear>70</angle_appear> - <angle_disappear>80</angle_disappear> - </face> +$ ./tutorial-mb-tracker --tracker 0 \endcode -or in the code: -\snippet tutorial-mb-edge-tracker.cpp Set angles - -\note When these two angle parameters are not set, their default values set to 89 degrees are used. - -\image html img-tracker-mb-visibility.jpg Principle of the visibility test used to determine if a face is visible. - -- When Ogre visibility test is disabled (we recall that this is the default behavior), the algorithm that computes the normal of the face is very simple. It makes the assumption that faces are convex and oriented counter clockwise. Here the face is considered as appearing if \f$ \alpha < 70\f$ degrees, and disappearing if \f$ \alpha > 80\f$ degrees. When only moving-edges are used (nor keypoints) and when the object to track is simple like a single box, we suggest as here to disable Ogre visibility test. -\snippet tutorial-mb-edge-tracker.cpp Set ogre - -- When Ogre visibility test is enabled, the algorithm used to determine the visibility of a face is the same than previously except that once visible faces are detected thanks to their normal, we add an other test to reject faces that are partially occluded by an other one. This additional test is performed using Ogre ray-tracing capability. +will produce results similar to: +\htmlonly +<br> +<iframe width="420" height="315" src="http://www.youtube.com/embed/b__u_yGEbmc?rel=0" frameborder="0" allowfullscreen></iframe> +\endhtmlonly +- Using vpMbKltTracker to track only keypoints: \code - tracker.setOgreVisibilityTest(true); +$ ./tutorial-mb-tracker --tracker 1 \endcode - - -Additionally to the visibility test described above, it is also possible to use clipping. Firstly, the algorithm removes the faces that are not visibles, according to the visibility test used, then it will also remove the faces or parts of the faces that are out of the clipping planes. As illustrated in the following figure, different clipping planes can be enabled. - -\image html img-fov.png Camera field of view and clipping planes. - -Let's consider two plane categories: the ones belonging to the field of view or FOV (Left, Right, Up and Down), and the Near and Far clipping planes. The FOV planes can be enabled by: - -\snippet tutorial-mb-edge-tracker.cpp Set clipping fov - -which is equivalent to: - +will produce results similar to: +\htmlonly +<br> +<iframe width="420" height="315" src="http://www.youtube.com/embed/eZmUw9r6Idw?rel=0" frameborder="0" allowfullscreen></iframe> +\endhtmlonly +- Using vpMbEdgeKltTracker to track moving-edges and keypoints in an hybrid scheme: \code - tracker.setClipping(vpMbtPolygon::LEFT_CLIPPING - | vpMbtPolygon::RIGHT_CLIPPING - | vpMbtPolygon::UP_CLIPPING - | vpMbtPolygon::DOWN_CLIPPING); +$ ./tutorial-mb-tracker --tracker 2 \endcode +will produce results similar to: +\htmlonly +<br> +<iframe width="420" height="315" src="http://www.youtube.com/embed/a-RX9NPF2k0?rel=0" frameborder="0" allowfullscreen></iframe> +\endhtmlonly -Of course, if the user just wants to activate Right and Up clipping, he will use: - +With this example it is also possible to work on an other data set using "--name" command line option. For example, if you run: \code - tracker.setClipping(vpMbtPolygon::RIGHT_CLIPPING | vpMbtPolygon::UP_CLIPPING); +$ ./tutorial-mb-tracker --name myobject \endcode +you have to put the following data in the same folder than the binary: +- myobject.mpg: A video that contains the object to track. +- myobject.init: The coordinates of at least four 3D points used for the initialization. +- myobject.cao: The CAD model of the object to track. -For the Near and Far clipping it is quite different. Indeed, thoses planes require clipping distances. Here there are two choices, either the user uses default values and activate them with: +Since the video myobject.mpg was acquired by an other camera, you have to set the camera intrinsic parameters in the source code modifying the line: +\snippet tutorial-mb-tracker.cpp Set camera parameters -\code - tracker.setClipping(vpMbtPolygon::NEAR_CLIPPING | vpMbtPolygon::FAR_CLIPPING); -\endcode +and build again before using "--name" command line option. -or the user can specify the distances in meters, which will automatically activate the clipping for thoses planes: +\subsection mb_started_src_explained Source code explained -\snippet tutorial-mb-edge-tracker.cpp Set clipping distance +Hereafter is the description of the some lines introduced in the previous example. -It is also possible to enable them in the xml file. This is done with the following lines: +First we include the header of the hybrid tracker that includes internally vpMbEdgeTracker and vpMbKltTracker classes. +\snippet tutorial-mb-tracker.cpp Include -\code -<conf> - ... - <face> - ... - <near_clipping>0.1</near_clipping> - <far_clipping>100.0</far_clipping> - <fov_clipping>0</fov_clipping> - </face> -\endcode +The tracker uses image \c I and the intrinsic camera parameters \c cam as input. +\snippet tutorial-mb-tracker.cpp Image -Here for simplicity, the user just has the possibility to either activate all the FOV clipping planes or none of them (fov_clipping requires a boolean). +As output, it estimates \c cMo, the pose of the object in the camera frame. +\snippet tutorial-mb-tracker.cpp cMo -\note When clipping parameters are not set in the xml file, nor in the code, clipping is not used. Usually clipping is not helpful when the oject to track is simple. +Once input image \c teabox.pgm is loaded in \c I, a window is created and initialized with image \c I. Then we create an instance of the tracker depending on "--tracker" command line option. +\snippet tutorial-mb-tracker.cpp Constructor -Now we are ready to load the cad model of the object. ViSP supports cad model in cao format or in vrml format. The cao format is a particular format only supported by ViSP. It doesn't require an additional 3rd party rather then vrml format that require Coin 3rd party. We load the cad model in cao format with: -\snippet tutorial-mb-edge-tracker.cpp Load cao -The file \c teabox.cao describes first the vertices of the box, then the edges that corresponds to the faces. A more complete description of this file is provided in \ref tracking_mb_cao_face. The next figure gives the index of the vertices that are defined in \c teabox.cao. +Then the corresponding tracker settings are initialized. More details are given in \ref mb_settings section. +\snippet tutorial-mb-tracker.cpp Set parameters -To load the cad model in vrml the user has to replace the previous line by the following: -\snippet tutorial-mb-edge-tracker.cpp Load wrl -As for the cao format, \c teabox.wrl describes first the vertices of the box, then the edges that corresponds to the faces. A more complete description of this file is provided in \ref tracking_mb_vrml_face. +Now we are ready to load the cad model of the object. ViSP supports cad model in cao format or in vrml format. The cao format is a particular format only supported by ViSP. It doesn't require an additional 3rd party rather then vrml format that require Coin 3rd party. We load the cad model in cao format from teabox.cao file which complete description is provided in \ref mb_teabox_cao with: +\snippet tutorial-mb-tracker.cpp Load cao -\image html img-teabox-cao.jpg Index of the vertices used to model the tea box in cao format. +It is also possible to modify the code to load the cad model in vrml format from teabox.wrl file described in \ref mb_teabox_vrml. To this end modify the previous line with: +\code +tracker->loadModel(objectname + ".wrl"); +\endcode Once the model of the object to track is loaded, with the next line the display in the image window of additional drawings in overlay such as the moving edges positions, is then enabled by: -\snippet tutorial-mb-edge-tracker.cpp Set display +\snippet tutorial-mb-tracker.cpp Set display Now we have to initialize the tracker. With the next line we choose to use a user interaction. -\snippet tutorial-mb-edge-tracker.cpp Init +\snippet tutorial-mb-tracker.cpp Init The user has to click in the image on four vertices with their 3D coordinates defined in the "teabox.init" file. The following image shows where the user has to click. @@ -193,50 +126,117 @@ The content of \c teabox.init file that defines 3D coordinates of some points of \includelineno teabox.init We give now the signification of each line of this file: -- line 1: Number of 3D points that should be defined in this file. At least 4 points are required. Four is the minimal number of points requested to compute a pose. +- line 1: Number of 3D points that are defined in this file. At least 4 points are required. Four is the minimal number of points requested to compute a pose. - line 2: Each point is defined by its 3D coordinates. Here we define the first point with coordinates (0,0,0). In the previous figure it corresponds to vertex 0 of the tea box. This point is also the origin of the frame in which all the points are defined. - line 3: 3D coordinates of vertex 3. - line 4: 3D coordinates of vertex 2. - line 5: 3D coordinates of vertex 5. -Here the user has to click on vertex 0, 3, 2 and 5 in the window that displays image \c I. From the 3D coordinates defined in \c teabox.init and the corresponding 2D coordinates of the vertices obtained by user interaction a pose is computed that is than used to initialize the tracker. +Here the user has to click on vertex 0, 3, 2 and 5 in the window that displays image \c I. From the 3D coordinates defined in \c teabox.init and the corresponding 2D coordinates of the vertices obtained by user interaction a pose is computed that is then used to initialize the tracker. Next, in the infinite while loop, after displaying the next image, we track the object on a new image \c I. +\snippet tutorial-mb-tracker.cpp Track -\snippet tutorial-mb-edge-tracker.cpp Track +The result of the tracking is a pose \c cMo that can be obtained by: +\snippet tutorial-mb-tracker.cpp Get pose -The result of the tracking is a pose \c cMo that could be obtained by: -\snippet tutorial-mb-edge-tracker.cpp Get pose Next lines are used first to retrieve the camera parameters used by the tracker, then to display the visible part of the cad model using red lines with 2 as thickness, and finally to display the object frame at the estimated position \c cMo. Each axis of the frame are 0.025 meters long. Using vpColor::none indicates that x-axis is displayed in red, y-axis in green, while z-axis in blue. The thickness of the axis is 3. +\snippet tutorial-mb-tracker.cpp Display + +The last lines are here to free the memory allocated for the display and tracker: +\snippet tutorial-mb-tracker.cpp Cleanup + +\section mb_model Teabox CAD model -\snippet tutorial-mb-edge-tracker.cpp Display +ViSP supports two different ways to describe CAD models, either in cao or in vrml format. +- cao format is specific to ViSP. It allows to describe the CAD model of an object using a text file with extension \c .cao. +- vrml format is supported only if Coin 3rd party is installed. This format allows to describe the CAD model of an object using a text file with extension \c .wrl. -The last lines are here to free the memory allocated by libxml2 or Coin 3rd party libraries: -\snippet tutorial-mb-edge-tracker.cpp Cleanup +\subsection mb_teabox_cao teabox.cao example -\subsection tracking_mb_klt Model-based keypoint tracker +The content of the file teabox.cao used in the getting started \ref mb_started_src but also in tutorial-mb-edge-tracker.cpp and in tutorial-mb-hybrid-tracker.cpp examples is given here: + +\includelineno teabox.cao -The following example that comes from tutorial-mb-klt-tracker.cpp allows to track the tea box using vpMbKltTracker class. +This file describes the model of the tea box corresponding to the next image: -\include tutorial-mb-klt-tracker.cpp +\image html img-teabox-cao.jpg Index of the vertices used to model the tea box in cao format. -The video below shows the result of the tea box model-based KLT tracking where keypoints are used as input features. - -\htmlonly -<iframe width="420" height="315" src="http://www.youtube.com/embed/eZmUw9r6Idw?rel=0" frameborder="0" allowfullscreen></iframe> -\endhtmlonly +We make the choice to describe the faces of the box from the 3D points that correspond to the vertices. We provide now a line by line description of the file. Notice that the characters after the '#' are considered as comments. +- line 1: Header of the \c .cao file +- line 3: The model is defined by 8 3D points. Here the 8 points correspond to the 8 vertices of the tea box presented in the previous figure. Thus, next 8 lines define the 3D points coordinates. +- line 4: 3D point with coordinate (0,0,0) corresponding to vertex 0 of the tea box. This point is also the origin of the frame in which all the 3D points are defined. +- line 5: 3D point with coordinate (0,0,-0.08) corresponding to vertex 1. +- line 6 to 11: The other 3D points corresponding to vertices 2 to 7 respectively. +- line 13: Number of 3D lines defined from two 3D points. It is possible to introduce 3D lines and then use these lines to define faces from these 3D lines. This is particularly useful to define faces from non-closed polygons. For instance, it can be used to specify the tracking of only 3 edges of a rectangle. Notice also that a 3D line that doesn't belong to a face is always visible and consequently always tracked. +- line 15: Number of faces defined from 3D lines. In our teabox example we decide to define all the faces from 3D points, that is why this value is set to 0. +- line 17: The number of faces defined by a set of 3D points. Here our teabox has 6 faces. Thus, next 6 lines describe each face from the 3D points defined previously line 4 to 11. Notice here that all the faces defined from 3D points corresponds to closed polygons. +- line 18: First face defined by 4 3D points, respectively vertices 0,1,2,3. The orientation of the face is counter clockwise by going from vertex 0 to vertex 1, then 2 and 3. This fixes the orientation of the normal of the face going outside the object. +- line 19: Second face also defined by 4 points, respectively vertices 1,6,5,2 to have a counter clockwise orientation. +- line 20 to 23: The four other faces of the box. +- line 25: Number of 3D cylinders describing the model. Since we model a simple box, the number of cylinders is 0. +- line 27: Number of 3D circles describing the model. For the same reason, the number of circles is 0. + +\subsection mb_teabox_cao_triangle teabox-triangle.cao example + +The content of the file teabox-triangle.cao used in the tutorial-mb-klt-tracker.cpp example is given here: + +\includelineno teabox-triangle.cao + +This file describes the model of the tea box corresponding to the next image: + +\image html img-teabox-cao-triangle.jpg Index of the vertices used to model the tea box in cao format with triangles. + +Until line 15, the content of this file is similar to the one described in +\ref mb_teabox_cao. Line 17 we specify that the model contains 12 faces. Each face is then described as a triangle. + +\note Since some lines of the model (for example the one between points 0 and 2, or 7 and 3...) don't correspond to teabox edges, this CAD model is not suited for moving-edges and hybrid trackers. + +\subsection mb_teabox_vrml teabox.wrl example + +The content of the teabox.wrl file used in tutorial-mb-tracker-full.cpp and tutorial-mb-edge-tracker.cpp when teabox.cao is missing is given hereafter. This content is to make into relation with teabox.cao described in \ref mb_teabox_cao. As for the cao format, teabox.wrl describes first the vertices of the box, then the edges that corresponds to the faces. + +\includelineno teabox.wrl + +This file describes the model of the tea box corresponding to the next image: + +\image html img-teabox-cao.jpg Index of the vertices used to model the tea box in vrml format. + +We provide now a line by line description of the file where the faces of the box are defined from the vertices: +- line 1 to 10: Header of the \c .wrl file. +- line 13 to 20: 3D coordinates of the 8 tea box vertices. +- line 34 to 29: Each line describe a face. In this example, a face is defined by 4 vertices. For example, the first face join vertices 0,1,2,3. The orientation of the face is counter clockwise by going from vertex 0 to vertex 1, then 2 and 3. This fixes the orientation of the normal of the face going outside the object. + + +\section mb_settings Tracker settings -This example is very similar to the one presented in \ref tracking_mb_edges except that here we use vpMbKltTracker class to track the tea box. +\subsection mb_settings_xml Settings from an XML file -As previously, there are two different ways to initialize the tracker. -- The first one, if libxml2 is available, consists in reading the settings from an xml file. -\snippet tutorial-mb-klt-tracker.cpp Load xml -The \c teabox.xml file used here contains the following: +Instead of setting the tracker parameters from source code, if libxml2 is available it is possible to specify the settings from an XML file. As done in tutorial-mb-tracker-full.cpp example, to read the parameters from an XML file, simply modify the code like: +\snippet tutorial-mb-tracker-full.cpp Load xml +The content of the XML file teabox.xml that is considered by default is the following: \code <?xml version="1.0"?> <conf> + <ecm> + <mask> + <size>5</size> + <nb_mask>180</nb_mask> + </mask> + <range> + <tracking>8</tracking> + </range> + <contrast> + <edge_threshold>10000</edge_threshold> + <mu1>0.5</mu1> + <mu2>0.5</mu2> + </contrast> + <sample> + <step>4</step> + </sample> + </ecm> <klt> <mask_border>5</mask_border> <max_features>300</max_features> @@ -262,34 +262,19 @@ The \c teabox.xml file used here contains the following: </face> </conf> \endcode -- The second one consists in initializing the parameters directly in the source code: -\snippet tutorial-mb-klt-tracker.cpp Set parameters - -Note also that in this example we can model the tea box with triangles: -\code - tracker.loadModel("teabox-triangle.cao"); -\endcode -The file \c teabox-triangle.cao describes first the vertices of the box, then the triangular faces. A more complete description of this file is provided in \ref tracking_mb_cao_triangle). - -Note that this is the only tracker for which lines of the model are not necessary edges of the object. - -\subsection tracking_mb_hybrid Model-based hybrid tracker - -The following example that comes from tutorial-mb-hybrid-tracker.cpp allows to track the tea box using vpMbEdgeKltTracker class. -\include tutorial-mb-hybrid-tracker.cpp +Depending on the tracker all the XML tags are not useful: +- \<ecm\> tag corresponds to the moving-edges settings. This tag is used by vpMbEdgeTracker and vpMbEdgeKltTracker. +- \<klt\> tag corresponds to the keypoint settings. This tag is used by vpMbKltTracker and vpMbEdgeKltTracker. +- \<camera\> and \<face\> tags are used by all the trackers. -The video below shows the result of the tea box model-based hybrid tracking where moving-edges and keypoints are used as input features. +\subsection mb_settings_ecm Moving-edges settings +Moving-edges settings affect the way the visible edges of an object are tracked. +These settings could be tuned either from XML using \<ecm\> tag as: -\htmlonly -<iframe width="420" height="315" src="http://www.youtube.com/embed/a-RX9NPF2k0?rel=0" frameborder="0" allowfullscreen></iframe> -\endhtmlonly - -The source code is very similar to the one described in \ref tracking_mb_edges and \ref tracking_mb_klt. It doesn't require additional line by line explanation. -We provide just hereafter the content of the \c teabox.xml file: \code -<?xml version="1.0"?> <conf> + ... <ecm> <mask> <size>5</size> @@ -303,11 +288,36 @@ We provide just hereafter the content of the \c teabox.xml file: <mu1>0.5</mu1> <mu2>0.5</mu2> </contrast> + <sample> + <step>4</step> + </sample> </ecm> - <sample> - <step>4</step> - <nb_sample>250</nb_sample> - </sample> + ... +</conf> +\endcode + +of from source code using vpMbEdgeTracker::setMovingEdge() method: +\snippet tutorial-mb-tracker-full.cpp Set moving-edges parameters + +With the previous parameters you can set: +- mask_size: defines the size of the convolution mask used to detect an edge. +- nb_mask: number of mask applied to determine the object contour. The number of mask determines the precision of the normal of the edge for every sample. If precision is 2deg, then there are 360/2 = 180 masks. +- range_tracking: range on both sides of the reference pixel along the normal of the contour used to track a moving-edge. If the displacement of the tracked object in two successive images is large, you have to increase this parameter. +- edge_threshold: likelihood threshold used to determined if the moving edge is valid or not. +- mu1: minimum image contrast allowed to detect a contour. +- mu2: maximum image contrast allowed to detect a contour. +- sample_step: minimum distance in pixel between two discretized moving-edges. To increase the number of moving-edges you have to reduce this parameter. + +\note Most important parameters are \e range_tracking and \e sample_step. + + +\subsection mb_settings_klt Keypoints settings +Keypoint settings affect tracking of keypoints on visible faces using KLT. +These settings could be tuned either from XML using \<klt\> tag as: + +\code +<conf> + ... <klt> <mask_border>5</mask_border> <max_features>300</max_features> @@ -318,83 +328,163 @@ We provide just hereafter the content of the \c teabox.xml file: <size_block>3</size_block> <pyramid_lvl>3</pyramid_lvl> </klt> + ... +</conf> +\endcode + +of from source code using vpMbKltTracker::setKltOpencv() and vpMbKltTracker::setMaskBorder() methods: +\snippet tutorial-mb-tracker-full.cpp Set klt parameters + +With the previous parameters you can set: +- mask_border: erosion number of the mask used on each face. +- max_features: maximum number of keypoint features to track in the image. +- window_size: window size used to refine the corner locations. +- quality: parameter characterizing the minimal accepted quality of image corners. Corners with quality measure less than this parameter are rejected. This means that if you want to have more keypoints on a face, you have to reduce this parameter. +- min_distance: minimal Euclidean distance between detected corners during keypoint detection stage used to initialize keypoint location. +- harris: free parameter of the Harris detector. +- size_block: size of the averaging block used to track the keypoint features. +- pyramid_lvl: maximal pyramid level. If the level is zero, then no pyramid is computed for the optical flow. + +\note Most important parameters are \e min_distance and \e quality. + +\subsection mb_settings_cam Camera settings +Camera settings correspond to the intrinsic camera parameters without distorsion. If images are acquired by a camera that has a large field of view that introduce distorsion, images need to be undistorded before processed by the tracker. The camera parameters are then the one obtained on undistorded images. + +Camera settings could be set from XML using \<camera\> tag as: +\code +<conf> + ... <camera> <u0>325.66776</u0> <v0>243.69727</v0> <px>839.21470</px> <py>839.44555</py> </camera> + ... +</conf> +\endcode +of from source code using vpMbTracker::setCameraParameters() method: +\snippet tutorial-mb-tracker-full.cpp Set camera parameters + +As described in vpCameraParameters class, these parameters correspond to \f$(p_x, p_y)\f$ the ratio between the focal length and the size of a pixel, and \f$(u_0, v_0)\f$ the coordinates of the principal point in pixel. + +\note The \ref tutorial-calibration explains how to obtain these parameters from a camera calibration stage. + +\subsection mb_settings_visibility Visibility settings + +An important setting concerns the visibility test that is used to determine if a face is visible or not. Note that moving-edges and keypoints are only tracked on visible faces. Three different visibility tests are implemented; with or without Ogre ray tracing and with or without scanline rendering. The default test is the one without Ogre and scanline. The functions vpMbTracker::setOgreVisibilityTest() and vpMbTracker::setScanLineVisibilityTest() allow to select which test to use. + +\subsubsection mb_settings_visibility_default Default visibility based on normals +Let us now highlight how the default visibility test works. As illustrated in the following figure, the angle \f$ \alpha \f$ between the normal of the face and the line going from the camera to the center of gravity of the face is used to determine if the face is visible. + +\image html img-tracker-mb-visibility.jpg Principle of the visibility test used to determine if a face is visible. + +When no advanced visibility test is enable (we recall that this is the default behavior), the algorithm that computes the normal of the face is very simple. It makes the assumption that faces are convex and oriented counter clockwise. If we consider two parameters; the angle to determine if a face is appearing \f$ \alpha_{appear} \f$, and the angle to determine if the face is disappearing \f$ \alpha_{disappear} \f$, a face will be considered as visible if \f$ \alpha \leq \alpha_{disappear} \f$. We consider also that a new face is appearing if \f$ \alpha \leq \alpha_{appear} \f$. These two parameters can be set either in the XML file: +\code +<conf> + ... <face> <angle_appear>70</angle_appear> <angle_disappear>80</angle_disappear> - <near_clipping>0.1</near_clipping> - <far_clipping>100</far_clipping> - <fov_clipping>1</fov_clipping> </face> -</conf> \endcode +or in the code: +\snippet tutorial-mb-tracker-full.cpp Set angles -\section tracking_model How to model the objects to track +Here the face is considered as appearing if \f$ \alpha \leq 70\f$ degrees, and disappearing if \f$ \alpha > 80\f$ degrees. -ViSP supports two different ways to describe CAD models, either in cao or in vrml format. -- cao format is specific to ViSP. It allows to describe the CAD model of an object using a text file with extension \c .cao. -- vrml format is supported only if Coin 3rd party is installed. This format allows to describe the CAD model of an object using a text file with extension \c .wrl. +\note When these two angle parameters are not set, their default values set to 89 degrees are used. +\subsubsection mb_settings_visibility_ogre Advanced visibility via Ogre3D -\subsection tracking_mb_cao_face teabox.cao example +The Ogre3D visibility test approach is based on ray tracing. When this test is enabled, the algorithm used to determine the visibility of a face performs (<b>in addition to the previous test based on normals, i.e on the visible faces resulting from the previous test</b>) another test which sets the faces that are <b>partially occluded as non-visible</b>. It can be enabled via: +\code + tracker->setOgreVisibilityTest(true); +\endcode +\image html img-tracker-mb-visibility-ogre.png "Ogre visibility test on both polygons." -The content of the file teabox.cao used in the \ref tracking_mb_edges and \ref tracking_mb_hybrid examples is given here: +When using the <b>classical version of the ogre visibility test</b> (which is the default behavior when activating this test), <b>only one ray</b> is used per polygon to test its visibility. As shown on the figure above, this only ray is sent from the camera to the center of gravity of the considered polygon. If the ray intersects another polygon before the considered one, it is set as non-visible. Intersections are computed <b>between the ray and the axis-aligned bounding-box (AABB)</b> of each polygon. In the figure above, the ray associated to the first polygon intersects first the AABB of the second polygon so it is considered as occluded. As a result, only the second polygon will be used during the tracking phase. This means that when using the edges, only the blue lines will be taken into account, and when using the keypoints, they will be detected only inside the second polygon (blue area). -\includelineno teabox.cao +Additionnaly, it is also possible to use a statistical approach during the ray tracing phase in order to improve the visibility results. +\code + tracker->setNbRayCastingAttemptsForVisibility(4); + tracker->setGoodNbRayCastingAttemptsRatio(0.70); +\endcode +\image html img-tracker-mb-visibility-ogre-advanced.png "Ogre visibility test on the first polygon, using a statistical approach." -This file describes the model of the tea box corresponding to the next image: +Contrary to the classical version of this test, the <b>statistical approach uses multiple rays per polygons</b> (4 in the example above). Each ray is sent randomly toward the considered polygon. If a specified ratio of rays do not have intersected another polygon before the considered one, the polygon is set as visible. In the example above, three ray on four return the first polygon as visible. As the ratio of good matches is more than 70% (which corresponds to the chosen ratio in this example) the first polygon is considered as visible, as well as the second one. As a result, all visible blue lines will be taken into account during the tracking phase of the edges and the keypoints that are detected inside the green area will be also used. Unfortunately, this approach is a <b>polygon based approach</b> so the dashed blue lines, that are not visible, will also be used during the tracking phase. Plus, keypoints that are detected inside the overlapping area won't be well associated and can disturb the algorithm. -\image html img-teabox-cao.jpg Index of the vertices used to model the tea box in cao format. +\note Since ViSP 3.0.0 we have introduced vpMbTracker::setOgreShowConfigDialog() method that allows to open the Ogre configuration pannel which can be used to select the renderer. To enable this feature, use: -We make the choice to describe the faces of the box from the 3D points that correspond to the vertices. We provide now a line by line description of the file. Notice that the characters after the '#' are considered as comments. -- line 1: Header of the \c .cao file -- line 3: The model is defined by 8 3D points. Here the 8 points correspond to the 8 vertices of the tea box presented in the previous figure. Thus, next 8 lines define the 3D points coordinates. -- line 4: 3D point with coordinate (0,0,0) corresponding to vertex 0 of the tea box. This point is also the origin of the frame in which all the 3D points are defined. -- line 5: 3D point with coordinate (0,0,-0.08) corresponding to vertex 1. -- line 6 to 11: The other 3D points corresponding to vertices 2 to 7 respectively. -- line 13: Number of 3D lines defined from two 3D points. It is possible to introduce 3D lines and then use these lines to define faces from these 3D lines. This is particularly useful to define faces from non-closed polygons. For instance, it can be used to specify the tracking of only 3 edges of a rectangle. Notice also that a 3D line that doesn't belong to a face is always visible and consequently always tracked. -- line 15: Number of faces defined from 3D lines. In our teabox example we decide to define all the faces from 3D points, that is why this value is set to 0. -- line 17: The number of faces defined by a set of 3D points. Here our teabox has 6 faces. Thus, next 6 lines describe each face from the 3D points defined previously line 4 to 11. Notice here that all the faces defined from 3D points corresponds to closed polygons. -- line 18: First face defined by 4 3D points, respectively vertices 0,1,2,3. The orientation of the face is counter clockwise by going from vertex 0 to vertex 1, then 2 and 3. This fixes the orientation of the normal of the face going outside the object. -- line 19: Second face also defined by 4 points, respectively vertices 1,6,5,2 to have a counter clockwise orientation. -- line 20 to 23: The four other faces of the box. -- line 25: Number of 3D cylinders describing the model. Since we model a simple box, the number of cylinders is 0. -- line 27: Number of 3D circles describing the model. For the same reason, the number of circles is 0. +\code + tracker->setOgreShowConfigDialog(true); +\endcode -\subsection tracking_mb_cao_triangle teabox-triangle.cao example +\subsubsection mb_settings_visibility_scanline Advanced visibility via Scanline Rendering -The content of the file teabox-triangle.cao used in the \ref tracking_mb_klt example is given here: +Contrary to the visibility test using Ogre3D, this method <b>does not require any additional third-party library</b>. As for the advanced visibility using Ogre3D, <b>this test is applied in addition to the test based on normals (i.e on the faces set as visible during this test) and also in addition to the test with Ogre3D if it has been activated</b>. This test is based on the scanline rendering algorithm and can be enabled via: +\code + tracker->setScanLineVisibilityTest(true); +\endcode +\image html img-tracker-mb-visibility-scanline.png "Scanline visibility test on both polygons." -\includelineno teabox-triangle.cao +Even if this approach requires a bit <b>more computing power</b>, it is a <b>pixel perfect visibility test</b>. According to the camera point of view, polygons will be <b>decomposed in order to consider only their visible parts</b>. As a result, if we consider the example above, dashed red lines won't be considered during the tracking phase and detected keypoints will be correctly matched with the closest (in term of depth from the camera position) polygon. -This file describes the model of the tea box corresponding to the next image: +\subsection mb_settings_clipping Clipping settings -\image html img-teabox-cao-triangle.jpg Index of the vertices used to model the tea box in cao format with triangles. +Additionally to the visibility test described above, it is also possible to use clipping. Firstly, the algorithm removes the faces that are not visibles, according to the visibility test used, then it will also remove the faces or parts of the faces that are out of the clipping planes. As illustrated in the following figure, different clipping planes can be enabled. -Until line 15, the content of this file is similar to the one described in -\ref tracking_mb_cao_face. Line 17 we specify that the model contains 12 faces. Each face is then described as a triangle. +\image html img-fov.png Camera field of view and clipping planes. -\subsection tracking_mb_vrml_face teabox.wrl example +Let us consider two plane categories: the ones belonging to the field of view or FOV (Left, Right, Up and Down), and the Near and Far clipping planes. The FOV planes can be enabled by: -The content of the teabox.wrl file used in the \ref tracking_mb_edges is given hereafter. This content is to make into relation with teabox.cao described in \ref tracking_mb_cao_face. +\snippet tutorial-mb-tracker-full.cpp Set clipping fov -\includelineno teabox.wrl +which is equivalent to: -This file describes the model of the tea box corresponding to the next image: +\code + tracker->setClipping(vpMbtPolygon::LEFT_CLIPPING + | vpMbtPolygon::RIGHT_CLIPPING + | vpMbtPolygon::UP_CLIPPING + | vpMbtPolygon::DOWN_CLIPPING); +\endcode -\image html img-teabox-cao.jpg Index of the vertices used to model the tea box in vrml format. +Of course, if the user just wants to activate Right and Up clipping, he will use: + +\code + tracker->setClipping(vpMbtPolygon::RIGHT_CLIPPING | vpMbtPolygon::UP_CLIPPING); +\endcode + +For the Near and Far clipping it is quite different. Indeed, those planes require clipping distances. Here there are two choices, either the user uses default values and activate them with: + +\code + tracker->setClipping(vpMbtPolygon::NEAR_CLIPPING | vpMbtPolygon::FAR_CLIPPING); +\endcode + +or the user can specify the distances in meters, which will automatically activate the clipping for those planes: + +\snippet tutorial-mb-tracker-full.cpp Set clipping distance + +It is also possible to enable them in the XML file. This is done with the following lines: + +\code +<conf> + ... + <face> + ... + <near_clipping>0.1</near_clipping> + <far_clipping>100.0</far_clipping> + <fov_clipping>0</fov_clipping> + </face> +\endcode + +Here for simplicity, the user just has the possibility to either activate all the FOV clipping planes or none of them (fov_clipping requires a boolean). + +\note When clipping parameters are not set in the XML file, nor in the code, clipping is not used. Usually clipping is not helpful when the oject to track is simple. -We provide now a line by line description of the file where the faces of the box are defined from the vertices: -- line 1 to 10: Header of the \c .wrl file. -- line 13 to 20: 3D coordinates of the 8 tea box vertices. -- line 34 to 29: Each line describe a face. In this example, a face is defined by 4 vertices. For example, the first face join vertices 0,1,2,3. The orientation of the face is counter clockwise by going from vertex 0 to vertex 1, then 2 and 3. This fixes the orientation of the normal of the face going outside the object. -\section advanced_model_sec Advanced: How to manipulate the model +\section mb_advanced Advanced +\subsection mb_advanced_model How to manipulate the model The following code shows how to access to the CAD model - to check if a face is visible, @@ -428,7 +518,7 @@ The following code shows how to access to the CAD model \endcode -\section advanced_lod_sec Advanced: Level of detail (LOD) +\subsection mb_advanced_lod Level of detail (LOD) The level of detail (LOD) consists in introducing additional constraints to the visibility check to determine if the features of a face have to be tracked or not. Two parameters are used - the line length (in pixel) @@ -451,12 +541,12 @@ tracker.setMinLineLengthThresh(35.0, "Left line"); tracker.setMinPolygonAreaThresh(120.0, "Front face"); \endcode -Furthermore, to set a name to a face see \ref advanced_cao_nam_sec. +Furthermore, to set a name to a face see \ref mb_advanced_cao_nam. -\section advanced_cao_sec Advanced: CAD model in cao format +\subsection mb_advanced_cao CAD model in cao format -\subsection advanced_cao_lin_sec How to model faces from lines +\subsubsection mb_advanced_cao_lin How to model faces from lines The first thing to do is to declare the differents points. Then you define each segment of the face with the index of the start point and with the index of the end point. Finally, you define the face with the index of the segments which constitute the face. @@ -493,7 +583,7 @@ V1 \endcode -\subsection advanced_cao_cyl_sec How to model cylinders +\subsubsection mb_advanced_cao_cyl How to model cylinders The first thing to do is to declare the two points defining the cylinder axis of revolution. Then you declare the cylinder with the index of the points that define the cylinder axis of revolution and with the cylinder radius. \note For the level of detail, in a case of a cylinder, this is taking into account by using the length of the axis of revolution to determine the visibility. @@ -521,7 +611,7 @@ V1 \endcode -\subsection advanced_cao_cir_sec How to model circles +\subsubsection mb_advanced_cao_cir How to model circles The first thing to do is to declare three points: one point for the center of the circle and two points on the circle plane (i.e. not necessary located on the perimeter of the circle but on the plane of the circle). Then you declare your circle with the radius and with index of the three points. \note The way you declare the two points on the circle plane (clockwise or counter clockwise) will determine the direction of the normal of the circle and so will influe on the visibility of the circle. @@ -551,9 +641,9 @@ V1 \endcode -\subsection advanced_cao_hie_sec How to create an hierarchical model +\subsubsection mb_advanced_cao_hie How to create a hierarchical model It could be useful to define a complex model instead of using one big model file with all the declaration with different sub-models, each one representing a specific part of the complex model in a specific model file. -To create an hierarchical model, the first step is to define all the elementary parts and then regroup them. +To create a hierarchical model, the first step is to define all the elementary parts and then regroup them. \image html img-plane-hierarchical-diagram.jpg Example of a possible hierarchical modelling of a plane. @@ -586,10 +676,10 @@ load("tailplane.cao") \note The path to include another model can be expressed as an absolute or a relative path (relative to the file which includes the model). -\subsection advanced_cao_nam_sec How to set a name to a face -To exploit the name of a face in the code, see \ref advanced_lod_sec. +\subsubsection mb_advanced_cao_nam How to set a name to a face +To exploit the name of a face in the code, see sections about \ref mb_advanced_lod and \ref mb_advanced_exclude. -It could be useful to give a name for a face in a model in order to easily modify his LOD parameters for example, or just for debuging purpose. +It could be useful to give a name for a face in a model in order to easily modify his LOD parameters for example, or to decide if you want to use this face or not during the tracking phase. This is done directly in the model file : \code V1 @@ -622,9 +712,9 @@ load("tailplane.cao") You can give a name to all the elements excepts for points. -\subsection advanced_cao_lod_sec How to tune the level of detail +\subsubsection mb_advanced_cao_lod How to tune the level of detail -As explained in section \ref advanced_lod_sec the parameters of the lod can be set in the source code. They can also be set directly in the configuration file or in the CAD model in cao format. +As explained in section \ref mb_advanced_lod the parameters of the lod can be set in the source code. They can also be set directly in the configuration file or in the CAD model in cao format. The following lines show the content of the configuration file : @@ -672,7 +762,106 @@ load("tailplane.cao") Basically, the LOD settings expressed in configuration file will have effect on all the elements in the CAD model while the LOD settings expressed in CAD model will be specific to an element. The natural order would be to load first the configuration file and after the CAD model. +\subsection mb_advanced_wrml CAD model in wrml format +\subsubsection mb_advanced_wrml_nam How to set a name to a face + +To exploit the name of a face in the code, see sections about \ref mb_advanced_lod and \ref mb_advanced_exclude. + +When using a wrml file, names are associated with shapes. In the example below (the model of a teabox), as only one shape is defined, all its faces will have the same name: "teabox_name". + +\note If you want to set different names for different faces, you have to define them in different shapes. + +\code +#VRML V2.0 utf8 + +DEF fst_0 Group { +children [ + +# Object "teabox" + +DEF teabox_name Shape { + +geometry DEF cube IndexedFaceSet { + +coord Coordinate { +point [ +0 0 0 , +0 0 -0.08, +0.165 0 -0.08, +0.165 0 0 , +0.165 0.068 0 , +0.165 0.068 -0.08, +0 0.068 -0.08, +0 0.068 0 ] +} + +coordIndex [ + 0,1,2,3,-1, + 1,6,5,2,-1, + 4,5,6,7,-1, + 0,3,4,7,-1, + 5,4,3,2,-1, + 0,7,6,1,-1]} +} + +] +} +\endcode + +\subsection mb_advanced_exclude How not to consider specific polygons + +When using model-based trackers, it is possible not to consider edge tracking or keypoint tracking for specific faces. To do so, <b>the faces you want to consider must have a name</b>. + +If you want to enable (default behavior) or disable the edge tracking on specific face it can be done via: + +\code +vpMbEdgeTracker::setUseEdgeTracking("name of the face", boolean); +\endcode + +If the boolean is set to False, the tracking of the edges of the faces that have the given name will be disable. If it is set to True (default behavior), it will be enable. + +As for the edge tracking, the same functionnality is also available when using keypoints via: + +\code +vpMbKltTracker::setUseKltTracking("name of the face", boolean); +\endcode + +\section mb_known_issues Known issues +\subsection mb_known_issues_example_with_ogre Model-based trackers examples are not working with Ogre visibility ckeck + +If you run mbtEdgeTracking.cpp, mbtKltTracking.cpp or mbtEdgeKltTracking.cpp examples enabling Ogre visibility check (using "-o" option), you may encounter the following issue that was obtained following \ref tutorial-install-win81-msvc : +\code +C:\ViSP\ViSP-3.0.0-build\example\Tracking\Debug> mbtEdgeTracking.exe -c -o +... +OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource VTFInstancing.cg in resource group General +... +*** Initializing OIS *** +\endcode +and then a wonderful runtime issue as in the next image: +\image html img-win8.1-msvc-mbtracker-ogre-issue.jpg + +It means maybe that Ogre version is not compatible with DirectX 11. This can be checked adding "-w" option to the command line: +\code +C:\ViSP\ViSP-3.0.0-build\example\Tracking\Debug> mbtEdgeTracking.exe -c -o -w +\endcode +Now the binary should open the Ogre configuration window where you have to select "OpenGL Rendering Subsystem" instead of "Direct3D11 Rendering Subsystem". Press then OK to continue and start the tracking of the cube. +\image html img-win8.1-msvc-mbtracker-ogre-opengl.jpg + +\subsection mb_known_issues_tutorial_with_ogre Model-based trackers tutorials are not working with Ogre visibility ckeck + +This issue is similar to \ref mb_known_issues_example_with_ogre. It may occur with tutorial-mb-edge-tracker.cpp, tutorial-mb-klt-tracker.cpp and tutorial-mb-hybrid-tracker.cpp. To make working the tutorials: + +- modify the code like: +\code + tracker.setOgreVisibilityTest(true); + tracker.setOgreShowConfigDialog(true); +\endcode +- build the modified tutorial +- run the binary. Now the binary should open the Ogre configuration window where you have to select an Ogre renderer that is working on your computer. +\image html img-win8.1-msvc-mbtracker-ogre-opengl.jpg +- Press then OK to continue and start the tracking of the object. +\subsection mb_next Next tutorial You are now ready to see the next \ref tutorial-tracking-tt. diff --git a/doc/tutorial-tracking-me.doc b/doc/tutorial-tracking-me.doc index 33c35d0394e262554a71db0752843cc68cbc0c68..89de133d215eaaa34d3884d4174f8b9135596ead 100644 --- a/doc/tutorial-tracking-me.doc +++ b/doc/tutorial-tracking-me.doc @@ -20,16 +20,16 @@ Here after we explain line by line the program. Images that are processed could be acquired from a firewire camera on Unix or Windows, of from an usb camera under Unix. That is allowed by including the grabber headers. \code -#include <visp/vp1394CMUGrabber.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpV4l2Grabber.h> +#include <visp3/sensor/vp1394CMUGrabber.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/sensor/vpV4l2Grabber.h> \endcode To display these images we then include the headers of the viewers. \code -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayX.h> +#include <visp3/core/vpDisplayGDI.h> +#include <visp3/core/vpDisplayX.h> \endcode The Graphical Display Interface (GDI) allows to display images under Windows, while X11 allows this feature under unix-like systems. @@ -37,13 +37,13 @@ The Graphical Display Interface (GDI) allows to display images under Windows, wh Finally, to track a line with the moving edges, we include the header of the vpMeLine class. \code -#include <visp/vpMeLine.h> +#include <visp3/core/vpMeLine.h> \endcode In the main() function, The source code is build only if one of the grabbers and one of the viewers is available. \code -#if (defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_CMU1394) || defined(VISP_HAVE_V4L2)) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) +#if (defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) || defined(VISP_HAVE_V4L2)) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) \endcode Here we create a gray level image container \c I that will contain the images acquired by our camera. @@ -55,7 +55,7 @@ vpImage<unsigned char> I; Then, we create a grabber instance, first for a firewire camera under Unix if libdc1394 3rd party is installed, secondly for a firewire camera under Windows if CMU1394 3rd party is installed, and lastly for an usb camera under Unix if none of the previous 3rd party are installed, and if libv4l is installed. The \ref tutorial-grabber gives more details concerning the framegrabbing. \code -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vp1394TwoGrabber g(false); #elif defined(VISP_HAVE_CMU1394) vp1394CMUGrabber g; @@ -137,6 +137,7 @@ This example is very similar to the one presented in \ref tracking_me_line. It d Note here that the user has to initialize the tracker on image \c I by clicking on five points located on the ellipse to track. +\section tracking_me_next Next tutorial You are now ready to see the next \ref tutorial-tracking-mb. */ diff --git a/doc/tutorial.doc b/doc/tutorial.doc new file mode 100644 index 0000000000000000000000000000000000000000..dd28425ca36cc7abdd0b61d277ef3568144fb907 --- /dev/null +++ b/doc/tutorial.doc @@ -0,0 +1,129 @@ +/*! \page tutorial_mainpage Tutorials +This page references all the tutorials. + +- \subpage tutorial_install_pkg + +- \subpage tutorial_install_src + +- \subpage tutorial_started + +- \subpage tutorial_image + +- \subpage tutorial_calib + +- \subpage tutorial_tracking + +- \subpage tutorial_detection + +- \subpage tutorial_computer_vision + +- \subpage tutorial_vs + +- \subpage tutorial_bridge + +- \subpage tutorial_tools + +*/ + +/*! \page tutorial_install_pkg Installation from packages +This page introduces the user to the way to install ViSP from existing prebuild packages. + +- \subpage tutorial-install-ubuntu-package <br>In this first tutorial you will learn how to install ViSP prebuilt library from Ubuntu packages. + +*/ + +/*! \page tutorial_install_src Installation from source code +This page introduces the user to the way to install ViSP from source code. + +- \subpage tutorial-install-ubuntu <br>In this tutorial you will learn how to install ViSP from source on Linux Ubuntu. +- \subpage tutorial-install-fedora <br>In this other tutorial you will learn how to install ViSP from source on Linux Fedora. +- \subpage tutorial-install-centos <br>In this other tutorial you will learn how to install ViSP from source on Linux CentOS. +- \subpage tutorial-install-opensuse <br>In this other tutorial you will learn how to install ViSP from source on Linux openSUSE. +- \subpage tutorial-install-raspberry <br>In this tutorial you will learn how to install ViSP from source on Raspberry Pi. +- \subpage tutorial-install-win7 <br>In this tutorial you will learn how to install ViSP from source on Windows 7 with Visual C++ 2012. +- \subpage tutorial-install-win81-msvc <br>In this tutorial you will learn how to install ViSP from source on Windows 8.1 with Visual C++ 2013. +- \subpage tutorial-install-win10-msvc14 <br>In this tutorial you will learn how to install ViSP from source on Windows 10 with Visual C++ 2015. +- \subpage tutorial-install-win81-mingw64 <br>In this tutorial you will learn how to install ViSP from source on Windows 8.1 with Mingw-w64. +- \subpage tutorial-install-osx-homebrew <br>In this tutorial you will learn how to install ViSP from source on OSX with Homebrew. +- \subpage tutorial-install-iOS <br>In this tutorial you will learn how to install ViSP from source on OSX for iOS project. + +*/ + +/*! \page tutorial_started Getting started +This page introduces the user to the way to start with ViSP. + +- \subpage tutorial-getting-started <br>This tutorial shows how to build a project that uses ViSP to read and display an image. +- \subpage tutorial-getting-started-iOS <br>This tutorial shows how to build a project that uses ViSP on iOS devices. + +*/ + +/*! \page tutorial_image Image manipulation +This page introduces the user to the way to get, to filter or to render images. + +- \subpage tutorial-grabber <br>This tutorial shows how to acquire images from a camera. +- \subpage tutorial-image-filtering <br>This tutorial shows how to filter an image with ViSP. +- \subpage tutorial-simu-image <br>This tutorial shows how to project the image of a planar scene to a given camera position. + +*/ + +/*! \page tutorial_calib Camera calibration +This page introduces the user to the way to calibrate a camera. + +- \subpage tutorial-calibration <br>This tutorial explains how to calibrate a camera. + +*/ + +/*! \page tutorial_tracking Tracking +This page introduces the user to the way to track objects in images. + +- \subpage tutorial-tracking-blob <br>This tutorial introduces blob tracking and detection. +- \subpage tutorial-tracking-keypoint <br>This tutorial focuses on keypoint tracking using Kanade-Lucas-Tomasi feature tracker. +- \subpage tutorial-tracking-me <br>This tutorial focuses on line and ellipse tracking using moving-edges. +- \subpage tutorial-tracking-mb <br>This tutorial focuses on model-based trackers using either edges, keypoints or and hybrid scheme that uses edges and keypoints. +- \subpage tutorial-tracking-tt <br>This tutorial focuses on template trackers based on image registration approaches. + +*/ + +/*! \page tutorial_detection Detection +This page introduces the user to the way to detect features or objects in images. + +- \subpage tutorial-matching <br>This tutorial shows how to detect and match keypoints. New since ViSP 2.10.0. +- \subpage tutorial-matching-deprecated <br>This tutorial shows how to detect and match SURF keypoints. It will be deprecated if you use an OpenCV version equal to 2.8.0 or a more recent version. +- \subpage tutorial-detection-barcode <br>This tutorial focuses on bar code (QR code, Data Matrix code) detection. New since ViSP 2.10.0. +- \subpage tutorial-detection-face <br>This tutorial focuses on face detection thanks to OpenCV Haar cascade classifier. New since ViSP 2.10.0. +- \subpage tutorial-detection-object <br>This tutorial shows how to learn keypoints detected on a known object and how to use the matched correspondences to detect and estimate the pose of the object. New since ViSP 2.10.0. + +*/ + +/*! \page tutorial_computer_vision Computer vision +This page introduces the user to the way to estimate a pose or an homography. + +- \subpage tutorial-pose-estimation <br>This tutorial focuses on pose estimation from planar or non planar points. New since ViSP 2.10.0. +- \subpage tutorial-homography <br>Here we explain how to estimate an homography from couples of matched points. +- \subpage tutorial-homography-deprecated <br>Here we explain how to estimate an homography from couples of matched points. It will be deprecated if you use an OpenCV version equal to 2.8.0 or a more recent version. + +*/ + +/*! \page tutorial_vs Visual servoing +This page introduces the user to the way to achieve a visual servoing. + +- \subpage tutorial-ibvs <br>This tutorial explains how to simulate an IBVS. +- \subpage tutorial-simu-robot-pioneer <br>This tutorial focuses on visual servoing simulation on a unicycle robot. The study case is a Pioneer P3-DX mobile robot equipped with a camera. +- \subpage tutorial-boost-vs <br>This tutorial explains how to speed up the time to convergence of a visual servo. + +*/ + +/*! \page tutorial_bridge Bridges over other frameworks +This page introduces the user to the way to bridge other frameworks like OpenCV. + +- \subpage tutorial-bridge-opencv <br>This tutorial explicit how to convert OpenCV to/from ViSP structures such as camera parameters, images... + +*/ + +/*! \page tutorial_tools Other tools +This page introduces the user to other tools that may be useful. + +- \subpage tutorial-plotter <br>This tutorial explains how to plot curves in real-time during a visual servo. +- \subpage tutorial-trace <br>This tutorial explains how to introduce trace in the code that could be enabled for debugging or disabled. + +*/ \ No newline at end of file diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index adfe43d557507eb678d342a11ea73345823d3248..6054dab10b4c483f4cfc43ca21e95b224b69d23e 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,78 +1,97 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP overall configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# Set SRC_SUBDIRS variable to all the sub directories we want to parse during -# the build process. -# -# If you add/remove a directory, modify here -SET (SRC_SUBDIRS - calibration - coin-simulator - device - direct-visual-servoing - homography - image - key-point - math - manual - moments/image - moments/points - moments/polygon - ogre-simulator - parse-argv - pose-estimation - robot-simulator/afma6 - robot-simulator/camera - robot-simulator/viper850 - servo-afma4 - servo-afma6 - servo-biclops - servo-pioneer - servo-ptu46 - servo-viper650 - servo-viper850 - tools - tracking - video - wireframe-simulator -) - -# Build process propagation in the sub directories -SUBDIRS(${SRC_SUBDIRS}) +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP overall configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +project(ViSP-examples) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP) + +if(MSVC) + if(NOT VISP_SHARED) + foreach(flag_var + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + if(${flag_var} MATCHES "/MD") + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endif() + if(${flag_var} MATCHES "/MDd") + string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}") + endif() + endforeach(flag_var) + + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcrtd.lib") + set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib") + set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libcmtd.lib") + endif() +endif() + +visp_add_subdirectory(calibration REQUIRED_DEPS visp_core visp_vision visp_io visp_gui) +visp_add_subdirectory(coin-simulator REQUIRED_DEPS visp_core visp_robot visp_vs visp_ar visp_io) +visp_add_subdirectory(device/display REQUIRED_DEPS visp_core visp_gui visp_io) +visp_add_subdirectory(device/framegrabber REQUIRED_DEPS visp_core visp_sensor visp_io visp_gui) +visp_add_subdirectory(device/kinect REQUIRED_DEPS visp_core visp_sensor visp_gui) +visp_add_subdirectory(device/laserscanner REQUIRED_DEPS visp_core visp_sensor visp_io) +visp_add_subdirectory(device/light REQUIRED_DEPS visp_core visp_robot visp_io) +visp_add_subdirectory(direct-visual-servoing REQUIRED_DEPS visp_core visp_robot visp_visual_features visp_io visp_gui) +visp_add_subdirectory(homography REQUIRED_DEPS visp_core visp_vision visp_io) +visp_add_subdirectory(image REQUIRED_DEPS visp_core visp_io) +visp_add_subdirectory(key-point REQUIRED_DEPS visp_core visp_vision visp_sensor visp_io visp_gui) +visp_add_subdirectory(manual REQUIRED_DEPS visp_core visp_sensor visp_vs visp_robot visp_ar visp_vision visp_io visp_gui) +visp_add_subdirectory(math REQUIRED_DEPS visp_core visp_vision visp_io) +visp_add_subdirectory(moments/image REQUIRED_DEPS visp_core visp_vs visp_robot visp_gui) +visp_add_subdirectory(moments/points REQUIRED_DEPS visp_core visp_vs visp_robot visp_gui) +visp_add_subdirectory(moments/polygon REQUIRED_DEPS visp_core visp_vs visp_robot visp_gui) +visp_add_subdirectory(ogre-simulator REQUIRED_DEPS visp_core visp_vision visp_ar visp_blob visp_io visp_gui) +visp_add_subdirectory(parse-argv REQUIRED_DEPS visp_core visp_io) +visp_add_subdirectory(pose-estimation REQUIRED_DEPS visp_core visp_blob visp_vision visp_io visp_gui) +visp_add_subdirectory(robot-simulator/afma6 REQUIRED_DEPS visp_core visp_vs visp_robot visp_io visp_gui) +visp_add_subdirectory(robot-simulator/camera REQUIRED_DEPS visp_core visp_vs visp_robot visp_io visp_gui) +visp_add_subdirectory(robot-simulator/viper850 REQUIRED_DEPS visp_core visp_vs visp_robot visp_io visp_gui) +visp_add_subdirectory(servo-afma4 REQUIRED_DEPS visp_core visp_blob visp_vs visp_robot visp_sensor visp_gui) +visp_add_subdirectory(servo-afma6 REQUIRED_DEPS visp_core visp_blob visp_vs visp_robot visp_sensor visp_vision visp_gui) +visp_add_subdirectory(servo-biclops REQUIRED_DEPS visp_core visp_blob visp_vs visp_robot visp_sensor visp_gui) +visp_add_subdirectory(servo-pioneer REQUIRED_DEPS visp_core visp_blob visp_vs visp_robot visp_sensor visp_gui) +visp_add_subdirectory(servo-ptu46 REQUIRED_DEPS visp_core visp_blob visp_vs visp_robot visp_sensor visp_gui) +visp_add_subdirectory(servo-viper650 REQUIRED_DEPS visp_core visp_blob visp_vs visp_robot visp_sensor visp_vision visp_gui) +visp_add_subdirectory(servo-viper850 REQUIRED_DEPS visp_core visp_blob visp_vs visp_robot visp_sensor visp_vision visp_gui) +visp_add_subdirectory(tools REQUIRED_DEPS visp_core visp_robot visp_io visp_gui) +visp_add_subdirectory(tracking REQUIRED_DEPS visp_core visp_io visp_gui) +visp_add_subdirectory(video REQUIRED_DEPS visp_core visp_io visp_gui) +visp_add_subdirectory(wireframe-simulator REQUIRED_DEPS visp_core visp_robot visp_io visp_gui) diff --git a/example/calibration/CMakeLists.txt b/example/calibration/CMakeLists.txt index 8ca78d04bfc9502e656300ed33ce9961a725ee35..726d18f2b78896ec6a28adb85aeec6afd2107457 100644 --- a/example/calibration/CMakeLists.txt +++ b/example/calibration/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,27 +35,21 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set (SOURCE +project(example-calibration) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_vision visp_gui visp_io) + +set(example_cpp camera_calibration.cpp calibrateTsai.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() @@ -82,24 +73,7 @@ list(APPEND data2copy "${CMAKE_CURRENT_SOURCE_DIR}/circles-03.png" ) list(APPEND data2copy "${CMAKE_CURRENT_SOURCE_DIR}/circles-04.png" ) list(APPEND data2copy "${CMAKE_CURRENT_SOURCE_DIR}/circles-05.png" ) -# Since CMake 3.0.0 policy CMP0026 was introduced to disallow location property on target. -# If CMake 3.0.0 is used, we use $<TARGET_FILE_DIR:tgt> to get the target location -if (CMAKE_VERSION VERSION_GREATER 2.8.12) - foreach(data ${data2copy}) - add_custom_command( - TARGET camera_calibration - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${data}" "$<TARGET_FILE_DIR:camera_calibration" - ) - endforeach() -else() - get_target_property(target_location camera_calibration LOCATION) - get_filename_component(target_location "${target_location}" PATH) - foreach(data ${data2copy}) - add_custom_command( - TARGET camera_calibration - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${data}" "${target_location}" - ) - endforeach() -endif() +# Copy the data files to the same location than the target +foreach(data ${data2copy}) + visp_copy_data(camera_calibration.cpp ${data}) +endforeach() diff --git a/example/calibration/calibrateTsai.cpp b/example/calibration/calibrateTsai.cpp index 77b299d2bbc49fec65095099bdd4b24c87d71bf4..6a9764a3be5d1e59fdba1bf052735e3d1928f8b7 100644 --- a/example/calibration/calibrateTsai.cpp +++ b/example/calibration/calibrateTsai.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: calibrateTsai.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tsai calibration example to estimate hand to eye transformation. * @@ -50,11 +46,11 @@ #include <iomanip> #include <vector> -#include <visp/vpDebug.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> -#include <visp/vpCalibration.h> -#include <visp/vpExponentialMap.h> +#include <visp3/core/vpDebug.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/vision/vpCalibration.h> +#include <visp3/core/vpExponentialMap.h> int main() { diff --git a/example/calibration/camera_calibration.cpp b/example/calibration/camera_calibration.cpp index 015460716dc67dcfe70c70486641e5cec85b3217..9ac67a73ad23fb35f497343aa05932e78691027b 100644 --- a/example/calibration/camera_calibration.cpp +++ b/example/calibration/camera_calibration.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: camera_calibration.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Camera calibration with chessboard or circle calibration grid. * @@ -40,7 +36,7 @@ *****************************************************************************/ #include <iostream> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if VISP_HAVE_OPENCV_VERSION >= 0x020300 @@ -49,17 +45,17 @@ #include <opencv2/calib3d/calib3d.hpp> #include <opencv2/highgui/highgui.hpp> -#include <visp/vpCalibration.h> +#include <visp3/vision/vpCalibration.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpIoTools.h> -#include <visp/vpPoint.h> -#include <visp/vpVideoReader.h> -#include <visp/vpXmlParserCamera.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpPoint.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/core/vpXmlParserCamera.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -176,9 +172,7 @@ int main(int argc, const char ** argv) for (int i=0; i< s.boardSize.height; i++) { for (int j=0; j< s.boardSize.width; j++) { - vpPoint P; - P.setWorldCoordinates(j*s.squareSize, i*s.squareSize, 0); - model.push_back(P); + model.push_back( vpPoint(j*s.squareSize, i*s.squareSize, 0) ); } } diff --git a/example/coin-simulator/CMakeLists.txt b/example/coin-simulator/CMakeLists.txt index 21a6189669b84f0dd0bd20d57eb83c474d74c838..b2b79c7d5505356335a3da9556745a57c60a3544 100644 --- a/example/coin-simulator/CMakeLists.txt +++ b/example/coin-simulator/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,31 +35,25 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set (SOURCE +project(example-coin-simulator) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_robot visp_vs visp_ar visp_io) + +set(example_cpp simulateFourPoints2DCartesianCamVelocity.cpp simulateFourPoints2DPolarCamVelocity.cpp - simulateCircle2DCamVelocity.cpp + simulateCircle2DCamVelocity.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") + endif() # Add test - add_test(${binary} ${binary} ${OPTION_TO_DESACTIVE_DISPLAY}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") - endif() + get_filename_component(target ${cpp} NAME_WE) + add_test(${target} ${target} ${OPTION_TO_DESACTIVE_DISPLAY}) endforeach() diff --git a/example/coin-simulator/simulateCircle2DCamVelocity.cpp b/example/coin-simulator/simulateCircle2DCamVelocity.cpp index b5b3c9ee12956bb6327872c3b135ee8eaf18df93..3a2325e0ae1a89b7ba775255a5645666196dea28 100644 --- a/example/coin-simulator/simulateCircle2DCamVelocity.cpp +++ b/example/coin-simulator/simulateCircle2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: simulateCircle2DCamVelocity.cpp 5263 2015-02-04 13:43:25Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a visual servoing with visualization. * @@ -54,24 +50,24 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> -#ifdef VISP_HAVE_COIN_AND_GUI -#include <visp/vpImage.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpTime.h> -#include <visp/vpSimulator.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeatureEllipse.h> -#include <visp/vpCircle.h> -#include <visp/vpServo.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#ifdef VISP_HAVE_COIN3D_AND_GUI +#include <visp3/core/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpTime.h> +#include <visp3/ar/vpSimulator.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeatureEllipse.h> +#include <visp3/core/vpCircle.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> #define GETOPTARGS "cdi:h" #define SAVE 0 @@ -173,7 +169,9 @@ void *mainLoop (void *_simu) vcMo[3] = 0 ; vcMo[4] = vpMath::rad(45) ; vcMo[5] = vpMath::rad(40) ; - vpHomogeneousMatrix cMo(vcMo) ; ; + vpHomogeneousMatrix cMo(vcMo); + vpHomogeneousMatrix wMo; // Set to identity + vpHomogeneousMatrix wMc; // Robot (=camera) location in the world frame vpHomogeneousMatrix cMod ; cMod[0][3] = 0 ; @@ -185,14 +183,15 @@ void *mainLoop (void *_simu) while (pos!=0) { vpServo task ; - vpRobotCamera robot ; + vpSimulatorCamera robot ; float sampling_time = 0.040f; // Sampling period in second robot.setSamplingTime(sampling_time); robot.setMaxTranslationVelocity(4.); // Sets the initial camera location - robot.setPosition(cMo) ; + wMc = wMo * cMo.inverse(); + robot.setPosition(wMc) ; simu->setCameraPosition(cMo) ; if (pos==1) cMod[2][3] = 0.32 ; @@ -239,10 +238,11 @@ void *mainLoop (void *_simu) double t = vpTime::measureTimeMs(); if (iter==1) std::cout << "get the robot position" << std::endl; - robot.getPosition(cMo) ; + wMc = robot.getPosition() ; if (iter==1) std::cout << "new circle position" << std::endl; //retrieve x,y and Z of the vpCircle structure + cMo = wMc.inverse() * wMo; circle.track(cMo) ; vpFeatureBuilder::create(p,circle); diff --git a/example/coin-simulator/simulateFourPoints2DCartesianCamVelocity.cpp b/example/coin-simulator/simulateFourPoints2DCartesianCamVelocity.cpp index b1be43c844df1d4d0c4311cac402ff762f158681..ed588952dc8e3823db7ab152862f0d8acf642580 100644 --- a/example/coin-simulator/simulateFourPoints2DCartesianCamVelocity.cpp +++ b/example/coin-simulator/simulateFourPoints2DCartesianCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: simulateFourPoints2DCartesianCamVelocity.cpp 5263 2015-02-04 13:43:25Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a visual servoing with visualization. * @@ -52,24 +48,24 @@ from the camera and from an external view using vpSimulator. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> -#ifdef VISP_HAVE_COIN_AND_GUI +#ifdef VISP_HAVE_COIN3D_AND_GUI -#include <visp/vpImage.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpTime.h> -#include <visp/vpSimulator.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpServo.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpTime.h> +#include <visp3/ar/vpSimulator.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> #define GETOPTARGS "di:h" #define SAVE 0 @@ -162,7 +158,7 @@ void *mainLoop (void *_simu) simu->initMainApplication() ; vpServo task ; - vpRobotCamera robot ; + vpSimulatorCamera robot ; float sampling_time = 0.040f; // Sampling period in second robot.setSamplingTime(sampling_time); @@ -186,12 +182,16 @@ void *mainLoop (void *_simu) vcMo[4] = vpMath::rad(0) ; vcMo[5] = vpMath::rad(40) ; - vpHomogeneousMatrix cMo(vcMo) ; - robot.setPosition(cMo) ; + vpHomogeneousMatrix cMo(vcMo); + vpHomogeneousMatrix wMo; // Set to identity + vpHomogeneousMatrix wMc; // Camera location in world frame + wMc = wMo * cMo.inverse(); + robot.setPosition(wMc) ; simu->setCameraPosition(cMo) ; simu->getCameraPosition(cMo) ; - robot.setPosition(cMo) ; + wMc = wMo * cMo.inverse(); + robot.setPosition(wMc) ; robot.setMaxTranslationVelocity(4.); vpCameraParameters cam ; @@ -258,7 +258,8 @@ void *mainLoop (void *_simu) robot.get_eJe(eJe) ; task.set_eJe(eJe) ; - robot.getPosition(cMo) ; + wMc = robot.getPosition(); + cMo = wMc.inverse() * wMo; for (int i = 0 ; i < 4 ; i++) { point[i].track(cMo) ; diff --git a/example/coin-simulator/simulateFourPoints2DPolarCamVelocity.cpp b/example/coin-simulator/simulateFourPoints2DPolarCamVelocity.cpp index 9ab7e7696abde3420a3c747c0a66ac9158d3e069..6700eadd10cca5e1df8fbe6ee3d2b44b2359d411 100644 --- a/example/coin-simulator/simulateFourPoints2DPolarCamVelocity.cpp +++ b/example/coin-simulator/simulateFourPoints2DPolarCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: simulateFourPoints2DPolarCamVelocity.cpp 5263 2015-02-04 13:43:25Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a visual servoing with visualization. * @@ -50,24 +46,24 @@ of the four points. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> -#ifdef VISP_HAVE_COIN_AND_GUI +#ifdef VISP_HAVE_COIN3D_AND_GUI -#include <visp/vpImage.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpTime.h> -#include <visp/vpSimulator.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePointPolar.h> -#include <visp/vpServo.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpTime.h> +#include <visp3/ar/vpSimulator.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePointPolar.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> #define GETOPTARGS "di:h" #define SAVE 0 @@ -160,7 +156,7 @@ void *mainLoop (void *_simu) simu->initMainApplication() ; vpServo task ; - vpRobotCamera robot ; + vpSimulatorCamera robot ; float sampling_time = 0.040f; // Sampling period in second robot.setSamplingTime(sampling_time); @@ -176,12 +172,16 @@ void *mainLoop (void *_simu) vcMo[4] = vpMath::rad(0) ; vcMo[5] = vpMath::rad(90) ; - vpHomogeneousMatrix cMo(vcMo) ; - robot.setPosition(cMo) ; + vpHomogeneousMatrix cMo(vcMo); + vpHomogeneousMatrix wMo; // Set to identity + vpHomogeneousMatrix wMc; // Camera location in world frame + wMc = wMo * cMo.inverse(); + robot.setPosition(wMc) ; simu->setCameraPosition(cMo) ; simu->getCameraPosition(cMo) ; - robot.setPosition(cMo) ; + wMc = wMo * cMo.inverse(); + robot.setPosition(wMc) ; vpCameraParameters cam ; @@ -273,7 +273,8 @@ void *mainLoop (void *_simu) robot.get_eJe(eJe) ; task.set_eJe(eJe) ; - robot.getPosition(cMo) ; + wMc = robot.getPosition(); + cMo = wMc.inverse() * wMo; for (int i = 0 ; i < 4 ; i++) { point[i].track(cMo) ; diff --git a/example/device/display/CMakeLists.txt b/example/device/display/CMakeLists.txt index befd33cf8e95e4f13bff854209c5667b9d702960..6dd20f97daeb131bf612379ff148f387446bf62b 100644 --- a/example/device/display/CMakeLists.txt +++ b/example/device/display/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,12 +35,13 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-device-display) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_gui visp_io) + +set(example_cpp displaySequence.cpp displayGDI.cpp displayD3D.cpp @@ -53,18 +51,10 @@ set(SOURCE displayXMulti.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/device/display/displayD3D.cpp b/example/device/display/displayD3D.cpp index ccf1ed29088230f98f0c5ded55f9093f3a316a86..d94f9fbab34f5c6612af8d6f8949e61135629117 100755 --- a/example/device/display/displayD3D.cpp +++ b/example/device/display/displayD3D.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: displayD3D.cpp 5004 2014-11-24 08:24:18Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Windows' D3D Display Test * @@ -48,17 +44,17 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_D3D9) ) -#include <visp/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayD3D.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> /*! \example displayD3D.cpp diff --git a/example/device/display/displayGDI.cpp b/example/device/display/displayGDI.cpp index 41724ea35b38e1c6a98c2af94280740679200ba8..5497c9553ada50983c60f2cb34eb6df6251bb03b 100755 --- a/example/device/display/displayGDI.cpp +++ b/example/device/display/displayGDI.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: displayGDI.cpp 5004 2014-11-24 08:24:18Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Windows' GDI Display Test * @@ -47,17 +43,17 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #if ( defined(_WIN32) && defined(VISP_HAVE_GDI) ) -#include <visp/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayGDI.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> /*! \example displayGDI.cpp diff --git a/example/device/display/displayGTK.cpp b/example/device/display/displayGTK.cpp index ef7dbe93dc7a955b22f4f01c7f57127d076717fa..a10b0ff1262a6ebde8d4b33a71fa3d1ba3c09d51 100644 --- a/example/device/display/displayGTK.cpp +++ b/example/device/display/displayGTK.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: displayGTK.cpp 5004 2014-11-24 08:24:18Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read an image on the disk and display it using GTK. * @@ -49,20 +45,20 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_GTK #include <stdlib.h> #include <stdio.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> /*! \example displayGTK.cpp diff --git a/example/device/display/displayOpenCV.cpp b/example/device/display/displayOpenCV.cpp index 97d4fe0ef84433e8a3e386ce7683b07bf1313d16..9d93b9223e91a75bea9a21884f9afa9627e748d6 100644 --- a/example/device/display/displayOpenCV.cpp +++ b/example/device/display/displayOpenCV.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: displayOpenCV.cpp 5005 2014-11-24 08:25:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read an image on the disk and display it using OpenCV. * @@ -47,19 +43,19 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> #if defined(VISP_HAVE_OPENCV) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> -#include <visp/vpTime.h> +#include <visp3/core/vpTime.h> /*! \example displayOpenCV.cpp diff --git a/example/device/display/displaySequence.cpp b/example/device/display/displaySequence.cpp index a7dd3ee56d11b7eb97b227ee91305d9f901191a0..a7f820feebf5296f632c6ddd406c5bed5a22f4e6 100644 --- a/example/device/display/displaySequence.cpp +++ b/example/device/display/displaySequence.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: displaySequence.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read an image sequence from the disk and display it. * @@ -52,24 +48,24 @@ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> #include <stdio.h> #include <stdlib.h> #include <sstream> #include <iomanip> #if (defined (VISP_HAVE_GTK) || defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> -#include <visp/vpTime.h> +#include <visp3/core/vpTime.h> /*! \example displaySequence.cpp diff --git a/example/device/display/displayX.cpp b/example/device/display/displayX.cpp index b0280540484e9482df3afa8504d89e2c5cf514c2..c0813a178c4a0e51ded8e3b61261a2a5c9110a99 100644 --- a/example/device/display/displayX.cpp +++ b/example/device/display/displayX.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: displayX.cpp 5004 2014-11-24 08:24:18Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read an image on the disk and display it using X11. * @@ -48,18 +44,18 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> #ifdef VISP_HAVE_X11 -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayX.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> -#include <visp/vpTime.h> +#include <visp3/core/vpTime.h> /*! \example displayX.cpp diff --git a/example/device/display/displayXMulti.cpp b/example/device/display/displayXMulti.cpp index 4bff5507f3960a677643d72d331d3ea39ca41e5e..7f9eddd9e616b01fb5f1758ddf38c8ffd1a0d9cb 100644 --- a/example/device/display/displayXMulti.cpp +++ b/example/device/display/displayXMulti.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: displayXMulti.cpp 5004 2014-11-24 08:24:18Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read an image on the disk and display it using X11. * @@ -48,20 +44,20 @@ the overlayed features in an image on the disk. */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_X11 #include <stdlib.h> #include <stdio.h> #include <string.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayX.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> /*! \example displayXMulti.cpp diff --git a/example/device/framegrabber/CMakeLists.txt b/example/device/framegrabber/CMakeLists.txt index acba5bfd8c22116c359bffea95a37efe180d430f..997371b191803c58feb492bc504052f58944ed11 100644 --- a/example/device/framegrabber/CMakeLists.txt +++ b/example/device/framegrabber/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,12 +35,13 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-device-framegrabber) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_sensor visp_io visp_gui) + +set(example_cpp grab1394Two.cpp grab1394CMU.cpp grabDisk.cpp @@ -54,18 +52,10 @@ set(SOURCE grabOpenCV-2.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/device/framegrabber/grab1394CMU.cpp b/example/device/framegrabber/grab1394CMU.cpp index fdca9c3efd2bd6bddb663a776bced4cdb93fae17..052790f688db3abb438c2921019656a6d61d274a 100644 --- a/example/device/framegrabber/grab1394CMU.cpp +++ b/example/device/framegrabber/grab1394CMU.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: grab1394CMU.cpp 4659 2014-02-09 14:11:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Video capture example based on CMU 1394 Digital Camera SDK. * @@ -50,14 +46,14 @@ #include <stdlib.h> #include <iostream> -#include <visp/vpConfig.h> -#include <visp/vp1394CMUGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpParseArgv.h> -#include <visp/vpTime.h> +#include <visp3/core/vpConfig.h> +#include <visp3/sensor/vp1394CMUGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpTime.h> #define GRAB_COLOR diff --git a/example/device/framegrabber/grab1394Two.cpp b/example/device/framegrabber/grab1394Two.cpp index 401e31d7c57d116f1656ef9396f96fab22cbc448..738c7ca9e7032b2593c0e37700223726e799cb1e 100644 --- a/example/device/framegrabber/grab1394Two.cpp +++ b/example/device/framegrabber/grab1394Two.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: grab1394Two.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Firewire cameras video capture. * @@ -55,23 +51,23 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> #include <stdio.h> #include <iostream> #include <sstream> #include <list> -#if defined(VISP_HAVE_DC1394_2) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpTime.h> -#include <visp/vpParseArgv.h> -#include <visp/vpRGBa.h> +#if defined(VISP_HAVE_DC1394) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpTime.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpRGBa.h> #define GRAB_CxOLOR diff --git a/example/device/framegrabber/grabDirectShow.cpp b/example/device/framegrabber/grabDirectShow.cpp index cea7264c493eeea35ab1ab6f1fd77111a25bb262..1a03f03d9575ff62f487900c44412485090a1aab 100644 --- a/example/device/framegrabber/grabDirectShow.cpp +++ b/example/device/framegrabber/grabDirectShow.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: grabDirectShow.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Acquire images using DirectShow (under Windows only) and display it * using GTK or GDI. @@ -41,8 +37,8 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> /*! \file grabDirectShow.cpp @@ -55,13 +51,13 @@ #if (defined (VISP_HAVE_GTK) || defined(VISP_HAVE_GDI)) -#include <visp/vpDirectShowGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpParseArgv.h> -#include <visp/vpTime.h> +#include <visp3/sensor/vpDirectShowGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpTime.h> // List of allowed command line options #define GETOPTARGS "dhn:o:" diff --git a/example/device/framegrabber/grabDirectShowMulti.cpp b/example/device/framegrabber/grabDirectShowMulti.cpp index 312c80a655384d0e543d3af5bb7e5010ffa988c3..aa922ba3adb9f5a4787f4e62ed3c9ec61c58c0cf 100644 --- a/example/device/framegrabber/grabDirectShowMulti.cpp +++ b/example/device/framegrabber/grabDirectShowMulti.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: grabDirectShowMulti.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -41,8 +38,8 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> /*! \file grabDirectShowMulti.cpp @@ -60,13 +57,13 @@ #if defined (VISP_HAVE_DIRECTSHOW) #if (defined (VISP_HAVE_GTK) || defined(VISP_HAVE_GDI)) -#include <visp/vpDirectShowGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpParseArgv.h> -#include <visp/vpTime.h> +#include <visp3/sensor/vpDirectShowGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpTime.h> // List of allowed command line options diff --git a/example/device/framegrabber/grabDisk.cpp b/example/device/framegrabber/grabDisk.cpp index 3fe498109753d5f6a536d410f56c0ce26b5e8c32..dc2b6a0ca8c930b2f1cc4bb218c9626236b71df6 100644 --- a/example/device/framegrabber/grabDisk.cpp +++ b/example/device/framegrabber/grabDisk.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: grabDisk.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read an image sequence from the disk and display it. * @@ -41,19 +37,19 @@ *****************************************************************************/ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) -#include <visp/vpDiskGrabber.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpImage.h> -#include <visp/vpIoTools.h> -#include <visp/vpParseArgv.h> -#include <visp/vpTime.h> +#include <visp3/io/vpDiskGrabber.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpTime.h> /*! \file grabDisk.cpp diff --git a/example/device/framegrabber/grabOpenCV-2.cpp b/example/device/framegrabber/grabOpenCV-2.cpp index a7f9c00d9f2b8acc2d71f54cded72a2a2d6bc93c..26eb1744027c635b3eea18af0f05667b2c2f7ba3 100644 --- a/example/device/framegrabber/grabOpenCV-2.cpp +++ b/example/device/framegrabber/grabOpenCV-2.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: grabOpenCV-2.cpp 5005 2014-11-24 08:25:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Acquire images using OpenCV cv::VideoCapture. * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> /*! \example grabOpenCV-2.cpp @@ -50,14 +46,14 @@ #include <iostream> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpImage.h> -#include <visp/vpImageConvert.h> -#include <visp/vpOpenCVGrabber.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/sensor/vpOpenCVGrabber.h> // usage: binary <device name> diff --git a/example/device/framegrabber/grabOpenCV.cpp b/example/device/framegrabber/grabOpenCV.cpp index 82b278c5faabc9a24baef9158ba95c1e146cca1c..347fb54da940a81456a1869bd28f7b357f2e8ae3 100644 --- a/example/device/framegrabber/grabOpenCV.cpp +++ b/example/device/framegrabber/grabOpenCV.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: grabOpenCV.cpp 5023 2014-12-03 16:07:48Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Acquire images using DirectShow (under Windows only) and display it * using GTK or GDI. @@ -40,8 +36,8 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> /*! \file grabOpenCV.cpp @@ -53,12 +49,12 @@ #if defined (VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION < 0x020408) -#include <visp/vpOpenCVGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpParseArgv.h> -#include <visp/vpTime.h> +#include <visp3/sensor/vpOpenCVGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpTime.h> // List of allowed command line options #define GETOPTARGS "dhn:o:D:" diff --git a/example/device/framegrabber/grabV4l2.cpp b/example/device/framegrabber/grabV4l2.cpp index 8670fb83b0a30489cd53a16902a0313391195a6e..a9f229dd400c0c4d8fe0035ef0da8b04004c964c 100644 --- a/example/device/framegrabber/grabV4l2.cpp +++ b/example/device/framegrabber/grabV4l2.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: grabV4l2.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Acquire images using 1394 device with cfox (MAC OSX) and display it * using GTK or GTK. @@ -41,8 +37,8 @@ *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> /*! \file grabV4l2.cpp @@ -55,14 +51,14 @@ #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK)) -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpTime.h> -#include <visp/vpParseArgv.h> -#include <visp/vpV4l2Grabber.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpTime.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/sensor/vpV4l2Grabber.h> // List of allowed command line options #define GETOPTARGS "df:i:hn:o:p:s:t:v:x" diff --git a/example/device/kinect/CMakeLists.txt b/example/device/kinect/CMakeLists.txt index 4bc470815db588add51b9cc5a492fb79d9973653..ed54369c5b1d359288cb3e7aeb0c37610aff0b01 100644 --- a/example/device/kinect/CMakeLists.txt +++ b/example/device/kinect/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,26 +35,19 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - kinectAcquisition.cpp -) +project(example-device-kinect) + +cmake_minimum_required(VERSION 2.6) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) +find_package(VISP REQUIRED visp_core visp_sensor visp_gui) - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +set(example_cpp + kinectAcquisition.cpp +) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/device/kinect/kinectAcquisition.cpp b/example/device/kinect/kinectAcquisition.cpp index e043eefdfbb3664c8b22513e4b129717cf533903..436ae768a1d1948cdfadd2a2a6a9c73dd6298c59 100644 --- a/example/device/kinect/kinectAcquisition.cpp +++ b/example/device/kinect/kinectAcquisition.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: kinectAcquisition.cpp 5060 2014-12-12 18:31:03Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Kinect example. * @@ -48,20 +44,20 @@ */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <iostream> #ifdef VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_GDI)) -#include <visp/vpImage.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpKinect.h> -#include <visp/vpTime.h> +#include <visp3/core/vpImage.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/sensor/vpKinect.h> +#include <visp3/core/vpTime.h> int main() { try { diff --git a/example/device/laserscanner/CMakeLists.txt b/example/device/laserscanner/CMakeLists.txt index 5ca5f10e50e3774e01b3d4fe325b80757309aeee..28ea84bc77b26fc290e08a5975c45ecb8294cc96 100644 --- a/example/device/laserscanner/CMakeLists.txt +++ b/example/device/laserscanner/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,27 +35,20 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-device-laserscanner) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_sensor visp_io) + +set(example_cpp SickLDMRS-Acq.cpp SickLDMRS-Process.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/device/laserscanner/SickLDMRS-Acq.cpp b/example/device/laserscanner/SickLDMRS-Acq.cpp index 940a7ac0ceac60a0e81d816354257ec4d64d78b0..01fba82bcac96c1b6d35ae41d40a762e4271ff3f 100644 --- a/example/device/laserscanner/SickLDMRS-Acq.cpp +++ b/example/device/laserscanner/SickLDMRS-Acq.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: SickLDMRS-Acq.cpp 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Sick LD-MRS laser driver. * @@ -50,9 +46,9 @@ platforms since the Sick LD-MRS driver was not ported to Windows. */ -#include <visp/vpDebug.h> -#include <visp/vpSickLDMRS.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpDebug.h> +#include <visp3/sensor/vpSickLDMRS.h> +#include <visp3/io/vpParseArgv.h> #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) diff --git a/example/device/laserscanner/SickLDMRS-Process.cpp b/example/device/laserscanner/SickLDMRS-Process.cpp index 9a2ad7bad095330df3c1cfabf76c85d07eced7a1..f714d9cf4d82b433d23a4df5a67833c70bf7dda3 100644 --- a/example/device/laserscanner/SickLDMRS-Process.cpp +++ b/example/device/laserscanner/SickLDMRS-Process.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: SickLDMRS-Process.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Sick LD-MRS laser driver. * @@ -61,18 +57,20 @@ select the layers to proceed. */ -#include <visp/vpDebug.h> -#include <visp/vpImagePoint.h> -#include <visp/vpSickLDMRS.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpParseArgv.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/sensor/vpSickLDMRS.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpDisplay.h> +#ifdef VISP_HAVE_MODULE_GUI +# include <visp3/gui/vpDisplayX.h> +# include <visp3/gui/vpDisplayGDI.h> +# include <visp3/gui/vpDisplayGTK.h> +#endif +#include <visp3/io/vpParseArgv.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpIoTools.h> #if ( !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) ) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_GTK)) @@ -113,7 +111,8 @@ void *laser_display_and_save_loop(void *) } } - vpDisplay *display; + vpDisplay *display = NULL; +#ifdef VISP_HAVE_MODULE_GUI #if defined VISP_HAVE_X11 display = new vpDisplayX; #elif defined VISP_HAVE_GDI @@ -122,6 +121,7 @@ void *laser_display_and_save_loop(void *) display = new vpDisplayGTK; #endif display->init (map, 10, 10, "Laser scan"); +#endif unsigned int iter = 0; for ( ; ; ) { @@ -236,7 +236,7 @@ void *laser_acq_loop(void *) void *camera_acq_and_display_loop(void *) { -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 try { // Initialize the firewire framegrabber vp1394TwoGrabber g; // Create a grabber based on libdc1394-2.x third party lib @@ -253,7 +253,8 @@ void *camera_acq_and_display_loop(void *) g.acquire(I); // Acquire an image I.quarterSizeImage(Q); - vpDisplay *display; + vpDisplay *display = NULL; +#ifdef VISP_HAVE_MODULE_GUI #if defined VISP_HAVE_X11 display = new vpDisplayX; #elif defined VISP_HAVE_GDI @@ -262,7 +263,8 @@ void *camera_acq_and_display_loop(void *) display = new vpDisplayGTK; #endif display->init (Q, 320, 10, "Camera"); - +#endif + // Create a file with cameraimage time stamps std::ofstream fdimage_ts; if (save) { diff --git a/example/device/light/CMakeLists.txt b/example/device/light/CMakeLists.txt index 2628f47a98f083211327caff63ce84f654825a40..a38c889908cfbefdb65a757d5ee3677200a039a0 100644 --- a/example/device/light/CMakeLists.txt +++ b/example/device/light/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,26 +35,19 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - ringLight.cpp -) +project(example-device-laserscanner) + +cmake_minimum_required(VERSION 2.6) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) +find_package(VISP REQUIRED visp_core visp_robot visp_io) - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +set(example_cpp + ringLight.cpp +) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/device/light/ringLight.cpp b/example/device/light/ringLight.cpp index 324ea0388c0d7497292c3084f8f15272b18bef34..c6a02d77f851e937dd2ba72bcb853cd568e580ab 100644 --- a/example/device/light/ringLight.cpp +++ b/example/device/light/ringLight.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: ringLight.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of ring light control. * @@ -47,8 +43,8 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #include <cmath> // std::fabs #include <limits> // numeric_limits #if defined VISP_HAVE_PARPORT @@ -56,9 +52,9 @@ #include <stdio.h> #include <iostream> -#include <visp/vpRingLight.h> -#include <visp/vpParseArgv.h> -#include <visp/vpTime.h> +#include <visp3/robot/vpRingLight.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpTime.h> // List of allowed command line options #define GETOPTARGS "d:hn:ot:" diff --git a/example/direct-visual-servoing/CMakeLists.txt b/example/direct-visual-servoing/CMakeLists.txt index 288a5abb72853bf7a5272c85062dd6b52bfdc0d7..6e332238e43dad33dc855042e62ef358301b3cec 100644 --- a/example/direct-visual-servoing/CMakeLists.txt +++ b/example/direct-visual-servoing/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,27 +35,20 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - photometricVisualServoing.cpp -) +project(example-direct-vvs) + +cmake_minimum_required(VERSION 2.6) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) +find_package(VISP REQUIRED visp_core visp_robot visp_visual_features visp_io visp_gui) - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +set(example_cpp + photometricVisualServoing.cpp +) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/direct-visual-servoing/photometricVisualServoing.cpp b/example/direct-visual-servoing/photometricVisualServoing.cpp index c9af07b162d7fc08ba6b782c44a5c2ac9f57bc32..6e16ab391390edc082c23f5c96add5f4a9b05ee8 100755 --- a/example/direct-visual-servoing/photometricVisualServoing.cpp +++ b/example/direct-visual-servoing/photometricVisualServoing.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: photometricVisualServoing.cpp 5108 2015-01-05 07:48:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,26 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * - * * Authors: * Eric Marchand * Christophe Collewet @@ -45,33 +40,33 @@ */ -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageTools.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpTime.h> -#include <visp/vpRobotCamera.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpTime.h> +#include <visp3/robot/vpSimulatorCamera.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayX.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayX.h> -#include <visp/vpFeatureLuminance.h> -#include <visp/vpParseArgv.h> +#include <visp3/visual_features/vpFeatureLuminance.h> +#include <visp3/io/vpParseArgv.h> -#include <visp/vpImageSimulator.h> +#include <visp3/robot/vpImageSimulator.h> #include <stdlib.h> #define Z 1 -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> // List of allowed command line options #define GETOPTARGS "cdi:n:h" @@ -302,6 +297,8 @@ main(int argc, const char ** argv) //camera desired position vpHomogeneousMatrix cMo ; cMo.buildFrom(0,0,1.2,vpMath::rad(15),vpMath::rad(-5),vpMath::rad(20)); + vpHomogeneousMatrix wMo; // Set to identity + vpHomogeneousMatrix wMc; // Camera position in the world frame //set the robot at the desired position sim.setCameraPosition(cMo) ; @@ -340,9 +337,10 @@ main(int argc, const char ** argv) } #endif // create the robot (here a simulated free flying camera) - vpRobotCamera robot ; + vpSimulatorCamera robot; robot.setSamplingTime(0.04); - robot.setPosition(cMo) ; + wMc = wMo * cMo.inverse(); + robot.setPosition(wMc); // ------------------------------------------------------ // Visual feature, interaction matrix, error @@ -460,9 +458,9 @@ main(int argc, const char ** argv) std::cout << " |Tc| = " << sqrt(v.sumSquare()) << std::endl; // send the robot velocity - robot.setVelocity(vpRobot::CAMERA_FRAME, v) ; - robot.getPosition(cMo) ; - + robot.setVelocity(vpRobot::CAMERA_FRAME, v); + wMc = robot.getPosition(); + cMo = wMc.inverse() * wMo; } while(normeError > 10000 && iter < opt_niter); diff --git a/example/homography/CMakeLists.txt b/example/homography/CMakeLists.txt index 74aeeb3eaf5013bf334d409196bf5ec76203e76e..b48423e2b3b3fb9a990519ef6de9072106b05e64 100644 --- a/example/homography/CMakeLists.txt +++ b/example/homography/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,32 +35,26 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-homography) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_vision visp_io) + +set(example_cpp homographyHartleyDLT2DObject.cpp homographyHLM2DObject.cpp homographyHLM3DObject.cpp homographyRansac2DObject.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") + endif() # Add test - ADD_TEST(${binary} ${binary}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") - endif() + get_filename_component(target ${cpp} NAME_WE) + add_test(${target} ${target}) endforeach() diff --git a/example/homography/homographyHLM2DObject.cpp b/example/homography/homographyHLM2DObject.cpp index 3966301a00e861d0e852f6019f2196b859b2f01c..e3e9329ec706ff2d068979b119d778a86d31058b 100644 --- a/example/homography/homographyHLM2DObject.cpp +++ b/example/homography/homographyHLM2DObject.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: homographyHLM2DObject.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of the HLM (Malis) homography estimation algorithm. * @@ -56,17 +52,17 @@ */ -#include <visp/vpMath.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomography.h> -#include <visp/vpDebug.h> -#include <visp/vpThetaUVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpThetaUVector.h> -#include <visp/vpPoint.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpDebug.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpDebug.h> +#include <visp3/io/vpParseArgv.h> #include <stdlib.h> // List of allowed command line options #define GETOPTARGS "h" diff --git a/example/homography/homographyHLM3DObject.cpp b/example/homography/homographyHLM3DObject.cpp index ffe94ae719c325c7ef30f4cc42660dc5fea84dfc..91d3cdd148f97f35c1b0c5b43eee6eb6b32fd96e 100644 --- a/example/homography/homographyHLM3DObject.cpp +++ b/example/homography/homographyHLM3DObject.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: homographyHLM3DObject.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test the HLM (Malis) homography estimation algorithm with a 3D object. * @@ -54,17 +50,17 @@ */ -#include <visp/vpMath.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomography.h> -#include <visp/vpDebug.h> -#include <visp/vpThetaUVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpThetaUVector.h> -#include <visp/vpPoint.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpDebug.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpDebug.h> +#include <visp3/io/vpParseArgv.h> #include <stdlib.h> // List of allowed command line options #define GETOPTARGS "h" diff --git a/example/homography/homographyHartleyDLT2DObject.cpp b/example/homography/homographyHartleyDLT2DObject.cpp index 86561fd795e9814d73f287a2ca1c123f889027d0..23959a846f49132d5e0094650256add6d0ad86a1 100644 --- a/example/homography/homographyHartleyDLT2DObject.cpp +++ b/example/homography/homographyHartleyDLT2DObject.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: homographyHartleyDLT2DObject.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of the HartleyDLT homography estimation algorithm. * @@ -55,17 +51,17 @@ -#include <visp/vpMath.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomography.h> -#include <visp/vpDebug.h> -#include <visp/vpThetaUVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpThetaUVector.h> -#include <visp/vpPoint.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpDebug.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpDebug.h> +#include <visp3/io/vpParseArgv.h> #include <stdlib.h> // List of allowed command line options #define GETOPTARGS "h" diff --git a/example/homography/homographyRansac2DObject.cpp b/example/homography/homographyRansac2DObject.cpp index 7e092a20e9b2805b0818b65435c2b8dbe18c4efc..1e85ca092a194d4cd5b181eaf6f13529b8ba5e16 100644 --- a/example/homography/homographyRansac2DObject.cpp +++ b/example/homography/homographyRansac2DObject.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: homographyRansac2DObject.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of the Ransac homography estimation algorithm. * @@ -57,19 +53,19 @@ */ -#include <visp/vpMath.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomography.h> -#include <visp/vpDebug.h> -#include <visp/vpThetaUVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpThetaUVector.h> -#include <visp/vpPoint.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpDebug.h> -#include <visp/vpRansac.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpRansac.h> +#include <visp3/io/vpParseArgv.h> #include <stdlib.h> // List of allowed command line options #define GETOPTARGS "h" @@ -155,8 +151,8 @@ main(int argc, const char ** argv) std::vector<vpPoint> P(nbpt); // Point to be tracked std::vector<double> xa(nbpt), ya(nbpt), xb(nbpt), yb(nbpt); - std::vector<vpPoint> aP(nbpt); // Point to be tracked - std::vector<vpPoint> bP(nbpt); // Point to be tracked + std::vector<vpPoint> aP(nbpt); // Point to be tracked + std::vector<vpPoint> bP(nbpt); // Point to be tracked P[0].setWorldCoordinates(-L,-L, 0 ) ; // inlier P[1].setWorldCoordinates(2*L,-L, 0 ) ; // inlier diff --git a/example/image/CMakeLists.txt b/example/image/CMakeLists.txt index b95ae4c55192ffb14b001af71a490f0573961ceb..53aa29d976ce0f2acfea8642a39c50b27730d7c5 100644 --- a/example/image/CMakeLists.txt +++ b/example/image/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,33 +35,23 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - imageDiskRW.cpp -) +project(example-image) + +cmake_minimum_required(VERSION 2.6) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) +find_package(VISP REQUIRED visp_core visp_io) - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +set(example_cpp + imageDiskRW.cpp +) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() -endforeach() -# Add test -# To run some of these tests don't forget to set VISP_INPUT_IMAGE_PATH -# environment variable to the ViSP test sequences location. -# To get these sequence download ViSP-images.tar.gz from -# http://www.irisa.fr/lagadic/visp/visp.html -add_test(imageDiskRW imageDiskRW) + # Add test + get_filename_component(target ${cpp} NAME_WE) + add_test(${target} ${target}) +endforeach() diff --git a/example/image/imageDiskRW.cpp b/example/image/imageDiskRW.cpp index 87db3f1ff27867f51d1b1b727c985ef3679ebe8b..5aaeb1f429d7b3fa1c06359e6496ca8694f7fe9e 100644 --- a/example/image/imageDiskRW.cpp +++ b/example/image/imageDiskRW.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: imageDiskRW.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Reading and writting images on the disk. * @@ -59,11 +55,11 @@ -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> #include <stdio.h> // List of allowed command line options diff --git a/example/key-point/CMakeLists.txt b/example/key-point/CMakeLists.txt index fc8b2d30a7e2d1782e86ea9c47e57f081315fb31..297f3ffa6a320d4bb8ed33d7ba5a4f4e01a7957a 100644 --- a/example/key-point/CMakeLists.txt +++ b/example/key-point/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,29 +35,22 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-keypoint) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_vision visp_sensor visp_io visp_gui) + +set(example_cpp keyPointSurf.cpp planarObjectDetector.cpp fernClassifier.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/key-point/fernClassifier.cpp b/example/key-point/fernClassifier.cpp index cf3cb619c42f5f81f1263f0f57eaf894cbd730c6..1023fcda39c4815ef42f0172cfb3308e848b8bc3 100644 --- a/example/key-point/fernClassifier.cpp +++ b/example/key-point/fernClassifier.cpp @@ -1,36 +1,32 @@ /**************************************************************************** - * - * $Id: fernClassifier.cpp 5023 2014-12-03 16:07:48Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.GPL at the root directory of this source + * See the file LICENSE.txt at the root directory of this source * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Detection of points of interests and matching using the Ferns classifier. * @@ -50,24 +46,24 @@ Detection of points of interests and matching using a Fern classifier. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #if ((defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI)) && (VISP_HAVE_OPENCV_VERSION >= 0x020000) && (VISP_HAVE_OPENCV_VERSION < 0x030000)) #include <iostream> #include <stdlib.h> -#include <visp/vpFernClassifier.h> -#include <visp/vpParseArgv.h> -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpHomography.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpTime.h> +#include <visp3/vision/vpFernClassifier.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpTime.h> #include <iomanip> #define GETOPTARGS "hlcdb:i:p" diff --git a/example/key-point/keyPointSurf.cpp b/example/key-point/keyPointSurf.cpp index 4eaacdbc343e34169c1d0d4cda1b3b1e4ab1317d..72f73c01578b93fa185f4ca01a9bc038207fa5ed 100644 --- a/example/key-point/keyPointSurf.cpp +++ b/example/key-point/keyPointSurf.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: keyPointSurf.cpp 5202 2015-01-24 09:29:06Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tracking of Surf key points. * @@ -53,25 +49,25 @@ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> #include <stdio.h> #include <sstream> #include <iomanip> #if ((defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_OPENCV_NONFREE) && (VISP_HAVE_OPENCV_VERSION < 0x030000)) -#include <visp/vpKeyPointSurf.h> +#include <visp3/vision/vpKeyPointSurf.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> // List of allowed command line options #define GETOPTARGS "cdi:h" diff --git a/example/key-point/planarObjectDetector.cpp b/example/key-point/planarObjectDetector.cpp index fbdfea1c425832f87c486fdfcd4bafea9f4317f1..009bc7d6c6f7aa84e950dd81d1fb9b92e1f2009a 100644 --- a/example/key-point/planarObjectDetector.cpp +++ b/example/key-point/planarObjectDetector.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: planarObjectDetector.cpp 5023 2014-12-03 16:07:48Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Detection of planar surface using Fern classifier. * @@ -50,27 +46,27 @@ Tracking of planar surface using Fern classifier. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #if ((defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI)) && (VISP_HAVE_OPENCV_VERSION >= 0x020000) && (VISP_HAVE_OPENCV_VERSION < 0x030000)) #include <iostream> #include <stdlib.h> -#include <visp/vpPlanarObjectDetector.h> -#include <visp/vpParseArgv.h> -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpHomography.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpTime.h> +#include <visp3/vision/vpPlanarObjectDetector.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpTime.h> #include <iomanip> -#include <visp/vpV4l2Grabber.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#include <visp3/sensor/vp1394TwoGrabber.h> #define GETOPTARGS "hlcdb:i:p" diff --git a/example/manual/CMakeLists.txt b/example/manual/CMakeLists.txt index 0e35823538508e98a082cf360b2269238cd25455..f50b75aefca57c068a0a03ee9cd0d33e83b426a1 100644 --- a/example/manual/CMakeLists.txt +++ b/example/manual/CMakeLists.txt @@ -1,75 +1,65 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP manual examples build. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - geometric-features/manGeometricFeatures.cpp - hello-world/CMake/HelloWorld.cpp - image-manipulation/manDisplay.cpp - image-manipulation/manGrab1394-2.cpp - image-manipulation/manGrabDirectShow.cpp - image-manipulation/manGrabDisk.cpp - image-manipulation/manGrabV4l2.cpp - ogre/HelloWorldOgre.cpp - ogre/HelloWorldOgreAdvanced.cpp - simulation/manServo4PointsDisplay.cpp - simulation/manSimu4Dots.cpp - simulation/manSimu4Points.cpp - moments/manServoMomentsSimple.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") - endif() -endforeach() +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP manual examples build. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +project(example-manual) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_sensor visp_vs visp_robot visp_ar visp_vision visp_io visp_gui) + +set(example_cpp + geometric-features/manGeometricFeatures.cpp + hello-world/CMake/HelloWorld.cpp + image-manipulation/manDisplay.cpp + image-manipulation/manGrab1394-2.cpp + image-manipulation/manGrabDirectShow.cpp + image-manipulation/manGrabDisk.cpp + image-manipulation/manGrabV4l2.cpp + ogre/HelloWorldOgre.cpp + ogre/HelloWorldOgreAdvanced.cpp + simulation/manServo4PointsDisplay.cpp + simulation/manSimu4Dots.cpp + simulation/manSimu4Points.cpp + moments/manServoMomentsSimple.cpp +) + +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") + endif() +endforeach() diff --git a/example/manual/geometric-features/manGeometricFeatures.cpp b/example/manual/geometric-features/manGeometricFeatures.cpp index c3b11bdca97d78219d0ab169f7baaea8fd7e0d75..e98a5334ff7e953b7527a92e97f97df858608336 100644 --- a/example/manual/geometric-features/manGeometricFeatures.cpp +++ b/example/manual/geometric-features/manGeometricFeatures.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: manGeometricFeatures.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Geometric features example. * @@ -53,24 +49,24 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpImageIo.h> +#include <visp3/core/vpDebug.h> +#include <visp3/io/vpImageIo.h> // For 2D image -#include <visp/vpImage.h> +#include <visp3/core/vpImage.h> // Video device interface -#include <visp/vpDisplay.h> -#include <visp/vpDisplayGTK.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayGTK.h> // For frame transformation and projection -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpCameraParameters.h> // Needed geometric features -#include <visp/vpPoint.h> -#include <visp/vpLine.h> -#include <visp/vpCylinder.h> -#include <visp/vpCircle.h> -#include <visp/vpSphere.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpLine.h> +#include <visp3/core/vpCylinder.h> +#include <visp3/core/vpCircle.h> +#include <visp3/core/vpSphere.h> #include <iostream> diff --git a/example/manual/hello-world/Autotools/HelloWorld.cpp b/example/manual/hello-world/Autotools/HelloWorld.cpp index 123a58283832d7a41b903a48559ab519679cf4af..09062b97e7db2d0559bbeea627a13b5c22181a97 100644 --- a/example/manual/hello-world/Autotools/HelloWorld.cpp +++ b/example/manual/hello-world/Autotools/HelloWorld.cpp @@ -1,8 +1,8 @@ #include <iostream> -#include <visp/vpDebug.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> int main() diff --git a/example/manual/hello-world/Autotools/have_visp.m4 b/example/manual/hello-world/Autotools/have_visp.m4 index 951eb3df63aa02ba5d18054d46aaaa9b7333e129..adf5d584986dc1a0363dcc00a60d6d25cdbdf280 100644 --- a/example/manual/hello-world/Autotools/have_visp.m4 +++ b/example/manual/hello-world/Autotools/have_visp.m4 @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: have_visp.m4 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/example/manual/hello-world/CMake/HelloWorld.cpp b/example/manual/hello-world/CMake/HelloWorld.cpp index 86acb033258a930e56f928db5984976f8623a737..c3e7b6d63591c246e328c124dd18972a711be6a3 100644 --- a/example/manual/hello-world/CMake/HelloWorld.cpp +++ b/example/manual/hello-world/CMake/HelloWorld.cpp @@ -1,7 +1,44 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Hello world example. + * + * Authors: + * Fabien Spindler + * + *****************************************************************************/ + #include <iostream> -#include <visp/vpMath.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpThetaUVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpThetaUVector.h> #include <limits> int main() diff --git a/example/manual/hello-world/Makefile/HelloWorld.cpp b/example/manual/hello-world/Makefile/HelloWorld.cpp index 123a58283832d7a41b903a48559ab519679cf4af..09062b97e7db2d0559bbeea627a13b5c22181a97 100644 --- a/example/manual/hello-world/Makefile/HelloWorld.cpp +++ b/example/manual/hello-world/Makefile/HelloWorld.cpp @@ -1,8 +1,8 @@ #include <iostream> -#include <visp/vpDebug.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> int main() diff --git a/example/manual/image-manipulation/manDisplay.cpp b/example/manual/image-manipulation/manDisplay.cpp index 9ee243951c78880ca34b77830c2007addca818d0..99c599a8f908a3b788f303124817bb3ff9d509fb 100644 --- a/example/manual/image-manipulation/manDisplay.cpp +++ b/example/manual/image-manipulation/manDisplay.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: manDisplay.cpp 5004 2014-11-24 08:24:18Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Display example. * @@ -47,11 +43,11 @@ */ -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpColor.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpColor.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/core/vpImagePoint.h> int main() { diff --git a/example/manual/image-manipulation/manGrab1394-2.cpp b/example/manual/image-manipulation/manGrab1394-2.cpp index 81d2ce56b30abaa381b4194fd78dd5268c5e7120..2a1df9cb8d6792b06819e45940ec7ef730c1545f 100644 --- a/example/manual/image-manipulation/manGrab1394-2.cpp +++ b/example/manual/image-manipulation/manGrab1394-2.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: manGrab1394-2.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Images grabbing example. * @@ -54,14 +50,14 @@ -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> #include <stdlib.h> #include <stdio.h> int main() { -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 try { unsigned int ncameras; // Number of cameras on the bus vp1394TwoGrabber g; diff --git a/example/manual/image-manipulation/manGrabDirectShow.cpp b/example/manual/image-manipulation/manGrabDirectShow.cpp index 43f925ca4750b7b5677de9c9092f4b11fef8d290..360a4291080a5f1bf20ff05d185570f8c4e9bac9 100644 --- a/example/manual/image-manipulation/manGrabDirectShow.cpp +++ b/example/manual/image-manipulation/manGrabDirectShow.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: manGrabDirectShow.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Images grabbing example. * @@ -52,10 +48,10 @@ */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpDirectShowGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vpDirectShowGrabber.h> int main() { diff --git a/example/manual/image-manipulation/manGrabDisk.cpp b/example/manual/image-manipulation/manGrabDisk.cpp index 6bafc461e00ec2bb325a2a943551c80ed706f845..03d1a2d10084e3a90baee615597762f7c2c55fd4 100644 --- a/example/manual/image-manipulation/manGrabDisk.cpp +++ b/example/manual/image-manipulation/manGrabDisk.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: manGrabDisk.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Images grabbing example. * @@ -52,10 +48,10 @@ */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpDiskGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpDiskGrabber.h> int main() { diff --git a/example/manual/image-manipulation/manGrabOpenCV.cpp b/example/manual/image-manipulation/manGrabOpenCV.cpp index c2928ac0410bc4da86f30787404c05b5cc530b11..9f6f6b15719da76002ead4d1902dfcffa3c6ade0 100644 --- a/example/manual/image-manipulation/manGrabOpenCV.cpp +++ b/example/manual/image-manipulation/manGrabOpenCV.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: manGrabOpenCV.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Images grabbing example. * @@ -44,9 +40,9 @@ \brief Images grabbing example with the vpOpenCVGrabber class. */ -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpOpenCVGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vpOpenCVGrabber.h> int main(){ vpImage<unsigned char> I; // Grey level image diff --git a/example/manual/image-manipulation/manGrabV4l2.cpp b/example/manual/image-manipulation/manGrabV4l2.cpp index 21910d57bd5dcd9a8c2efb16eef7b3346dbaf02a..27df423323823d40ca4c8caa5089d298431cdc11 100644 --- a/example/manual/image-manipulation/manGrabV4l2.cpp +++ b/example/manual/image-manipulation/manGrabV4l2.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: manGrabV4l2.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Images grabbing example. * @@ -52,8 +48,8 @@ */ -#include <visp/vpImage.h> -#include <visp/vpV4l2Grabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vpV4l2Grabber.h> int main() { diff --git a/example/manual/moments/manServoMomentsSimple.cpp b/example/manual/moments/manServoMomentsSimple.cpp index 6cebf4154a0ffd2af9c979a4462e8f4bb4cceaa8..b44f45e8ca9677b97285af28c16bb785a4912495 100644 --- a/example/manual/moments/manServoMomentsSimple.cpp +++ b/example/manual/moments/manServoMomentsSimple.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: servoMomentPolygon.cpp 3323 2011-09-13 15:23:56Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of visual servoing with moments using a polygon as object container * @@ -45,16 +41,16 @@ */ -#include <visp/vpPoint.h> //the basic tracker +#include <visp3/core/vpPoint.h> //the basic tracker #include <vector> //store the polygon -#include <visp/vpMomentObject.h> //transmit the polygon to the object -#include <visp/vpMomentCommon.h> //update the common database with the object -#include <visp/vpFeatureMomentCommon.h> //init the feature database using the information about moment dependencies -#include <visp/vpServo.h> //visual servoing task -#include <visp/vpRobotCamera.h> -#include <visp/vpPlane.h> -#include <visp/vpException.h> +#include <visp3/core/vpMomentObject.h> //transmit the polygon to the object +#include <visp3/core/vpMomentCommon.h> //update the common database with the object +#include <visp3/visual_features/vpFeatureMomentCommon.h> //init the feature database using the information about moment dependencies +#include <visp3/vs/vpServo.h> //visual servoing task +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/core/vpPlane.h> +#include <visp3/core/vpException.h> #include <limits> #include <iostream> //some console output //this function converts the plane defined by the cMo to 1/Z=Ax+By+C plane form @@ -90,14 +86,15 @@ int main() vpHomogeneousMatrix cMo(0.1,0.0,1.0,vpMath::rad(0),vpMath::rad(0),vpMath::rad(0)); vpHomogeneousMatrix cdMo(vpHomogeneousMatrix(0.0,0.0,1.0,vpMath::rad(0),vpMath::rad(0),-vpMath::rad(0))); + vpHomogeneousMatrix wMo; // Set to identity + vpHomogeneousMatrix wMc; // Camera position in the world frame cMoToABC(cMo,A,B,C); cMoToABC(cdMo,Ad,Bd,Cd); // Define source and destination polygons for (int i = 0 ; i < nbpoints ; i++){ - vpPoint p; - p.setWorldCoordinates(x[i],y[i],0.0); - p.track(cMo) ; + vpPoint p(x[i],y[i],0.0); + p.track(cMo); vec_p.push_back(p); p.track(cdMo) ; vec_p_d.push_back(p); @@ -142,18 +139,19 @@ int main() al->init(); al->error(*al); //param robot - vpRobotCamera robot ; + vpSimulatorCamera robot ; float sampling_time = 0.010f; // Sampling period in seconds robot.setSamplingTime(sampling_time); - robot.setPosition(cMo); + wMc = wMo * cMo.inverse(); + robot.setPosition(wMc); do{ - robot.getPosition(cMo); + wMc = robot.getPosition(); + cMo = wMc.inverse() * wMo; vec_p.clear(); for (int i = 0 ; i < nbpoints ; i++){ - vpPoint p; - p.setWorldCoordinates(x[i],y[i],0.0); + vpPoint p(x[i],y[i],0.0); p.track(cMo) ; vec_p.push_back(p); } diff --git a/example/manual/ogre/HelloWorldOgre.cpp b/example/manual/ogre/HelloWorldOgre.cpp index e9c91c8b7dd7433491f7e8320b51d69f6a6a3e74..17d83e7f77380f37181a3df5752785ded0c3e6e8 100644 --- a/example/manual/ogre/HelloWorldOgre.cpp +++ b/example/manual/ogre/HelloWorldOgre.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: HelloWorldOgre.cpp 5128 2015-01-06 11:46:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -46,19 +43,19 @@ #include <iostream> -#include <visp/vpOpenCVGrabber.h> -#include <visp/vpV4l2Grabber.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpAROgre.h> +#include <visp3/sensor/vpOpenCVGrabber.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/ar/vpAROgre.h> int main() { try { #if defined(VISP_HAVE_OGRE) -#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394_2) || (VISP_HAVE_OPENCV_VERSION >= 0x020100) +#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100) // Image to stock gathered data // Here we acquire a color image. The consequence will be that @@ -71,7 +68,7 @@ int main() vpV4l2Grabber grabber; grabber.open(I); grabber.acquire(I); -#elif defined(VISP_HAVE_DC1394_2) +#elif defined(VISP_HAVE_DC1394) // libdc1394-2 vp1394TwoGrabber grabber; grabber.open(I); @@ -133,7 +130,7 @@ int main() // Rendering loop, ended with on escape while(ogre.continueRendering()){ // Acquire a new image -#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) grabber.acquire(I); #elif defined(VISP_HAVE_OPENCV) grabber >> frame; diff --git a/example/manual/ogre/HelloWorldOgreAdvanced.cpp b/example/manual/ogre/HelloWorldOgreAdvanced.cpp index 1033351bcdcd9a653ecc6f0512f9f58076f1fcf4..8aae0da9d114d33036b3b0bda97353a5c11a3f8a 100644 --- a/example/manual/ogre/HelloWorldOgreAdvanced.cpp +++ b/example/manual/ogre/HelloWorldOgreAdvanced.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: HelloWorldOgreAdvanced.cpp 5128 2015-01-06 11:46:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -46,13 +43,13 @@ #include <iostream> -#include <visp/vpOpenCVGrabber.h> -#include <visp/vpV4l2Grabber.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpAROgre.h> +#include <visp3/sensor/vpOpenCVGrabber.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/ar/vpAROgre.h> #if defined(VISP_HAVE_OGRE) @@ -110,7 +107,7 @@ int main() { try { #if defined(VISP_HAVE_OGRE) -#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394_2) || (VISP_HAVE_OPENCV_VERSION >= 0x020100) +#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100) // Image to store gathered data // Here we acquire a grey level image. The consequence will be that @@ -127,7 +124,7 @@ int main() // the image size grabber.open(I); grabber.acquire(I); -#elif defined(VISP_HAVE_DC1394_2) +#elif defined(VISP_HAVE_DC1394) // libdc1394-2 vp1394TwoGrabber grabber; // Open frame grabber @@ -165,7 +162,7 @@ int main() // Rendering loop while(ogre.continueRendering()){ // Acquire a new image -#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) grabber.acquire(I); #elif defined(VISP_HAVE_OPENCV) grabber >> frame; diff --git a/example/manual/simulation/manServo4PointsDisplay.cpp b/example/manual/simulation/manServo4PointsDisplay.cpp index 9028c79bd3c1ce942808514ff87f041b43eb3dec..3813a43a48c6f71501721363fb130a191d6b6214 100755 --- a/example/manual/simulation/manServo4PointsDisplay.cpp +++ b/example/manual/simulation/manServo4PointsDisplay.cpp @@ -1,213 +1,225 @@ -/**************************************************************************** - * - * $Id: manServo4PointsDisplay.cpp 4574 2014-01-09 08:48:51Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Description: - * Simulation of a visual servoing with display. - * - * Authors: - * Eric Marchand - * Fabien Spindler - * - *****************************************************************************/ - -/*! - \file manServo4PointsDisplay.cpp - \brief Visual servoing experiment on 4 points with a display. -*/ - -/*! - \example manServo4PointsDisplay.cpp - Visual servoing experiment on 4 points with a display. -*/ - -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> - -#ifdef VISP_HAVE_GTK - -#include <visp/vpImage.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpTime.h> -#include <visp/vpImage.h> -#include <visp/vpImageConvert.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpPose.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpIoTools.h> - -int main() -{ - try { - ////////////////////////////////////////// - // sets the initial camera location - vpHomogeneousMatrix cMo(0.3,0.2,3, - vpMath::rad(0),vpMath::rad(0),vpMath::rad(40)) ; - - /////////////////////////////////// - // initialize the robot - vpRobotCamera robot ; - robot.setSamplingTime(0.04); // 40ms - robot.setPosition(cMo) ; - - //initialize the camera parameters - vpCameraParameters cam(800,800,240,180); - - //Image definition - unsigned int height = 360 ; - unsigned int width = 480 ; - vpImage<unsigned char> I(height,width); - - //Display initialization - vpDisplayGTK disp; - disp.init(I,100,100,"Simulation display"); - - //////////////////////////////////////// - // Desired visual features initialization - - // sets the points coordinates in the object frame (in meter) - vpPoint point[4] ; - point[0].setWorldCoordinates(-0.1,-0.1,0) ; - point[1].setWorldCoordinates(0.1,-0.1,0) ; - point[2].setWorldCoordinates(0.1,0.1,0) ; - point[3].setWorldCoordinates(-0.1,0.1,0) ; - - // sets the desired camera location - vpHomogeneousMatrix cMo_d(0,0,1,0,0,0) ; - - // computes the 3D point coordinates in the camera frame and its 2D coordinates - for (int i = 0 ; i < 4 ; i++) - point[i].project(cMo_d) ; - - // creates the associated features - vpFeaturePoint pd[4] ; - for (int i = 0 ; i < 4 ; i++) - vpFeatureBuilder::create(pd[i],point[i]) ; - - - /////////////////////////////////////// - // Current visual features initialization - - // computes the 3D point coordinates in the camera frame and its 2D coordinates - for (int i = 0 ; i < 4 ; i++) - point[i].project(cMo) ; - - // creates the associated features - vpFeaturePoint p[4] ; - for (int i = 0 ; i < 4 ; i++) - vpFeatureBuilder::create(p[i],point[i]) ; - - - ///////////////////////////////// - // Task defintion - vpServo task ; - // we want an eye-in-hand control law ; - task.setServo(vpServo::EYEINHAND_L_cVe_eJe) ; - task.setInteractionMatrixType(vpServo::DESIRED, vpServo::PSEUDO_INVERSE) ; - - // Set the position of the camera in the end-effector frame - vpHomogeneousMatrix cMe ; - vpVelocityTwistMatrix cVe(cMe) ; - task.set_cVe(cVe) ; - // Set the Jacobian (expressed in the end-effector frame) - vpMatrix eJe ; - robot.get_eJe(eJe) ; - task.set_eJe(eJe) ; - - // we want to see a point on a point - for (int i = 0 ; i < 4 ; i++) - task.addFeature(p[i],pd[i]) ; - // Set the gain - task.setLambda(1.0) ; - // Print the current information about the task - task.print(); - - - //////////////////////////////////////////////// - // The control loop - int k = 0; - while(k++ < 200){ - double t = vpTime::measureTimeMs(); - - // Display the image background - vpDisplay::display(I); - - // Update the current features - for (int i = 0 ; i < 4 ; i++) - { - point[i].project(cMo) ; - vpFeatureBuilder::create(p[i],point[i]) ; - } - - // Display the task features (current and desired) - vpServoDisplay::display(task,cam,I); - vpDisplay::flush(I); - - // Update the robot Jacobian - robot.get_eJe(eJe) ; - task.set_eJe(eJe) ; - - // Compute the control law - vpColVector v = task.computeControlLaw() ; - - // Send the computed velocity to the robot and compute the new robot position - robot.setVelocity(vpRobot::ARTICULAR_FRAME, v) ; - robot.getPosition(cMo) ; - - // Print the current information about the task - task.print(); - - // Wait 40 ms - vpTime::wait(t,40); - } - task.kill(); - return 0; - } - catch(vpException e) { - std::cout << "Catch an exception: " << e << std::endl; - return 1; - } -} - -#else -int -main() -{ vpTRACE("You should install GTK") ; - -} -#endif +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Simulation of a visual servoing with display. + * + * Authors: + * Eric Marchand + * Fabien Spindler + * + *****************************************************************************/ + +/*! + \file manServo4PointsDisplay.cpp + \brief Visual servoing experiment on 4 points with a display. +*/ + +/*! + \example manServo4PointsDisplay.cpp + Visual servoing experiment on 4 points with a display. +*/ + +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> + +#if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) + +#include <visp3/core/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpTime.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vision/vpPose.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/core/vpIoTools.h> + +int main() +{ + try { + ////////////////////////////////////////// + // sets the initial camera location + vpHomogeneousMatrix cMo(0.3,0.2,3, + vpMath::rad(0),vpMath::rad(0),vpMath::rad(40)) ; + vpHomogeneousMatrix wMo; // Set to identity + vpHomogeneousMatrix wMc; // Camera position in the world frame + + /////////////////////////////////// + // initialize the robot + vpSimulatorCamera robot ; + robot.setSamplingTime(0.04); // 40ms + wMc = wMo * cMo.inverse(); + robot.setPosition(wMc) ; + + //initialize the camera parameters + vpCameraParameters cam(800,800,240,180); + + //Image definition + unsigned int height = 360 ; + unsigned int width = 480 ; + vpImage<unsigned char> I(height,width); + + //Display initialization +#if defined(VISP_HAVE_X11) + vpDisplayX disp; +#elif defined(VISP_HAVE_GTK) + vpDisplayGTK disp; +#elif defined(VISP_HAVE_GDI) + vpDisplayGDI disp; +#elif defined(VISP_HAVE_OPENCV) + vpDisplayOpenCV disp; +#endif + disp.init(I,100,100,"Simulation display"); + + //////////////////////////////////////// + // Desired visual features initialization + + // sets the points coordinates in the object frame (in meter) + vpPoint point[4] ; + point[0].setWorldCoordinates(-0.1,-0.1,0) ; + point[1].setWorldCoordinates(0.1,-0.1,0) ; + point[2].setWorldCoordinates(0.1,0.1,0) ; + point[3].setWorldCoordinates(-0.1,0.1,0) ; + + // sets the desired camera location + vpHomogeneousMatrix cMo_d(0,0,1,0,0,0) ; + + // computes the 3D point coordinates in the camera frame and its 2D coordinates + for (int i = 0 ; i < 4 ; i++) + point[i].project(cMo_d) ; + + // creates the associated features + vpFeaturePoint pd[4] ; + for (int i = 0 ; i < 4 ; i++) + vpFeatureBuilder::create(pd[i],point[i]) ; + + + /////////////////////////////////////// + // Current visual features initialization + + // computes the 3D point coordinates in the camera frame and its 2D coordinates + for (int i = 0 ; i < 4 ; i++) + point[i].project(cMo) ; + + // creates the associated features + vpFeaturePoint p[4] ; + for (int i = 0 ; i < 4 ; i++) + vpFeatureBuilder::create(p[i],point[i]) ; + + + ///////////////////////////////// + // Task defintion + vpServo task ; + // we want an eye-in-hand control law ; + task.setServo(vpServo::EYEINHAND_L_cVe_eJe) ; + task.setInteractionMatrixType(vpServo::DESIRED, vpServo::PSEUDO_INVERSE) ; + + // Set the position of the camera in the end-effector frame + vpHomogeneousMatrix cMe ; + vpVelocityTwistMatrix cVe(cMe) ; + task.set_cVe(cVe) ; + // Set the Jacobian (expressed in the end-effector frame) + vpMatrix eJe ; + robot.get_eJe(eJe) ; + task.set_eJe(eJe) ; + + // we want to see a point on a point + for (int i = 0 ; i < 4 ; i++) + task.addFeature(p[i],pd[i]) ; + // Set the gain + task.setLambda(1.0) ; + // Print the current information about the task + task.print(); + + + //////////////////////////////////////////////// + // The control loop + int k = 0; + while(k++ < 200){ + double t = vpTime::measureTimeMs(); + + // Display the image background + vpDisplay::display(I); + + // Update the current features + for (int i = 0 ; i < 4 ; i++) + { + point[i].project(cMo) ; + vpFeatureBuilder::create(p[i],point[i]) ; + } + + // Display the task features (current and desired) + vpServoDisplay::display(task,cam,I); + vpDisplay::flush(I); + + // Update the robot Jacobian + robot.get_eJe(eJe) ; + task.set_eJe(eJe) ; + + // Compute the control law + vpColVector v = task.computeControlLaw() ; + + // Send the computed velocity to the robot and compute the new robot position + robot.setVelocity(vpRobot::ARTICULAR_FRAME, v); + wMc = robot.getPosition(); + cMo = wMc.inverse() * wMo; + + // Print the current information about the task + task.print(); + + // Wait 40 ms + vpTime::wait(t,40); + } + task.kill(); + return 0; + } + catch(vpException e) { + std::cout << "Catch an exception: " << e << std::endl; + return 1; + } +} + +#else +int +main() +{ vpTRACE("You should install GTK") ; + +} +#endif diff --git a/example/manual/simulation/manSimu4Dots.cpp b/example/manual/simulation/manSimu4Dots.cpp index e915971f142ed6b76cc8908b6e4d56000ce6e106..66ea177efc774054d1a534203c6daa9e48570c59 100755 --- a/example/manual/simulation/manSimu4Dots.cpp +++ b/example/manual/simulation/manSimu4Dots.cpp @@ -1,295 +1,302 @@ -/**************************************************************************** - * - * $Id: manSimu4Dots.cpp 4574 2014-01-09 08:48:51Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Description: - * Simulation of a visual servoing with visualization and image generation. - * - * Authors: - * Eric Marchand - * Fabien Spindler - * - *****************************************************************************/ - -/*! - \file manSimu4Dots.cpp - \brief Visual servoing experiment on 4 points with a visualization and image generation - from the camera and from an external view using vpSimulator. -*/ - -/*! - \example manSimu4Dots.cpp - Visual servoing experiment on 4 points with a visualization and image generation - from the camera and from an external view using vpSimulator. -*/ - -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> - - -#if (defined(VISP_HAVE_COIN_AND_GUI) && (defined(VISP_HAVE_GTK) || defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI))) - -#include <visp/vpImage.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpTime.h> -#include <visp/vpImage.h> -#include <visp/vpImageConvert.h> -#include <visp/vpSimulator.h> - -#if defined(VISP_HAVE_X11) -# include <visp/vpDisplayX.h> -#elif defined(VISP_HAVE_GDI) -# include <visp/vpDisplayGDI.h> -#elif defined(VISP_HAVE_GTK) -# include <visp/vpDisplayGTK.h> -#endif -// You may have strange compiler issues using the simulator based on SoQt -// and the vpDisplayGTK. In that case prefer to use another display like -// vpDisplayX under linux or vpDisplayGDI under Windows -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpPose.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpDot2.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpIoTools.h> - -static -void *mainLoop (void *_simu) -{ - // pointer copy of the vpSimulator instance - vpSimulator *simu = (vpSimulator *)_simu ; - - // Simulation initialization - simu->initMainApplication() ; - - /////////////////////////////////// - // Set the initial camera location - vpHomogeneousMatrix cMo(0.3,0.2,3, - vpMath::rad(0),vpMath::rad(0),vpMath::rad(40)); - - /////////////////////////////////// - // Initialize the robot - vpRobotCamera robot ; - robot.setSamplingTime(0.04); // 40ms - robot.setPosition(cMo) ; - // Send the robot position to the visualizator - simu->setCameraPosition(cMo) ; - // Initialize the camera parameters - vpCameraParameters cam ; - simu->getCameraParameters(cam); - - //////////////////////////////////////// - // Desired visual features initialization - - // sets the points coordinates in the object frame (in meter) - vpPoint point[4] ; - point[0].setWorldCoordinates(-0.1,-0.1,0) ; - point[1].setWorldCoordinates(0.1,-0.1,0) ; - point[2].setWorldCoordinates(0.1,0.1,0) ; - point[3].setWorldCoordinates(-0.1,0.1,0) ; - - // sets the desired camera location - vpHomogeneousMatrix cMo_d(0,0,1,0,0,0) ; - - // computes the 3D point coordinates in the camera frame and its 2D coordinates - for (int i = 0 ; i < 4 ; i++) - point[i].project(cMo_d) ; - - // creates the associated features - vpFeaturePoint pd[4] ; - for (int i = 0 ; i < 4 ; i++) - vpFeatureBuilder::create(pd[i],point[i]) ; - - - - /////////////////////////////////////// - // Current visual features initialization - unsigned int height = simu->getInternalHeight(); - unsigned int width = simu->getInternalWidth(); - - // Create a greyscale image - vpImage<unsigned char> I(height,width); - - //Display initialization -#if defined(VISP_HAVE_X11) - vpDisplayX disp; -#elif defined(VISP_HAVE_GDI) - vpDisplayGDI disp; -#elif defined(VISP_HAVE_GTK) - vpDisplayGTK disp; -#endif - disp.init(I,100,100,"Simulation display"); - // disp(I); - // Get the current image - vpTime::wait(500); // wait to be sure the image is generated - simu->getInternalImage(I); - - // Display the current image - vpDisplay::display(I); - vpDisplay::flush(I); - - // Initialize the four dots tracker - std::cout << "A click in the four dots clockwise. " << std::endl; - vpDot2 dot[4]; - vpFeaturePoint p[4]; - for (int i = 0 ; i < 4 ; i++) - { - dot[i].setGraphics(true); - // Call for a click - std::cout << "A click in the dot " << i << std::endl; - dot[i].initTracking(I); - // Create the associated feature - vpFeatureBuilder::create(p[i],cam,dot[i]); - // flush the display - vpDisplay::flush(I); - } - - - ///////////////////////////////// - // Task defintion - vpServo task ; - // we want an eye-in-hand control law ; - task.setServo(vpServo::EYEINHAND_L_cVe_eJe) ; - task.setInteractionMatrixType(vpServo::DESIRED) ; - - // Set the position of the camera in the end-effector frame - vpHomogeneousMatrix cMe ; - vpVelocityTwistMatrix cVe(cMe) ; - task.set_cVe(cVe) ; - // Set the Jacobian (expressed in the end-effector frame) - vpMatrix eJe ; - robot.get_eJe(eJe) ; - task.set_eJe(eJe) ; - - // we want to see a point on a point - for (int i = 0 ; i < 4 ; i++) - task.addFeature(p[i],pd[i]) ; - // Set the gain - task.setLambda(1.0) ; - // Print the current information about the task - task.print(); - - vpTime::wait(500); - - //////////////////////////////////////////////// - // The control loop - int k = 0; - while(k++ < 200){ - double t = vpTime::measureTimeMs(); - - // Get the current internal camera view and display it - simu->getInternalImage(I); - vpDisplay::display(I); - - // Track the four dots and update the associated visual features - for (int i = 0 ; i < 4 ; i++) - { - dot[i].track(I) ; - vpFeatureBuilder::create(p[i],cam,dot[i]) ; - } - - // Display the desired and current visual features - vpServoDisplay::display(task,cam,I) ; - vpDisplay::flush(I); - - // Update the robot Jacobian - robot.get_eJe(eJe) ; - task.set_eJe(eJe) ; - - // Compute the control law - vpColVector v = task.computeControlLaw() ; - - // Send the computed velocity to the robot and compute the new robot position - robot.setVelocity(vpRobot::ARTICULAR_FRAME, v) ; - robot.getPosition(cMo) ; - - // Send the robot position to the visualizator - simu->setCameraPosition(cMo) ; - - - // Wait 40 ms - vpTime::wait(t,40); - } - // Print information about the task - task.print(); - task.kill(); - simu->closeMainApplication() ; - - void *a=NULL ; - return a ; -} - - -int -main() -{ - try { - vpSimulator simu ; - - // Internal view initialization : view from the robot camera - simu.initInternalViewer(480, 360) ; - // External view initialization : view from an external camera - simu.initExternalViewer(300, 300) ; - - // Inernal camera paramters initialization - vpCameraParameters cam(800,800,240,180) ; - simu.setInternalCameraParameters(cam) ; - - vpTime::wait(500) ; - // Load the scene - std::cout << "Load : ./4Points.iv" << std::endl - << "This file should be in the working directory" << std::endl; - - simu.load("./4points.iv") ; - - // Run the main loop - simu.initApplication(&mainLoop) ; - // Run the simulator - simu.mainLoop() ; - return 0; - } - catch(vpException e) { - std::cout << "Catch an exception: " << e << std::endl; - return 1; - } -} - -#else -int -main() -{ vpTRACE("You should install Coin3D and SoQT or SoWin or SoXt") ; - -} -#endif +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Simulation of a visual servoing with visualization and image generation. + * + * Authors: + * Eric Marchand + * Fabien Spindler + * + *****************************************************************************/ + +/*! + \file manSimu4Dots.cpp + \brief Visual servoing experiment on 4 points with a visualization and image generation + from the camera and from an external view using vpSimulator. +*/ + +/*! + \example manSimu4Dots.cpp + Visual servoing experiment on 4 points with a visualization and image generation + from the camera and from an external view using vpSimulator. +*/ + +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> + + +#if (defined(VISP_HAVE_COIN3D_AND_GUI) && (defined(VISP_HAVE_GTK) || defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI))) + +#include <visp3/core/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpTime.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/ar/vpSimulator.h> + +#if defined(VISP_HAVE_X11) +# include <visp3/gui/vpDisplayX.h> +#elif defined(VISP_HAVE_GDI) +# include <visp3/gui/vpDisplayGDI.h> +#elif defined(VISP_HAVE_GTK) +# include <visp3/gui/vpDisplayGTK.h> +#endif +// You may have strange compiler issues using the simulator based on SoQt +// and the vpDisplayGTK. In that case prefer to use another display like +// vpDisplayX under linux or vpDisplayGDI under Windows +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vision/vpPose.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/core/vpIoTools.h> + +static +void *mainLoop (void *_simu) +{ + // pointer copy of the vpSimulator instance + vpSimulator *simu = (vpSimulator *)_simu ; + + // Simulation initialization + simu->initMainApplication() ; + + /////////////////////////////////// + // Set the initial camera location + vpHomogeneousMatrix cMo(0.3,0.2,3, + vpMath::rad(0),vpMath::rad(0),vpMath::rad(40)); + vpHomogeneousMatrix wMo; // Set to identity + vpHomogeneousMatrix wMc; // Camera position in the world frame + + /////////////////////////////////// + // Initialize the robot + vpSimulatorCamera robot ; + robot.setSamplingTime(0.04); // 40ms + wMc = wMo * cMo.inverse(); + robot.setPosition(wMc) ; + // Send the robot position to the visualizator + simu->setCameraPosition(cMo) ; + // Initialize the camera parameters + vpCameraParameters cam ; + simu->getCameraParameters(cam); + + //////////////////////////////////////// + // Desired visual features initialization + + // sets the points coordinates in the object frame (in meter) + vpPoint point[4] ; + point[0].setWorldCoordinates(-0.1,-0.1,0) ; + point[1].setWorldCoordinates(0.1,-0.1,0) ; + point[2].setWorldCoordinates(0.1,0.1,0) ; + point[3].setWorldCoordinates(-0.1,0.1,0) ; + + // sets the desired camera location + vpHomogeneousMatrix cMo_d(0,0,1,0,0,0) ; + + // computes the 3D point coordinates in the camera frame and its 2D coordinates + for (int i = 0 ; i < 4 ; i++) + point[i].project(cMo_d) ; + + // creates the associated features + vpFeaturePoint pd[4] ; + for (int i = 0 ; i < 4 ; i++) + vpFeatureBuilder::create(pd[i],point[i]) ; + + /////////////////////////////////////// + // Current visual features initialization + unsigned int height = simu->getInternalHeight(); + unsigned int width = simu->getInternalWidth(); + + // Create a greyscale image + vpImage<unsigned char> I(height,width); + + //Display initialization +#if defined(VISP_HAVE_X11) + vpDisplayX disp; +#elif defined(VISP_HAVE_GDI) + vpDisplayGDI disp; +#elif defined(VISP_HAVE_GTK) + vpDisplayGTK disp; +#endif + disp.init(I,100,100,"Simulation display"); + // disp(I); + // Get the current image + vpTime::wait(500); // wait to be sure the image is generated + simu->getInternalImage(I); + + // Display the current image + vpDisplay::display(I); + vpDisplay::flush(I); + + // Initialize the four dots tracker + std::cout << "A click in the four dots clockwise. " << std::endl; + vpDot2 dot[4]; + vpFeaturePoint p[4]; + for (int i = 0 ; i < 4 ; i++) + { + dot[i].setGraphics(true); + // Call for a click + std::cout << "A click in the dot " << i << std::endl; + dot[i].initTracking(I); + // Create the associated feature + vpFeatureBuilder::create(p[i],cam,dot[i]); + // flush the display + vpDisplay::flush(I); + } + + + ///////////////////////////////// + // Task defintion + vpServo task ; + // we want an eye-in-hand control law ; + task.setServo(vpServo::EYEINHAND_L_cVe_eJe) ; + task.setInteractionMatrixType(vpServo::DESIRED) ; + + // Set the position of the camera in the end-effector frame + vpHomogeneousMatrix cMe ; + vpVelocityTwistMatrix cVe(cMe) ; + task.set_cVe(cVe) ; + // Set the Jacobian (expressed in the end-effector frame) + vpMatrix eJe ; + robot.get_eJe(eJe) ; + task.set_eJe(eJe) ; + + // we want to see a point on a point + for (int i = 0 ; i < 4 ; i++) + task.addFeature(p[i],pd[i]) ; + // Set the gain + task.setLambda(1.0) ; + // Print the current information about the task + task.print(); + + vpTime::wait(500); + + //////////////////////////////////////////////// + // The control loop + int k = 0; + while(k++ < 200){ + double t = vpTime::measureTimeMs(); + + // Get the current internal camera view and display it + simu->getInternalImage(I); + vpDisplay::display(I); + + // Track the four dots and update the associated visual features + for (int i = 0 ; i < 4 ; i++) + { + dot[i].track(I) ; + vpFeatureBuilder::create(p[i],cam,dot[i]) ; + } + + // Display the desired and current visual features + vpServoDisplay::display(task,cam,I) ; + vpDisplay::flush(I); + + // Update the robot Jacobian + robot.get_eJe(eJe) ; + task.set_eJe(eJe) ; + + // Compute the control law + vpColVector v = task.computeControlLaw() ; + + // Send the computed velocity to the robot and compute the new robot position + robot.setVelocity(vpRobot::ARTICULAR_FRAME, v); + wMc = robot.getPosition(); + cMo = wMc.inverse() * wMo; + + // Send the robot position to the visualizator + simu->setCameraPosition(cMo) ; + + // Wait 40 ms + vpTime::wait(t,40); + } + // Print information about the task + task.print(); + task.kill(); + simu->closeMainApplication() ; + + void *a=NULL ; + return a ; +} + + +int +main() +{ + try { + vpSimulator simu ; + + // Internal view initialization : view from the robot camera + simu.initInternalViewer(480, 360) ; + // External view initialization : view from an external camera + simu.initExternalViewer(300, 300) ; + + // Inernal camera paramters initialization + vpCameraParameters cam(800,800,240,180) ; + simu.setInternalCameraParameters(cam) ; + + vpTime::wait(500) ; + // Load the scene + + // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value + std::string ipath = vpIoTools::getViSPImagesDataPath(); + std::string filename = "./4points.iv"; + + // Set the default input path + if (! ipath.empty()) + filename = vpIoTools::createFilePath(ipath, "ViSP-images/iv/4points.iv"); + + std::cout << "Load : " << filename << std::endl + << "This file should be in the working directory" << std::endl; + + simu.load(filename.c_str()); + + // Run the main loop + simu.initApplication(&mainLoop) ; + // Run the simulator + simu.mainLoop() ; + return 0; + } + catch(vpException e) { + std::cout << "Catch an exception: " << e << std::endl; + return 1; + } +} + +#else +int +main() +{ vpTRACE("You should install Coin3D and SoQT or SoWin or SoXt") ; + +} +#endif diff --git a/example/manual/simulation/manSimu4Points.cpp b/example/manual/simulation/manSimu4Points.cpp index 4335ef8e7bf5fa92e82dfa314c0f57314297f3f3..01842b19880212e8810e7566316fab879ccf3012 100755 --- a/example/manual/simulation/manSimu4Points.cpp +++ b/example/manual/simulation/manSimu4Points.cpp @@ -1,246 +1,252 @@ -/**************************************************************************** - * - * $Id: manSimu4Points.cpp 4574 2014-01-09 08:48:51Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Description: - * Simulation of a visual servoing with visualization. - * - * Authors: - * Eric Marchand - * Fabien Spindler - * - *****************************************************************************/ - -/*! - \file manSimu4Points.cpp - \brief Visual servoing experiment on 4 points with a visualization - from the camera and from an external view using vpSimulator. -*/ - -/*! - \example manSimu4Points.cpp - Visual servoing experiment on 4 points with a visualization - from the camera and from an external view using vpSimulator. -*/ - -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> - - -#if (defined(VISP_HAVE_COIN_AND_GUI)) - -#include <visp/vpImage.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpTime.h> -#include <visp/vpSimulator.h> - - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpServo.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> - -static -void *mainLoop (void *_simu) -{ - // pointer copy of the vpSimulator instance - vpSimulator *simu = (vpSimulator *)_simu ; - - // Simulation initialization - simu->initMainApplication() ; - - - ///////////////////////////////////////// - // sets the initial camera location - vpHomogeneousMatrix cMo(-0.3,-0.2,3, - vpMath::rad(0),vpMath::rad(0),vpMath::rad(40)) ; - - /////////////////////////////////// - // Initialize the robot - vpRobotCamera robot ; - robot.setSamplingTime(0.04); // 40ms - robot.setPosition(cMo) ; - // Send the robot position to the visualizator - simu->setCameraPosition(cMo) ; - // Initialize the camera parameters - vpCameraParameters cam ; - simu->getCameraParameters(cam); - - //////////////////////////////////////// - // Desired visual features initialization - - // sets the points coordinates in the object frame (in meter) - vpPoint point[4] ; - point[0].setWorldCoordinates(-0.1,-0.1,0) ; - point[1].setWorldCoordinates(0.1,-0.1,0) ; - point[2].setWorldCoordinates(0.1,0.1,0) ; - point[3].setWorldCoordinates(-0.1,0.1,0) ; - - // sets the desired camera location - vpHomogeneousMatrix cMo_d(0,0,1,0,0,0) ; - - // computes the 3D point coordinates in the camera frame and its 2D coordinates - for (int i = 0 ; i < 4 ; i++) - point[i].project(cMo_d) ; - - // creates the associated features - vpFeaturePoint pd[4] ; - for (int i = 0 ; i < 4 ; i++) - vpFeatureBuilder::create(pd[i],point[i]) ; - - - - /////////////////////////////////////// - // Current visual features initialization - - // computes the 3D point coordinates in the camera frame and its 2D coordinates - for (int i = 0 ; i < 4 ; i++) - point[i].project(cMo) ; - - // creates the associated features - vpFeaturePoint p[4] ; - for (int i = 0 ; i < 4 ; i++) - vpFeatureBuilder::create(p[i],point[i]) ; - - - ///////////////////////////////// - // Task defintion - vpServo task ; - // we want an eye-in-hand control law ; - task.setServo(vpServo::EYEINHAND_L_cVe_eJe) ; - task.setInteractionMatrixType(vpServo::DESIRED,vpServo::PSEUDO_INVERSE) ; - - // Set the position of the camera in the end-effector frame - vpHomogeneousMatrix cMe ; - vpVelocityTwistMatrix cVe(cMe) ; - task.set_cVe(cVe) ; - // Set the Jacobian (expressed in the end-effector frame) - vpMatrix eJe ; - robot.get_eJe(eJe) ; - task.set_eJe(eJe) ; - - // we want to see a point on a point - for (int i = 0 ; i < 4 ; i++) - task.addFeature(p[i],pd[i]) ; - // Set the gain - task.setLambda(1.0) ; - // Print the current information about the task - task.print(); - - vpTime::wait(500); - //////////////////////////////////////////////// - // The control loop - int k = 0; - while(k++ < 200){ - double t = vpTime::measureTimeMs(); - - - // Update the current features - for (int i = 0 ; i < 4 ; i++) - { - point[i].project(cMo) ; - vpFeatureBuilder::create(p[i],point[i]) ; - } - - // Update the robot Jacobian - robot.get_eJe(eJe) ; - task.set_eJe(eJe) ; - - // Compute the control law - vpColVector v = task.computeControlLaw() ; - - // Send the computed velocity to the robot and compute the new robot position - robot.setVelocity(vpRobot::ARTICULAR_FRAME, v) ; - robot.getPosition(cMo) ; - - // Send the robot position to the visualizator - simu->setCameraPosition(cMo) ; - - // Print the current information about the task - task.print(); - - // Wait 40 ms - vpTime::wait(t,40); - } - task.kill(); - simu->closeMainApplication() ; - - - void *a=NULL ; - return a ; - // return (void *); -} - - -int -main() -{ - try { - vpSimulator simu ; - - // Internal view initialization : view from the robot camera - simu.initInternalViewer(480, 360) ; - // External view initialization : view from an external camera - simu.initExternalViewer(300, 300) ; - - // Inernal camera paramters initialization - vpCameraParameters cam(800,800,240,180) ; - simu.setInternalCameraParameters(cam) ; - - vpTime::wait(1000) ; - // Load the scene - std::cout << "Load : ./4Points.iv" << std::endl - << "This file should be in the working directory" << std::endl; - simu.load("./4points.iv") ; - - // Run the main loop - simu.initApplication(&mainLoop) ; - // Run the simulator - simu.mainLoop() ; - return 0; - } - catch(vpException e) { - std::cout << "Catch an exception: " << e << std::endl; - return 1; - } -} - -#else -int -main() -{ - vpTRACE("You should install Coin3D and/or GTK") ; -} -#endif +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Simulation of a visual servoing with visualization. + * + * Authors: + * Eric Marchand + * Fabien Spindler + * + *****************************************************************************/ + +/*! + \file manSimu4Points.cpp + \brief Visual servoing experiment on 4 points with a visualization + from the camera and from an external view using vpSimulator. +*/ + +/*! + \example manSimu4Points.cpp + Visual servoing experiment on 4 points with a visualization + from the camera and from an external view using vpSimulator. +*/ + +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> + + +#if (defined(VISP_HAVE_COIN3D_AND_GUI)) + +#include <visp3/core/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpTime.h> +#include <visp3/ar/vpSimulator.h> + + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> + +static +void *mainLoop (void *_simu) +{ + // pointer copy of the vpSimulator instance + vpSimulator *simu = (vpSimulator *)_simu ; + + // Simulation initialization + simu->initMainApplication() ; + + ///////////////////////////////////////// + // sets the initial camera location + vpHomogeneousMatrix cMo(-0.3,-0.2,3, + vpMath::rad(0),vpMath::rad(0),vpMath::rad(40)) ; + vpHomogeneousMatrix wMo; // Set to identity + vpHomogeneousMatrix wMc; // Camera position in the world frame + + /////////////////////////////////// + // Initialize the robot + vpSimulatorCamera robot ; + robot.setSamplingTime(0.04); // 40ms + wMc = wMo * cMo.inverse(); + robot.setPosition(wMc) ; + // Send the robot position to the visualizator + simu->setCameraPosition(cMo) ; + // Initialize the camera parameters + vpCameraParameters cam ; + simu->getCameraParameters(cam); + + //////////////////////////////////////// + // Desired visual features initialization + + // sets the points coordinates in the object frame (in meter) + vpPoint point[4] ; + point[0].setWorldCoordinates(-0.1,-0.1,0) ; + point[1].setWorldCoordinates(0.1,-0.1,0) ; + point[2].setWorldCoordinates(0.1,0.1,0) ; + point[3].setWorldCoordinates(-0.1,0.1,0) ; + + // sets the desired camera location + vpHomogeneousMatrix cMo_d(0,0,1,0,0,0) ; + + // computes the 3D point coordinates in the camera frame and its 2D coordinates + for (int i = 0 ; i < 4 ; i++) + point[i].project(cMo_d) ; + + // creates the associated features + vpFeaturePoint pd[4] ; + for (int i = 0 ; i < 4 ; i++) + vpFeatureBuilder::create(pd[i],point[i]) ; + + /////////////////////////////////////// + // Current visual features initialization + + // computes the 3D point coordinates in the camera frame and its 2D coordinates + for (int i = 0 ; i < 4 ; i++) + point[i].project(cMo) ; + + // creates the associated features + vpFeaturePoint p[4] ; + for (int i = 0 ; i < 4 ; i++) + vpFeatureBuilder::create(p[i],point[i]) ; + + + ///////////////////////////////// + // Task defintion + vpServo task ; + // we want an eye-in-hand control law ; + task.setServo(vpServo::EYEINHAND_L_cVe_eJe) ; + task.setInteractionMatrixType(vpServo::DESIRED,vpServo::PSEUDO_INVERSE) ; + + // Set the position of the camera in the end-effector frame + vpHomogeneousMatrix cMe ; + vpVelocityTwistMatrix cVe(cMe) ; + task.set_cVe(cVe) ; + // Set the Jacobian (expressed in the end-effector frame) + vpMatrix eJe ; + robot.get_eJe(eJe) ; + task.set_eJe(eJe) ; + + // we want to see a point on a point + for (int i = 0 ; i < 4 ; i++) + task.addFeature(p[i],pd[i]) ; + // Set the gain + task.setLambda(1.0) ; + // Print the current information about the task + task.print(); + + vpTime::wait(500); + //////////////////////////////////////////////// + // The control loop + int k = 0; + while(k++ < 200){ + double t = vpTime::measureTimeMs(); + + + // Update the current features + for (int i = 0 ; i < 4 ; i++) + { + point[i].project(cMo) ; + vpFeatureBuilder::create(p[i],point[i]) ; + } + + // Update the robot Jacobian + robot.get_eJe(eJe) ; + task.set_eJe(eJe) ; + + // Compute the control law + vpColVector v = task.computeControlLaw() ; + + // Send the computed velocity to the robot and compute the new robot position + robot.setVelocity(vpRobot::ARTICULAR_FRAME, v) ; + wMc = robot.getPosition(); + cMo = wMc.inverse() * wMo; + + // Send the robot position to the visualizator + simu->setCameraPosition(cMo) ; + + // Print the current information about the task + task.print(); + + // Wait 40 ms + vpTime::wait(t,40); + } + task.kill(); + simu->closeMainApplication() ; + + + void *a=NULL ; + return a ; + // return (void *); +} + + +int +main() +{ + try { + vpSimulator simu ; + + // Internal view initialization : view from the robot camera + simu.initInternalViewer(480, 360) ; + // External view initialization : view from an external camera + simu.initExternalViewer(300, 300) ; + + // Inernal camera paramters initialization + vpCameraParameters cam(800,800,240,180) ; + simu.setInternalCameraParameters(cam) ; + + vpTime::wait(1000) ; + // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value + std::string ipath = vpIoTools::getViSPImagesDataPath(); + std::string filename = "./4points.iv"; + + // Set the default input path + if (! ipath.empty()) + filename = vpIoTools::createFilePath(ipath, "ViSP-images/iv/4points.iv"); + + std::cout << "Load : " << filename << std::endl + << "This file should be in the working directory" << std::endl; + + simu.load(filename.c_str()); + + // Run the main loop + simu.initApplication(&mainLoop) ; + // Run the simulator + simu.mainLoop() ; + return 0; + } + catch(vpException e) { + std::cout << "Catch an exception: " << e << std::endl; + return 1; + } +} + +#else +int +main() +{ + vpTRACE("You should install Coin3D and/or GTK") ; +} +#endif diff --git a/example/math/BSpline.cpp b/example/math/BSpline.cpp index 00379d2f30c0f1dee068ca854669c13e5a8a48b7..13e388f04b3b93c72a409d337a689735581c32eb 100644 --- a/example/math/BSpline.cpp +++ b/example/math/BSpline.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: BSpline.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exemple of a B-Spline curve. * @@ -52,21 +48,24 @@ -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> -#include <visp/vpBSpline.h> +#include <visp3/core/vpBSpline.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayX.h> // Should be after #include <visp/vpDisplayOpenCV.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpDisplay.h> +#ifdef VISP_HAVE_MODULE_GUI +# include <visp3/gui/vpDisplayGTK.h> +# include <visp3/gui/vpDisplayGDI.h> +# include <visp3/gui/vpDisplayOpenCV.h> +# include <visp3/gui/vpDisplayD3D.h> +# include <visp3/gui/vpDisplayX.h> // Should be after #include <visp3/gui/vpDisplayOpenCV.h> +#endif -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> #include <cstdlib> #include <stdlib.h> @@ -171,6 +170,8 @@ main(int argc, const char ** argv) vpImage<unsigned char> I(540,480); // We open a window using either X11, GTK or GDI. + +#ifdef VISP_HAVE_MODULE_GUI #if defined VISP_HAVE_X11 vpDisplayX display; #elif defined VISP_HAVE_GTK @@ -189,6 +190,7 @@ main(int argc, const char ** argv) vpDisplay::display(I) ; vpDisplay::flush(I) ; } +#endif vpBSpline bSpline; std::list<double> knots; diff --git a/example/math/CMakeLists.txt b/example/math/CMakeLists.txt index d64b3e348f1f7cd6335fcd09218462249dadffb4..bddbbd90fe6f0a138e05d56fed5e8097f2ef279e 100644 --- a/example/math/CMakeLists.txt +++ b/example/math/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,32 +35,24 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-math) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_io) + +set(example_cpp exponentialMap.cpp BSpline.cpp - Nurbs.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") + endif() # Add test - add_test(${binary} ${binary} -c ${OPTION_TO_DESACTIVE_DISPLAY}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") - endif() + get_filename_component(target ${cpp} NAME_WE) + add_test(${target} ${target} -c ${OPTION_TO_DESACTIVE_DISPLAY}) endforeach() - diff --git a/example/math/exponentialMap.cpp b/example/math/exponentialMap.cpp index 2e627bc83e2e0dec2273a1f43b28bc4230784583..b7e92891a8bd665981d3eedcf82e9be0d3697a1e 100644 --- a/example/math/exponentialMap.cpp +++ b/example/math/exponentialMap.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: exponentialMap.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test some vpColVector functionalities. * @@ -46,13 +42,13 @@ */ -#include <visp/vpTranslationVector.h> -#include <visp/vpRotationVector.h> -#include <visp/vpThetaUVector.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpColVector.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpExponentialMap.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRotationVector.h> +#include <visp3/core/vpThetaUVector.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpExponentialMap.h> int diff --git a/example/moments/image/CMakeLists.txt b/example/moments/image/CMakeLists.txt index 046dc9c442df6311d99092b39c7e5381d6e55ff1..df5053c8a5e6c8afba021beaac8ec5024ea61e63 100644 --- a/example/moments/image/CMakeLists.txt +++ b/example/moments/image/CMakeLists.txt @@ -1,9 +1,7 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. +# See http://visp.inria.fr for more information. # # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr +# Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -38,26 +35,19 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - servoMomentImage.cpp -) +project(example-moments-image) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) +cmake_minimum_required(VERSION 2.6) - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +find_package(VISP REQUIRED visp_core visp_vs visp_robot visp_gui) + +set(example_cpp + servoMomentImage.cpp +) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/moments/image/servoMomentImage.cpp b/example/moments/image/servoMomentImage.cpp index e6577d66fdbae4a4497c57d989ce126c9c23157a..0208b4f08f9ca0436af0da0298abbcdc1e342d1b 100644 --- a/example/moments/image/servoMomentImage.cpp +++ b/example/moments/image/servoMomentImage.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: servoMomentImage.cpp 4670 2014-02-17 08:59:05Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of visual servoing with moments using an image as object * container @@ -47,31 +43,31 @@ #define PRINT_CONDITION_NUMBER -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <iostream> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentDatabase.h> -#include <visp/vpMomentCommon.h> -#include <visp/vpFeatureMomentCommon.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpServo.h> -#include <visp/vpDebug.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpImageSimulator.h> -#include <visp/vpPlane.h> -#include <visp/vpPoseVector.h> -#include <visp/vpPlot.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpMomentCommon.h> +#include <visp3/visual_features/vpFeatureMomentCommon.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vs/vpServo.h> +#include <visp3/core/vpDebug.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/robot/vpImageSimulator.h> +#include <visp3/core/vpPlane.h> +#include <visp3/core/vpPoseVector.h> +#include <visp3/gui/vpPlot.h> #if !defined(_WIN32) && !defined(VISP_HAVE_PTHREAD) // Robot simulator used in this example is not available @@ -146,7 +142,7 @@ vpDisplayGTK displayInt; vpHomogeneousMatrix cMo; vpHomogeneousMatrix cdMo; -vpRobotCamera robot;//robot used in this simulation +vpSimulatorCamera robot;//robot used in this simulation vpImage<vpRGBa> Iint(480,640, 0);//internal image used for interface display vpServo task; //servoing task vpCameraParameters cam;//robot camera parameters @@ -303,7 +299,11 @@ void execute(unsigned int nbIter){ vpDisplay::flush(Iint); unsigned int iter=0; double t=0; - robot.setPosition(cMo); + + vpHomogeneousMatrix wMo; // Set to identity + vpHomogeneousMatrix wMc; // Camera position in the world frame + wMc = wMo * cMo.inverse(); + robot.setPosition(wMc); float sampling_time = 0.010f; // Sampling period in seconds robot.setSamplingTime(sampling_time); @@ -317,7 +317,8 @@ void execute(unsigned int nbIter){ vpColVector v ; t = vpTime::measureTimeMs(); //get the cMo - robot.getPosition(cMo); + wMc = robot.getPosition(); + cMo = wMc.inverse() * wMo; currentpose.buildFrom(cMo); // For plot //setup the plane in A,B,C style vpPlane pl; @@ -349,19 +350,19 @@ void execute(unsigned int nbIter){ //robot.setPosition(vpRobot::CAMERA_FRAME,0.01*v); err_features = task.error; - std::cout<<" || s - s* || = "<<task.error.sumSquare()<<std::endl; + std::cout<<" || s - s* || = "<<task.error.sumSquare()<<std::endl; robot.setVelocity(vpRobot::CAMERA_FRAME, v) ; vpTime::wait(t, sampling_time * 1000); // Wait 10 ms ViSP_plot.plot(0,iter, v); - ViSP_plot.plot(1,iter,currentpose); // Plot the velocities - ViSP_plot.plot(2, iter,err_features); //cMo as translations and theta_u + ViSP_plot.plot(1,iter,currentpose); // Plot the velocities + ViSP_plot.plot(2, iter,err_features); //cMo as translations and theta_u - _error = ( task.getError() ).sumSquare(); + _error = ( task.getError() ).sumSquare(); - #if defined(PRINT_CONDITION_NUMBER) - /* +#if defined(PRINT_CONDITION_NUMBER) + /* * Condition number of interaction matrix */ vpMatrix Linteraction = task.L; diff --git a/example/moments/points/CMakeLists.txt b/example/moments/points/CMakeLists.txt index e80fdb28bb9342328f46e07ea97b14d545250b2c..2fa569ed3890c935125687a18410cc6af299d93d 100644 --- a/example/moments/points/CMakeLists.txt +++ b/example/moments/points/CMakeLists.txt @@ -1,9 +1,7 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. +# See http://visp.inria.fr for more information. # # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr +# Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -38,26 +35,19 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - servoMomentPoints.cpp -) +project(example-moments-points) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) +cmake_minimum_required(VERSION 2.6) - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +find_package(VISP REQUIRED visp_core visp_vs visp_robot visp_gui) + +set(example_cpp + servoMomentPoints.cpp +) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/moments/points/servoMomentPoints.cpp b/example/moments/points/servoMomentPoints.cpp index b5e2bedd65bf6baeb28fd1eff274cd3fe2f40e04..a7fe1d08f57c3790f67d0d6bf0498df1567fc845 100644 --- a/example/moments/points/servoMomentPoints.cpp +++ b/example/moments/points/servoMomentPoints.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: servoMomentPoints.cpp 4673 2014-02-17 09:06:49Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of visual servoing with moments using discrete points as object * container @@ -45,27 +41,27 @@ Example of moment-based visual servoing with Images */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <iostream> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentDatabase.h> -#include <visp/vpMomentCommon.h> -#include <visp/vpFeatureMomentCommon.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpServo.h> -#include <visp/vpDebug.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpSimulatorAfma6.h> -#include <visp/vpPlane.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpMomentCommon.h> +#include <visp3/visual_features/vpFeatureMomentCommon.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vs/vpServo.h> +#include <visp3/core/vpDebug.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/robot/vpSimulatorAfma6.h> +#include <visp3/core/vpPlane.h> #if !defined(_WIN32) && !defined(VISP_HAVE_PTHREAD) @@ -165,8 +161,7 @@ void initScene(){ int nbpoints = 8; for (int i = 0 ; i < nbpoints ; i++){ - vpPoint p; - p.setWorldCoordinates(x[i]/20,y[i]/20,0.0); + vpPoint p(x[i]/20,y[i]/20,0.0); p.track(cMo) ; src_pts.push_back(p); } @@ -174,8 +169,7 @@ void initScene(){ src.setType(vpMomentObject::DISCRETE); src.fromVector(src_pts); for (int i = 0 ; i < nbpoints ; i++){ - vpPoint p; - p.setWorldCoordinates(x[i]/20,y[i]/20,0.0); + vpPoint p(x[i]/20,y[i]/20,0.0); p.track(cdMo) ; dst_pts.push_back(p); } @@ -239,8 +233,7 @@ void refreshScene(vpMomentObject &obj){ std::vector<vpPoint> cur_pts; for (int i = 0 ; i < nbpoints ; i++){ - vpPoint p; - p.setWorldCoordinates(x[i]/20,y[i]/20,0.0); + vpPoint p(x[i]/20,y[i]/20,0.0); p.track(cMo) ; cur_pts.push_back(p); } diff --git a/example/moments/polygon/CMakeLists.txt b/example/moments/polygon/CMakeLists.txt index 6b54b33e840ef373af122162e32ff54fc520a187..e2303a62b435b858ef95337ae3cadd309c4c5e39 100644 --- a/example/moments/polygon/CMakeLists.txt +++ b/example/moments/polygon/CMakeLists.txt @@ -1,9 +1,7 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. # # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. +# See http://visp.inria.fr for more information. # # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr +# Inria at visp@inria.fr # # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -38,26 +35,19 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - servoMomentPolygon.cpp -) +project(example-moments-polygon) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) +cmake_minimum_required(VERSION 2.6) - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +find_package(VISP REQUIRED visp_core visp_vs visp_robot visp_gui) + +set(example_cpp + servoMomentPolygon.cpp +) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/moments/polygon/servoMomentPolygon.cpp b/example/moments/polygon/servoMomentPolygon.cpp index 87cdedeb98b5da4ed706911fc92b39e4b84569ed..78e367183cd18ee26c61ad57cb4dcfdc9c88f0cf 100644 --- a/example/moments/polygon/servoMomentPolygon.cpp +++ b/example/moments/polygon/servoMomentPolygon.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: servoMomentPolygon.cpp 4670 2014-02-17 08:59:05Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of visual servoing with moments using a polygon as object container * @@ -44,27 +40,27 @@ Example of moment-based visual servoing with Images */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <iostream> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentDatabase.h> -#include <visp/vpMomentCommon.h> -#include <visp/vpFeatureMomentCommon.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpServo.h> -#include <visp/vpDebug.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpSimulatorAfma6.h> -#include <visp/vpPlane.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpMomentCommon.h> +#include <visp3/visual_features/vpFeatureMomentCommon.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vs/vpServo.h> +#include <visp3/core/vpDebug.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/robot/vpSimulatorAfma6.h> +#include <visp3/core/vpPlane.h> #if !defined(_WIN32) && !defined(VISP_HAVE_PTHREAD) // Robot simulator used in this example is not available @@ -164,8 +160,7 @@ void initScene(){ int nbpoints = 4; for (int i = 0 ; i < nbpoints ; i++){ - vpPoint p; - p.setWorldCoordinates(x[i],y[i],0.0); + vpPoint p(x[i],y[i],0.0); p.track(cMo) ; src_pts.push_back(p); } @@ -173,8 +168,7 @@ void initScene(){ src.setType(vpMomentObject::DENSE_POLYGON); src.fromVector(src_pts); for (int i = 0 ; i < nbpoints ; i++){ - vpPoint p; - p.setWorldCoordinates(x[i],y[i],0.0); + vpPoint p(x[i],y[i],0.0); p.track(cdMo) ; dst_pts.push_back(p); } @@ -190,8 +184,7 @@ void refreshScene(vpMomentObject &obj){ vector<vpPoint> cur_pts; for (int i = 0 ; i < nbpoints ; i++){ - vpPoint p; - p.setWorldCoordinates(x[i],y[i],0.0); + vpPoint p(x[i],y[i],0.0); p.track(cMo) ; cur_pts.push_back(p); } diff --git a/example/ogre-simulator/AROgre.cpp b/example/ogre-simulator/AROgre.cpp index 71995b41986d94fa4c7f7bdcebc0d4efbb5d730c..230fd82111e6d2e91e5cffaf1ab38c5e83ee4b5a 100644 --- a/example/ogre-simulator/AROgre.cpp +++ b/example/ogre-simulator/AROgre.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: AROgre.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation of a simple augmented reality application using the vpAROgre * class. @@ -47,7 +43,7 @@ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <iostream> //#if defined(VISP_HAVE_OGRE) && (defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK) || (defined(VISP_HAVE_X11) && ! defined(APPLE))) @@ -59,22 +55,22 @@ // /usr/X11R6/include/X11/X.h:108: error: ‘Cursor’ has a previous // declaration as ‘typedef XID Cursor’. That's why it should not be // used on APPLE platforms -# include <visp/vpDisplayX.h> +# include <visp3/gui/vpDisplayX.h> #endif -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpPose.h> -#include <visp/vpPoint.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDot2.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpVideoReader.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> -#include <visp/vpDebug.h> -#include <visp/vpAROgre.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpDebug.h> +#include <visp3/ar/vpAROgre.h> // List of allowed command line options #define GETOPTARGS "ci:p:h" @@ -702,6 +698,10 @@ int main(int argc, const char **argv) std::cout << "Catch a ViSP exception: " << e << std::endl; return 1; } + catch(Ogre::Exception e) { + std::cout << "Catch an Ogre exception: " << e.getDescription() << std::endl; + return 1; + } catch(...) { std::cout << "Catch an exception " << std::endl; return 1; diff --git a/example/ogre-simulator/AROgreBasic.cpp b/example/ogre-simulator/AROgreBasic.cpp index 3236ecfb1216bdaf9a71d8b7125aeadc816de68b..37bedea2d8c21a780d409cab917a6c6b3fbe9b73 100644 --- a/example/ogre-simulator/AROgreBasic.cpp +++ b/example/ogre-simulator/AROgreBasic.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: AROgreBasic.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation of a simple augmented reality application using the vpAROgre * class. @@ -47,7 +43,7 @@ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <iostream> //#if defined(VISP_HAVE_OGRE) && (defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_GTK) || (defined(VISP_HAVE_X11) && ! defined(APPLE))) @@ -59,22 +55,22 @@ // /usr/X11R6/include/X11/X.h:108: error: ‘Cursor’ has a previous // declaration as ‘typedef XID Cursor’. That's why it should not be // used on APPLE platforms -# include <visp/vpDisplayX.h> +# include <visp3/gui/vpDisplayX.h> #endif -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpPose.h> -#include <visp/vpPoint.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDot2.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpVideoReader.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> -#include <visp/vpDebug.h> -#include <visp/vpAROgre.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpDebug.h> +#include <visp3/ar/vpAROgre.h> // List of allowed command line options #define GETOPTARGS "ci:p:h" @@ -584,6 +580,10 @@ int main(int argc, const char **argv) std::cout << "Catch a ViSP exception: " << e << std::endl; return 1; } + catch(Ogre::Exception e) { + std::cout << "Catch an Ogre exception: " << e.getDescription() << std::endl; + return 1; + } catch(...) { std::cout << "Catch an exception " << std::endl; return 1; diff --git a/example/ogre-simulator/CMakeLists.txt b/example/ogre-simulator/CMakeLists.txt index 9b19f1707213ded1d3e16b8a939ec71ee9cc7926..466062bd91e0d6c84fcb78ab09fd8d9b6fbef3b8 100644 --- a/example/ogre-simulator/CMakeLists.txt +++ b/example/ogre-simulator/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,27 +35,20 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - AROgre.cpp - AROgreBasic.cpp -) +project(example-ogre-simulator) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) +cmake_minimum_required(VERSION 2.6) - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +find_package(VISP REQUIRED visp_core visp_vision visp_ar visp_blob visp_io visp_gui) + +set(example_cpp + AROgre.cpp + AROgreBasic.cpp +) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/parse-argv/CMakeLists.txt b/example/parse-argv/CMakeLists.txt index ba94d4e49697a6064e33e9e2e8b4cf24eb36147b..0ed1db5c9ebaaae3aa66c0f09ca44959844634d9 100644 --- a/example/parse-argv/CMakeLists.txt +++ b/example/parse-argv/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,30 +35,24 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-parse-argv) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_io) + +set(example_cpp parse-argv1.cpp parse-argv2.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") + endif() # Add test - add_test(${binary} ${binary}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") - endif() + get_filename_component(target ${cpp} NAME_WE) + add_test(${target} ${target}) endforeach() diff --git a/example/parse-argv/parse-argv1.cpp b/example/parse-argv/parse-argv1.cpp index 2634975134135e27a624e9d1c1934d3c1bdb66a9..87c52f418df5dcd448afe3dbb7ea1fc0569e44d8 100644 --- a/example/parse-argv/parse-argv1.cpp +++ b/example/parse-argv/parse-argv1.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: parse-argv1.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of command line parsing. * @@ -54,8 +50,8 @@ -#include <visp/vpDebug.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpDebug.h> +#include <visp3/io/vpParseArgv.h> #include <stdlib.h> #include <stdio.h> #include <sstream> diff --git a/example/parse-argv/parse-argv2.cpp b/example/parse-argv/parse-argv2.cpp index 420174d8171a9badfdc50b6dcc7417c2174089ae..449ccc790475965039c8a6ecca5a723ec9147981 100644 --- a/example/parse-argv/parse-argv2.cpp +++ b/example/parse-argv/parse-argv2.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: parse-argv2.cpp 5311 2015-02-11 17:42:01Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of command line parsing. * @@ -54,8 +50,8 @@ -#include <visp/vpDebug.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpDebug.h> +#include <visp3/io/vpParseArgv.h> #include <stdio.h> #include <sstream> #include <iomanip> diff --git a/example/pose-estimation/CMakeLists.txt b/example/pose-estimation/CMakeLists.txt index c6700eac3d161e43603389540e0ad59b735ec2aa..85949d14a5fe9a948109e6ea78c5f258aa738ca3 100644 --- a/example/pose-estimation/CMakeLists.txt +++ b/example/pose-estimation/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,34 +35,23 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -SET (SOURCE - poseVirtualVS.cpp -) +project(example-pose-estimation) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) +cmake_minimum_required(VERSION 2.6) - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +find_package(VISP REQUIRED visp_core visp_blob visp_vision visp_io visp_gui) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") - endif() -endforeach() +set(example_cpp + poseVirtualVS.cpp +) -# Add test -# To run some of these tests don't forget to set VISP_INPUT_IMAGE_PATH -# environment variable to the ViSP test sequences location. -# To get these sequence download ViSP-images.tar.gz from -# http://www.irisa.fr/lagadic/visp/visp.html +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") + endif() -add_test(poseVirtualVS poseVirtualVS -c ${OPTION_TO_DESACTIVE_DISPLAY}) + # Add test + get_filename_component(target ${cpp} NAME_WE) + add_test(${target} ${target} -c ${OPTION_TO_DESACTIVE_DISPLAY}) +endforeach() diff --git a/example/pose-estimation/poseVirtualVS.cpp b/example/pose-estimation/poseVirtualVS.cpp index 3bf6d19e66828e4c61e6f82afe2a3965f4f46b48..e37fba111905af8615286b3e49d1687495134c96 100644 --- a/example/pose-estimation/poseVirtualVS.cpp +++ b/example/pose-estimation/poseVirtualVS.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: poseVirtualVS.cpp 5108 2015-01-05 07:48:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pose computation on an object made of dots. * reading of PGM image @@ -63,28 +59,28 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> #include <stdio.h> #include <sstream> #include <iomanip> #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImagePoint.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> -#include <visp/vpPose.h> -#include <visp/vpDot.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/vision/vpPose.h> +#include <visp3/blob/vpDot.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> // List of allowed command line options diff --git a/example/robot-simulator/afma6/CMakeLists.txt b/example/robot-simulator/afma6/CMakeLists.txt index 43b97b4200d480e5a257bc1ff947c20fcb3e0708..318b76b2eeb0e9dd247a955e430469ada4804d57 100644 --- a/example/robot-simulator/afma6/CMakeLists.txt +++ b/example/robot-simulator/afma6/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 2457 2010-01-07 10:41:18Z nmelchio $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,29 +35,23 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - servoSimuAfma6FourPoints2DCamVelocity.cpp -) +project(example-robot-simulator-afma6) + +cmake_minimum_required(VERSION 2.6) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) +find_package(VISP REQUIRED visp_core visp_vs visp_robot visp_io visp_gui) - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +set(example_cpp + servoSimuAfma6FourPoints2DCamVelocity.cpp +) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() -endforeach() -# Add test -add_test(servoSimuAfma6FourPoints2DCamVelocity servoSimuAfma6FourPoints2DCamVelocity -c ${OPTION_TO_DESACTIVE_DISPLAY}) + # Add test + get_filename_component(target ${cpp} NAME_WE) + add_test(${target} ${target} -c ${OPTION_TO_DESACTIVE_DISPLAY}) +endforeach() diff --git a/example/robot-simulator/afma6/servoSimuAfma6FourPoints2DCamVelocity.cpp b/example/robot-simulator/afma6/servoSimuAfma6FourPoints2DCamVelocity.cpp index f4544d1829a211bffbbc884eb611d4b615ca1168..505f197dab91a46f7523b0cbc6961bd50930159b 100644 --- a/example/robot-simulator/afma6/servoSimuAfma6FourPoints2DCamVelocity.cpp +++ b/example/robot-simulator/afma6/servoSimuAfma6FourPoints2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuFourPoints2DPolarCamVelocityDisplay.cpp 2503 2010-02-16 18:55:01Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing using 4 points with cartesian * coordinates as visual feature. @@ -57,8 +53,8 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #if (defined(_WIN32) || defined(VISP_HAVE_PTHREAD)) && (defined (VISP_HAVE_X11) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_GDI)) @@ -69,21 +65,21 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorAfma6.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorAfma6.h> // List of allowed command line options #define GETOPTARGS "cdh" diff --git a/example/robot-simulator/camera/CMakeLists.txt b/example/robot-simulator/camera/CMakeLists.txt index b05b61b153e60990ed1dca97ea8647ad536960af..d689596c7a29842907a79df6209061845f15535e 100644 --- a/example/robot-simulator/camera/CMakeLists.txt +++ b/example/robot-simulator/camera/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 2457 2010-01-07 10:41:18Z nmelchio $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,12 +35,13 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-robot-simulator-camera) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_vs visp_robot visp_io visp_gui) + +set(example_cpp servoSimu3D_cdMc_CamVelocity.cpp servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp servoSimu3D_cMcd_CamVelocity.cpp @@ -69,18 +67,10 @@ set(SOURCE servoSimuThetaUCamVelocity.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocity.cpp b/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocity.cpp index 2ee501accc927738e1ca50c2ccecf5d3f9be6ba0..7f01c4eee6308f800d7963ab9822e6a06bd2f08e 100644 --- a/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimu3D_cMcd_CamVelocity.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 3D visual servoing. * @@ -61,14 +57,14 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpFeatureThetaU.h> -#include <visp/vpFeatureTranslation.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/visual_features/vpFeatureTranslation.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" diff --git a/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp b/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp index 8b504499de04928b9d94b5656b88b8bbdcbde91a..7af42add3372890478171e59daf00e9d1a222b5f 100644 --- a/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp +++ b/example/robot-simulator/camera/servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimu3D_cMcd_CamVelocityWithoutVpServo.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 3D visual servoing. * @@ -85,14 +81,14 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpMath.h> -#include <visp/vpFeatureThetaU.h> -#include <visp/vpFeatureTranslation.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpIoTools.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/core/vpMath.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/visual_features/vpFeatureTranslation.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" @@ -269,7 +265,7 @@ main(int argc, const char ** argv) // Create the identity matrix vpMatrix I(3,3); - I.setIdentity(); + I.eye(); // Compute the camera translational velocity vpColVector v(3); diff --git a/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocity.cpp b/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocity.cpp index 0d2cd25d5b70c1e2e37f5fb70d468b16bb88dd54..69b97313495d26ccd32e18319a997b79541ac4e4 100644 --- a/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimu3D_cdMc_CamVelocity.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 3D visual servoing. * @@ -62,14 +58,14 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpFeatureThetaU.h> -#include <visp/vpFeatureTranslation.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/visual_features/vpFeatureTranslation.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" diff --git a/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp b/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp index 0348c7564e61b823622a3b0826afab63f1404d13..b736b9565bb8c5af6c16fd3c82dfa7d2a9d72659 100644 --- a/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp +++ b/example/robot-simulator/camera/servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimu3D_cdMc_CamVelocityWithoutVpServo.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 3D visual servoing. * @@ -80,13 +76,13 @@ #include <stdio.h> #include <string> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpSimulatorCamera.h> -#include <visp/vpThetaUVector.h> -#include <visp/vpTranslationVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/core/vpThetaUVector.h> +#include <visp3/core/vpTranslationVector.h> // List of allowed command line options #define GETOPTARGS "h" diff --git a/example/robot-simulator/camera/servoSimuCircle2DCamVelocity.cpp b/example/robot-simulator/camera/servoSimuCircle2DCamVelocity.cpp index 4b4b9c0bab9434b1ba1759df2b5aa36a26cd1ca7..191a73cccd15c79ec193ad6068afc4e50a43d892 100644 --- a/example/robot-simulator/camera/servoSimuCircle2DCamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimuCircle2DCamVelocity.cpp @@ -1,11 +1,8 @@ - /**************************************************************************** - * - * $Id: servoSimuCircle2DCamVelocity.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing on a circle. * @@ -61,14 +56,14 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpCircle.h> -#include <visp/vpFeatureEllipse.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/core/vpCircle.h> +#include <visp3/visual_features/vpFeatureEllipse.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" diff --git a/example/robot-simulator/camera/servoSimuCircle2DCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuCircle2DCamVelocityDisplay.cpp index e3ca194d33b605e120b22a575c65fff0026f3ea9..4000cb0e8e3d8588a70758b983c550299866ea9b 100644 --- a/example/robot-simulator/camera/servoSimuCircle2DCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuCircle2DCamVelocityDisplay.cpp @@ -1,11 +1,8 @@ - /**************************************************************************** - * - * $Id: servoSimuCircle2DCamVelocityDisplay.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing on a circle. * @@ -51,30 +46,29 @@ - display the camera view. */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) #include <stdlib.h> #include <stdio.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpCircle.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpProjectionDisplay.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpCircle.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/vs/vpServoDisplay.h> // List of allowed command line options #define GETOPTARGS "cdh" diff --git a/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplay.cpp index 091b86c0b96bc2d46fc3fcf953306230245db7d2..7b857d8ee8aa0ce67b9c50cd51e1ee4e3187d091 100644 --- a/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplay.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuCylinder2DCamVelocityDisplay.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing on a cylinder. * @@ -50,30 +46,29 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) #include <stdlib.h> #include <stdio.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpCylinder.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpProjectionDisplay.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpCylinder.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/vs/vpServoDisplay.h> // List of allowed command line options #define GETOPTARGS "cdh" diff --git a/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp b/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp index efc02a5fb1e80f4178b5c7a790e099d38a0a07be..d5efbaf044684bc06516e462c73da5e2cc210c91 100644 --- a/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp +++ b/example/robot-simulator/camera/servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuCylinder2DCamVelocityDisplaySecondaryTask.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing on a cylinder. * @@ -54,29 +50,29 @@ */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) #include <stdlib.h> #include <stdio.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpCylinder.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpProjectionDisplay.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpCylinder.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/gui/vpProjectionDisplay.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/vs/vpServoDisplay.h> // List of allowed command line options #define GETOPTARGS "cdh" diff --git a/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocity.cpp b/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocity.cpp index 7d750d955c3d71be4984e85d645a2c6175058273..9c6fe44062c326a97da5cb2295d2ba0b323fd921 100644 --- a/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuFourPoints2DCamVelocity.cpp 2503 2010-02-16 18:55:01Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing using 4 points as visual feature. * @@ -57,14 +53,14 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpConfig.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/core/vpConfig.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" diff --git a/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocityDisplay.cpp index e3f31a09c1cd3ed02931d4293409ba45cc4ba292..d7a9507843d05e99d7bf2f39ff6c64e58946a116 100644 --- a/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuFourPoints2DCamVelocityDisplay.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuFourPoints2DCamVelocityDisplay.cpp 2503 2010-02-16 18:55:01Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing using 4 points as visual feature. * @@ -56,28 +52,28 @@ */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) #include <stdlib.h> #include <stdio.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpProjectionDisplay.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/gui/vpProjectionDisplay.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "cdh" diff --git a/example/robot-simulator/camera/servoSimuFourPoints2DPolarCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuFourPoints2DPolarCamVelocityDisplay.cpp index 8e9d1b68c223c6fcf49ed57ce274bbf84d2bbd74..8c40e0cc7eefe757a3d382735221db23c48eaae8 100644 --- a/example/robot-simulator/camera/servoSimuFourPoints2DPolarCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuFourPoints2DPolarCamVelocityDisplay.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuFourPoints2DPolarCamVelocityDisplay.cpp 2503 2010-02-16 18:55:01Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing using 4 points with polar * coordinates as visual feature. @@ -57,32 +53,32 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) #include <stdlib.h> #include <stdio.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePointPolar.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpProjectionDisplay.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpSimulatorCamera.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePointPolar.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/gui/vpProjectionDisplay.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/io/vpParseArgv.h> // List of allowed command line options #define GETOPTARGS "cdh" @@ -335,7 +331,6 @@ main(int argc, const char ** argv) point[2].setWorldCoordinates(0.25,0.25,0) ; point[3].setWorldCoordinates(-0.25,0.25,0) ; - for (i = 0 ; i < 4 ; i++) externalview.insert(point[i]) ; diff --git a/example/robot-simulator/camera/servoSimuLine2DCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuLine2DCamVelocityDisplay.cpp index 54c535143d04392ff71c4d160b5414be7ccb60ee..672d7a20bdd9ecc0f71d0cfeb7c4b01a26363d93 100644 --- a/example/robot-simulator/camera/servoSimuLine2DCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuLine2DCamVelocityDisplay.cpp @@ -1,11 +1,8 @@ - /**************************************************************************** - * - * $Id: servoSimuLine2DCamVelocityDisplay.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing on a line. * @@ -50,29 +45,29 @@ - display the camera view. */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) #include <stdlib.h> #include <stdio.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpLine.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpLine.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "cdh" diff --git a/example/robot-simulator/camera/servoSimuPoint2DCamVelocity1.cpp b/example/robot-simulator/camera/servoSimuPoint2DCamVelocity1.cpp index d1066f2187055d93225352422638de56c233066e..ee5ea2a0599b1cd00c06561557dd0f09e729741b 100644 --- a/example/robot-simulator/camera/servoSimuPoint2DCamVelocity1.cpp +++ b/example/robot-simulator/camera/servoSimuPoint2DCamVelocity1.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuPoint2DCamVelocity1.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing on a point. * @@ -51,13 +47,13 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" @@ -143,35 +139,34 @@ main(int argc, const char ** argv) vpSimulatorCamera robot ; // sets the initial camera location - vpHomogeneousMatrix cMo ; - cMo[0][3] = 0.1 ; - cMo[1][3] = 0.2 ; - cMo[2][3] = 2 ; + vpHomogeneousMatrix cMo; + cMo[0][3] = 0.1; + cMo[1][3] = 0.2; + cMo[2][3] = 2; // Compute the position of the object in the world frame vpHomogeneousMatrix wMc, wMo; - robot.getPosition(wMc) ; + robot.getPosition(wMc); wMo = wMc * cMo; // sets the point coordinates in the world frame - vpPoint point ; - point.setWorldCoordinates(0,0,0) ; + vpPoint point(0, 0, 0); // computes the point coordinates in the camera frame and its 2D coordinates - point.track(cMo) ; + point.track(cMo); // sets the current position of the visual feature vpFeaturePoint p ; - vpFeatureBuilder::create(p,point) ; //retrieve x,y and Z of the vpPoint structure + vpFeatureBuilder::create(p,point); //retrieve x,y and Z of the vpPoint structure // sets the desired position of the visual feature - vpFeaturePoint pd ; - pd.buildFrom(0,0,1) ; // buildFrom(x,y,Z) ; + vpFeaturePoint pd; + pd.buildFrom(0,0,1); // buildFrom(x,y,Z) ; // define the task // - we want an eye-in-hand control law // - robot is controlled in the camera frame - task.setServo(vpServo::EYEINHAND_CAMERA) ; + task.setServo(vpServo::EYEINHAND_CAMERA); // we want to see a point on a point std::cout << std::endl ; diff --git a/example/robot-simulator/camera/servoSimuPoint2DCamVelocity2.cpp b/example/robot-simulator/camera/servoSimuPoint2DCamVelocity2.cpp index 1524bb64b39de1555200bfa6d552b7038e6f741b..2646dda7fb24b0a3d468482d1c233cea418f10b0 100644 --- a/example/robot-simulator/camera/servoSimuPoint2DCamVelocity2.cpp +++ b/example/robot-simulator/camera/servoSimuPoint2DCamVelocity2.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuPoint2DCamVelocity2.cpp 2503 2010-02-16 18:55:01Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing on a point. * @@ -59,13 +55,13 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" @@ -161,29 +157,28 @@ main(int argc, const char ** argv) std::cout << std::endl ; // sets the initial camera location - vpHomogeneousMatrix cMo ; - cMo[0][3] = 0.1 ; - cMo[1][3] = 0.2 ; - cMo[2][3] = 2 ; + vpHomogeneousMatrix cMo; + cMo[0][3] = 0.1; + cMo[1][3] = 0.2; + cMo[2][3] = 2; // Compute the position of the object in the world frame vpHomogeneousMatrix wMc, wMo; - robot.getPosition(wMc) ; + robot.getPosition(wMc); wMo = wMc * cMo; // sets the point coordinates in the world frame - vpPoint point ; - point.setWorldCoordinates(0,0,0) ; + vpPoint point(0, 0, 0); // computes the point coordinates in the camera frame and its 2D coordinates - point.track(cMo) ; + point.track(cMo); // sets the current position of the visual feature - vpFeaturePoint p ; - vpFeatureBuilder::create(p,point) ; //retrieve x,y and Z of the vpPoint structure + vpFeaturePoint p; + vpFeatureBuilder::create(p, point); //retrieve x,y and Z of the vpPoint structure // sets the desired position of the visual feature - vpFeaturePoint pd ; - pd.buildFrom(0,0,1) ; + vpFeaturePoint pd; + pd.buildFrom(0,0,1); // define the task // - we want an eye-in-hand control law diff --git a/example/robot-simulator/camera/servoSimuPoint2DCamVelocity3.cpp b/example/robot-simulator/camera/servoSimuPoint2DCamVelocity3.cpp index 5806ace9e67078454b9176477f534cea95d8907c..66006ce912f7babc9c8883d07a6390f677c9c9f2 100644 --- a/example/robot-simulator/camera/servoSimuPoint2DCamVelocity3.cpp +++ b/example/robot-simulator/camera/servoSimuPoint2DCamVelocity3.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuPoint2DCamVelocity3.cpp 2503 2010-02-16 18:55:01Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing on a point. * @@ -58,13 +54,13 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" @@ -157,32 +153,31 @@ main(int argc, const char ** argv) std::cout << " Simulation " << std::endl ; std::cout << " task : servo a point " << std::endl ; std::cout << "-------------------------------------------------------" << std::endl ; - std::cout << std::endl ; + std::cout << std::endl; // sets the initial camera location - vpHomogeneousMatrix cMo ; - cMo[0][3] = 0.1 ; - cMo[1][3] = 0.2 ; - cMo[2][3] = 2 ; + vpHomogeneousMatrix cMo; + cMo[0][3] = 0.1; + cMo[1][3] = 0.2; + cMo[2][3] = 2; // Compute the position of the object in the world frame vpHomogeneousMatrix wMc, wMo; - robot.getPosition(wMc) ; + robot.getPosition(wMc); wMo = wMc * cMo; // sets the point coordinates in the world frame - vpPoint point ; - point.setWorldCoordinates(0,0,0) ; + vpPoint point(0, 0, 0); // computes the point coordinates in the camera frame and its 2D coordinates - point.track(cMo) ; + point.track(cMo); // sets the current position of the visual feature - vpFeaturePoint p ; - vpFeatureBuilder::create(p,point) ; //retrieve x,y and Z of the vpPoint structure + vpFeaturePoint p; + vpFeatureBuilder::create(p,point); //retrieve x,y and Z of the vpPoint structure // sets the desired position of the visual feature - vpFeaturePoint pd ; - pd.buildFrom(0,0,1) ; // buildFrom(x,y,Z) ; + vpFeaturePoint pd; + pd.buildFrom(0,0,1); // buildFrom(x,y,Z) ; // define the task // - we want an eye-in-hand control law diff --git a/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity1.cpp b/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity1.cpp index 2788691fe5c72e83d873bef8991f96abe34e2c0e..e75c6285ed8397ee9da9229a495cf269cbeeb9d5 100644 --- a/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity1.cpp +++ b/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity1.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuPoint2DhalfCamVelocity1.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2 1/2 D visual servoing. * @@ -55,16 +51,16 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpFeatureThetaU.h> -#include <visp/vpGenericFeature.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/visual_features/vpGenericFeature.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" @@ -172,25 +168,23 @@ main(int argc, const char ** argv) // sets the desired camera location vpPoseVector cd_r_o(0,0,1, vpMath::rad(0),vpMath::rad(0),vpMath::rad(0)) ; - vpHomogeneousMatrix cdMo(cd_r_o) ; + vpHomogeneousMatrix cdMo(cd_r_o); // sets the point coordinates in the world frame - vpPoint point ; - point.setWorldCoordinates(0,0,0) ; + vpPoint point(0, 0, 0); // computes the point coordinates in the camera frame and its 2D coordinates - point.track(cMo) ; + point.track(cMo); - vpPoint pointd ; - pointd.setWorldCoordinates(0,0,0) ; - pointd.track(cdMo) ; + vpPoint pointd(0, 0, 0); + pointd.track(cdMo); //------------------------------------------------------------------ // 1st feature (x,y) // want to it at (0,0) - vpFeaturePoint p ; - vpFeatureBuilder::create(p,point) ; + vpFeaturePoint p; + vpFeatureBuilder::create(p,point); - vpFeaturePoint pd ; - vpFeatureBuilder::create(pd,pointd) ; + vpFeaturePoint pd; + vpFeatureBuilder::create(pd,pointd); //------------------------------------------------------------------ // 2nd feature (Z) diff --git a/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity2.cpp b/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity2.cpp index 5e98f980fe1973c343eea69b8f4465e464d73a2c..22dd53415eca0689d6aca254d303b2de6df1840c 100644 --- a/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity2.cpp +++ b/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity2.cpp @@ -1,11 +1,8 @@ - /**************************************************************************** - * - * $Id: servoSimuPoint2DhalfCamVelocity2.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2 1/2 D visual servoing using theta U visual features. * @@ -55,16 +50,16 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpFeatureThetaU.h> -#include <visp/vpGenericFeature.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/visual_features/vpGenericFeature.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" @@ -213,19 +208,16 @@ main(int argc, const char ** argv) //------------------------------------------------------------------ // sets the point coordinates in the world frame - vpPoint point ; - // defined point coordinates in the scene frame : oP - point.setWorldCoordinates(0,0,0) ; + vpPoint point(0, 0, 0); // computes the point coordinates in the camera frame and its // 2D coordinates cP and then p // computes the point coordinates in the camera frame and its 2D coordinates" ) ; - point.track(cMo) ; + point.track(cMo); // We also defined (again by forward projection) the desired position // of this point according to the desired camera position - vpPoint pointd ; - pointd.setWorldCoordinates(0,0,0) ; - pointd.track(cdMo) ; + vpPoint pointd(0, 0, 0); + pointd.track(cdMo); // Nevertheless, a vpPoint is not a feature, this is just a "tracker" // from which the feature are built diff --git a/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity3.cpp b/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity3.cpp index d42e4931d983255d3913c7f9bd989d3ba748f0a5..aade620f04ca0c5a3e58db2a1dcb447f40c5f088 100644 --- a/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity3.cpp +++ b/example/robot-simulator/camera/servoSimuPoint2DhalfCamVelocity3.cpp @@ -1,11 +1,8 @@ - /**************************************************************************** - * - * $Id: servoSimuPoint2DhalfCamVelocity3.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2 1/2 D visual servoing using theta U visual features. * @@ -55,16 +50,16 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpFeatureThetaU.h> -#include <visp/vpGenericFeature.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/visual_features/vpGenericFeature.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" @@ -212,9 +207,7 @@ main(int argc, const char ** argv) //------------------------------------------------------------------ // sets the point coordinates in the world frame - vpPoint P ; - // defined point coordinates in the scene frame : oP - P.setWorldCoordinates(0,0,0) ; + vpPoint P(0, 0, 0) ; // computes the P coordinates in the camera frame and its // 2D coordinates cP and then p // computes the point coordinates in the camera frame and its 2D coordinates @@ -222,8 +215,7 @@ main(int argc, const char ** argv) // We also defined (again by forward projection) the desired position // of this point according to the desired camera position - vpPoint Pd ; - Pd.setWorldCoordinates(0,0,0) ; + vpPoint Pd(0, 0, 0) ; Pd.track(cdMo) ; // Nevertheless, a vpPoint is not a feature, this is just a "tracker" diff --git a/example/robot-simulator/camera/servoSimuPoint3DCamVelocity.cpp b/example/robot-simulator/camera/servoSimuPoint3DCamVelocity.cpp index b2361f4737eb75ea85bbc8b653f92b2fe082d05a..69b19555f95538056135fbbd6845645c778b6579 100644 --- a/example/robot-simulator/camera/servoSimuPoint3DCamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimuPoint3DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuPoint3DCamVelocity.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 3D visual servoing on a 3D point. * @@ -55,13 +51,13 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpFeaturePoint3D.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeaturePoint3D.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" @@ -166,8 +162,7 @@ main(int argc, const char ** argv) wMo = wMc * cMo; // sets the point coordinates in the world frame - vpPoint point ; - point.setWorldCoordinates(0,0,0) ; + vpPoint point(0,0,0) ; // computes the point coordinates in the camera frame point.track(cMo) ; diff --git a/example/robot-simulator/camera/servoSimuSphere2DCamVelocity.cpp b/example/robot-simulator/camera/servoSimuSphere2DCamVelocity.cpp index 9c39af785e7993dbfdfcaf7bd3862f513999a7c5..da152cfaf4d6fc020e8786ccfaacda524b1066e2 100644 --- a/example/robot-simulator/camera/servoSimuSphere2DCamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimuSphere2DCamVelocity.cpp @@ -1,11 +1,8 @@ - /**************************************************************************** - * - * $Id: servoSimuSphere2DCamVelocity.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing on a sphere. * @@ -54,14 +49,14 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureEllipse.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSphere.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureEllipse.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/core/vpSphere.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" diff --git a/example/robot-simulator/camera/servoSimuSphere2DCamVelocitySecondaryTask.cpp b/example/robot-simulator/camera/servoSimuSphere2DCamVelocitySecondaryTask.cpp index 340f2dcb5643dbf1af31d3f0ca21456e3cf1b9e2..bf1d4f22f5168178b171d69feaf0acdfe4012d40 100644 --- a/example/robot-simulator/camera/servoSimuSphere2DCamVelocitySecondaryTask.cpp +++ b/example/robot-simulator/camera/servoSimuSphere2DCamVelocitySecondaryTask.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuSphere2DCamVelocitySecondaryTask.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing on a sphere. * @@ -54,15 +50,14 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureEllipse.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpServo.h> -#include <visp/vpSphere.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureEllipse.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/core/vpSphere.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" diff --git a/example/robot-simulator/camera/servoSimuSquareLine2DCamVelocityDisplay.cpp b/example/robot-simulator/camera/servoSimuSquareLine2DCamVelocityDisplay.cpp index 5d9f60850d5830cf88ae6217ea27de0e23c19ac0..f6f9fc2d26911858e7d37fb7925360f21337081f 100644 --- a/example/robot-simulator/camera/servoSimuSquareLine2DCamVelocityDisplay.cpp +++ b/example/robot-simulator/camera/servoSimuSquareLine2DCamVelocityDisplay.cpp @@ -1,11 +1,8 @@ - /**************************************************************************** - * - * $Id: servoSimuSquareLine2DCamVelocityDisplay.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing on a line. * @@ -50,30 +45,29 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) #include <stdlib.h> #include <stdio.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpLine.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpLine.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "cdh" diff --git a/example/robot-simulator/camera/servoSimuThetaUCamVelocity.cpp b/example/robot-simulator/camera/servoSimuThetaUCamVelocity.cpp index b28ab523f3c18585aa8fb2b664cd70fb8a53fb7e..84e253a8bb422f7309fd9f72a12d7412e86085c9 100644 --- a/example/robot-simulator/camera/servoSimuThetaUCamVelocity.cpp +++ b/example/robot-simulator/camera/servoSimuThetaUCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuThetaUCamVelocity.cpp 2457 2010-01-07 10:41:18Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a visual servoing using theta U visual features. * tests the control law @@ -56,13 +52,13 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpFeatureThetaU.h> -#include <visp/vpFeatureTranslation.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/visual_features/vpFeatureTranslation.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> // List of allowed command line options #define GETOPTARGS "h" diff --git a/example/robot-simulator/viper850/CMakeLists.txt b/example/robot-simulator/viper850/CMakeLists.txt index f15684b51ebcd8f20542df187c6e109135650a6b..87c6771c1e57743e995392966bbe7b98182194f6 100644 --- a/example/robot-simulator/viper850/CMakeLists.txt +++ b/example/robot-simulator/viper850/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 2457 2010-01-07 10:41:18Z nmelchio $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,29 +35,23 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - servoSimuViper850FourPoints2DCamVelocity.cpp -) +project(example-robot-simulator-viper850) + +cmake_minimum_required(VERSION 2.6) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) +find_package(VISP REQUIRED visp_core visp_vs visp_robot visp_io visp_gui) - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +set(example_cpp + servoSimuViper850FourPoints2DCamVelocity.cpp +) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() -endforeach() -# Add test -add_test(servoSimuViper850FourPoints2DCamVelocity servoSimuViper850FourPoints2DCamVelocity -c ${OPTION_TO_DESACTIVE_DISPLAY}) + # Add test + get_filename_component(target ${cpp} NAME_WE) + add_test(${target} ${target} -c ${OPTION_TO_DESACTIVE_DISPLAY}) +endforeach() diff --git a/example/robot-simulator/viper850/servoSimuViper850FourPoints2DCamVelocity.cpp b/example/robot-simulator/viper850/servoSimuViper850FourPoints2DCamVelocity.cpp index f00a4760a896ef005cdd0056c9f258c65a3cf007..eec9d55c8cc228c633c9ebb4891cd786f51694b8 100644 --- a/example/robot-simulator/viper850/servoSimuViper850FourPoints2DCamVelocity.cpp +++ b/example/robot-simulator/viper850/servoSimuViper850FourPoints2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoSimuFourPoints2DPolarCamVelocityDisplay.cpp 2503 2010-02-16 18:55:01Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulation of a 2D visual servoing using 4 points with polar * coordinates as visual feature. @@ -57,8 +53,8 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #if (defined(_WIN32) || defined(VISP_HAVE_PTHREAD)) && (defined (VISP_HAVE_X11) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_GDI)) @@ -69,21 +65,21 @@ #include <stdlib.h> #include <stdio.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorViper850.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorViper850.h> // List of allowed command line options #define GETOPTARGS "cdh" diff --git a/example/servo-afma4/CMakeLists.txt b/example/servo-afma4/CMakeLists.txt index ef53ba46a1fa58c374b9b1882f0aaca2a88b3638..35354314a9a8662a3e779b0fb04023eb3ec791c5 100644 --- a/example/servo-afma4/CMakeLists.txt +++ b/example/servo-afma4/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,29 +35,22 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-servo-afma4) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_blob visp_vs visp_robot visp_sensor visp_gui) + +set(example_cpp moveAfma4.cpp servoAfma4Point2DArtVelocity.cpp servoAfma4Point2DCamVelocity.cpp servoAfma4Point2DCamVelocityKalman.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/servo-afma4/moveAfma4.cpp b/example/servo-afma4/moveAfma4.cpp index f889ed7a739770dee7b1de6e08ccc3fb424f9e7c..b46b99a58db3bc8007cb68e3759bdc0c21d4d155 100644 --- a/example/servo-afma4/moveAfma4.cpp +++ b/example/servo-afma4/moveAfma4.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: moveAfma4.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for Afma 4 dof robot. * @@ -55,16 +51,16 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #ifdef VISP_HAVE_AFMA4 #include <unistd.h> #include <stdlib.h> -#include <visp/vpParseArgv.h> -#include <visp/vpRobotAfma4.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/robot/vpRobotAfma4.h> // List of allowed command line options #define GETOPTARGS "mh" diff --git a/example/servo-afma4/servoAfma4Point2DArtVelocity.cpp b/example/servo-afma4/servoAfma4Point2DArtVelocity.cpp index 53763b0ca9a2fd6c9d1480b977038fb4d7594634..ee40a18f7c54752f4a11ece34ddf70f5b869949c 100644 --- a/example/servo-afma4/servoAfma4Point2DArtVelocity.cpp +++ b/example/servo-afma4/servoAfma4Point2DArtVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma4Point2DArtVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -65,38 +61,37 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdio.h> #include <iostream> #include <fstream> #include <sstream> #include <stdlib.h> -#if (defined (VISP_HAVE_AFMA4) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotAfma4.h> -#include <visp/vpIoTools.h> +#if (defined (VISP_HAVE_AFMA4) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotAfma4.h> +#include <visp3/core/vpIoTools.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> -#include <visp/vpDot.h> +#include <visp3/blob/vpDot.h> int main() diff --git a/example/servo-afma4/servoAfma4Point2DCamVelocity.cpp b/example/servo-afma4/servoAfma4Point2DCamVelocity.cpp index 5549e73e46dc1b87d84916017b100cebe2e9f3ba..01f12723616733aed57185d49ee5b9881d7e9455 100644 --- a/example/servo-afma4/servoAfma4Point2DCamVelocity.cpp +++ b/example/servo-afma4/servoAfma4Point2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma4Point2DCamVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -66,34 +62,33 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> -#if (defined (VISP_HAVE_AFMA4) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotAfma4.h> -#include <visp/vpIoTools.h> +#if (defined (VISP_HAVE_AFMA4) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotAfma4.h> +#include <visp3/core/vpIoTools.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> -#include <visp/vpDot.h> +#include <visp3/blob/vpDot.h> int main() diff --git a/example/servo-afma4/servoAfma4Point2DCamVelocityKalman.cpp b/example/servo-afma4/servoAfma4Point2DCamVelocityKalman.cpp index 05a8ec830e8fd579759fe24f0a5d7d9282c48cf7..6e583ce46a1d6709b06021196ebdfa3ac0d34b78 100644 --- a/example/servo-afma4/servoAfma4Point2DCamVelocityKalman.cpp +++ b/example/servo-afma4/servoAfma4Point2DCamVelocityKalman.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma4Point2DCamVelocityKalman.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -60,33 +56,32 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> -#if (defined (VISP_HAVE_AFMA4) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotAfma4.h> -#include <visp/vpIoTools.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpParseArgv.h> -#include <visp/vpDot2.h> -#include <visp/vpAdaptiveGain.h> -#include <visp/vpLinearKalmanFilterInstantiation.h> +#if (defined (VISP_HAVE_AFMA4) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotAfma4.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/vs/vpAdaptiveGain.h> +#include <visp3/core/vpLinearKalmanFilterInstantiation.h> // List of allowed command line options diff --git a/example/servo-afma6/CMakeLists.txt b/example/servo-afma6/CMakeLists.txt index 1cc2addfb1310344d8a90955865ab5cd15316d61..9a391d5b8aa590f9d2d6053282d28579b0a14a90 100644 --- a/example/servo-afma6/CMakeLists.txt +++ b/example/servo-afma6/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,12 +35,13 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-servo-afma6) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_blob visp_vs visp_robot visp_sensor visp_vision visp_gui) + +set(example_cpp servoAfma6Ellipse2DCamVelocity.cpp servoAfma6FourPoints2DArtVelocity.cpp servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp @@ -60,17 +58,9 @@ set(SOURCE servoAfma6Segment2DCamVelocity.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/servo-afma6/servoAfma62DhalfCamVelocity.cpp b/example/servo-afma6/servoAfma62DhalfCamVelocity.cpp index 9180438597b16ecd7d34242ec1925cf9e24c0a91..53b40a9cfd18344f111674b694f849508377d171 100644 --- a/example/servo-afma6/servoAfma62DhalfCamVelocity.cpp +++ b/example/servo-afma6/servoAfma62DhalfCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma62DhalfCamVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -60,43 +56,42 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <cmath> // std::fabs #include <limits> // numeric_limits -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpFeatureDepth.h> -#include <visp/vpGenericFeature.h> -#include <visp/vpLine.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpPose.h> - -#include <visp/vpRobotAfma6.h> +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/visual_features/vpFeatureDepth.h> +#include <visp3/visual_features/vpGenericFeature.h> +#include <visp3/core/vpLine.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/vision/vpPose.h> + +#include <visp3/robot/vpRobotAfma6.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> -#include <visp/vpDot2.h> -#include <visp/vpPoint.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> int diff --git a/example/servo-afma6/servoAfma6Cylinder2DCamVelocity.cpp b/example/servo-afma6/servoAfma6Cylinder2DCamVelocity.cpp index a45fed980c1ab8fdc49d410863e9ea99f800dda8..d43d25c50bbf33faca259aa0935a30bb7aa8c3f5 100644 --- a/example/servo-afma6/servoAfma6Cylinder2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6Cylinder2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6Cylinder2DCamVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -56,35 +52,34 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <cmath> // std::fabs #include <limits> // numeric_limits -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpMeLine.h> -#include <visp/vpCylinder.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> - -#include <visp/vpRobotAfma6.h> +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/me/vpMeLine.h> +#include <visp3/core/vpCylinder.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> + +#include <visp3/robot/vpRobotAfma6.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> int main() diff --git a/example/servo-afma6/servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp b/example/servo-afma6/servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp index 44429118db3f36d25467e9a8aba1f08b5069a8dd..170b7ad7e73ae3d3432b6e4e19a6178fb4dfd4bf 100644 --- a/example/servo-afma6/servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp +++ b/example/servo-afma6/servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6Cylinder2DCamVelocitySecondaryTask.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -60,35 +56,34 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <cmath> // std::fabs #include <limits> // numeric_limits -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpMeLine.h> -#include <visp/vpCylinder.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> - -#include <visp/vpRobotAfma6.h> +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/me/vpMeLine.h> +#include <visp3/core/vpCylinder.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> + +#include <visp3/robot/vpRobotAfma6.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> int diff --git a/example/servo-afma6/servoAfma6Ellipse2DCamVelocity.cpp b/example/servo-afma6/servoAfma6Ellipse2DCamVelocity.cpp index 1accd1a233d4ef0d1e2350fc00a8833c0f44a28e..23aff2d38572e2775da70c9b0f0f14347ae12c3b 100644 --- a/example/servo-afma6/servoAfma6Ellipse2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6Ellipse2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6Ellipse2DCamVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -62,34 +58,33 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <cmath> // std::fabs #include <limits> // numeric_limits -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeatureEllipse.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeatureEllipse.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> -#include <visp/vpRobotAfma6.h> +#include <visp3/robot/vpRobotAfma6.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> -#include <visp/vpDot.h> +#include <visp3/blob/vpDot.h> diff --git a/example/servo-afma6/servoAfma6FourPoints2DArtVelocity.cpp b/example/servo-afma6/servoAfma6FourPoints2DArtVelocity.cpp index 5e1c2cdb494338874a19353b16afad8f28ccfdc5..6fa5064917b1182f8d733dcff19213505eb032c8 100644 --- a/example/servo-afma6/servoAfma6FourPoints2DArtVelocity.cpp +++ b/example/servo-afma6/servoAfma6FourPoints2DArtVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6FourPoints2DArtVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -63,38 +59,37 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdio.h> #include <iostream> #include <fstream> #include <sstream> #include <stdlib.h> -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpIoTools.h> -#include <visp/vpRobotAfma6.h> +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/robot/vpRobotAfma6.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> -#include <visp/vpDot.h> +#include <visp3/blob/vpDot.h> int main() diff --git a/example/servo-afma6/servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp b/example/servo-afma6/servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp index debf5ddf0865d59851187654f1111f26c49f4e0c..fae0200be53bc638f62e290993ee7bc469e0673a 100644 --- a/example/servo-afma6/servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp +++ b/example/servo-afma6/servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6FourPoints2DCamVelocityInteractionCurrent.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -67,37 +63,36 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpDot.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpPose.h> -#include <visp/vpIoTools.h> +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/blob/vpDot.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpIoTools.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> +#include <visp3/core/vpException.h> #define L 0.05 // to deal with a 10cm by 10cm square diff --git a/example/servo-afma6/servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp b/example/servo-afma6/servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp index d59457f51ea8aedf0517184de691f0edb64bdf61..44416592abf51d0e53e3880f12566171af90bf72 100644 --- a/example/servo-afma6/servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp +++ b/example/servo-afma6/servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6FourPoints2DCamVelocityInteractionDesired.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -67,36 +63,35 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpDot.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpIoTools.h> +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/blob/vpDot.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/core/vpIoTools.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> +#include <visp3/core/vpException.h> #define L 0.05 // to deal with a 10cm by 10cm square diff --git a/example/servo-afma6/servoAfma6Line2DCamVelocity.cpp b/example/servo-afma6/servoAfma6Line2DCamVelocity.cpp index 3acfdff3e20b7c272a28d19ccac1576ccfced2d4..07d019141b303a1cdf3a6d68350a4983318062f7 100644 --- a/example/servo-afma6/servoAfma6Line2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6Line2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6Line2DCamVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -59,32 +55,31 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpLine.h> -#include <visp/vpMeLine.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/core/vpLine.h> +#include <visp3/me/vpMeLine.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> -#include <visp/vpRobotAfma6.h> +#include <visp3/robot/vpRobotAfma6.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> int main() diff --git a/example/servo-afma6/servoAfma6Point2DArtVelocity.cpp b/example/servo-afma6/servoAfma6Point2DArtVelocity.cpp index 7f0e31d955b9da8e6d9046c44560c83a2977d649..90beaf4866b5eb7cdd7942ee76347cdb9bed80a8 100644 --- a/example/servo-afma6/servoAfma6Point2DArtVelocity.cpp +++ b/example/servo-afma6/servoAfma6Point2DArtVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6Point2DArtVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -64,38 +60,37 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdio.h> #include <iostream> #include <fstream> #include <sstream> #include <stdlib.h> -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpIoTools.h> +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpIoTools.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> -#include <visp/vpDot.h> +#include <visp3/blob/vpDot.h> int main() diff --git a/example/servo-afma6/servoAfma6Point2DCamVelocity.cpp b/example/servo-afma6/servoAfma6Point2DCamVelocity.cpp index 6ed0b84aef400d4c53a31a558a9fca55e2233850..8d29c565616621beeb8853a677f9b4e62cec2136 100644 --- a/example/servo-afma6/servoAfma6Point2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6Point2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6Point2DCamVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -65,30 +61,29 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpIoTools.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpDot.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/blob/vpDot.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> int main() diff --git a/example/servo-afma6/servoAfma6Points2DCamVelocityEyeToHand.cpp b/example/servo-afma6/servoAfma6Points2DCamVelocityEyeToHand.cpp index 10652314030266797561532885faaf3c3d4c9f30..8a240421384abfb2ca24148e8bc6302cad764ff2 100644 --- a/example/servo-afma6/servoAfma6Points2DCamVelocityEyeToHand.cpp +++ b/example/servo-afma6/servoAfma6Points2DCamVelocityEyeToHand.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6Points2DCamVelocityEyeToHand.cpp 5004 2014-11-24 08:24:18Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-to-hand control @@ -61,36 +57,35 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <cmath> // std::fabs #include <limits> // numeric_limits #include <list> -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) #define SAVE 0 -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpDot.h> -#include <visp/vpPose.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/blob/vpDot.h> +#include <visp3/vision/vpPose.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> #define L 0.006 #define D 0 diff --git a/example/servo-afma6/servoAfma6Segment2DCamVelocity.cpp b/example/servo-afma6/servoAfma6Segment2DCamVelocity.cpp index c151bdebf20521cf70b50730edf0137bfd4905e6..f1b55e58e52e05fef9041ff34c02bb39ecec8353 100644 --- a/example/servo-afma6/servoAfma6Segment2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6Segment2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6Point2DCamVelocity.cpp 3616 2012-03-09 14:31:52Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -51,31 +47,30 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <vector> -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeatureSegment.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpIoTools.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpDot.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeatureSegment.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/blob/vpDot.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> int main() diff --git a/example/servo-afma6/servoAfma6SquareLines2DCamVelocity.cpp b/example/servo-afma6/servoAfma6SquareLines2DCamVelocity.cpp index 663fa0feb2e373ab6f362b74263e969ee532a8e3..6b997832ccd71c172fe8ae997d0adfbabc5fd1f7 100644 --- a/example/servo-afma6/servoAfma6SquareLines2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6SquareLines2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6SquareLines2DCamVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -60,37 +56,36 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <cmath> // std::fabs #include <limits> // numeric_limits -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpLine.h> -#include <visp/vpMeLine.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> - -#include <visp/vpRobotAfma6.h> +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/core/vpLine.h> +#include <visp3/me/vpMeLine.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> + +#include <visp3/robot/vpRobotAfma6.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> -#include <visp/vpDot.h> +#include <visp3/blob/vpDot.h> int main() diff --git a/example/servo-afma6/servoAfma6TwoLines2DCamVelocity.cpp b/example/servo-afma6/servoAfma6TwoLines2DCamVelocity.cpp index 45f8bd8c5ea8fbb286b89633a3768d8f668fac02..679fdabdcd8637e6fb3cb675de0aa463dac469eb 100644 --- a/example/servo-afma6/servoAfma6TwoLines2DCamVelocity.cpp +++ b/example/servo-afma6/servoAfma6TwoLines2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoAfma6TwoLines2DCamVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -64,35 +60,34 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <cmath> // std::fabs #include <limits> // numeric_limits -#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpLine.h> -#include <visp/vpMeLine.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> - -#include <visp/vpRobotAfma6.h> +#if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/core/vpLine.h> +#include <visp3/me/vpMeLine.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> + +#include <visp3/robot/vpRobotAfma6.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> int main() diff --git a/example/servo-biclops/CMakeLists.txt b/example/servo-biclops/CMakeLists.txt index 183f15df7e76abb24cd5d4640a893abdc6930975..b9adb9efa29718b336ecf56a5e327b679f2cafd7 100644 --- a/example/servo-biclops/CMakeLists.txt +++ b/example/servo-biclops/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,27 +35,20 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-servo-biclops) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_blob visp_vs visp_robot visp_sensor visp_gui) + +set(example_cpp moveBiclops.cpp servoBiclopsPoint2DArtVelocity.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/servo-biclops/moveBiclops.cpp b/example/servo-biclops/moveBiclops.cpp index c02ed031d1eb2633b9455bc3d69d33f45a0c9f5b..49ccdf3cb8ede41ced74ed4d9de20c895c503d84 100644 --- a/example/servo-biclops/moveBiclops.cpp +++ b/example/servo-biclops/moveBiclops.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: moveBiclops.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tests the control law * Authors: @@ -58,15 +54,15 @@ -#include <visp/vpParseArgv.h> -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> -#include <visp/vpColVector.h> -#include <visp/vpTime.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpTime.h> #include <stdlib.h> #ifdef VISP_HAVE_BICLOPS -#include <visp/vpRobotBiclops.h> +#include <visp3/robot/vpRobotBiclops.h> // List of allowed command line options #define GETOPTARGS "c:h" @@ -114,16 +110,16 @@ Set the program options. */ bool getOptions(int argc, const char **argv, std::string& conf) { - const char *optarg; + const char *optarg_; int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg)) > 1) { + while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { switch (c) { - case 'c': conf = optarg; break; + case 'c': conf = optarg_; break; case 'h': usage(argv[0], NULL, conf); return false; break; default: - usage(argv[0], optarg, conf); return false; break; + usage(argv[0], optarg_, conf); return false; break; } } @@ -131,7 +127,7 @@ bool getOptions(int argc, const char **argv, std::string& conf) // standalone param or error usage(argv[0], NULL, conf); std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg << std::endl << std::endl; + std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; return false; } diff --git a/example/servo-biclops/servoBiclopsPoint2DArtVelocity.cpp b/example/servo-biclops/servoBiclopsPoint2DArtVelocity.cpp index 8450bd3bfcbc623077b0a5738828d1a5facf7ca7..5f3832166c052470ed0a7eafb026d11a709e9d3c 100644 --- a/example/servo-biclops/servoBiclopsPoint2DArtVelocity.cpp +++ b/example/servo-biclops/servoBiclopsPoint2DArtVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoBiclopsPoint2DArtVelocity.cpp 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -64,41 +60,39 @@ -#include <visp/vpTime.h> -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpTime.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <signal.h> #include <stdlib.h> -#if ( defined (VISP_HAVE_BICLOPS) && (defined (VISP_HAVE_DC1394_2) || defined(VISP_HAVE_DIRECTSHOW)) ) +#if ( defined (VISP_HAVE_BICLOPS) && (defined (VISP_HAVE_DC1394) || defined(VISP_HAVE_DIRECTSHOW)) ) #ifdef VISP_HAVE_PTHREAD # include <pthread.h> #endif -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpDirectShowGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotBiclops.h> -#include <visp/vpIoTools.h> -#include <visp/vpParseArgv.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpDot.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/sensor/vpDirectShowGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotBiclops.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/blob/vpDot.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> - +#include <visp3/core/vpException.h> #ifdef VISP_HAVE_PTHREAD pthread_mutex_t mutexEndLoop = PTHREAD_MUTEX_INITIALIZER; @@ -169,17 +163,17 @@ Set the program options. */ bool getOptions(int argc, const char **argv, std::string& conf, std::string &debugdir, std::string& user) { - const char *optarg; + const char *optarg_; int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg)) > 1) { + while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { switch (c) { - case 'c': conf = optarg; break; - case 'd': debugdir = optarg; break; + case 'c': conf = optarg_; break; + case 'd': debugdir = optarg_; break; case 'h': usage(argv[0], NULL, conf, debugdir, user); return false; break; default: - usage(argv[0], optarg, conf, debugdir, user); return false; break; + usage(argv[0], optarg_, conf, debugdir, user); return false; break; } } @@ -187,7 +181,7 @@ bool getOptions(int argc, const char **argv, std::string& conf, std::string &deb // standalone param or error usage(argv[0], NULL, conf, debugdir, user); std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg << std::endl << std::endl; + std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; return false; } @@ -276,7 +270,7 @@ main(int argc, const char ** argv) vpImage<unsigned char> I ; -#if defined VISP_HAVE_DC1394_2 +#if defined VISP_HAVE_DC1394 vp1394TwoGrabber g; #elif defined VISP_HAVE_DIRECTSHOW vpDirectShowGrabber g; diff --git a/example/servo-pioneer/CMakeLists.txt b/example/servo-pioneer/CMakeLists.txt index 76781f855d47568e85e4a144aead1189cae1b968..c6880b81e2f4efd5510f60d8cf7615fe234dfb8f 100644 --- a/example/servo-pioneer/CMakeLists.txt +++ b/example/servo-pioneer/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,12 +35,13 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-servo-pioneer) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_blob visp_vs visp_robot visp_sensor visp_gui) + +set(example_cpp movePioneer.cpp servoPioneerPoint2DDepth.cpp servoPioneerPoint2DDepthWithoutVpServo.cpp @@ -51,18 +49,9 @@ set(SOURCE sonarPioneerReader.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() - diff --git a/example/servo-pioneer/movePioneer.cpp b/example/servo-pioneer/movePioneer.cpp index 31bb006dc517f37348ccb2a5330eb8ab5fd89760..bc81e91979ccabee68cd40d17b41c696b9074cdd 100644 --- a/example/servo-pioneer/movePioneer.cpp +++ b/example/servo-pioneer/movePioneer.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: movePioneer.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example that shows how to control a Pioneer mobile robot in ViSP. * @@ -41,9 +37,9 @@ #include <iostream> -#include <visp/vpConfig.h> -#include <visp/vpTime.h> -#include <visp/vpRobotPioneer.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpTime.h> +#include <visp3/robot/vpRobotPioneer.h> #ifndef VISP_HAVE_PIONEER int main() diff --git a/example/servo-pioneer/servoPioneerPanSegment3D.cpp b/example/servo-pioneer/servoPioneerPanSegment3D.cpp index 8b3296e5d34dca6334eb51a4816e8920450e17d5..dd239e2734e190f1d39febc18a65c408c9470da1 100644 --- a/example/servo-pioneer/servoPioneerPanSegment3D.cpp +++ b/example/servo-pioneer/servoPioneerPanSegment3D.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: servoPioneerPanSegment3D.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * IBVS on Pioneer P3DX mobile platform * @@ -40,25 +36,25 @@ *****************************************************************************/ #include <iostream> -#include <visp/vpConfig.h> - -#include <visp/vpRobotPioneer.h> // Include before vpDisplayX to avoid build issues -#include <visp/vpRobotBiclops.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDot2.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureSegment.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vp1394CMUGrabber.h> -#include <visp/vpV4l2Grabber.h> -#include <visp/vpPioneerPan.h> -#include <visp/vpPlot.h> -#include <visp/vpServo.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/core/vpConfig.h> + +#include <visp3/robot/vpRobotPioneer.h> // Include before vpDisplayX to avoid build issues +#include <visp3/robot/vpRobotBiclops.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureSegment.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/sensor/vp1394CMUGrabber.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#include <visp3/robot/vpPioneerPan.h> +#include <visp3/gui/vpPlot.h> +#include <visp3/vs/vpServo.h> +#include <visp3/core/vpVelocityTwistMatrix.h> #define USE_REAL_ROBOT #define USE_PLOTTER @@ -84,7 +80,7 @@ #if defined(VISP_HAVE_PIONEER) && defined(VISP_HAVE_BICLOPS) int main(int argc, char **argv) { -#if defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) +#if defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) try { vpImage<unsigned char> I; // Create a gray level image container @@ -175,7 +171,7 @@ int main(int argc, char **argv) g.open(I); // Logitec sphere parameters cam.initPersProjWithoutDistortion(558, 555, 312, 210); -#elif defined(VISP_HAVE_DC1394_2) +#elif defined(VISP_HAVE_DC1394) // Create a grabber based on libdc1394-2.x third party lib (for firewire cameras under Linux) vp1394TwoGrabber g(false); g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_640x480_MONO8); diff --git a/example/servo-pioneer/servoPioneerPoint2DDepth.cpp b/example/servo-pioneer/servoPioneerPoint2DDepth.cpp index 73e89af79f76d9bd1122eeec40fa652ff6336879..b1c5e1e024e34df08b7d430e64bc4e00b19901e2 100644 --- a/example/servo-pioneer/servoPioneerPoint2DDepth.cpp +++ b/example/servo-pioneer/servoPioneerPoint2DDepth.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: servoPioneerPoint2DDepth.cpp 5128 2015-01-06 11:46:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * IBVS on Pioneer P3DX mobile platform * @@ -40,27 +36,27 @@ *****************************************************************************/ #include <iostream> -#include <visp/vpConfig.h> - -#include <visp/vpRobotPioneer.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDot2.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureDepth.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpImageConvert.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vp1394CMUGrabber.h> -#include <visp/vpV4l2Grabber.h> -#include <visp/vpOpenCVGrabber.h> -#include <visp/vpServo.h> -#include <visp/vpVelocityTwistMatrix.h> - -#if defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100) +#include <visp3/core/vpConfig.h> + +#include <visp3/robot/vpRobotPioneer.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureDepth.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/sensor/vp1394CMUGrabber.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#include <visp3/sensor/vpOpenCVGrabber.h> +#include <visp3/vs/vpServo.h> +#include <visp3/core/vpVelocityTwistMatrix.h> + +#if defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100) #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) #if defined(VISP_HAVE_PIONEER) # define TEST_COULD_BE_ACHIEVED @@ -157,7 +153,7 @@ int main(int argc, char **argv) g.open(I); // Logitec sphere parameters cam.initPersProjWithoutDistortion(558, 555, 312, 210); -#elif defined(VISP_HAVE_DC1394_2) +#elif defined(VISP_HAVE_DC1394) // Create a grabber based on libdc1394-2.x third party lib (for firewire cameras under Linux) vp1394TwoGrabber g(false); g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_640x480_MONO8); diff --git a/example/servo-pioneer/servoPioneerPoint2DDepthWithoutVpServo.cpp b/example/servo-pioneer/servoPioneerPoint2DDepthWithoutVpServo.cpp index f43906e70599a17f9d4c0d9471b72bd4b6af9078..99b771f9fa5159d1971983fdf3f7e8af8a80cf88 100644 --- a/example/servo-pioneer/servoPioneerPoint2DDepthWithoutVpServo.cpp +++ b/example/servo-pioneer/servoPioneerPoint2DDepthWithoutVpServo.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: servoPioneerPoint2DDepthWithoutVpServo.cpp 5128 2015-01-06 11:46:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * IBVS on Pioneer P3DX mobile platform * @@ -40,25 +36,25 @@ *****************************************************************************/ #include <iostream> -#include <visp/vpConfig.h> -#include <visp/vpRobotPioneer.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDot2.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureDepth.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpImageConvert.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vp1394CMUGrabber.h> -#include <visp/vpOpenCVGrabber.h> -#include <visp/vpV4l2Grabber.h> -#include <visp/vpVelocityTwistMatrix.h> - -#if defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100) +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotPioneer.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureDepth.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/sensor/vp1394CMUGrabber.h> +#include <visp3/sensor/vpOpenCVGrabber.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#include <visp3/core/vpVelocityTwistMatrix.h> + +#if defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100) #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) #if defined(VISP_HAVE_PIONEER) # define TEST_COULD_BE_ACHIEVED @@ -155,7 +151,7 @@ int main(int argc, char **argv) g.open(I); // Logitec sphere parameters cam.initPersProjWithoutDistortion(558, 555, 312, 210); -#elif defined(VISP_HAVE_DC1394_2) +#elif defined(VISP_HAVE_DC1394) // Create a grabber based on libdc1394-2.x third party lib (for firewire cameras under Linux) vp1394TwoGrabber g(false); g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_640x480_MONO8); @@ -226,8 +222,8 @@ int main(int argc, char **argv) robot.get_eJe(eJe); vpMatrix L; // Interaction matrix - L.stackMatrices(L_x); // constant since build with the desired feature - L.stackMatrices(L_Z); // not constant since it corresponds to log(Z/Z*) that evolves at each iteration + L.stack(L_x); // constant since build with the desired feature + L.stack(L_Z); // not constant since it corresponds to log(Z/Z*) that evolves at each iteration vpColVector v; // vz, wx @@ -259,8 +255,8 @@ int main(int argc, char **argv) // Update the global interaction matrix vpMatrix L; - L.stackMatrices(L_x); // constant since build with the desired feature - L.stackMatrices(L_Z); // not constant since it corresponds to log(Z/Z*) that evolves at each iteration + L.stack(L_x); // constant since build with the desired feature + L.stack(L_Z); // not constant since it corresponds to log(Z/Z*) that evolves at each iteration // Update the global error s-s* vpColVector error; diff --git a/example/servo-pioneer/sonarPioneerReader.cpp b/example/servo-pioneer/sonarPioneerReader.cpp index e40043d99599cfd2c4adbe8a87aa36eb8a6fb343..144fa4f2e7564d97be13d7fadea7ecc682667b9f 100644 --- a/example/servo-pioneer/sonarPioneerReader.cpp +++ b/example/servo-pioneer/sonarPioneerReader.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: sonarPioneerReader.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example that shows how to control a Pioneer mobile robot in ViSP. * @@ -41,15 +37,15 @@ #include <iostream> -#include <visp/vpRobotPioneer.h> // Include before vpDisplayX to avoid build issues -#include <visp/vpConfig.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayX.h> -#include <visp/vpImage.h> -#include <visp/vpIoTools.h> -#include <visp/vpImageIo.h> -#include <visp/vpTime.h> +#include <visp3/robot/vpRobotPioneer.h> // Include before vpDisplayX to avoid build issues +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpTime.h> #ifndef VISP_HAVE_PIONEER int main() @@ -112,11 +108,13 @@ void sonarPrinter(void) double end_angle = 45; range = sonar.currentReadingPolar(start_angle, end_angle, &angle); printf(" front quadrant: %5.0f ", range); - if (range != sonar.getMaxRange()) + //if (range != sonar.getMaxRange()) + if (std::fabs(range - sonar.getMaxRange()) > std::numeric_limits<double>::epsilon()) printf("%3.0f ", angle); printf("\n"); #if defined(VISP_HAVE_X11) || defined (VISP_HAVE_GDI) - if (isInitialized && range != sonar.getMaxRange()) + //if (isInitialized && range != sonar.getMaxRange()) + if (isInitialized && std::fabs(range - sonar.getMaxRange()) > std::numeric_limits<double>::epsilon()) { double x = range * cos(vpMath::rad(angle)); // position of the obstacle in the sensor frame double y = range * sin(vpMath::rad(angle)); @@ -135,19 +133,22 @@ void sonarPrinter(void) range = sonar.currentReadingPolar(-135, -45, &angle); printf(" right quadrant: %5.0f ", range); - if (range != sonar.getMaxRange()) + //if (range != sonar.getMaxRange()) + if (std::fabs(range - sonar.getMaxRange()) > std::numeric_limits<double>::epsilon()) printf("%3.0f ", angle); printf("\n"); range = sonar.currentReadingPolar(45, 135, &angle); printf(" left quadrant: %5.0f ", range); - if (range != sonar.getMaxRange()) + //if (range != sonar.getMaxRange()) + if (std::fabs(range - sonar.getMaxRange()) > std::numeric_limits<double>::epsilon()) printf("%3.0f ", angle); printf("\n"); range = sonar.currentReadingPolar(-135, 135, &angle); printf(" back quadrant: %5.0f ", range); - if (range != sonar.getMaxRange()) + //if (range != sonar.getMaxRange()) + if (std::fabs(range - sonar.getMaxRange()) > std::numeric_limits<double>::epsilon()) printf("%3.0f ", angle); printf("\n"); @@ -179,7 +180,8 @@ void sonarPrinter(void) // reading->getSensorY(), reading->getSensorTh(), reading->getRange()); #if defined(VISP_HAVE_X11) || defined (VISP_HAVE_GDI) - if (isInitialized && range != sonar.getMaxRange()) + //if (isInitialized && range != sonar.getMaxRange()) + if (isInitialized && std::fabs(range - sonar.getMaxRange()) > std::numeric_limits<double>::epsilon()) { vpDisplay::displayLine(I, si, sj, i, j, vpColor::blue, 2); vpDisplay::displayCross(I, si, sj, 7, vpColor::blue); @@ -238,7 +240,7 @@ int main(int argc, char **argv) // Create a display to show sensor data if (isInitialized == false) { - I.resize(half_size*2, half_size*2); + I.resize((unsigned int)half_size*2, (unsigned int)half_size*2); I = 255; #if defined(VISP_HAVE_X11) diff --git a/example/servo-ptu46/CMakeLists.txt b/example/servo-ptu46/CMakeLists.txt index 9135d34d5016974d5039908cc87e80ff33ebfe0a..854e0cd69db50ec171b5392397e7c5c1b4319c96 100644 --- a/example/servo-ptu46/CMakeLists.txt +++ b/example/servo-ptu46/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,27 +35,20 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-servo-ptu46) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_blob visp_vs visp_robot visp_sensor visp_gui) + +set(example_cpp movePtu46.cpp servoPtu46Point2DArtVelocity.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/servo-ptu46/movePtu46.cpp b/example/servo-ptu46/movePtu46.cpp index 920aed4fad5290c3693029223b91868bee712d3d..10cfbe4291c05e5a71652ab7902d1c1397bd71c7 100644 --- a/example/servo-ptu46/movePtu46.cpp +++ b/example/servo-ptu46/movePtu46.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: movePtu46.cpp 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tests the control law * @@ -54,8 +50,8 @@ robot is controlled first in position, then in velocity. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX # include <unistd.h> #endif @@ -64,7 +60,7 @@ #ifdef VISP_HAVE_PTU46 -#include <visp/vpRobotPtu46.h> +#include <visp3/robot/vpRobotPtu46.h> int main() diff --git a/example/servo-ptu46/servoPtu46Point2DArtVelocity.cpp b/example/servo-ptu46/servoPtu46Point2DArtVelocity.cpp index 3a2a365c398afaa7276372e9c0bbe1d197b6d624..7f38f899a552c2a2890f30233cc66f617ba17d0e 100644 --- a/example/servo-ptu46/servoPtu46Point2DArtVelocity.cpp +++ b/example/servo-ptu46/servoPtu46Point2DArtVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoPtu46Point2DArtVelocity.cpp 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -61,8 +57,8 @@ point. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX # include <unistd.h> #endif @@ -70,32 +66,31 @@ -#if (defined(VISP_HAVE_PTU46) & defined (VISP_HAVE_DC1394_2) ) +#if (defined(VISP_HAVE_PTU46) & defined (VISP_HAVE_DC1394) ) #ifdef VISP_HAVE_PTHREAD # include <pthread.h> #endif -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> -#include <visp/vpRobotPtu46.h> +#include <visp3/robot/vpRobotPtu46.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> -#include <visp/vpDot2.h> +#include <visp3/blob/vpDot2.h> #ifdef VISP_HAVE_PTHREAD @@ -104,6 +99,7 @@ pthread_mutex_t mutexEndLoop = PTHREAD_MUTEX_INITIALIZER; void signalCtrC( int signumber ) { + (void)(signumber); #ifdef VISP_HAVE_PTHREAD pthread_mutex_unlock( &mutexEndLoop ); #endif @@ -166,17 +162,15 @@ main() return(-1) ; } - vpServo task ; vpDot2 dot ; try{ vpERROR_TRACE("start dot.initTracking(I) ") ; - int x,y; - vpDisplay::getClick( I,y,x ); - dot.set_u( x ) ; - dot.set_v( y ) ; + vpImagePoint germ; + vpDisplay::getClick( I, germ ); + dot.setCog(germ); vpDEBUG_TRACE(25,"Click!"); //dot.initTracking(I) ; dot.track(I); diff --git a/example/servo-viper650/CMakeLists.txt b/example/servo-viper650/CMakeLists.txt index eefd0ef6770c21a8433ccfe5b3048a439b5ccdd6..0054ec81693d2f9e4b7277cd0b49fee81ce4dc6c 100644 --- a/example/servo-viper650/CMakeLists.txt +++ b/example/servo-viper650/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 3750 2012-06-01 09:39:38Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,29 +35,21 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-servo-viper650) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_blob visp_vs visp_robot visp_sensor visp_vision visp_gui) + +set(example_cpp servoViper650Point2DCamVelocity.cpp servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() - diff --git a/example/servo-viper650/servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp b/example/servo-viper650/servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp index 2f0ad87b6d802c4418561496bb2bed96cd3be4c8..00b70c31d479d39cb7f10160d8cc1c7d1afea97a 100644 --- a/example/servo-viper650/servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp +++ b/example/servo-viper650/servoViper650FourPoints2DArtVelocityInteractionCurrent.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp 3870 2012-09-05 17:03:43Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -52,33 +48,33 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #include <stdio.h> #include <iostream> #include <fstream> #include <sstream> #include <stdlib.h> -#if (defined (VISP_HAVE_VIPER650) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDot2.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpPoint.h> -#include <visp/vpPose.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> +#if (defined (VISP_HAVE_VIPER650) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vision/vpPose.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> #define L 0.05 // to deal with a 10cm by 10cm square diff --git a/example/servo-viper650/servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp b/example/servo-viper650/servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp index facd496ca10b3da72a0045532887a989e878eb05..22c2f591146cfd3cff3ba0789b24637d83a9d9bd 100644 --- a/example/servo-viper650/servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp +++ b/example/servo-viper650/servoViper650FourPoints2DCamVelocityInteractionCurrent.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp 3870 2012-09-05 17:03:43Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -53,33 +49,33 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #include <stdio.h> #include <iostream> #include <fstream> #include <sstream> #include <stdlib.h> -#if (defined (VISP_HAVE_VIPER650) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDot2.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpPoint.h> -#include <visp/vpPose.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> +#if (defined (VISP_HAVE_VIPER650) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vision/vpPose.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> #define L 0.05 // to deal with a 10cm by 10cm square diff --git a/example/servo-viper650/servoViper650Point2DCamVelocity.cpp b/example/servo-viper650/servoViper650Point2DCamVelocity.cpp index 60cab3e285f227e241e88b225c973a614b83e63e..eb51b7b9f5de00cdb102449c44b9496e81bc3334 100644 --- a/example/servo-viper650/servoViper650Point2DCamVelocity.cpp +++ b/example/servo-viper650/servoViper650Point2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoViper650Point2DCamVelocity.cpp 3616 2012-03-09 14:31:52Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -53,8 +49,8 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <stdio.h> @@ -62,25 +58,24 @@ #include <fstream> #include <sstream> -#if (defined (VISP_HAVE_VIPER650) && defined (VISP_HAVE_DC1394_2) && defined (VISP_HAVE_X11)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpIoTools.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpImageIo.h> -#include <visp/vpDot2.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> +#if (defined (VISP_HAVE_VIPER650) && defined (VISP_HAVE_DC1394) && defined (VISP_HAVE_X11)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> int main() diff --git a/example/servo-viper850/CMakeLists.txt b/example/servo-viper850/CMakeLists.txt index e93f230b9c38a146dc6e869d1a6ee9286beaecd6..8c48bb06604b94b0c5be86d743d62a7502800f45 100644 --- a/example/servo-viper850/CMakeLists.txt +++ b/example/servo-viper850/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,33 +35,28 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-servo-viper850) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_blob visp_vs visp_robot visp_sensor visp_vision visp_gui) + +set(example_cpp servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp servoViper850FourPoints2DArtVelocityInteractionDesired.cpp servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp servoViper850FourPointsKinect.cpp servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp + servoViper850Point2DArtVelocity-jointAvoidance-large.cpp servoViper850Point2DArtVelocity.cpp servoViper850Point2DCamVelocity.cpp servoViper850Point2DCamVelocityKalman.cpp ) -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/servo-viper850/servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp b/example/servo-viper850/servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp index 0a894bf4e912f7c2b17b5752045e21bc49c41255..da2d78754f6c3f598dd8d1770b52c6dd211cb982 100644 --- a/example/servo-viper850/servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp +++ b/example/servo-viper850/servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoViper850FourPoints2DArtVelocityInteractionCurrent.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -52,33 +48,33 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdio.h> #include <iostream> #include <fstream> #include <sstream> #include <stdlib.h> -#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDot2.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpPoint.h> -#include <visp/vpPose.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> +#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vision/vpPose.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> #define L 0.05 // to deal with a 10cm by 10cm square diff --git a/example/servo-viper850/servoViper850FourPoints2DArtVelocityInteractionDesired.cpp b/example/servo-viper850/servoViper850FourPoints2DArtVelocityInteractionDesired.cpp index 0a9e9687b2ee76ef9ae2c793722d0f3b5842f8f6..638f03836f534057f50582f424a39e664b8513fc 100644 --- a/example/servo-viper850/servoViper850FourPoints2DArtVelocityInteractionDesired.cpp +++ b/example/servo-viper850/servoViper850FourPoints2DArtVelocityInteractionDesired.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoViper850FourPoints2DArtVelocityInteractionDesired.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -52,33 +48,33 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdio.h> #include <iostream> #include <fstream> #include <sstream> #include <stdlib.h> -#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDot2.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpPoint.h> -#include <visp/vpPose.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> +#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vision/vpPose.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> int main() diff --git a/example/servo-viper850/servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp b/example/servo-viper850/servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp index a10613a180197ff50aa608de61178199202cad31..cb17f8b3cefc75056e5cef8ed9a8d453ef8d6d58 100644 --- a/example/servo-viper850/servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp +++ b/example/servo-viper850/servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoViper850FourPoints2DCamVelocityInteractionCurrent.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -53,33 +49,33 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdio.h> #include <iostream> #include <fstream> #include <sstream> #include <stdlib.h> -#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDot2.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpPoint.h> -#include <visp/vpPose.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> +#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vision/vpPose.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> #define L 0.05 // to deal with a 10cm by 10cm square diff --git a/example/servo-viper850/servoViper850FourPointsKinect.cpp b/example/servo-viper850/servoViper850FourPointsKinect.cpp index 4fc9b644b96dd70a5a89e5f77946e070bbad1a47..35170ac29450c4a2c6e1720f595f7c0810fd696b 100644 --- a/example/servo-viper850/servoViper850FourPointsKinect.cpp +++ b/example/servo-viper850/servoViper850FourPointsKinect.cpp @@ -1,10 +1,7 @@ - /**************************************************************************** - * - * $Id: servoViper850FourPoints2DCamVelocityKinect.cpp 3530 2012-01-03 10:52:12Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -52,8 +47,8 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdio.h> #include <iostream> @@ -64,30 +59,29 @@ #if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES) ) -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImageConvert.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpIoTools.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpPose.h> -#include <visp/vpKinect.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/vision/vpPose.h> +#include <visp3/sensor/vpKinect.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> -#include <visp/vpDot2.h> +#include <visp3/blob/vpDot2.h> #define L 0.05 // to deal with a 10cm by 10cm square diff --git a/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp b/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp index ea887eb7629f1989d8b517ea5f544f168e85ad8d..8c78c9e6204a91d99e1335f4dbe44c50fe8ed084 100644 --- a/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp +++ b/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp 4698 2014-03-26 06:55:37Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -51,8 +47,8 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <stdio.h> @@ -62,27 +58,26 @@ #include <cmath> // std::fabs #include <limits> // numeric_limits -#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394_2) && defined(VISP_HAVE_DISPLAY)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpIoTools.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpDot2.h> -#include <visp/vpPlot.h> +#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394) && defined(VISP_HAVE_DISPLAY)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/gui/vpPlot.h> int diff --git a/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp b/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp index da8769045b9c385bb67d370ea9a5a251cebb91a8..8a71f3a0ed93777a9141d7e97618434af3029a90 100644 --- a/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp +++ b/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoViper850Point2DArtVelocity-jointAvoidance-gpa.cpp 4698 2014-03-26 06:55:37Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -50,8 +46,8 @@ Implemented from \cite Marchand96f and section II.B in \cite Chaumette01c. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <stdio.h> @@ -59,27 +55,26 @@ #include <fstream> #include <sstream> -#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394_2) && defined(VISP_HAVE_DISPLAY)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpIoTools.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpDot2.h> -#include <visp/vpPlot.h> +#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394) && defined(VISP_HAVE_DISPLAY)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/gui/vpPlot.h> int @@ -193,7 +188,6 @@ main() std::cin >> beta ; vpDot2 dot ; - std::cout << "Click on a dot..." << std::endl; dot.initTracking(I) ; @@ -336,18 +330,17 @@ main() task.kill(); return 0; } - catch (...) + catch (vpException &e) { - vpERROR_TRACE(" Test failed") ; + std::cout << "Catch an exception: " << e.getMessage() << std::endl; return 0; } } - #else int main() { - vpERROR_TRACE("You do not have an afma6 robot or a firewire framegrabber connected to your computer..."); + vpERROR_TRACE("You do not have an Viper 850 robot or a firewire framegrabber connected to your computer..."); } #endif diff --git a/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-large.cpp b/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-large.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e05cf3b474bd9e6dc8c7ccda5612fbc2aa44521b --- /dev/null +++ b/example/servo-viper850/servoViper850Point2DArtVelocity-jointAvoidance-large.cpp @@ -0,0 +1,313 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * tests the control law + * eye-in-hand control + * velocity computed in articular + * + * Authors: + * Eric Marchand + * Fabien Spindler + * Giovanni Claudio + * + *****************************************************************************/ + +/*! + \example servoViper850Point2DArtVelocity-jointAvoidance-large.cpp + + Joint limits avoidance using a secondary task for joint limit avoidance \cite Marey:2010b using the + new large projection operator (see equation(24) in the paper \cite Marey:2010). +*/ + +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace + +#include <stdlib.h> +#include <stdio.h> +#include <iostream> +#include <fstream> +#include <sstream> + +#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394_2) && defined(VISP_HAVE_DISPLAY)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/gui/vpPlot.h> + + +int +main() +{ + try { + vpRobotViper850 robot ; + + vpServo task ; + + vpImage<unsigned char> I ; + + bool reset = false; + vp1394TwoGrabber g(reset); + g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_640x480_MONO8); + g.setFramerate(vp1394TwoGrabber::vpFRAMERATE_60); + g.open(I) ; + + g.acquire(I) ; + +#ifdef VISP_HAVE_X11 + vpDisplayX display(I,800,100,"Current image") ; +#elif defined(VISP_HAVE_OPENCV) + vpDisplayOpenCV display(I,800,100,"Current image") ; +#elif defined(VISP_HAVE_GTK) + vpDisplayGTK display(I,800,100,"Current image") ; +#endif + + vpDisplay::display(I) ; + vpDisplay::flush(I) ; + + vpColVector jointMin(6), jointMax(6) ; + jointMin = robot.getJointMin(); + jointMax = robot.getJointMax(); + + vpColVector Qmiddle(6); + vpColVector data(12) ; + + Qmiddle = (jointMin + jointMax) /2.; + // double rho1 = 0.1 ; + + double rho = 0.1; + double rho1 = 0.3; + + vpColVector q(6) ; + + // Create a window with two graphics + // - first graphic to plot q(t), Qmin, Qmax, Ql0min, Ql1min, Ql0max and Ql1max + vpPlot plot(2); + + // The first graphic contains 12 data to plot: q(t), Low Limits, Upper Limits, ql0min, ql1min, ql0max and ql1max + plot.initGraph(0, 12); + // The second graphic contains the values of the secondaty task velocities + plot.initGraph(1, 6); + + // For the first graphic : + // - along the x axis the expected values are between 0 and 200 + // - along the y axis the expected values are between -1.2 and 1.2 + plot.initRange(0, 0., 200., -1.2, 1.2); + plot.setTitle(0, "Joint behavior"); + + // For the second graphic : + plot.setTitle(1, "Q secondary task"); + + // For the first and second graphic, set the curves legend + char legend[10]; + for (unsigned int i=0; i < 6; i++) { + sprintf(legend, "q%d", i+1); + plot.setLegend(0, i, legend); + plot.setLegend(1, i, legend); + } + plot.setLegend(0, 6, "Low Limit"); + plot.setLegend(0, 7, "Upper Limit"); + plot.setLegend(0, 8, "ql0 min"); + plot.setLegend(0, 9, "ql0 max"); + plot.setLegend(0, 10, "ql1 min"); + plot.setLegend(0, 11, "ql1 max"); + + // Set the curves color + plot.setColor(0, 0, vpColor::red); + plot.setColor(0, 1, vpColor::green); + plot.setColor(0, 2, vpColor::blue); + plot.setColor(0, 3, vpColor::orange); + plot.setColor(0, 4, vpColor(0, 128, 0)); + plot.setColor(0, 5, vpColor::cyan); + for (unsigned int i= 6; i < 12; i++) + plot.setColor(0, i, vpColor::black); // for Q and tQ [min,max] + + vpColVector sec_task(6) ; + + vpDot2 dot ; + + std::cout << "Click on a dot..." << std::endl; + dot.initTracking(I) ; + vpImagePoint cog = dot.getCog(); + vpDisplay::displayCross(I, cog, 10, vpColor::blue) ; + vpDisplay::flush(I); + + vpCameraParameters cam ; + // Update camera parameters + robot.getCameraParameters (cam, I); + + // sets the current position of the visual feature + vpFeaturePoint p ; + vpFeatureBuilder::create(p,cam, dot) ; //retrieve x,y and Z of the vpPoint structure + + p.set_Z(1) ; + // sets the desired position of the visual feature + vpFeaturePoint pd ; + pd.buildFrom(0,0,1) ; + + // Define the task + // - we want an eye-in-hand control law + // - articular velocity are computed + task.setServo(vpServo::EYEINHAND_L_cVe_eJe) ; + task.setInteractionMatrixType(vpServo::DESIRED, vpServo::PSEUDO_INVERSE) ; + + vpVelocityTwistMatrix cVe ; + robot.get_cVe(cVe) ; + std::cout << cVe <<std::endl ; + task.set_cVe(cVe) ; + + // - Set the Jacobian (expressed in the end-effector frame)") ; + vpMatrix eJe ; + robot.get_eJe(eJe) ; + task.set_eJe(eJe) ; + + // - we want to see a point on a point..") ; + std::cout << std::endl ; + task.addFeature(p,pd) ; + + // - set the gain + task.setLambda(0.8) ; + + // Display task information " ) ; + task.print() ; + + robot.setRobotState(vpRobot::STATE_VELOCITY_CONTROL) ; + + int iter = 0; + std::cout << "\nHit CTRL-C to stop the loop...\n" << std::flush; + for ( ; ; ) { + iter ++; + // Acquire a new image from the camera + g.acquire(I) ; + + // Display this image + vpDisplay::display(I) ; + + // Achieve the tracking of the dot in the image + dot.track(I) ; + cog = dot.getCog(); + + // Display a green cross at the center of gravity position in the image + vpDisplay::displayCross(I, cog, 10, vpColor::green) ; + + // Get the measured joint positions of the robot + robot.getPosition(vpRobot::ARTICULAR_FRAME, q); + + // Update the point feature from the dot location + vpFeatureBuilder::create(p, cam, dot); + + // Get the jacobian of the robot + robot.get_eJe(eJe) ; + // Update this jacobian in the task structure. It will be used to compute + // the velocity skew (as an articular velocity) + // qdot = -lambda * L^+ * cVe * eJe * (s-s*) + task.set_eJe(eJe) ; + + vpColVector prim_task ; + // Compute the visual servoing skew vector + prim_task = task.computeControlLaw() ; + + // Compute the secondary task for the joint limit avoidance + sec_task = task.secondaryTaskJointLimitAvoidance(q, prim_task, jointMin, jointMax, rho, rho1); + + vpColVector v ; + v = prim_task + sec_task; + + // Display the current and desired feature points in the image display + vpServoDisplay::display(task, cam, I) ; + + // Apply the computed joint velocities to the robot + robot.setVelocity(vpRobot::ARTICULAR_FRAME, v) ; + + { + // Add the material to plot curves + + // q normalized between (entre -1 et 1) + for (unsigned int i=0 ; i < 6 ; i++) { + data[i] = (q[i] - Qmiddle[i]) ; + data[i] /= (jointMax[i] - jointMin[i]) ; + data[i]*=2 ; + } + + data[6] = -1.0; + data[7] = 1.0; + + unsigned int joint = 2; + double tQmin_l0 = jointMin[joint] + rho *(jointMax[joint] - jointMin[joint]); + double tQmax_l0 = jointMax[joint] - rho *(jointMax[joint] - jointMin[joint]); + + double tQmin_l1 = tQmin_l0 - rho * rho1 * (jointMax[joint] - jointMin[joint]); + double tQmax_l1 = tQmax_l0 + rho * rho1 * (jointMax[joint] - jointMin[joint]); + + data[8] = 2*(tQmin_l0 - Qmiddle[joint])/(jointMax[joint] - jointMin[joint]); + data[9] = 2*(tQmax_l0 - Qmiddle[joint])/(jointMax[joint] - jointMin[joint]); + data[10] = 2*(tQmin_l1 - Qmiddle[joint])/(jointMax[joint] - jointMin[joint]); + data[11] = 2*(tQmax_l1 - Qmiddle[joint])/(jointMax[joint] - jointMin[joint]); + plot.plot(0, iter, data); // plot q(t), Low Limits, Upper Limits, ql0min, ql1min, ql0max and ql1max + plot.plot(1, iter, sec_task); //plot secondary task velocities + } + + vpDisplay::flush(I) ; + } + + // Display task information + task.print() ; + task.kill(); + return 0; + } + catch (...) + { + vpERROR_TRACE(" Test failed") ; + return 0; + } +} + + +#else +int +main() +{ + vpERROR_TRACE("You do not have an afma6 robot or a firewire framegrabber connected to your computer..."); +} +#endif diff --git a/example/servo-viper850/servoViper850Point2DArtVelocity.cpp b/example/servo-viper850/servoViper850Point2DArtVelocity.cpp index a790b56166c59a3a05b728468a83c729033e0c1c..bca8d42769eaa8b543ab00315bd3b579a782e8dd 100644 --- a/example/servo-viper850/servoViper850Point2DArtVelocity.cpp +++ b/example/servo-viper850/servoViper850Point2DArtVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoViper850Point2DArtVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -51,8 +47,8 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <stdio.h> @@ -60,29 +56,28 @@ #include <fstream> #include <sstream> -#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpIoTools.h> +#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpIoTools.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> -#include <visp/vpDot2.h> +#include <visp3/blob/vpDot2.h> int main() diff --git a/example/servo-viper850/servoViper850Point2DCamVelocity.cpp b/example/servo-viper850/servoViper850Point2DCamVelocity.cpp index 7b72b9c7fe8419c8d3e43ea9eb9f363d213cf7ed..1a44c1fd87770e36813b40edc6eb6705403732d5 100644 --- a/example/servo-viper850/servoViper850Point2DCamVelocity.cpp +++ b/example/servo-viper850/servoViper850Point2DCamVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoViper850Point2DCamVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -53,8 +49,8 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <stdio.h> @@ -62,27 +58,26 @@ #include <fstream> #include <sstream> -#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpIoTools.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpImageIo.h> -#include <visp/vpDot2.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> +#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> int diff --git a/example/servo-viper850/servoViper850Point2DCamVelocityKalman.cpp b/example/servo-viper850/servoViper850Point2DCamVelocityKalman.cpp index e2926ad7d59e10229f9f331fef8b4fba10d637c1..1b03c001171d1b1c2c9b76a151b45267d44d3e74 100644 --- a/example/servo-viper850/servoViper850Point2DCamVelocityKalman.cpp +++ b/example/servo-viper850/servoViper850Point2DCamVelocityKalman.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: servoViper850Point2DCamVelocityKalman.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * tests the control law * eye-in-hand control @@ -54,8 +50,8 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> // Debug trace +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> // Debug trace #include <stdlib.h> #include <stdio.h> @@ -63,29 +59,28 @@ #include <fstream> #include <sstream> -#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394_2)) - -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpServo.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpIoTools.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpImageIo.h> -#include <visp/vpDot2.h> -#include <visp/vpAdaptiveGain.h> -#include <visp/vpLinearKalmanFilterInstantiation.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> +#if (defined (VISP_HAVE_VIPER850) && defined (VISP_HAVE_DC1394)) + +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpException.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/vs/vpAdaptiveGain.h> +#include <visp3/core/vpLinearKalmanFilterInstantiation.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> int main() diff --git a/example/tools/CMakeLists.txt b/example/tools/CMakeLists.txt index cad994093012a68697898b1ad30f937d3fca0eaf..eda73a2542b207e04d11d815cf579bd4219348c3 100644 --- a/example/tools/CMakeLists.txt +++ b/example/tools/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,12 +35,13 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-servo-tools) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_robot visp_io visp_gui) + +set(example_cpp keyboard.cpp parallelPort.cpp plot2d.cpp @@ -51,18 +49,10 @@ set(SOURCE histogram.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() diff --git a/example/tools/histogram.cpp b/example/tools/histogram.cpp index d6d4fe98c76d92ecdd7f5078abc902f0d7dcf0cd..0bec968188f2137526b918caf79256897549d27b 100644 --- a/example/tools/histogram.cpp +++ b/example/tools/histogram.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: histogram.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of Histogram manipulation. * @@ -48,12 +44,12 @@ -#include <visp/vpDebug.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpHistogram.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpHistogram.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> #include <stdio.h> #include <stdlib.h> diff --git a/example/tools/keyboard.cpp b/example/tools/keyboard.cpp index ef97dd0279ab98e3e75c7a3f52b3fa20cc2dd6be..418f6d11b735047e7242e9c1663da519a40bd19f 100644 --- a/example/tools/keyboard.cpp +++ b/example/tools/keyboard.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: keyboard.cpp 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of keyboard management. * @@ -45,15 +41,15 @@ Keyboard example. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) #include <stdio.h> #include <iostream> #include <signal.h> -#include <visp/vpKeyboard.h> +#include <visp3/io/vpKeyboard.h> int diff --git a/example/tools/parallelPort.cpp b/example/tools/parallelPort.cpp index 789f5222d8253b27840db8ab991b93f347d7d601..6889a11dcc9655fe0b91f7bc045ac2e53ddedc2c 100644 --- a/example/tools/parallelPort.cpp +++ b/example/tools/parallelPort.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: parallelPort.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of keybord management. * @@ -45,8 +41,8 @@ Send a data to the parallel port. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #if defined VISP_HAVE_PARPORT #include <stdlib.h> @@ -54,8 +50,8 @@ #include <iostream> #include <signal.h> -#include <visp/vpParallelPort.h> -#include <visp/vpParseArgv.h> +#include <visp3/io/vpParallelPort.h> +#include <visp3/io/vpParseArgv.h> // List of allowed command line options #define GETOPTARGS "d:h" diff --git a/example/tools/plot2d.cpp b/example/tools/plot2d.cpp index 5c487c30e5daf1a01f9ae3ddb7c2c383fdec50d4..5215dd8197eea2dfac53d8a81bc98fe305ed65f4 100644 --- a/example/tools/plot2d.cpp +++ b/example/tools/plot2d.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: plot2d.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example which describes how to use the vpPlot class * @@ -46,11 +42,11 @@ Plot 2D curves example. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> -#include <visp/vpPlot.h> -#include <visp/vpMath.h> +#include <visp3/gui/vpPlot.h> +#include <visp3/core/vpMath.h> int main () { diff --git a/example/tools/plot3d.cpp b/example/tools/plot3d.cpp index 39e7f72c8705969c047f9adb3977268d78a040c4..659b5ca746329735d5a90932eacd2d5917efc88c 100755 --- a/example/tools/plot3d.cpp +++ b/example/tools/plot3d.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: plot.cpp 3530 2012-01-03 10:52:12Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example which describes how to use the vpPlot class * @@ -47,8 +43,8 @@ */ #include <iostream> -#include <visp/vpConfig.h> -#include <visp/vpPlot.h> +#include <visp3/core/vpConfig.h> +#include <visp3/gui/vpPlot.h> int main () { diff --git a/example/tracking/CMakeLists.txt b/example/tracking/CMakeLists.txt index fad0953d92d1f9aa9d0d4b7d476d00409152657d..00e492a2c584c6b6773a3127bec8923f4f312c5b 100644 --- a/example/tracking/CMakeLists.txt +++ b/example/tracking/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,12 +35,13 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE +project(example-tracking) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_io visp_gui) + +set(example_cpp mbtEdgeTracking.cpp mbtEdgeKltTracking.cpp mbtKltTracking.cpp @@ -52,24 +50,16 @@ set(SOURCE trackMeCircle.cpp trackMeEllipse.cpp trackMeLine.cpp - trackMeNurbs.cpp +# trackMeNurbs.cpp trackDot.cpp trackDot2.cpp trackKltOpencv.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() endforeach() @@ -89,7 +79,7 @@ add_test(trackDot2WithAutoDetection trackDot2WithAutoDetection -c ${OPTION_TO_DE add_test(trackMeCircle trackMeCircle -c ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(trackMeEllipse trackMeEllipse -c ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(trackMeLine trackMeLine -c ${OPTION_TO_DESACTIVE_DISPLAY}) -add_test(trackMeNurbs trackMeNurbs -c ${OPTION_TO_DESACTIVE_DISPLAY}) +#add_test(trackMeNurbs trackMeNurbs -c ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(trackDot trackDot -c ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(trackDot2 trackDot2 -c ${OPTION_TO_DESACTIVE_DISPLAY}) @@ -104,6 +94,7 @@ add_test(templateTrackerPyramidal-SSDESM-Homography templateTracker -c -l 2 - add_test(templateTrackerPyramidal-SSDESM-HomographySL3 templateTracker -c -l 2 -t 0 -w 2 -p ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(templateTrackerPyramidal-SSDESM-SRT templateTracker -c -l 2 -t 0 -w 3 -p ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(templateTrackerPyramidal-SSDESM-Translation templateTracker -c -l 2 -t 0 -w 4 -p ${OPTION_TO_DESACTIVE_DISPLAY}) +add_test(templateTrackerPyramidal-SSDESM-RT templateTracker -c -l 2 -t 0 -w 5 -p ${OPTION_TO_DESACTIVE_DISPLAY}) #add_test(templateTracker-SSDForwardAdditional-Affine templateTracker -c -l 2 -t 1 -w 0 ${OPTION_TO_DESACTIVE_DISPLAY}) #add_test(templateTracker-SSDForwardAdditional-Homography templateTracker -c -l 2 -t 1 -w 1 ${OPTION_TO_DESACTIVE_DISPLAY}) @@ -116,6 +107,7 @@ add_test(templateTrackerPyramidal-SSDForwardAdditional-Homography templateTra add_test(templateTrackerPyramidal-SSDForwardAdditional-HomographySL3 templateTracker -c -l 2 -t 1 -w 2 -p ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(templateTrackerPyramidal-SSDForwardAdditional-SRT templateTracker -c -l 2 -t 1 -w 3 -p ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(templateTrackerPyramidal-SSDForwardAdditional-Translation templateTracker -c -l 2 -t 1 -w 4 -p ${OPTION_TO_DESACTIVE_DISPLAY}) +add_test(templateTrackerPyramidal-SSDForwardAdditional-RT templateTracker -c -l 2 -t 1 -w 5 -p ${OPTION_TO_DESACTIVE_DISPLAY}) #add_test(templateTracker-SSDForwardCompositional-Affine templateTracker -c -l 2 -t 2 -w 0 ${OPTION_TO_DESACTIVE_DISPLAY}) #add_test(templateTracker-SSDForwardCompositional-Homography templateTracker -c -l 2 -t 2 -w 1 ${OPTION_TO_DESACTIVE_DISPLAY}) @@ -128,6 +120,7 @@ add_test(templateTrackerPyramidal-SSDForwardCompositional-Homography template add_test(templateTrackerPyramidal-SSDForwardCompositional-HomographySL3 templateTracker -c -l 2 -t 2 -w 2 -p ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(templateTrackerPyramidal-SSDForwardCompositional-SRT templateTracker -c -l 2 -t 2 -w 3 -p ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(templateTrackerPyramidal-SSDForwardCompositional-Translation templateTracker -c -l 2 -t 2 -w 4 -p ${OPTION_TO_DESACTIVE_DISPLAY}) +add_test(templateTrackerPyramidal-SSDForwardCompositional-RT templateTracker -c -l 2 -t 2 -w 5 -p ${OPTION_TO_DESACTIVE_DISPLAY}) #add_test(templateTracker-SSDInverseCompositional-Affine templateTracker -c -l 2 -t 3 -w 0 ${OPTION_TO_DESACTIVE_DISPLAY}) #add_test(templateTracker-SSDInverseCompositional-Homography templateTracker -c -l 2 -t 3 -w 1 ${OPTION_TO_DESACTIVE_DISPLAY}) @@ -140,6 +133,7 @@ add_test(templateTrackerPyramidal-SSDInverseCompositional-Homography template add_test(templateTrackerPyramidal-SSDInverseCompositional-HomographySL3 templateTracker -c -l 2 -t 3 -w 2 -p ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(templateTrackerPyramidal-SSDInverseCompositional-SRT templateTracker -c -l 2 -t 3 -w 3 -p ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(templateTrackerPyramidal-SSDInverseCompositional-Translation templateTracker -c -l 2 -t 3 -w 4 -p ${OPTION_TO_DESACTIVE_DISPLAY}) +add_test(templateTrackerPyramidal-SSDInverseCompositional-RT templateTracker -c -l 2 -t 3 -w 5 -p ${OPTION_TO_DESACTIVE_DISPLAY}) #add_test(templateTracker-ZNCCForwardAdditional-Affine templateTracker -c -l 2 -t 4 -w 0 ${OPTION_TO_DESACTIVE_DISPLAY}) #add_test(templateTracker-ZNCCForwardAdditional-Homography templateTracker -c -l 2 -t 4 -w 1 ${OPTION_TO_DESACTIVE_DISPLAY}) @@ -152,6 +146,7 @@ add_test(templateTrackerPyramidal-ZNCCForwardAdditional-Homography templateTr add_test(templateTrackerPyramidal-ZNCCForwardAdditional-HomographySL3 templateTracker -c -l 2 -t 4 -w 2 -p ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(templateTrackerPyramidal-ZNCCForwardAdditional-SRT templateTracker -c -l 2 -t 4 -w 3 -p ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(templateTrackerPyramidal-ZNCCForwardAdditional-Translation templateTracker -c -l 2 -t 4 -w 4 -p ${OPTION_TO_DESACTIVE_DISPLAY}) +add_test(templateTrackerPyramidal-ZNCCForwardAdditional-RT templateTracker -c -l 2 -t 4 -w 5 -p ${OPTION_TO_DESACTIVE_DISPLAY}) #add_test(templateTracker-ZNCCInverseCompositional-Affine templateTracker -c -l 2 -t 5 -w 0 ${OPTION_TO_DESACTIVE_DISPLAY}) #add_test(templateTracker-ZNCCInverseCompositional-Homography templateTracker -c -l 2 -t 5 -w 1 ${OPTION_TO_DESACTIVE_DISPLAY}) @@ -164,3 +159,13 @@ add_test(templateTrackerPyramidal-ZNCCInverseCompositional-Homography templat add_test(templateTrackerPyramidal-ZNCCInverseCompositional-HomographySL3 templateTracker -c -l 2 -t 5 -w 2 -p ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(templateTrackerPyramidal-ZNCCInverseCompositional-SRT templateTracker -c -l 2 -t 5 -w 3 -p ${OPTION_TO_DESACTIVE_DISPLAY}) add_test(templateTrackerPyramidal-ZNCCInverseCompositional-Translation templateTracker -c -l 2 -t 5 -w 4 -p ${OPTION_TO_DESACTIVE_DISPLAY}) +add_test(templateTrackerPyramidal-ZNCCInverseCompositional-RT templateTracker -c -l 2 -t 5 -w 5 -p ${OPTION_TO_DESACTIVE_DISPLAY}) + +if(BUILD_MODULE_visp_tt_mi) + add_test(templateTrackerPyramidal-MIInverseCompositional-Affine templateTracker -c -l 2 -t 9 -w 0 -p ${OPTION_TO_DESACTIVE_DISPLAY}) + add_test(templateTrackerPyramidal-MIInverseCompositional-Homography templateTracker -c -l 2 -t 9 -w 1 -p ${OPTION_TO_DESACTIVE_DISPLAY}) + add_test(templateTrackerPyramidal-MIInverseCompositional-HomographySL3 templateTracker -c -l 2 -t 9 -w 2 -p ${OPTION_TO_DESACTIVE_DISPLAY}) + add_test(templateTrackerPyramidal-MIInverseCompositional-SRT templateTracker -c -l 2 -t 9 -w 3 -p ${OPTION_TO_DESACTIVE_DISPLAY}) + add_test(templateTrackerPyramidal-MIInverseCompositional-Translation templateTracker -c -l 2 -t 9 -w 4 -p ${OPTION_TO_DESACTIVE_DISPLAY}) + add_test(templateTrackerPyramidal-MIInverseCompositional-RT templateTracker -c -l 2 -t 9 -w 5 -p ${OPTION_TO_DESACTIVE_DISPLAY}) +endif() diff --git a/example/tracking/mbtEdgeKltTracking.cpp b/example/tracking/mbtEdgeKltTracking.cpp index 84f3853abd0a2f729bda50595704f6bfe77ac06a..d890915c77d2434516a1b55e481b87303ad0aaad 100644 --- a/example/tracking/mbtEdgeKltTracking.cpp +++ b/example/tracking/mbtEdgeKltTracking.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: mbtTracking.cpp 3957 2012-11-07 15:22:30Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of Hybrid Tracking of MBT and MBT KTL. * @@ -45,30 +41,31 @@ \brief Example of Hybrid Tracking of MBT and MBT KTL on an image sequence containing a cube. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpMbEdgeKltTracker.h> -#include <visp/vpVideoReader.h> -#include <visp/vpParseArgv.h> +#include <iostream> +#include <visp3/core/vpConfig.h> -#if defined (VISP_HAVE_OPENCV) && defined (VISP_HAVE_DISPLAY) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) +#if defined(VISP_HAVE_MODULE_MBT) && defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(VISP_HAVE_DISPLAY) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) +#include <visp3/core/vpDebug.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/mbt/vpMbEdgeKltTracker.h> -#define GETOPTARGS "x:m:i:n:dchtfCo" +#define GETOPTARGS "x:m:i:n:dchtfColw" void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, std::string &ipath, std::string &configFile, std::string &modelFile, std::string &initFile, bool &displayFeatures, bool &click_allowed, bool &display, - bool& cao3DModel, bool& trackCylinder, bool &useOgre); + bool& cao3DModel, bool& trackCylinder, bool &useOgre, bool &useScanline); void usage(const char *name, const char *badparam) { @@ -78,7 +75,7 @@ Example of tracking based on the 3D model.\n\ SYNOPSIS\n\ %s [-i <test image path>] [-x <config file>]\n\ [-m <model name>] [-n <initialisation file base name>]\n\ - [-t] [-c] [-d] [-h] [-f] [-C]", + [-t] [-c] [-d] [-h] [-f] [-C] [-o] [-w] [-l]", name ); fprintf(stdout, "\n\ @@ -129,6 +126,12 @@ OPTIONS: \n\ \n\ -o\n\ Use Ogre3D for visibility tests\n\ +\n\ + -w\n\ + When Ogre3D is enable [-o] show Ogre3D configuration dialog thatallows to set the renderer.\n\ +\n\ + -l\n\ + Use the scanline for visibility tests\n\ \n\ -h \n\ Print the help.\n\n"); @@ -140,7 +143,7 @@ OPTIONS: \n\ bool getOptions(int argc, const char **argv, std::string &ipath, std::string &configFile, std::string &modelFile, std::string &initFile, bool &displayFeatures, bool &click_allowed, bool &display, - bool& cao3DModel, bool& trackCylinder, bool &useOgre) + bool& cao3DModel, bool& trackCylinder, bool &useOgre, bool &showOgreConfigDialog, bool &useScanline) { const char *optarg_; int c; @@ -156,7 +159,9 @@ bool getOptions(int argc, const char **argv, std::string &ipath, std::string &co case 'c': click_allowed = false; break; case 'd': display = false; break; case 'C': trackCylinder = false; break; - case 'o' : useOgre = true; break; + case 'o': useOgre = true; break; + case 'l': useScanline = true; break; + case 'w': showOgreConfigDialog = true; break; case 'h': usage(argv[0], NULL); return false; break; default: @@ -195,6 +200,8 @@ main(int argc, const char ** argv) bool cao3DModel = false; bool trackCylinder = true; bool useOgre = false; + bool showOgreConfigDialog = false; + bool useScanline = false; bool quit = false; // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value @@ -205,7 +212,9 @@ main(int argc, const char ** argv) ipath = env_ipath; // Read the command line options - if (!getOptions(argc, argv, opt_ipath, opt_configFile, opt_modelFile, opt_initFile, displayFeatures, opt_click_allowed, opt_display, cao3DModel, trackCylinder, useOgre)) { + if (!getOptions(argc, argv, opt_ipath, opt_configFile, opt_modelFile, opt_initFile, displayFeatures, + opt_click_allowed, opt_display, cao3DModel, trackCylinder, useOgre, showOgreConfigDialog, + useScanline)) { return (-1); } @@ -254,7 +263,7 @@ main(int argc, const char ** argv) modelFile = vpIoTools::createFilePath(opt_ipath, modelFileCao); } else{ -#ifdef VISP_HAVE_COIN +#ifdef VISP_HAVE_COIN3D modelFile = vpIoTools::createFilePath(opt_ipath, modelFileWrl); #else std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl; @@ -267,7 +276,7 @@ main(int argc, const char ** argv) modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao); } else{ -#ifdef VISP_HAVE_COIN +#ifdef VISP_HAVE_COIN3D modelFile = vpIoTools::createFilePath(env_ipath, modelFileWrl); #else std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl; @@ -340,7 +349,6 @@ main(int argc, const char ** argv) me.setMu1(0.5); me.setMu2(0.5); me.setSampleStep(4); - me.setNbTotalSample(250); vpKltOpencv klt; klt.setMaxFeatures(10000); @@ -370,6 +378,11 @@ main(int argc, const char ** argv) // Tells if the tracker has to use Ogre3D for visibility tests tracker.setOgreVisibilityTest(useOgre); + if (useOgre) + tracker.setOgreShowConfigDialog(showOgreConfigDialog); + + // Tells if the tracker has to use the scanline visibility tests + tracker.setScanLineVisibilityTest(useScanline); // Retrieve the camera parameters from the tracker tracker.getCameraParameters(cam); @@ -442,7 +455,6 @@ main(int argc, const char ** argv) me.setMu1(0.5); me.setMu2(0.5); me.setSampleStep(4); - me.setNbTotalSample(250); vpKltOpencv klt; klt.setMaxFeatures(10000); @@ -469,28 +481,29 @@ main(int argc, const char ** argv) tracker.loadModel(modelFile); tracker.setCameraParameters(cam); tracker.setOgreVisibilityTest(useOgre); + tracker.setScanLineVisibilityTest(useScanline); tracker.initFromPose(I, cMo); } // Test to set an initial pose if (reader.getFrameIndex() == reader.getFirstFrameIndex() + 50) { - cMo.buildFrom(0.04371844921, 0.08438820979, 0.5382029442, 2.200417277, 0.873535825, -0.3479076844); + cMo.buildFrom(0.0439540832, 0.0845870108, 0.5477322481, 2.179498458, 0.8611798108, -0.3491961946); vpTRACE("Test set pose"); tracker.setPose(I, cMo); - if (opt_display) { - // display the 3D model - tracker.display(I, cMo, cam, vpColor::darkRed); - // display the frame - vpDisplay::displayFrame (I, cMo, cam, 0.05); -// if (opt_click_allowed) { -// vpDisplay::flush(I); -// vpDisplay::getClick(I); -// } - } +// if (opt_display) { +// // display the 3D model +// tracker.display(I, cMo, cam, vpColor::darkRed); +// // display the frame +// vpDisplay::displayFrame (I, cMo, cam, 0.05); +//// if (opt_click_allowed) { +//// vpDisplay::flush(I); +//// vpDisplay::getClick(I); +//// } +// } } // track the object: stop tracking from frame 40 to 50 - if (reader.getFrameIndex() - reader.getFirstFrameIndex() < 40 || reader.getFrameIndex() > reader.getFirstFrameIndex() + 50) { + if (reader.getFrameIndex() - reader.getFirstFrameIndex() < 40 || reader.getFrameIndex() - reader.getFirstFrameIndex() >= 50) { tracker.track(I); tracker.getPose(cMo); if (opt_display) { @@ -525,7 +538,7 @@ main(int argc, const char ** argv) vpXmlParser::cleanup(); #endif -#if defined(VISP_HAVE_COIN) && (COIN_MAJOR_VERSION == 3) +#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3) // Cleanup memory allocated by Coin library used to load a vrml model in vpMbEdgeKltTracker::loadModel() // We clean only if Coin was used. if(! cao3DModel) @@ -544,7 +557,7 @@ main(int argc, const char ** argv) int main() { - std::cout << "OpenCV and display are required." << std::endl; + std::cout << "visp_mbt, visp_gui modules and OpenCV are required to run this example." << std::endl; return 0; } diff --git a/example/tracking/mbtEdgeTracking.cpp b/example/tracking/mbtEdgeTracking.cpp index 04ec00cd4b992d1b268affea8315fbea4106d55a..e471316dd1cdde0611de2b8f8993a2f2469423a3 100644 --- a/example/tracking/mbtEdgeTracking.cpp +++ b/example/tracking/mbtEdgeTracking.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: mbtEdgeTracking.cpp 5156 2015-01-13 07:07:08Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of model based tracking. * @@ -47,29 +43,31 @@ \brief Example of model based tracking on an image sequence containing a cube. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpMbEdgeTracker.h> -#include <visp/vpVideoReader.h> -#include <visp/vpParseArgv.h> - -#if defined (VISP_HAVE_DISPLAY) - -#define GETOPTARGS "x:m:i:n:dchtfCo" +#include <iostream> +#include <visp3/core/vpConfig.h> + +#if defined(VISP_HAVE_MODULE_MBT) && defined(VISP_HAVE_DISPLAY) + +#include <visp3/core/vpDebug.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/mbt/vpMbEdgeTracker.h> + +#define GETOPTARGS "x:m:i:n:dchtfColw" void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, std::string &ipath, std::string &configFile, std::string &modelFile, std::string &initFile, bool &displayFeatures, bool &click_allowed, bool &display, - bool& cao3DModel, bool& trackCylinder, bool &useOgre); + bool& cao3DModel, bool& trackCylinder, bool &useOgre, bool &useScanline); void usage(const char *name, const char *badparam) { @@ -79,7 +77,7 @@ Example of tracking based on the 3D model.\n\ SYNOPSIS\n\ %s [-i <test image path>] [-x <config file>]\n\ [-m <model name>] [-n <initialisation file base name>]\n\ - [-t] [-c] [-d] [-h] [-f] [-C]", + [-t] [-c] [-d] [-h] [-f] [-C] [-o] [-w] [-l]", name ); fprintf(stdout, "\n\ @@ -129,7 +127,13 @@ OPTIONS: \n\ execution of this program without humain intervention.\n\ \n\ -o\n\ - Use Ogre3D for visibility tests\n\ + Use Ogre3D for visibility tests.\n\ +\n\ + -w\n\ + When Ogre3D is enable [-o] show Ogre3D configuration dialog thatallows to set the renderer.\n\ +\n\ + -l\n\ + Use the scanline for visibility tests\n\ \n\ -h \n\ Print the help.\n\n"); @@ -141,7 +145,7 @@ OPTIONS: \n\ bool getOptions(int argc, const char **argv, std::string &ipath, std::string &configFile, std::string &modelFile, std::string &initFile, bool &displayFeatures, bool &click_allowed, bool &display, - bool& cao3DModel, bool& trackCylinder, bool &useOgre) + bool& cao3DModel, bool& trackCylinder, bool &useOgre, bool &showOgreConfigDialog, bool &useScanline) { const char *optarg_; int c; @@ -158,6 +162,8 @@ bool getOptions(int argc, const char **argv, std::string &ipath, std::string &co case 'd': display = false; break; case 'C': trackCylinder = false; break; case 'o': useOgre = true; break; + case 'l': useScanline = true; break; + case 'w': showOgreConfigDialog = true; break; case 'h': usage(argv[0], NULL); return false; break; default: @@ -196,6 +202,8 @@ main(int argc, const char ** argv) bool cao3DModel = false; bool trackCylinder = true; bool useOgre = false; + bool showOgreConfigDialog = false; + bool useScanline = false; bool quit = false; // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value @@ -207,7 +215,9 @@ main(int argc, const char ** argv) // Read the command line options - if (!getOptions(argc, argv, opt_ipath, opt_configFile, opt_modelFile, opt_initFile, displayFeatures, opt_click_allowed, opt_display, cao3DModel, trackCylinder, useOgre)) { + if (!getOptions(argc, argv, opt_ipath, opt_configFile, opt_modelFile, opt_initFile, displayFeatures, + opt_click_allowed, opt_display, cao3DModel, trackCylinder, useOgre, showOgreConfigDialog, + useScanline)) { return (-1); } @@ -256,7 +266,7 @@ main(int argc, const char ** argv) modelFile = vpIoTools::createFilePath(opt_ipath, modelFileCao); } else{ -#ifdef VISP_HAVE_COIN +#ifdef VISP_HAVE_COIN3D modelFile = vpIoTools::createFilePath(opt_ipath, modelFileWrl); #else std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl; @@ -269,7 +279,7 @@ main(int argc, const char ** argv) modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao); } else{ -#ifdef VISP_HAVE_COIN +#ifdef VISP_HAVE_COIN3D modelFile = vpIoTools::createFilePath(env_ipath, modelFileWrl); #else std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl; @@ -342,7 +352,6 @@ main(int argc, const char ** argv) me.setMu1(0.5); me.setMu2(0.5); me.setSampleStep(4); - me.setNbTotalSample(250); tracker.setCameraParameters(cam); tracker.setMovingEdge(me); @@ -359,6 +368,11 @@ main(int argc, const char ** argv) // Tells if the tracker has to use Ogre3D for visibility tests tracker.setOgreVisibilityTest(useOgre); + if (useOgre) + tracker.setOgreShowConfigDialog(showOgreConfigDialog); + + // Tells if the tracker has to use the scanline visibility tests + tracker.setScanLineVisibilityTest(useScanline); // Retrieve the camera parameters from the tracker tracker.getCameraParameters(cam); @@ -431,7 +445,6 @@ main(int argc, const char ** argv) me.setMu1(0.5); me.setMu2(0.5); me.setSampleStep(4); - me.setNbTotalSample(250); tracker.setCameraParameters(cam); tracker.setMovingEdge(me); @@ -445,28 +458,29 @@ main(int argc, const char ** argv) tracker.loadModel(modelFile); tracker.setCameraParameters(cam); tracker.setOgreVisibilityTest(useOgre); + tracker.setScanLineVisibilityTest(useScanline); tracker.initFromPose(I, cMo); } // Test to set an initial pose if (reader.getFrameIndex() == reader.getFirstFrameIndex() + 50) { - cMo.buildFrom(0.04371844921, 0.08438820979, 0.5382029442, 2.200417277, 0.873535825, -0.3479076844); + cMo.buildFrom(0.0439540832, 0.0845870108, 0.5477322481, 2.179498458, 0.8611798108, -0.3491961946); vpTRACE("Test set pose"); tracker.setPose(I, cMo); - if (opt_display) { - // display the 3D model - tracker.display(I, cMo, cam, vpColor::darkRed); - // display the frame - vpDisplay::displayFrame (I, cMo, cam, 0.05); -// if (opt_click_allowed) { -// vpDisplay::flush(I); -// vpDisplay::getClick(I); -// } - } +// if (opt_display) { +// // display the 3D model +// tracker.display(I, cMo, cam, vpColor::darkRed); +// // display the frame +// vpDisplay::displayFrame (I, cMo, cam, 0.05); +//// if (opt_click_allowed) { +//// vpDisplay::flush(I); +//// vpDisplay::getClick(I); +//// } +// } } // track the object: stop tracking from frame 40 to 50 - if (reader.getFrameIndex() - reader.getFirstFrameIndex() < 40 || reader.getFrameIndex() > reader.getFirstFrameIndex() + 50) { + if (reader.getFrameIndex() - reader.getFirstFrameIndex() < 40 || reader.getFrameIndex() - reader.getFirstFrameIndex() >= 50) { tracker.track(I); tracker.getPose(cMo); if (opt_display) { @@ -502,7 +516,7 @@ main(int argc, const char ** argv) vpXmlParser::cleanup(); #endif -#if defined(VISP_HAVE_COIN) && (COIN_MAJOR_VERSION == 3) +#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3) // Cleanup memory allocated by Coin library used to load a vrml model in vpMbEdgeTracker::loadModel() // We clean only if Coin was used. if(! cao3DModel) @@ -521,7 +535,7 @@ main(int argc, const char ** argv) int main() { - std::cout << "Display is required to run this example." << std::endl; + std::cout << "visp_mbt module is required to run this example." << std::endl; return 0; } diff --git a/example/tracking/mbtKltTracking.cpp b/example/tracking/mbtKltTracking.cpp index 080b67d934c685e712651fe0dc2dbc322d53fa63..fffc5085f36e13256e814e996fbd3bbf8cddf55d 100644 --- a/example/tracking/mbtKltTracking.cpp +++ b/example/tracking/mbtKltTracking.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: mbtTracking.cpp 3957 2012-11-07 15:22:30Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of MBT KLT Tracking. * @@ -45,25 +41,26 @@ \brief Example of MBT KLT Tracking on an image sequence containing a cube. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpMbKltTracker.h> -#include <visp/vpVideoReader.h> -#include <visp/vpParseArgv.h> +#include <iostream> +#include <visp3/core/vpConfig.h> -#if defined (VISP_HAVE_OPENCV) && defined (VISP_HAVE_DISPLAY) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) +#if defined(VISP_HAVE_MODULE_MBT) && defined(VISP_HAVE_MODULE_KLT) && defined(VISP_HAVE_OPENCV) && defined(VISP_HAVE_DISPLAY) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) +#include <visp3/core/vpDebug.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/mbt/vpMbKltTracker.h> -#define GETOPTARGS "x:m:i:n:dchtfo" +#define GETOPTARGS "x:m:i:n:dchtfolw" void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, std::string &ipath, std::string &configFile, std::string &modelFile, @@ -78,7 +75,7 @@ Example of tracking based on the 3D model.\n\ SYNOPSIS\n\ %s [-i <test image path>] [-x <config file>]\n\ [-m <model name>] [-n <initialisation file base name>]\n\ - [-t] [-c] [-d] [-h] [-f]", + [-t] [-c] [-d] [-h] [-f] [-o] [-w] [-l]", name ); fprintf(stdout, "\n\ @@ -124,6 +121,12 @@ OPTIONS: \n\ \n\ -o\n\ Use Ogre3D for visibility tests\n\ +\n\ + -w\n\ + When Ogre3D is enable [-o] show Ogre3D configuration dialog thatallows to set the renderer.\n\ +\n\ + -l\n\ + Use the scanline for visibility tests\n\ \n\ -h \n\ Print the help.\n\n"); @@ -135,7 +138,7 @@ OPTIONS: \n\ bool getOptions(int argc, const char **argv, std::string &ipath, std::string &configFile, std::string &modelFile, std::string &initFile, bool &displayKltPoints, bool &click_allowed, bool &display, - bool& cao3DModel, bool &useOgre) + bool& cao3DModel, bool &useOgre, bool &showOgreConfigDialog, bool &useScanline) { const char *optarg_; int c; @@ -151,6 +154,8 @@ bool getOptions(int argc, const char **argv, std::string &ipath, std::string &co case 'c': click_allowed = false; break; case 'd': display = false; break; case 'o': useOgre = true; break; + case 'l': useScanline = true; break; + case 'w': showOgreConfigDialog = true; break; case 'h': usage(argv[0], NULL); return false; break; default: @@ -188,6 +193,8 @@ main(int argc, const char ** argv) bool opt_display = true; bool cao3DModel = false; bool useOgre = false; + bool showOgreConfigDialog = false; + bool useScanline = false; bool quit = false; // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value @@ -198,7 +205,8 @@ main(int argc, const char ** argv) ipath = env_ipath; // Read the command line options - if (!getOptions(argc, argv, opt_ipath, opt_configFile, opt_modelFile, opt_initFile, displayKltPoints, opt_click_allowed, opt_display, cao3DModel, useOgre)) { + if (!getOptions(argc, argv, opt_ipath, opt_configFile, opt_modelFile, opt_initFile, displayKltPoints, + opt_click_allowed, opt_display, cao3DModel, useOgre, showOgreConfigDialog, useScanline)) { return (-1); } @@ -240,7 +248,7 @@ main(int argc, const char ** argv) modelFile = vpIoTools::createFilePath(opt_ipath, modelFileCao); } else{ -#ifdef VISP_HAVE_COIN +#ifdef VISP_HAVE_COIN3D modelFile = vpIoTools::createFilePath(opt_ipath, modelFileWrl); #else std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl; @@ -253,7 +261,7 @@ main(int argc, const char ** argv) modelFile = vpIoTools::createFilePath(env_ipath, modelFileCao); } else{ -#ifdef VISP_HAVE_COIN +#ifdef VISP_HAVE_COIN3D modelFile = vpIoTools::createFilePath(env_ipath, modelFileWrl); #else std::cerr << "Coin is not detected in ViSP. Use the .cao model instead." << std::endl; @@ -345,6 +353,11 @@ main(int argc, const char ** argv) // Tells if the tracker has to use Ogre3D for visibility tests tracker.setOgreVisibilityTest(useOgre); + if (useOgre) + tracker.setOgreShowConfigDialog(showOgreConfigDialog); + + // Tells if the tracker has to use the scanline visibility tests + tracker.setScanLineVisibilityTest(useScanline); // Retrieve the camera parameters from the tracker tracker.getCameraParameters(cam); @@ -433,28 +446,29 @@ main(int argc, const char ** argv) tracker.loadModel(modelFile); tracker.setCameraParameters(cam); tracker.setOgreVisibilityTest(useOgre); + tracker.setScanLineVisibilityTest(useScanline); tracker.initFromPose(I, cMo); } // Test to set an initial pose if (reader.getFrameIndex() == reader.getFirstFrameIndex() + 50) { - cMo.buildFrom(0.04371844921, 0.08438820979, 0.5382029442, 2.200417277, 0.873535825, -0.3479076844); + cMo.buildFrom(0.0439540832, 0.0845870108, 0.5477322481, 2.179498458, 0.8611798108, -0.3491961946); vpTRACE("Test set pose"); tracker.setPose(I, cMo); - if (opt_display) { - // display the 3D model - tracker.display(I, cMo, cam, vpColor::darkRed); - // display the frame - vpDisplay::displayFrame (I, cMo, cam, 0.05); -// if (opt_click_allowed) { -// vpDisplay::flush(I); -// vpDisplay::getClick(I); -// } - } +// if (opt_display) { +// // display the 3D model +// tracker.display(I, cMo, cam, vpColor::darkRed); +// // display the frame +// vpDisplay::displayFrame (I, cMo, cam, 0.05); +//// if (opt_click_allowed) { +//// vpDisplay::flush(I); +//// vpDisplay::getClick(I); +//// } +// } } // track the object: stop tracking from frame 40 to 50 - if (reader.getFrameIndex() - reader.getFirstFrameIndex() < 40 || reader.getFrameIndex() > reader.getFirstFrameIndex() + 50) { + if (reader.getFrameIndex() - reader.getFirstFrameIndex() < 40 || reader.getFrameIndex() - reader.getFirstFrameIndex() >= 50) { tracker.track(I); tracker.getPose(cMo); if (opt_display) { @@ -473,11 +487,11 @@ main(int argc, const char ** argv) } } - // Uncomment if you want to print the covariance matrix. + // Uncomment if you want to print the covariance matrix. // Make sure tracker.setCovarianceComputation(true) has been called (uncomment below). // std::cout << tracker.getCovarianceMatrix() << std::endl << std::endl; - vpDisplay::flush(I); + vpDisplay::flush(I) ; } if (opt_click_allowed && !quit) { vpDisplay::getClick(I); @@ -490,7 +504,7 @@ main(int argc, const char ** argv) vpXmlParser::cleanup(); #endif -#if defined(VISP_HAVE_COIN) && (COIN_MAJOR_VERSION == 3) +#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3) // Cleanup memory allocated by Coin library used to load a vrml model in vpMbKltTracker::loadModel() // We clean only if Coin was used. if(! cao3DModel) @@ -509,7 +523,7 @@ main(int argc, const char ** argv) int main() { - std::cout << "OpenCV and display are required." << std::endl; + std::cout << "visp_mbt, visp_gui modules and OpenCV are required to run this example." << std::endl; return 0; } diff --git a/example/tracking/templateTracker.cpp b/example/tracking/templateTracker.cpp index 26f397608650f18ea0a5071ea289212856e443d8..6993f2a2ef86b5e7fbc1792154c5acf23689cada 100644 --- a/example/tracking/templateTracker.cpp +++ b/example/tracking/templateTracker.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: templateTracker.cpp 5002 2014-11-24 08:18:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -46,36 +43,45 @@ \brief Example of template tracking. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpVideoReader.h> -#include <visp/vpParseArgv.h> - -#include <visp/vpTemplateTrackerSSD.h> -#include <visp/vpTemplateTrackerSSDForwardAdditional.h> -#include <visp/vpTemplateTrackerSSDForwardCompositional.h> -#include <visp/vpTemplateTrackerSSDInverseCompositional.h> -#include <visp/vpTemplateTrackerSSDESM.h> -#include <visp/vpTemplateTrackerZNCCForwardAdditional.h> -#include <visp/vpTemplateTrackerZNCCInverseCompositional.h> - -#include <visp/vpTemplateTrackerWarpAffine.h> -#include <visp/vpTemplateTrackerWarpHomography.h> -#include <visp/vpTemplateTrackerWarpHomographySL3.h> -#include <visp/vpTemplateTrackerWarpSRT.h> -#include <visp/vpTemplateTrackerWarpTranslation.h> - -#if defined (VISP_HAVE_DISPLAY) - +#include <iostream> +#include <visp3/core/vpConfig.h> + +#if defined(VISP_HAVE_MODULE_TT) && defined (VISP_HAVE_DISPLAY) + +#include <visp3/core/vpDebug.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/io/vpParseArgv.h> + +#include <visp3/tt/vpTemplateTrackerSSD.h> +#include <visp3/tt/vpTemplateTrackerSSDForwardAdditional.h> +#include <visp3/tt/vpTemplateTrackerSSDForwardCompositional.h> +#include <visp3/tt/vpTemplateTrackerSSDInverseCompositional.h> +#include <visp3/tt/vpTemplateTrackerSSDESM.h> +#include <visp3/tt/vpTemplateTrackerZNCCForwardAdditional.h> +#include <visp3/tt/vpTemplateTrackerZNCCInverseCompositional.h> + +#include <visp3/tt/vpTemplateTrackerWarpAffine.h> +#include <visp3/tt/vpTemplateTrackerWarpHomography.h> +#include <visp3/tt/vpTemplateTrackerWarpHomographySL3.h> +#include <visp3/tt/vpTemplateTrackerWarpSRT.h> +#include <visp3/tt/vpTemplateTrackerWarpTranslation.h> +#include <visp3/tt/vpTemplateTrackerWarpRT.h> + +#ifdef VISP_HAVE_MODULE_TT_MI +# include <visp3/tt_mi/vpTemplateTrackerMIESM.h> +# include <visp3/tt_mi/vpTemplateTrackerMIForwardAdditional.h> +# include <visp3/tt_mi/vpTemplateTrackerMIForwardCompositional.h> +# include <visp3/tt_mi/vpTemplateTrackerMIInverseCompositional.h> +#endif #define GETOPTARGS "cdhi:l:pt:w:" @@ -85,7 +91,11 @@ typedef enum { WARP_HOMOGRAPHY, WARP_HOMOGRAPHY_SL3, WARP_SRT, - WARP_TRANSLATION + WARP_TRANSLATION, +#ifdef VISP_HAVE_MODULE_TT_MI + WARP_RT, +#endif + WARP_LAST } WarpType; typedef enum { @@ -94,7 +104,14 @@ typedef enum { TRACKER_SSD_FORWARD_COMPOSITIONAL, TRACKER_SSD_INVERSE_COMPOSITIONAL, // The most efficient TRACKER_ZNCC_FORWARD_ADDITIONEL, - TRACKER_ZNCC_INVERSE_COMPOSITIONAL + TRACKER_ZNCC_INVERSE_COMPOSITIONAL, +#ifdef VISP_HAVE_MODULE_TT_MI + TRACKER_MI_ESM, + TRACKER_MI_FORWARD_ADDITIONAL, + TRACKER_MI_FORWARD_COMPOSITIONAL, + TRACKER_MI_INVERSE_COMPOSITIONAL, // The most efficient +#endif + TRACKER_LAST } TrackerType; #endif @@ -136,7 +153,22 @@ OPTIONS: Default\n\ -c\n\ Disable the mouse click. Useful to automaze the \n\ execution of this program without humain intervention.\n\ - \n\ + \n", last_frame); + +#ifdef VISP_HAVE_MODULE_TT_MI + fprintf(stdout, "\n\ + -w <warp type=[0,1,2,3,4,5]> %d\n\ + Set the model used to warp the template. \n\ + Authorized values are:\n\ + %d : Affine\n\ + %d : Homography\n\ + %d : Homography in SL3\n\ + %d : SRT (scale, rotation, translation)\n\ + %d : RT (rotation, translation)\n\ + %d : Translation\n\n", + (int)warp_type, (int)WARP_AFFINE, (int)WARP_HOMOGRAPHY, (int)WARP_HOMOGRAPHY_SL3, (int)WARP_SRT, (int)WARP_TRANSLATION, (int)WARP_RT); +#else + fprintf(stdout, "\n\ -w <warp type=[0,1,2,3,4]> %d\n\ Set the model used to warp the template. \n\ Authorized values are:\n\ @@ -144,9 +176,13 @@ OPTIONS: Default\n\ %d : Homography\n\ %d : Homography in SL3\n\ %d : SRT (scale, rotation, translation)\n\ - %d : Translation\n\ - \n\ - -t <tracker type=[0,1,2,3,4,5]> %d\n\ + %d : Translation\n\n", + (int)warp_type, (int)WARP_AFFINE, (int)WARP_HOMOGRAPHY, (int)WARP_HOMOGRAPHY_SL3, (int)WARP_SRT, (int)WARP_TRANSLATION); +#endif + +#ifdef VISP_HAVE_MODULE_TT_MI + fprintf(stdout, "\n\ + -t <tracker type=[0,1,2,3,4,5,6,7,8,9]> %d\n\ Set the tracker used to track the template. \n\ Authorized values are:\n\ %d : SSD ESM\n\ @@ -155,18 +191,40 @@ OPTIONS: Default\n\ %d : SSD inverse compositional\n\ %d : ZNCC forward additional\n\ %d : ZNCC inverse compositional\n\ - \n\ - -p\n\ - Enable pyramidal tracking.\n\ - \n\ - -h \n\ - Print the help.\n\n", - last_frame, (int)warp_type, - (int)WARP_AFFINE, (int)WARP_HOMOGRAPHY, (int)WARP_HOMOGRAPHY_SL3, (int)WARP_SRT, (int)WARP_TRANSLATION, + %d : MI ESM\n\ + %d : MI forward additional\n\ + %d : MI forward compositional\n\ + %d : MI inverse compositional\n\n", + (int)tracker_type, + (int)TRACKER_SSD_ESM, (int)TRACKER_SSD_FORWARD_ADDITIONAL, (int)TRACKER_SSD_FORWARD_COMPOSITIONAL, + (int)TRACKER_SSD_INVERSE_COMPOSITIONAL, (int)TRACKER_ZNCC_FORWARD_ADDITIONEL, + (int)TRACKER_ZNCC_INVERSE_COMPOSITIONAL, + (int)TRACKER_MI_ESM, (int)TRACKER_MI_FORWARD_ADDITIONAL, (int)TRACKER_MI_FORWARD_COMPOSITIONAL, + (int)TRACKER_MI_INVERSE_COMPOSITIONAL); +#else + fprintf(stdout, "\n\ + -t <tracker type=[0,1,2,3,4,5]> %d\n\ + Set the tracker used to track the template. \n\ + Authorized values are:\n\ + %d : SSD ESM\n\ + %d : SSD forward additional\n\ + %d : SSD forward compositional\n\ + %d : SSD inverse compositional\n\ + %d : ZNCC forward additional\n\ + %d : ZNCC inverse compositional\n\n", (int)tracker_type, (int)TRACKER_SSD_ESM, (int)TRACKER_SSD_FORWARD_ADDITIONAL, (int)TRACKER_SSD_FORWARD_COMPOSITIONAL, (int)TRACKER_SSD_INVERSE_COMPOSITIONAL, (int)TRACKER_ZNCC_FORWARD_ADDITIONEL, (int)TRACKER_ZNCC_INVERSE_COMPOSITIONAL); + +#endif + fprintf(stdout, "\n\ + -p\n\ + Enable pyramidal tracking.\n\ + \n\ + -h \n\ + Print the help.\n\n"); + if (badparam) fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); } @@ -195,13 +253,13 @@ bool getOptions(int argc, const char **argv, std::string &ipath, bool &click_all } } - if (warp_type > WARP_TRANSLATION) { + if (warp_type >= WARP_LAST) { usage(argv[0], NULL, warp_type, tracker_type, last_frame); std::cerr << "ERROR: " << std::endl; std::cerr << " Bad argument -w <warp type> with \"warp type\"=" << (int)warp_type << std::endl << std::endl; return false; } - if (tracker_type > TRACKER_ZNCC_INVERSE_COMPOSITIONAL) { + if (tracker_type >= TRACKER_LAST) { usage(argv[0], NULL, warp_type, tracker_type, last_frame); std::cerr << "ERROR: " << std::endl; std::cerr << " Bad argument -t <tracker type> with \"tracker type\"=" << (int)tracker_type << std::endl << std::endl; @@ -310,6 +368,10 @@ main(int argc, const char ** argv) case WARP_HOMOGRAPHY_SL3: warp = new vpTemplateTrackerWarpHomographySL3; break; case WARP_SRT: warp = new vpTemplateTrackerWarpSRT; break; case WARP_TRANSLATION: warp = new vpTemplateTrackerWarpTranslation; break; +#ifdef VISP_HAVE_MODULE_TT_MI + case WARP_RT: warp = new vpTemplateTrackerWarpRT; break; +#endif + default: return 0; } vpTemplateTracker *tracker = NULL; @@ -320,6 +382,13 @@ main(int argc, const char ** argv) case TRACKER_SSD_INVERSE_COMPOSITIONAL: tracker = new vpTemplateTrackerSSDInverseCompositional(warp); break; case TRACKER_ZNCC_FORWARD_ADDITIONEL: tracker = new vpTemplateTrackerZNCCForwardAdditional(warp); break; case TRACKER_ZNCC_INVERSE_COMPOSITIONAL: tracker = new vpTemplateTrackerZNCCInverseCompositional(warp); break; +#ifdef VISP_HAVE_MODULE_TT_MI + case TRACKER_MI_ESM: tracker = new vpTemplateTrackerMIESM(warp); break; + case TRACKER_MI_FORWARD_ADDITIONAL: tracker = new vpTemplateTrackerMIForwardAdditional(warp); break; + case TRACKER_MI_FORWARD_COMPOSITIONAL: tracker = new vpTemplateTrackerMIForwardCompositional(warp); break; + case TRACKER_MI_INVERSE_COMPOSITIONAL: tracker = new vpTemplateTrackerMIInverseCompositional(warp); break; +#endif + default: return 0; } tracker->setSampling(2,2); @@ -421,7 +490,7 @@ main(int argc, const char ** argv) int main() { - std::cout << "No display is available." << std::endl; + std::cout << "visp_tt module or display not available." << std::endl; return 0; } diff --git a/example/tracking/trackDot.cpp b/example/tracking/trackDot.cpp index 7d895e6f80f64e1d74edf266e0a3c13b009da1b5..eeb269a6d99df13ad6091c6accf42105033b11cd 100644 --- a/example/tracking/trackDot.cpp +++ b/example/tracking/trackDot.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: trackDot.cpp 5108 2015-01-05 07:48:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of dot tracking. * @@ -53,26 +49,26 @@ Example of dot tracking on an image sequence using vpDot. */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> #include <stdio.h> #include <sstream> #include <iomanip> -#if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) +#if defined(VISP_HAVE_MODULE_BLOB) && (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDot.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/blob/vpDot.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> // List of allowed command line options #define GETOPTARGS "cdf:i:n:p:s:h" @@ -464,10 +460,11 @@ main(int argc, const char ** argv) } } #else -int -main() +#include <iostream> + +int main() { - vpERROR_TRACE("You do not have X11, GTK, GDI or OpenCV display functionalities..."); + std::cout << "visp_blob module or X11, GTK, GDI or OpenCV display functionalities are required..." << std::endl; } #endif diff --git a/example/tracking/trackDot2.cpp b/example/tracking/trackDot2.cpp index a659837d7f63d68a8a7d345e90fe2dddfaf88f3d..e5752887a367be6aa9eba3855db09d146fb27f54 100644 --- a/example/tracking/trackDot2.cpp +++ b/example/tracking/trackDot2.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: trackDot2.cpp 5108 2015-01-05 07:48:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of dot tracking. * @@ -45,26 +41,26 @@ \brief Example of dot tracking on an image sequence using vpDot2. */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> #include <stdio.h> #include <sstream> #include <iomanip> -#if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) +#if defined(VISP_HAVE_MODULE_BLOB) && (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDot2.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> // List of allowed command line options #define GETOPTARGS "cdf:i:n:p:s:h" @@ -511,10 +507,11 @@ main(int argc, const char ** argv) } } #else -int -main() +#include <iostream> + +int main() { - vpERROR_TRACE("You do not have X11, GTK, GDI or OpenCV display functionalities..."); + std::cout << "visp_me module or X11, GTK, GDI or OpenCV display functionalities are required..." << std::endl; } #endif diff --git a/example/tracking/trackDot2WithAutoDetection.cpp b/example/tracking/trackDot2WithAutoDetection.cpp index b05db3d0575d318310c3e5a12de228ba750c2a20..aaf7de4a86ab2046717bd20aa3df6ccd3630803f 100644 --- a/example/tracking/trackDot2WithAutoDetection.cpp +++ b/example/tracking/trackDot2WithAutoDetection.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: trackDot2WithAutoDetection.cpp 5108 2015-01-05 07:48:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test auto detection of dots. * @@ -50,26 +46,26 @@ Example of auto detection of dots using vpDot2. */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> #include <stdio.h> #include <sstream> #include <iomanip> -#if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) +#if defined(VISP_HAVE_MODULE_BLOB) && (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDot2.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> // List of allowed command line options #define GETOPTARGS "cdi:p:f:n:s:S:G:E:h" @@ -510,17 +506,11 @@ main(int argc, const char ** argv) } } #else -int -main() +#include <iostream> + +int main() { - vpERROR_TRACE("You do not have X11, GTK, GDI or OpenCV display functionalities..."); + std::cout << "visp_me module or X11, GTK, GDI or OpenCV display functionalities are required..." << std::endl; } #endif - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/example/tracking/trackKltOpencv.cpp b/example/tracking/trackKltOpencv.cpp index 5b2dd8004abbb034617e96bcdba4ac0ea0a961eb..d3995563d6e06012c4523bcc3df05c1a375e58bc 100644 --- a/example/tracking/trackKltOpencv.cpp +++ b/example/tracking/trackKltOpencv.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: trackKltOpencv.cpp 5108 2015-01-05 07:48:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of dot tracking. * @@ -45,27 +41,27 @@ \brief Example of KLT tracking using OpenCV library. */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdio.h> #include <sstream> #include <iomanip> #include <vector> -#if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV)) +#if defined(VISP_HAVE_MODULE_KLT) && (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined (VISP_HAVE_OPENCV)) #if defined (VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) -#include <visp/vpKltOpencv.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/klt/vpKltOpencv.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> // List of allowed command line options #define GETOPTARGS "cdf:i:n:p:s:h" @@ -448,10 +444,12 @@ main() } #endif #else -int -main() +#include <iostream> + +int main() { - vpERROR_TRACE("You do not have X11, GTK, GDI or OpenCV display functionalities..."); + std::cout << "visp_klt module or X11, GTK, GDI or OpenCV display functionalities are required..." << std::endl; } + #endif diff --git a/example/tracking/trackMeCircle.cpp b/example/tracking/trackMeCircle.cpp index 43bc4e97b3949f7d81a814a6b87d0055cee751bd..b2e48787017a513a20869fc12660e21bcdc49518 100644 --- a/example/tracking/trackMeCircle.cpp +++ b/example/tracking/trackMeCircle.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: trackMeCircle.cpp 5108 2015-01-05 07:48:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tracking of an ellipse. * @@ -51,27 +47,26 @@ Tracking of an ellipse using vpMe. */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> #include <stdio.h> #include <sstream> #include <iomanip> -#if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) +#if defined(VISP_HAVE_MODULE_ME) && (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpColor.h> -#include <visp/vpMeEllipse.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/me/vpMeEllipse.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> // List of allowed command line options #define GETOPTARGS "cdi:h" @@ -286,7 +281,6 @@ main(int argc, const char ** argv) me.setPointsToTrack(60) ; me.setThreshold(15000) ; - E1.setCircle(true) ; E1.setMe(&me) ; E1.setDisplay(vpMeSite::RANGE_RESULT) ; // If click is allowed, wait for a mouse click to select the points @@ -296,15 +290,14 @@ main(int argc, const char ** argv) } else { // Create a list of points to automate the test - unsigned int n=5 ; - vpImagePoint *ip = new vpImagePoint [n]; - ip[0].set_i( 39 ); ip[0].set_j( 136 ); - ip[1].set_i( 42 ); ip[1].set_j( 83 ); - ip[2].set_i( 86 ); ip[2].set_j( 55 ); - ip[3].set_i( 132 ); ip[3].set_j( 72 ); - ip[4].set_i( 145 ); ip[4].set_j( 134 ); - E1.initTracking(I, n, ip) ; - delete [] ip ; + std::vector<vpImagePoint> ip; + ip.push_back(vpImagePoint(39, 136)); + ip.push_back(vpImagePoint(42, 83)); + ip.push_back(vpImagePoint(86, 55)); + ip.push_back(vpImagePoint(132, 72)); + ip.push_back(vpImagePoint(145, 134)); + + E1.initTracking(I, ip) ; } if (opt_display) { @@ -332,10 +325,11 @@ main(int argc, const char ** argv) } } #else -int -main() +#include <iostream> + +int main() { - vpERROR_TRACE("You do not have X11, GTK, GDI or OpenCV display functionalities..."); + std::cout << "visp_me module or X11, GTK, GDI or OpenCV display functionalities are required..." << std::endl; } #endif diff --git a/example/tracking/trackMeEllipse.cpp b/example/tracking/trackMeEllipse.cpp index e35238549ccbe27bdfdc59922b677bedf34f777e..d082733def72206a3d65f3f8386fd717069a4d81 100644 --- a/example/tracking/trackMeEllipse.cpp +++ b/example/tracking/trackMeEllipse.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: trackMeEllipse.cpp 5108 2015-01-05 07:48:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tracking of an ellipse. * @@ -51,8 +47,8 @@ Tracking of an ellipse using vpMe. */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> @@ -60,20 +56,20 @@ #include <sstream> #include <iomanip> -#if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) +#if defined(VISP_HAVE_MODULE_ME) && (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpColor.h> -#include <visp/vpMeEllipse.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/me/vpMeEllipse.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> // List of allowed command line options #define GETOPTARGS "cdi:h" @@ -296,15 +292,14 @@ main(int argc, const char ** argv) E1.initTracking(I) ; else { // Create a list of points to automate the test - unsigned int n=5 ; - vpImagePoint *ip = new vpImagePoint [n]; - ip[0].set_i( 33 ); ip[0].set_j( 276 ); - ip[1].set_i( 83 ); ip[1].set_j( 126 ); - ip[2].set_i( 201 ); ip[2].set_j( 36 ); - ip[3].set_i( 243 ); ip[3].set_j( 164 ); - ip[4].set_i( 195 ); ip[4].set_j( 329 ); - E1.initTracking(I, n, ip) ; - delete [] ip ; + std::vector<vpImagePoint> ip; + ip.push_back(vpImagePoint(33, 276)); + ip.push_back(vpImagePoint(83, 126)); + ip.push_back(vpImagePoint(201, 36)); + ip.push_back(vpImagePoint(243, 164)); + ip.push_back(vpImagePoint(195, 329)); + + E1.initTracking(I, ip) ; } if (opt_display) { E1.display(I, vpColor::green) ; @@ -352,10 +347,11 @@ main(int argc, const char ** argv) } } #else -int -main() +#include <iostream> + +int main() { - vpERROR_TRACE("You do not have X11, GTK, GDI or OpenCV display functionalities..."); + std::cout << "visp_me module or X11, GTK, GDI or OpenCV display functionalities are required..." << std::endl; } #endif diff --git a/example/tracking/trackMeLine.cpp b/example/tracking/trackMeLine.cpp index c91695c428555b830f96517e0abca336b726fd8a..8f9dfdb14ee045d487ec0292858b1267b429289b 100644 --- a/example/tracking/trackMeLine.cpp +++ b/example/tracking/trackMeLine.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: trackMeLine.cpp 5108 2015-01-05 07:48:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tracking of a line. * @@ -51,32 +47,32 @@ Tracking of a line using vpMe. */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> #include <stdio.h> #include <sstream> #include <iomanip> -#if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) +#if defined(VISP_HAVE_MODULE_ME) && (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpColor.h> -#include <visp/vpMeLine.h> +#include <visp3/me/vpMeLine.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/visual_features/vpFeatureBuilder.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> // List of allowed command line options #define GETOPTARGS "cdi:h" @@ -364,10 +360,11 @@ main(int argc, const char ** argv) } #else -int -main() +#include <iostream> + +int main() { - vpERROR_TRACE("You do not have X11, GTK, GDI or OpenCV display functionalities..."); + std::cout << "visp_me module or X11, GTK, GDI or OpenCV display functionalities are required..." << std::endl; } #endif diff --git a/example/tracking/trackMeNurbs.cpp b/example/tracking/trackMeNurbs.cpp index eda500c4efaede87efaf59dd5f925edf2d7b43c2..6d2b6ac5d5987105f8b8525d8c43af83710bcadf 100644 --- a/example/tracking/trackMeNurbs.cpp +++ b/example/tracking/trackMeNurbs.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: trackMeNurbs.cpp 5108 2015-01-05 07:48:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tracking of a nurbs. * @@ -52,29 +48,29 @@ Tracking of a nurbs using vpMe. */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> #include <stdio.h> #include <sstream> #include <iomanip> -#if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) +#if defined(VISP_HAVE_MODULE_ME) && (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpColor.h> -#include <visp/vpMeNurbs.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> -#include <visp/vpVideoReader.h> +#include <visp3/me/vpMeNurbs.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpVideoReader.h> // List of allowed command line options #define GETOPTARGS "cdi:h" @@ -324,15 +320,16 @@ main(int argc, const char ** argv) return 0; } catch(vpException e) { - std::cout << "Catch an exception: " << e << std::endl; - return 1; + std::cout << "Catch an exception: " << e.getMessage() << std::endl; + return 0; } } #else -int -main() +#include <iostream> + +int main() { - vpERROR_TRACE("You do not have X11, GTK, GDI or OpenCV display functionalities..."); + std::cout << "visp_me module or X11, GTK, GDI or OpenCV display functionalities are required..." << std::endl; } #endif diff --git a/example/video/CMakeLists.txt b/example/video/CMakeLists.txt index 1b2a73e5ddb4fad24c6e3cc3962c69530e2f26d2..1f54cd37aa67668cb97f3d26f8d16376fe67f4c4 100644 --- a/example/video/CMakeLists.txt +++ b/example/video/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 2158 2009-05-07 07:24:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,37 +35,25 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -SET (SOURCE +project(example-video) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_io visp_gui) + +set(example_cpp videoReader.cpp imageSequenceReader.cpp ) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() -endforeach() - -# Add test -# To run some of these tests don't forget to set VISP_INPUT_IMAGE_PATH -# environment variable to the ViSP test sequences location. -# To get these sequence download ViSP-images.tar.gz from -# http://www.irisa.fr/lagadic/visp/visp.html -add_test(videoReader videoReader -c ${OPTION_TO_DESACTIVE_DISPLAY}) -add_test(imageSequenceReader imageSequenceReader -c ${OPTION_TO_DESACTIVE_DISPLAY}) + # Add test + get_filename_component(target ${cpp} NAME_WE) + add_test(${target} ${target} -c ${OPTION_TO_DESACTIVE_DISPLAY}) +endforeach() diff --git a/example/video/imageSequenceReader.cpp b/example/video/imageSequenceReader.cpp index 5880542ef014499385ec713a41f4a1dbceab362b..3d8b03a07c1e10233a7b9e03fbed112739038793 100644 --- a/example/video/imageSequenceReader.cpp +++ b/example/video/imageSequenceReader.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: imageDiskRW.cpp 2158 2009-05-07 07:24:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Reading an image sequence. * @@ -49,16 +45,16 @@ Reading an image sequence using vpVideoReader class. */ -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> -#include <visp/vpDebug.h> -#include <visp/vpVideoReader.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpDebug.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_GTK) diff --git a/example/video/videoReader.cpp b/example/video/videoReader.cpp index 4d6b365faaf817f5e7f4061ffed5c993aff7c016..dfbac7a7c8b7a8b9a699f73c902c96fc718e9ed9 100644 --- a/example/video/videoReader.cpp +++ b/example/video/videoReader.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: imageDiskRW.cpp 2158 2009-05-07 07:24:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Reading a video file. * @@ -49,17 +45,17 @@ Reading a video file using vpVideoReader class. */ -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> -#include <visp/vpDebug.h> -#include <visp/vpVideoReader.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpDebug.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_GTK) diff --git a/example/wireframe-simulator/CMakeLists.txt b/example/wireframe-simulator/CMakeLists.txt index 8678ea0d02fba9bc1745d97b6630376eed893f4e..ac38e2f932aaab069a257e6464b02479ecaa91a3 100644 --- a/example/wireframe-simulator/CMakeLists.txt +++ b/example/wireframe-simulator/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # @@ -38,33 +35,23 @@ # ############################################################################# -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - wireframeSimulator.cpp -) +project(example-wireframe-simulator) + +cmake_minimum_required(VERSION 2.6) -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) +find_package(VISP REQUIRED visp_core visp_robot visp_io visp_gui) - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) +set(example_cpp + wireframeSimulator.cpp +) - add_dependencies(visp_examples ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "examples") +foreach(cpp ${example_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "examples") endif() -endforeach() -# Add test -# To run some of these tests don't forget to set VISP_INPUT_IMAGE_PATH -# environment variable to the ViSP test sequences location. -# To get these sequence download ViSP-images.tar.gz from -# http://www.irisa.fr/lagadic/visp/visp.html -add_test(wireframeSimulator wireframeSimulator -c ${OPTION_TO_DESACTIVE_DISPLAY}) + # Add test + get_filename_component(target ${cpp} NAME_WE) + add_test(${target} ${target} -c ${OPTION_TO_DESACTIVE_DISPLAY}) +endforeach() diff --git a/example/wireframe-simulator/wireframeSimulator.cpp b/example/wireframe-simulator/wireframeSimulator.cpp index 46600a04ae99f17c62d12c0e445236045af6fa3b..2a26d541306e741c9cd9ccafbe260dc38dd33077 100644 --- a/example/wireframe-simulator/wireframeSimulator.cpp +++ b/example/wireframe-simulator/wireframeSimulator.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: wireframeSimulator.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Demonstration of the wireframe simulator * @@ -47,19 +43,19 @@ #include <stdlib.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpWireFrameSimulator.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/robot/vpWireFrameSimulator.h> #define GETOPTARGS "cdh" diff --git a/macros/have_visp.m4 b/macros/have_visp.m4 index 951eb3df63aa02ba5d18054d46aaaa9b7333e129..adf5d584986dc1a0363dcc00a60d6d25cdbdf280 100644 --- a/macros/have_visp.m4 +++ b/macros/have_visp.m4 @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: have_visp.m4 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # diff --git a/test/device/CMakeLists.txt b/modules/CMakeLists.txt similarity index 60% rename from test/device/CMakeLists.txt rename to modules/CMakeLists.txt index f61ebd21f80e10feee8cb9ac3d90af1cd0b6ddc0..1d88d57dd7c815c0cd22421946e1c6489ce50099 100644 --- a/test/device/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 3057 2011-02-11 13:17:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,40 +10,34 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: -# ViSP overall configuration file. +# ViSP configuration file. # # Authors: # Fabien Spindler # ############################################################################# -# Set SRC_SUBDIRS variable to all the sub directories we want to parse during -# the build process. -# -# If you add/remove a directory, modify here -SET (SRC_SUBDIRS - framegrabber - display -) +if(NOT VISP_MODULES_PATH) + set(VISP_MODULES_PATH "${CMAKE_CURRENT_SOURCE_DIR}") +endif() -# Build process propagation in the sub directories -SUBDIRS(${SRC_SUBDIRS}) +# extra modules are outside ViSP. Useful for contrib or specific additional modules +vp_glob_modules(${VISP_MODULES_PATH} EXTRA ${VISP_CONTRIB_MODULES_PATH}) diff --git a/modules/ar/CMakeLists.txt b/modules/ar/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..610606154b4c3065af7b29212da00aabffb0d072 --- /dev/null +++ b/modules/ar/CMakeLists.txt @@ -0,0 +1,183 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +# Add optional 3rd parties +set(opt_incs "") +set(opt_libs "") + +if(USE_OGRE) + if(NOT OGRE_BUILD_PLATFORM_IPHONE) + if(WIN32 OR APPLE) + set(Boost_USE_STATIC_LIBS TRUE) + else() + # Statically linking boost to a dynamic Ogre build doesn't work on Linux 64bit + set(Boost_USE_STATIC_LIBS ${OGRE_STATIC}) + endif() + if(MINGW) + # this is probably a bug in CMake: the boost find module tries to look for + # boost libraries with name libboost_*, but CMake already prefixes library + # search names with "lib". This is the workaround. + set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "") + endif() + #set(Boost_ADDITIONAL_VERSIONS "1.53.0" "1.52.0" "1.51.0" "1.50.0" "1.49.0" "1.48.0" "1.47.0" "1.46.0" "1.45.0" "1.44.0" "1.44" "1.44.0" "1.42" "1.42.0" "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" ) + # Components that need to be linked with. Since Ogre 1.9 we need not only boost_thread and boost_date_time, but also boost_system + set(OGRE_BOOST_COMPONENTS thread system date_time) + if(WIN32) + list(APPEND OGRE_BOOST_COMPONENTS chrono) + endif() + find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET) + mark_as_advanced(Boost_LIB_DIAGNOSTIC_DEFINITIONS Boost_DIR BOOST_THREAD_LIBRARY) + if(NOT Boost_FOUND) + set(OGRE_BOOST_COMPONENTS thread date_time) + if(WIN32) + list(APPEND OGRE_BOOST_COMPONENTS chrono) + endif() + find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET) + endif() + if(NOT Boost_FOUND) + # Try again with the other type of libs + set(Boost_USE_STATIC_LIBS NOT ${Boost_USE_STATIC_LIBS}) + find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET) + endif() + + if(Boost_FOUND) + # Set up referencing of Boost + #LIST(APPEND VISP_DEFS "-DBOOST_ALL_NO_LIB") + list(APPEND opt_incs ${Boost_INCLUDE_DIR}) + list(APPEND opt_libs ${Boost_LIBRARIES}) + endif() + endif() + + mark_as_advanced(OGRE_SAMPLES_INCLUDEPATH) + #message("OGRE_SAMPLES_INCLUDEPATH: ${OGRE_SAMPLES_INCLUDEPATH}") + if(OGRE_SAMPLES_INCLUDEPATH) + list(APPEND opt_incs ${OGRE_SAMPLES_INCLUDEPATH}) + endif() + + # hack to fix possible presence of NOTFOUND in OGRE_INCLUDE_DIRS + #message("OGRE_INCLUDE_DIRS: ${OGRE_INCLUDE_DIRS}") + foreach(inc_ ${OGRE_INCLUDE_DIRS}) + if(NOT ${inc_} MATCHES "NOTFOUND") + list(APPEND opt_incs ${inc_}) + endif() + endforeach() + list(APPEND opt_libs ${OGRE_LIBRARIES}) +endif(USE_OGRE) + +if(USE_OIS AND USE_OGRE) + list(APPEND opt_incs ${OIS_INCLUDE_DIR}) + list(APPEND opt_libs ${OIS_LIBRARIES}) + if(APPLE) + # With Ogre 1.7.4 and 1.8.1 to be able to link with libOIS.a, Cocoa framework is requested. + # This is a work around since it should come with FindOGRE.cmake + list(APPEND opt_libs "-framework Cocoa") + endif() +endif() + +if(USE_COIN3D) + if(WIN32) + add_definitions("-DCOIN_DLL") + endif() + list(APPEND opt_incs ${COIN3D_INCLUDE_DIRS}) + # On OSX cmake 2.8 found OpenGL but OPENGL_INCLUDE_DIR was set to NOT_FOUND + # We add a test to be sure that the OPENGL vars exist. + if(OPENGL_INCLUDE_DIR) + list(APPEND opt_incs ${OPENGL_INCLUDE_DIR}) + endif() + if(OPENGL_LIBRARIES) + list(APPEND opt_libs ${OPENGL_LIBRARIES}) + endif() + + list(APPEND opt_libs ${COIN3D_LIBRARIES}) + if(USE_SOWIN) + add_definitions("-DSOWIN_DLL") + list(APPEND opt_incs ${SOWIN_INCLUDE_DIRS}) + list(APPEND opt_libs ${SOWIN_LIBRARIES}) + endif() + + if(USE_SOQT AND USE_QT) + list(APPEND opt_incs ${SOQT_INCLUDE_DIRS}) + list(APPEND opt_incs ${QT_INCLUDE_DIR}) + list(APPEND opt_incs ${QT_INCLUDES}) + list(APPEND opt_libs ${SOQT_LIBRARIES}) + if(WIN32) + add_definitions("-DSOQT_DLL") + endif() + + # We manage QT libraries + if(DESIRED_QT_VERSION MATCHES 3) + #Add Qt3 libraries + set(VISP_HAVE_QT3_FOUND "yes") # for ViSP-third-party.txt + #message("QT_QT_LIBRARY ${QT_QT_LIBRARY}") + list(APPEND opt_libs ${QT_QT_LIBRARY}) + elseif(DESIRED_QT_VERSION MATCHES 4) + #Add Qt4 libraries + set(VISP_HAVE_QT4_FOUND "yes") # for ViSP-third-party.txt + #message("QT_QTGUI_LIBRARY ${QT_QTGUI_LIBRARY}") + #message("QT_QTGUI_LIBRARY_RELEASE ${QT_QTGUI_LIBRARY_RELEASE}") + #message("QT_QTGUI_LIBRARY_DEBUG ${QT_QTGUI_LIBRARY_DEBUG}") + if(QT_QTGUI_LIBRARY_RELEASE AND QT_QTCORE_LIBRARY_RELEASE AND QT_QTGUI_LIBRARY_DEBUG AND QT_QTCORE_LIBRARY_DEBUG) + list(APPEND opt_libs optimized ${QT_QTGUI_LIBRARY_RELEASE}) + list(APPEND opt_libs optimized ${QT_QTCORE_LIBRARY_RELEASE}) + list(APPEND opt_libs debug ${QT_QTGUI_LIBRARY_DEBUG}) + list(APPEND opt_libs debug ${QT_QTCORE_LIBRARY_DEBUG}) + elseif(QT_QTGUI_LIBRARY_RELEASE AND QT_QTCORE_LIBRARY_RELEASE) + list(APPEND opt_libs ${QT_QTGUI_LIBRARY_RELEASE}) + list(APPEND opt_libs ${QT_QTCORE_LIBRARY_RELEASE}) + elseif(QT_QTGUI_LIBRARY_DEBUG AND QT_QTCORE_LIBRARY_DEBUG) + list(APPEND opt_libs ${QT_QTGUI_LIBRARY_DEBUG}) + list(APPEND opt_libs ${QT_QTCORE_LIBRARY_DEBUG}) + endif() + endif() + + # Because in QT_DEFINITIONS defs are separated by ";", parse the + # QT_DEFINITIONS in order to build a space separated string + vp_list_remove_separator(QT_DEFINITIONS) + add_definitions(${QT_DEFINITIONS}) + add_definitions("-DQT_DLL") + endif(USE_SOQT AND USE_QT) + + if(USE_SOXT) + # OpenGL and SoXt are found + list(APPEND opt_libs ${SOXT_LIBRARIES}) + endif() +endif(USE_COIN3D) + +vp_add_module(ar visp_core OPTIONAL visp_io) +vp_glob_module_sources() +vp_module_include_directories(${opt_incs}) +vp_create_module(${opt_libs}) diff --git a/data/ogre-simulator/media/materials/scripts/Examples.material b/modules/ar/data/ogre-simulator/media/materials/scripts/Examples.material similarity index 100% rename from data/ogre-simulator/media/materials/scripts/Examples.material rename to modules/ar/data/ogre-simulator/media/materials/scripts/Examples.material diff --git a/data/ogre-simulator/media/materials/textures/grass_1024.jpg b/modules/ar/data/ogre-simulator/media/materials/textures/grass_1024.jpg similarity index 100% rename from data/ogre-simulator/media/materials/textures/grass_1024.jpg rename to modules/ar/data/ogre-simulator/media/materials/textures/grass_1024.jpg diff --git a/data/ogre-simulator/media/materials/textures/r2skin.jpg b/modules/ar/data/ogre-simulator/media/materials/textures/r2skin.jpg similarity index 100% rename from data/ogre-simulator/media/materials/textures/r2skin.jpg rename to modules/ar/data/ogre-simulator/media/materials/textures/r2skin.jpg diff --git a/data/ogre-simulator/media/models/robot.mesh b/modules/ar/data/ogre-simulator/media/models/robot.mesh similarity index 100% rename from data/ogre-simulator/media/models/robot.mesh rename to modules/ar/data/ogre-simulator/media/models/robot.mesh diff --git a/data/ogre-simulator/media/models/robot.skeleton b/modules/ar/data/ogre-simulator/media/models/robot.skeleton similarity index 100% rename from data/ogre-simulator/media/models/robot.skeleton rename to modules/ar/data/ogre-simulator/media/models/robot.skeleton diff --git a/src/simulator/coin-simulator/vpAR.h b/modules/ar/include/visp3/ar/vpAR.h similarity index 77% rename from src/simulator/coin-simulator/vpAR.h rename to modules/ar/include/visp3/ar/vpAR.h index 47ca36008182fc3d6d98eefc9e5a91f6edf77697..4618b65cb373544a9ed0f5cab796bed38a4a68b0 100644 --- a/src/simulator/coin-simulator/vpAR.h +++ b/modules/ar/include/visp3/ar/vpAR.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpAR.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Use to display an image behind the internal view of the simulator * used for augmented reality application @@ -57,26 +53,26 @@ #ifndef vpAR_HH #define vpAR_HH -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#ifdef VISP_HAVE_COIN_AND_GUI +#ifdef VISP_HAVE_COIN3D_AND_GUI // visp -#include <visp/vpDebug.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpCameraParameters.h> -#include <visp/vpSimulator.h> +#include <visp3/ar/vpSimulator.h> -#include <visp/vpViewer.h> -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> -#include <visp/vpTime.h> +#include <visp3/ar/vpViewer.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/core/vpTime.h> /*! \class vpAR - \ingroup RobotSimuWithViz + \ingroup group_ar_renderer \brief Implementation of an augmented reality viewer. @@ -89,13 +85,13 @@ The code below shows how to use the class. \code -#include <visp/vpConfig.h> -#include <visp/vpAR.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpImage.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/core/vpConfig.h> +#include <visp3/ar/vpAR.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpHomogeneousMatrix.h> -#ifdef VISP_HAVE_COIN_AND_GUI +#ifdef VISP_HAVE_COIN3D_AND_GUI static void *mainloopfunction(void *_simu) { vpAR *simu = (vpAR *)_simu ; @@ -117,7 +113,7 @@ static void *mainloopfunction(void *_simu) int main() { -#ifdef VISP_HAVE_COIN_AND_GUI +#ifdef VISP_HAVE_COIN3D_AND_GUI vpAR simu; //Camera parameters. vpCameraParameters cam(600,600,160,120); diff --git a/src/simulator/ogre-simulator/vpAROgre.h b/modules/ar/include/visp3/ar/vpAROgre.h similarity index 89% rename from src/simulator/ogre-simulator/vpAROgre.h rename to modules/ar/include/visp3/ar/vpAROgre.h index 7ce79b51b0d8a22aed1d6f09442d85ac8f4bbfc5..edda44a38ddb6e7e890d713d65ba3987d2d2da7d 100644 --- a/src/simulator/ogre-simulator/vpAROgre.h +++ b/modules/ar/include/visp3/ar/vpAROgre.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpAROgre.h 4931 2014-10-09 14:02:52Z ayol $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Augmented Reality viewer using Ogre3D. * @@ -52,19 +48,19 @@ #ifndef __VP_AROGRE__ #define __VP_AROGRE__ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_OGRE #include <list> -#include <visp/vpImage.h> -#include <visp/vpImageConvert.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpRGBa.h> -#include <visp/vpImageTools.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpRxyzVector.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpRxyzVector.h> #include <Ogre.h> #include <OgreFrameListener.h> @@ -76,7 +72,7 @@ /*! \class vpAROgre - \ingroup RobotSimuWithViz + \ingroup group_ar_renderer \brief Implementation of an augmented reality viewer. @@ -125,7 +121,7 @@ class VISP_EXPORT vpAROgre : public Ogre::FrameListener, public Ogre::WindowEven mOptionnalResourceLocation.push_back(resourceLocation); } - void addRotation(const std::string &name, const vpRotationMatrix &wRo); + void addRotation(const std::string &sceneName, const vpRotationMatrix &wRo); bool continueRendering(void); @@ -155,7 +151,7 @@ class VISP_EXPORT vpAROgre : public Ogre::FrameListener, public Ogre::WindowEven */ inline double getNearClippingDistance() const { return mNearClipping; } - vpTranslationVector getPosition(const std::string &name)const; + vpTranslationVector getPosition(const std::string &sceneName)const; void getRenderingOutput(vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo); @@ -182,7 +178,7 @@ class VISP_EXPORT vpAROgre : public Ogre::FrameListener, public Ogre::WindowEven virtual bool keyReleased( const OIS::KeyEvent & /*e*/) { return true; } #endif - void load(const std::string &name, const std::string &model); + void load(const std::string &entityName, const std::string &model); bool renderOneFrame(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMw); @@ -223,9 +219,8 @@ class VISP_EXPORT vpAROgre : public Ogre::FrameListener, public Ogre::WindowEven mPluginsPath = pluginsPath; } - void setPosition(const std::string &name, - const vpTranslationVector &wTo); - void setPosition(const std::string &name, const vpHomogeneousMatrix &wMo); + void setPosition(const std::string &sceneName, const vpTranslationVector &wTo); + void setPosition(const std::string &sceneName, const vpHomogeneousMatrix &wMo); /*! Set the resource path used to locate the resource.cfg file. @@ -240,9 +235,9 @@ class VISP_EXPORT vpAROgre : public Ogre::FrameListener, public Ogre::WindowEven mResourcePath = resourcePath; } - void setRotation(const std::string &name, const vpRotationMatrix &wRo); + void setRotation(const std::string &sceneName, const vpRotationMatrix &wRo); - void setScale(const std::string &name, const float factorx, const float factory, const float factorz); + void setScale(const std::string &sceneName, const float factorx, const float factory, const float factorz); /*! Enable/Disable the appearance of the config dialog on startup. @@ -256,7 +251,7 @@ class VISP_EXPORT vpAROgre : public Ogre::FrameListener, public Ogre::WindowEven mshowConfigDialog = showConfigDialog; } - void setVisibility(const std::string &name, bool isVisible); + void setVisibility(const std::string &sceneName, bool isVisible); /*! Set the name of the window. diff --git a/src/simulator/coin-simulator/vpSimulator.h b/modules/ar/include/visp3/ar/vpSimulator.h similarity index 92% rename from src/simulator/coin-simulator/vpSimulator.h rename to modules/ar/include/visp3/ar/vpSimulator.h index 6f1c4d410dfe95024a41dda59e23ccdf9f45ac0c..6a16b7261812191314c6882cb780d511a3fe4a42 100644 --- a/src/simulator/coin-simulator/vpSimulator.h +++ b/modules/ar/include/visp3/ar/vpSimulator.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulator.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulator based on Coin3d. * @@ -50,11 +46,11 @@ \warning The content of this file is only available if Coin3D and one of the GUI (SoWin, SoXT, SoQt) are installed. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#ifdef VISP_HAVE_COIN_AND_GUI +#ifdef VISP_HAVE_COIN3D_AND_GUI -#include <visp/vpViewer.h> +#include <visp3/ar/vpViewer.h> /* KNOWN ISSUE DEALING WITH X11 and QT If you get a strange compiler error on the line with None, @@ -79,17 +75,17 @@ #include <Inventor/threads/SbThread.h> // visp -#include <visp/vpDebug.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/core/vpImageConvert.h> /*! \class vpSimulator - \ingroup RobotSimuWithViz + \ingroup group_ar_simulator \brief Implementation of a simulator based on Coin3d (www.coin3d.org). @@ -272,7 +268,9 @@ public: void changeZoomFactor(const float zoom, const int index); public: typedef enum { INTERNAL, EXTERNAL } vpSimulatorViewType ; +#ifdef VISP_HAVE_MODULE_IO void write(const char * fileName); +#endif protected: SbTime * realtime ; SoOffscreenRenderer * offScreenRenderer ; diff --git a/src/simulator/coin-simulator/vpSimulatorException.h b/modules/ar/include/visp3/ar/vpSimulatorException.h similarity index 76% rename from src/simulator/coin-simulator/vpSimulatorException.h rename to modules/ar/include/visp3/ar/vpSimulatorException.h index 887b749d4ebc743b40ec864ad908fca98848a3b7..d391bfcea4fbe96ffbbcccc124b70579859f7958 100644 --- a/src/simulator/coin-simulator/vpSimulatorException.h +++ b/modules/ar/include/visp3/ar/vpSimulatorException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulatorException.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exceptions that can be emited by the simulator classes. * @@ -54,7 +50,7 @@ */ /* Classes standards. */ -#include <visp/vpException.h> +#include <visp3/core/vpException.h> #include <iostream> /* Classe std::ostream. */ #include <string> /* Classe string. */ @@ -66,9 +62,6 @@ /*! \class vpSimulatorException - - \ingroup Exception - \brief Error that can be emited by the vpSimulator class and its derivates. */ class VISP_EXPORT vpSimulatorException : public vpException @@ -88,19 +81,9 @@ class VISP_EXPORT vpSimulatorException : public vpException } ; public: - vpSimulatorException (const int id, const char* format, ...) - { - this->code = id; - va_list args; - va_start(args, format); - setMessage(format, args); - va_end (args); - } - vpSimulatorException (const int id, const std::string & msg) - : vpException(id, msg){ ; } - vpSimulatorException (const int id) - : vpException(id){ ; } - + vpSimulatorException (const int id, const char* format, ...); + vpSimulatorException (const int id, const std::string & msg); + vpSimulatorException (const int id); }; #endif diff --git a/src/simulator/coin-simulator/vpViewer.h b/modules/ar/include/visp3/ar/vpViewer.h similarity index 88% rename from src/simulator/coin-simulator/vpViewer.h rename to modules/ar/include/visp3/ar/vpViewer.h index c02bc4d18ae9f2ce43c0816778ca97482832e479..2dc64c99e09a01c2d06d2f19bbda0b6d02af8307 100644 --- a/src/simulator/coin-simulator/vpViewer.h +++ b/modules/ar/include/visp3/ar/vpViewer.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpViewer.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulator based on Coin3d. * @@ -54,9 +50,9 @@ */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#ifdef VISP_HAVE_COIN_AND_GUI +#ifdef VISP_HAVE_COIN3D_AND_GUI #if defined(VISP_HAVE_SOWIN) @@ -97,12 +93,13 @@ #endif // visp -#include <visp/vpDebug.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpCameraParameters.h> /*! \class vpViewer + \ingroup group_ar_simulator \brief Viewer used by the simulator. @@ -164,6 +161,6 @@ private: #endif }; -#endif //VISP_HAVE_COIN_AND_GUI +#endif //VISP_HAVE_COIN3D_AND_GUI #endif diff --git a/src/simulator/coin-simulator/vpAR.cpp b/modules/ar/src/coin-simulator/vpAR.cpp similarity index 90% rename from src/simulator/coin-simulator/vpAR.cpp rename to modules/ar/src/coin-simulator/vpAR.cpp index 48698e28ee43a3f4e4ae02b2f0421b5ef9b8a966..92413325bef0827fbd195585140eadda4f3003d9 100644 --- a/src/simulator/coin-simulator/vpAR.cpp +++ b/modules/ar/src/coin-simulator/vpAR.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpAR.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Use to display an image behind the internal view of the simulator * used for augmented reality application @@ -46,12 +42,12 @@ \brief class used to display an image behind the internal view of the simulator. Used for augmented reality applications. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#ifdef VISP_HAVE_COIN_AND_GUI +#ifdef VISP_HAVE_COIN3D_AND_GUI -#include <visp/vpAR.h> -#include <visp/vpTime.h> +#include <visp3/ar/vpAR.h> +#include <visp3/core/vpTime.h> /* Objets OIV. */ @@ -183,10 +179,7 @@ vpAR::setImage(vpImage<vpRGBa> &I) } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_ar.a(vpAR.cpp.o) has no symbols +void dummy_vpAR() {}; #endif - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/simulator/coin-simulator/vpSimulator.cpp b/modules/ar/src/coin-simulator/vpSimulator.cpp similarity index 97% rename from src/simulator/coin-simulator/vpSimulator.cpp rename to modules/ar/src/coin-simulator/vpSimulator.cpp index 684669c2c11b559959a02543249f32e024e4b8b4..776252bab764a856416367db3f598c376d637d65 100644 --- a/src/simulator/coin-simulator/vpSimulator.cpp +++ b/modules/ar/src/coin-simulator/vpSimulator.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulator.cpp 5263 2015-02-04 13:43:25Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulator based on Coin3d. * @@ -45,15 +41,18 @@ The simulator uses the vpViewer class. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#ifdef VISP_HAVE_COIN_AND_GUI +#ifdef VISP_HAVE_COIN3D_AND_GUI -#include <visp/vpSimulator.h> -#include <visp/vpTime.h> +#include <visp3/ar/vpSimulator.h> +#include <visp3/core/vpTime.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> +#include <visp3/core/vpImage.h> + +#ifdef VISP_HAVE_MODULE_IO +# include <visp3/io/vpImageIo.h> +#endif /* Objets OIV. */ #include <Inventor/nodes/SoCone.h> /* Objet cone. */ @@ -1026,6 +1025,7 @@ vpSimulator::offScreenRendering(vpSimulatorViewType view, int * width, int * hei * - RETURN : Code d'erreur CODE_OK si tout s'est bien passe. */ +#ifdef VISP_HAVE_MODULE_IO void vpSimulator::write (const char * fileName) { @@ -1054,6 +1054,7 @@ vpSimulator::write (const char * fileName) // fclose (fp); get =1 ; } +#endif void vpSimulator::getSizeInternalView(int& width, int& height) @@ -1092,10 +1093,7 @@ vpSimulator::getInternalImage(vpImage<unsigned char> &I) get =1 ; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_ar.a(vpSimulator.cpp.o) has no symbols +void dummy_vpSimulator() {}; #endif - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/simulator/coin-simulator/vpViewer.cpp b/modules/ar/src/coin-simulator/vpViewer.cpp similarity index 93% rename from src/simulator/coin-simulator/vpViewer.cpp rename to modules/ar/src/coin-simulator/vpViewer.cpp index 69e66e6508ce2d2c88ef68ca8ce297a2555e4072..0cb5c683ab8bc1a93807810997577139c51cf4df 100644 --- a/src/simulator/coin-simulator/vpViewer.cpp +++ b/modules/ar/src/coin-simulator/vpViewer.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpViewer.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Simulator based on Coin3d. * @@ -44,11 +40,11 @@ based either on SoWin or SoQt. Under Unix, the viewer is based on SoQt or SoXt. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#ifdef VISP_HAVE_COIN_AND_GUI -#include <visp/vpViewer.h> -#include <visp/vpSimulator.h> +#ifdef VISP_HAVE_COIN3D_AND_GUI +#include <visp3/ar/vpViewer.h> +#include <visp3/ar/vpSimulator.h> #include <Inventor/events/SoKeyboardEvent.h> @@ -263,4 +259,7 @@ vpViewer::processSoEvent(const SoEvent * const event) } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_ar.a(vpViewer.cpp.o) has no symbols +void dummy_vpViewer() {}; #endif diff --git a/src/simulator/ogre-simulator/vpAROgre.cpp b/modules/ar/src/ogre-simulator/vpAROgre.cpp similarity index 89% rename from src/simulator/ogre-simulator/vpAROgre.cpp rename to modules/ar/src/ogre-simulator/vpAROgre.cpp index 074a0e6bc3cece07e494d4fdf0c0d94fab09f6ab..8559c4905da7752ac96c8274d01875949337cdfc 100644 --- a/src/simulator/ogre-simulator/vpAROgre.cpp +++ b/modules/ar/src/ogre-simulator/vpAROgre.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpAROgre.cpp 5234 2015-01-30 13:51:02Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Augmented Reality viewer using Ogre3D. * @@ -49,12 +45,12 @@ */ -#include "visp/vpConfig.h" +#include "visp3/core/vpConfig.h" #ifdef VISP_HAVE_OGRE -#include "visp/vpAROgre.h" -#include "visp/vpIoTools.h" +#include "visp3/ar/vpAROgre.h" +#include "visp3/core/vpIoTools.h" /*! @@ -222,14 +218,31 @@ void vpAROgre::init(bool ) { // Create the root + // mPluginsPath may contain more than one folder location separated by ";" + bool pluginsFileExists = false; + std::string pluginFile; + std::vector<std::string> plugingsPaths = vpIoTools::splitChain(std::string(mPluginsPath), std::string(";")); + for (size_t i=0; i<plugingsPaths.size(); i++) { +#if defined(NDEBUG) || !defined(_WIN32) + pluginFile = plugingsPaths[i]+"/plugins.cfg"; +#else + pluginFile = plugingsPaths[i]+"/plugins_d.cfg"; +#endif + + if(vpIoTools::checkFilename(pluginFile)) { + pluginsFileExists = true; + break; + } + } + if (! pluginsFileExists) { + std::string errorMsg = std::string("Error: the requested plugins file \"") #if defined(NDEBUG) || !defined(_WIN32) - std::string pluginFile = mPluginsPath+"/plugins.cfg"; + + std::string("plugins.cfg") #else - std::string pluginFile = mPluginsPath+"/plugins_d.cfg"; + + std::string("plugins_d.cfg") #endif - if(!vpIoTools::checkFilename(pluginFile)){ - std::string errorMsg = "Error: the requested plugins file \"" - + pluginFile + "\" doesn't exist."; + + std::string("\" doesn't exist in ") + + std::string(mPluginsPath); std::cout << errorMsg << std::endl; throw (vpException(vpException::ioError, errorMsg)); @@ -251,16 +264,29 @@ void vpAROgre::init(bool // [General] // FileSystem=media/ // Zip=packages/level1.zip - Ogre::ConfigFile cf; - std::string resourceFile = mResourcePath+"/resources.cfg"; - if(!vpIoTools::checkFilename(resourceFile)){ - std::string errorMsg = "Error: the requested resource file \"" - + resourceFile + "\" doesn't exist."; + + // mResourcePath may contain more than one folder location separated by ";" + bool resourcesFileExists = false; + std::string resourceFile; + std::vector<std::string> resourcesPaths = vpIoTools::splitChain(std::string(mResourcePath), std::string(";")); + for (size_t i=0; i<resourcesPaths.size(); i++) { + resourceFile = resourcesPaths[i]+"/resources.cfg"; + if(vpIoTools::checkFilename(resourceFile)) { + resourcesFileExists = true; + break; + } + } + if (! resourcesFileExists) { + std::string errorMsg = std::string("Error: the requested resource file \"resources.cfg\"") + + std::string("doesn't exist in ") + + std::string(mResourcePath); + std::cout << errorMsg << std::endl; throw (vpException(vpException::ioError, errorMsg)); } std::cout << "######################### Load resource file: " << resourceFile << std::endl; + Ogre::ConfigFile cf; cf.load(resourceFile); // Go through all sections & settings in the file @@ -632,66 +658,65 @@ void vpAROgre::setCameraParameters(const vpCameraParameters &cameraP ) /*! Load a mesh in the 3D world. - \param name : Name of the Entity and SceneNode to create. + \param entityName : Name of the Entity and SceneNode to create. \param model : 3D model to load. */ -void vpAROgre::load(const std::string &name, const std::string &model) +void vpAROgre::load(const std::string &entityName, const std::string &model) { - Ogre::Entity *newEntity = mSceneMgr->createEntity(name, model); - Ogre::SceneNode *newNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(name); + Ogre::Entity *newEntity = mSceneMgr->createEntity(entityName, model); + Ogre::SceneNode *newNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(entityName); newNode->attachObject(newEntity); } /*! Change position of a ScneneNode. - \param name : Name of the SceneNode to move. + \param sceneName : Name of the SceneNode to move. \param wTo : New position of the node (translation between object frame and world frame). */ -void vpAROgre::setPosition(const std::string &name, - const vpTranslationVector &wTo) +void vpAROgre::setPosition(const std::string &sceneName, + const vpTranslationVector &wTo) { // Reset the position - Ogre::SceneNode *node = mSceneMgr->getSceneNode(name); + Ogre::SceneNode *node = mSceneMgr->getSceneNode(sceneName); node->setPosition((Ogre::Real)wTo[0], (Ogre::Real)wTo[1], (Ogre::Real)wTo[2]); } /*! Get position of a SceneNode. - \param name : Name of the SceneNode in the scene graph. + \param sceneName : Name of the SceneNode in the scene graph. \return The position of the node. */ -vpTranslationVector vpAROgre::getPosition(const std::string &name)const +vpTranslationVector vpAROgre::getPosition(const std::string &sceneName)const { - Ogre::Vector3 translation = mSceneMgr->getSceneNode(name)->getPosition(); + Ogre::Vector3 translation = mSceneMgr->getSceneNode(sceneName)->getPosition(); return vpTranslationVector((Ogre::Real)translation[0], (Ogre::Real)translation[1], (Ogre::Real)translation[2]); } /*! Set the orientation of a SceneNode. - \param name : Name of the SceneNode to rotate. + \param sceneName : Name of the SceneNode to rotate. \param wRo : The rotation matrix representing the rotation to apply. */ -void vpAROgre::setRotation(const std::string &name, const vpRotationMatrix &wRo) +void vpAROgre::setRotation(const std::string &sceneName, const vpRotationMatrix &wRo) { // Get the node in its original position - mSceneMgr->getSceneNode(name)->resetOrientation(); + mSceneMgr->getSceneNode(sceneName)->resetOrientation(); // Apply the new rotation Ogre::Matrix3 rotationOgre = Ogre::Matrix3( (Ogre::Real)wRo[0][0], (Ogre::Real)wRo[0][1], (Ogre::Real)wRo[0][2], (Ogre::Real)wRo[1][0], (Ogre::Real)wRo[1][1], (Ogre::Real)wRo[1][2], (Ogre::Real)wRo[2][0], (Ogre::Real)wRo[2][1], (Ogre::Real)wRo[2][2]); Ogre::Quaternion q(rotationOgre); - mSceneMgr->getSceneNode(name)->rotate(q); + mSceneMgr->getSceneNode(sceneName)->rotate(q); } /*! Add a rotation to a SceneNode. - \param name : Name of the SceneNode to rotate. + \param sceneName : Name of the SceneNode to rotate. \param wRo : The rotation matrix representing the rotation to apply. */ -void vpAROgre::addRotation(const std::string &name, - const vpRotationMatrix &wRo) +void vpAROgre::addRotation(const std::string &sceneName, const vpRotationMatrix &wRo) { // Apply the new rotation Ogre::Matrix3 rotationOgre @@ -699,21 +724,18 @@ void vpAROgre::addRotation(const std::string &name, (Ogre::Real)wRo[1][0], (Ogre::Real)wRo[1][1], (Ogre::Real)wRo[1][2], (Ogre::Real)wRo[2][0], (Ogre::Real)wRo[2][1], (Ogre::Real)wRo[2][2]); Ogre::Quaternion q(rotationOgre); - mSceneMgr->getSceneNode(name)->rotate(q); - - + mSceneMgr->getSceneNode(sceneName)->rotate(q); } /*! Set the position and the orientation of a SceneNode. - \param name : Name of the SceneNode to rotate. + \param sceneName : Name of the SceneNode to rotate. \param wMo : The homogeneous matrix representing the rotation and translation to apply. */ -void vpAROgre::setPosition(const std::string &name, - const vpHomogeneousMatrix &wMo) +void vpAROgre::setPosition(const std::string &sceneName, const vpHomogeneousMatrix &wMo) { // Extract the position and orientation data vpRotationMatrix rotations; @@ -721,33 +743,33 @@ void vpAROgre::setPosition(const std::string &name, wMo.extract(rotations); wMo.extract(translation); // Apply them to the node - setPosition(name, translation); - setRotation(name, rotations); + setPosition(sceneName, translation); + setRotation(sceneName, rotations); } /*! Tell if a SceneNode is shown on the screen or not. - \param name : Name of the SceneNode. + \param sceneName : Name of the SceneNode. \param isVisible : If true we show the node, if false we don't. */ -void vpAROgre::setVisibility(const std::string &name, bool isVisible) +void vpAROgre::setVisibility(const std::string &sceneName, bool isVisible) { - mSceneMgr->getSceneNode(name)->setVisible(isVisible); + mSceneMgr->getSceneNode(sceneName)->setVisible(isVisible); } /*! Scale a SceneNode. - \param name : Name of the SceneNode. + \param sceneName : Name of the SceneNode. \param factorx : Scale factor along the x-axis. \param factory : Scale factor along the x-axis. \param factorz : Scale factor along the x-axis. */ -void vpAROgre::setScale(const std::string &name, const float factorx, const float factory, const float factorz) +void vpAROgre::setScale(const std::string &sceneName, const float factorx, const float factory, const float factorz) { // Reset the scale to its original value - mSceneMgr->getSceneNode(name)->scale(Ogre::Vector3(1,1,1)/mSceneMgr->getSceneNode(name)->getScale()); + mSceneMgr->getSceneNode(sceneName)->scale(Ogre::Vector3(1,1,1)/mSceneMgr->getSceneNode(sceneName)->getScale()); // Apply the new scale - mSceneMgr->getSceneNode(name)->scale(Ogre::Vector3(factorx, factory, factorz)); + mSceneMgr->getSceneNode(sceneName)->scale(Ogre::Vector3(factorx, factory, factorz)); } /*! @@ -1068,5 +1090,8 @@ void vpAROgre::getRenderingOutput(vpImage<vpRGBa> &I, const vpHomogeneousMatrix } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_ar.a(vpAROgre.cpp.o) has no symbols +void dummy_vpAROgre() {}; #endif diff --git a/modules/ar/src/vpSimulatorException.cpp b/modules/ar/src/vpSimulatorException.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c236fd1667c03f993d039e0c6efc0eeb98fbe3b0 --- /dev/null +++ b/modules/ar/src/vpSimulatorException.cpp @@ -0,0 +1,58 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Exceptions that can be emited by the simulator classes. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +/* \file vpSimulatorException.h + \brief error that can be emited by the vpSimulator class and its derivates + */ +/* Classes standards. */ + +#include <visp3/ar/vpSimulatorException.h> + +vpSimulatorException::vpSimulatorException (const int id, const char* format, ...) +{ + this->code = id; + va_list args; + va_start(args, format); + setMessage(format, args); + va_end (args); +} + +vpSimulatorException::vpSimulatorException (const int id, const std::string & msg) + : vpException(id, msg){ ; } + +vpSimulatorException::vpSimulatorException (const int id) + : vpException(id){ ; } diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..5d8c0f68dbe7b2138ee21835262390fb504d3ae8 --- /dev/null +++ b/modules/core/CMakeLists.txt @@ -0,0 +1,251 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +#vp_define_module(core) + +# Add optional 3rd parties +set(opt_incs "") +set(opt_libs "") + +# winmm.lib for timeGetTime() under windows +CHECK_LIBRARY_EXISTS("winmm.lib" getch "" HAVE_LIBWINMM) # for timeGetTime() +if(HAVE_LIBWINMM) + list(APPEND opt_libs "winmm.lib") +endif() + +# Add library ws2_32.a or ws2_32.lib for vpNetwork class +if(WIN32 AND NOT CYGWIN) + if(MINGW) + CHECK_LIBRARY_EXISTS("ws2_32.a" getch "" HAVE_LIBWS2_32) # for inet_ntoa() and socket functionalities + if(HAVE_LIBWS2_32) + list(APPEND opt_libs "ws2_32.a") + else() + find_library(WS2_32_LIBRARY "libws2_32.a" + "$ENV{MINGW_DIR}/lib" + "$ENV{MINGW_DIR}/mingw/lib" + C:/mingw/mingw/lib) + mark_as_advanced(WS2_32_LIBRARY) + if(WS2_32_LIBRARY) + list(APPEND opt_libs "${WS2_32_LIBRARY}") + endif() + endif() + else() # pure WIN32 + CHECK_LIBRARY_EXISTS("ws2_32.lib" getch "" HAVE_LIBWS2_32) # for inet_ntoa() and socket functionalities + if(HAVE_LIBWS2_32) + #message("have ws2_32.lib") + list(APPEND opt_libs "ws2_32.lib") + endif() + endif() +endif() + +# OpenCV +if(USE_OPENCV) + # On win32 since OpenCV 2.4.7 and on OSX with OpenCV 2.4.10 we cannot use OpenCV_LIBS to set ViSP 3rd party libraries. + # Using OpenCV_LIBS works to build visp library, examples, demos and test thanks to the components, + # but not tutorials that are stand alone Cmake project that use ViSP as a 3rd party. + # To be clear OpenCV_LIBS contains opencv_core and not c:\...\opencv_core248.lib full path as requested + # to use ViSP. This was not the case with OpenCV 2.4.6. + # For the build of ViSP it works with OpenCV_LIBS: in that case thanks to opencv_core properties, CMake + # is able to find the real name and location of the libraries. + # But when ViSP is used as a 3rd party where it should import OpenCV libraries, it doesn't work with + # OpenCV_LIBS. + # The solution here is to get the real name of OpenCV libraries thanks to the properties and link + # with these names. + # An other way could be to include OpenCVConfig.cmake, but in that case, visp-config and visp.pc + # will be not able to give the names of OpenCV libraries when used without CMake. + #message("OpenCV_LIB_COMPONENTS: ${OpenCV_LIB_COMPONENTS}") + #message("OpenCV_LIBS: ${OpenCV_LIBS}") + #if(WIN32 AND OpenCV_LIB_COMPONENTS AND OpenCV_VERSION AND OpenCV_VERSION VERSION_GREATER 2.4.6.1) + if(OpenCV_LIB_COMPONENTS AND OpenCV_VERSION AND OpenCV_VERSION VERSION_GREATER 2.4.6.1) + # ReleaseWithDebugInfo was requested to detect libopencv-devel under Fedora 20 + # RelWithDebugInfo was requested to detect ros-hydro-opencv2 2.4.9 under Ubuntu 12.04 LTS with ROS hydro + set(config_ "NONE" "RELEASE" "DEBUG" "RELEASEWITHDEBINFO" "RELWITHDEBINFO") + if(POLICY CMP0045) + # Fix Error on non-existent target in get_target_property for 3rd party location extraction + cmake_policy(PUSH) + cmake_policy(SET CMP0045 OLD) + endif() + + foreach(component_ ${OpenCV_LIB_COMPONENTS}) + foreach(imp_config_ ${config_}) + if(OpenCV_SHARED) + get_target_property(component_property_${imp_config_}_ ${component_} IMPORTED_IMPLIB_${imp_config_}) + # particular case of opencv_ts that doesn't have an implib + if(NOT EXISTS "${component_property_${imp_config_}_}") + get_target_property(component_property_${imp_config_}_ ${component_} IMPORTED_LOCATION_${imp_config_}) + endif() + else() + get_target_property(component_property_${imp_config_}_ ${component_} IMPORTED_LOCATION_${imp_config_}) + endif() + get_target_property(component_property_3rdparty_${imp_config_}_ ${component_} IMPORTED_LINK_INTERFACE_LIBRARIES_${imp_config_}) + #message("component_property_${imp_config_}_: ${component_property_${imp_config_}_}") + #message("component_property_3rdparty_${imp_config_}_: ${component_property_3rdparty_${imp_config_}_}") + # Under Unix, there is no specific suffix for OpenCV libraries. If one is found we add it + # Under Windows, we add the "optimized", "debug" specific keywords + if(WIN32 AND EXISTS "${component_property_${imp_config_}_}" AND "${imp_config_}" MATCHES "RELEASE") # also valid for RELEASEWITHDEBINFO + list(APPEND opt_libs optimized "${component_property_${imp_config_}_}") + elseif(WIN32 AND EXISTS "${component_property_${imp_config_}_}" AND "${imp_config_}" MATCHES "DEBUG") + list(APPEND opt_libs debug "${component_property_${imp_config_}_}") + elseif(EXISTS "${component_property_${imp_config_}_}") + list(APPEND opt_libs "${component_property_${imp_config_}_}") + endif() + + if(component_property_3rdparty_${imp_config_}_) + foreach(3rdparty_ ${component_property_3rdparty_${imp_config_}_}) + #message("3rdparty_ ${3rdparty_}") + list(FIND OpenCV_LIB_COMPONENTS ${3rdparty_} 3rdparty_is_opencv_component_) + if(3rdparty_is_opencv_component_ LESS 0) + #message("${3rdparty_} is not an opencv component") + get_target_property(3rdparty_opt_location_ ${3rdparty_} IMPORTED_LOCATION_${imp_config_}) + if(NOT EXISTS "${3rdparty_opt_location_}") + #message("3rdparty_: ${3rdparty_} location doesn't exist in ${imp_config_}") + get_target_property(3rdparty_opt_location_ ${3rdparty_} IMPORTED_LOCATION) + #message("3rdparty_: ${3rdparty_} location : ${3rdparty_opt_location_}") + endif() + if(EXISTS "${3rdparty_opt_location_}") + #message("3rdparty_opt_location_: ${3rdparty_opt_location_} with config ${imp_config_}") + if(WIN32 AND "${imp_config_}" MATCHES "RELEASE") + #message("is release") + list(APPEND opt_libs optimized ${3rdparty_opt_location_}) + elseif(WIN32 AND "${imp_config_}" MATCHES "DEBUG") + list(APPEND opt_libs debug ${3rdparty_opt_location_}) + else() + list(APPEND opt_libs ${3rdparty_opt_location_}) + endif() + else() + find_library(3rdparty_location_ NAMES ${3rdparty_}) + mark_as_advanced(3rdparty_location_) + if(3rdparty_location_) + #message(${3rdparty_location_}) + list(APPEND opt_libs ${3rdparty_location_}) # should be a system dependency + else() + list(APPEND opt_libs ${3rdparty_}) # should be a system dependency + endif() + endif() + endif() + endforeach() + endif() + endforeach() + endforeach() + + if(POLICY CMP0045) + # Fix Error on non-existent target in get_target_property for 3rd party location extraction + cmake_policy(POP) + endif() + + else() + # this should be an old OpenCV version that doesn't have the previous behavior + list(APPEND opt_libs ${OpenCV_LIBS}) + endif() + list(APPEND opt_incs ${OpenCV_INCLUDE_DIRS}) + #list(APPEND opt_libs ${OpenCV_LIBS}) + #MESSAGE("OpenCV_INCLUDE_DIRS = ${OpenCV_INCLUDE_DIRS}") + #MESSAGE("OpenCV_LIBS = ${OpenCV_LIBS}") + #MESSAGE("OpenCV_LIB_DIR = ${OpenCV_LIB_DIR}") + #message("OpenCV_NONFREE_FOUND: ${OPENCV_NONFREE_FOUND}") +endif(USE_OPENCV) + + + +if(USE_YARP) + list(APPEND opt_incs ${YARP_INCLUDE_DIRS}) + + # Work around to add Yarp libraries and also third party libraries requested by Yarp + list(REVERSE YARP_LIBRARIES) # to start with YARP_init, that depends on YARP_dev, YARP_sig and YARP_OS + foreach(lib ${YARP_LIBRARIES}) + get_target_property(CONFIGURATIONS ${lib} IMPORTED_CONFIGURATIONS) + foreach(CONFIGURATION ${CONFIGURATIONS}) + get_target_property(YARP_LIB ${lib} "IMPORTED_LOCATION_${CONFIGURATION}") # Get Yarp full absolute library path and name + + if(WIN32) + #Work around when YARP is build as shared libraries + string(REGEX REPLACE ".dll$" ".lib" YARP_LIB ${YARP_LIB}) + + if(${CONFIGURATION} STREQUAL "RELEASE") + list(APPEND VISP_EXTERN_LIBRARIES optimized ${YARP_LIB}) # Append full absolute library path and name + elseif(${CONFIGURATION} STREQUAL "DEBUG") + list(APPEND VISP_EXTERN_LIBRARIES debug ${YARP_LIB}) # Append full absolute library path and name + endif() + else() + list(APPEND opt_libs ${YARP_LIB}) # Append full absolute library path and name + endif() + # Get 3rd party libraries requested by Yarp + get_target_property(YARP_LINK_LIBS_ ${lib} "IMPORTED_LINK_INTERFACE_LIBRARIES_${CONFIGURATION}") + list(APPEND YARP_LINK_LIBS ${YARP_LINK_LIBS_}) + endforeach() + endforeach() + + # Remove Yarp libraries since they were added previously with full absolute library path and name + if(YARP_LINK_LIBS) + foreach(lib ${YARP_LIBRARIES}) + list(REMOVE_ITEM YARP_LINK_LIBS ${lib}) + endforeach() + endif() + # Add 3rd party libraries requested by Yarp + list(APPEND opt_libs ${YARP_LINK_LIBS}) + add_definitions(${YARP_DEFINES}) +endif(USE_YARP) + +# Math: gsl, lapack, OpenCV +if(USE_GSL) + list(APPEND opt_incs ${GSL_INCLUDE_DIRS}) + list(APPEND opt_libs ${GSL_LIBRARIES}) +endif() +if(USE_LAPACK) + list(APPEND opt_libs ${LAPACK_C_LIBRARIES}) +endif() + +# Misc: xml, pthread, zlib +if(USE_XML2) + list(APPEND opt_incs ${XML2_INCLUDE_DIRS}) + list(APPEND opt_libs ${XML2_LIBRARIES}) +endif() +if(USE_PTHREAD) + list(APPEND opt_incs ${PTHREAD_INCLUDE_DIRS}) + list(APPEND opt_libs ${PTHREAD_LIBRARIES}) +endif() +if(USE_ZLIB) + list(APPEND opt_incs ${ZLIB_INCLUDE_DIRS}) + list(APPEND opt_libs ${ZLIB_LIBRARIES}) +endif() + +vp_add_module(core) +vp_glob_module_sources() +vp_module_include_directories(${opt_incs}) +vp_create_module(${opt_libs}) +vp_create_compat_headers("include/visp3/core/vpConfig.h") +vp_add_tests(CTEST_EXCLUDE_PATH network DEPENDS_ON visp_io visp_gui) diff --git a/modules/core/include/visp3/core/vpArray2D.h b/modules/core/include/visp3/core/vpArray2D.h new file mode 100644 index 0000000000000000000000000000000000000000..8aa1fc1e99d869a9e7a98a56dbe0e9fd4a7db399 --- /dev/null +++ b/modules/core/include/visp3/core/vpArray2D.h @@ -0,0 +1,652 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * This class implements an 2D array as a template class. + * + * Authors: + * Fabien Spindler + * + *****************************************************************************/ +#ifndef __vpArray2D_h_ +#define __vpArray2D_h_ + +#include <iostream> +#include <ostream> +#include <math.h> +#include <stdlib.h> +#include <string.h> +#include <fstream> +#include <sstream> +#include <limits> + +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> + +/*! + \class vpArray2D + \ingroup group_core_matrices + + \brief Implementation of a generic 2D array used as vase class of matrices and vectors. + + This class implements a 2D array as a template class and all the basic functionalities + common to matrices and vectors. + More precisely: + - concerning matrices, vpMatrix but also specific containers such as twist + (vpVelocityTwistMatrix and vpForceTwistMatrix), homogeneous (vpHomogeneousMatrix), + rotation (vpRotationMatrix) and homography (vpHomography) matrices inherit from + vpArray2D<double>. + - concerning vectors, vpColVector, vpRowVector but also specific containers describing + the pose (vpPoseVector) and the rotation (vpRotationVector) inherit also from + vpArray2D<double>. +*/ +template<class Type> +class vpArray2D +{ +protected: + //! Number of rows in the array + unsigned int rowNum; + //! Number of columns in the array + unsigned int colNum; + //! Address of the first element of each rows + Type **rowPtrs; + //! Current array size (rowNum * colNum) + unsigned int dsize; + +public: + //! Address of the first element of the data array + Type *data; + +public: + /*! + Basic constructor of a 2D array. + Number of columns and rows are set to zero. + */ + vpArray2D<Type>() + : rowNum(0), colNum(0), rowPtrs(NULL), dsize(0), data(NULL) + {} + /*! + Copy constructor of a 2D array. + */ + vpArray2D<Type>(const vpArray2D<Type> & A) + : rowNum(0), colNum(0), rowPtrs(NULL), dsize(0), data(NULL) + { + resize(A.rowNum, A.colNum); + memcpy(data, A.data, rowNum*colNum*sizeof(Type)); + } + /*! + Constructor that initializes a 2D array with 0. + + \param r : Array number of rows. + \param c : Array number of columns. + */ + vpArray2D<Type>(unsigned int r, unsigned int c) + : rowNum(0), colNum(0), rowPtrs(NULL), dsize(0), data(NULL) + { + resize(r, c); + } + /*! + Constructor that initialize a 2D array with \e val. + + \param r : Array number of rows. + \param c : Array number of columns. + \param val : Each element of the array is set to \e val. + */ + vpArray2D<Type>(unsigned int r, unsigned int c, Type val) + : rowNum(0), colNum(0), rowPtrs(NULL), dsize(0), data(NULL) + { + resize(r, c); + *this = val; + } + /*! + Destructor that desallocate memory. + */ + virtual ~vpArray2D<Type>() + { + if (data != NULL ) { + free(data); + data=NULL; + } + + if (rowPtrs!=NULL) { + free(rowPtrs); + rowPtrs=NULL ; + } + rowNum = colNum = dsize = 0; + } + + /** @name Inherited functionalities from vpArray2D */ + //@{ + + Type getMinValue() const; + + Type getMaxValue() const; + + //! Return the number of rows of the 2D array + inline unsigned int getRows() const { return rowNum ;} + //! Return the number of columns of the 2D array + inline unsigned int getCols() const { return colNum; } + //! Return the number of elements of the 2D array. + inline unsigned int size() const { return colNum*rowNum; } + /*! + Set the size of the array and initialize all the values to zero. + + \param nrows : number of rows. + \param ncols : number of column. + \param flagNullify : if true, then the array is re-initialized to 0 + after resize. If false, the initial values from the common part of the + array (common part between old and new version of the array) are kept. + Default value is true. + */ + void resize(const unsigned int nrows, const unsigned int ncols, + const bool flagNullify = true) + { + if ((nrows == rowNum) && (ncols == colNum)) { + if (flagNullify && this->data != NULL) { + memset(this->data, 0, this->dsize*sizeof(Type)); + } + } + else { + const bool recopyNeeded = (ncols != this ->colNum); + Type * copyTmp = NULL; + unsigned int rowTmp = 0, colTmp=0; + + // Recopy case per case is required if number of cols has changed; + // structure of Type array is not the same in this case. + if (recopyNeeded && this->data != NULL) { + copyTmp = new Type[this->dsize]; + memcpy (copyTmp, this ->data, sizeof(Type)*this->dsize); + rowTmp=this->rowNum; colTmp=this->colNum; + } + + // Reallocation of this->data array + this->dsize = nrows*ncols; + this->data = (Type*)realloc(this->data, this->dsize*sizeof(Type)); + if ((NULL == this->data) && (0 != this->dsize)) { + if (copyTmp != NULL) delete [] copyTmp; + throw(vpException(vpException::memoryAllocationError, + "Memory allocation error when allocating 2D array data")) ; + } + + this->rowPtrs = (Type**)realloc (this->rowPtrs, nrows*sizeof(Type*)); + if ((NULL == this->rowPtrs) && (0 != this->dsize)) { + if (copyTmp != NULL) delete [] copyTmp; + throw(vpException(vpException::memoryAllocationError, + "Memory allocation error when allocating 2D array rowPtrs")) ; + } + + // Update rowPtrs + { + Type **t_= rowPtrs; + for (unsigned int i=0; i<dsize; i+=ncols) { + *t_++ = this->data + i; + } + } + + this->rowNum = nrows; this->colNum = ncols; + + // Recopy of this->data array values or nullify + if (flagNullify) { + memset(this->data,0,this->dsize*sizeof(Type)); + } + else if (recopyNeeded && this->rowPtrs != NULL) { + // Recopy... + const unsigned int minRow = (this->rowNum<rowTmp)?this->rowNum:rowTmp; + const unsigned int minCol = (this->colNum<colTmp)?this->colNum:colTmp; + for (unsigned int i=0; i<this->rowNum; ++i) { + for (unsigned int j=0; j<this->colNum; ++j) { + if ((minRow > i) && (minCol > j)) { + (*this)[i][j] = copyTmp [i*colTmp+j]; + } + else { + (*this)[i][j] = 0; + } + } + } + } + + if (copyTmp != NULL) + delete [] copyTmp; + } + } + //! Set all the elements of the array to \e x. + vpArray2D<Type> & operator=(Type x) + { + for (unsigned int i=0;i<rowNum;i++) + for(unsigned int j=0;j<colNum;j++) + rowPtrs[i][j] = x; + + return *this; + } + + /*! + Copy operator of a 2D array. + */ + vpArray2D<Type> & operator=(const vpArray2D<Type> & A) + { + resize(A.rowNum, A.colNum); + memcpy(data, A.data, rowNum*colNum*sizeof(Type)); + return *this; + } + + //! Set element \f$A_{ij} = x\f$ using A[i][j] = x + inline Type *operator[](unsigned int i) { return rowPtrs[i]; } + //! Get element \f$x = A_{ij}\f$ using x = A[i][j] + inline Type *operator[](unsigned int i) const {return rowPtrs[i];} + + /*! + \relates vpArray2D + Writes the given array to the output stream and returns a reference to the output stream. + */ + friend std::ostream &operator<<(std::ostream &s, const vpArray2D<Type> &A) + { + if (A.data == NULL) + return s; + std::ios_base::fmtflags original_flags = s.flags(); + + s.precision(10) ; + for (unsigned int i=0;i<A.getRows();i++) { + for (unsigned int j=0;j<A.getCols() -1;j++){ + s << A[i][j] << " "; + } + // We don't add " " after the last row element + s << A[i][A.getCols() -1]; + // We don't add a \n char on the end of the last array line + if (i < A.getRows()-1) + s << std::endl; + } + + s.flags(original_flags); // restore s to standard state + + return s; + } + //@} + + //--------------------------------- + // Inherited array I/O Static Public Member Functions + //--------------------------------- + /** @name Inherited I/O from vpArray2D with Static Public Member Functions */ + //@{ + /*! + Load a matrix from a file. + + \param filename : Absolute file name. + \param A : Array to be loaded + \param binary : If true the matrix is loaded from a binary file, else from a text file. + \param header : Header of the file is loaded in this parameter. + + \return Returns true if success. + + \sa save() + */ + static bool load(const std::string &filename, vpArray2D<Type> &A, + const bool binary = false, char *header = NULL) + { + std::fstream file; + + if (!binary) + file.open(filename.c_str(), std::fstream::in); + else + file.open(filename.c_str(), std::fstream::in|std::fstream::binary); + + if(!file) { + file.close(); + return false; + } + + else { + if (!binary) { + char c='0'; + std::string h; + while ((c != '\0') && (c != '\n')) { + file.read(&c,1); + h+=c; + } + if (header != NULL) + strncpy(header, h.c_str(), h.size() + 1); + + unsigned int rows, cols; + file >> rows; + file >> cols; + + if (rows > (std::numeric_limits<unsigned int>::max)() + || cols > (std::numeric_limits<unsigned int>::max)()) + throw vpException(vpException::badValue, "Array exceed the max size."); + + A.resize(rows,cols); + + Type value; + for(unsigned int i = 0; i < rows; i++) { + for(unsigned int j = 0; j < cols; j++) { + file >> value; + A[i][j] = value; + } + } + } + else { + char c='0'; + std::string h; + while ((c != '\0') && (c != '\n')) { + file.read(&c,1); + h+=c; + } + if (header != NULL) + strncpy(header, h.c_str(), h.size() + 1); + + unsigned int rows, cols; + file.read((char*)&rows,sizeof(unsigned int)); + file.read((char*)&cols,sizeof(unsigned int)); + A.resize(rows,cols); + + Type value; + for(unsigned int i = 0; i < rows; i++) { + for(unsigned int j = 0; j < cols; j++) { + file.read((char*)&value,sizeof(Type)); + A[i][j] = value; + } + } + } + } + + file.close(); + return true; + } + /*! + Load an array from a YAML-formatted file. + + \param filename : absolute file name. + \param A : array to be loaded from the file. + \param header : header of the file is loaded in this parameter. + + \return Returns true on success. + + \sa saveYAML() + + */ + static bool loadYAML(const std::string &filename, vpArray2D<Type> &A, char *header = NULL) + { + std::fstream file; + + file.open(filename.c_str(), std::fstream::in); + + if(!file) { + file.close(); + return false; + } + + unsigned int rows = 0,cols = 0; + std::string h; + std::string line,subs; + bool inheader = true; + unsigned int i=0, j; + unsigned int lineStart = 0; + + while ( getline (file,line) ) { + if(inheader) { + if(rows == 0 && line.compare(0,5,"rows:") == 0) { + std::stringstream ss(line); + ss >> subs; + ss >> rows; + } + else if (cols == 0 && line.compare(0,5,"cols:") == 0) { + std::stringstream ss(line); + ss >> subs; + ss >> cols; + } + else if (line.compare(0,5,"data:") == 0) + inheader = false; + else + h += line + "\n"; + } + else { + // if i == 0, we just got out of the header: initialize matrix dimensions + if(i == 0) { + if(rows == 0 || cols == 0) { + file.close(); + return false; + } + A.resize(rows, cols); + // get indentation level which is common to all lines + lineStart = (unsigned int)line.find("[") + 1; + } + std::stringstream ss(line.substr(lineStart, line.find("]") - lineStart)); + j = 0; + while(getline(ss, subs, ',')) + A[i][j++] = atof(subs.c_str()); + i++; + } + } + + if (header != NULL) + strncpy(header, h.substr(0,h.length()-1).c_str(), h.size()); + + file.close(); + return true; + } + + /*! + Save a matrix to a file. + + \param filename : Absolute file name. + \param A : Array to be saved. + \param binary : If true the matrix is saved in a binary file, else a text file. + \param header : Optional line that will be saved at the beginning of the file. + + \return Returns true if success. + + Warning : If you save the matrix as in a text file the precision is + less than if you save it in a binary file. + + \sa load() + */ + static bool save(const std::string &filename, const vpArray2D<Type> &A, + const bool binary = false, const char *header = "") + { + std::fstream file; + + if (!binary) + file.open(filename.c_str(), std::fstream::out); + else + file.open(filename.c_str(), std::fstream::out|std::fstream::binary); + + if(!file) { + file.close(); + return false; + } + + else { + if (!binary) { + unsigned int i = 0; + file << "# "; + while (header[i] != '\0') { + file << header[i]; + if (header[i] == '\n') + file << "# "; + i++; + } + file << '\0'; + file << std::endl; + file << A.getRows() << "\t" << A.getCols() << std::endl; + file << A << std::endl; + } + else { + int headerSize = 0; + while (header[headerSize] != '\0') headerSize++; + file.write(header,headerSize+1); + unsigned int matrixSize; + matrixSize = A.getRows(); + file.write((char*)&matrixSize,sizeof(int)); + matrixSize = A.getCols(); + file.write((char*)&matrixSize,sizeof(int)); + Type value; + for(unsigned int i = 0; i < A.getRows(); i++) { + for(unsigned int j = 0; j < A.getCols(); j++) { + value = A[i][j]; + file.write((char*)&value,sizeof(Type)); + } + } + } + } + + file.close(); + return true; + } + /*! + Save an array in a YAML-formatted file. + + \param filename : absolute file name. + \param A : array to be saved in the file. + \param header : optional lines that will be saved at the beginning of the file. Should be YAML-formatted and will adapt to the indentation if any. + + \return Returns true if success. + + Here is an example of outputs. + \code + vpArray2D<double> M(3,4); + vpArray2D::saveYAML("matrix.yml", M, "example: a YAML-formatted header"); + vpArray2D::saveYAML("matrixIndent.yml", M, "example:\n - a YAML-formatted header\n - with inner indentation"); + \endcode + Content of matrix.yml: + \code + example: a YAML-formatted header + rows: 3 + cols: 4 + data: + - [0, 0, 0, 0] + - [0, 0, 0, 0] + - [0, 0, 0, 0] + \endcode + Content of matrixIndent.yml: + \code + example: + - a YAML-formatted header + - with inner indentation + rows: 3 + cols: 4 + data: + - [0, 0, 0, 0] + - [0, 0, 0, 0] + - [0, 0, 0, 0] + \endcode + + \sa loadYAML() + */ + static bool saveYAML(const std::string &filename, const vpArray2D<Type> &A, const char *header = "") + { + std::fstream file; + + file.open(filename.c_str(), std::fstream::out); + + if(!file) { + file.close(); + return false; + } + + unsigned int i = 0; + bool inIndent = false; + std::string indent = ""; + bool checkIndent = true; + while (header[i] != '\0') { + file << header[i]; + if(checkIndent) { + if (inIndent) { + if(header[i] == ' ') + indent += " "; + else if (indent.length() > 0) + checkIndent = false; + } + if (header[i] == '\n' || (inIndent && header[i] == ' ')) + inIndent = true; + else + inIndent = false; + } + i++; + } + + if(i != 0) + file << std::endl; + file << "rows: " << A.getRows() << std::endl; + file << "cols: " << A.getCols() << std::endl; + + if(indent.length() == 0) + indent = " "; + + file << "data: " << std::endl; + unsigned int j; + for(i=0;i<A.getRows();++i) + { + file << indent << "- ["; + for(j=0;j<A.getCols()-1;++j) + file << A[i][j] << ", "; + file << A[i][j] << "]" << std::endl; + } + + file.close(); + return true; + } + //@} +}; + +/*! + Return the array min value. + */ +template<class Type> +Type +vpArray2D<Type>::getMinValue() const +{ + Type *dataptr = data; + Type min = *dataptr; + dataptr++; + for (unsigned int i = 0; i < dsize-1; i++) + { + if (*dataptr < min) min = *dataptr; + dataptr++; + } + return min; +} + +/*! + Return the array max value. + */ +template<class Type> +Type +vpArray2D<Type>::getMaxValue() const +{ + Type *dataptr = data; + Type max = *dataptr; + dataptr++; + for (unsigned int i = 0; i < dsize-1; i++) + { + if (*dataptr > max) max = *dataptr; + dataptr++; + } + return max; +} + +#endif diff --git a/src/math/spline/vpBSpline.h b/modules/core/include/visp3/core/vpBSpline.h similarity index 66% rename from src/math/spline/vpBSpline.h rename to modules/core/include/visp3/core/vpBSpline.h index c1c371f8521a4f69a6bde8d2e24c255fdc2c38f6..1329e518f37dfdb6abd020daf0b28d6c3dffce51 100644 --- a/src/math/spline/vpBSpline.h +++ b/modules/core/include/visp3/core/vpBSpline.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpBSpline.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * This class implements the B-Spline * @@ -47,15 +43,11 @@ \brief Class that provides tools to compute and manipulate a B-Spline curve. */ -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> #include <vector> #include <list> - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -# include <visp/vpList.h> -#endif -#include <visp/vpMatrix.h> +#include <visp3/core/vpMatrix.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -79,8 +71,7 @@ typedef struct vpBasisFunction{ /*! \class vpBSpline - \ingroup MathTools - + \ingroup group_core_math_spline \brief Class that provides tools to compute and manipulate a B-Spline curve. @@ -223,93 +214,6 @@ class VISP_EXPORT vpBSpline static vpImagePoint* computeCurveDers(double l_u, unsigned int l_i, unsigned int l_p, unsigned int l_der, std::vector<double> &l_knots, std::vector<vpImagePoint> &l_controlPoints); vpImagePoint* computeCurveDers(double u, unsigned int der); - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated functions - */ - /*! - \deprecated This method is deprecated. You should use get_controlPoints(std::list<vpImagePoint> &) const instead. \n \n - Gets all the control points. - - \return list : A vpList containing the coordinates of the control points - */ - vp_deprecated vpList<vpImagePoint> get_controlPoints() const { - vpList<vpImagePoint> list; - for (unsigned int i = 0; i < controlPoints.size(); i++) list.addRight(*(&(controlPoints[0])+i)); - return list; } - - /*! - \deprecated This method is deprecated. You should use get_knots(std::list<double> &) const instead. \n \n - Gets all the knots. - - \return list : A vpList containing the value of the knots. - */ - vp_deprecated inline vpList<double> get_knots() const { - vpList<double> list; - for (unsigned int i = 0; i < knots.size(); i++) list.addRight(*(&(knots[0])+i)); - return list; } - - /*! - \deprecated This method is deprecated. You should use get_crossingPoints(std::list<vpImagePoint> &) const instead. \n \n - Gets all the crossing points (used in the interpolation method) - - \return list : A vpList containing the coordinates of the crossing points - */ - vp_deprecated inline vpList<vpImagePoint> get_crossingPoints() const { - vpList<vpImagePoint> list; - for (unsigned int i = 0; i < crossingPoints.size(); i++) list.addRight(*(&(crossingPoints[0])+i)); - return list; } - - /*! - \deprecated This method is deprecated. You should use set_controlPoints(const std::list<vpImagePoint> &) instead. \n \n - Sets all the control points. - - \param list : A vpList containing the coordinates of the control points - */ - vp_deprecated inline void set_controlPoints(vpList<vpImagePoint> &list) { - controlPoints.clear(); - list.front(); - for (unsigned int i = 0; i < list.nbElements(); i++) - { - controlPoints.push_back(list.value()); - list.next(); - } - } - - /*! - \deprecated This method is deprecated. You should use set_knots(const std::list<double> &) instead. \n \n - Sets all the knots. - - \param list : A vpList containing the value of the knots. - */ - vp_deprecated inline void set_knots(vpList<double> &list) { - knots.clear(); - list.front(); - for (unsigned int i = 0; i < list.nbElements(); i++) - { - knots.push_back(list.value()); - list.next(); - } - } - - /*! - \deprecated This method is deprecated. You should use set_crossingPoints(const std::list<vpImagePoint> &) instead. \n \n - Sets all the crossing points (used in the interpolation method) - - \param list : A vpList containing the coordinates of the crossing points - */ - vp_deprecated inline void set_crossingPoints(vpList<vpImagePoint> &list) { - crossingPoints.clear(); - list.front(); - for (unsigned int i = 0; i < list.nbElements(); i++) - { - crossingPoints.push_back(list.value()); - list.next(); - } - } -#endif - }; #endif diff --git a/src/camera/vpCameraParameters.h b/modules/core/include/visp3/core/vpCameraParameters.h similarity index 66% rename from src/camera/vpCameraParameters.h rename to modules/core/include/visp3/core/vpCameraParameters.h index 28906872e6df97fe6a77affb1d223578d6f30935..fec82cfbb9a12c30392e962f113b81d0f6d3f96a 100644 --- a/src/camera/vpCameraParameters.h +++ b/modules/core/include/visp3/core/vpCameraParameters.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpCameraParameters.h 5207 2015-01-26 09:05:28Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Camera intrinsic parameters. * @@ -54,113 +50,127 @@ #include <vector> -#include <visp/vpConfig.h> -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpDebug.h> /*! \class vpCameraParameters - \ingroup CameraModelTransformation CameraModel + \ingroup group_core_camera \brief Generic class defining intrinsic camera parameters. - Two kinds of camera modelisation are implemented: - - Camera parameters for a perspective projection without distortion model, - - Camera parameters for a perspective projection with distortion model. - - The main intrinsic camera parameters are \f$(p_x, p_y)\f$ the ratio - between the focal length and the size of a pixel, and \f$(u_0, - v_0)\f$ the coordinates of the principal point in pixel. The lens - distortion can also be considered by two additional parameters - \f$(k_{ud}, k_{du})\f$. - - <b>1. Camera parameters for a perspective projection without distortion model</b> - - In this modelisation, only \f$u_0,v_0,p_x,p_y\f$ parameters are - used. If we denote \f$(u,v)\f$ the position of a pixel in the - digitized image, this position is related to the corresponding - coordinates \f$(x,y)\f$ in the normalized space (in meter) by: + Let us define the pinhole camera model implemented in ViSP. In this model, a scene view is formed + by projecting 3D points into the image plane using a perspective transformation. \f[ - \left\{ \begin{array}{l} - u = u_0 + p_x x \\ - v = v_0 + p_y y - \end{array}\right. + \left[ \begin{array}{c} + u \\ + v \\ + 1 + \end{array}\right] = + \left[ \begin{array}{ccc} + u_0 & 0 & p_x \\ + 0 & v_0 & p_y \\ + 0 & 0 & 1 + \end{array}\right] + \left[ \begin{array}{c} + X_c \\ + Y_c \\ + Z_c + \end{array}\right] \f] - The initialization of such a model can be done using: - - initPersProjWithoutDistortion() that allows to set \f$u_0,v_0,p_x,p_y\f$ parameters; - - initFromFov() that computes the parameters from an image size and a camera field of view. + where: - <b>2. Camera parameters for a perspective projection with distortion model</b> - - In this modelisation, \f$u_0,v_0,p_x,p_y,k_{ud},k_{du}\f$ - parameters are used. If a model with distortion is considered, we - got: + - \f$(X_c,Y_c,Z_c)\f$ are the coordinates of a 3D point in the camera frame + - \f$(u,v)\f$ are the coordinates in pixels of the projected 3D point + - \f$(u_0,v_0)\f$ is a principal point that is usually near the image center + - \f$(p_x,p_y)\f$ are the focal lengths expressed in pixel units. + When \f$Z_c \neq 0\f$, the previous equation si equivalent to the following: \f[ - \left\{ \begin{array}{l} - u = u_0 + p_x x + \delta_u \\ - v = v_0 + p_y y + \delta_v - \end{array}\right. + \begin{array}{lcl} + x &=& X_c / Z_c \\ + y &=& Y_c / Z_c \\ + u &=& u_0 + x \; p_x \\ + v &=& v_0 + y \; p_y + \end{array} \f] - where \f$\delta_u\f$ and \f$\delta_v\f$ are - geometrical distortions introduced in the camera model. These distortions are - due to imperfections in the lenses design and assembly there usually are some - positional errors that have to be taken into account. - \f$\delta_u\f$ and \f$\delta_v\f$ can be modeled as follow: - - with an undistorted to distorted model - \f[ - \left\{ \begin{array}{l} - \delta_u(x,y) = k_{ud} \;r^2\; p_x x \\ - \\ - \delta_v(x,y) = k_{ud}\; r^2\; p_y y - \end{array}\right. - \f] - with \f[ r^2 = x^2 + y^2 \f] - This model is useful to convert meter to pixel coordinates because in this - case : + Real lenses usually have some radial distortion. So, the above model is extended as: + \f[ - \left\{ \begin{array}{l} - u = f_u(x,y) = u_0 + p_x x\left(1+k_{ud}\left(x^2 + y^2\right)\right) \\ - \\ - v = f_v(x,y) = v_0 + p_y y\left(1+k_{ud}\left(x^2 + y^2\right)\right) - \end{array}\right. + \begin{array}{lcl} + x &=& X_c / Z_c \\ + y &=& Y_c / Z_c \\ + x^{'} &=& x (1 + k_{ud} r^2) \\ + y^{'} &=& y (1 + k_{ud} r^2) \\ + r^2 &=& x^2 + y^2 \\ + u &=& u_0 + x^{'} \; p_x \\ + v &=& v_0 + y^{'} \; p_y + \end{array} \f] - The conversion from normalized coordinates \f$(x,y)\f$ into pixel - \f$(u,v)\f$ is implemented in vpMeterPixelConversion. - - or with a distorted to undistorted model + where \f$k_{ud}\f$ is the first order radial distorsion. Higher order distorsion coefficients are not considered in ViSP. + + Now in ViSP we consider also the inverse transformation, where from pixel coordinates we want to compute their + normalized coordinates in the image plane. Previous equations could be written like: + \f[ - \left\{ \begin{array}{l} - \delta_u(u,v) = -k_{du} \;r^2\; \left(u-u_0\right) \\ - \\ - \delta_v(u,v) = -k_{du}\; r^2\; \left(v-v_0\right) - \end{array}\right. + \begin{array}{lcl} + x &=& (u - u_0) / p_x \\ + y &=& (v - v_0) / p_y + \end{array} \f] - with \f[ r^2 = {\left(\frac{u-u_0}{p_{x}}\right)}^2 + {\left(\frac{v-v_0}{p_{y}}\right)}^2 \f] - This model is useful to convert pixel to meter coordinates because in this - case : + + Considering radial distortion, the above model is extended as: \f[ - \left\{ \begin{array}{l} - x = f_x(u,v) = \frac{u-u_0}{p_x}\left(1+k_{du}\left( {\left(\frac{u-u_0}{p_{x}}\right)}^2 + {\left(\frac{v-v_0}{p_{y}}\right)}^2 \right)\right) \\ - \\ - y = f_y(u,v) = \frac{v-v_0}{p_y}\left(1+k_{du}\left( {\left(\frac{u-u_0}{p_{x}}\right)}^2 + {\left(\frac{v-v_0}{p_{y}}\right)}^2 \right)\right) - \end{array}\right. + \begin{array}{lcl} + (u-u_0)^{'} &=& (u-u_0) (1 + k_{du} r^2) \\ + (v-v_0)^{'} &=& (v-v_0) (1 + k_{du} r^2) \\ + r^2 &=& ((u-u_0)/p_x)^2 + ((v-v_0)/p_y)^2 \\ + x &=& (u - u_0)^{'} / p_x \\ + y &=& (v - v_0)^{'} / p_y + \end{array} \f] - The initialization of such a model can be done using: - - initPersProjWithDistortion() that allows to set \f$u_0,v_0,p_x,p_y,k_{ud},k_{du}\f$ parameters; + Finally, in ViSP the main intrinsic camera parameters are \f$(p_x, p_y)\f$ the ratio + between the focal length and the size of a pixel, and \f$(u_0, + v_0)\f$ the coordinates of the principal point in pixel. The lens + distortion can also be considered by two additional parameters + \f$(k_{ud}, k_{du})\f$. + + \note \ref tutorial-calibration shows how to calibrate a camera + to estimate the parameters corresponding to the model implemented in this class. + + \note Note also that \ref tutorial-bridge-opencv gives the correspondance between + ViSP and OpenCV camera modelization. \note The conversion from pixel coordinates \f$(u,v)\f$ in the normalized space \f$(x,y)\f$ is implemented in vpPixelMeterConversion, whereas the conversion from normalized coordinates into pixel is implemented in vpMeterPixelConversion. - The selection of one of these modelisations is done during + From a practical point of view, two kinds of camera modelisation are implemented in this class: + + <b>1. Camera parameters for a perspective projection without distortion model</b> + + In this modelisation, only \f$u_0,v_0,p_x,p_y\f$ parameters are considered. + + Initialization of such a model can be done using: + - initPersProjWithoutDistortion() that allows to set \f$u_0,v_0,p_x,p_y\f$ parameters; + - initFromFov() that computes the parameters from an image size and a camera field of view. + + <b>2. Camera parameters for a perspective projection with distortion model</b> + + In this modelisation, all the parameters \f$u_0,v_0,p_x,p_y,k_{ud},k_{du}\f$ + are considered. Initialization of such a model can be done using: + - initPersProjWithDistortion() that allows to set \f$u_0,v_0,p_x,p_y,k_{ud},k_{du}\f$ parameters; + + The selection of the camera model (without or with distorsion) is done during vpCameraParameters initialisation. Here an example of camera initialisation, for a model without distortion. A complete example is given in initPersProjWithoutDistortion(). @@ -204,8 +214,6 @@ An XML parser for camera parameters is also provided in vpXmlParserCamera. - Note also that the \ref tutorial-calibration shows how to calibrate a camera - to obtain the parameters corresponding to both models implemented in this class. */ class VISP_EXPORT vpCameraParameters { @@ -308,35 +316,6 @@ public : void printParameters() ; friend VISP_EXPORT std::ostream & operator << (std::ostream & os, const vpCameraParameters &cam); -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - \deprecated This function is deprecated. Use rather getHorizontalFovAngle(). - Get the horizontal angle of the field of view. - - \sa computeFov() - - \return AngleX computed with px and width. - */ - vp_deprecated inline double getFovAngleX() const { - if(!isFov) vpTRACE("Warning: The FOV is not computed, getFovAngleX() won't be significant."); - return m_hFovAngle; - } - - /*! - \deprecated This function is deprecated. Use rather getVerticalFovAngle(). - Get the vertical angle in radian of the field of view. - - \sa computeFov() - - \return FOV vertical angle computed with py and height. - */ - vp_deprecated inline double getFovAngleY() const { - if(!isFov) vpTRACE("Warning: The FOV is not computed, getFovAngleY() won't be significant."); - return m_hFovAngle; - } - -#endif - private: static const double DEFAULT_U0_PARAMETER; static const double DEFAULT_V0_PARAMETER; diff --git a/src/tracking/forward-projection/vpCircle.h b/modules/core/include/visp3/core/vpCircle.h similarity index 80% rename from src/tracking/forward-projection/vpCircle.h rename to modules/core/include/visp3/core/vpCircle.h index 86151b247669caf39314c3ac52aef3ce9b7cce2e..aa5cca375d0b977e50cfef14d7de7b88c48ebbd6 100644 --- a/src/tracking/forward-projection/vpCircle.h +++ b/modules/core/include/visp3/core/vpCircle.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpCircle.h 4702 2014-03-27 15:33:52Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Visual feature circle. * @@ -47,15 +43,15 @@ #ifndef vpCircle_hh #define vpCircle_hh -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> #include <math.h> -#include <visp/vpDebug.h> -#include <visp/vpMath.h> -#include <visp/vpForwardProjection.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpForwardProjection.h> /*! \class vpCircle - \ingroup TrackingFeature GeometryFeature + \ingroup group_core_geometry \brief Class that defines what is a circle. */ class VISP_EXPORT vpCircle : public vpForwardProjection @@ -109,6 +105,13 @@ public: const unsigned int thickness=1) ; vpCircle *duplicate() const ; + //################### + // Static Functions + //################### + + public: + static void computeIntersectionPoint(const vpCircle &circle, const vpCameraParameters &cam, const double &rho, const double &theta, double &i, double &j); + } ; diff --git a/src/network/vpClient.h b/modules/core/include/visp3/core/vpClient.h similarity index 87% rename from src/network/vpClient.h rename to modules/core/include/visp3/core/vpClient.h index 0f457799a2ae37dde13bd3bbb809ac1798baa310..f492f68df9bb7e326e171431ae53d2134fc30c85 100644 --- a/src/network/vpClient.h +++ b/modules/core/include/visp3/core/vpClient.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpClient.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * TCP Client * @@ -42,18 +38,18 @@ #ifndef vpClient_H #define vpClient_H -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> -#include <visp/vpException.h> -#include <visp/vpRequest.h> -#include <visp/vpNetwork.h> -#include <visp/vpTime.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpRequest.h> +#include <visp3/core/vpNetwork.h> +#include <visp3/core/vpTime.h> /*! \class vpClient - \ingroup Network + \ingroup group_core_network \brief This class represents a Transmission Control Protocol (TCP) client. @@ -64,7 +60,7 @@ It corresponds to the client used in the first exemple of vpServer class' documentation: \code -#include <visp/vpClient.h> +#include <visp3/core/vpClient.h> #include <iostream> int main(int argc, char **argv) @@ -99,11 +95,11 @@ int main(int argc, char **argv) It correspond to the server used in the second exemple of vpServer class' documentation. \code -#include <visp/vpClient.h> -#include <visp/vpV4l2Grabber.h> -#include <visp/vpImage.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> +#include <visp3/core/vpClient.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> #include <iostream> #include "vpRequestImage.h" //See vpRequest class documentation diff --git a/modules/core/include/visp3/core/vpColVector.h b/modules/core/include/visp3/core/vpColVector.h new file mode 100644 index 0000000000000000000000000000000000000000..2a88c9364f419afc073d27420cce58152d7ceaec --- /dev/null +++ b/modules/core/include/visp3/core/vpColVector.h @@ -0,0 +1,320 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Provide some simple operation on column vectors. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + + + +#ifndef vpColVector_H +#define vpColVector_H + +#include <visp3/core/vpArray2D.h> +#include <visp3/core/vpRowVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRotationVector.h> +#include <visp3/core/vpPoseVector.h> + +class vpMatrix; +class vpRowVector; +class vpRotationVector; +class vpTranslationVector; +class vpPoseVector; + +/*! + \file vpColVector.h + \brief definition of column vector class as well + as a set of operations on these vector +*/ + +/*! + \class vpColVector + \ingroup group_core_matrices + + \brief Implementation of column vector and the associated operations. + + This class provides a data structure for a column vector that contains values of double. + It contains also some functions to achieve a set of operations on these vectors. + + The vpColVector class is derived from vpArray2D<double>. +*/ +class VISP_EXPORT vpColVector : public vpArray2D<double> +{ + friend class vpMatrix; +public: + + //! Basic constructor that creates an empty 0-size column vector. + vpColVector() : vpArray2D<double>() {}; + //! Construct a column vector of size n. All the elements are initialized to zero. + vpColVector(unsigned int n) : vpArray2D<double>(n,1){}; + //! Construct a column vector of size n. Each element is set to \e val. + vpColVector(unsigned int n, double val) : vpArray2D<double>(n, 1, val){}; + //! Copy constructor that allows to construct a column vector from an other one. + vpColVector(const vpColVector &v) : vpArray2D<double>(v) {}; + vpColVector(const vpColVector &v, unsigned int r, unsigned int nrows) ; + //! Constructor that initialize a column vector from a 3-dim (Euler or \f$\theta {\bf u}\f$) + //! or 4-dim (quaternion) rotation vector. + vpColVector(const vpRotationVector &v); + //! Constructor that initialize a column vector from a 6-dim pose vector. + vpColVector(const vpPoseVector &p); + //! Constructor that initialize a column vector from a 3-dim translation vector. + vpColVector(const vpTranslationVector &t); + vpColVector(const vpMatrix &M); + vpColVector(const vpMatrix &M, unsigned int j); + vpColVector(const std::vector<double> &v); + vpColVector(const std::vector<float> &v); + /*! + Destructor. + */ + virtual ~vpColVector() {}; + + /*! + Removes all elements from the vector (which are destroyed), + leaving the container with a size of 0. + */ + void clear() + { + if (data != NULL ) { + free(data); + data=NULL; + } + + if (rowPtrs!=NULL) { + free(rowPtrs); + rowPtrs=NULL ; + } + rowNum = colNum = dsize = 0; + } + + /*! + Convert a column vector containing angles in degrees into radians. + \sa rad2deg() + */ + inline void deg2rad() { + double d2r = M_PI/180.0; + + (*this) *= d2r; + } + + double euclideanNorm() const; + /*! + Extract a sub-column vector from a column vector. + \param r : Index of the row corresponding to the first element of the vector to extract. + \param colsize : Size of the vector to extract. + \exception vpException::fatalError If the vector to extract is not contained in the original one. + + \code + vpColVector v1; + for (unsigned int i=0; i<4; i++) + v1.stack(i); + // v1 is equal to [0 1 2 3]^T + vpColVector v2 = v1.extract(1, 3); + // v2 is equal to [1 2 3]^T + \endcode + */ + vpColVector extract(unsigned int r, unsigned int colsize) const + { + if (r >= rowNum || r+colsize > rowNum) { + throw(vpException(vpException::fatalError, + "Cannot extract a (%dx1) column vector from a (%dx1) column vector starting at index %d", + colsize, rowNum, r)); + } + + return vpColVector(*this, r, colsize); + } + + double infinityNorm() const; + void init(const vpColVector &v, unsigned int r, unsigned int nrows); + void insert(unsigned int i, const vpColVector &v); + + vpColVector &normalize() ; + vpColVector &normalize(vpColVector &x) const ; + + //! Operator that allows to set a value of an element \f$v_i\f$: v[i] = x + inline double &operator[](unsigned int n) { return *(data + n); } + //! Operator that allows to get the value of an element \f$v_i\f$: x = v[i] + inline const double &operator[](unsigned int n) const { return *(data+n); } + //! Copy operator. Allow operation such as A = v + vpColVector &operator=(const vpColVector &v); + vpColVector &operator=(const vpPoseVector &p); + vpColVector &operator=(const vpRotationVector &rv); + vpColVector &operator=(const vpTranslationVector &tv); + vpColVector &operator=(const vpMatrix &M); + vpColVector &operator=(const std::vector<double> &v); + vpColVector &operator=(const std::vector<float> &v); + vpColVector &operator=(double x); + + double operator*(const vpColVector &x) const; + vpMatrix operator*(const vpRowVector &v) const; + vpColVector operator*(const double x) const; + vpColVector &operator*=(double x); + + vpColVector operator/(const double x) const; + vpColVector &operator/=(double x); + + vpColVector operator+(const vpColVector &v) const; + vpColVector &operator+=(vpColVector v); + + vpColVector operator-(const vpColVector &v) const; + vpColVector &operator-=(vpColVector v); + vpColVector operator-() const; + + vpColVector &operator<<(const vpColVector &v); + vpColVector &operator<<(double *); + + int print(std::ostream& s, unsigned int length, char const* intro=0) const; + + /*! + Convert a column vector containing angles in radians into degrees. + \sa deg2rad() + */ + inline void rad2deg() { + double r2d = 180.0/M_PI; + + (*this) *= r2d; + } + + void reshape(vpMatrix & M, const unsigned int &nrows, const unsigned int &ncols); + vpMatrix reshape(const unsigned int &nrows, const unsigned int &ncols); + + /*! Modify the size of the column vector. + \param i : Size of the vector. This value corresponds to the vector number + of rows. + \param flagNullify : If true, set the data to zero. + \exception vpException::fatalError When \e ncols is not equal to 1. + */ + void resize(const unsigned int i, const bool flagNullify = true) + { + vpArray2D<double>::resize(i, 1, flagNullify); + } + /*! + Resize the column vector to a \e nrows-dimension vector. + This function can only be used with \e ncols = 1. + \param nrows : Vector number of rows. This value corresponds + to the size of the vector. + \param ncols : Vector number of columns. This value should be set to 1. + \param flagNullify : If true, set the data to zero. + \exception vpException::fatalError When \e ncols is not equal to 1. + + */ + void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify) + { + if (ncols != 1) + throw(vpException(vpException::fatalError, + "Cannot resize a column vector to a (%dx%d) dimension vector that has more than one column", + nrows, ncols)); + vpArray2D<double>::resize(nrows, ncols, flagNullify); + }; + + void stack(const double &d); + void stack(const vpColVector &v); + + double sumSquare() const; + vpRowVector t() const; + vpRowVector transpose() const; + void transpose(vpRowVector &v) const; + + /*! + Compute and return the cross product of two 3-dimension vectors: \f$a \times b\f$. + \param a : 3-dimension column vector. + \param b : 3-dimension column vector. + \return The cross product \f$a \times b\f$. + + \exception vpException::dimensionError If the vectors dimension is not equal to 3. + + */ + inline static vpColVector cross(const vpColVector &a, const vpColVector &b) + { + return crossProd(a,b); + } + static vpColVector crossProd(const vpColVector &a, const vpColVector &b) ; + + static double dotProd(const vpColVector &a, const vpColVector &b) ; + static vpColVector invSort(const vpColVector &v) ; + static double median(const vpColVector &v) ; + static double mean(const vpColVector &v) ; + // Compute the skew matrix [v]x + static vpMatrix skew(const vpColVector &v); + + static vpColVector sort(const vpColVector &v) ; + + static vpColVector stack(const vpColVector &A, const vpColVector &B); + static void stack(const vpColVector &A, const vpColVector &B, vpColVector &C); + + static double stdev(const vpColVector &v, const bool useBesselCorrection=false); + +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + /*! + @name Deprecated functions + */ + //@{ + /*! + \deprecated Provided only for compat with previous releases. + This function does nothing. + */ + vp_deprecated void init() {}; + /*! + \deprecated You should rather use extract(). + */ + vp_deprecated vpColVector rows(unsigned int first_row, unsigned int last_row) const + { + return vpColVector(*this, first_row-1, last_row-first_row+1); + } + /*! + \deprecated You should rather use eye() + */ + vp_deprecated void setIdentity(const double & val=1.0) ; + /*! + \deprecated You should rather use stack(const vpColVector &) + */ + vp_deprecated void stackMatrices(const vpColVector &r) { stack(r); }; + /*! + \deprecated You should rather use stack(const vpColVector &A, const vpColVector &B) + */ + vp_deprecated static vpColVector stackMatrices(const vpColVector &A, const vpColVector &B) { return stack(A, B); }; + /*! + \deprecated You should rather use stack(const vpColVector &A, const vpColVector &B, vpColVector &C) + */ + vp_deprecated static void stackMatrices(const vpColVector &A, const vpColVector &B, vpColVector &C) { stack(A, B, C); }; + + //@} +#endif +}; + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +VISP_EXPORT +#endif +vpColVector operator*(const double &x, const vpColVector &v) ; + +#endif diff --git a/src/image/vpColor.h b/modules/core/include/visp3/core/vpColor.h similarity index 61% rename from src/image/vpColor.h rename to modules/core/include/visp3/core/vpColor.h index adeaea2043a6e1ca5e538991b3dd13125cc42bbf..4c25b4c6407b3b2bdadb5a8f3bb50017e8fb77d3 100644 --- a/src/image/vpColor.h +++ b/modules/core/include/visp3/core/vpColor.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpColor.h 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Color definition. * @@ -45,14 +41,14 @@ #define vpColor_hh -#include <visp/vpConfig.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpRGBa.h> /*! \class vpColor - \ingroup ImageGUI + \ingroup group_core_gui \brief Class to define colors available for display functionnalities. @@ -69,12 +65,12 @@ a circle) and a specific brown color (used to draw a rectangle). \code -#include <visp/vpConfig.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayOpenCV.h> +#include <visp3/core/vpConfig.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayOpenCV.h> int main() { @@ -241,4 +237,83 @@ class VISP_EXPORT vpColor : public vpRGBa }; +// In this file if windows +#if defined(VISP_USE_MSVC) && defined(visp_EXPORTS) +/*!< Predefined black color with R=G=B=0 and identifier vpColor::id_black. */ +vpColor const __declspec(selectany) vpColor::black = vpColor(0, 0, 0, id_black); +/*!< Predefined white color with R=G=B=255 and identifier vpColor::id_white. */ +vpColor const __declspec(selectany) vpColor::white = vpColor(255, 255, 255, id_white); +/*!< Predefined light gray color with R=G=B=64 and identifier vpColor::id_lightGray. */ +vpColor const __declspec(selectany) vpColor::lightGray = vpColor(192, 192, 192, id_lightGray); +/*!< Predefined gray color with R=G=B=128 and identifier vpColor::id_gray. */ +vpColor const __declspec(selectany) vpColor::gray = vpColor(128, 128, 128, id_gray); +/*!< Predefined dark gray color with R=G=B=192 and identifier vpColor::id_darkGray. */ +vpColor const __declspec(selectany) vpColor::darkGray = vpColor(64, 64, 64, id_darkGray); +/*!< Predefined light red color with R= 255 and G=B=140 and identifier + vpColor::id_lightRed. */ +vpColor const __declspec(selectany) vpColor::lightRed = vpColor(255, 140, 140, id_lightRed); +/*!< Predefined red color with R=255 and G=B=0 and identifier + vpColor::id_red. */ +vpColor const __declspec(selectany) vpColor::red = vpColor(255, 0, 0, id_red); +/*!< Predefined dark red color with R= 128 and G=B=0 and identifier + vpColor::id_darkRed. */ +vpColor const __declspec(selectany) vpColor::darkRed = vpColor(128, 0, 0, id_darkRed); +/*!< Predefined light green color with G= 255 and R=B=140 and identifier + vpColor::id_lightGreen. */ +vpColor const __declspec(selectany) vpColor::lightGreen = vpColor(140, 255, 140, id_lightGreen); +/*!< Predefined green color with G=255 and R=B=0 and identifier + vpColor::id_green. */ +vpColor const __declspec(selectany) vpColor::green = vpColor(0, 255, 0, id_green); +/*!< Predefined dark green color with G= 128 and R=B=0 and identifier + vpColor::id_darkGreen. */ +vpColor const __declspec(selectany) vpColor::darkGreen = vpColor(0, 128, 0, id_darkGreen); +/*!< Predefined light blue color with B= 255 and R=G=140 and identifier + vpColor::id_lightBlue. */ +vpColor const __declspec(selectany) vpColor::lightBlue = vpColor(140, 140, 255, id_lightBlue); +/*!< Predefined blue color with R=G=0 and B=255 and identifier + vpColor::id_blue. */ +vpColor const __declspec(selectany) vpColor::blue = vpColor(0, 0, 255, id_blue); +/*!< Predefined dark blue color with B= 128 and R=G=0 and identifier + vpColor::id_darkBlue. */ +vpColor const __declspec(selectany) vpColor::darkBlue = vpColor(0, 0, 128, id_darkBlue); +/*!< Predefined yellow color with R=G=255 and B=0 and identifier + vpColor::id_yellow. */ +vpColor const __declspec(selectany) vpColor::yellow = vpColor(255, 255, 0, id_yellow); +/*!< Predefined cyan color with R=0 and G=B=255 and identifier + vpColor::id_cyan. */ +vpColor const __declspec(selectany) vpColor::cyan = vpColor(0, 255, 255, id_cyan); +/*!< Predefined orange color with R=255, G=165 and B=0 and identifier + vpColor::id_orange. */ +vpColor const __declspec(selectany) vpColor::orange = vpColor(255, 165, 0, id_orange); +/*!< Predefined purple color with R=128, G=0 and B=128 and identifier + vpColor::id_purple. */ +vpColor const __declspec(selectany) vpColor::purple = vpColor(128, 0, 128, id_purple); +/*!< Predefined none color with R=G=B=0 and identifier vpColor::id_unknown. */ +vpColor const __declspec(selectany) vpColor::none = vpColor(0, 0, 0, id_unknown); + +const __declspec(selectany) unsigned int vpColor::nbColors = 18; + +/*!< Array of available colors. */ +vpColor const __declspec(selectany) vpColor::allColors[vpColor::nbColors] = { + vpColor::blue , // 12 + vpColor::green , // 9 + vpColor::red , // 6 + vpColor::cyan , // 15 + vpColor::purple , // 4 + vpColor::yellow , // 14 + vpColor::orange , // 16 + vpColor::lightBlue ,// 11 + vpColor::lightGreen,// 8 + vpColor::lightRed , // 5 + vpColor::darkBlue , // 13 + vpColor::darkGreen ,// 10 + vpColor::darkRed , // 7 + vpColor::lightGray ,// 2 + vpColor::gray , // 3 + vpColor::darkGray , // 4 + vpColor::black , // 0 + vpColor::white}; // 17 + +#endif + #endif diff --git a/src/tools/convert/vpConvert.h b/modules/core/include/visp3/core/vpConvert.h similarity index 88% rename from src/tools/convert/vpConvert.h rename to modules/core/include/visp3/core/vpConvert.h index 2a871f28df36e49eff444cde3063bd6969a7740b..81532596c1f1e97ceae739fc3ad35b02df5c5192 100644 --- a/src/tools/convert/vpConvert.h +++ b/modules/core/include/visp3/core/vpConvert.h @@ -1,112 +1,112 @@ -/**************************************************************************** - * - * $Id: vpIoTools.h 5197 2015-01-23 17:24:22Z strinh $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Directory management. - * - * Authors: - * Fabien Spindler - * Souriya Trinh - * - *****************************************************************************/ - - -#ifndef __vpConvert_h__ -#define __vpConvert_h__ - -/*! - \file vpConvert.h - \brief Tools for type or general conversion. - */ - -#include <visp/vpConfig.h> - -#if (VISP_HAVE_OPENCV_VERSION >= 0x020101) - #include <opencv2/core/core.hpp> - #include <opencv2/features2d/features2d.hpp> -#endif - -#include <visp/vpImagePoint.h> -#include <visp/vpPoint.h> - - -class VISP_EXPORT vpConvert -{ - -public: -#if (VISP_HAVE_OPENCV_VERSION >= 0x020101) - static void convertFromOpenCV(const cv::KeyPoint &from, vpImagePoint &to); - static void convertFromOpenCV(const cv::Point2f &from, vpImagePoint &to); - static void convertFromOpenCV(const cv::Point2d &from, vpImagePoint &to); - static void convertFromOpenCV(const cv::Point3f &from, vpPoint &to, const bool cameraFrame=false); - static void convertFromOpenCV(const cv::Point3d &from, vpPoint &to, const bool cameraFrame=false); - - static void convertFromOpenCV(const std::vector<cv::KeyPoint> &from, std::vector<vpImagePoint> &to); - static void convertFromOpenCV(const std::vector<cv::Point2f> &from, std::vector<vpImagePoint> &to); - static void convertFromOpenCV(const std::vector<cv::Point2d> &from, std::vector<vpImagePoint> &to); - static void convertFromOpenCV(const std::vector<cv::Point3f> &from, std::vector<vpPoint> &to, const bool cameraFrame=false); - static void convertFromOpenCV(const std::vector<cv::Point3d> &from, std::vector<vpPoint> &to, const bool cameraFrame=false); - static void convertFromOpenCV(const std::vector<cv::DMatch> &from, std::vector<unsigned int> &to); - - static void convertToOpenCV(const vpImagePoint &from, cv::Point2f &to); - static void convertToOpenCV(const vpImagePoint &from, cv::Point2d &to); - static void convertToOpenCV(const vpPoint &from, cv::Point3f &to, const bool cameraFrame=false); - static void convertToOpenCV(const vpPoint &from, cv::Point3d &to, const bool cameraFrame=false); - - static void convertToOpenCV(const std::vector<vpImagePoint> &from, std::vector<cv::Point2f> &to); - static void convertToOpenCV(const std::vector<vpImagePoint> &from, std::vector<cv::Point2d> &to); - static void convertToOpenCV(const std::vector<vpPoint> &from, std::vector<cv::Point3f> &to, const bool cameraFrame=false); - static void convertToOpenCV(const std::vector<vpPoint> &from, std::vector<cv::Point3d> &to, const bool cameraFrame=false); - -private: - static vpImagePoint keyPointToVpImagePoint(const cv::KeyPoint &keypoint); - static vpImagePoint point2fToVpImagePoint(const cv::Point2f &point); - static vpImagePoint point2dToVpImagePoint(const cv::Point2d &point); - static vpPoint point3fToVpObjectPoint(const cv::Point3f &point3f); - static vpPoint point3dToVpObjectPoint(const cv::Point3d &point3d); - static vpPoint point3fToVpCamPoint(const cv::Point3f &point3f); - static vpPoint point3dToVpCamPoint(const cv::Point3d &point3d); - static int dMatchToTrainIndex(const cv::DMatch &match); - - static cv::Point2f vpImagePointToPoint2f(const vpImagePoint &point); - static cv::Point2d vpImagePointToPoint2d(const vpImagePoint &point); - static cv::Point3f vpCamPointToPoint3f(const vpPoint &point); - static cv::Point3d vpCamPointToPoint3d(const vpPoint &point); - static cv::Point3f vpObjectPointToPoint3f(const vpPoint &point); - static cv::Point3d vpObjectPointToPoint3d(const vpPoint &point); - -#endif - -}; - -#endif +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Directory management. + * + * Authors: + * Fabien Spindler + * Souriya Trinh + * + *****************************************************************************/ + + +#ifndef __vpConvert_h__ +#define __vpConvert_h__ + +/*! + \file vpConvert.h + \brief Tools for type or general conversion. + */ + +#include <visp3/core/vpConfig.h> + +#if (VISP_HAVE_OPENCV_VERSION >= 0x020101) + #include <opencv2/core/core.hpp> + #include <opencv2/features2d/features2d.hpp> +#endif + +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpPoint.h> + +/*! + \class vpConvert + \ingroup group_core_bridges + Bridges over other frameworks like OpenCV. + */ +class VISP_EXPORT vpConvert +{ + +public: +#if (VISP_HAVE_OPENCV_VERSION >= 0x020101) + static void convertFromOpenCV(const cv::KeyPoint &from, vpImagePoint &to); + static void convertFromOpenCV(const cv::Point2f &from, vpImagePoint &to); + static void convertFromOpenCV(const cv::Point2d &from, vpImagePoint &to); + static void convertFromOpenCV(const cv::Point3f &from, vpPoint &to, const bool cameraFrame=false); + static void convertFromOpenCV(const cv::Point3d &from, vpPoint &to, const bool cameraFrame=false); + + static void convertFromOpenCV(const std::vector<cv::KeyPoint> &from, std::vector<vpImagePoint> &to); + static void convertFromOpenCV(const std::vector<cv::Point2f> &from, std::vector<vpImagePoint> &to); + static void convertFromOpenCV(const std::vector<cv::Point2d> &from, std::vector<vpImagePoint> &to); + static void convertFromOpenCV(const std::vector<cv::Point3f> &from, std::vector<vpPoint> &to, const bool cameraFrame=false); + static void convertFromOpenCV(const std::vector<cv::Point3d> &from, std::vector<vpPoint> &to, const bool cameraFrame=false); + static void convertFromOpenCV(const std::vector<cv::DMatch> &from, std::vector<unsigned int> &to); + + static void convertToOpenCV(const vpImagePoint &from, cv::Point2f &to); + static void convertToOpenCV(const vpImagePoint &from, cv::Point2d &to); + static void convertToOpenCV(const vpPoint &from, cv::Point3f &to, const bool cameraFrame=false); + static void convertToOpenCV(const vpPoint &from, cv::Point3d &to, const bool cameraFrame=false); + + static void convertToOpenCV(const std::vector<vpImagePoint> &from, std::vector<cv::Point2f> &to); + static void convertToOpenCV(const std::vector<vpImagePoint> &from, std::vector<cv::Point2d> &to); + static void convertToOpenCV(const std::vector<vpPoint> &from, std::vector<cv::Point3f> &to, const bool cameraFrame=false); + static void convertToOpenCV(const std::vector<vpPoint> &from, std::vector<cv::Point3d> &to, const bool cameraFrame=false); + +private: + static vpImagePoint keyPointToVpImagePoint(const cv::KeyPoint &keypoint); + static vpImagePoint point2fToVpImagePoint(const cv::Point2f &point); + static vpImagePoint point2dToVpImagePoint(const cv::Point2d &point); + static vpPoint point3fToVpObjectPoint(const cv::Point3f &point3f); + static vpPoint point3dToVpObjectPoint(const cv::Point3d &point3d); + static vpPoint point3fToVpCamPoint(const cv::Point3f &point3f); + static vpPoint point3dToVpCamPoint(const cv::Point3d &point3d); + static int dMatchToTrainIndex(const cv::DMatch &match); + + static cv::Point2f vpImagePointToPoint2f(const vpImagePoint &point); + static cv::Point2d vpImagePointToPoint2d(const vpImagePoint &point); + static cv::Point3f vpCamPointToPoint3f(const vpPoint &point); + static cv::Point3d vpCamPointToPoint3d(const vpPoint &point); + static cv::Point3f vpObjectPointToPoint3f(const vpPoint &point); + static cv::Point3d vpObjectPointToPoint3d(const vpPoint &point); + +#endif + +}; + +#endif diff --git a/src/tracking/forward-projection/vpCylinder.h b/modules/core/include/visp3/core/vpCylinder.h similarity index 91% rename from src/tracking/forward-projection/vpCylinder.h rename to modules/core/include/visp3/core/vpCylinder.h index e8f0ebbf20d8ac7cb7f8524863acf03ee14b6479..6bda1c66f4e9e235a16a12e5888574ba47acd865 100644 --- a/src/tracking/forward-projection/vpCylinder.h +++ b/modules/core/include/visp3/core/vpCylinder.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpCylinder.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Cylinder feature. * @@ -48,15 +44,15 @@ #ifndef vpCylinder_hh #define vpCylinder_hh -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> #include <math.h> -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> -#include <visp/vpForwardProjection.h> +#include <visp3/core/vpForwardProjection.h> /*! \class vpCylinder - \ingroup TrackingFeature GeometryFeature + \ingroup group_core_geometry \brief Class that defines what is a cylinder. A cylinder may be represented by the equation: diff --git a/src/tools/trace/vpDebug.h b/modules/core/include/visp3/core/vpDebug.h similarity index 94% rename from src/tools/trace/vpDebug.h rename to modules/core/include/visp3/core/vpDebug.h index 4f3970ca8036f85dd47ae81c9815c0418bd8bfa7..bf3f3e340bf2f76dde6e4761415a544acd7a8815 100644 --- a/src/tools/trace/vpDebug.h +++ b/modules/core/include/visp3/core/vpDebug.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDebug.h 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Debug and trace macro. * @@ -51,7 +47,7 @@ #ifndef __VP_DEBUG_HH #define __VP_DEBUG_HH -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <stdio.h> #include <stdarg.h> #include <iostream> @@ -71,7 +67,7 @@ /*! \class vpTraceOutput - \ingroup Debug + \ingroup group_core_debug \brief This class is used to display debug or error messages. @@ -102,7 +98,7 @@ #define VP_DEBUG // Activate the debug mode #define VP_DEBUG_MODE 2 // Activate debug level 1 and 2 -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int main() { @@ -260,12 +256,12 @@ class vpTraceOutput #ifdef VP_TRACE // Activate the trace mode /*! - \ingroup Debug + \ingroup group_core_debug Works like vpTRACE() and should be used at the beginning of a function. \code #define VP_TRACE // To activate the trace mode -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int main() { @@ -281,12 +277,12 @@ int main() /*! - \ingroup Debug + \ingroup group_core_debug Works like vpTRACE() and should be used at the end of a function. \code #define VP_TRACE // To activate the trace mode -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int main() { @@ -314,7 +310,7 @@ inline void vpOUT_FCT (const char * /* a */, ...){} #ifdef VP_TRACE /*! - \ingroup Debug + \ingroup group_core_debug Used to display trace messages on the standard stream (C++). Use like this : vpCTRACE<<"my message"<<std::endl; @@ -323,7 +319,7 @@ inline void vpOUT_FCT (const char * /* a */, ...){} #define VP_DEBUG // To activate the debug mode #define VP_DEBUG_MODE 2 // To activate debug level 1 and 2 -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int main() { @@ -342,7 +338,7 @@ int main() /*! - \ingroup Debug + \ingroup group_core_debug Used to display error messages on the error stream (C++). Use like this : vpCERROR<<"my message"<<std::endl; @@ -351,7 +347,7 @@ int main() #define VP_DEBUG // To activate the debug mode #define VP_DEBUG_MODE 2 // To activate debug level 1 and 2 -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int main() { @@ -369,7 +365,7 @@ int main() #define vpCERROR std::cerr << "(L0) " << "!!\t" << __FILE__ << ": " << __FUNCTION__ << "(#" << __LINE__ << ") : " /*! - \ingroup Debug + \ingroup group_core_debug Used to display error messages on the error stream. Prints the name of the file, the function name and the line where it was used. @@ -380,7 +376,7 @@ int main() #define VP_TRACE // To activate trace mode #define VP_DEBUG_MODE 2 // Activate debug level 1 and 2 -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int main() { @@ -395,7 +391,7 @@ int main() #define vpERROR_TRACE (vpTraceOutput( __FILE__,__LINE__, __FUNCTION__, true)) /*! - \ingroup Debug + \ingroup group_core_debug Used to display trace messages on the standard stream. Prints the name of the file, the function name and the line where it was used. @@ -404,7 +400,7 @@ int main() \code #define VP_TRACE // To activate trace mode -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int main() { @@ -436,7 +432,7 @@ inline void vpTRACE (int /* level */, const char * /* a */, ...){} #ifdef VP_DEBUG /*! - \ingroup Debug + \ingroup group_core_debug vpDERROR_TRACE works like printf, but prints only if the tracing level is smaller than the debug level VP_DEBUG_MODE. @@ -444,7 +440,7 @@ inline void vpTRACE (int /* level */, const char * /* a */, ...){} #define VP_DEBUG // Activate the debug mode #define VP_DEBUG_MODE 2 // Activate debug level 1 and 2 -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int main() { @@ -459,7 +455,7 @@ int main() #define vpDERROR_TRACE (vpTraceOutput( __FILE__,__LINE__, __FUNCTION__, true)) /*! - \ingroup Debug + \ingroup group_core_debug vpDEBUG_TRACE works like printf, but prints only if the tracing level level is greater than the debug level VP_DEBUG_MODE. @@ -467,7 +463,7 @@ int main() #define VP_DEBUG // Activate the debug mode #define VP_DEBUG_MODE 2 // Activate debug level 1 and 2 -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int main() { @@ -482,13 +478,13 @@ int main() #define vpDEBUG_TRACE (vpTraceOutput( __FILE__,__LINE__, __FUNCTION__, false)) /*! - \ingroup Debug + \ingroup group_core_debug vpCDEBUG(level) work like the C++ output stream std::cout. \code #define VP_DEBUG // Activate the debug mode #define VP_DEBUG_MODE 2 // Activate debug level 1 and 2 -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int main() { @@ -507,7 +503,7 @@ int main() std::cout << "(L" << level << ") "<< __FILE__ << ": " << __FUNCTION__ << "(#" << __LINE__ << ") : " /*! - \ingroup Debug + \ingroup group_core_debug vpDEBUG_ENABLE(level) is equal to 1 if the debug level \e level is greater than the debug mode VP_DEBUG_MODE, 0 else. @@ -516,7 +512,7 @@ int main() #define VP_DEBUG // Activate the debug mode #define VP_DEBUG_MODE 2 // Activate debug level 1 and 2 -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int main() { diff --git a/src/device/display/vpDisplay.h b/modules/core/include/visp3/core/vpDisplay.h similarity index 94% rename from src/device/display/vpDisplay.h rename to modules/core/include/visp3/core/vpDisplay.h index 078b74daa5bdae42d6112b128223637f9a75b2d8..9b626ee1ac440f5b66703250932c541dce93afa2 100644 --- a/src/device/display/vpDisplay.h +++ b/modules/core/include/visp3/core/vpDisplay.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplay.h 5089 2014-12-19 07:58:34Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Image display. * @@ -47,14 +43,14 @@ #include <string> #include <sstream> -#include <visp/vpImage.h> -#include <visp/vpColor.h> -#include <visp/vpMouseButton.h> -#include <visp/vpRGBa.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpRect.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpMouseButton.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpRect.h> +#include <visp3/core/vpImagePoint.h> /*! \file vpDisplay.h @@ -66,7 +62,7 @@ \class vpDisplay - \ingroup ImageGUI + \ingroup group_core_gui \brief Class that defines generic functionnalities for display. @@ -76,13 +72,13 @@ The example below shows how to use this class. \code -#include <visp/vpConfig.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayOpenCV.h> +#include <visp3/core/vpConfig.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayOpenCV.h> int main() { @@ -558,6 +554,57 @@ class VISP_EXPORT vpDisplay \param width, height : Width and height of the window. \param x, y : The window is set at position x,y (column index, row index). \param title : Window title. + + The following example shows how to use this function + \code +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/io/vpImageIo.h> + +int main() +{ +#ifdef VISP_HAVE_DISPLAY + vpImage<unsigned char> I; + vpImageIo::read(I, "lena.pgm"); + + vpDisplay *d; + +#if defined(VISP_HAVE_X11) + d = new vpDisplayX; +#elif defined(VISP_HAVE_GTK) + d = new vpDisplayGTK; +#elif defined(VISP_HAVE_GDI) + d = new vpDisplayGDI; +#elif defined(VISP_HAVE_D3D9) + d = new vpDisplayD3D; +#elif defined(VISP_HAVE_OPENCV) + d = new vpDisplayOpenCV; +#else + std::cout << "Sorry, no video device is available" << std::endl; + return -1; +#endif + + d->init(I.getWidth(), I.getHeight(), 10, 20, "viewer"); + + // Now associate the display to the image + I.display = d; + + // Set the display background with image I content + vpDisplay::display(I); + + // Flush the foreground and background display + vpDisplay::flush(I); + + // wait for a mouse clink in the display to exit + vpDisplay::getClick(I); + + delete d; +#endif +} + \endcode */ virtual void init(unsigned int width, unsigned int height, int x=-1, int y=-1 , @@ -667,7 +714,7 @@ class VISP_EXPORT vpDisplay const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color=vpColor::none, - unsigned int thickness=1) ; + unsigned int thickness=1, vpImagePoint offset=vpImagePoint(0,0)) ; static void displayLine(const vpImage<unsigned char> &I, const vpImagePoint &ip1, const vpImagePoint &ip2, @@ -821,7 +868,7 @@ class VISP_EXPORT vpDisplay const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color=vpColor::none, - unsigned int thickness=1) ; + unsigned int thickness=1, vpImagePoint offset=vpImagePoint(0,0)); static void displayEllipse(const vpImage<vpRGBa> &I, const vpImagePoint ¢er, const double &coef1, const double &coef2, const double &coef3, diff --git a/src/device/display/vpDisplayException.h b/modules/core/include/visp3/core/vpDisplayException.h similarity index 86% rename from src/device/display/vpDisplayException.h rename to modules/core/include/visp3/core/vpDisplayException.h index 7c6263149ddeb9a951c60434adc1dcc8e0682e8d..74bde04df734e7efb15a2c4065f2b49c8e15d746 100644 --- a/src/device/display/vpDisplayException.h +++ b/modules/core/include/visp3/core/vpDisplayException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayException.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exception that can be emited by the vpDisplay class and its derivates. * @@ -54,8 +50,8 @@ \brief error that can be emited by the vpDisplay class and its derivates */ /* Classes standards. */ -#include <visp/vpConfig.h> -#include <visp/vpException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> #include <iostream> /* Classe std::ostream. */ #include <string> /* Classe string. */ @@ -66,9 +62,7 @@ /*! \class vpDisplayException - - \ingroup Exception - + \ingroup group_core_debug \brief Error that can be emited by the vpDisplay class and its derivates. */ class VISP_EXPORT vpDisplayException : public vpException diff --git a/src/exceptions/vpException.h b/modules/core/include/visp3/core/vpException.h similarity index 90% rename from src/exceptions/vpException.h rename to modules/core/include/visp3/core/vpException.h index d15124f7d04a67af0ae3c4125e953252b6c25b5d..9402fee7c95e32e00708322436494dd1744be9d8 100644 --- a/src/exceptions/vpException.h +++ b/modules/core/include/visp3/core/vpException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpException.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exception handling. * @@ -52,7 +48,7 @@ /* --- INCLUDE --------------------------------------------------------- */ /* --------------------------------------------------------------------- */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> /* Classes standards. */ #include <iostream> /* Classe std::ostream. */ @@ -66,6 +62,7 @@ /*! \class vpException + \ingroup group_core_debug \brief error that can be emited by ViSP classes. This class inherites from the standard std::exception contained in the C++ diff --git a/src/math/transformation/vpExponentialMap.h b/modules/core/include/visp3/core/vpExponentialMap.h similarity index 84% rename from src/math/transformation/vpExponentialMap.h rename to modules/core/include/visp3/core/vpExponentialMap.h index f8ed340d9efe1d1bab1e1cf4cf169558fec66421..cc07c7789bbfc8e044d71aa9c1d50fede79cfb1d 100644 --- a/src/math/transformation/vpExponentialMap.h +++ b/modules/core/include/visp3/core/vpExponentialMap.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpExponentialMap.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exponential map. * @@ -50,13 +46,13 @@ #ifndef vpExponentialMap_h #define vpExponentialMap_h -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpColVector.h> /*! \class vpExponentialMap - \ingroup ExpMapTransformation + \ingroup group_core_transformations \brief Direct or inverse exponential map computation. diff --git a/src/visual-feature/vpFeatureDisplay.h b/modules/core/include/visp3/core/vpFeatureDisplay.h similarity index 88% rename from src/visual-feature/vpFeatureDisplay.h rename to modules/core/include/visp3/core/vpFeatureDisplay.h index 9547c4df945b568a24746a5e1644cd6485c8a371..5ce0bb7ed98ebdfdb0eddd3b8e9fc4e454594f13 100644 --- a/src/visual-feature/vpFeatureDisplay.h +++ b/modules/core/include/visp3/core/vpFeatureDisplay.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureDisplay.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface with the image for feature display. * @@ -50,17 +46,17 @@ */ //Color / image / display -#include <visp/vpImage.h> -#include <visp/vpColor.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpRGBa.h> // Meter/pixel conversion -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpCameraParameters.h> /*! \class vpFeatureDisplay - \ingroup VsFeatureDisplay + \ingroup group_core_gui \brief Interface with the image for feature display. */ class VISP_EXPORT vpFeatureDisplay diff --git a/src/math/transformation/vpForceTwistMatrix.h b/modules/core/include/visp3/core/vpForceTwistMatrix.h similarity index 63% rename from src/math/transformation/vpForceTwistMatrix.h rename to modules/core/include/visp3/core/vpForceTwistMatrix.h index 33a797a2f058837146527b1b45def59b1b7a9c1b..7edea4a9626131c025499be144babf7cc9d82a3b 100644 --- a/src/math/transformation/vpForceTwistMatrix.h +++ b/modules/core/include/visp3/core/vpForceTwistMatrix.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpForceTwistMatrix.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Twist transformation matrix that allows to transform forces from one * frame to an other. @@ -43,22 +39,24 @@ #ifndef vpForceTwistMatrix_h #define vpForceTwistMatrix_h -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRotationMatrix.h> +#include <visp3/core/vpArray2D.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRotationMatrix.h> /*! \class vpForceTwistMatrix - \ingroup TwistTransformation + \ingroup group_core_transformations + + \brief Implementation of a force/torque twist matrix and operations on such kind of matrices. - \brief Class that consider the particular case of twist + Class that consider the particular case of twist transformation matrix that allows to transform a force/troque vector from one frame to an other. - The vpForceTwistMatrix is derived from vpMatrix. + The vpForceTwistMatrix class is derived from vpArray2D<double>. The twist transformation matrix that allows to transform the force/torque vector expressed at frame \f${\cal F}_b\f$ into the @@ -79,8 +77,8 @@ from probe frame to a sensor frame. \code -#include <visp/vpColVector.h> -#include <visp/vpForceTwistMatrix.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpForceTwistMatrix.h> int main() { @@ -101,13 +99,11 @@ int main() } \endcode */ -class VISP_EXPORT vpForceTwistMatrix : public vpMatrix +class VISP_EXPORT vpForceTwistMatrix : public vpArray2D<double> { - friend class vpMatrix; - public: // basic constructor - vpForceTwistMatrix() ; + vpForceTwistMatrix(); // copy constructor vpForceTwistMatrix(const vpForceTwistMatrix &F) ; // constructor from an homogeneous transformation @@ -117,20 +113,21 @@ class VISP_EXPORT vpForceTwistMatrix : public vpMatrix vpForceTwistMatrix(const vpTranslationVector &t, const vpThetaUVector &thetau) ; // Construction from Translation and rotation (matrix parameterization) vpForceTwistMatrix(const vpTranslationVector &t, const vpRotationMatrix &R) ; - vpForceTwistMatrix(const double tx, const double ty, const double tz, - const double tux, const double tuy, const double tuz) ; - - // Basic initialisation (identity) - void init() ; + vpForceTwistMatrix(const double tx, const double ty, const double tz, + const double tux, const double tuy, const double tuz) ; + /*! + Destructor. + */ + virtual ~vpForceTwistMatrix() {}; vpForceTwistMatrix buildFrom(const vpTranslationVector &t, - const vpRotationMatrix &R); + const vpRotationMatrix &R); vpForceTwistMatrix buildFrom(const vpTranslationVector &t, - const vpThetaUVector &thetau); + const vpThetaUVector &thetau); vpForceTwistMatrix buildFrom(const vpHomogeneousMatrix &M) ; // Basic initialisation (identity) - void setIdentity() ; + void eye() ; vpForceTwistMatrix operator*(const vpForceTwistMatrix &F) const ; vpMatrix operator*(const vpMatrix &M) const ; @@ -139,12 +136,39 @@ class VISP_EXPORT vpForceTwistMatrix : public vpMatrix // copy operator from vpMatrix (handle with care) vpForceTwistMatrix &operator=(const vpForceTwistMatrix &H); -} ; + int print(std::ostream& s, unsigned int length, char const* intro=0) const; + + /*! + This function is not applicable to a velocity twist matrix that is always a + 6-by-6 matrix. + \exception vpException::fatalError When this function is called. + */ + void resize(const unsigned int nrows, const unsigned int ncols, + const bool flagNullify = true) + { + (void)nrows; + (void)ncols; + (void)flagNullify; + throw(vpException(vpException::fatalError, "Cannot resize a velocity twist matrix")); + }; + +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + /*! + @name Deprecated functions + */ + //@{ + /*! + \deprecated Provided only for compat with previous releases. + This function does nothing. + */ + vp_deprecated void init() {}; + /*! + \deprecated You should rather use eye(). + */ + vp_deprecated void setIdentity(); + //@} #endif +} ; -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +#endif diff --git a/src/tracking/forward-projection/vpForwardProjection.h b/modules/core/include/visp3/core/vpForwardProjection.h similarity index 93% rename from src/tracking/forward-projection/vpForwardProjection.h rename to modules/core/include/visp3/core/vpForwardProjection.h index 6b4a8ea36f6b1c244e22ca914db861807491ad9b..cd6cb94f77bc6a032fe92608de36ee7ff0ffa78f 100644 --- a/src/tracking/forward-projection/vpForwardProjection.h +++ b/modules/core/include/visp3/core/vpForwardProjection.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpForwardProjection.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Forward projection. * @@ -47,11 +43,11 @@ \brief class that defines what is a generic geometric feature */ -#include <visp/vpMatrix.h> -#include <visp/vpTracker.h> -#include <visp/vpColor.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpTracker.h> +#include <visp3/core/vpColor.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> /*! diff --git a/src/device/framegrabber/generic-framegrabber/vpFrameGrabber.h b/modules/core/include/visp3/core/vpFrameGrabber.h similarity index 83% rename from src/device/framegrabber/generic-framegrabber/vpFrameGrabber.h rename to modules/core/include/visp3/core/vpFrameGrabber.h index 975adbd234566f5b2de27aee5e4b7b54e647be0b..a8b203650fef2e04eabb6d023e3e655866388d1b 100644 --- a/src/device/framegrabber/generic-framegrabber/vpFrameGrabber.h +++ b/modules/core/include/visp3/core/vpFrameGrabber.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFrameGrabber.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Frame grabbing. * @@ -44,8 +40,8 @@ #ifndef vpFrameGrabber_hh #define vpFrameGrabber_hh -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> /*! \file vpFrameGrabber.h @@ -56,8 +52,6 @@ /*! \class vpFrameGrabber - \ingroup Framegrabber - \brief Base class for all video devices. It is designed to provide a front end to video sources. @@ -66,19 +60,19 @@ The example below shows how to use this class. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpV4l2Grabber.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vpFrameGrabber *g; // Generic framegrabber -#if defined( VISP_HAVE_DC1394_2 ) +#if defined( VISP_HAVE_DC1394 ) vp1394TwoGrabber *g_1394_2 = new vp1394TwoGrabber; // specific settings for firewire grabber based on libdc1394-2.x version g_1394_2->setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_320x240_YUV422); diff --git a/src/device/framegrabber/generic-framegrabber/vpFrameGrabberException.h b/modules/core/include/visp3/core/vpFrameGrabberException.h similarity index 85% rename from src/device/framegrabber/generic-framegrabber/vpFrameGrabberException.h rename to modules/core/include/visp3/core/vpFrameGrabberException.h index 1439f7ab2d8eefa2cf1de811219e86936dc1dc8d..94d908709553b5ed868ef8718d12583448909d24 100644 --- a/src/device/framegrabber/generic-framegrabber/vpFrameGrabberException.h +++ b/modules/core/include/visp3/core/vpFrameGrabberException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFrameGrabberException.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exceptions that can be emited by the vpFrameGrabber class and its derivates. * @@ -54,8 +50,8 @@ */ /* Classes standards. */ -#include <visp/vpConfig.h> -#include <visp/vpException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> #include <iostream> /* Classe std::ostream. */ #include <string> /* Classe string. */ @@ -63,10 +59,7 @@ /* --- CLASS --------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ -/*! - - \ingroup Exception - +/*! \brief Error that can be emited by the vpFrameGrabber class and its derivates */ class VISP_EXPORT vpFrameGrabberException : public vpException diff --git a/src/device/display/windows/vpGDIRenderer.h b/modules/core/include/visp3/core/vpGDIRenderer.h old mode 100755 new mode 100644 similarity index 88% rename from src/device/display/windows/vpGDIRenderer.h rename to modules/core/include/visp3/core/vpGDIRenderer.h index ca9631dd583caa108305a1318c4cf0c8e11e661d..f1d2a92a49de6b8df5c9575ddfca632200f4e10c --- a/src/device/display/windows/vpGDIRenderer.h +++ b/modules/core/include/visp3/core/vpGDIRenderer.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpGDIRenderer.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * GDI renderer for windows 32 display * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_GDI) ) #ifndef vpGDIRenderer_HH @@ -50,12 +46,12 @@ #include <windows.h> -#include <visp/vpWin32Renderer.h> -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> -#include <visp/vpDisplayException.h> +#include <visp3/gui/vpWin32Renderer.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/core/vpDisplayException.h> -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> class VISP_EXPORT vpGDIRenderer : public vpWin32Renderer { diff --git a/modules/core/include/visp3/core/vpGEMM.h b/modules/core/include/visp3/core/vpGEMM.h new file mode 100644 index 0000000000000000000000000000000000000000..02c1769fbd3b5d6d48c4d85cb049b50de4483a74 --- /dev/null +++ b/modules/core/include/visp3/core/vpGEMM.h @@ -0,0 +1,394 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Matrix generalized multiplication. + * + * Authors: + * Laneurit Jean + * + *****************************************************************************/ + + +#ifndef __VP_GEMM__ +#define __VP_GEMM__ + +#include <visp3/core/vpArray2D.h> +#include <visp3/core/vpException.h> + +const vpArray2D<double> null(0,0); + +/*! + Enumeration of the operations applied on matrices in vpGEMM() function. + + Operations are : + - VP_GEMM_A_T to use the transpose matrix of A instead of the matrix A + - VP_GEMM_B_T to use the transpose matrix of B instead of the matrix B + - VP_GEMM_C_T to use the transpose matrix of C instead of the matrix C + + \relates vpArray2D + */ +typedef enum { + VP_GEMM_A_T=1, //! Use A^T instead of A + VP_GEMM_B_T=2, //! Use B^T instead of B + VP_GEMM_C_T=4, //! Use C^T instead of C +} vpGEMMmethod; + +template<unsigned int> +inline void GEMMsize(const vpArray2D<double> & /*A*/,const vpArray2D<double> & /*B*/, unsigned int &/*Arows*/, unsigned int &/*Acols*/, unsigned int &/*Brows*/, unsigned int &/*Bcols*/) +{} + +template<> +void inline GEMMsize<0>(const vpArray2D<double> & A,const vpArray2D<double> & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols) +{ + Arows= A.getRows(); + Acols= A.getCols(); + Brows= B.getRows(); + Bcols= B.getCols(); +} + +template<> +inline void GEMMsize<1>(const vpArray2D<double> & A,const vpArray2D<double> & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols) +{ + Arows= A.getCols(); + Acols= A.getRows(); + Brows= B.getRows(); + Bcols= B.getCols(); +} +template<> +inline void GEMMsize<2>(const vpArray2D<double> & A,const vpArray2D<double> & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols) +{ + Arows= A.getRows(); + Acols= A.getCols(); + Brows= B.getCols(); + Bcols= B.getRows(); +} +template<> +inline void GEMMsize<3>(const vpArray2D<double> & A,const vpArray2D<double> & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols) +{ + Arows= A.getCols(); + Acols= A.getRows(); + Brows= B.getCols(); + Bcols= B.getRows(); +} + +template<> +inline void GEMMsize<4>(const vpArray2D<double> & A,const vpArray2D<double> & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols) +{ + Arows= A.getRows(); + Acols= A.getCols(); + Brows= B.getRows(); + Bcols= B.getCols(); +} + +template<> +inline void GEMMsize<5>(const vpArray2D<double> & A,const vpArray2D<double> & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols) +{ + Arows= A.getCols(); + Acols= A.getRows(); + Brows= B.getRows(); + Bcols= B.getCols(); +} + +template<> +inline void GEMMsize<6>(const vpArray2D<double> & A,const vpArray2D<double> & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols) +{ + Arows= A.getRows(); + Acols= A.getCols(); + Brows= B.getCols(); + Bcols= B.getRows(); +} + +template<> +inline void GEMMsize<7>(const vpArray2D<double> & A,const vpArray2D<double> & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols) +{ + Arows= A.getCols(); + Acols= A.getRows(); + Brows= B.getCols(); + Bcols= B.getRows(); +} + +template<unsigned int> +inline void GEMM1(const unsigned int &/*Arows*/,const unsigned int &/*Brows*/, const unsigned int &/*Bcols*/, const vpArray2D<double> & /*A*/, const vpArray2D<double> & /*B*/, const double & /*alpha*/,vpArray2D<double> &/*D*/){} + +template<> +inline void GEMM1<0>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpArray2D<double> & A, const vpArray2D<double> & B, const double & alpha,vpArray2D<double> &D) +{ + for(unsigned int r=0;r<Arows;r++) + for(unsigned int c=0;c<Bcols;c++){ + double sum=0; + for(unsigned int n=0;n<Brows;n++) + sum+=A[r][n]*B[n][c]*alpha; + D[r][c]=sum; + } +} + +template<> +inline void GEMM1<1>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpArray2D<double> & A, const vpArray2D<double> & B, const double & alpha,vpArray2D<double> &D) +{ + for(unsigned int r=0;r<Arows;r++) + for(unsigned int c=0;c<Bcols;c++){ + double sum=0; + for(unsigned int n=0;n<Brows;n++) + sum+=A[n][r]*B[n][c]*alpha; + D[r][c]=sum; + } +} + +template<> +inline void GEMM1<2>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpArray2D<double> & A,const vpArray2D<double> & B, const double & alpha,vpArray2D<double> &D) +{ + for(unsigned int r=0;r<Arows;r++) + for(unsigned int c=0;c<Bcols;c++){ + double sum=0; + for(unsigned int n=0;n<Brows;n++) + sum+=A[r][n]*B[c][n]*alpha; + D[r][c]=sum; + } +} + +template<> +inline void GEMM1<3>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpArray2D<double> & A,const vpArray2D<double> & B, const double & alpha,vpArray2D<double> &D) +{ + for(unsigned int r=0;r<Arows;r++) + for(unsigned int c=0;c<Bcols;c++){ + double sum=0; + for(unsigned int n=0;n<Brows;n++) + sum+=A[n][r]*B[c][n]*alpha; + D[r][c]=sum; + } +} + +template<unsigned int> +inline void GEMM2(const unsigned int &/*Arows*/,const unsigned int &/*Brows*/, const unsigned int &/*Bcols*/, const vpArray2D<double> & /*A*/,const vpArray2D<double> & /*B*/, const double & /*alpha*/, const vpArray2D<double> & /*C*/ , const double &/*beta*/, vpArray2D<double> &/*D*/) +{} + +template<> +inline void GEMM2<0>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpArray2D<double> & A,const vpArray2D<double> & B, const double & alpha, const vpArray2D<double> & C , const double &beta, vpArray2D<double> &D) +{ + for(unsigned int r=0;r<Arows;r++) + for(unsigned int c=0;c<Bcols;c++){ + double sum=0; + for(unsigned int n=0;n<Brows;n++) + sum+=A[r][n]*B[n][c]*alpha; + D[r][c]=sum+C[r][c]*beta; + } +} + +template<> +inline void GEMM2<1>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpArray2D<double> & A,const vpArray2D<double> & B, const double & alpha, const vpArray2D<double> & C , const double &beta, vpArray2D<double> &D) +{ + for(unsigned int r=0;r<Arows;r++) + for(unsigned int c=0;c<Bcols;c++){ + double sum=0; + for(unsigned int n=0;n<Brows;n++) + sum+=A[n][r]*B[n][c]*alpha; + D[r][c]=sum+C[r][c]*beta; + } +} + +template<> +inline void GEMM2<2>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpArray2D<double> & A,const vpArray2D<double> & B, const double & alpha, const vpArray2D<double> & C , const double &beta, vpArray2D<double> &D) +{ + for(unsigned int r=0;r<Arows;r++) + for(unsigned int c=0;c<Bcols;c++){ + double sum=0; + for(unsigned int n=0;n<Brows;n++) + sum+=A[r][n]*B[c][n]*alpha; + D[r][c]=sum+C[r][c]*beta; + } +} + +template<> +inline void GEMM2<3>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpArray2D<double> & A,const vpArray2D<double> & B, const double & alpha, const vpArray2D<double> & C , const double &beta, vpArray2D<double> &D) +{ + for(unsigned int r=0;r<Arows;r++) + for(unsigned int c=0;c<Bcols;c++){ + double sum=0; + for(unsigned int n=0;n<Brows;n++) + sum+=A[n][r]*B[c][n]*alpha; + D[r][c]=sum+C[r][c]*beta; + } +} + + +template<> +inline void GEMM2<4>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpArray2D<double> & A,const vpArray2D<double> & B, const double & alpha, const vpArray2D<double> & C , const double &beta, vpArray2D<double> &D) +{ + for(unsigned int r=0;r<Arows;r++) + for(unsigned int c=0;c<Bcols;c++){ + double sum=0; + for(unsigned int n=0;n<Brows;n++) + sum+=A[r][n]*B[n][c]*alpha; + D[r][c]=sum+C[c][r]*beta; + } +} + +template<> +inline void GEMM2<5>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpArray2D<double> & A,const vpArray2D<double> & B, const double & alpha, const vpArray2D<double> & C , const double &beta, vpArray2D<double> &D) +{ + for(unsigned int r=0;r<Arows;r++) + for(unsigned int c=0;c<Bcols;c++){ + double sum=0; + for(unsigned int n=0;n<Brows;n++) + sum+=A[n][r]*B[n][c]*alpha; + D[r][c]=sum+C[c][r]*beta; + } + +} + +template<> +inline void GEMM2<6>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpArray2D<double> & A,const vpArray2D<double> & B, const double & alpha, const vpArray2D<double> & C , const double &beta, vpArray2D<double> &D) +{ + for(unsigned int r=0;r<Arows;r++) + for(unsigned int c=0;c<Bcols;c++){ + double sum=0; + for(unsigned int n=0;n<Brows;n++) + sum+=A[r][n]*B[c][n]*alpha; + D[r][c]=sum+C[c][r]*beta; + } +} + +template<> +inline void GEMM2<7>(const unsigned int &Arows, const unsigned int &Brows, const unsigned int &Bcols, const vpArray2D<double> & A,const vpArray2D<double> & B, const double & alpha, const vpArray2D<double> & C , const double &beta, vpArray2D<double> &D) +{ + for(unsigned int r=0;r<Arows;r++) + for(unsigned int c=0;c<Bcols;c++){ + double sum=0; + for(unsigned int n=0;n<Brows;n++) + sum+=A[n][r]*B[c][n]*alpha; + D[r][c]=sum+C[c][r]*beta; + } +} + +template<unsigned int T> +inline void vpTGEMM(const vpArray2D<double> & A, const vpArray2D<double> & B, const double & alpha ,const vpArray2D<double> & C, const double & beta, vpArray2D<double> & D) +{ + unsigned int Arows; + unsigned int Acols; + unsigned int Brows; + unsigned int Bcols; + + GEMMsize<T>(A,B,Arows,Acols,Brows,Bcols); + + try { + if ((Arows != D.getRows()) || (Bcols != D.getCols())) D.resize(Arows,Bcols); + } + catch(...) { + throw ; + } + + if (Acols != Brows) { + throw(vpException(vpException::dimensionError, + "In vpGEMM, cannot multiply (%dx%d) matrix by (%dx%d) matrix", + Arows, Acols, Brows, Bcols)) ; + } + + if(C.getRows()!=0 && C.getCols()!=0){ + if ((Arows != C.getRows()) || (Bcols != C.getCols())) { + throw(vpException(vpException::dimensionError, + "In vpGEMM, cannot add resulting (%dx%d) matrix to (%dx%d) matrix", + Arows, Bcols, C.getRows(), C.getCols())) ; + } + + GEMM2<T>(Arows,Brows,Bcols,A,B,alpha,C,beta,D); + }else{ + GEMM1<T>(Arows,Brows,Bcols,A,B,alpha,D); + } + +} + +/*! + This function performs generalized matrix multiplication: + D = alpha*op(A)*op(B) + beta*op(C), where op(X) is X or X^T. + Operation on A, B and C matrices is described by enumeration vpGEMMmethod(). + + For example, to compute D = alpha*A^T*B^T+beta*C we need to call : + \code + vpGEMM(A, B, alpha, C, beta, D, VP_GEMM_A_T + VP_GEMM_B_T); + \endcode + + If C is not used, vpGEMM must be called using an empty array \e null. + Thus to compute D = alpha*A^T*B, we have to call: + \code + vpGEMM(A, B, alpha, null, 0, D, VP_GEMM_B_T); + \endcode + + \exception vpException::incorrectMatrixSizeError if the sizes of the matrices + do not allow the operations. + + \param A : An array that could be a vpMatrix. + \param B : An array that could be a vpMatrix. + \param alpha : A scalar. + \param C : An array that could be a vpMatrix. + \param beta : A scalar. + \param D : The resulting array that could be a vpMatrix. + \param ops : A scalar describing operation applied on the matrices. Possible values + are the one defined in vpGEMMmethod(): VP_GEMM_A_T, VP_GEMM_B_T, VP_GEMM_C_T. + + \relates vpArray2D + +*/ +inline void vpGEMM(const vpArray2D<double> & A, const vpArray2D<double> & B, + const double & alpha, const vpArray2D<double> & C, + const double & beta, vpArray2D<double> & D, const unsigned int &ops=0) +{ + switch(ops){ + case 0 : + vpTGEMM<0>( A, B, alpha , C, beta, D); + break; + case 1 : + vpTGEMM<1>( A, B, alpha , C, beta, D); + break; + case 2 : + vpTGEMM<2>( A, B, alpha , C, beta, D); + break; + case 3 : + vpTGEMM<3>( A, B, alpha , C, beta, D); + break; + case 4 : + vpTGEMM<4>( A, B, alpha , C, beta, D); + break; + case 5 : + vpTGEMM<5>( A, B, alpha , C, beta, D); + break; + case 6 : + vpTGEMM<6>( A, B, alpha , C, beta, D); + break; + case 7 : + vpTGEMM<7>( A, B, alpha , C, beta, D); + break; + default: + throw(vpException(vpException::functionNotImplementedError, + "Operation on vpGEMM not implemented")) ; + break; + } +} + +#endif diff --git a/src/math/misc/vpNoise.h b/modules/core/include/visp3/core/vpGaussRand.h similarity index 60% rename from src/math/misc/vpNoise.h rename to modules/core/include/visp3/core/vpGaussRand.h index bb0e0582e59c5c7d57674e886f66f1bc8a2fd99c..34b086ad10e8f389ee5352a356a9439d67d653b0 100644 --- a/src/math/misc/vpNoise.h +++ b/modules/core/include/visp3/core/vpGaussRand.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpNoise.h 5179 2015-01-16 09:42:33Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Generation of random number with uniform and normal probability density. * @@ -40,59 +36,15 @@ *****************************************************************************/ -#ifndef vpNoise_hh -#define vpNoise_hh - - -/*! - \file vpNoise.h - \brief Class for generating random number - with uniform and normal probability density - - The algorithms and notations used are described in \cite Gentle:2004. - - */ - -#include <visp/vpConfig.h> - - -/*! - \class vpUniRand +#ifndef vpGaussRand_hh +#define vpGaussRand_hh - \ingroup Random - \brief Class for generating random numbers with uniform probability density. - - The algorithms and notations used are described in \cite Gentle:2004. - - */ -class VISP_EXPORT vpUniRand -{ - /*unsigned*/ long a ; - /*unsigned*/ long m ; //2^31-1 - /*unsigned*/ long q ; //integer part of m/a - /*unsigned*/ long r ;//r=m mod a - double normalizer ; //we use a normalizer > m to ensure ans will never be 1 (it is the case if x = 739806647) - - private: - void draw0(); - protected: - long x; - double draw1(); - - public: - vpUniRand(const long seed = 0) - : a(16807), m(2147483647), q(127773), r(2836), normalizer(2147484721.0), x((seed)? seed : 739806647) - { - } - virtual ~vpUniRand() {}; - - double operator()() {return draw1();} - -}; +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpUniRand.h> /*! \class vpGaussRand - \ingroup Random + \ingroup group_core_random \brief Class for generating random number with normal probability density. The algorithms and notations used are described in \cite Gentle:2004. @@ -102,7 +54,7 @@ class VISP_EXPORT vpUniRand \code #include <iostream> -#include <visp/vpNoise.h> +#include <visp3/core/vpGaussRand.h> int main() { @@ -134,8 +86,8 @@ noise 9: 9.37701 \code #include <iostream> -#include <visp/vpNoise.h> -#include <visp/vpTime.h> +#include <visp3/core/vpGaussRand.h> +#include <visp3/core/vpTime.h> int main() { @@ -166,54 +118,54 @@ noise 9: 10.2391 */ class VISP_EXPORT vpGaussRand : public vpUniRand { - private : - double mean; - double sigma; - double gaussianDraw(); +private : + double mean; + double sigma; + double gaussianDraw(); - public: +public: - /*! + /*! Default noise generator constructor. */ - vpGaussRand() : vpUniRand(), mean(0), sigma(0) {} + vpGaussRand() : vpUniRand(), mean(0), sigma(0) {} - /*! + /*! Gaussian noise random generator constructor. \param sigma_val : Standard deviation. \param mean_val : Mean value. \param noise_seed : Seed of the noise */ - vpGaussRand(const double sigma_val, const double mean_val, const long noise_seed = 0) - : vpUniRand(noise_seed), mean(mean_val), sigma(sigma_val) {} + vpGaussRand(const double sigma_val, const double mean_val, const long noise_seed = 0) + : vpUniRand(noise_seed), mean(mean_val), sigma(sigma_val) {} - /*! + /*! Set the standard deviation and mean for gaussian noise. \param sigma_val : New standard deviation sigma. \param mean_val : New mean value. */ - void setSigmaMean(const double sigma_val, const double mean_val) { - this->mean = mean_val; - this->sigma = sigma_val; - } + void setSigmaMean(const double sigma_val, const double mean_val) { + this->mean = mean_val; + this->sigma = sigma_val; + } - /*! + /*! Set the seed of the noise. \param seed_val : New seed. */ - void seed(const long seed_val) { - x=seed_val; - } + void seed(const long seed_val) { + x=seed_val; + } - /*! + /*! Return a random value from the Gaussian noise generator. */ - double operator()() { - return sigma*gaussianDraw()+mean; - } + double operator()() { + return sigma*gaussianDraw()+mean; + } }; #endif diff --git a/src/math/misc/vpHinkley.h b/modules/core/include/visp3/core/vpHinkley.h old mode 100755 new mode 100644 similarity index 92% rename from src/math/misc/vpHinkley.h rename to modules/core/include/visp3/core/vpHinkley.h index 97fad8379916e277e155049fffb05577c56e6b09..24d579bcca434fef2c157ede74f83fbe71362c24 --- a/src/math/misc/vpHinkley.h +++ b/modules/core/include/visp3/core/vpHinkley.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHinkley.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Hinkley's cumulative sum test implementation. * @@ -46,12 +42,12 @@ \file vpHinkley.h \brief class for Hinkley's cumulative test computation. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> /*! \class vpHinkley - \ingroup Hinkley + \ingroup group_core_math_tools \brief This class implements the Hinkley's cumulative sum test. \author Fabien Spindler (Fabien.Spindler@irisa.fr), Irisa / Inria Rennes @@ -74,7 +70,6 @@ \f[ T_k = \sum_{t=0}^{k} (s(t) - m_0 - \frac{\delta}{2}) \f] \f[ N_k = \max_{0 \leq i \leq k} T_i\f] - In which \f$m_o\f$ is computed on-line and corresponds to the mean of the signal \f$ s(t) \f$ we want to detect a jump. \f$m_o\f$ is re-initialized at zero after each jump detection. \f$\delta\f$ diff --git a/src/tools/histogram/vpHistogram.h b/modules/core/include/visp3/core/vpHistogram.h similarity index 81% rename from src/tools/histogram/vpHistogram.h rename to modules/core/include/visp3/core/vpHistogram.h index db90687a64b9468b4b5795fc7a49cc368af3d89b..c1d5020fa20487a9ebb422fba93600b6e5326509 100644 --- a/src/tools/histogram/vpHistogram.h +++ b/modules/core/include/visp3/core/vpHistogram.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHistogram.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Gray level histogram manipulation. * @@ -51,22 +47,24 @@ #ifndef vpHistogram_h #define vpHistogram_h -#include <visp/vpImage.h> -#include <visp/vpHistogramPeak.h> -#include <visp/vpHistogramValey.h> +#include <sstream> + +#include <visp3/core/vpImage.h> +#include <visp3/core/vpHistogramPeak.h> +#include <visp3/core/vpHistogramValey.h> +#include <visp3/core/vpColor.h> #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -# include <visp/vpList.h> +# include <visp3/core/vpList.h> #endif #include <list> /*! \class vpHistogram - \ingroup Histogram + \ingroup group_core_histogram \brief Class to compute a gray level image histogram. - Here are two examples showing how to use this class to determine the threshold which can be used to segment two objects. @@ -143,10 +141,15 @@ public: */ inline unsigned operator[](const unsigned char level) const - { + { + if (level < size) { return histogram[level]; + } - }; + std::stringstream ss; + ss << "Level is > to size (" << size << ") !"; + throw vpException(vpException::dimensionError, ss.str().c_str()); + }; /*! Return the number of pixels having the gray \e level. @@ -168,9 +171,15 @@ public: */ inline unsigned operator()(const unsigned char level) const - { + { + if(level < size) { return histogram[level]; - }; + } + + std::stringstream ss; + ss << "Level is > to size (" << size << ") !"; + throw vpException(vpException::dimensionError, ss.str().c_str()); + }; /*! Return the number of pixels having the gray \e level. @@ -192,9 +201,15 @@ public: */ inline unsigned get(const unsigned char level) const - { + { + if(level < size) { return histogram[level]; - }; + } + + std::stringstream ss; + ss << "Level is > to size (" << size << ") !"; + throw vpException(vpException::dimensionError, ss.str().c_str()); + }; /*! @@ -214,11 +229,21 @@ public: */ inline void set(const unsigned char level, unsigned int value) - { + { + if(level < size) { histogram[level] = value; - }; + } else { + std::stringstream ss; + ss << "Level is > to size (" << size << ") !"; + throw vpException(vpException::dimensionError, ss.str().c_str()); + } + }; + + void calculate(const vpImage<unsigned char> &I, const unsigned int nbins=256); + + void display(const vpImage<unsigned char> &I, const vpColor &color=vpColor::white, const unsigned int thickness=2, + const unsigned int maxValue_=0); - void calculate(const vpImage<unsigned char> &I); void smooth(const unsigned int fsize = 3); unsigned getPeaks(std::list<vpHistogramPeak> & peaks); unsigned getPeaks(unsigned char dist, @@ -249,7 +274,7 @@ public: \sa getValues() */ - inline unsigned getSize() + inline unsigned getSize() const { return size; }; @@ -280,15 +305,6 @@ public: return histogram; }; -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated functions - */ - vp_deprecated unsigned getPeaks(vpList<vpHistogramPeak> & peaks); - vp_deprecated unsigned getValey(vpList<vpHistogramValey> & valey); - vp_deprecated unsigned sort(vpList<vpHistogramPeak> & peaks); -#endif - private: void init(unsigned size = 256); diff --git a/src/tools/histogram/vpHistogramPeak.h b/modules/core/include/visp3/core/vpHistogramPeak.h similarity index 90% rename from src/tools/histogram/vpHistogramPeak.h rename to modules/core/include/visp3/core/vpHistogramPeak.h index 3b1e0ea34b74d33c75b52e00431a5f889099dd07..aa1af9519d3a25c914cffaae31afd094327fa99d 100644 --- a/src/tools/histogram/vpHistogramPeak.h +++ b/modules/core/include/visp3/core/vpHistogramPeak.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHistogramPeak.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Gray level histogram manipulation. * @@ -51,14 +47,14 @@ #ifndef vpHistogramPeak_h #define vpHistogramPeak_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <ostream> /*! \class vpHistogramPeak - \ingroup Histogram + \ingroup group_core_histogram \brief Declaration of the peak (maximum value) in a gray level image histogram. diff --git a/src/tools/histogram/vpHistogramValey.h b/modules/core/include/visp3/core/vpHistogramValey.h similarity index 89% rename from src/tools/histogram/vpHistogramValey.h rename to modules/core/include/visp3/core/vpHistogramValey.h index 2c950d12a9ccef43840e0b04f46a54df7339950e..d141a194145d5de300658f555ac21129474c635b 100644 --- a/src/tools/histogram/vpHistogramValey.h +++ b/modules/core/include/visp3/core/vpHistogramValey.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHistogramValey.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Gray level histogram manipulation. * @@ -51,12 +47,12 @@ #ifndef vpHistogramValey_h #define vpHistogramValey_h -#include <visp/vpHistogramPeak.h> +#include <visp3/core/vpHistogramPeak.h> /*! \class vpHistogramValey - \ingroup Histogram + \ingroup group_core_histogram \brief Declaration of the valey (minimum value) in a gray level image histogram. diff --git a/src/math/transformation/vpHomogeneousMatrix.h b/modules/core/include/visp3/core/vpHomogeneousMatrix.h similarity index 58% rename from src/math/transformation/vpHomogeneousMatrix.h rename to modules/core/include/visp3/core/vpHomogeneousMatrix.h index a12a8bc3c7ab76299c28e45808814f7d62a460e0..3314daa430822823ae6ff21d9dcfcdd8106da4d7 100644 --- a/src/math/transformation/vpHomogeneousMatrix.h +++ b/modules/core/include/visp3/core/vpHomogeneousMatrix.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHomogeneousMatrix.h 5130 2015-01-06 18:50:43Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Homogeneous matrix. * @@ -50,40 +46,35 @@ #ifndef VPHOMOGENEOUSMATRIX_HH #define VPHOMOGENEOUSMATRIX_HH +class vpTranslationVector; class vpPoseVector; class vpMatrix; class vpRotationMatrix; class vpPoseVector; class vpThetaUVector; +class vpQuaternionVector; +class vpPoint; #include <vector> - -#include <visp/vpMatrix.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpThetaUVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpPoseVector.h> - #include <fstream> -class vpMatrix; -class vpRotationMatrix; -class vpPoseVector; -class vpThetaUVector; -class vpQuaternionVector; +#include <visp3/core/vpArray2D.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpThetaUVector.h> +//#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpPoseVector.h> /*! \class vpHomogeneousMatrix - \ingroup PoseTransformation - - \brief The class provides a data structure for the homogeneous matrices - as well as a set of operations on these matrices. + \ingroup group_core_transformations - The vpHomogeneousMatrix is derived from vpMatrix. + \brief Implementation of an homogeneous matrix and operations on such kind of matrices. - \author Eric Marchand (Eric.Marchand@irisa.fr) Irisa / Inria Rennes + The class provides a data structure for the homogeneous matrices + as well as a set of operations on these matrices. + The vpHomogeneousMatrix class is derived from vpArray2D<double>. An homogeneous matrix is 4x4 matrix defines as \f[ @@ -98,83 +89,44 @@ class vpQuaternionVector; \f$ ^a{\bf R}_b \f$ is a rotation matrix and \f$ ^a{\bf t}_b \f$ is a translation vector. - */ -class VISP_EXPORT vpHomogeneousMatrix : public vpMatrix +class VISP_EXPORT vpHomogeneousMatrix : public vpArray2D<double> { public: - //! Basic constructor. - vpHomogeneousMatrix() ; - //! Copy constructor. + vpHomogeneousMatrix(); vpHomogeneousMatrix(const vpHomogeneousMatrix &M) ; - //! Construction from translation vector and rotation matrix. vpHomogeneousMatrix(const vpTranslationVector &t, const vpRotationMatrix &R) ; - //! Construction from translation vector and theta u rotation vector. vpHomogeneousMatrix(const vpTranslationVector &t, const vpThetaUVector &tu) ; - //! Construction from translation vector and quaternion rotation vector. vpHomogeneousMatrix(const vpTranslationVector &t, const vpQuaternionVector &q) ; - /*! - Construction from translation vector and theta u rotation vector - defined as a pose vector. - */ vpHomogeneousMatrix(const vpPoseVector &p) ; - - //! Construction from translation and rotation defined as a theta u vector. - vpHomogeneousMatrix(const double tx, const double ty, const double tz, - const double tux, const double tuy, const double tuz) ; vpHomogeneousMatrix(const std::vector<float> &v); vpHomogeneousMatrix(const std::vector<double> &v); + vpHomogeneousMatrix(const double tx, const double ty, const double tz, + const double tux, const double tuy, const double tuz) ; + /*! + Destructor. + */ + virtual ~vpHomogeneousMatrix() {}; - //! Construction from translation vector and rotation matrix. void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R) ; - //! Construction from translation vector and theta u rotation vector. void buildFrom(const vpTranslationVector &t, const vpThetaUVector &tu) ; - //! Construction from translation vector and quaternion rotation vector. void buildFrom(const vpTranslationVector &t, const vpQuaternionVector& q) ; + void buildFrom(const vpPoseVector &p) ; void buildFrom(const std::vector<float> &v) ; void buildFrom(const std::vector<double> &v) ; + void buildFrom(const double tx, const double ty, const double tz, + const double tux, const double tuy, const double tuz) ; - /*! - Construction from translation vector and theta u rotation vector - defined as a pose vector. - */ - void buildFrom(const vpPoseVector &p) ; - - //! Construction from translation and rotation defined as a theta u vector. - void buildFrom(const double tx,const double ty, const double tz, - const double tux,const double tuy, const double tuz ) ; - void convert(std::vector<float> &M); void convert(std::vector<double> &M); - /*! - Return the translation vector from the homogeneous transformation matrix. - */ - vpTranslationVector getTranslationVector() - { - vpTranslationVector tr; - this->extract(tr); - return tr; - } -// /*! -// Return the rotation matrix from the homogeneous transformation matrix. -// */ -// vpThetaUVector getThetaUVector() -// vpRotationMatrix getRotationMatrix() -// { -// vpRotationMatrix R; -// this->extract(R); -// return R; -// } - - //! Copy operator from vpHomogeneousMatrix. - vpHomogeneousMatrix &operator=(const vpHomogeneousMatrix &M); - - //! Multiply two homogeneous matrices: aMb = aMc*cMb - vpHomogeneousMatrix operator*(const vpHomogeneousMatrix &M) const; + // Set to identity + void eye(); - //! Multiply by a vector ! size 4 !!! - vpColVector operator*(const vpColVector &v) const; + vpColVector getCol(const unsigned int j) const; + vpRotationMatrix getRotationMatrix(); + vpThetaUVector getThetaUVector(); + vpTranslationVector getTranslationVector(); // Invert the homogeneous matrix. vpHomogeneousMatrix inverse() const ; @@ -189,9 +141,9 @@ class VISP_EXPORT vpHomogeneousMatrix : public vpMatrix void insert(const vpTranslationVector &t) ; void insert(const vpQuaternionVector &t) ; - void extract( vpRotationMatrix &R) const; - void extract(vpTranslationVector &t) const; + void extract(vpRotationMatrix &R) const; void extract(vpThetaUVector &tu) const; + void extract(vpTranslationVector &t) const; void extract(vpQuaternionVector& q) const; // Load an homogeneous matrix from a file @@ -199,15 +151,45 @@ class VISP_EXPORT vpHomogeneousMatrix : public vpMatrix // Save an homogeneous matrix in a file void save(std::ofstream &f) const ; - // Set to identity - void eye(); - //! Basic initialisation (identity). - void init() ; - // Basic initialisation (identity). - void setIdentity() ; + vpHomogeneousMatrix &operator=(const vpHomogeneousMatrix &M); + vpHomogeneousMatrix operator*(const vpHomogeneousMatrix &M) const; + + vpColVector operator*(const vpColVector &v) const; + // Multiply by a point + vpPoint operator*(const vpPoint &bP) const; + + void print() const; + + /*! + This function is not applicable to an homogeneous matrix that is always a + 4-by-4 matrix. + \exception vpException::fatalError When this function is called. + */ + void resize(const unsigned int nrows, const unsigned int ncols, + const bool flagNullify = true) + { + (void)nrows; + (void)ncols; + (void)flagNullify; + throw(vpException(vpException::fatalError, "Cannot resize an homogeneous matrix")); + }; - //! Print the matrix as a vector [T thetaU] - void print() ; +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + /*! + @name Deprecated functions + */ + //@{ + /*! + \deprecated Provided only for compat with previous releases. + This function does nothing. + */ + vp_deprecated void init() {}; + /*! + \deprecated You should rather use eye(). + */ + vp_deprecated void setIdentity(); + //@} +#endif } ; diff --git a/src/image/vpImage.h b/modules/core/include/visp3/core/vpImage.h similarity index 86% rename from src/image/vpImage.h rename to modules/core/include/visp3/core/vpImage.h index bc17911aca4d53e19ae3f749a7f28fa456305150..a4ace005e33f500ecbcbf6afba667030fd115a0f 100644 --- a/src/image/vpImage.h +++ b/modules/core/include/visp3/core/vpImage.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpImage.h 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Image handling. * @@ -48,12 +44,12 @@ #ifndef vpImage_H #define vpImage_H -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> -#include <visp/vpException.h> -#include <visp/vpImageException.h> -#include <visp/vpImagePoint.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpImageException.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpRGBa.h> #include <fstream> #include <iostream> @@ -65,7 +61,7 @@ class vpDisplay; /*! \class vpImage - \ingroup ImageContainer ImageDataRepresentation + \ingroup group_core_image \brief Definition of the vpImage class member functions. @@ -128,12 +124,16 @@ public: vpImage(unsigned int height, unsigned int width) ; //! constructor set the size of the image and init all the pixel vpImage(unsigned int height, unsigned int width, Type value) ; + //! constructor from an image stored as a continuous array in memory + vpImage(Type * const array, const unsigned int height, const unsigned int width, const bool copyData=false) ; //! destructor virtual ~vpImage() ; //! set the size of the image void init(unsigned int height, unsigned int width) ; //! set the size of the image void init(unsigned int height, unsigned int width, Type value) ; + //! init from an image stored as a continuous array in memory + void init(Type * const array, const unsigned int height, const unsigned int width, const bool copyData=false); //! set the size of the image without initializing it. void resize(const unsigned int h, const unsigned int w) ; //! set the size of the image and initialize it. @@ -312,18 +312,9 @@ public: void sub(const vpImage<Type> &B, vpImage<Type> &C); void sub(const vpImage<Type> &A, const vpImage<Type> &B, vpImage<Type> &C); -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated functions - */ - vp_deprecated void sub(vpImage<Type>* im2, vpImage<Type>* dst); - // Returns a new image that's half size of the current image - vp_deprecated void halfSizeImage(vpImage<Type>* res); - // Returns a new image that's a quarter size of the current image - vp_deprecated void quarterSizeImage(vpImage<Type>* res); - // Returns a new image that's double size of the current image - vp_deprecated void doubleSizeImage(vpImage<Type>* res); -#endif + // Perform a look-up table transformation + void performLut(const Type (&lut)[256]); + private: unsigned int npixels ; //<! number of pixel in the image unsigned int width ; //<! number of columns @@ -353,7 +344,7 @@ vpImage<Type>::init(unsigned int h, unsigned int w, Type value) { init(h,w) ; } - catch(vpException me) + catch(vpException &) { vpERROR_TRACE(" ") ; throw ; @@ -385,7 +376,6 @@ template<class Type> void vpImage<Type>::init(unsigned int h, unsigned int w) { - if (h != this->height) { if (row != NULL) { vpDEBUG_TRACE(10,"Destruction row[]"); @@ -432,6 +422,68 @@ vpImage<Type>::init(unsigned int h, unsigned int w) row[i] = bitmap + i*width ; } +/*! + \brief Image initialization + + Init from image data stored as a continuous array in memory. + + \param array : Image data stored as a continuous array in memory + \param h : Image height. + \param w : Image width. + \param copyData : If false (by default) only the memory address is copied, otherwise the data are copied. + + \exception vpException::memoryAllocationError +*/ +template<class Type> +void +vpImage<Type>::init(Type * const array, const unsigned int h, const unsigned int w, const bool copyData) +{ + if (h != this->height) { + if (row != NULL) { + delete [] row; + row = NULL; + } + } + + //Delete bitmap if copyData==false, otherwise only if the dimension differs + if ( (copyData && ((h != this->height) || (w != this->width))) || !copyData ) { + if (bitmap != NULL) { + delete [] bitmap; + bitmap = NULL; + } + } + + this->width = w ; + this->height = h; + + npixels = width*height; + + if(copyData) { + if (bitmap == NULL) bitmap = new Type[npixels]; + + if (bitmap == NULL) { + throw(vpException(vpException::memoryAllocationError, + "cannot allocate bitmap ")) ; + } + + //Copy the image data + memcpy(bitmap, array, (size_t) (npixels * sizeof(Type))); + } else { + //Copy the address of the array in the bitmap + bitmap = array; + } + + if (row == NULL) row = new Type*[height]; + if (row == NULL) { + throw(vpException(vpException::memoryAllocationError, + "cannot allocate row ")) ; + } + + for (unsigned int i = 0 ; i < height ; i++) { + row[i] = bitmap + i*width; + } +} + /*! \brief Constructor @@ -489,13 +541,41 @@ vpImage<Type>::vpImage (unsigned int h, unsigned int w, Type value) { init(h,w,value) ; } - catch(vpException me) + catch(vpException &) { vpERROR_TRACE(" ") ; throw ; } } +/*! + \brief Constructor + + Construct a vpImage from a continuous array in memory. + + \param array : Image data stored as a continuous array in memory. + \param h : Image height. + \param w : Image width. + \param copyData : If false (by default) only the memory address is copied, otherwise the data are copied. + + \return MEMORY_FAULT if memory allocation is impossible, else OK + + \sa vpImage::init(array, height, width) +*/ +template<class Type> +vpImage<Type>::vpImage (Type * const array, const unsigned int h, const unsigned int w, const bool copyData) + : bitmap(NULL), display(NULL), npixels(0), width(0), height(0), row(NULL) +{ + try + { + init(array, h, w, copyData); + } + catch(vpException &) + { + throw ; + } +} + /*! \brief Constructor @@ -539,7 +619,7 @@ vpImage<Type>::resize(unsigned int h, unsigned int w) { init(h, w) ; } - catch(vpException me) + catch(vpException &) { vpERROR_TRACE(" ") ; throw ; @@ -573,7 +653,7 @@ vpImage<Type>::resize(unsigned int h, unsigned int w, const Type val) { init(h, w, val) ; } - catch(vpException me) + catch(vpException &) { vpERROR_TRACE(" ") ; throw ; @@ -640,7 +720,7 @@ vpImage<Type>::vpImage(const vpImage<Type>& I) memcpy(bitmap, I.bitmap, I.npixels*sizeof(Type)) ; for (unsigned int i =0 ; i < this->height ; i++) row[i] = bitmap + i*this->width ; } - catch(vpException me) + catch(vpException &) { vpERROR_TRACE(" ") ; throw ; @@ -744,7 +824,7 @@ vpImage<Type> & vpImage<Type>::operator=(const vpImage<Type> &I) } } } - catch(vpException me) + catch(vpException &) { vpERROR_TRACE(" ") ; throw ; @@ -813,7 +893,7 @@ bool vpImage<Type>::operator!=(const vpImage<Type> &I) Operation A - B (A is unchanged). \code -#include <visp/vpImage.h> +#include <visp3/core/vpImage.h> int main() { @@ -1354,7 +1434,7 @@ inline vpRGBa vpImage<vpRGBa>::getValue(vpImagePoint &ip) const Operation C = *this - B. \code -#include <visp/vpImage.h> +#include <visp3/core/vpImage.h> int main() { @@ -1389,7 +1469,7 @@ void vpImage<Type>::sub(const vpImage<Type> &B, vpImage<Type> &C) || (this->getWidth() != C.getWidth())) C.resize(this->getHeight(), this->getWidth()); } - catch(vpException me) + catch(vpException &me) { vpERROR_TRACE("Error caught") ; std::cout << me << std::endl ; @@ -1431,7 +1511,7 @@ void vpImage<Type>::sub(const vpImage<Type> &A, const vpImage<Type> &B, || (A.getWidth() != C.getWidth())) C.resize(A.getHeight(), A.getWidth()); } - catch(vpException me) + catch(vpException &me) { vpERROR_TRACE("Error caught") ; std::cout << me << std::endl ; @@ -1450,152 +1530,66 @@ void vpImage<Type>::sub(const vpImage<Type> &A, const vpImage<Type> &B, *(C.bitmap + i) = *(A.bitmap + i) - *(B.bitmap + i) ; } } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS + /*! - \deprecated This method is deprecated. You should use vpImage<Type>::sub(const vpImage<Type> &, vpImage<Type> &) instead. - Operation C = *this - B. + \warning This generic method is not implemented. You should rather use the + instantiated methods for unsigned char and vpRGBa images. - The result is placed in parameter C. + \sa vpImage<unsigned char>::performLut(const unsigned char (&)[256]) + \sa vpImage<vpRGBa char>::performLut(const vpRGBa (&)[256]) - \sa operator-() - - \exception vpException::memoryAllocationError If images pointer is NULL or if the images size differ. */ template<class Type> -void -vpImage<Type>::sub(vpImage<Type>* B, vpImage<Type>* C) +void vpImage<Type>::performLut(const Type (&)[256]) { - if (B == NULL || C == NULL) { - throw(vpException(vpException::memoryAllocationError, - "Images are not allocated in vpImage<>::sub()")) ; - } - if ( (this->getWidth() != B->getWidth()) - || (this->getHeight() != B->getHeight()) - || (this->getWidth() != C->getWidth()) - || (this->getHeight() != C->getHeight())) - { - vpERROR_TRACE("\n\t\t vpImage mismatch in vpImage/vpImage substraction") ; - throw(vpException(vpException::memoryAllocationError, - "vpImage mismatch in vpImage/vpImage substraction ")) ; - } - - for(unsigned int i = 0; i < height * width; i++) - C->bitmap[i] = this->bitmap[i] - B->bitmap[i]; +// vpTRACE("Not implemented"); + std::cerr << "Not implemented !" << std::endl; } /*! - \deprecated This method is deprecated. You should use halfSizeImage(vpImage<Type> &) instead. + Modify the intensities of a grayscale image using the look-up table passed in parameter. - Returns a new image that's half size of the current image. - No filtering is used during the sub sampling. - Used for building pyramid of the image. - - \warning Operator = must be defined for Type. - - \exception vpException::memoryAllocationError If images pointer is NULL or if the images size differ. - - */ - -template<class Type> -void -vpImage<Type>::halfSizeImage(vpImage<Type>* res) -{ - unsigned int r = height/2; - unsigned int c = width/2; - if(res == NULL) { - throw(vpException(vpException::memoryAllocationError, - "Images are not allocated in vpImage<>::sub()")) ; + \param lut : Look-up table (unsigned char array of size=256) which maps each intensity to his new value. +*/ +template<> +inline void vpImage<unsigned char>::performLut(const unsigned char (&lut)[256]) { + unsigned int size = getWidth()*getHeight(); + unsigned char *ptrStart = (unsigned char*) bitmap; + unsigned char *ptrEnd = ptrStart + size; + unsigned char *ptrCurrent = ptrStart; + + while(ptrCurrent != ptrEnd) { + *ptrCurrent = lut[*ptrCurrent]; + ++ptrCurrent; } - if((res->getWidth() != c) || (res->getHeight()!= r)) - res->resize(r,c); - for(unsigned int y = 0; y < r; y++) - for(unsigned int x = 0; x < c; x++) - (*res)[y][x] = (*this)[y*2][x*2]; } /*! - \deprecated This method is deprecated. You should use quarterSizeImage(vpImage<Type> &) instead. - - Returns a new image that's a quarter size of the current image. - Used for building a quarter of the image. - - \warning Operator = must be defined for Type. - - \exception vpException::memoryAllocationError If images pointer is NULL or if the images size differ. - */ + Modify the intensities of a color image using the look-up table passed in parameter. -template<class Type> -void -vpImage<Type>::quarterSizeImage(vpImage<Type>* res) -{ - unsigned int r = height/4; - unsigned int c = width/4; - if(res == NULL) { - throw(vpException(vpException::memoryAllocationError, - "Images are not allocated in vpImage<>::sub()")) ; - } - if((res->getWidth() != c) || (res->getHeight()!= r)) - res->resize(r,c); - for(unsigned int y = 0; y < r; y++) - for(unsigned int x = 0; x < c; x++) - (*res)[y][x] = (*this)[y*4][x*4]; -} - -/*! - \deprecated This method is deprecated. You should use doubleSizeImage(vpImage<Type> &) instead. + \param lut : Look-up table (vpRGBa array of size=256) which maps each intensity to his new value. +*/ +template<> +inline void vpImage<vpRGBa>::performLut(const vpRGBa (&lut)[256]) { + unsigned int size = getWidth()*getHeight(); + unsigned char *ptrStart = (unsigned char*) bitmap; + unsigned char *ptrEnd = ptrStart + size*4; + unsigned char *ptrCurrent = ptrStart; - Returns a new image that's double size of the current image. - Used (eg. in case of keypoints extraction, we might - double size of the image in order to have more keypoints) + while(ptrCurrent != ptrEnd) { + *ptrCurrent = lut[*ptrCurrent].R; + ++ptrCurrent; - \warning Operator = must be defined for Type. + *ptrCurrent = lut[*ptrCurrent].G; + ++ptrCurrent; - \exception vpException::memoryAllocationError If images pointer is NULL or if the images size differ. - */ -template<class Type> -void -vpImage<Type>::doubleSizeImage(vpImage<Type>* res) -{ - int h = height*2; - int w = width*2; + *ptrCurrent = lut[*ptrCurrent].B; + ++ptrCurrent; - if(res == NULL) { - throw(vpException(vpException::memoryAllocationError, - "Images are not allocated in vpImage<>::sub()")) ; + *ptrCurrent = lut[*ptrCurrent].A; + ++ptrCurrent; } - if((res->getWidth() != w) || (res->getHeight()!= h)) - res->resize(h, w); - - for(int j = 0; j < h; j++) - for(int i = 0; i < w; i++) - (*res)[j][i] = (*this)[j/2][i/2]; - - /* - A B C - E F G - H I J - A C H J are pixels from original image - B E G I are interpolated pixels - */ - - //interpolate pixels B and I - for(int j = 0; j < h; j += 2) - for(int i = 1; i < w - 1; i += 2) - (*res)[j][i] = (Type)(0.5 * ((*this)[j/2][i/2] + (*this)[j/2][i/2 + 1])); - - //interpolate pixels E and G - for(int j = 1; j < h - 1; j += 2) - for(int i = 0; i < w; i += 2) - (*res)[j][i] = (Type)(0.5 * ((*this)[j/2][i/2] + (*this)[j/2+1][i/2])); - - //interpolate pixel F - for(int j = 1; j < h - 1; j += 2) - for(int i = 1; i < w - 1; i += 2) - (*res)[j][i] = (Type)(0.25 * ((*this)[j/2][i/2] + (*this)[j/2][i/2+1] + - (*this)[j/2+1][i/2] + (*this)[j/2+1][i/2+1])); } -#endif // VISP_BUILD_DEPRECATED_FUNCTIONS - #endif diff --git a/src/image/vpImageConvert.h b/modules/core/include/visp3/core/vpImageConvert.h similarity index 73% rename from src/image/vpImageConvert.h rename to modules/core/include/visp3/core/vpImageConvert.h index a9f548e7a7c119b4acec1134c482df58c5ab131c..e9d794b39188f6d3cd3f8dabdab8a7631510c4c9 100644 --- a/src/image/vpImageConvert.h +++ b/modules/core/include/visp3/core/vpImageConvert.h @@ -1,45 +1,41 @@ /**************************************************************************** -* -* $Id: vpImageConvert.h 5204 2015-01-24 13:18:18Z fspindle $ -* -* This file is part of the ViSP software. -* Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -* -* This software is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* ("GPL") version 2 as published by the Free Software Foundation. -* See the file LICENSE.txt at the root directory of this source -* distribution for additional information about the GNU GPL. -* -* For using ViSP with software that can not be combined with the GNU -* GPL, please contact INRIA about acquiring a ViSP Professional -* Edition License. -* -* See http://www.irisa.fr/lagadic/visp/visp.html for more information. -* -* This software was developed at: -* INRIA Rennes - Bretagne Atlantique -* Campus Universitaire de Beaulieu -* 35042 Rennes Cedex -* France -* http://www.irisa.fr/lagadic -* -* If you have questions regarding the use of this file, please contact -* INRIA at visp@inria.fr -* -* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -* -* -* Description: -* Convert image types. -* -* Authors: -* Eric Marchand -* Fabien Spindler -* Anthony Saunier -* -*****************************************************************************/ + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Convert image types. + * + * Authors: + * Eric Marchand + * Fabien Spindler + * Anthony Saunier + * + *****************************************************************************/ /*! \file vpImageConvert.h @@ -50,11 +46,11 @@ #define vpIMAGECONVERT_H // image -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDebug.h> // color -#include <visp/vpRGBa.h> +#include <visp3/core/vpRGBa.h> #ifdef VISP_HAVE_OPENCV # if (VISP_HAVE_OPENCV_VERSION >= 0x030000) // Require opencv >= 3.0.0 @@ -82,19 +78,10 @@ # include <windows.h> #endif -#if defined(VISP_HAVE_LIBJPEG) -# include <jpeglib.h> -# include <jerror.h> -#endif - -#if defined(VISP_HAVE_LIBPNG) -# include <png.h> -#endif - /*! \class vpImageConvert - \ingroup ImageConversion + \ingroup group_core_image Convert image types. @@ -163,21 +150,17 @@ public: vpImage<vpRGBa> & dest) ; #endif -#ifdef VISP_HAVE_LIBJPEG -#if JPEG_LIB_VERSION > 70 - static void convertToJPEGBuffer(const vpImage<unsigned char> &src, - unsigned char **dest, long unsigned int &destSize, int quality = 100); - - static void convertToJPEGBuffer(unsigned char *src, long unsigned int srcSize, - vpImage<unsigned char> &dest); -#endif -#endif - static void split(const vpImage<vpRGBa> &src, vpImage<unsigned char>* pR, vpImage<unsigned char>* pG, vpImage<unsigned char>* pB, - vpImage<unsigned char>* pa = NULL) ; + vpImage<unsigned char>* pa = NULL); + + static void merge(const vpImage<unsigned char> *R, + const vpImage<unsigned char> *G, + const vpImage<unsigned char> *B, + const vpImage<unsigned char> *a, + vpImage<vpRGBa> &RGBa); /*! Converts a yuv pixel value in rgb format. @@ -300,9 +283,32 @@ public: static void MONO16ToRGBa(unsigned char *grey16, unsigned char *rgba, unsigned int size); + static void HSVToRGBa(const double *hue, const double *saturation, const double *value, unsigned char *rgba, + const unsigned int size); + static void HSVToRGBa(const unsigned char *hue, const unsigned char *saturation, const unsigned char *value, + unsigned char *rgba, const unsigned int size); + static void RGBaToHSV(const unsigned char *rgba, double *hue, double *saturation, double *value, + const unsigned int size); + static void RGBaToHSV(const unsigned char *rgba, unsigned char *hue, unsigned char *saturation, unsigned char *value, + const unsigned int size); + + static void HSVToRGB(const double *hue, const double *saturation, const double *value, unsigned char *rgb, + const unsigned int size); + static void HSVToRGB(const unsigned char *hue, const unsigned char *saturation, const unsigned char *value, + unsigned char *rgb, const unsigned int size); + static void RGBToHSV(const unsigned char *rgb, double *hue, double *saturation, double *value, + const unsigned int size); + static void RGBToHSV(const unsigned char *rgb, unsigned char *hue, unsigned char *saturation, unsigned char *value, + const unsigned int size); + private: static void computeYCbCrLUT(); + static void HSV2RGB(const double *hue, const double *saturation, const double *value, unsigned char *rgba, + const unsigned int size, const unsigned int step); + static void RGB2HSV(const unsigned char *rgb, double *hue, double *saturation, double *value, + const unsigned int size, const unsigned int step); + private: static bool YCbCrLUTcomputed; static int vpCrr[256]; diff --git a/src/image/vpImageException.h b/modules/core/include/visp3/core/vpImageException.h similarity index 85% rename from src/image/vpImageException.h rename to modules/core/include/visp3/core/vpImageException.h index 79c7fe9b60cea82c38393b460591b3a9c543e86b..2ab9bc70f0e58c0f06ab1d001f38640f52454d5c 100644 --- a/src/image/vpImageException.h +++ b/modules/core/include/visp3/core/vpImageException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImageException.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exceptions that can be emited by the vpImage class and its derivates. * @@ -53,8 +49,8 @@ */ /* Classes standards. */ -#include <visp/vpConfig.h> -#include <visp/vpException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> #include <iostream> /* Classe std::ostream. */ #include <string> /* Classe string. */ @@ -66,9 +62,7 @@ /*! \class vpImageException - - \ingroup Exception - + \ingroup group_core_debug \brief Error that can be emited by the vpImage class and its derivates. */ class VISP_EXPORT vpImageException : public vpException diff --git a/src/image/vpImageFilter.h b/modules/core/include/visp3/core/vpImageFilter.h similarity index 96% rename from src/image/vpImageFilter.h rename to modules/core/include/visp3/core/vpImageFilter.h index 0a43b22759be1b80ac71cb90515f785582d293b8..b50bf80aef8d83996f75b246d58a12d1df767dd9 100644 --- a/src/image/vpImageFilter.h +++ b/modules/core/include/visp3/core/vpImageFilter.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpImageFilter.h 4991 2014-11-21 16:03:09Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Various image tools, convolution, ... * @@ -50,10 +46,10 @@ */ -#include <visp/vpImage.h> -#include <visp/vpImageException.h> -#include <visp/vpMatrix.h> -#include <visp/vpMath.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImageException.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> #include <fstream> #include <iostream> @@ -63,7 +59,7 @@ /*! \class vpImageFilter - \ingroup ImageFiltering + \ingroup group_core_image \brief Various image filter, convolution, etc... @@ -397,6 +393,7 @@ public: } static void gaussianBlur(const vpImage<unsigned char> &I, vpImage<double>& GI, unsigned int size=7, double sigma=0., bool normalize=true); + static void gaussianBlur(const vpImage<double> &I, vpImage<double>& GI, unsigned int size=7, double sigma=0., bool normalize=true); /*! Apply a 5x5 Gaussian filter to an image pixel. diff --git a/src/image/vpImageMorphology.h b/modules/core/include/visp3/core/vpImageMorphology.h similarity index 91% rename from src/image/vpImageMorphology.h rename to modules/core/include/visp3/core/vpImageMorphology.h index 076e0dc34bd20369fe4184bb2016d25bdceb645e..898c819851e4ccdb1d2bda1afcb0be9564f3575f 100644 --- a/src/image/vpImageMorphology.h +++ b/modules/core/include/visp3/core/vpImageMorphology.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImageMorphology.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Morphology tools. * @@ -48,9 +44,9 @@ \brief Various mathematical morphology tools, erosion, dilatation... */ -#include <visp/vpImage.h> -#include <visp/vpImageException.h> -#include <visp/vpMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImageException.h> +#include <visp3/core/vpMatrix.h> #include <fstream> #include <iostream> @@ -60,7 +56,7 @@ /*! \class vpImageMorphology - \ingroup ImageFiltering + \ingroup group_core_image \brief Various mathematical morphology tools, erosion, dilatation... diff --git a/src/image/vpImagePoint.h b/modules/core/include/visp3/core/vpImagePoint.h similarity index 94% rename from src/image/vpImagePoint.h rename to modules/core/include/visp3/core/vpImagePoint.h index 9fae9de20ad18340ee22892b8799f8da01479faf..2d60965e6d7231986c7146019cd571cacd84c3e8 100644 --- a/src/image/vpImagePoint.h +++ b/modules/core/include/visp3/core/vpImagePoint.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImagePoint.h 5175 2015-01-15 17:06:07Z nmeriaux $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D point useful for image processing * @@ -49,20 +45,19 @@ for image processing */ -#include <visp/vpConfig.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpMath.h> #include <ostream> #include <cmath> // std::fabs #include <limits> // numeric_limits #include <vector> -class vpHomography; class vpRect; /*! \class vpImagePoint - \ingroup ImageTool + \ingroup group_core_image \brief Class that defines a 2D point in an image. This class is useful for image processing and stores only the <B>2D coordinates @@ -306,8 +301,6 @@ class VISP_EXPORT vpImagePoint friend VISP_EXPORT vpImagePoint operator/( const vpImagePoint &ip1, const double scale ); friend VISP_EXPORT std::ostream& operator<< (std::ostream &os, const vpImagePoint& ip); - vpImagePoint projection(const vpHomography& aHb); - private: double i,j; }; diff --git a/src/image/vpImageTools.h b/modules/core/include/visp3/core/vpImageTools.h similarity index 87% rename from src/image/vpImageTools.h rename to modules/core/include/visp3/core/vpImageTools.h index e9723577a1a5f0648341933a25ff5d984d529230..0d744dd5f3232afed1b3fbf6436fcc4bf36ff2b2 100644 --- a/src/image/vpImageTools.h +++ b/modules/core/include/visp3/core/vpImageTools.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImageTools.h 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Image tools. * @@ -51,16 +47,16 @@ */ -#include <visp/vpImage.h> +#include <visp3/core/vpImage.h> #ifdef VISP_HAVE_PTHREAD # include <pthread.h> #endif -#include <visp/vpImageException.h> -#include <visp/vpMath.h> -#include <visp/vpRect.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpImageException.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRect.h> +#include <visp3/core/vpCameraParameters.h> #include <fstream> #include <iostream> @@ -70,7 +66,7 @@ /*! \class vpImageTools - \ingroup ImageTool + \ingroup group_core_image \brief Various image tools; sub-image extraction, modification of the look up table, binarisation... @@ -90,15 +86,18 @@ public: static void createSubImage(const vpImage<Type> &I, const vpRect &rect, vpImage<Type> &S); + template<class Type> - static void binarise(vpImage<Type> &I, + static inline void binarise(vpImage<Type> &I, Type threshold1, Type threshold2, - Type value1, Type value2, Type value3); + Type value1, Type value2, Type value3, const bool useLUT=false); + static void changeLUT(vpImage<unsigned char>& I, unsigned char A, unsigned char newA, unsigned char B, unsigned char newB); + template<class Type> static void undistort(const vpImage<Type> &I, const vpCameraParameters &cam, @@ -157,6 +156,7 @@ void vpImageTools::createSubImage(const vpImage<Type> &I, S[i-i_sub][j-j_sub] = I[i][j] ; } } + /*! Extract a sub part of an image @@ -205,6 +205,7 @@ void vpImageTools::createSubImage(const vpImage<Type> &I, } } } + /*! Binarise an image. @@ -218,20 +219,61 @@ void vpImageTools::createSubImage(const vpImage<Type> &I, */ template<class Type> -void vpImageTools::binarise(vpImage<Type> &I, +inline void vpImageTools::binarise(vpImage<Type> &I, Type threshold1, Type threshold2, - Type value1, Type value2, Type value3) + Type value1, Type value2, Type value3, const bool useLUT) { - unsigned char v; - unsigned char *p = I.bitmap; - unsigned char *pend = I.bitmap + I.getWidth()*I.getHeight(); + if(useLUT) { + std::cerr << "LUT not available for this type ! Will use the iteration method." << std::endl; + } + + Type v; + Type *p = I.bitmap; + Type *pend = I.bitmap + I.getWidth()*I.getHeight(); for (; p < pend; p ++) { v = *p; if (v < threshold1) *p = value1; else if (v > threshold2) *p = value3; else *p = value2; } +} +/*! + + Binarise an image. + + - Pixels whose values are less than \e threshold1 are set to \e value1 + + - Pixels whose values are greater then or equal to \e threshold1 and + less then or equal to \e threshold2 are set to \e value2 + + - Pixels whose values are greater than \e threshold2 are set to \e value3 + +*/ +template<> +inline void vpImageTools::binarise(vpImage<unsigned char> &I, + unsigned char threshold1, unsigned char threshold2, + unsigned char value1, unsigned char value2, unsigned char value3, const bool useLUT) +{ + if(useLUT) { + //Construct the LUT + unsigned char lut[256]; + for(unsigned int i = 0; i < 256; i++) { + lut[i] = i < threshold1 ? value1 : (i > threshold2 ? value3 : value2); + } + + I.performLut(lut); + } else { + unsigned char v; + unsigned char *p = I.bitmap; + unsigned char *pend = I.bitmap + I.getWidth()*I.getHeight(); + for (; p < pend; p ++) { + v = *p; + if (v < threshold1) *p = value1; + else if (v > threshold2) *p = value3; + else *p = value2; + } + } } #ifdef VISP_HAVE_PTHREAD @@ -249,12 +291,14 @@ public: unsigned int nthreads; unsigned int threadid; public: - vpUndistortInternalType() { - src = dst = NULL; - width = height = 0; - nthreads = threadid = 0; - }; + vpUndistortInternalType() + : src(NULL), dst(NULL), width(0), height(0), cam(), nthreads(0), threadid(0) + {}; + vpUndistortInternalType(const vpUndistortInternalType<Type> &u) { + *this = u; + }; + vpUndistortInternalType &operator=(const vpUndistortInternalType<Type> &u) { src = u.src; dst = u.dst; width = u.width; @@ -262,7 +306,7 @@ public: cam = u.cam; nthreads = u.nthreads; threadid = u.threadid; - }; + } static void *vpUndistort_threaded(void *arg); }; @@ -534,13 +578,12 @@ void vpImageTools::flip(const vpImage<Type> &I, vpImage<Type> &newI) { unsigned int height = 0, width = 0; - int i = 0; height = I.getHeight(); width = I.getWidth(); newI.resize(height, width); - for ( i = 0; i < height; i++) + for (unsigned int i = 0; i < height; i++) { memcpy(newI.bitmap+i*width, I.bitmap+(height-1-i)*width, width*sizeof(Type)); @@ -555,9 +598,9 @@ void vpImageTools::flip(const vpImage<Type> &I, The following example shows how to use this function: \code -#include <visp/vpImageTools.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> int main() { diff --git a/src/tools/io/vpIoException.h b/modules/core/include/visp3/core/vpIoException.h similarity index 85% rename from src/tools/io/vpIoException.h rename to modules/core/include/visp3/core/vpIoException.h index 2c03ed785776ee529d843de0d000c310537dcb4c..9e52677cfb8c9d291e4f76b26a6c9f1f046383e1 100644 --- a/src/tools/io/vpIoException.h +++ b/modules/core/include/visp3/core/vpIoException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpIoException.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exceptions that can be emited by the vpIo class and its derivates. * @@ -54,8 +50,8 @@ \brief Error that can be emited by the vpIoTools class and its derivates. */ -#include <visp/vpConfig.h> -#include <visp/vpException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> #include <iostream> #include <string> @@ -66,7 +62,7 @@ /*! \class vpIoException - \ingroup Exception + \ingroup group_core_debug \brief Error that can be emited by the vpIoTools class and its derivates. */ class VISP_EXPORT vpIoException : public vpException diff --git a/src/tools/io/vpIoTools.h b/modules/core/include/visp3/core/vpIoTools.h similarity index 81% rename from src/tools/io/vpIoTools.h rename to modules/core/include/visp3/core/vpIoTools.h index 7d7ef707538410f390777d849c8918d56b27f7e8..f46ecd100aec7721dd0c08beb26ada8b23f27985 100644 --- a/src/tools/io/vpIoTools.h +++ b/modules/core/include/visp3/core/vpIoTools.h @@ -1,255 +1,237 @@ -/**************************************************************************** - * - * $Id: vpIoTools.h 5197 2015-01-23 17:24:22Z strinh $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Directory management. - * - * Authors: - * Fabien Spindler - * - *****************************************************************************/ - - -#ifndef vpIoTools_HH -#define vpIoTools_HH - -/*! - \file vpIoTools.h - \brief File and directories basic tools. - */ - -#include <visp/vpConfig.h> - -#include <iostream> -#include <sstream> -#include <string> -#include <stdlib.h> -#include <vector> -#include <visp/vpColor.h> - -/*! - \class vpIoTools - \ingroup FileDirectories - \brief File and directories basic tools. - - The example below shows how to manipulate the functions of this - class to create first a directory which name corresponds to the user - name and then create a file in this directory. - - \code -#include <iostream> -#include <string> -#include <fstream> -#include <visp/vpIoTools.h> - -int main() -{ - std::string username; - vpIoTools::getUserName(username); - - // Test if a username directory exist. If no try to create it - if (vpIoTools::checkDirectory(username) == false) { - try { - // Create a directory with name "username" - vpIoTools::makeDirectory(username); - } - catch (...) { - std::cout << "Cannot create " << username << " directory" << std::endl; - return false; - } - } - // Create a empty filename with name "username/file.txt" - std::ofstream f; - std::string filename = username + "/file.txt"; - filename = vpIoTools::path(filename); // Under Windows converts the filename string into "username\\file.txt" - - std::cout << "Create: " << filename << std::endl; - f.open(filename.c_str()); - f.close(); - - // Rename the file - std::string newfilename = username + "/newfile.txt"; - std::cout << "Rename: " << filename << " in: " << newfilename << std::endl; - if (vpIoTools::rename(filename, newfilename) == false) - std::cout << "Unable to rename: " << filename << std::endl; - - // Remove the file - std::cout << "Remove: " << newfilename << std::endl; - if (vpIoTools::remove(newfilename) == false) - std::cout << "Unable to remove: " << newfilename << std::endl; -} - \endcode - - The example below shows how to read a configuration file and how to create a name for experiment files. - We assume the following file "/home/user/demo/config.txt" : - \code -expNumber 2 -save 0 -lambda 0.4 -use2D 0 -use3D 1 - \endcode - - \code -#include <iostream> -#include <string> -#include <visp/vpIoTools.h> - -int main() -{ - // reading configuration file - vpIoTools::loadConfigFile("/home/user/demo/config.txt"); - std::string nExp;vpIoTools::readConfigVar("expNumber", nExp); // nExp <- "2" - double lambda;vpIoTools::readConfigVar("lambda", lambda); // lambda <- 0.4 - bool use2D;vpIoTools::readConfigVar("use2D", use2D); // use2D <- false - bool use3D;vpIoTools::readConfigVar("use3D", use3D); // use3D <- true - bool doSave;vpIoTools::readConfigVar("save", doSave); // doSave <- false - - // creating name for experiment files - vpIoTools::setBaseDir("/home/user/data"); - vpIoTools::setBaseName("exp" + nExp); // full name <- "/home/user/data/exp2" - vpIoTools::addNameElement("2D", use2D); // full name <- "/home/user/data/exp2" since use2D==false - vpIoTools::addNameElement("3D", use3D); // full name <- "/home/user/data/exp2_3D" - vpIoTools::addNameElement("lambda", lambda); // full name <- "/home/user/data/exp2_3D_lambda0.4" - - // saving file - vpIoTools::saveConfigFile(doSave); // would copy "/home/user/demo/config.txt" to "/home/user/data/exp2_3D_lambda0.4_config.txt" if doSave was true - - // create sub directory - vpIoTools::createBaseNamePath(); // creates "/home/user/data/exp2_3D_lambda0.4/" -} - \endcode - - */ - -class VISP_EXPORT vpIoTools -{ - -public: - static void getUserName(std::string &username); - static std::string getUserName(); - static std::string getenv(const char *env); - static std::string getenv(const std::string &env); - static std::string getViSPImagesDataPath(); - static void getVersion(const std::string &version, unsigned int &major, unsigned int &minor, unsigned int &patch); - static bool checkDirectory(const char *dirname); - static bool checkDirectory(const std::string &dirname); - static bool checkFilename(const char *filename); - static bool checkFilename(const std::string &filename); - static bool copy(const char *src, const char *dst); - static bool copy(const std::string &src, const std::string &dst); - static void makeDirectory(const char *dirname); - static void makeDirectory(const std::string &dirname); - static bool remove(const char *filename); - static bool remove(const std::string &filename); - static bool rename(const char *oldfilename, const char *newfilename); - static bool rename(const std::string &oldfilename, const std::string &newfilename); - - static std::string path(const char * pathname); - static std::string path(const std::string &pathname); - - /*! - Define the directory separator character, backslash ('\') for windows platform or slash ('/') otherwise. - */ - static const char separator = - #if defined(_WIN32) - '\\'; - #else - '/'; - #endif - - static std::string getFileExtension(const std::string &pathname, const bool checkFile=false); - static std::string getName(const std::string &pathname); - static std::string getNameWE(const std::string &pathname); - static std::string getParent(const std::string& pathname); - static std::string createFilePath(const std::string& parent, const std::string child); - static bool isAbsolutePathname(const std::string& pathname); - static std::pair<std::string, std::string> splitDrive(const std::string& pathname); - - // read configuration file - static bool loadConfigFile(const std::string &confFile); - static bool readConfigVar(const std::string &var, float &value); - static bool readConfigVar(const std::string &var, double &value); - static bool readConfigVar(const std::string &var, int &value); - static bool readConfigVar(const std::string &var, unsigned int &value); - static bool readConfigVar(const std::string &var, bool &value); - static bool readConfigVar(const std::string &var, std::string &value); - static bool readConfigVar(const std::string &var, vpColor &value); - static bool readConfigVar(const std::string &var, vpMatrix &value, - const unsigned int &nCols = 0, - const unsigned int &nRows = 0); - - // construct experiment filename & path - /*! - Sets the base name (prefix) of the experiment files. - - \param s : Prefix of the experiment files. - */ - inline static void setBaseName(const std::string &s) {baseName = s;} - /*! - Sets the base directory of the experiment files. - - \param dir : Directory where the data will be saved. - */ - static inline void setBaseDir(const std::string &dir) {baseDir = dir + "/";} - static void addNameElement(const std::string &strTrue, - const bool &cond=true, - const std::string &strFalse=""); - static void addNameElement(const std::string &strTrue, const double &val); - /*! - Gets the base name (prefix) of the experiment files. - - \return the base name of the experiment files. - */ - inline static std::string getBaseName() {return baseName;} - /*! - Gets the full path of the experiment files : baseDir/baseName - - \return the full path of the experiment files. - */ - inline static std::string getFullName() {return baseDir + baseName;} - - // write files - static void saveConfigFile(const bool &actuallySave = true); - static void createBaseNamePath(const bool &empty = false); - - protected: - static std::string baseName; - static std::string baseDir; - static std::string configFile; - static std::vector<std::string> configVars; - static std::vector<std::string> configValues; -} ; - - -#endif +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Directory management. + * + * Authors: + * Fabien Spindler + * + *****************************************************************************/ + + +#ifndef vpIoTools_HH +#define vpIoTools_HH + +/*! + \file vpIoTools.h + \brief File and directories basic tools. + */ + +#include <visp3/core/vpConfig.h> + +#include <iostream> +#include <sstream> +#include <string> +#include <stdlib.h> +#include <vector> +#include <visp3/core/vpColor.h> + +/*! + \class vpIoTools + \ingroup group_core_files_io + \brief File and directories basic tools. + + The example below shows how to manipulate the functions of this + class to create first a directory which name corresponds to the user + name and then create a file in this directory. + + \code +#include <iostream> +#include <string> +#include <fstream> +#include <visp3/core/vpIoTools.h> + +int main() +{ + std::string username; + vpIoTools::getUserName(username); + + // Test if a username directory exist. If no try to create it + if (vpIoTools::checkDirectory(username) == false) { + try { + // Create a directory with name "username" + vpIoTools::makeDirectory(username); + } + catch (...) { + std::cout << "Cannot create " << username << " directory" << std::endl; + return false; + } + } + // Create a empty filename with name "username/file.txt" + std::ofstream f; + std::string filename = username + "/file.txt"; + filename = vpIoTools::path(filename); // Under Windows converts the filename string into "username\\file.txt" + + std::cout << "Create: " << filename << std::endl; + f.open(filename.c_str()); + f.close(); + + // Rename the file + std::string newfilename = username + "/newfile.txt"; + std::cout << "Rename: " << filename << " in: " << newfilename << std::endl; + if (vpIoTools::rename(filename, newfilename) == false) + std::cout << "Unable to rename: " << filename << std::endl; + + // Remove the file + std::cout << "Remove: " << newfilename << std::endl; + if (vpIoTools::remove(newfilename) == false) + std::cout << "Unable to remove: " << newfilename << std::endl; +} + \endcode + + The example below shows how to read a configuration file and how to create a name for experiment files. + We assume the following file "/home/user/demo/config.txt" : + \code +expNumber 2 +save 0 +lambda 0.4 +use2D 0 +use3D 1 + \endcode + + \code +#include <iostream> +#include <string> +#include <visp3/core/vpIoTools.h> + +int main() +{ + // reading configuration file + vpIoTools::loadConfigFile("/home/user/demo/config.txt"); + std::string nExp;vpIoTools::readConfigVar("expNumber", nExp); // nExp <- "2" + double lambda;vpIoTools::readConfigVar("lambda", lambda); // lambda <- 0.4 + bool use2D;vpIoTools::readConfigVar("use2D", use2D); // use2D <- false + bool use3D;vpIoTools::readConfigVar("use3D", use3D); // use3D <- true + bool doSave;vpIoTools::readConfigVar("save", doSave); // doSave <- false + + // creating name for experiment files + vpIoTools::setBaseDir("/home/user/data"); + vpIoTools::setBaseName("exp" + nExp); // full name <- "/home/user/data/exp2" + vpIoTools::addNameElement("2D", use2D); // full name <- "/home/user/data/exp2" since use2D==false + vpIoTools::addNameElement("3D", use3D); // full name <- "/home/user/data/exp2_3D" + vpIoTools::addNameElement("lambda", lambda); // full name <- "/home/user/data/exp2_3D_lambda0.4" + + // saving file + vpIoTools::saveConfigFile(doSave); // would copy "/home/user/demo/config.txt" to "/home/user/data/exp2_3D_lambda0.4_config.txt" if doSave was true + + // create sub directory + vpIoTools::createBaseNamePath(); // creates "/home/user/data/exp2_3D_lambda0.4/" +} + \endcode + + */ + +class VISP_EXPORT vpIoTools +{ + +public: + static void getUserName(std::string &username); + static std::string getUserName(); + static std::string getenv(const char *env); + static std::string getenv(const std::string &env); + static std::string getViSPImagesDataPath(); + static void getVersion(const std::string &version, unsigned int &major, unsigned int &minor, unsigned int &patch); + static bool checkDirectory(const char *dirname); + static bool checkDirectory(const std::string &dirname); + static bool checkFilename(const char *filename); + static bool checkFilename(const std::string &filename); + static bool copy(const char *src, const char *dst); + static bool copy(const std::string &src, const std::string &dst); + static void makeDirectory(const char *dirname); + static void makeDirectory(const std::string &dirname); + static bool remove(const char *filename); + static bool remove(const std::string &filename); + static bool rename(const char *oldfilename, const char *newfilename); + static bool rename(const std::string &oldfilename, const std::string &newfilename); + + static std::string path(const char * pathname); + static std::string path(const std::string &pathname); + + /*! + Define the directory separator character, backslash ('\') for windows platform or slash ('/') otherwise. + */ + static const char separator = + #if defined(_WIN32) + '\\'; + #else + '/'; + #endif + + static std::string getFileExtension(const std::string &pathname, const bool checkFile=false); + static std::string getName(const std::string &pathname); + static std::string getNameWE(const std::string &pathname); + static std::string getParent(const std::string& pathname); + static std::string createFilePath(const std::string& parent, const std::string child); + static bool isAbsolutePathname(const std::string& pathname); + static std::pair<std::string, std::string> splitDrive(const std::string& pathname); + static std::vector<std::string> splitChain(const std::string & chain, const std::string & sep); + + /*! + @name Configuration file parsing + */ + //@{ + // read configuration file + static bool loadConfigFile(const std::string &confFile); + static bool readConfigVar(const std::string &var, float &value); + static bool readConfigVar(const std::string &var, double &value); + static bool readConfigVar(const std::string &var, int &value); + static bool readConfigVar(const std::string &var, unsigned int &value); + static bool readConfigVar(const std::string &var, bool &value); + static bool readConfigVar(const std::string &var, std::string &value); + static bool readConfigVar(const std::string &var, vpColor &value); + static bool readConfigVar(const std::string &var, vpArray2D<double> &value, + const unsigned int &nCols = 0, + const unsigned int &nRows = 0); + + // construct experiment filename & path + static void setBaseName(const std::string &s); + static void setBaseDir(const std::string &dir); + static void addNameElement(const std::string &strTrue, + const bool &cond=true, + const std::string &strFalse=""); + static void addNameElement(const std::string &strTrue, const double &val); + static std::string getBaseName(); + static std::string getFullName(); + + // write files + static void saveConfigFile(const bool &actuallySave = true); + static void createBaseNamePath(const bool &empty = false); + //@} + + protected: + static std::string baseName; + static std::string baseDir; + static std::string configFile; + static std::vector<std::string> configVars; + static std::vector<std::string> configValues; +} ; + + +#endif diff --git a/src/math/kalman/vpKalmanFilter.h b/modules/core/include/visp3/core/vpKalmanFilter.h similarity index 93% rename from src/math/kalman/vpKalmanFilter.h rename to modules/core/include/visp3/core/vpKalmanFilter.h index 823dfe8a934e9e8cd164aa74e9fa1b8d80dabdb9..5a8816470caef7195e0da564388c4f517cb9f122 100644 --- a/src/math/kalman/vpKalmanFilter.h +++ b/modules/core/include/visp3/core/vpKalmanFilter.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpKalmanFilter.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Kalman filtering. * @@ -43,8 +39,8 @@ #ifndef vpKalmanFilter_h #define vpKalmanFilter_h -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpColVector.h> #include <math.h> @@ -55,6 +51,7 @@ /*! \class vpKalmanFilter + \ingroup group_core_kalman \brief This class provides a generic Kalman filtering algorithm along with some specific state model (constant velocity, constant acceleration) which are implemented in the vpLinearKalmanFilterInstantiation class. @@ -143,7 +140,7 @@ public: // int init() { return init_done ; } void init(unsigned int size_state, unsigned int size_measure, unsigned int n_signal) ; void prediction() ; - void filtering(vpColVector &z) ; + void filtering(const vpColVector &z) ; /*! Return the size of the state vector \f${\bf x}_{(k)}\f$ for one signal. */ @@ -193,8 +190,6 @@ public: iterations. Only used in some specific state models implemented in vpLinearKalmanFilterInstantiation.*/ double dt ; - -protected: /*! The state prediction covariance \f${\bf P}_{k \mid k-1} \f$ where \f$ {\bf P}_{k \mid k-1} = {\bf F}_{k-1} {\bf P}_{k-1 \mid k-1} {\bf F}^T_{k-1} @@ -209,6 +204,8 @@ protected: */ vpMatrix Pest ; +protected: + /*! Filter gain \f${\bf W}_k\f$ where \f$ {\bf W}_k = {\bf P}_{k \mid k-1} {\bf H}^T \left[ {\bf H P}_{k \mid k-1} {\bf H}^T + {\bf diff --git a/src/tracking/forward-projection/vpLine.h b/modules/core/include/visp3/core/vpLine.h similarity index 92% rename from src/tracking/forward-projection/vpLine.h rename to modules/core/include/visp3/core/vpLine.h index 780a1a024ea7cc45c73702d180622f5c1090a09d..3ac5d758acd5240e3b9f3cf51d4094a0a970d0c2 100644 --- a/src/tracking/forward-projection/vpLine.h +++ b/modules/core/include/visp3/core/vpLine.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpLine.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Line feature. * @@ -48,14 +44,14 @@ \brief class that defines what is a line */ -#include <visp/vpMatrix.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> -#include <visp/vpForwardProjection.h> +#include <visp3/core/vpForwardProjection.h> /*! \class vpLine - \ingroup TrackingFeature GeometryFeature + \ingroup group_core_geometry \brief Class that defines a line in the object frame, the camera frame and the image plane. All the parameters diff --git a/src/math/kalman/vpLinearKalmanFilterInstantiation.h b/modules/core/include/visp3/core/vpLinearKalmanFilterInstantiation.h similarity index 91% rename from src/math/kalman/vpLinearKalmanFilterInstantiation.h rename to modules/core/include/visp3/core/vpLinearKalmanFilterInstantiation.h index 5ff208bb0361f75af98f173a64b15741d825c232..3ae9c1bab32ba624637d08a7c6e480c8638d79b7 100644 --- a/src/math/kalman/vpLinearKalmanFilterInstantiation.h +++ b/modules/core/include/visp3/core/vpLinearKalmanFilterInstantiation.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpLinearKalmanFilterInstantiation.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Kalman filtering. * @@ -43,7 +39,7 @@ #ifndef vpLinearKalmanFilterInstantiation_h #define vpLinearKalmanFilterInstantiation_h -#include <visp/vpKalmanFilter.h> +#include <visp3/core/vpKalmanFilter.h> #include <math.h> @@ -54,6 +50,7 @@ /*! \class vpLinearKalmanFilterInstantiation + \ingroup group_core_kalman \brief This class provides an implementation of some specific linear Kalman filters. */ class VISP_EXPORT vpLinearKalmanFilterInstantiation : public vpKalmanFilter @@ -144,7 +141,7 @@ class VISP_EXPORT vpLinearKalmanFilterInstantiation : public vpKalmanFilter size of the state and measure vectors. \code -#include <visp/vpLinearKalmanFilterInstantiation.h> +#include <visp3/core/vpLinearKalmanFilterInstantiation.h> int main() { diff --git a/src/data-structure/vpList.h b/modules/core/include/visp3/core/vpList.h similarity index 94% rename from src/data-structure/vpList.h rename to modules/core/include/visp3/core/vpList.h index 485acb0dd444d9aaded3ec1fcac33175bbd588a3..094968b26239818f7565f511a575a3195d0157d0 100644 --- a/src/data-structure/vpList.h +++ b/modules/core/include/visp3/core/vpList.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpList.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * List data structure. * @@ -50,8 +46,9 @@ \brief Definition of the list managment class */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpException.h> #include <stdio.h> @@ -64,11 +61,22 @@ template <class type> class vpListElement { - public: - vpListElement() : prev(NULL), next(NULL), val() {}; - vpListElement<type> *prev; //<! pointer to the previous element in the list - vpListElement<type> *next; //<! pointer to the next element in the list - type val; //<! value of the element +//private: +// vpListElement(const vpListElement &) +// : prev(NULL), next(NULL), val() +// { +// throw vpException(vpException::functionNotImplementedError,"Not implemented!"); +// } +// vpListElement &operator=(const vpListElement &){ +// throw vpException(vpException::functionNotImplementedError,"Not implemented!"); +// return *this; +// } + +public: + vpListElement() : prev(NULL), next(NULL), val() {}; + vpListElement<type> *prev; //<! pointer to the previous element in the list + vpListElement<type> *next; //<! pointer to the next element in the list + type val; //<! value of the element } ; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ @@ -76,11 +84,8 @@ class vpListElement /*! \class vpList - \ingroup List \brief Provide simple list management - \author Eric Marchand (Eric.Marchand@irisa.fr) Irisa / Inria Rennes - \verbatim Data structure: each object vpListElement contains its own value and diff --git a/modules/core/include/visp3/core/vpMath.h b/modules/core/include/visp3/core/vpMath.h new file mode 100644 index 0000000000000000000000000000000000000000..1de527746f3853bc0d28a7c99ff16d7153ca9d21 --- /dev/null +++ b/modules/core/include/visp3/core/vpMath.h @@ -0,0 +1,472 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Simple mathematical function not available in the C math library (math.h). + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +/*! + \file vpMath.h + \brief Provides simple Math computation that are not available in + the C mathematics library (math.h) +*/ + + + +#ifndef vpMATH_HH +#define vpMATH_HH + +#include <visp3/core/vpConfig.h> + +#include <math.h> +#include <limits> +#include <climits> +#include <algorithm> +#include <vector> + +#if defined(VISP_HAVE_FUNC_ISNAN) || defined(VISP_HAVE_FUNC_STD_ISNAN) || defined(VISP_HAVE_FUNC_ISINF) || defined(VISP_HAVE_FUNC_STD_ISINF) || defined(VISP_HAVE_FUNC_STD_ROUND) +# include <cmath> +#endif + +#if defined(_WIN32) // Not defined in Microsoft math.h + +# ifndef M_PI +# define M_PI 3.14159265358979323846 +# endif + +# ifndef M_PI_2 +# define M_PI_2 (M_PI/2.0) +# endif + +# ifndef M_PI_4 +# define M_PI_4 (M_PI/4.0) +# endif + +#endif + + +/*! + \class vpMath + \ingroup group_core_math_tools + \brief Provides simple mathematics computation tools that are not + available in the C mathematics library (math.h) + + \author Eric Marchand (Eric.Marchand@irisa.fr) Irisa / Inria Rennes +*/ + +class VISP_EXPORT vpMath +{ + public: + + /*! + Convert an angle in radians into degrees. + + \param rad : Angle in radians. + \return Angle converted in degrees. + */ + static inline double deg(double rad) { return (rad*180.0)/M_PI ; } + + /*! + Convert an angle in degrees into radian. + \param deg : Angle in degrees. + \return Angle converted in radian. + */ + static inline double rad(double deg) { return (deg*M_PI)/180.0 ; } + + /*! + Compute x square value. + \return \f$ x^2 \f$. + */ + static inline double sqr(double x) { return x*x ; } + + // factorial of x + static inline double fact(unsigned int x) ; + + // combinaison + static inline long double comb(unsigned int n, unsigned int p) ; + + // round x to the nearest integer + static inline int round(const double x) ; + + // return the sign of x (+-1) + static inline int sign(double x) ; + + + // test if a number equals 0 (with threshold value) + static inline bool nul(double x, double s=0.001); + + // test if two numbers are equals (with a user defined threshold) + static inline bool equal(double x, double y, double s=0.001); + + // test if a number is greater than another (with a user defined threshold) + static inline bool greater(double x, double y, double s=0.001); + + + /*! + Find the maximum between two numbers (or other). + \param a : First number. + \param b : Second number. + \return The maximum of the two numbers. + */ + template <class Type> static Type maximum(const Type& a, const Type& b) + { + return (a > b) ? a : b; + } + + /*! + Find the minimum between two numbers (or other). + \param a : First number. + \param b : Second number. + \return The minimum of the two numbers. + */ + template <class Type> static Type minimum(const Type& a, const Type& b) + { + return (a < b) ? a : b; + } + + /*! + Find the absolute value of a number (or other). + \param x : The number. + \return The absolute value of x + */ + template <class Type> static Type abs(const Type& x) + { + return (x < 0) ? -x : x; + } + + + // sinus cardinal + static double sinc(double x) ; + static double sinc(double sinx, double x) ; + static double mcosc(double cosx, double x) ; + static double msinc(double sinx, double x) ; + + // sigmoid + static inline double sigmoid(double x, double x0=0.,double x1=1., double n=12.); + + /*! + Exchange two numbers. + + \param a First number to exchange. + \param b Second number to exchange + */ + template <class Type> static void swap(Type& a, Type& b) + { + Type tmp = b; + b = a; + a = tmp; + } + + static bool isNaN(const double value); + static bool isInf(const double value); + + template<typename _Tp> static inline _Tp saturate(unsigned char v) { return _Tp(v); } + template<typename _Tp> static inline _Tp saturate(char v) { return _Tp(v); } + template<typename _Tp> static inline _Tp saturate(unsigned short v) { return _Tp(v); } + template<typename _Tp> static inline _Tp saturate(short v) { return _Tp(v); } + template<typename _Tp> static inline _Tp saturate(unsigned v) { return _Tp(v); } + template<typename _Tp> static inline _Tp saturate(int v) { return _Tp(v); } + template<typename _Tp> static inline _Tp saturate(float v) { return _Tp(v); } + template<typename _Tp> static inline _Tp saturate(double v) { return _Tp(v); } + + static double getMean(const std::vector<double> &v); + static double getMedian(const std::vector<double> &v); + static double getStdev(const std::vector<double> &v, const bool useBesselCorrection=false); + + private: + static const double ang_min_sinc; + static const double ang_min_mc; +}; + + + +//Begining of the inline functions definition + +/*! + Computes and returns x! + \param x : parameter of factorial function. +*/ +double vpMath::fact(unsigned int x) +{ + if ( (x == 1) || (x == 0)) return 1; + return x * fact(x-1); +} + +/*! + Computes the number of combination of p elements inside n elements. + + \param n : total number of elements. + \param p : requested number of elements. + + \return \f$ n! / ((n-p)! p!) \f$ +*/ +long double vpMath::comb(unsigned int n, unsigned int p) +{ + if (n == p) return 1; + return fact(n)/ (fact(n-p) * fact(p)); +} + + +/*! + Round x to the nearest integer. + + \param x : Value to round. + + \return Nearest integer of x. + +*/ +int vpMath::round(const double x) +{ +#if defined(VISP_HAVE_FUNC_ROUND) + //:: to design the global namespace and avoid to call recursively vpMath::round + return (int)::round(x); +#elif defined(VISP_HAVE_FUNC_STD_ROUND) + return (int)std::round(x) +#else + return (x > 0.0) ? ((int) floor(x + 0.5)) : ((int) ceil(x - 0.5)); +#endif +} + +/*! + Return the sign of x. + + \return -1 if x is negative, +1 if positive and 0 if zero. + +*/ +int vpMath::sign(double x) +{ + if (fabs(x) < std::numeric_limits<double>::epsilon()) + return 0; + else { + if (x < 0) + return -1; + else + return 1; + } +} + +/*! + Compares \f$ | x | \f$ to \f$ s \f$. + \param x : Value to test. + \param s : Tolerance threshold + \return true if \f$ | x | < s \f$. + +*/ +bool vpMath::nul(double x, double s) +{ + return(fabs(x)<s); +} + +/*! + Compares \f$ | x - y | \f$ to \f$ s \f$. + \param x : x value. + \param y : y value. + \param s : Tolerance threshold. + \return true if \f$ | x - y | < s \f$. +*/ +bool vpMath::equal(double x, double y, double s) +{ + return( nul(x-y, s) ); +} + +/*! + Compares \f$ x \f$ to \f$ y - s \f$. + \param x : x value. + \param y : y value. + \param s : Tolerance threshold. + \return true if \f$ x > y - s \f$. +*/ +bool vpMath::greater(double x, double y, double s) +{ + return(x>(y-s)); +} + +/*! + + Sigmoid function between [x0,x1] with \f$ s(x)=0 if x\le x0\f$ and \f$ s(x)=1 if x \ge x1 \f$ + \param x : Value of x. + \param x0 : Lower bound (default 0). + \param x1 : Upper bound (default 1). + \param n : Degree of the exponential (default 12). + +\return \f$1/(1+exp(-n*((x-x0)/(x1-x0)-0.5)))\f$ + */ +double vpMath::sigmoid(double x, double x0,double x1, double n) +{ + if(x < x0) + return 0.; + else if(x > x1) + return 1.; + double l0 = 1./(1.+exp(0.5*n)); + double l1 = 1./(1.+exp(-0.5*n)); + return (1./(1.+exp(-n*((x-x0)/(x1-x0)-0.5)))-l0)/(l1-l0); +} + +//unsigned char +template<> inline unsigned char vpMath::saturate<unsigned char>(char v) { + return (unsigned char) (std::max)((int) v, 0); +} + +template<> inline unsigned char vpMath::saturate<unsigned char>(unsigned short v) { + return (unsigned char) (std::min)((unsigned int) v, (unsigned int) UCHAR_MAX); +} + +template<> inline unsigned char vpMath::saturate<unsigned char>(int v) { + return (unsigned char) ((unsigned int) v <= UCHAR_MAX ? v : v > 0 ? UCHAR_MAX : 0); +} + +template<> inline unsigned char vpMath::saturate<unsigned char>(short v) { + return saturate<unsigned char> ((int) v); +} + +template<> inline unsigned char vpMath::saturate<unsigned char>(unsigned int v) { + return (unsigned char) (std::min)(v, (unsigned int) UCHAR_MAX); +} + +template<> inline unsigned char vpMath::saturate<unsigned char>(float v) { + int iv = vpMath::round(v); + return saturate<unsigned char> (iv); +} + +template<> inline unsigned char vpMath::saturate<unsigned char>(double v) { + int iv = vpMath::round(v); + return saturate<unsigned char> (iv); +} + +//char +template<> inline char vpMath::saturate<char>(unsigned char v) { + return (char) (std::min)((int) v, SCHAR_MAX); +} + +template<> inline char vpMath::saturate<char>(unsigned short v) { + return (char) (std::min)((unsigned int) v, (unsigned int) SCHAR_MAX); +} + +template<> inline char vpMath::saturate<char>(int v) { + return (char) ((unsigned int) (v - SCHAR_MIN) <= (unsigned int) UCHAR_MAX ? v : + v > 0 ? SCHAR_MAX : SCHAR_MIN); +} + +template<> inline char vpMath::saturate<char>(short v) { + return saturate<char>((int) v); +} + +template<> inline char vpMath::saturate<char>(unsigned int v) { + return (char) (std::min)(v, (unsigned int) SCHAR_MAX); +} + +template<> inline char vpMath::saturate<char>(float v) { + int iv = vpMath::round(v); + return saturate<char>(iv); +} + +template<> inline char vpMath::saturate<char>(double v) { + int iv = vpMath::round(v); + return saturate<char>(iv); +} + +//unsigned short +template<> inline unsigned short vpMath::saturate<unsigned short>(char v) { + return (unsigned short) (std::max)((int) v, 0); +} + +template<> inline unsigned short vpMath::saturate<unsigned short>(short v) { + return (unsigned short) (std::max)((int) v, 0); +} + +template<> inline unsigned short vpMath::saturate<unsigned short>(int v) { + return (unsigned short) ((unsigned int) v <= (unsigned int) USHRT_MAX ? v : + v > 0 ? USHRT_MAX : 0); +} + +template<> inline unsigned short vpMath::saturate<unsigned short>(unsigned int v) { + return (unsigned short) (std::min)(v, (unsigned int) USHRT_MAX); +} + +template<> inline unsigned short vpMath::saturate<unsigned short>(float v) { + int iv = vpMath::round(v); + return vpMath::saturate<unsigned short>(iv); +} + +template<> inline unsigned short vpMath::saturate<unsigned short>(double v) { + int iv = vpMath::round(v); + return vpMath::saturate<unsigned short>(iv); +} + +//short +template<> inline short vpMath::saturate<short>(unsigned short v) { + return (short) (std::min)((int) v, SHRT_MAX); +} +template<> inline short vpMath::saturate<short>(int v) { + return (short) ((unsigned int) (v - SHRT_MIN) <= (unsigned int) USHRT_MAX ? v : + v > 0 ? SHRT_MAX : SHRT_MIN); +} +template<> inline short vpMath::saturate<short>(unsigned int v) { + return (short) (std::min)(v, (unsigned int) SHRT_MAX); +} +template<> inline short vpMath::saturate<short>(float v) { + int iv = vpMath::round(v); + return vpMath::saturate<short>(iv); +} +template<> inline short vpMath::saturate<short>(double v) { + int iv = vpMath::round(v); + return vpMath::saturate<short>(iv); +} + +//int +template<> inline int vpMath::saturate<int>(float v) { + return vpMath::round(v); +} + +template<> inline int vpMath::saturate<int>(double v) { + return vpMath::round(v); +} + +//unsigned int +// (Comment from OpenCV) we intentionally do not clip negative numbers, to make -1 become 0xffffffff etc. +template<> inline unsigned int vpMath::saturate<unsigned int>(float v) { + return (unsigned int) vpMath::round(v); +} + +template<> inline unsigned int vpMath::saturate<unsigned int>(double v) { + return (unsigned int) vpMath::round(v); +} + + +#endif + +/* + * Local variables: + * c-basic-offset: 2 + * End: + */ diff --git a/src/math/matrix/vpMatrix.h b/modules/core/include/visp3/core/vpMatrix.h similarity index 55% rename from src/math/matrix/vpMatrix.h rename to modules/core/include/visp3/core/vpMatrix.h index 3f3659d688b22b8c925d429cc1a78ea2b5a1674f..a35b1e0a63c1d24a1158b574abe21dc339a9f9b6 100644 --- a/src/math/matrix/vpMatrix.h +++ b/modules/core/include/visp3/core/vpMatrix.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMatrix.h 5238 2015-01-30 13:52:25Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Matrix manipulation. * @@ -39,14 +35,17 @@ * *****************************************************************************/ - - #ifndef vpMatrix_H #define vpMatrix_H -#include <visp/vpConfig.h> -#include <visp/vpException.h> -#include <visp/vpTime.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpTime.h> +#include <visp3/core/vpArray2D.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/core/vpForceTwistMatrix.h> #ifdef VISP_HAVE_GSL # include <gsl/gsl_math.h> @@ -59,14 +58,9 @@ class vpRowVector; class vpColVector; class vpTranslationVector; - - -class vpColVector; -class vpTranslationVector; -class vpRowVector; -class vpHomography; - - +class vpHomogeneousMatrix; +class vpVelocityTwistMatrix; +class vpForceTwistMatrix; /*! \file vpMatrix.h @@ -79,14 +73,14 @@ class vpHomography; /*! \class vpMatrix - \ingroup Matrix + \ingroup group_core_matrices - \brief Definition of the vpMatrix class. + \brief Implementation of a matrix and operations on matrices. vpMatrix class provides a data structure for the matrices as well - as a set of operations on these matrices + as a set of operations on these matrices. - \author Eric Marchand (IRISA - INRIA Rennes) + The vpMatrix class is derived from vpArray2D<double>. \warning Note the matrix in the class (*this) will be noted A in the comment @@ -95,7 +89,7 @@ class vpHomography; \sa vpRowVector, vpColVector, vpHomogeneousMatrix, vpRotationMatrix, vpTwistMatrix, vpHomography */ -class VISP_EXPORT vpMatrix +class VISP_EXPORT vpMatrix : public vpArray2D<double> { public: /*! @@ -106,229 +100,127 @@ class VISP_EXPORT vpMatrix LU_DECOMPOSITION /*!< LU decomposition method. */ } vpDetMethod; - -protected: - //! number of rows - unsigned int rowNum; - //! number of columns - unsigned int colNum; - public: - //! address of the first element of the data array - double *data; - protected: - //! address of the first element of each rows - double **rowPtrs; - - //! Current size (rowNum * colNum) - unsigned int dsize; - //! Total row space - unsigned int trsize; + /*! + Basic constructor of a matrix of double. Number of columns and rows are zero. + */ + vpMatrix() : vpArray2D<double>(0, 0) {}; + /*! + Constructor that initialize a matrix of double with 0. - public: - //! Basic constructor - vpMatrix() ; - //! Constructor. Initialization of A as an r x c matrix with 0. - vpMatrix(unsigned int r, unsigned int c) ; - vpMatrix(unsigned int r, unsigned int c, double val); - //! sub vpMatrix constructor - vpMatrix(const vpMatrix &m, unsigned int r, unsigned int c, - unsigned int nrows, unsigned int ncols) ; + \param r : Matrix number of rows. + \param c : Matrix number of columns. + */ + vpMatrix(unsigned int r, unsigned int c) : vpArray2D<double>(r, c) {}; + /*! + Constructor that initialize a matrix of double with \e val. - vpMatrix(const vpHomography& H); + \param r : Matrix number of rows. + \param c : Matrix number of columns. + \param val : Each element of the matrix is set to \e val. + */ + vpMatrix(unsigned int r, unsigned int c, double val) : vpArray2D<double>(r, c, val) {}; + vpMatrix(const vpMatrix &M, unsigned int r, unsigned int c, + unsigned int nrows, unsigned int ncols) ; + /*! + Create a matrix from a 2D array that could be one of the following container that + inherit from vpArray2D such as vpMatrix, vpRotationMatrix, vpHomogeneousMatrix, + vpPoseVector, vpColVector, vpRowVector... + + The following example shows how to create a matrix from an homogeneous matrix: + \code + vpRotationMatrix R; + vpMatrix M(R); + \endcode + */ + vpMatrix(const vpArray2D<double>& A) : vpArray2D<double>(A) {}; //! Destructor (Memory de-allocation) - virtual ~vpMatrix(); + virtual ~vpMatrix() {}; - //! Initialization of the object matrix - void init() ; - - //! Destruction of the matrix (Memory de-allocation) - void kill() ; + /*! + Removes all elements from the matrix (which are destroyed), + leaving the container with a size of 0. + */ + void clear() + { + if (data != NULL ) { + free(data); + data=NULL; + } + + if (rowPtrs!=NULL) { + free(rowPtrs); + rowPtrs=NULL ; + } + rowNum = colNum = dsize = 0; + } + //------------------------------------------------- + // Setting a diagonal matrix + //------------------------------------------------- + /** @name Setting a diagonal matrix */ + //@{ + void diag(const double &val = 1.0); + void diag(const vpColVector &A); // Initialize an identity matrix n-by-n + void eye(); void eye(unsigned int n) ; // Initialize an identity matrix m-by-n void eye(unsigned int m, unsigned int n) ; - void setIdentity(const double & val=1.0) ; - - //--------------------------------- - // Set/get Matrix size - //--------------------------------- - /** @name Set/get Matrix size */ - //@{ - //! Return the number of rows of the matrix - inline unsigned int getRows() const { return rowNum ;} - //! Return the number of columns of the matrix - inline unsigned int getCols() const { return colNum; } - //! Return the number of elements of the matrix. - inline unsigned int size() const { return colNum*rowNum; } - - // Set the size of the matrix A, initialization with a zero matrix - void resize(const unsigned int nrows, const unsigned int ncols, - const bool nullify = true); - - double getMinValue() const; - - double getMaxValue() const; //@} - + //--------------------------------- - // Printing + // Assignment //--------------------------------- - - friend VISP_EXPORT std::ostream &operator << (std::ostream &s,const vpMatrix &m); - /** @name Printing */ + /** @name Assignment operators */ //@{ - - int print(std::ostream& s, unsigned int length, char const* intro=0); - std::ostream & matlabPrint(std::ostream & os) const; - std::ostream & maplePrint(std::ostream & os) const; - std::ostream & csvPrint(std::ostream & os) const; - std::ostream & cppPrint(std::ostream & os, const char * matrixName = NULL, bool octet = false) const; - - void printSize() { std::cout << getRows() <<" x " << getCols() <<" " ; } + vpMatrix &operator<<(double*); + vpMatrix &operator=(const vpArray2D<double> &A); + vpMatrix &operator=(const double x); //@} - - //--------------------------------- - // Copy / assignment - //--------------------------------- - /** @name Copy / assignment */ + //------------------------------------------------- + // Stacking + //------------------------------------------------- + /** @name Stacking */ //@{ - //! Copy constructor - vpMatrix (const vpMatrix& m); + // Stack the matrix A below the current one, copy if not initialized this = [ this A ]^T + void stack(const vpMatrix &A); + void stack(const vpRowVector &r); + // Stacks columns of a matrix in a vector + void stackColumns(vpColVector &out ); - // Assignment from an array - vpMatrix &operator<<(double*); + // Stacks columns of a matrix in a vector + vpColVector stackColumns(); - //! Copy operator. Allow operation such as A = B - vpMatrix &operator=(const vpMatrix &B); - //! Copy operator. Allow operation such as A = H - vpMatrix &operator=(const vpHomography &H); - //! Set all the element of the matrix A to x - vpMatrix &operator=(const double x); - void diag(const vpColVector &A); + // Stacks columns of a matrix in a vector + void stackRows(vpRowVector &out ); + + // Stacks columns of a matrix in a vector + vpRowVector stackRows(); //@} //--------------------------------- - // Access/modification operators + // Matrix insertion with Static Public Member Functions //--------------------------------- - /** @name Access/modification operators */ + /** @name Matrix insertion */ //@{ - //! write elements Aij (usage : A[i][j] = x ) - inline double *operator[](unsigned int i) { return rowPtrs[i]; } - //! read elements Aij (usage : x = A[i][j] ) - inline double *operator[](unsigned int i) const {return rowPtrs[i];} - //@} - - //--------------------------------- - // Matrix operations (Static). - //--------------------------------- - - static void add2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C); - static void add2WeightedMatrices(const vpMatrix &A, const double &wA, const vpMatrix &B,const double &wB, vpMatrix &C); - static vpMatrix computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b); - static vpMatrix computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b, const vpMatrix &w); - static void computeHLM(const vpMatrix &H, const double &alpha, vpMatrix &HLM); - - // Create a diagonal matrix with the element of a vector DAii = Ai - static void createDiagonalMatrix(const vpColVector &A, vpMatrix &DA) ; // Insert matrix A in the current matrix at the given position (r, c). void insert(const vpMatrix&A, const unsigned int r, const unsigned int c); - // Insert matrix B in matrix A at the given position (r, c). - static vpMatrix insert(const vpMatrix &A,const vpMatrix &B, const unsigned int r, const unsigned int c) ; - // Insert matrix B in matrix A (not modified) at the given position (r, c), the result is given in matrix C. - static void insert(const vpMatrix &A, const vpMatrix &B, vpMatrix &C, const unsigned int r, const unsigned int c) ; - - // Juxtapose to matrices C = [ A B ] - static vpMatrix juxtaposeMatrices(const vpMatrix &A,const vpMatrix &B) ; - // Juxtapose to matrices C = [ A B ] - static void juxtaposeMatrices(const vpMatrix &A,const vpMatrix &B, vpMatrix &C) ; - // Compute Kronecker product matrix - static void kron(const vpMatrix &m1, const vpMatrix &m2 , vpMatrix &out); - - // Compute Kronecker product matrix - static vpMatrix kron(const vpMatrix &m1, const vpMatrix &m2 ); - - /*! - Load a matrix from a file. - - \param filename : absolute file name - \param M : matrix to be loaded - \param binary :If true the matrix is loaded from a binary file, else from a text file. - \param Header : Header of the file is loaded in this parameter - - \return Returns true if no problem appends. - */ - static inline bool loadMatrix(std::string filename, vpMatrix &M, - const bool binary = false, char *Header = NULL) - { - return vpMatrix::loadMatrix(filename.c_str(), M, binary, Header); - } - static bool loadMatrix(const char *filename, vpMatrix &M, const bool binary = false, char *Header = NULL); - static void mult2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C); - static void multMatrixVector(const vpMatrix &A, const vpColVector &b, vpColVector &c); - static void negateMatrix(const vpMatrix &A, vpMatrix &C); - /*! - Save a matrix to a file. - - \param filename : absolute file name - \param M : matrix to be saved - \param binary :If true the matrix is save in a binary file, else a text file. - \param Header : optional line that will be saved at the beginning of the file - - \return Returns true if no problem appends. - - Warning : If you save the matrix as in a text file the precision is less than if you save it in a binary file. - */ - static inline bool saveMatrix(std::string filename, const vpMatrix &M, - const bool binary = false, - const char *Header = "") - { - return vpMatrix::saveMatrix(filename.c_str(), M, binary, Header); - } - static bool saveMatrix(const char *filename, const vpMatrix &M, const bool binary = false, const char *Header = ""); - - /*! - Save a matrix in a YAML-formatted file. - - \param filename : absolute file name. - \param M : matrix to be saved in the file. - \param header : optional lines that will be saved at the beginning of the file. Should be YAML-formatted and will adapt to the indentation if any. - - \return Returns true if success. - - */ - static inline bool saveMatrixYAML(std::string filename, const vpMatrix &M, const char *header = "") - { - return vpMatrix::saveMatrixYAML(filename.c_str(), M, header); - } - static bool saveMatrixYAML(const char *filename, const vpMatrix &M, const char *header = ""); - /*! - Load a matrix from a YAML-formatted file. - - \param filename : absolute file name. - \param M : matrix to be loaded from the file. - \param header : Header of the file is loaded in this parameter. - - \return Returns true if no problem appends. - */ - static inline bool loadMatrixYAML(std::string filename, vpMatrix &M, char *header = NULL) - { - return vpMatrix::loadMatrixYAML(filename.c_str(), M, header); - } - static bool loadMatrixYAML(const char *filename, vpMatrix &M, char *header = NULL); - + //@} - // Stack the matrix A below the current one, copy if not initialized this = [ this A ]^T - void stackMatrices(const vpMatrix &A); - //! Stack two Matrices C = [ A B ]^T - static vpMatrix stackMatrices(const vpMatrix &A,const vpMatrix &B) ; - //! Stack two Matrices C = [ A B ]^T - static void stackMatrices(const vpMatrix &A,const vpMatrix &B, vpMatrix &C) ; - static void sub2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C); - + //------------------------------------------------- + // Columns, Rows extraction, SubMatrix + //------------------------------------------------- + /** @name Columns, rows, sub-matrices extraction */ + //@{ + vpRowVector getRow(const unsigned int i) const; + vpRowVector getRow(const unsigned int i, const unsigned int j_begin, const unsigned int size) const; + vpColVector getCol(const unsigned int j) const; + vpColVector getCol(const unsigned int j, const unsigned int i_begin, const unsigned int size) const; + void init(const vpMatrix &M, unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols); + //@} //--------------------------------- // Matrix operations. @@ -339,24 +231,17 @@ protected: vpMatrix &operator+=(const vpMatrix &B); // operation A = A - B vpMatrix &operator-=(const vpMatrix &B); - vpMatrix operator*(const vpMatrix &B) const; - vpMatrix operator*(const vpHomography &H) const; + vpMatrix operator*(const vpRotationMatrix &R) const; + vpMatrix operator*(const vpVelocityTwistMatrix &V) const; + vpMatrix operator*(const vpForceTwistMatrix &V) const; + // operation t_out = A * t (A is unchanged, t and t_out are translation vectors) + vpTranslationVector operator*(const vpTranslationVector &tv) const; + vpColVector operator*(const vpColVector &v) const; vpMatrix operator+(const vpMatrix &B) const; vpMatrix operator-(const vpMatrix &B) const; vpMatrix operator-() const; - //--------------------------------- - // Matrix/vector operations. - //--------------------------------- - - vpColVector operator*(const vpColVector &b) const; - // operation c = A * b (A is unchanged, c and b are translation vectors) - vpTranslationVector operator*(const vpTranslationVector &b) const; - //--------------------------------- - // Matrix/real operations. - //--------------------------------- - //! Add x to all the element of the matrix : Aij = Aij + x vpMatrix &operator+=(const double x); //! Substract x to all the element of the matrix : Aij = Aij - x @@ -377,35 +262,29 @@ protected: \return \f$\sum a_{ij}\f$ */ double sum() const; - /*! - Return the sum square of all the \f$a_{ij}\f$ elements of the matrix. - - \return \f$\sum a_{ij}^{2}\f$ - */ double sumSquare() const; - // return the determinant of the matrix. double det(vpDetMethod method = LU_DECOMPOSITION) const; //Compute the exponential matrix of a square matrix - vpMatrix expm(); + vpMatrix expm() const; //------------------------------------------------- - // Columns, Rows extraction, SubMatrix + // Kronecker product //------------------------------------------------- - /** @name Columns, Rows extraction, Submatrix */ - //@{ - vpRowVector getRow(const unsigned int i) const; - vpRowVector getRow(const unsigned int i, const unsigned int j_begin, const unsigned int size) const; - vpColVector getCol(const unsigned int j) const; - vpColVector getCol(const unsigned int j, const unsigned int i_begin, const unsigned int size) const; - void init(const vpMatrix &M, unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols); + /** @name Kronecker product */ + //@{ + // Compute Kronecker product matrix + void kron(const vpMatrix &m1, vpMatrix &out) const; + + // Compute Kronecker product matrix + vpMatrix kron(const vpMatrix &m1) const; //@} - + //------------------------------------------------- - // transpose + // Transpose //------------------------------------------------- - /** @name Transpose, Identity */ + /** @name Transpose */ //@{ // Compute the transpose C = A^T vpMatrix t() const; @@ -413,40 +292,14 @@ protected: // Compute the transpose C = A^T vpMatrix transpose()const; void transpose(vpMatrix & C )const; - + vpMatrix AAt() const; void AAt(vpMatrix &B) const; - + vpMatrix AtA() const; void AtA(vpMatrix &B) const; //@} - - //------------------------------------------------- - // Kronecker product - //------------------------------------------------- - /** @name Kronecker product */ - //@{ - - // Stacks columns of a matrix in a vector - void stackColumns(vpColVector &out ); - - // Stacks columns of a matrix in a vector - vpColVector stackColumns(); - - // Stacks columns of a matrix in a vector - void stackRows(vpRowVector &out ); - - // Stacks columns of a matrix in a vector - vpRowVector stackRows(); - - // Compute Kronecker product matrix - void kron(const vpMatrix &m1 , vpMatrix &out); - - // Compute Kronecker product matrix - vpMatrix kron(const vpMatrix &m1); - //@} - //------------------------------------------------- // Matrix inversion //------------------------------------------------- @@ -461,7 +314,7 @@ protected: #endif // doxygen should skip this // inverse matrix A using the LU decomposition vpMatrix inverseByLU() const; -#if defined(VISP_HAVE_LAPACK) +#if defined(VISP_HAVE_LAPACK_C) // inverse matrix A using the Cholesky decomposition (only for real symmetric matrices) vpMatrix inverseByCholesky() const; //lapack implementation of inverse by Cholesky @@ -507,7 +360,7 @@ protected: #if (VISP_HAVE_OPENCV_VERSION >= 0x020101) // Require opencv >= 2.1.1 void svdOpenCV(vpColVector& w, vpMatrix& v); #endif -#ifdef VISP_HAVE_LAPACK +#ifdef VISP_HAVE_LAPACK_C void svdLapack(vpColVector& W, vpMatrix& V); #endif //! solve AX=B using the SVD decomposition @@ -527,66 +380,254 @@ protected: // solve Ax=B using the SVD decomposition (usage x=A.solveBySVD(B)) vpColVector solveBySVD(const vpColVector &B) const ; - unsigned int kernel(vpMatrix &KerA, double svThreshold=1e-6); - double cond(); + unsigned int kernel(vpMatrix &KerA, double svThreshold=1e-6) const; + double cond() const; //@} //------------------------------------------------- // Eigen values and vectors //------------------------------------------------- - /** @name Eigen values */ //@{ // compute the eigen values using the Gnu Scientific library - vpColVector eigenValues(); - void eigenValues(vpColVector &evalue, vpMatrix &evector); + vpColVector eigenValues() const; + void eigenValues(vpColVector &evalue, vpMatrix &evector) const; //@} - // ------------------------- + //------------------------------------------------- // Norms - // ------------------------- + //------------------------------------------------- /** @name Norms */ //@{ - // Euclidean norm ||x||=sqrt(sum(x_i^2)) - double euclideanNorm () const; - // Infinity norm ||x||=max(sum(fabs(x_i))) - double infinityNorm () const; + double euclideanNorm() const; + double infinityNorm() const; //@} -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS + //--------------------------------- + // Printing + //--------------------------------- + /** @name Printing */ + //@{ + int print(std::ostream& s, unsigned int length, char const* intro=0) const; + std::ostream & matlabPrint(std::ostream & os) const; + std::ostream & maplePrint(std::ostream & os) const; + std::ostream & csvPrint(std::ostream & os) const; + std::ostream & cppPrint(std::ostream & os, const char * matrixName = NULL, bool octet = false) const; + void printSize() const { std::cout << getRows() <<" x " << getCols() <<" " ; } + //@} + + //------------------------------------------------------------------ + // Static functionalities + //------------------------------------------------------------------ + + //--------------------------------- + // Setting a diagonal matrix with Static Public Member Functions + //--------------------------------- + /** @name Setting a diagonal matrix with Static Public Member Functions */ + //@{ + // Create a diagonal matrix with the element of a vector DAii = Ai + static void createDiagonalMatrix(const vpColVector &A, vpMatrix &DA) ; + //@} + + //--------------------------------- + // Matrix insertion with Static Public Member Functions + //--------------------------------- + /** @name Matrix insertion with Static Public Member Functions */ + //@{ + // Insert matrix B in matrix A at the given position (r, c). + static vpMatrix insert(const vpMatrix &A,const vpMatrix &B, const unsigned int r, const unsigned int c) ; + // Insert matrix B in matrix A (not modified) at the given position (r, c), the result is given in matrix C. + static void insert(const vpMatrix &A, const vpMatrix &B, vpMatrix &C, const unsigned int r, const unsigned int c) ; + + //--------------------------------- + // Stacking with Static Public Member Functions + //--------------------------------- + /** @name Stacking with Static Public Member Functions */ + //@{ + // Juxtapose to matrices C = [ A B ] + static vpMatrix juxtaposeMatrices(const vpMatrix &A,const vpMatrix &B) ; + // Juxtapose to matrices C = [ A B ] + static void juxtaposeMatrices(const vpMatrix &A,const vpMatrix &B, vpMatrix &C) ; + // Stack two matrices C = [ A B ]^T + static vpMatrix stack(const vpMatrix &A, const vpMatrix &B) ; + static vpMatrix stack(const vpMatrix &A, const vpRowVector &r) ; + + // Stack two matrices C = [ A B ]^T + static void stack(const vpMatrix &A, const vpMatrix &B, vpMatrix &C); + static void stack(const vpMatrix &A, const vpRowVector &r, vpMatrix &C); + //@} + + //--------------------------------- + // Matrix operations Static Public Member Functions + //--------------------------------- + /** @name Matrix operations with Static Public Member Functions */ + //@{ + static void add2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C); + static void add2Matrices(const vpColVector &A, const vpColVector &B, vpColVector &C); + static void add2WeightedMatrices(const vpMatrix &A, const double &wA, const vpMatrix &B,const double &wB, vpMatrix &C); + static void computeHLM(const vpMatrix &H, const double &alpha, vpMatrix &HLM); + static void mult2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C); + static void mult2Matrices(const vpMatrix &A, const vpMatrix &B, vpRotationMatrix &C); + static void mult2Matrices(const vpMatrix &A, const vpMatrix &B, vpHomogeneousMatrix &C); + static void mult2Matrices(const vpMatrix &A, const vpColVector &B, vpColVector &C); + static void multMatrixVector(const vpMatrix &A, const vpColVector &v, vpColVector &w); + static void negateMatrix(const vpMatrix &A, vpMatrix &C); + static void sub2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C); + static void sub2Matrices(const vpColVector &A, const vpColVector &B, vpColVector &C); + //@} + + //--------------------------------- + // Kronecker product Static Public Member Functions + //--------------------------------- + /** @name Kronecker product with Static Public Member Functions */ + //@{ + // Compute Kronecker product matrix + static void kron(const vpMatrix &m1, const vpMatrix &m2 , vpMatrix &out); + + // Compute Kronecker product matrix + static vpMatrix kron(const vpMatrix &m1, const vpMatrix &m2 ); + //@} + + //--------------------------------- + // Covariance computation Static Public Member Functions + //--------------------------------- + /** @name Covariance computation with Static Public Member Functions */ + //@{ + static vpMatrix computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b); + static vpMatrix computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b, const vpMatrix &w); + static vpMatrix computeCovarianceMatrixVVS(const vpHomogeneousMatrix &cMo, const vpColVector &deltaS, const vpMatrix &Ls, const vpMatrix &W); + static vpMatrix computeCovarianceMatrixVVS(const vpHomogeneousMatrix &cMo, const vpColVector &deltaS, const vpMatrix &Ls); + //@} + + //--------------------------------- + // Matrix I/O Static Public Member Functions + //--------------------------------- + /** @name Matrix I/O with Static Public Member Functions */ + //@{ /*! - @name Deprecated functions + Load a matrix from a file. This function overloads vpArray2D::load(). + + \param filename : absolute file name. + \param M : matrix to be loaded. + \param binary :If true the matrix is loaded from a binary file, else from a text file. + \param header : Header of the file is loaded in this parameter + + \return Returns true if no problem appends. */ - vp_deprecated vpRowVector row(const unsigned int i); - vp_deprecated vpColVector column(const unsigned int j); -#endif + static inline bool loadMatrix(const std::string &filename, vpArray2D<double> &M, + const bool binary = false, char *header = NULL) + { + return vpArray2D<double>::load(filename, M, binary, header); + } - private: - double detByLU() const; + /*! + Load a matrix from a YAML-formatted file. This function overloads vpArray2D::loadYAML(). -}; + \param filename : absolute file name. + \param M : matrix to be loaded from the file. + \param header : Header of the file is loaded in this parameter. + + \return Returns true if no problem appends. + */ + static inline bool loadMatrixYAML(const std::string &filename, vpArray2D<double> &M, char *header = NULL) + { + return vpArray2D<double>::loadYAML(filename, M, header); + } + /*! + Save a matrix to a file. This function overloads vpArray2D::load(). -////////////////////////////////////////////////////////////////////////// + \param filename : absolute file name. + \param M : matrix to be saved. + \param binary : If true the matrix is save in a binary file, else a text file. + \param header : optional line that will be saved at the beginning of the file. + \return Returns true if no problem appends. -////////////////////////////////////////////////////////////////////////// + Warning : If you save the matrix as in a text file the precision is less than if you save it in a binary file. + */ + static inline bool saveMatrix(const std::string &filename, const vpArray2D<double> &M, + const bool binary = false, + const char *header = "") + { + return vpArray2D<double>::save(filename, M, binary, header); + } + /*! + Save a matrix in a YAML-formatted file. This function overloads vpArray2D::saveYAML(). -//! multiplication by a scalar C = x*A -VISP_EXPORT vpMatrix operator*(const double &x, const vpMatrix &A) ; + \param filename : absolute file name. + \param M : matrix to be saved in the file. + \param header : optional lines that will be saved at the beginning of the file. Should be YAML-formatted and will adapt to the indentation if any. - //! multiplication by a scalar C = x*A -VISP_EXPORT vpColVector operator*(const double &x, const vpColVector &A) ; + \return Returns true if success. + + */ + static inline bool saveMatrixYAML(const std::string &filename, const vpArray2D<double> &M, const char *header = "") + { + return vpArray2D<double>::saveYAML(filename, M, header); + } + //@} +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + /*! + @name Deprecated functions + */ + //@{ + /*! + \deprecated Only provided for compatibilty with ViSP previous releases. This function does nothing. + */ + vp_deprecated void init() { }; + /*! + \deprecated You should rather use stack(const vpMatrix &A) + */ + vp_deprecated void stackMatrices(const vpMatrix &A) { stack(A); }; + /*! + \deprecated You should rather use stack(const vpMatrix &A, const vpMatrix &B) + */ + vp_deprecated static vpMatrix stackMatrices(const vpMatrix &A, const vpMatrix &B) { return vpMatrix::stack(A, B); }; + /*! + \deprecated You should rather use stack(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) + */ + vp_deprecated static void stackMatrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) { vpMatrix::stack(A, B, C); }; + /*! + \deprecated You should rather use stack(const vpMatrix &A, const vpMatrix &B) + */ + vp_deprecated static vpMatrix stackMatrices(const vpMatrix &A, const vpRowVector &B); + /*! + \deprecated You should rather use stack(const vpMatrix &A, const vpRowVector &B, vpMatrix &C) + */ + vp_deprecated static void stackMatrices(const vpMatrix &A, const vpRowVector &B, vpMatrix &C); + /*! + \deprecated You should rather use vpColVector::stack(const vpColVector &A, const vpColVector &B) + */ + vp_deprecated static vpMatrix stackMatrices(const vpColVector &A, const vpColVector &B); + /*! + \deprecated You should rather use vpColVector::stack(const vpColVector &A, const vpColVector &B, vpColVector &C) + */ + vp_deprecated static void stackMatrices(const vpColVector &A, const vpColVector &B, vpColVector &C); + /*! + \deprecated You should rather use diag(const double &) + */ + vp_deprecated void setIdentity(const double & val=1.0) ; + //@} #endif + private: + double detByLU() const; + static void computeCovarianceMatrixVVS(const vpHomogeneousMatrix &cMo, const vpColVector &deltaS, const vpMatrix &Ls, vpMatrix &Js, vpColVector &deltaP); + +}; + + +////////////////////////////////////////////////////////////////////////// -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +#ifndef DOXYGEN_SHOULD_SKIP_THIS +VISP_EXPORT +#endif +vpMatrix operator*(const double &x, const vpMatrix &A) ; + +#endif diff --git a/src/math/matrix/vpMatrixException.h b/modules/core/include/visp3/core/vpMatrixException.h similarity index 86% rename from src/math/matrix/vpMatrixException.h rename to modules/core/include/visp3/core/vpMatrixException.h index 2d23f349c90cb545d4fc5b53918835c99f66ae02..91698e7e07ad59e92d82ab2912d413e3522fb454 100644 --- a/src/math/matrix/vpMatrixException.h +++ b/modules/core/include/visp3/core/vpMatrixException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMatrixException.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exceptions that can be emited by the vpMatrix class and its derivates. * @@ -51,8 +47,8 @@ /* Classes standards. */ // -#include <visp/vpConfig.h> -#include <visp/vpException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> #include <iostream> /* Classe std::ostream. */ #include <string> /* Classe string. */ @@ -63,7 +59,7 @@ /*! \class vpMatrixException - \ingroup Exception + \ingroup group_core_debug \brief error that can be emited by the vpMatrix class and its derivates */ class VISP_EXPORT vpMatrixException : public vpException diff --git a/src/camera/vpMeterPixelConversion.h b/modules/core/include/visp3/core/vpMeterPixelConversion.h similarity index 92% rename from src/camera/vpMeterPixelConversion.h rename to modules/core/include/visp3/core/vpMeterPixelConversion.h index 405f7c0e27c648103f9da9c2d20f5bc638b9dbe3..7b51e2ad585efb399e1f49f65590f6a6de62c1ee 100644 --- a/src/camera/vpMeterPixelConversion.h +++ b/modules/core/include/visp3/core/vpMeterPixelConversion.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMeterPixelConversion.h 4726 2014-04-23 11:58:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Meter to pixel conversion. * @@ -51,16 +47,16 @@ */ -#include <visp/vpCameraParameters.h> -#include <visp/vpCircle.h> -#include <visp/vpException.h> -#include <visp/vpImagePoint.h> -#include <visp/vpMath.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpCircle.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpMath.h> /*! \class vpMeterPixelConversion - \ingroup CameraModelTransformation CameraModel + \ingroup group_core_camera \brief Conversion from normalized coordinates \f$(x,y)\f$ in meter to pixel coordinates \f$(u,v)\f$. diff --git a/src/tracking/moments/vpMoment.h b/modules/core/include/visp3/core/vpMoment.h similarity index 64% rename from src/tracking/moments/vpMoment.h rename to modules/core/include/visp3/core/vpMoment.h index 60bcf6e0f23c2a6f10545af5c1dfb5c7e2bc6548..00243a033aaa985ab274bfae70d6146def7be27d 100644 --- a/src/tracking/moments/vpMoment.h +++ b/modules/core/include/visp3/core/vpMoment.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMoment.h 4708 2014-03-28 17:36:46Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Base for 2D moment descriptor * @@ -47,11 +43,13 @@ #ifndef __MOMENT_H__ #define __MOMENT_H__ -#include <visp/vpConfig.h> - #include <vector> #include <iostream> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> + + class vpMomentDatabase; class vpMomentObject; @@ -59,7 +57,7 @@ class vpMomentObject; /*! \class vpMoment - \ingroup TrackingMoments + \ingroup group_core_moments \brief This class defines shared methods/attributes for 2D moments. @@ -105,36 +103,54 @@ class vpMomentObject; - vpMomentGravityCenterNormalized */ -class VISP_EXPORT vpMoment{ - private: - vpMomentObject* object; - vpMomentDatabase* moments; - char _name[255]; - protected: - std::vector<double> values; - /*! - Returns the linked moment database. - \return the moment database - */ - inline vpMomentDatabase& getMoments() const { return *moments; } - public: - inline const vpMomentObject& getObject() const { return *object;} - vpMoment(); - /*! - Returns all values computed by the moment. - \return vector of values - */ - const std::vector<double>& get() const { return values;} - void linkTo(vpMomentDatabase& moments); - void update(vpMomentObject& object); - virtual void compute()=0; - virtual const char* name() const = 0; - friend VISP_EXPORT std::ostream & operator<<(std::ostream & os, const vpMoment& m); - virtual void printDependencies(std::ostream& os) const; - - /*! - Virtual destructor. - */ - virtual ~vpMoment() {} +class VISP_EXPORT vpMoment +{ +private: + vpMomentObject* object; + vpMomentDatabase* moments; + char _name[255]; + +protected: + std::vector<double> values; + /*! + Returns the linked moment database. + \return the moment database + */ + inline vpMomentDatabase& getMoments() const { return *moments; } + +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpMoment(const vpMoment &) +// : object(NULL), moments(NULL), values() +// { +// throw vpException(vpException::functionNotImplementedError,"Not implemented!"); +// } +// vpMoment &operator=(const vpMoment &){ +// throw vpException(vpException::functionNotImplementedError,"Not implemented!"); +// return *this; +// } +//#endif + +public: + vpMoment(); + + /*! + Virtual destructor. + */ + virtual ~vpMoment() {} + + virtual void compute()=0; + inline const vpMomentObject& getObject() const { return *object;} + /*! + Returns all values computed by the moment. + \return vector of values + */ + const std::vector<double>& get() const { return values;} + void linkTo(vpMomentDatabase& moments); + virtual const char* name() const = 0; + friend VISP_EXPORT std::ostream & operator<<(std::ostream & os, const vpMoment& m); + virtual void printDependencies(std::ostream& os) const; + void update(vpMomentObject& object); + }; #endif diff --git a/src/tracking/moments/vpMomentAlpha.h b/modules/core/include/visp3/core/vpMomentAlpha.h similarity index 92% rename from src/tracking/moments/vpMomentAlpha.h rename to modules/core/include/visp3/core/vpMomentAlpha.h index 4fcf3562a1b167c6294cfa9f0b20d53c89bcef10..edf0dd2f1fd803a874bb17d669d6044744a17e73 100644 --- a/src/tracking/moments/vpMomentAlpha.h +++ b/modules/core/include/visp3/core/vpMomentAlpha.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentAlpha.h 4713 2014-03-28 18:02:26Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Alpha moment descriptor for in-plane orientation. * @@ -47,12 +43,12 @@ #ifndef __MOMENTALPHA_H__ #define __MOMENTALPHA_H__ -#include <visp/vpMoment.h> +#include <visp3/core/vpMoment.h> /*! \class vpMomentAlpha - \ingroup TrackingMoments + \ingroup group_core_moments \brief This class defines the orientation of the object inside the plane parallel to the object. @@ -75,12 +71,12 @@ Therefore the first and second alpha should have opposite values. \code -#include <visp/vpMomentObject.h> -#include <visp/vpPoint.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentDatabase.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentAlpha.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentAlpha.h> #include <iostream> #include <vector> #include <algorithm> diff --git a/src/tracking/moments/vpMomentArea.h b/modules/core/include/visp3/core/vpMomentArea.h similarity index 80% rename from src/tracking/moments/vpMomentArea.h rename to modules/core/include/visp3/core/vpMomentArea.h index 70500c41914670ed8cd30f84321e0f09fb406002..2c8a22b25381d1d243345695bcaea6239331d536 100644 --- a/src/tracking/moments/vpMomentArea.h +++ b/modules/core/include/visp3/core/vpMomentArea.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentArea.h 3530 2012-01-03 10:52:12Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Just the area m00 = mu00 * @@ -41,7 +37,7 @@ #ifndef __MOMENTAREA_H__ #define __MOMENTAREA_H__ -#include <visp/vpMoment.h> +#include <visp3/core/vpMoment.h> class vpMomentObject; class vpMomentCentered; // Required for discrete case of vpMomentObject @@ -49,7 +45,7 @@ class vpMomentCentered; // Required for discrete case of vpMomentObject /*! \class vpMomentArea - \ingroup TrackingMoments + \ingroup group_core_moments \brief Class handling the surface moment. diff --git a/src/tracking/moments/vpMomentAreaNormalized.h b/modules/core/include/visp3/core/vpMomentAreaNormalized.h similarity index 89% rename from src/tracking/moments/vpMomentAreaNormalized.h rename to modules/core/include/visp3/core/vpMomentAreaNormalized.h index 5c5e1c42711a1e0df3131c4f3b2ced039f2f6b75..146e4c3eec8241dc478db289f7c38c42b2ea7ca1 100644 --- a/src/tracking/moments/vpMomentAreaNormalized.h +++ b/modules/core/include/visp3/core/vpMomentAreaNormalized.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentAreaNormalized.h 4713 2014-03-28 18:02:26Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D normalized surface moment descriptor (usually described as An) * @@ -45,7 +41,7 @@ #ifndef __MOMENTSURFACENORMALIZED_H__ #define __MOMENTSURFACENORMALIZED_H__ -#include <visp/vpMoment.h> +#include <visp3/core/vpMoment.h> class vpMomentObject; class vpMomentCentered; @@ -53,7 +49,7 @@ class vpMomentCentered; /*! \class vpMomentAreaNormalized - \ingroup TrackingMoments + \ingroup group_core_moments \brief Class handling the normalized surface moment that is invariant in scale and used to estimate depth. @@ -75,12 +71,12 @@ class vpMomentCentered; This example shows a computation in the discrete case. \code -#include <visp/vpMomentObject.h> -#include <visp/vpPoint.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentDatabase.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentAreaNormalized.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentAreaNormalized.h> int main() { diff --git a/src/tracking/moments/vpMomentBasic.h b/modules/core/include/visp3/core/vpMomentBasic.h similarity index 86% rename from src/tracking/moments/vpMomentBasic.h rename to modules/core/include/visp3/core/vpMomentBasic.h index 8dde8610ae622b45dae6cf1c9ad1c0d8889824a0..c433e0635229d298b12ba2b11a02f4943618168b 100644 --- a/src/tracking/moments/vpMomentBasic.h +++ b/modules/core/include/visp3/core/vpMomentBasic.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentBasic.h 4710 2014-03-28 17:39:33Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Basic moment descriptor * @@ -47,12 +43,12 @@ #ifndef __MOMENTBASIC_H__ #define __MOMENTBASIC_H__ -#include <visp/vpMoment.h> +#include <visp3/core/vpMoment.h> /*! \class vpMomentBasic - \ingroup TrackingMoments + \ingroup group_core_moments \brief This class defines the 2D basic moment \f$m_{ij}\f$. This class is a wrapper for vpMomentObject wich allows to use it as a moment. diff --git a/src/tracking/moments/vpMomentCInvariant.h b/modules/core/include/visp3/core/vpMomentCInvariant.h similarity index 93% rename from src/tracking/moments/vpMomentCInvariant.h rename to modules/core/include/visp3/core/vpMomentCInvariant.h index c4652af9e3f9fcbdfde38d4a46d475a6877aeb0d..6a887a5147aa881b2bf3626076a73ecd2b7e66a9 100644 --- a/src/tracking/moments/vpMomentCInvariant.h +++ b/modules/core/include/visp3/core/vpMomentCInvariant.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentCInvariant.h 5303 2015-02-10 17:01:28Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Descriptor for various invariants used to drive space roations around X and Y axis. * @@ -45,8 +41,8 @@ #ifndef __MOMENTCINVARIANT_H__ #define __MOMENTCINVARIANT_H__ -#include <visp/vpMoment.h> -#include <visp/vpMomentDatabase.h> +#include <visp3/core/vpMoment.h> +#include <visp3/core/vpMomentDatabase.h> class vpMomentCentered; class vpMomentBasic; @@ -54,7 +50,7 @@ class vpMomentBasic; /*! \class vpMomentCInvariant - \ingroup TrackingMoments + \ingroup group_core_moments This class defines several 2D (translation+rotation+scale) invariants for both symmetric and non-symmetric objects. These moment-based invariants are described in the following papers \cite Chaumette04a, \cite Tahri05z. @@ -72,10 +68,10 @@ class vpMomentBasic; The example below shows how to retrieve the \f$C_2\f$ invariant: \code -#include <visp/vpMomentObject.h> -#include <visp/vpPoint.h> -#include <visp/vpMomentCInvariant.h> -#include <visp/vpMomentCommon.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMomentCInvariant.h> +#include <visp3/core/vpMomentCommon.h> #include <iostream> int main() diff --git a/src/tracking/moments/vpMomentCentered.h b/modules/core/include/visp3/core/vpMomentCentered.h similarity index 90% rename from src/tracking/moments/vpMomentCentered.h rename to modules/core/include/visp3/core/vpMomentCentered.h index 0d00fb59b55ec9d4d709121f62ae6cce89214644..8fcd14ff788ec99205a64ac811eaf64fbc182954 100644 --- a/src/tracking/moments/vpMomentCentered.h +++ b/modules/core/include/visp3/core/vpMomentCentered.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentCentered.h 4712 2014-03-28 17:55:43Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Centered moment descriptor * @@ -42,7 +38,7 @@ #ifndef __MOMENTCENTERED_H__ #define __MOMENTCENTERED_H__ -#include <visp/vpMoment.h> +#include <visp3/core/vpMoment.h> /*! \file vpMomentCentered.h \brief Centered moment descriptor (also refered to as \f$\mu_{ij}\f$). @@ -54,7 +50,7 @@ class vpMomentObject; /*! \class vpMomentCentered - \ingroup TrackingMoments + \ingroup group_core_moments \brief This class defines the double-indexed centered moment descriptor \f$\mu_{ij}\f$. diff --git a/src/tracking/moments/vpMomentCommon.h b/modules/core/include/visp3/core/vpMomentCommon.h similarity index 60% rename from src/tracking/moments/vpMomentCommon.h rename to modules/core/include/visp3/core/vpMomentCommon.h index beb17c3bd6aa76b5d74d9163ccf561b746bfb615..dbd5f03224fb5ce7512c10472db8cbcece31e939 100644 --- a/src/tracking/moments/vpMomentCommon.h +++ b/modules/core/include/visp3/core/vpMomentCommon.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentCommon.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pre-filled moment database with all commonly used moments. * @@ -45,15 +41,15 @@ #ifndef VPCOMMONMOMENTS_H #define VPCOMMONMOMENTS_H -#include <visp/vpMomentDatabase.h> -#include <visp/vpMomentBasic.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentGravityCenterNormalized.h> -#include <visp/vpMomentAreaNormalized.h> -#include <visp/vpMomentCInvariant.h> -#include <visp/vpMomentAlpha.h> -#include <visp/vpMomentArea.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpMomentBasic.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentGravityCenterNormalized.h> +#include <visp3/core/vpMomentAreaNormalized.h> +#include <visp3/core/vpMomentCInvariant.h> +#include <visp3/core/vpMomentAlpha.h> +#include <visp3/core/vpMomentArea.h> #include <vector> @@ -62,7 +58,7 @@ class vpMomentObject; /*! \class vpMomentCommon - \ingroup TrackingMoments + \ingroup group_core_moments \brief This class initializes and allows access to commonly used moments. @@ -95,24 +91,40 @@ class vpMomentObject; \attention Make sure your object is at least of order 5 when using this pre-filled database. */ -class VISP_EXPORT vpMomentCommon : public vpMomentDatabase{ +class VISP_EXPORT vpMomentCommon : public vpMomentDatabase +{ private: - vpMomentBasic momentBasic; - vpMomentGravityCenter momentGravity; - vpMomentCentered momentCentered; - vpMomentGravityCenterNormalized momentGravityNormalized; - vpMomentAreaNormalized momentSurfaceNormalized; - vpMomentCInvariant* momentCInvariant; - vpMomentAlpha momentAlpha; - vpMomentArea momentArea; + vpMomentBasic momentBasic; + vpMomentGravityCenter momentGravity; + vpMomentCentered momentCentered; + vpMomentGravityCenterNormalized momentGravityNormalized; + vpMomentAreaNormalized momentSurfaceNormalized; + vpMomentCInvariant* momentCInvariant; + vpMomentAlpha momentAlpha; + vpMomentArea momentArea; + +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpMomentCommon(const vpMomentCommon &) +// : vpMomentDatabase(), momentBasic(), momentGravity(), momentCentered(), momentGravityNormalized(), +// momentSurfaceNormalized(0, 0), momentCInvariant(), momentAlpha(), momentArea() +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpMomentCommon &operator=(const vpMomentCommon &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: - vpMomentCommon(double dstSurface,std::vector<double> ref,double refAlpha,double dstZ=1.0, bool flg_sxsyfromnormalized=false); + vpMomentCommon(double dstSurface,std::vector<double> ref,double refAlpha,double dstZ=1.0, bool flg_sxsyfromnormalized=false); - static double getAlpha(vpMomentObject& object); - static std::vector<double> getMu3(vpMomentObject& object); - static double getSurface(vpMomentObject& object); + static double getAlpha(vpMomentObject& object); + static std::vector<double> getMu3(vpMomentObject& object); + static double getSurface(vpMomentObject& object); - void updateAll(vpMomentObject& object); - ~vpMomentCommon(); + void updateAll(vpMomentObject& object); + ~vpMomentCommon(); }; #endif // VPCOMMONMOMENTS_H diff --git a/src/tracking/moments/vpMomentDatabase.h b/modules/core/include/visp3/core/vpMomentDatabase.h similarity index 89% rename from src/tracking/moments/vpMomentDatabase.h rename to modules/core/include/visp3/core/vpMomentDatabase.h index 733574c777fcdbc343f07969b07b61622af66747..f85eb30c4c3966f3f1c2ba281126b4fcd4ad730b 100644 --- a/src/tracking/moments/vpMomentDatabase.h +++ b/modules/core/include/visp3/core/vpMomentDatabase.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentDatabase.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pseudo-database used to handle dependencies between moments * @@ -45,7 +41,7 @@ #ifndef __MOMENTDATABASE_H__ #define __MOMENTDATABASE_H__ -#include <visp/vpImage.h> +#include <visp3/core/vpImage.h> #include <map> #include <iostream> @@ -57,7 +53,7 @@ class vpMomentObject; /*! \class vpMomentDatabase - \ingroup TrackingMoments + \ingroup group_core_moments \brief This class allows to register all vpMoments so they can access each other according to their dependencies. @@ -68,11 +64,11 @@ class vpMomentObject; All moments in a database can access each other freely at any time. They can also verify if a moment is present in the database or not. Here is a example of a dependency between two moments using a vpMomentDatabase: \code -#include <visp/vpMomentObject.h> -#include <visp/vpPoint.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentDatabase.h> -#include <visp/vpMomentCentered.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpMomentCentered.h> #include <iostream> int main() diff --git a/src/tracking/moments/vpMomentGravityCenter.h b/modules/core/include/visp3/core/vpMomentGravityCenter.h similarity index 88% rename from src/tracking/moments/vpMomentGravityCenter.h rename to modules/core/include/visp3/core/vpMomentGravityCenter.h index 8efe3c31062ac7339f2595120922ccf3c205fcb4..857d1c88b505fe325d4a329c8e66029b69c1294a 100644 --- a/src/tracking/moments/vpMomentGravityCenter.h +++ b/modules/core/include/visp3/core/vpMomentGravityCenter.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentGravityCenter.h 4713 2014-03-28 18:02:26Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D Gravity Center moment descriptor (usually described by the pair Xg,Yg) * @@ -45,14 +41,14 @@ #ifndef __MOMENTGRAVITYCENTER_H__ #define __MOMENTGRAVITYCENTER_H__ -#include <visp/vpMoment.h> -#include <visp/vpMomentDatabase.h> +#include <visp3/core/vpMoment.h> +#include <visp3/core/vpMomentDatabase.h> class vpMomentObject; /*! \class vpMomentGravityCenter - \ingroup TrackingMoments + \ingroup group_core_moments \brief Class describing 2D gravity center moment. @@ -61,9 +57,9 @@ class vpMomentObject; These coordinates are defined as follows: \f$x_g = \frac{m_{01}}{m_{00}} \f$,\f$y_g = \frac{m_{10}}{m_{00}} \f$ \code -#include <visp/vpMomentObject.h> -#include <visp/vpPoint.h> -#include <visp/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMomentGravityCenter.h> #include <iostream> int main() diff --git a/src/tracking/moments/vpMomentGravityCenterNormalized.h b/modules/core/include/visp3/core/vpMomentGravityCenterNormalized.h similarity index 82% rename from src/tracking/moments/vpMomentGravityCenterNormalized.h rename to modules/core/include/visp3/core/vpMomentGravityCenterNormalized.h index b3a9caa7bd2772445fb5ac1c71abdd01cba494ec..67a02d060daba64f6f0aac934f6a814a5e1ec867 100644 --- a/src/tracking/moments/vpMomentGravityCenterNormalized.h +++ b/modules/core/include/visp3/core/vpMomentGravityCenterNormalized.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentGravityCenterNormalized.h 4713 2014-03-28 18:02:26Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D normalized gravity center moment descriptor (usually described by the pair Xn,Yn) * @@ -45,14 +41,14 @@ #ifndef __MOMENTGRAVITYNORMALIZED_H__ #define __MOMENTGRAVITYNORMALIZED_H__ -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentDatabase.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentDatabase.h> class vpMomentObject; /*! \class vpMomentGravityCenterNormalized - \ingroup TrackingMoments + \ingroup group_core_moments \brief Class describing 2D normalized gravity center moment. diff --git a/src/tracking/moments/vpMomentObject.h b/modules/core/include/visp3/core/vpMomentObject.h similarity index 91% rename from src/tracking/moments/vpMomentObject.h rename to modules/core/include/visp3/core/vpMomentObject.h index 7b11b82d4c11fdaedb64a3d967fcb360e7e4c8a4..14b8b726a6be9fd2cbc12871de839dec039b25c8 100644 --- a/src/tracking/moments/vpMomentObject.h +++ b/modules/core/include/visp3/core/vpMomentObject.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentObject.h 5300 2015-02-10 16:26:32Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Object input structure used by moments. * @@ -45,10 +41,10 @@ #ifndef __MOMENTOBJECT_H__ #define __MOMENTOBJECT_H__ -#include <visp/vpImage.h> -#include <visp/vpMoment.h> -#include <visp/vpPoint.h> -#include <visp/vpMath.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpMoment.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMath.h> #include <cstdlib> #include <utility> @@ -57,7 +53,7 @@ class vpCameraParameters; /*! \class vpMomentObject - \ingroup TrackingMoments + \ingroup group_core_moments \brief Class for generic objects. @@ -92,24 +88,19 @@ class vpCameraParameters; moments that are computed and how to compute other classical moments such as the gravity center or the centered moments. \code -#include <visp/vpMomentObject.h> -#include <visp/vpMomentCommon.h> -#include <visp/vpPoint.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentCommon.h> +#include <visp3/core/vpPoint.h> int main() { // Define an object as 4 clockwise points on a plane (Z=0) - vpPoint p; std::vector<vpPoint> vec_p; // vector that contains the 4 points - p.setWorldCoordinates(-0.2, 0.1, 0.0); // values in meters - vec_p.push_back(p); - p.setWorldCoordinates(+0.3, 0.1, 0.0); // values in meters - vec_p.push_back(p); - p.setWorldCoordinates(+0.2,-0.1, 0.0); // values in meters - vec_p.push_back(p); - p.setWorldCoordinates(-0.2,-0.15, 0.0); // values in meters - vec_p.push_back(p); + vec_p.push_back( vpPoint(-0.2, 0.1, 0.0) ); // values in meters + vec_p.push_back( vpPoint(+0.3, 0.1, 0.0) ); // values in meters + vec_p.push_back( vpPoint(+0.2,-0.1, 0.0) ); // values in meters + vec_p.push_back( vpPoint(-0.2,-0.15, 0.0) ); // values in meters // These points are observed by a camera vpHomogeneousMatrix cMo(0, 0, 1, 0, 0, 0); // We set the camera to be 1m far the object @@ -211,7 +202,8 @@ Centered moments (mu03, mu12, mu21, mu30): 0.003375 0.0045625 -0.00228125 -0.000 Note that in the continuous case, the moment object \f$m_{00}\f$ corresponds to the surface \f$a\f$ of the object. In the discrete case, it is the number of discrete points \f$n\f$. */ -class VISP_EXPORT vpMomentObject{ +class VISP_EXPORT vpMomentObject +{ public: /*! @@ -233,9 +225,6 @@ public: bool flg_normalize_intensity; // To scale the intensity of each individual pixel in the image by the maximum intensity value present in it - // Constructor helpers - void init(unsigned int orderinp); - void init(const vpMomentObject& objin); // Constructors vpMomentObject(unsigned int order); vpMomentObject(const vpMomentObject& srcobj); @@ -266,11 +255,10 @@ public: */ unsigned int getOrder() const {return order-1;} - /*! - Specifies the type of the input data. - \param input_type : An input type. - */ - void setType(vpObjectType input_type){this->type=input_type;} + // Constructor helpers + void init(unsigned int orderinp); + void init(const vpMomentObject& objin); + friend VISP_EXPORT std::ostream & operator<<(std::ostream & os, const vpMomentObject& v); /*! Outputs raw moments in indexed form like m[1,1] = value of moment m11 @@ -278,6 +266,12 @@ public: \param os : Output stream. */ static void printWithIndices(const vpMomentObject& momobj, std::ostream& os); + /*! + Specifies the type of the input data. + \param input_type : An input type. + */ + void setType(vpObjectType input_type){this->type=input_type;} + /*! Converts the raw moments contained in vpMomentObject to a vpMatrix \param momobj : A vpMomentObject @@ -290,6 +284,7 @@ protected: std::vector<double> values; void set(unsigned int i, unsigned int j, const double& value_ij); void cacheValues(std::vector<double>& cache,double x, double y); + private: void cacheValues(std::vector<double>& cache,double x, double y, double IntensityNormalized); double calc_mom_polygon(unsigned int p, unsigned int q, const std::vector<vpPoint>& points); diff --git a/src/device/display/vpMouseButton.h b/modules/core/include/visp3/core/vpMouseButton.h old mode 100755 new mode 100644 similarity index 78% rename from src/device/display/vpMouseButton.h rename to modules/core/include/visp3/core/vpMouseButton.h index b15e69fb6f23a3cf581c28f38fc9aff45aeb1917..650f0d1126d61f2e366dd5f7140d28b758ec2fe2 --- a/src/device/display/vpMouseButton.h +++ b/modules/core/include/visp3/core/vpMouseButton.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMouseButton.h 5232 2015-01-30 11:53:30Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Color definition. * @@ -43,11 +39,11 @@ #ifndef vpMouseButton_h #define vpMouseButton_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> /*! \class vpMouseButton - \ingroup ImageGUI + \ingroup group_gui_display \brief Class that defines mouse button identifiers. */ class VISP_EXPORT vpMouseButton diff --git a/src/tools/mutex/vpMutex.h b/modules/core/include/visp3/core/vpMutex.h similarity index 75% rename from src/tools/mutex/vpMutex.h rename to modules/core/include/visp3/core/vpMutex.h index c0bfd0f7b294350df7404018546a106f50034849..d6ad11212844b0afd57e31585f832d445a7b9b24 100644 --- a/src/tools/mutex/vpMutex.h +++ b/modules/core/include/visp3/core/vpMutex.h @@ -1,10 +1,7 @@ /**************************************************************************** - * - * $Id: vpMutex.h 5126 2015-01-05 22:07:11Z fspindle $ - * * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Mutex protection. * @@ -44,8 +39,8 @@ #ifndef __VP_MUTEX__ #define __VP_MUTEX__ -#include <visp/vpConfig.h> -#include <visp/vpException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> #ifdef VISP_HAVE_PTHREAD #include <pthread.h> @@ -54,7 +49,7 @@ \class vpMutex - \ingroup Mutex + \ingroup group_core_mutex \brief Class that allows protection by mutex. @@ -76,7 +71,7 @@ public: \class vpScopedLock - \ingroup Mutex + \ingroup group_core_mutex \brief Class that allows protection by mutex. @@ -86,14 +81,16 @@ public: { private: vpMutex & _mutex; - public: -#ifndef DOXYGEN_SHOULD_SKIP_THIS - void operator=(const vpScopedLock &){ - throw vpException(vpException::functionNotImplementedError,"Not implemented!"); - } -#endif +// private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpScopedLock &operator=(const vpScopedLock &){ +// throw vpException(vpException::functionNotImplementedError,"Not implemented!"); +// return *this; +// } +//#endif + public: vpScopedLock(vpMutex & mutex) : _mutex(mutex) { diff --git a/src/network/vpNetwork.h b/modules/core/include/visp3/core/vpNetwork.h similarity index 93% rename from src/network/vpNetwork.h rename to modules/core/include/visp3/core/vpNetwork.h index 4be624c6b6253687f149d50b64f7cc23ab0f7b30..eb19164f8a0ee2290a6c1eda4885365b355d8f5c 100644 --- a/src/network/vpNetwork.h +++ b/modules/core/include/visp3/core/vpNetwork.h @@ -1,499 +1,495 @@ -/**************************************************************************** - * - * $Id: vpNetwork.h 4632 2014-02-03 17:06:40Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * TCP Network - * - * Authors: - * Aurelien Yol - * - *****************************************************************************/ - -#ifndef vpNetwork_H -#define vpNetwork_H - -#include <visp/vpConfig.h> -#include <visp/vpRequest.h> - -#include <vector> -#include <stdio.h> -#include <string.h> -#include <iostream> - -#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX -# include <unistd.h> -# include <sys/socket.h> -# include <netinet/in.h> -# include <arpa/inet.h> -# include <netdb.h> -#else -# include<io.h> -//# include<winsock.h> -# include<winsock2.h> -//# pragma comment(lib, "ws2_32.lib") // Done by CMake in main CMakeLists.txt -#endif - - -/*! - \class vpNetwork - - \ingroup Network - - \brief This class represents a Transmission Control Protocol (TCP) network. - - TCP provides reliable, ordered delivery of a stream of bytes from a program - on one computer to another program on another computer. - - \warning This class shouldn't be used directly. You better use vpClient and - vpServer to simulate your network. Some exemples are provided in these classes. - - \sa vpServer - \sa vpNetwork -*/ -class VISP_EXPORT vpNetwork -{ -protected: - - struct vpReceptor{ -#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX - int socketFileDescriptorReceptor; - socklen_t receptorAddressSize; -#else - SOCKET socketFileDescriptorReceptor; - int receptorAddressSize; -#endif - struct sockaddr_in receptorAddress; - std::string receptorIP; - - vpReceptor() : socketFileDescriptorReceptor(0), receptorAddressSize(), receptorAddress(), receptorIP() {} - }; - - struct vpEmitter{ - struct sockaddr_in emitterAddress; -#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX - int socketFileDescriptorEmitter; -#else - SOCKET socketFileDescriptorEmitter; -#endif - vpEmitter() : emitterAddress(), socketFileDescriptorEmitter(0) - { - emitterAddress.sin_family = AF_INET; - emitterAddress.sin_addr.s_addr = INADDR_ANY; - emitterAddress.sin_port = 0; - socketFileDescriptorEmitter = 0; - } - }; - - //######## PARAMETERS ######## - //# # - //############################ - - vpEmitter emitter; - std::vector<vpReceptor> receptor_list; - fd_set readFileDescriptor; -#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX - int socketMax; -#else - SOCKET socketMax; -#endif - - //Message Handling - std::vector<vpRequest*> request_list; - - unsigned int max_size_message; - std::string separator; - std::string beginning; - std::string end; - std::string param_sep; - - std::string currentMessageReceived; - - struct timeval tv; - long tv_sec; - long tv_usec; - - bool verboseMode; - -private: - - std::vector<int> _handleRequests(); - int _handleFirstRequest(); - - void _receiveRequest(); - void _receiveRequestFrom(const unsigned int &receptorEmitting); - int _receiveRequestOnce(); - int _receiveRequestOnceFrom(const unsigned int &receptorEmitting); - -public: - - vpNetwork(); - virtual ~vpNetwork(); - - void addDecodingRequest(vpRequest *); - - int getReceptorIndex(const char *name); - - /*! - Get the Id of the request at the index ind. - - \param ind : Index of the request. - - \return Id of the request. - */ - std::string getRequestIdFromIndex(const int &ind){ - if(ind >= (int)request_list.size() || ind < 0) - return ""; - return request_list[(unsigned)ind]->getId(); - } - - /*! - Get the maximum size that the emitter can receive (in request mode). - - \sa vpNetwork::setMaxSizeReceivedMessage() - - \return Acutal max size value. - */ - unsigned int getMaxSizeReceivedMessage(){ return max_size_message; } - - void print(const char *id = ""); - - template<typename T> - int receive(T* object, const unsigned int &sizeOfObject = sizeof(T)); - template<typename T> - int receiveFrom(T* object, const unsigned int &receptorEmitting, const unsigned int &sizeOfObject = sizeof(T)); - - std::vector<int> receiveRequest(); - std::vector<int> receiveRequestFrom(const unsigned int &receptorEmitting); - int receiveRequestOnce(); - int receiveRequestOnceFrom(const unsigned int &receptorEmitting); - - std::vector<int> receiveAndDecodeRequest(); - std::vector<int> receiveAndDecodeRequestFrom(const unsigned int &receptorEmitting); - int receiveAndDecodeRequestOnce(); - int receiveAndDecodeRequestOnceFrom(const unsigned int &receptorEmitting); - - void removeDecodingRequest(const char *); - - template<typename T> - int send(T* object, const int unsigned &sizeOfObject = sizeof(T)); - template<typename T> - int sendTo(T* object, const unsigned int &dest, const unsigned int &sizeOfObject = sizeof(T)); - - int sendRequest(vpRequest &req); - int sendRequestTo(vpRequest &req, const unsigned int &dest); - - int sendAndEncodeRequest(vpRequest &req); - int sendAndEncodeRequestTo(vpRequest &req, const unsigned int &dest); - - /*! - Change the maximum size that the emitter can receive (in request mode). - - \sa vpNetwork::getMaxSizeReceivedMessage() - - \param s : new maximum size value. - */ - void setMaxSizeReceivedMessage(const unsigned int &s){ max_size_message = s;} - - /*! - Change the time the emitter spend to check if he receives a message from a receptor. - Initially this value is set to 10usec. - - \sa vpNetwork::setTimeoutUSec() - - \param sec : new value in second. - */ - void setTimeoutSec(const long &sec){ tv_sec = sec; } - - /*! - Change the time the emitter spend to check if he receives a message from a receptor. - Initially this value is set to 10usec. - - \sa vpNetwork::setTimeoutSec() - - \param usec : new value in micro second. - */ - void setTimeoutUSec(const long &usec){ tv_usec = usec; } - - /*! - Set the verbose mode. - - \param mode : Change the verbose mode. True to turn on, False to turn off. - */ - void setVerbose(const bool &mode){ verboseMode = mode; } -}; - -//######## Definition of Template Functions ######## -//# # -//################################################## - -/*! - Receives a object. The size of the received object is suppose to be the size of the type of the object. - Note that a received message can correspond to a deconnection signal. - - \warning Using this function means that you know what kind of object you are suppose to receive, - and when you are suppose to receive. - If the emitter has several receptors. It might be a problem, and in that case you better use the - "request" option. - - \sa vpNetwork::receiveRequest() - \sa vpNetwork::receiveRequestOnce() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestOnce() - - \param object : Received object. - \param sizeOfObject : Size of the received object. - - \return the number of bytes received, or -1 if an error occured. -*/ -template<typename T> -int vpNetwork::receive(T* object, const unsigned int &sizeOfObject) -{ - if(receptor_list.size() == 0) - { - if(verboseMode) - vpTRACE( "No receptor" ); - return -1; - } - - tv.tv_sec = tv_sec; - tv.tv_usec = tv_usec; - - FD_ZERO(&readFileDescriptor); - - for(unsigned int i=0; i<receptor_list.size(); i++){ - FD_SET((unsigned int)receptor_list[i].socketFileDescriptorReceptor,&readFileDescriptor); - - if(i == 0) - socketMax = receptor_list[i].socketFileDescriptorReceptor; - - if(socketMax < receptor_list[i].socketFileDescriptorReceptor) socketMax = receptor_list[i].socketFileDescriptorReceptor; - } - - int value = select((int)socketMax+1,&readFileDescriptor,NULL,NULL,&tv); - int numbytes = 0; - - if(value == -1){ - if(verboseMode) - vpERROR_TRACE( "Select error" ); - return -1; - } - else if(value == 0){ - //Timeout - return 0; - } - else{ - for(unsigned int i=0; i<receptor_list.size(); i++){ - if(FD_ISSET((unsigned int)receptor_list[i].socketFileDescriptorReceptor,&readFileDescriptor)){ -#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX - numbytes = recv(receptor_list[i].socketFileDescriptorReceptor, (char*)(void*)object, sizeOfObject, 0); -#else - numbytes = recv((unsigned int)receptor_list[i].socketFileDescriptorReceptor, (char*)(void*)object, (int)sizeOfObject, 0); -#endif - if(numbytes <= 0) - { - std::cout << "Disconnected : " << inet_ntoa(receptor_list[i].receptorAddress.sin_addr) << std::endl; - receptor_list.erase(receptor_list.begin()+(int)i); - return numbytes; - } - - break; - } - } - } - - return numbytes; -} - -/*! - Receives a object from a receptor, by specifying its size or not. - Note that a received message can correspond to a deconnection signal. - - \warning Using this function means that you know what kind of object you are suppose to receive, - and when you are suppose to receive. - If the emitter has several receptors. It might be a problem, and in that case you better use the - "request" mode. - - \sa vpNetwork::getReceptorIndex() - \sa vpNetwork::receiveRequestFrom() - \sa vpNetwork::receiveRequestOnceFrom() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() - - \param object : Received object. - \param receptorEmitting : Index of the receptor emitting the message. - \param sizeOfObject : Size of the received object. - - \return the number of bytes received, or -1 if an error occured. -*/ -template<typename T> -int vpNetwork::receiveFrom(T* object, const unsigned int &receptorEmitting, const unsigned int &sizeOfObject) -{ - if(receptor_list.size() == 0 || receptorEmitting > (int)receptor_list.size()-1 ) - { - if(verboseMode) - vpTRACE( "No receptor at the specified index" ); - return -1; - } - - tv.tv_sec = tv_sec; - tv.tv_usec = tv_usec; - - FD_ZERO(&readFileDescriptor); - - socketMax = receptor_list[receptorEmitting].socketFileDescriptorReceptor; - FD_SET((unsigned int)receptor_list[receptorEmitting].socketFileDescriptorReceptor,&readFileDescriptor); - - int value = select((int)socketMax+1,&readFileDescriptor,NULL,NULL,&tv); - int numbytes = 0; - - if(value == -1){ - if(verboseMode) - vpERROR_TRACE( "Select error" ); - return -1; - } - else if(value == 0){ - //timeout - return 0; - } - else{ - if(FD_ISSET((unsigned int)receptor_list[receptorEmitting].socketFileDescriptorReceptor,&readFileDescriptor)){ -#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX - numbytes = recv(receptor_list[receptorEmitting].socketFileDescriptorReceptor, (char*)(void*)object, sizeOfObject, 0); -#else - numbytes = recv((unsigned int)receptor_list[receptorEmitting].socketFileDescriptorReceptor, (char*)(void*)object, (int)sizeOfObject, 0); -#endif - if(numbytes <= 0) - { - std::cout << "Disconnected : " << inet_ntoa(receptor_list[receptorEmitting].receptorAddress.sin_addr) << std::endl; - receptor_list.erase(receptor_list.begin()+(int)receptorEmitting); - return numbytes; - } - } - } - - return numbytes; -} - -/*! - Send an object. The size of the received object is suppose to be the size of its type. - Note that sending object containing pointers, virtual methods, etc, won't probably work. - - \warning Using this function means that, in the other side of the network, it knows what kind of object it is suppose to receive, - and when it is suppose to receive. - If the emitter has several receptors. It might be a problem, and in that case you better use the - "request" option. - - \sa vpNetwork::sendTo() - \sa vpNetwork::sendRequest() - \sa vpNetwork::sendRequestTo() - \sa vpNetwork::sendAndEncodeRequest() - \sa vpNetwork::sendAndEncodeRequestTo() - - \param object : Received object. - \param sizeOfObject : Size of the object - - \return The number of bytes sent, or -1 if an error happened. -*/ -template<typename T> -int vpNetwork::send(T* object, const unsigned int &sizeOfObject) -{ - if(receptor_list.size() == 0) - { - if(verboseMode) - vpTRACE( "No receptor !" ); - return 0; - } - - int flags = 0; -//#if ! defined(APPLE) && ! defined(SOLARIS) && ! defined(_WIN32) -#if defined(__linux__) - flags = MSG_NOSIGNAL; // Only for Linux -#endif - -#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX - return sendto(receptor_list[0].socketFileDescriptorReceptor, (const char*)(void*)object, sizeOfObject, - flags, (sockaddr*) &receptor_list[0].receptorAddress,receptor_list[0].receptorAddressSize); -#else - return sendto(receptor_list[0].socketFileDescriptorReceptor, (const char*)(void*)object, (int)sizeOfObject, - flags, (sockaddr*) &receptor_list[0].receptorAddress,receptor_list[0].receptorAddressSize); -#endif - -} - -/*! - Send an object. The size has to be specified. - - \warning Using this function means that, in the other side of the network, it knows what kind of object it is suppose to receive, - and when it is suppose to receive. - If the emitter has several receptors. It might be a problem, and in that case you better use the - "request" option. - - \sa vpNetwork::getReceptorIndex() - \sa vpNetwork::send() - \sa vpNetwork::sendRequest() - \sa vpNetwork::sendRequestTo() - \sa vpNetwork::sendAndEncodeRequest() - \sa vpNetwork::sendAndEncodeRequestTo() - - \param object : Object to send. - \param dest : Index of the receptor that you are sending the object. - \param sizeOfObject : Size of the object. - - \return The number of bytes sent, or -1 if an error happened. -*/ -template<typename T> -int vpNetwork::sendTo(T* object, const unsigned int &dest, const unsigned int &sizeOfObject) -{ - if(receptor_list.size() == 0 || dest > (int)receptor_list.size()-1 ) - { - if(verboseMode) - vpTRACE( "No receptor at the specified index." ); - return 0; - } - - int flags = 0; -//#if ! defined(APPLE) && ! defined(SOLARIS) && ! defined(_WIN32) -#if defined(__linux__) - flags = MSG_NOSIGNAL; // Only for Linux -#endif - -#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX - return sendto(receptor_list[dest].socketFileDescriptorReceptor, (const char*)(void*)object, sizeOfObject, - flags, (sockaddr*) &receptor_list[dest].receptorAddress,receptor_list[dest].receptorAddressSize); -#else - return sendto(receptor_list[dest].socketFileDescriptorReceptor, (const char*)(void*)object, (int)sizeOfObject, - flags, (sockaddr*) &receptor_list[dest].receptorAddress,receptor_list[dest].receptorAddressSize); -#endif -} - -#endif +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * TCP Network + * + * Authors: + * Aurelien Yol + * + *****************************************************************************/ + +#ifndef vpNetwork_H +#define vpNetwork_H + +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpRequest.h> + +#include <vector> +#include <stdio.h> +#include <string.h> +#include <iostream> + +#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX +# include <unistd.h> +# include <sys/socket.h> +# include <netinet/in.h> +# include <arpa/inet.h> +# include <netdb.h> +#else +# include<io.h> +//# include<winsock.h> +# include<winsock2.h> +//# pragma comment(lib, "ws2_32.lib") // Done by CMake in main CMakeLists.txt +#endif + + +/*! + \class vpNetwork + + \ingroup group_core_network + + \brief This class represents a Transmission Control Protocol (TCP) network. + + TCP provides reliable, ordered delivery of a stream of bytes from a program + on one computer to another program on another computer. + + \warning This class shouldn't be used directly. You better use vpClient and + vpServer to simulate your network. Some exemples are provided in these classes. + + \sa vpServer + \sa vpNetwork +*/ +class VISP_EXPORT vpNetwork +{ +protected: + + struct vpReceptor{ +#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX + int socketFileDescriptorReceptor; + socklen_t receptorAddressSize; +#else + SOCKET socketFileDescriptorReceptor; + int receptorAddressSize; +#endif + struct sockaddr_in receptorAddress; + std::string receptorIP; + + vpReceptor() : socketFileDescriptorReceptor(0), receptorAddressSize(), receptorAddress(), receptorIP() {} + }; + + struct vpEmitter{ + struct sockaddr_in emitterAddress; +#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX + int socketFileDescriptorEmitter; +#else + SOCKET socketFileDescriptorEmitter; +#endif + vpEmitter() : emitterAddress(), socketFileDescriptorEmitter(0) + { + emitterAddress.sin_family = AF_INET; + emitterAddress.sin_addr.s_addr = INADDR_ANY; + emitterAddress.sin_port = 0; + socketFileDescriptorEmitter = 0; + } + }; + + //######## PARAMETERS ######## + //# # + //############################ + + vpEmitter emitter; + std::vector<vpReceptor> receptor_list; + fd_set readFileDescriptor; +#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX + int socketMax; +#else + SOCKET socketMax; +#endif + + //Message Handling + std::vector<vpRequest*> request_list; + + unsigned int max_size_message; + std::string separator; + std::string beginning; + std::string end; + std::string param_sep; + + std::string currentMessageReceived; + + struct timeval tv; + long tv_sec; + long tv_usec; + + bool verboseMode; + +private: + + std::vector<int> _handleRequests(); + int _handleFirstRequest(); + + void _receiveRequest(); + void _receiveRequestFrom(const unsigned int &receptorEmitting); + int _receiveRequestOnce(); + int _receiveRequestOnceFrom(const unsigned int &receptorEmitting); + +public: + + vpNetwork(); + virtual ~vpNetwork(); + + void addDecodingRequest(vpRequest *); + + int getReceptorIndex(const char *name); + + /*! + Get the Id of the request at the index ind. + + \param ind : Index of the request. + + \return Id of the request. + */ + std::string getRequestIdFromIndex(const int &ind){ + if(ind >= (int)request_list.size() || ind < 0) + return ""; + return request_list[(unsigned)ind]->getId(); + } + + /*! + Get the maximum size that the emitter can receive (in request mode). + + \sa vpNetwork::setMaxSizeReceivedMessage() + + \return Acutal max size value. + */ + unsigned int getMaxSizeReceivedMessage(){ return max_size_message; } + + void print(const char *id = ""); + + template<typename T> + int receive(T* object, const unsigned int &sizeOfObject = sizeof(T)); + template<typename T> + int receiveFrom(T* object, const unsigned int &receptorEmitting, const unsigned int &sizeOfObject = sizeof(T)); + + std::vector<int> receiveRequest(); + std::vector<int> receiveRequestFrom(const unsigned int &receptorEmitting); + int receiveRequestOnce(); + int receiveRequestOnceFrom(const unsigned int &receptorEmitting); + + std::vector<int> receiveAndDecodeRequest(); + std::vector<int> receiveAndDecodeRequestFrom(const unsigned int &receptorEmitting); + int receiveAndDecodeRequestOnce(); + int receiveAndDecodeRequestOnceFrom(const unsigned int &receptorEmitting); + + void removeDecodingRequest(const char *); + + template<typename T> + int send(T* object, const int unsigned &sizeOfObject = sizeof(T)); + template<typename T> + int sendTo(T* object, const unsigned int &dest, const unsigned int &sizeOfObject = sizeof(T)); + + int sendRequest(vpRequest &req); + int sendRequestTo(vpRequest &req, const unsigned int &dest); + + int sendAndEncodeRequest(vpRequest &req); + int sendAndEncodeRequestTo(vpRequest &req, const unsigned int &dest); + + /*! + Change the maximum size that the emitter can receive (in request mode). + + \sa vpNetwork::getMaxSizeReceivedMessage() + + \param s : new maximum size value. + */ + void setMaxSizeReceivedMessage(const unsigned int &s){ max_size_message = s;} + + /*! + Change the time the emitter spend to check if he receives a message from a receptor. + Initially this value is set to 10usec. + + \sa vpNetwork::setTimeoutUSec() + + \param sec : new value in second. + */ + void setTimeoutSec(const long &sec){ tv_sec = sec; } + + /*! + Change the time the emitter spend to check if he receives a message from a receptor. + Initially this value is set to 10usec. + + \sa vpNetwork::setTimeoutSec() + + \param usec : new value in micro second. + */ + void setTimeoutUSec(const long &usec){ tv_usec = usec; } + + /*! + Set the verbose mode. + + \param mode : Change the verbose mode. True to turn on, False to turn off. + */ + void setVerbose(const bool &mode){ verboseMode = mode; } +}; + +//######## Definition of Template Functions ######## +//# # +//################################################## + +/*! + Receives a object. The size of the received object is suppose to be the size of the type of the object. + Note that a received message can correspond to a deconnection signal. + + \warning Using this function means that you know what kind of object you are suppose to receive, + and when you are suppose to receive. + If the emitter has several receptors. It might be a problem, and in that case you better use the + "request" option. + + \sa vpNetwork::receiveRequest() + \sa vpNetwork::receiveRequestOnce() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestOnce() + + \param object : Received object. + \param sizeOfObject : Size of the received object. + + \return the number of bytes received, or -1 if an error occured. +*/ +template<typename T> +int vpNetwork::receive(T* object, const unsigned int &sizeOfObject) +{ + if(receptor_list.size() == 0) + { + if(verboseMode) + vpTRACE( "No receptor" ); + return -1; + } + + tv.tv_sec = tv_sec; + tv.tv_usec = tv_usec; + + FD_ZERO(&readFileDescriptor); + + for(unsigned int i=0; i<receptor_list.size(); i++){ + FD_SET((unsigned int)receptor_list[i].socketFileDescriptorReceptor,&readFileDescriptor); + + if(i == 0) + socketMax = receptor_list[i].socketFileDescriptorReceptor; + + if(socketMax < receptor_list[i].socketFileDescriptorReceptor) socketMax = receptor_list[i].socketFileDescriptorReceptor; + } + + int value = select((int)socketMax+1,&readFileDescriptor,NULL,NULL,&tv); + int numbytes = 0; + + if(value == -1){ + if(verboseMode) + vpERROR_TRACE( "Select error" ); + return -1; + } + else if(value == 0){ + //Timeout + return 0; + } + else{ + for(unsigned int i=0; i<receptor_list.size(); i++){ + if(FD_ISSET((unsigned int)receptor_list[i].socketFileDescriptorReceptor,&readFileDescriptor)){ +#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX + numbytes = recv(receptor_list[i].socketFileDescriptorReceptor, (char*)(void*)object, sizeOfObject, 0); +#else + numbytes = recv((unsigned int)receptor_list[i].socketFileDescriptorReceptor, (char*)(void*)object, (int)sizeOfObject, 0); +#endif + if(numbytes <= 0) + { + std::cout << "Disconnected : " << inet_ntoa(receptor_list[i].receptorAddress.sin_addr) << std::endl; + receptor_list.erase(receptor_list.begin()+(int)i); + return numbytes; + } + + break; + } + } + } + + return numbytes; +} + +/*! + Receives a object from a receptor, by specifying its size or not. + Note that a received message can correspond to a deconnection signal. + + \warning Using this function means that you know what kind of object you are suppose to receive, + and when you are suppose to receive. + If the emitter has several receptors. It might be a problem, and in that case you better use the + "request" mode. + + \sa vpNetwork::getReceptorIndex() + \sa vpNetwork::receiveRequestFrom() + \sa vpNetwork::receiveRequestOnceFrom() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() + + \param object : Received object. + \param receptorEmitting : Index of the receptor emitting the message. + \param sizeOfObject : Size of the received object. + + \return the number of bytes received, or -1 if an error occured. +*/ +template<typename T> +int vpNetwork::receiveFrom(T* object, const unsigned int &receptorEmitting, const unsigned int &sizeOfObject) +{ + if(receptor_list.size() == 0 || receptorEmitting > (unsigned int)receptor_list.size()-1 ) + { + if(verboseMode) + vpTRACE( "No receptor at the specified index" ); + return -1; + } + + tv.tv_sec = tv_sec; + tv.tv_usec = tv_usec; + + FD_ZERO(&readFileDescriptor); + + socketMax = receptor_list[receptorEmitting].socketFileDescriptorReceptor; + FD_SET((unsigned int)receptor_list[receptorEmitting].socketFileDescriptorReceptor,&readFileDescriptor); + + int value = select((int)socketMax+1,&readFileDescriptor,NULL,NULL,&tv); + int numbytes = 0; + + if(value == -1){ + if(verboseMode) + vpERROR_TRACE( "Select error" ); + return -1; + } + else if(value == 0){ + //timeout + return 0; + } + else{ + if(FD_ISSET((unsigned int)receptor_list[receptorEmitting].socketFileDescriptorReceptor,&readFileDescriptor)){ +#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX + numbytes = recv(receptor_list[receptorEmitting].socketFileDescriptorReceptor, (char*)(void*)object, sizeOfObject, 0); +#else + numbytes = recv((unsigned int)receptor_list[receptorEmitting].socketFileDescriptorReceptor, (char*)(void*)object, (int)sizeOfObject, 0); +#endif + if(numbytes <= 0) + { + std::cout << "Disconnected : " << inet_ntoa(receptor_list[receptorEmitting].receptorAddress.sin_addr) << std::endl; + receptor_list.erase(receptor_list.begin()+(int)receptorEmitting); + return numbytes; + } + } + } + + return numbytes; +} + +/*! + Send an object. The size of the received object is suppose to be the size of its type. + Note that sending object containing pointers, virtual methods, etc, won't probably work. + + \warning Using this function means that, in the other side of the network, it knows what kind of object it is suppose to receive, + and when it is suppose to receive. + If the emitter has several receptors. It might be a problem, and in that case you better use the + "request" option. + + \sa vpNetwork::sendTo() + \sa vpNetwork::sendRequest() + \sa vpNetwork::sendRequestTo() + \sa vpNetwork::sendAndEncodeRequest() + \sa vpNetwork::sendAndEncodeRequestTo() + + \param object : Received object. + \param sizeOfObject : Size of the object + + \return The number of bytes sent, or -1 if an error happened. +*/ +template<typename T> +int vpNetwork::send(T* object, const unsigned int &sizeOfObject) +{ + if(receptor_list.size() == 0) + { + if(verboseMode) + vpTRACE( "No receptor !" ); + return 0; + } + + int flags = 0; +//#if ! defined(APPLE) && ! defined(SOLARIS) && ! defined(_WIN32) +#if defined(__linux__) + flags = MSG_NOSIGNAL; // Only for Linux +#endif + +#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX + return sendto(receptor_list[0].socketFileDescriptorReceptor, (const char*)(void*)object, sizeOfObject, + flags, (sockaddr*) &receptor_list[0].receptorAddress,receptor_list[0].receptorAddressSize); +#else + return sendto(receptor_list[0].socketFileDescriptorReceptor, (const char*)(void*)object, (int)sizeOfObject, + flags, (sockaddr*) &receptor_list[0].receptorAddress,receptor_list[0].receptorAddressSize); +#endif + +} + +/*! + Send an object. The size has to be specified. + + \warning Using this function means that, in the other side of the network, it knows what kind of object it is suppose to receive, + and when it is suppose to receive. + If the emitter has several receptors. It might be a problem, and in that case you better use the + "request" option. + + \sa vpNetwork::getReceptorIndex() + \sa vpNetwork::send() + \sa vpNetwork::sendRequest() + \sa vpNetwork::sendRequestTo() + \sa vpNetwork::sendAndEncodeRequest() + \sa vpNetwork::sendAndEncodeRequestTo() + + \param object : Object to send. + \param dest : Index of the receptor that you are sending the object. + \param sizeOfObject : Size of the object. + + \return The number of bytes sent, or -1 if an error happened. +*/ +template<typename T> +int vpNetwork::sendTo(T* object, const unsigned int &dest, const unsigned int &sizeOfObject) +{ + if(receptor_list.size() == 0 || dest > (unsigned int)receptor_list.size()-1 ) + { + if(verboseMode) + vpTRACE( "No receptor at the specified index." ); + return 0; + } + + int flags = 0; +//#if ! defined(APPLE) && ! defined(SOLARIS) && ! defined(_WIN32) +#if defined(__linux__) + flags = MSG_NOSIGNAL; // Only for Linux +#endif + +#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX + return sendto(receptor_list[dest].socketFileDescriptorReceptor, (const char*)(void*)object, sizeOfObject, + flags, (sockaddr*) &receptor_list[dest].receptorAddress,receptor_list[dest].receptorAddressSize); +#else + return sendto(receptor_list[dest].socketFileDescriptorReceptor, (const char*)(void*)object, (int)sizeOfObject, + flags, (sockaddr*) &receptor_list[dest].receptorAddress,receptor_list[dest].receptorAddressSize); +#endif +} + +#endif diff --git a/src/math/misc/vpMath.cpp b/modules/core/include/visp3/core/vpNoise.h similarity index 59% rename from src/math/misc/vpMath.cpp rename to modules/core/include/visp3/core/vpNoise.h index ac637a1169ca617766b6d441cb45eb5d39c0d102..584e87a00eae8bc81b79edf04b5dca4608a20afb 100644 --- a/src/math/misc/vpMath.cpp +++ b/modules/core/include/visp3/core/vpNoise.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMath.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,42 +10,35 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: - * Simple mathematical function not available in the C math library (math.h). + * Generation of random number with uniform and normal probability density. * * Authors: * Eric Marchand * *****************************************************************************/ -/*! - \file vpMath.cpp - \brief Provides simple Math computation that are not available in - the C mathematics library (math.h) -*/ - -#include <visp/vpMath.h> -const double vpMath::ang_min_sinc = 1.0e-8; -const double vpMath::ang_min_mc = 2.5e-4; +#ifndef vpNoise_hh +#define vpNoise_hh +#include <visp3/core/vpGaussRand.h> +#endif diff --git a/src/camera/vpPixelMeterConversion.h b/modules/core/include/visp3/core/vpPixelMeterConversion.h similarity index 92% rename from src/camera/vpPixelMeterConversion.h rename to modules/core/include/visp3/core/vpPixelMeterConversion.h index f93f24f719aa87ca243966a111c77fdccbf1a5fc..8e9d98eb2eb375563a46ef7382dc17a0a23f7463 100644 --- a/src/camera/vpPixelMeterConversion.h +++ b/modules/core/include/visp3/core/vpPixelMeterConversion.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPixelMeterConversion.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pixel to meter conversion. * @@ -49,16 +45,16 @@ \brief pixel to meter conversion */ -#include <visp/vpCameraParameters.h> -#include <visp/vpException.h> -#include <visp/vpMath.h> -#include <visp/vpDebug.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpImagePoint.h> /*! \class vpPixelMeterConversion - \ingroup CameraModelTransformation CameraModel + \ingroup group_core_camera \brief Conversion from pixel coordinates \f$(u,v)\f$ to normalized coordinates \f$(x,y)\f$ in meter. diff --git a/src/tools/geometry/vpPlane.h b/modules/core/include/visp3/core/vpPlane.h similarity index 89% rename from src/tools/geometry/vpPlane.h rename to modules/core/include/visp3/core/vpPlane.h index c55e08f38279eb41822a5a8cb9f19a66b2ababbd..919042f5a42bf89befba4162747a07cc201bc648 100644 --- a/src/tools/geometry/vpPlane.h +++ b/modules/core/include/visp3/core/vpPlane.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPlane.h 4702 2014-03-27 15:33:52Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Plane geometrical structure. * @@ -43,13 +39,14 @@ #ifndef vpPlane_hh #define vpPlane_hh - - +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> /*! \class vpPlane - \ingroup GeometryPlane + \ingroup group_core_geometry \brief This class defines the container for a plane geometrical structure. @@ -58,12 +55,6 @@ vector of the plane. */ - -#include <visp/vpColVector.h> -#include <visp/vpPoint.h> -#include <visp/vpHomogeneousMatrix.h> - - class VISP_EXPORT vpPlane { diff --git a/modules/core/include/visp3/core/vpPoint.h b/modules/core/include/visp3/core/vpPoint.h new file mode 100644 index 0000000000000000000000000000000000000000..5908f2b3703880d6fcc748dc460f11ca501fba6f --- /dev/null +++ b/modules/core/include/visp3/core/vpPoint.h @@ -0,0 +1,140 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Point feature. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + + +#ifndef vpPoint_H +#define vpPoint_H + +/*! + \file vpPoint.h + \brief class that defines what is a point +*/ + +class vpHomogeneousMatrix; + +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpForwardProjection.h> +#include <visp3/core/vpColor.h> + + +/*! + \class vpPoint + \ingroup group_core_geometry + \brief Class that defines what is a point. +*/ +class VISP_EXPORT vpPoint : public vpForwardProjection +{ + +public: + //! Basic constructor. + vpPoint(); + vpPoint(double oX, double oY, double oZ); + vpPoint(const vpColVector &P); + vpPoint(const std::vector<double> &P); + //! Destructor. + virtual ~vpPoint() {} + +public: + + // Compute the 3D coordinates _cP (camera frame) + void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &_cP) ; + void changeFrame(const vpHomogeneousMatrix &cMo); + + void display(const vpImage<unsigned char> &I, + const vpCameraParameters &cam, + const vpColor &color=vpColor::green, + const unsigned int thickness=1) ; + void display(const vpImage<unsigned char> &I, + const vpHomogeneousMatrix &cMo, + const vpCameraParameters &cam, + const vpColor &color=vpColor::green, + const unsigned int thickness=1) ; + void display(const vpImage<vpRGBa> &I, + const vpHomogeneousMatrix &cMo, + const vpCameraParameters &cam, + const vpColor &color=vpColor::green, + const unsigned int thickness=1) ; + vpPoint *duplicate() const ; + + // Get coordinates + double get_X() const; + double get_Y() const; + double get_Z() const; + double get_W() const; + double get_oX() const; + double get_oY() const; + double get_oZ() const; + double get_oW() const; + double get_x() const; + double get_y() const; + double get_w() const; + + void getWorldCoordinates(double& oX, double& oY, double& oZ); + void getWorldCoordinates(vpColVector &P); + vpColVector getWorldCoordinates(void); + void getWorldCoordinates(std::vector<double> &P); + + //! Basic construction. + void init() ; + + friend VISP_EXPORT std::ostream& operator<<(std::ostream& os, const vpPoint& vpp); + vpPoint& operator=(const vpPoint& vpp); + + //! Projection onto the image plane of a point. Input: the 3D coordinates in the camera frame _cP, output : the 2D coordinates _p. + void projection(const vpColVector &_cP, vpColVector &_p); + + void projection(); + + // Set coordinates + void set_X(const double X); + void set_Y(const double Y); + void set_Z(const double Z); + void set_W(const double W); + void set_oX(const double oX); + void set_oY(const double oY); + void set_oZ(const double oZ); + void set_oW(const double oW); + void set_x(const double x); + void set_y(const double y); + void set_w(const double w); + + void setWorldCoordinates(const double oX, const double oY, const double oZ); + void setWorldCoordinates(const vpColVector &P); + void setWorldCoordinates(const std::vector<double> &P); +}; + +#endif diff --git a/src/tools/geometry/vpPolygon.h b/modules/core/include/visp3/core/vpPolygon.h similarity index 81% rename from src/tools/geometry/vpPolygon.h rename to modules/core/include/visp3/core/vpPolygon.h index 13cf64477f34aa75da457ff7d59dbb862b3cacec..5e42c7816563e35bcc7704dace13018c8ac84253 100644 --- a/src/tools/geometry/vpPolygon.h +++ b/modules/core/include/visp3/core/vpPolygon.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPolygon.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Defines a generic 2D polygon. * @@ -44,12 +40,22 @@ #ifndef vpPolygon_h #define vpPolygon_h +#include <vector> + +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpRect.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpCameraParameters.h> + /*! \class vpPolygon + \ingroup group_core_geometry \brief Defines a generic 2D polygon. - + A polygon is internally represented by N 2D points. - + By default three coordinates in the \f$ (i,j) \f$ frame (see vpImagePoint class documentation for more details about the frame) are used \f$ (0,0) \f$, \f$ (1,0) \f$ and \f$ (0,1) \f$. @@ -58,13 +64,13 @@ \code #include <iostream> -#include <visp/vpPolygon.h> +#include <visp3/core/vpPolygon.h> int main() { std::vector<vpImagePoint> corners; - // Initialize the corners vector with 4 points + // Initialize the corners vector with 4 points corners.push_back( vpImagePoint( 50, 100) ); corners.push_back( vpImagePoint( 50, 300) ); corners.push_back( vpImagePoint(200, 300) ); @@ -83,22 +89,12 @@ int main() // Check if a point is inside the polygon vpImagePoint ip(550, 200); - std::cout << "The point " << ip << " is " << (polygon.isInside(ip) ? "inside":"outside") << " the polygon" << std::endl; + std::cout << "The point " << ip << " is " << (polygon.isInside(ip) ? "inside":"outside") << " the polygon" << std::endl; return 0; } \endcode */ - -#include <visp/vpImagePoint.h> -#include <visp/vpRect.h> -#include <visp/vpColor.h> -#include <visp/vpImage.h> -#include <visp/vpPoint.h> -#include <visp/vpCameraParameters.h> - -#include <vector> - class VISP_EXPORT vpPolygon { protected: @@ -127,7 +123,7 @@ class VISP_EXPORT vpPolygon bool isInside(const vpImagePoint &iP); - void display(const vpImage<unsigned char>& I, const vpColor& color, unsigned int thickness=1); + void display(const vpImage<unsigned char>& I, const vpColor& color, unsigned int thickness=1) const; /*! Get the corners of the polygon. @@ -176,8 +172,16 @@ class VISP_EXPORT vpPolygon void updateBoundingBox(); private: - bool testIntersectionSegments(const vpImagePoint& ip1, const vpImagePoint& ip2, const vpImagePoint& ip3, const vpImagePoint& ip4); - + bool testIntersectionSegments(const vpImagePoint& ip1, const vpImagePoint& ip2, const vpImagePoint& ip3, const vpImagePoint& ip4); + + //################### + // Static Functions + //################### + + public: + static bool isInside(const std::vector<vpImagePoint>& roi, const double &i, const double &j); + private: + static bool intersect(const vpImagePoint& p1, const vpImagePoint& p2, const double &i, const double &j, const double &i_test, const double &j_test); }; #endif diff --git a/src/tracking/mbt/vpMbtPolygon.h b/modules/core/include/visp3/core/vpPolygon3D.h similarity index 56% rename from src/tracking/mbt/vpMbtPolygon.h rename to modules/core/include/visp3/core/vpPolygon3D.h index 3fde8b700540f55b72b62e36617886a2fcdcd0d5..3d8848cc4325032e36b46a74b6f36eaa2ed149a9 100644 --- a/src/tracking/mbt/vpMbtPolygon.h +++ b/modules/core/include/visp3/core/vpPolygon3D.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbtPolygon.h 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,59 +10,53 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implements a polygon of the model used by the model-based tracker. * * Authors: - * Nicolas Melchior - * Romain Tallonneau - * Eric Marchand * Aurelien Yol * *****************************************************************************/ /*! - \file vpMbtPolygon.h - \brief Implements a polygon of the model used by the model-based tracker. + \file vpPolygon3D.h + \brief Implements a 3D polygon with render functionnalities like clipping. */ -#ifndef vpMbtPolygon_HH -#define vpMbtPolygon_HH - -#include <visp/vpPoint.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpPixelMeterConversion.h> +#ifndef vpPolygon3D_HH +#define vpPolygon3D_HH #include <vector> -/*! - \class vpMbtPolygon - - \brief Implementation of a polygon of the model used by the model-based tracker. +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/core/vpMeterPixelConversion.h> + - \ingroup ModelBasedTracking +/*! + \class vpPolygon3D + \ingroup group_core_geometry + \brief Implements a 3D polygon with render functionnalities like clipping. - */ -class VISP_EXPORT vpMbtPolygon +*/ +class VISP_EXPORT vpPolygon3D { public: typedef enum @@ -78,37 +70,23 @@ public: DOWN_CLIPPING = 32, FOV_CLIPPING = 60, ALL_CLIPPING = 63 - } vpMbtPolygonClippingType; + } vpPolygon3DClippingType; public: - //! Index of the polygon. Cannot be unsigned int because default value is -1. - int index; //! Number of points used to define the polygon. unsigned int nbpt; //! Number of corners inside the image during the last call to getNbCornerInsideImage unsigned int nbCornersInsidePrev; - //! flag to specify whether the face is visible or not - bool isvisible; - //! flag to specify whether the face is appearing or not - bool isappearing; //! corners in the object frame vpPoint *p; //! Region of interest clipped - std::vector<std::pair<vpPoint,unsigned int> > roiPointsClip; + std::vector<std::pair<vpPoint,unsigned int> > polyClipped; //! Clipping flag unsigned int clippingFlag; //! Distance for near clipping double distNearClip; //! Distance for near clipping double distFarClip; - //! Flag to specify if the visibility of the polygon depends also of the current level of detail (LOD) - bool useLod; - //! Threshold for minimum line length in pixel to consider if the line is visible or not in LOD case - double minLineLengthThresh; - //! Threshold for minimum polygon area in pixel to consider if the polygon is visible or not in LOD case - double minPolygonAreaThresh; - //! Name of the polygon - std::string name; private: bool getClippedPointsFovGeneric(const vpPoint &p1, const vpPoint &p2, @@ -123,20 +101,20 @@ private: const unsigned int &flag, const double &distance); public: - vpMbtPolygon() ; - vpMbtPolygon(const vpMbtPolygon& mbtp) ; - virtual ~vpMbtPolygon() ; + vpPolygon3D() ; + vpPolygon3D(const vpPolygon3D& mbtp) ; + virtual ~vpPolygon3D() ; void addPoint(const unsigned int n, const vpPoint &P) ; void changeFrame(const vpHomogeneousMatrix &cMo) ; - void computeRoiClipped(const vpCameraParameters &cam = vpCameraParameters()); + void computePolygonClipped(const vpCameraParameters &cam = vpCameraParameters()); /*! Get the clipping used. - \sa vpMbtPolygonClipping + \sa vpPolygon3DClipping \return Clipping flags. */ @@ -148,20 +126,6 @@ public: \return Far clipping value. */ inline double getFarClippingDistance() const { return distFarClip; } - - /*! - Get the index of the face. - - \return index : the index of the face. - */ - inline int getIndex() const {return index ;} - - /*! - Get the name of the face. - - \return Name of the face. - */ - inline std::string getName() const {return name;} /*! Return the number of corners. @@ -169,14 +133,14 @@ public: \return number of corner of the face */ inline unsigned int getNbPoint() const {return nbpt ;} - + /*! Return the number of corners at the previous computation. \return number of corner of the face at the previous computation */ inline unsigned int getNbCornerInsidePrevImage() const { return nbCornersInsidePrev; } - + unsigned int getNbCornerInsideImage(const vpImage<unsigned char>& I, const vpCameraParameters &cam); /*! @@ -190,9 +154,7 @@ public: std::vector<vpImagePoint> getRoi(const vpCameraParameters &cam); - std::vector<vpImagePoint> getRoi(const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo); - - void getRoiClipped(std::vector<vpPoint> &points); + std::vector<vpImagePoint> getRoi(const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo); void getRoiClipped(const vpCameraParameters &cam, std::vector<vpImagePoint>&roi); @@ -202,17 +164,25 @@ public: void getRoiClipped(const vpCameraParameters &cam, std::vector<std::pair<vpImagePoint,unsigned int> > &roi, const vpHomogeneousMatrix &cMo); - inline bool isAppearing() const {return isappearing;} - virtual bool isVisible(const vpHomogeneousMatrix &cMo, const double alpha, const bool &modulo = false, - const vpCameraParameters &cam = vpCameraParameters(), const vpImage<unsigned char> &I = vpImage<unsigned char>()); - bool isVisible() const {return isvisible;} +#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS + /*! + @name Deprecated functions + */ + //@{ + vp_deprecated void getRoiClipped(std::vector<vpPoint> &points); + //@} +#endif + + void getPolygonClipped(std::vector<std::pair<vpPoint,unsigned int> > &poly); + + void getPolygonClipped(std::vector<vpPoint> &poly); - vpMbtPolygon& operator=(const vpMbtPolygon& mbtp) ; + vpPolygon3D& operator=(const vpPolygon3D& mbtp) ; /*! Specify which clipping to use. - \sa vpMbtPolygonClipping + \sa vpPolygon3DClipping \param flags : New clipping flags. */ @@ -223,52 +193,7 @@ public: \param dist : Far clipping value. */ - inline void setFarClippingDistance(const double &dist) { distFarClip = dist; clippingFlag = (clippingFlag | vpMbtPolygon::FAR_CLIPPING);} - - /*! - Set the index of the face. - - \param i : the new index of the face. - */ - virtual inline void setIndex(const int i ) { index = i ; } - - // Due to a doxygen warning include the sample code in the doc, we remove the inline and put the doc in the *.cpp file - void setLod(const bool use_lod); - /*! - Set the threshold for the minimum line length to be considered as visible in the LOD - (level of detail) case. This threshold is only used when setLoD() is turned on. - - \param min_line_length : threshold for the minimum line length in pixel. When a single line that doesn't - belong to a face is considered by the tracker, this line is tracked only if its lenght in pixel is - greater than \e min_line_length. - - \sa setLoD() - */ - inline void setMinLineLengthThresh(const double min_line_length) { - this->minLineLengthThresh = min_line_length; - } - /*! - Set the minimum polygon area to be considered as visible in the LOD (level of detail) - case. This threshold is only used when setLoD() is turned on. - - \param min_polygon_area : threshold for the minimum polygon area in pixel. When a face - is considered by the tracker, this face is tracked only if its area in pixel is - greater than \e min_polygon_area. - - \sa setLoD() - */ - inline void setMinPolygonAreaThresh(const double min_polygon_area) { - this->minPolygonAreaThresh = min_polygon_area; - } - - /*! - Set the name of the face. - - \param face_name : name of the face. - */ - inline void setName(const std::string &face_name) { - this->name = face_name; - } + inline void setFarClippingDistance(const double &dist) { distFarClip = dist; clippingFlag = (clippingFlag | vpPolygon3D::FAR_CLIPPING);} virtual void setNbPoint(const unsigned int nb) ; @@ -277,7 +202,7 @@ public: \param dist : Near clipping value. */ - inline void setNearClippingDistance(const double &dist) { distNearClip = dist; clippingFlag = (clippingFlag | vpMbtPolygon::NEAR_CLIPPING);} + inline void setNearClippingDistance(const double &dist) { distNearClip = dist; clippingFlag = (clippingFlag | vpPolygon3D::NEAR_CLIPPING);} public: static void getClippedPolygon(const std::vector<vpPoint> &ptIn, std::vector<vpPoint> &ptOut, const vpHomogeneousMatrix &cMo, @@ -285,14 +210,6 @@ public: const double &znear = 0.001, const double &zfar = 100 ); static void getMinMaxRoi(const std::vector<vpImagePoint> &roi, int & i_min, int &i_max, int &j_min, int &j_max); static bool roiInsideImage(const vpImage<unsigned char>& I, const std::vector<vpImagePoint>& corners); - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -public: - /*! - @name Deprecated functions - */ - bool isVisible(const vpHomogeneousMatrix &cMo, const bool &depthTest = false) ; -#endif }; #endif diff --git a/src/math/transformation/vpPoseVector.h b/modules/core/include/visp3/core/vpPoseVector.h similarity index 54% rename from src/math/transformation/vpPoseVector.h rename to modules/core/include/visp3/core/vpPoseVector.h index 607fdcdd6e50a4a7dd9a8d02114d07c76dca2f82..f25de5c294e9692fd28e7ae3cec933b1d88b43cb 100644 --- a/src/math/transformation/vpPoseVector.h +++ b/modules/core/include/visp3/core/vpPoseVector.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPoseVector.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pose object. A pose is a size 6 vector [t, tu]^T where tu is * a rotation vector (theta u representation) and t is a translation vector. @@ -52,84 +48,100 @@ where tu is a rotation vector (theta u representation) and t is a translation vector. */ -class vpRotationMatrix; -class vpHomogeneousMatrix; -class vpTranslationVector; -class vpThetaUVector; - -#include <visp/vpMatrix.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomogeneousMatrix.h> class vpRotationMatrix; class vpHomogeneousMatrix; class vpTranslationVector; class vpThetaUVector; +class vpRowVector; + +#include <visp3/core/vpArray2D.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> /*! \class vpPoseVector - \ingroup PoseTransformation + \ingroup group_core_transformations + + \brief Implementation of a pose vector and operations on poses. + + The vpPose class implements a complete representation of every rigid motion in the + euclidian space. - \brief The pose is a complete representation of every rigid motion in the - euclidian space. + The vpPose class is derived from vpArray2D<double>. - It is composed of a translation and a rotation + The pose is composed of a translation and a rotation minimaly represented by a 6 dimension pose vector as: \f[ ^{a}{\bf - r}_b = [^{a}{\bf t}_{b},\Theta {\bf u}]^\top \in R^6\f] + r}_b = [^{a}{\bf t}_{b},\theta {\bf u}]^\top \in R^6\f] where \f$ ^{a}{\bf r}_b \f$ is the pose from frame \f$ a \f$ to frame \f$ b \f$, with \f$ ^{a}{\bf t}_{b} \f$ being the translation vector between these frames along the x,y,z - axis and \f$\Theta \bf u \f$, the \f$\Theta \bf u \f$ representation of the + axis and \f$\theta \bf u \f$, the axis-angle representation of the rotation \f$^{a}\bf{R}_{b}\f$ between these frames. - To know more about the \f$\Theta \bf u\f$ rotation representation, + Translations are expressed in meters, while the angles in the \f$\theta {\bf u}\f$ + axis-angle representation are expressed in radians. + + To know more about the \f$\theta \bf u\f$ rotation representation, see vpThetaUVector documentation. */ -class VISP_EXPORT vpPoseVector : public vpColVector +class VISP_EXPORT vpPoseVector : public vpArray2D<double> { - - private: - // initialize a size 6 vector - void init() ; - - public: +public: // constructor vpPoseVector() ; // constructor from 3 angles (in radian) vpPoseVector(const double tx, const double ty, const double tz, - const double tux, const double tuy, const double tuz) ; + const double tux, const double tuy, const double tuz) ; // constructor convert an homogeneous matrix in a pose vpPoseVector(const vpHomogeneousMatrix& M) ; // constructor convert a translation and a "thetau" vector into a pose - vpPoseVector(const vpTranslationVector& t, - const vpThetaUVector& tu) ; + vpPoseVector(const vpTranslationVector& tv, + const vpThetaUVector& tu) ; // constructor convert a translation and a rotation matrix into a pose - vpPoseVector(const vpTranslationVector& t, - const vpRotationMatrix& R) ; - + vpPoseVector(const vpTranslationVector& tv, + const vpRotationMatrix& R) ; + /*! + Destructor. + */ + virtual ~vpPoseVector() {}; + vpPoseVector buildFrom(const double tx, const double ty, const double tz, + const double tux, const double tuy, const double tuz) ; // convert an homogeneous matrix in a pose vpPoseVector buildFrom(const vpHomogeneousMatrix& M) ; // convert a translation and a "thetau" vector into a pose - vpPoseVector buildFrom(const vpTranslationVector& t, - const vpThetaUVector& tu) ; + vpPoseVector buildFrom(const vpTranslationVector& tv, + const vpThetaUVector& tu) ; // convert a translation and a rotation matrix into a pose - vpPoseVector buildFrom(const vpTranslationVector& t, - const vpRotationMatrix& R) ; - + vpPoseVector buildFrom(const vpTranslationVector& tv, + const vpRotationMatrix& R) ; - /*! + void extract(vpRotationMatrix &R) const; + void extract(vpThetaUVector &tu) const; + void extract(vpTranslationVector &tv) const; + void extract(vpQuaternionVector& q) const; + + vpRotationMatrix getRotationMatrix() const; + vpThetaUVector getThetaUVector() const; + vpTranslationVector getTranslationVector() const; + + // Load an homogeneous matrix from a file + void load(std::ifstream &f) ; + + /*! Set the value of an element of the pose vector: r[i] = x. \param i : Pose vector element index \code // Create a pose vector with translation and rotation set to zero - vpPoseVector r; + vpPoseVector r; // Initialize the pose vector r[0] = 1; @@ -167,20 +179,42 @@ class VISP_EXPORT vpPoseVector : public vpColVector */ inline const double &operator [](unsigned int i) const { return *(data+i); } - // Load an homogeneous matrix from a file - void load(std::ifstream &f) ; + // Print a vector [T thetaU] thetaU in degree + void print() const; + int print(std::ostream& s, unsigned int length, char const* intro=0) const; + + /*! + This function is not applicable to a pose vector that is always a + 6-by-1 column vector. + \exception vpException::fatalError When this function is called. + */ + void resize(const unsigned int nrows, const unsigned int ncols, + const bool flagNullify = true) + { + (void)nrows; + (void)ncols; + (void)flagNullify; + throw(vpException(vpException::fatalError, "Cannot resize a pose vector")); + }; + // Save an homogeneous matrix in a file void save(std::ofstream &f) const ; + void set(const double tx, const double ty, const double tz, + const double tux, const double tuy, const double tuz); + vpRowVector t() const; - // Print a vector [T thetaU] thetaU in degree - void print() ; +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + /*! + @name Deprecated functions + */ + //@{ + /*! + \deprecated Provided only for compat with previous releases. + This function does nothing. + */ + vp_deprecated void init() {}; + //@} +#endif } ; #endif - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ - diff --git a/src/math/transformation/vpQuaternionVector.h b/modules/core/include/visp3/core/vpQuaternionVector.h similarity index 50% rename from src/math/transformation/vpQuaternionVector.h rename to modules/core/include/visp3/core/vpQuaternionVector.h index a41a41ff79ec0f4df8d424230f32aa71de911428..5247a9f4ba6ce02a7684f1658d26fd52e64983bb 100644 --- a/src/math/transformation/vpQuaternionVector.h +++ b/modules/core/include/visp3/core/vpQuaternionVector.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpQuaternionVector.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Quaternion definition. * @@ -52,17 +48,23 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpRotationVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpRotationVector.h> +#include <visp3/core/vpThetaUVector.h> /*! \class vpQuaternionVector - \ingroup RotTransformation + \ingroup group_core_transformations - \brief Defines a quaternion and its basic operations. + \brief Implementation of a rotation vector as quaternion angle + minimal representation. + + Defines a quaternion and its basic operations. + + The vpQuaternionVector class is derived from vpRotationVector. A quaternion is defined by four values: \f${\bf q} = (x, y, z, w)\f$. @@ -81,38 +83,36 @@ class VISP_EXPORT vpQuaternionVector : public vpRotationVector private: static const double minimum; public: - - /*! Default constructor that initialize all the angles to zero. */ - vpQuaternionVector() : vpRotationVector(4) {} - /*! Copy constructor. */ - vpQuaternionVector(const vpQuaternionVector &q) : vpRotationVector(q) {} - vpQuaternionVector(const double x, const double y, const double z,const double w) ; + vpQuaternionVector(); + vpQuaternionVector(const vpQuaternionVector &q); + vpQuaternionVector(const double qx, const double qy, const double qz,const double qw) ; vpQuaternionVector(const vpRotationMatrix &R); - - void buildFrom(const vpRotationMatrix& R); - - void set(const double x, const double y, const double z,const double w) ; - - //! Returns x-component of the quaternion. - inline double x() const {return r[0];} - //! Returns y-component of the quaternion. - inline double y() const {return r[1];} - //! Returns z-component of the quaternion. - inline double z() const {return r[2];} - //! Returns w-component of the quaternion. - inline double w() const {return r[3];} - - vpQuaternionVector operator+( vpQuaternionVector &q) ; - vpQuaternionVector operator-( vpQuaternionVector &q) ; - vpQuaternionVector operator-() ; - vpQuaternionVector operator*(const double l) ; - vpQuaternionVector operator*( vpQuaternionVector &rq) ; + vpQuaternionVector(const vpThetaUVector& tu) ; + + //! Destructor. + virtual ~vpQuaternionVector() {}; + + vpQuaternionVector buildFrom(const double qx, const double qy, const double qz, const double qw) ; + vpQuaternionVector buildFrom(const vpRotationMatrix& R); + vpQuaternionVector buildFrom(const vpThetaUVector& tu); + void set(const double x, const double y, const double z, const double w) ; + + double x() const; + double y() const; + double z() const; + double w() const; + + vpQuaternionVector operator+(const vpQuaternionVector &q) const; + vpQuaternionVector operator-(const vpQuaternionVector &q) const; + vpQuaternionVector operator-() const; + vpQuaternionVector operator*(const double l) const; + vpQuaternionVector operator*(const vpQuaternionVector &rq) const; + vpQuaternionVector operator/(const double l) const; + + vpQuaternionVector conjugate() const; + vpQuaternionVector inverse() const; + double magnitude() const; + void normalize(); } ; #endif - -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ diff --git a/src/image/vpRGBa.h b/modules/core/include/visp3/core/vpRGBa.h similarity index 89% rename from src/image/vpRGBa.h rename to modules/core/include/visp3/core/vpRGBa.h index 5566e5677197e67eeae132ee1993fbb0f1ec2bcd..54d3f35cf99fdd9af13994e51a59f587d43a2116 100644 --- a/src/image/vpRGBa.h +++ b/modules/core/include/visp3/core/vpRGBa.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRGBa.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * RGBA pixel. * @@ -50,13 +46,13 @@ images (it define a RGB 32 bits structure, fourth byte is not used) */ -#include <visp/vpColVector.h> +#include <visp3/core/vpColVector.h> /*! \class vpRGBa - \ingroup ImageContainer + \ingroup group_core_image \brief Class that defines a RGB 32 bits structure. diff --git a/src/math/robust/vpRansac.h b/modules/core/include/visp3/core/vpRansac.h similarity index 92% rename from src/math/robust/vpRansac.h rename to modules/core/include/visp3/core/vpRansac.h index b3029d905e8f3f54faa3e083e25933eba79bd334..fdceab7f0814c80eadb2513cf1fd2d00c6feaef3 100644 --- a/src/math/robust/vpRansac.h +++ b/modules/core/include/visp3/core/vpRansac.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRansac.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Ransac robust algorithm. * @@ -51,14 +47,14 @@ -#include <visp/vpNoise.h> // random number generation -#include <visp/vpDebug.h> // debug and trace -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpUniRand.h> // random number generation +#include <visp3/core/vpDebug.h> // debug and trace +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> #include <ctime> /*! \class vpRansac - \ingroup Robust + \ingroup group_core_robust \brief This class is a generic implementation of the Ransac algorithm. It cannot be used alone. diff --git a/src/tools/geometry/vpRect.h b/modules/core/include/visp3/core/vpRect.h old mode 100755 new mode 100644 similarity index 95% rename from src/tools/geometry/vpRect.h rename to modules/core/include/visp3/core/vpRect.h index 9ae88e5687c9d4c3469d101ea526c8b1491b0579..4f6f622dcad69a4de4d74866bf079161f5bf7105 --- a/src/tools/geometry/vpRect.h +++ b/modules/core/include/visp3/core/vpRect.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRect.h 5009 2014-11-25 18:00:13Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Defines a rectangle in the plane. * @@ -48,7 +44,7 @@ /*! \class vpRect - + \ingroup group_core_geometry \brief Defines a rectangle in the plane. A rectangle is internally represented as an upper-left corner and a @@ -78,8 +74,8 @@ */ #include <vector> -#include <visp/vpException.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpImagePoint.h> class VISP_EXPORT vpRect diff --git a/src/network/vpRequest.h b/modules/core/include/visp3/core/vpRequest.h similarity index 89% rename from src/network/vpRequest.h rename to modules/core/include/visp3/core/vpRequest.h index a155160535f318f3bd58632b749def0c7742dda2..52ea27098ecb810d1c3f40d9e047ac185e179624 100644 --- a/src/network/vpRequest.h +++ b/modules/core/include/visp3/core/vpRequest.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRequest.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Network Request. * @@ -42,10 +38,10 @@ #ifndef vpRequest_H #define vpRequest_H -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> -#include <visp/vpException.h> -#include <visp/vpImageException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpImageException.h> #include <string.h> #include <vector> @@ -53,7 +49,7 @@ /*! \class vpRequest - \ingroup Network + \ingroup group_core_network \brief This the request that will transit on the network @@ -68,8 +64,8 @@ #ifndef vpRequestImage_H #define vpRequestImage_H -#include <visp/vpImage.h> -#include <visp/vpRequest.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRequest.h> class vpRequestImage : public vpRequest { @@ -230,7 +226,7 @@ void vpRequest::addParameterObject(T * params, const int &sizeOfObject) if(sizeOfObject != 0){ char *tempS = new char [sizeOfObject]; memcpy((void*)tempS, (void*)params, sizeOfObject); - std::string returnVal(tempS, sizeOfObject); + std::string returnVal(tempS, (size_t)sizeOfObject); listOfParams.push_back(returnVal); diff --git a/src/math/robust/vpRobust.h b/modules/core/include/visp3/core/vpRobust.h similarity index 92% rename from src/math/robust/vpRobust.h rename to modules/core/include/visp3/core/vpRobust.h index 28f3c1d15beb21a866b706c4483f43b3575ef5ee..8d0dae77b537647626ae37510058acf835439833 100644 --- a/src/math/robust/vpRobust.h +++ b/modules/core/include/visp3/core/vpRobust.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobust.h 4796 2014-07-23 15:51:16Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * M-Estimator and various influence function. * @@ -49,13 +45,13 @@ #ifndef CROBUST_HH #define CROBUST_HH -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> /*! \class vpRobust - \ingroup Robust + \ingroup group_core_robust \brief Contains an M-Estimator and various influence function. Supported methods: M-estimation, Tukey, Cauchy and Huber diff --git a/modules/core/include/visp3/core/vpRotationMatrix.h b/modules/core/include/visp3/core/vpRotationMatrix.h new file mode 100644 index 0000000000000000000000000000000000000000..f55e94d5d3164f940da66c4a03a2e6c9d3b29828 --- /dev/null +++ b/modules/core/include/visp3/core/vpRotationMatrix.h @@ -0,0 +1,167 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Rotation matrix. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + + +#ifndef vpROTATIONMATRIX_H +#define vpROTATIONMATRIX_H + +/*! + \file vpRotationMatrix.h + \brief Class that consider the particular case of rotation matrix +*/ + +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpArray2D.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpRzyxVector.h> +#include <visp3/core/vpRzyzVector.h> +#include <visp3/core/vpThetaUVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpQuaternionVector.h> +#include <visp3/core/vpPoseVector.h> + +/*! + \class vpRotationMatrix + + \ingroup group_core_transformations + + \brief Implementation of a rotation matrix and operations on such kind of matrices. + + The vpRotationMatrix considers the particular case of + a rotation matrix. + + The vpRotationMatrix class is derived from vpArray2D<double>. + +*/ +class VISP_EXPORT vpRotationMatrix : public vpArray2D<double> +{ +public: + vpRotationMatrix(); + vpRotationMatrix(const vpRotationMatrix &R); + vpRotationMatrix(const vpHomogeneousMatrix &M); + vpRotationMatrix(const vpThetaUVector &r); + vpRotationMatrix(const vpPoseVector &p); + vpRotationMatrix(const vpRzyzVector &r); + vpRotationMatrix(const vpRxyzVector &r); + vpRotationMatrix(const vpRzyxVector &r); + vpRotationMatrix(const vpQuaternionVector& q); + vpRotationMatrix(const double tux, const double tuy, const double tuz); + /*! + Destructor. + */ + virtual ~vpRotationMatrix() {}; + + vpRotationMatrix buildFrom(const vpHomogeneousMatrix &M); + vpRotationMatrix buildFrom(const vpThetaUVector &v) ; + vpRotationMatrix buildFrom(const vpPoseVector &p); + vpRotationMatrix buildFrom(const vpRzyzVector &v); + vpRotationMatrix buildFrom(const vpRxyzVector &v); + vpRotationMatrix buildFrom(const vpRzyxVector &v); + vpRotationMatrix buildFrom(const vpQuaternionVector& q); + vpRotationMatrix buildFrom(const double tux, const double tuy, const double tuz); + + void eye(); + + vpColVector getCol(const unsigned int j) const; + vpThetaUVector getThetaUVector(); + + vpRotationMatrix inverse() const; + void inverse(vpRotationMatrix &R) const; + + bool isARotationMatrix() const ; + + // copy operator from vpRotationMatrix + vpRotationMatrix &operator=(const vpRotationMatrix &R); + // copy operator from vpMatrix (handle with care) + vpRotationMatrix &operator=(const vpMatrix &M); + // operation c = A * b (A is unchanged) + vpTranslationVector operator*(const vpTranslationVector &tv) const; + // operation C = A * B (A is unchanged) + vpRotationMatrix operator*(const vpRotationMatrix &R) const; + // operation C = A * B (A is unchanged) + vpMatrix operator*(const vpMatrix &M) const; + // operation v2 = A * v1 (A is unchanged) + vpColVector operator*(const vpColVector &v) const; + vpRotationMatrix operator*(const double x) const; + vpRotationMatrix &operator*=(const double x); + + void printVector() ; + + /*! + This function is not applicable to a rotation matrix that is always a + 3-by-3 matrix. + \exception vpException::fatalError When this function is called. + */ + void resize(const unsigned int nrows, const unsigned int ncols, + const bool flagNullify = true) + { + (void)nrows; + (void)ncols; + (void)flagNullify; + throw(vpException(vpException::fatalError, "Cannot resize a rotation matrix")); + }; + + // transpose + vpRotationMatrix t() const; + +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + /*! + @name Deprecated functions + */ + //@{ + /*! + \deprecated Provided only for compat with previous releases. + This function does nothing. + */ + vp_deprecated void init() {}; + /*! + \deprecated You should rather use eye(). + */ + vp_deprecated void setIdentity(); + //@} +#endif + +private: + static const double threshold; +}; + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +VISP_EXPORT +#endif +vpRotationMatrix operator*(const double &x, const vpRotationMatrix &R) ; + +#endif diff --git a/src/math/transformation/vpRotationVector.h b/modules/core/include/visp3/core/vpRotationVector.h similarity index 62% rename from src/math/transformation/vpRotationVector.h rename to modules/core/include/visp3/core/vpRotationVector.h index 965ee37d2d27142e1ca97b3a09e0651333f9d147..15ee560fd631592764df3e25097a7e075867c75f 100644 --- a/src/math/transformation/vpRotationVector.h +++ b/modules/core/include/visp3/core/vpRotationVector.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRotationVector.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Generic rotation vector (cannot be used as is !). * @@ -48,31 +44,35 @@ (cannot be used as is !) */ - - - -#include <visp/vpMath.h> -#include <visp/vpRowVector.h> -#include <stdio.h> #include <iostream> +#include <math.h> +#include <stdio.h> +#include <visp3/core/vpArray2D.h> -#include <math.h> +class vpRowVector; +class vpColVector; /*! \class vpRotationVector - \ingroup RotTransformation + \ingroup group_core_transformations + + \brief Implementation of a generic rotation vector. + + Class that consider the case of a generic rotation vector + (cannot be used as is !) consisting in three or four angles. - \brief Class that consider the case of a generic rotation vector - (cannot be used as is !) consisting in three angles. + The vpRotationVector class is derived from vpArray2D<double>. + The vpRotationVector class is also the base class of specific rotations vectors such as + vpThetaUVector, vpRxyzVector, vpRzyxVector, vpRzyzVector and vpQuaternionVector. The code below shows how this class can be used to manipulate a vpRxyzVector. \code #include <iostream> -#include <visp/vpRxyzVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -91,77 +91,71 @@ int main() */ -class VISP_EXPORT vpRotationVector +class VISP_EXPORT vpRotationVector : public vpArray2D<double> { - friend class vpColVector; -protected: - double *r ; - unsigned int _size; - void init(const unsigned int size); public: - //! Constructor that constructs a vector of size 3 and initialize all values to zero. + //! Constructor that constructs a 0-size rotation vector. vpRotationVector() - : r(NULL), _size(0) - { - init(3); - } + : vpArray2D<double>() + {} //! Constructor that constructs a vector of size n and initialize all values to zero. vpRotationVector(const unsigned int n) - : r(NULL), _size(n) - { - init(n); - } + : vpArray2D<double>(n, 1) + {} + /*! Copy operator. */ vpRotationVector(const vpRotationVector &v) - : r(NULL), _size(0) - { - *this = v; - } + : vpArray2D<double>(v) + {} - virtual ~vpRotationVector(); + /*! + Destructor. + */ + virtual ~vpRotationVector() {}; + + /** @name Inherited functionalities from vpRotationVector */ + //@{ /*! - Operator that allows to set the value of an element of the rotation + Operator that allows to set the value of an element of the rotation vector: r[i] = value */ - inline double &operator [](unsigned int n) { return *(r + n); } + inline double &operator [](unsigned int i) { return *(data + i); } /*! - Operator that allows to get the value of an element of the rotation + Operator that allows to get the value of an element of the rotation vector: value = r[i] */ - inline const double &operator [](unsigned int n) const { return *(r+n); } + inline const double &operator [](unsigned int i) const { return *(data+i); } /*! Affectation of two vectors. */ vpRotationVector &operator=(const vpRotationVector &v) { - init(v.size()); - for (unsigned int i=0; i<_size; i++) + resize(v.size(), 1); + for (unsigned int i=0; i<v.size(); i++) { - r[i] = v.r[i] ; + data[i] = v.data[i] ; } return *this; } + vpColVector operator*(double x) const; - /*! Returns the size of the rotation vector - */ - unsigned int size() const; + double sumSquare() const; // Transpose of the rotation vector. vpRowVector t() const; - friend VISP_EXPORT std::ostream &operator << (std::ostream &s, const vpRotationVector &m); - + //@} } ; +#ifndef DOXYGEN_SHOULD_SKIP_THIS +VISP_EXPORT +#endif +vpColVector operator*(const double &x, const vpRotationVector &v) ; + #endif -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/modules/core/include/visp3/core/vpRowVector.h b/modules/core/include/visp3/core/vpRowVector.h new file mode 100644 index 0000000000000000000000000000000000000000..cd07b7478a85408ed8f6c6b7a99f79f60ae77009 --- /dev/null +++ b/modules/core/include/visp3/core/vpRowVector.h @@ -0,0 +1,271 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Operation on row vectors. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +#ifndef vpRowVector_H +#define vpRowVector_H + +#include <vector> + +#include <visp3/core/vpArray2D.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> + +class vpMatrix; +class vpColVector; + +/*! + \file vpRowVector.h + \brief Definition of row vector class as well + as a set of operations on these vectors. + +*/ + +/*! + \class vpRowVector + + \ingroup group_core_matrices + + \brief Implementation of row vector and the associated operations. + + This class provides a data structure for a row vector that contains values of double. + It contains also some functions to achieve a set of operations on these vectors. + + The vpRowVector class is derived from vpArray2D<double>. +*/ +class VISP_EXPORT vpRowVector : public vpArray2D<double> +{ +public: + //! Basic constructor that creates an empty 0-size row vector. + vpRowVector() : vpArray2D<double>() {}; + //! Construct a row vector of size n. All the elements are initialized to zero. + vpRowVector(unsigned int n) : vpArray2D<double>(1, n){}; + //! Construct a row vector of size n. Each element is set to \e val. + vpRowVector(unsigned int n, double val) : vpArray2D<double>(1, n, val){}; + //! Copy constructor that allows to construct a row vector from an other one. + vpRowVector(const vpRowVector &v) : vpArray2D<double>(v) {}; + vpRowVector(const vpRowVector &v, unsigned int c, unsigned int ncols) ; + vpRowVector(const vpMatrix &M); + vpRowVector(const vpMatrix &M, unsigned int i); + vpRowVector(const std::vector<double> &v); + vpRowVector(const std::vector<float> &v); + /*! + Destructor. + */ + virtual ~vpRowVector() {}; + + /*! + Removes all elements from the vector (which are destroyed), + leaving the container with a size of 0. + */ + void clear() + { + if (data != NULL ) { + free(data); + data=NULL; + } + + if (rowPtrs!=NULL) { + free(rowPtrs); + rowPtrs=NULL ; + } + rowNum = colNum = dsize = 0; + } + + /*! + Convert a column vector containing angles in degrees into radians. + \sa rad2deg() + */ + inline void deg2rad() { + double d2r = M_PI/180.0; + + (*this) *= d2r; + } + + double euclideanNorm() const; + /*! + Extract a sub-row vector from a row vector. + \param c : Index of the column corresponding to the first element of the vector to extract. + \param rowsize : Size of the vector to extract. + \exception vpException::fatalError If the vector to extract is not contained in the original one. + + \code + vpRowVector r1; + for (unsigned int i=0; i<4; i++) + r1.stack(i); + // r1 is equal to [0 1 2 3] + vpRowVector r2 = r1.extract(1, 3); + // r2 is equal to [1 2 3] + \endcode + */ + vpRowVector extract(unsigned int c, unsigned int rowsize) const + { + if (c >= colNum || c+rowsize > colNum) { + throw(vpException(vpException::fatalError, + "Cannot extract a (1x%d) row vector from a (1x%d) row vector starting at index %d", + rowsize, colNum, c)); + } + + return vpRowVector(*this, c, rowsize); + } + + void init(const vpRowVector &v, unsigned int c, unsigned int ncols); + void insert(unsigned int i, const vpRowVector &v); + + vpRowVector &normalize() ; + vpRowVector &normalize(vpRowVector &x) const ; + + //! Operator that allows to set a value of an element \f$v_i\f$: v[i] = x + inline double &operator[](unsigned int n) { return *(data+n); } + //! Operator that allows to get the value of an element \f$v_i\f$: x = v[i] + inline const double &operator[](unsigned int n) const { return *(data+n) ; } + + //! Copy operator. Allow operation such as A = v + vpRowVector &operator=(const vpRowVector &v); + vpRowVector &operator=(const vpMatrix &M); + vpRowVector &operator=(const std::vector<double> &v); + vpRowVector &operator=(const std::vector<float> &v); + vpRowVector &operator=(const double x); + + double operator*(const vpColVector &x) const; + vpRowVector operator*(const vpMatrix &M) const; + vpRowVector operator*(const double x) const; + vpRowVector &operator*=(double x); + + vpRowVector operator/(const double x) const; + vpRowVector &operator/=(double x); + + vpRowVector operator+(const vpRowVector &v) const; + vpRowVector &operator+=(vpRowVector v); + + vpRowVector operator-(const vpRowVector &v) const; + vpRowVector &operator-=(vpRowVector v); + vpRowVector operator-() const; + + vpRowVector &operator<<(const vpRowVector &v); + + int print(std::ostream& s, unsigned int length, char const* intro=0) const; + /*! + Convert a column vector containing angles in radians into degrees. + \sa deg2rad() + */ + inline void rad2deg() { + double r2d = 180.0/M_PI; + + (*this) *= r2d; + } + void reshape(vpMatrix & M,const unsigned int &nrows,const unsigned int &ncols); + vpMatrix reshape(const unsigned int &nrows,const unsigned int &ncols); + + /*! Modify the size of the row vector. + \param i : Size of the vector. This value corresponds to the vector number + of columns. + \param flagNullify : If true, set the data to zero. + */ + inline void resize(const unsigned int i, const bool flagNullify = true) + { + vpArray2D<double>::resize(1, i, flagNullify); + } + + /*! + Resize the row vector to a \e ncols-dimension vector. + This function can only be used with \e nrows = 1. + \param nrows : Vector number of rows. This value should be set to 1. + \param ncols : Vector number of columns. This value corresponds + to the size of the vector. + \param flagNullify : If true, set the data to zero. + \exception vpException::fatalError When \e nrows is not equal to 1. + + */ + void resize(const unsigned int nrows, const unsigned int ncols, const bool flagNullify) + { + if (nrows != 1) + throw(vpException(vpException::fatalError, + "Cannot resize a row vector to a (%dx%d) dimension vector that has more than one row", + nrows, ncols)); + vpArray2D<double>::resize(nrows, ncols, flagNullify); + }; + + void stack(const double &d); + void stack(const vpRowVector &v); + + double sumSquare() const; + vpColVector t() const; + vpColVector transpose() const; + void transpose(vpColVector &v) const; + + static double mean(const vpRowVector &v) ; + static double median(const vpRowVector &v) ; + static vpRowVector stack(const vpRowVector &A, const vpRowVector &B); + static void stack(const vpRowVector &A, const vpRowVector &B, vpRowVector &C); + static double stdev(const vpRowVector &v, const bool useBesselCorrection=false); + +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + /*! + @name Deprecated functions + */ + //@{ + /*! + \deprecated Provided only for compat with previous releases. + This function does nothing. + */ + vp_deprecated void init() {}; + /*! + \deprecated You should rather use stack(const vpRowVector &) + */ + vp_deprecated void stackMatrices(const vpRowVector &r) { stack(r); }; + /*! + \deprecated You should rather use stack(const vpRowVector &A, const vpRowVector &B) + */ + vp_deprecated static vpRowVector stackMatrices(const vpRowVector &A, const vpRowVector &B) { return stack(A, B); }; + /*! + \deprecated You should rather use stack(const vpRowVector &A, const vpRowVector &B, vpRowVector &C) + */ + vp_deprecated static void stackMatrices(const vpRowVector &A, const vpRowVector &B, vpRowVector &C) { stack(A, B, C); }; + + /*! + \deprecated You should rather use eye() + */ + vp_deprecated void setIdentity(const double & val=1.0) ; + //@} +#endif + +}; + +VISP_EXPORT vpRowVector operator*(const double &x, const vpRowVector &v) ; + +#endif diff --git a/src/math/transformation/vpRxyzVector.h b/modules/core/include/visp3/core/vpRxyzVector.h similarity index 73% rename from src/math/transformation/vpRxyzVector.h rename to modules/core/include/visp3/core/vpRxyzVector.h index ec1f258ab2bc4c192d1ec28343a45cfd431b7291..184667f684781d183fca2d70bcd7b37d24024f48 100644 --- a/src/math/transformation/vpRxyzVector.h +++ b/modules/core/include/visp3/core/vpRxyzVector.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRxyzVector.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Rxyz angle parameterization for the rotation. * Rxyz(phi,theta,psi) = Rot(x,phi)Rot(y,theta)Rot(z,psi). @@ -54,19 +50,23 @@ Rxyz(phi,theta,psi) = Rot(x,phi)Rot(y,theta)Rot(z,psi) */ -#include <visp/vpMatrix.h> -#include <visp/vpRotationVector.h> -#include <visp/vpRotationMatrix.h> +#include <visp3/core/vpRotationVector.h> +#include <visp3/core/vpRotationMatrix.h> + +class vpRotationVector; class vpRotationMatrix; class vpThetaUVector; /*! \class vpRxyzVector - \ingroup RotTransformation + \ingroup group_core_transformations - \brief Class that consider the case of the Euler + \brief Implementation of a rotation vector as \f$R(x,y,z)\f$ Euler angle + minimal representation. + + Class that consider the case of the Euler \f$(\varphi,\theta,\psi)\f$ angle using the x-y-z convention, where \f$(\varphi,\theta,\psi)\f$ are respectively the rotation angles around the \f$x\f$, \f$y\f$ and \f$z\f$ axis. @@ -108,6 +108,8 @@ class vpThetaUVector; \right) \f] + The vpRxyzVector class is derived from vpRotationVector. + The code below shows first how to initialize this representation of Euler angles, than how to contruct a rotation matrix from a vpRxyzVector and finaly how to extract the vpRxyzVector Euler angles @@ -115,9 +117,9 @@ class vpThetaUVector; \code #include <iostream> -#include <visp/vpMath.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpRxyzVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpRxyzVector.h> int main() { @@ -151,42 +153,19 @@ int main() class VISP_EXPORT vpRxyzVector : public vpRotationVector { - friend class vpRotationMatrix; - friend class vpThetaUVector; - public: - /*! Default constructor that initialize all the angles to zero. */ - vpRxyzVector() {} - /*! Copy constructor. */ - vpRxyzVector(const vpRxyzVector &rxyz) : vpRotationVector(rxyz) {} - - /*! - Constructor from 3 angles (in radian). - \param phi : \f$\varphi\f$ angle around the \f$x\f$ axis. - \param theta : \f$\theta\f$ angle around the \f$y\f$ axis. - \param psi : \f$\psi\f$ angle around the \f$z\f$ axis. - */ - vpRxyzVector(const double phi, const double theta, const double psi) : - vpRotationVector (3) { r[0]=phi;r[1]=theta;r[2]=psi; } + vpRxyzVector(); + vpRxyzVector(const vpRxyzVector &rxyz); + vpRxyzVector(const double phi, const double theta, const double psi); // initialize a Rxyz vector from a rotation matrix vpRxyzVector(const vpRotationMatrix& R) ; // initialize a Rxyz vector from a ThetaU vector - vpRxyzVector(const vpThetaUVector& tu) ; - - /*! - Construction from 3 angles (in radian). - \param phi : \f$\varphi\f$ angle around the \f$x\f$ axis. - \param theta : \f$\theta\f$ angle around the \f$y\f$ axis. - \param psi : \f$\psi\f$ angle around the \f$z\f$ axis. - */ - void buildFrom(const double phi, const double theta, const double psi) - { - r[0] = phi ; - r[1] = theta ; - r[2] = psi ; - } + vpRxyzVector(const vpThetaUVector& tu) ; + + //! Destructor. + virtual ~vpRxyzVector() {}; // convert a rotation matrix into Rxyz vector vpRxyzVector buildFrom(const vpRotationMatrix& R) ; @@ -194,6 +173,9 @@ class VISP_EXPORT vpRxyzVector : public vpRotationVector // convert a ThetaU vector into a Rxyz vector vpRxyzVector buildFrom(const vpThetaUVector& tu) ; + void buildFrom(const double phi, const double theta, const double psi); + + vpRxyzVector &operator=(double x) ; } ; #endif diff --git a/src/math/transformation/vpRzyxVector.h b/modules/core/include/visp3/core/vpRzyxVector.h similarity index 74% rename from src/math/transformation/vpRzyxVector.h rename to modules/core/include/visp3/core/vpRzyxVector.h index 329c4b4965de5258b0dc28afbde5ee6c9195f541..f3f6c846c8e9aed0d1137c5e6e19e336207c2142 100644 --- a/src/math/transformation/vpRzyxVector.h +++ b/modules/core/include/visp3/core/vpRzyxVector.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRzyxVector.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Rzyx angle parameterization for the rotation. * Rzyx(phi,theta,psi) = Rot(z,phi)Rot(y,theta)Rot(x,psi) @@ -53,18 +49,21 @@ Rzyx(phi,theta,psi) = Rot(z,phi)Rot(y,theta)Rot(x,psi) */ -#include <visp/vpRotationMatrix.h> -#include <visp/vpRotationVector.h> - class vpRotationMatrix; class vpThetaUVector; +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpRotationVector.h> + /*! \class vpRzyxVector - \ingroup RotTransformation + \ingroup group_core_transformations + + \brief Implementation of a rotation vector as \f$R(z,y,x)\f$ Euler angle + minimal representation. - \brief Class that consider the case of the Euler + Class that consider the case of the Euler \f$(\varphi,\theta,\psi)\f$ angle using the z-y-x convention, where \f$(\varphi,\theta,\psi)\f$ are respectively the rotation angles around the \f$z\f$, \f$y\f$ and \f$x\f$ axis. @@ -108,15 +107,17 @@ class vpThetaUVector; \right) \f] + The vpRzyxVector class is derived from vpRotationVector. + The code below shows first how to initialize this representation of Euler angles, than how to contruct a rotation matrix from a vpRzyxVector and finaly how to extract the vpRzyxVector Euler angles from the build rotation matrix. \code -#include <visp/vpMath.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpRzyxVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpRzyxVector.h> int main() { @@ -150,23 +151,10 @@ int main() class VISP_EXPORT vpRzyxVector : public vpRotationVector { - friend class vpRotationMatrix; - friend class vpThetaUVector; - public: - /*! Default constructor that initialize all the angles to zero. */ - vpRzyxVector() {} - /*! Copy constructor. */ - vpRzyxVector(const vpRzyxVector &rzyx) : vpRotationVector(rzyx) {} - - /*! - Constructor from 3 angles (in radian). - \param phi : \f$\varphi\f$ angle around the \f$z\f$ axis. - \param theta : \f$\theta\f$ angle around the \f$y\f$ axis. - \param psi : \f$\psi\f$ angle around the \f$x\f$ axis. - */ - vpRzyxVector(const double phi, const double theta, const double psi) : - vpRotationVector (3) { r[0]=phi;r[1]=theta;r[2]=psi; } + vpRzyxVector(); + vpRzyxVector(const vpRzyxVector &rzyx); + vpRzyxVector(const double phi, const double theta, const double psi); // initialize a Rzyx vector from a rotation matrix vpRzyxVector(const vpRotationMatrix& R) ; @@ -174,18 +162,8 @@ public: // initialize a Rzyx vector from a ThetaU vector vpRzyxVector(const vpThetaUVector& tu) ; - /*! - Construction from 3 angles (in radian). - \param phi : \f$\varphi\f$ angle around the \f$z\f$ axis. - \param theta : \f$\theta\f$ angle around the \f$y\f$ axis. - \param psi : \f$\psi\f$ angle around the \f$x\f$ axis. - */ - void buildFrom(const double phi, const double theta, const double psi) - { - r[0] = phi ; - r[1] = theta ; - r[2] = psi ; - } + //! Destructor. + virtual ~vpRzyxVector() {}; // convert a rotation matrix into Rzyx vector vpRzyxVector buildFrom(const vpRotationMatrix& R) ; @@ -193,12 +171,9 @@ public: // convert a ThetaU vector into a Rzyx vector vpRzyxVector buildFrom(const vpThetaUVector& R) ; + void buildFrom(const double phi, const double theta, const double psi); + + vpRzyxVector &operator=(double x) ; } ; #endif - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/math/transformation/vpRzyzVector.h b/modules/core/include/visp3/core/vpRzyzVector.h similarity index 74% rename from src/math/transformation/vpRzyzVector.h rename to modules/core/include/visp3/core/vpRzyzVector.h index 90865e95aa611b135c647236a9220ef604135682..1b27c3d0abc2d4a38d818f3dee927f4dea9fdcae 100644 --- a/src/math/transformation/vpRzyzVector.h +++ b/modules/core/include/visp3/core/vpRzyzVector.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRzyzVector.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Euler angles parameterization for the rotation. * Rzyz(phi,theta,psi) = Rot(z,phi)Rot(y,theta)Rot(z,psi) @@ -56,15 +52,18 @@ class vpRotationMatrix; class vpThetaUVector; -#include <visp/vpRotationVector.h> -#include <visp/vpRotationMatrix.h> +#include <visp3/core/vpRotationVector.h> +#include <visp3/core/vpRotationMatrix.h> /*! \class vpRzyzVector - \ingroup RotTransformation + \ingroup group_core_transformations + + \brief Implementation of a rotation vector as \f$R(z,y,z)\f$ Euler angle + minimal representation. - \brief Class that consider the case of the Euler + Class that consider the case of the Euler \f$(\varphi,\theta,\psi)\f$ angles using the z-y-z convention, where \f$(\varphi,\theta,\psi)\f$ are respectively the rotation angles around the \f$z\f$, \f$y\f$ and \f$z\f$ axis. @@ -109,15 +108,17 @@ class vpThetaUVector; \right) \f] + The vpRzyzVector class is derived from vpRotationVector. + The code below shows first how to initialize this representation of Euler angles, than how to contruct a rotation matrix from a vpRzyzVector and finaly how to extract the vpRzyzVector Euler angles from the build rotation matrix. \code -#include <visp/vpMath.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpRzyzVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpRzyzVector.h> int main() { @@ -149,42 +150,20 @@ int main() */ class VISP_EXPORT vpRzyzVector : public vpRotationVector { - friend class vpRotationMatrix; - friend class vpThetaUVector; - public: - /*! Default constructor that initialize all the angles to zero. */ - vpRzyzVector() {} - /*! Copy constructor. */ - vpRzyzVector(const vpRzyzVector &rzyz) : vpRotationVector(rzyz) {} - - /*! - Constructor from 3 angles (in radian). - \param phi : \f$\varphi\f$ angle around the \f$z\f$ axis. - \param theta : \f$\theta\f$ angle around the \f$y\f$ axis. - \param psi : \f$\psi\f$ angle around the \f$z\f$ axis. - */ - vpRzyzVector(const double phi, const double theta, const double psi) : - vpRotationVector (3) { r[0]=phi;r[1]=theta;r[2]=psi; } - + vpRzyzVector(); + vpRzyzVector(const vpRzyzVector &rzyz); + // initialize a Rzyz vector from a rotation matrix vpRzyzVector(const vpRotationMatrix& R); // initialize a Rzyz vector from a ThetaU vector vpRzyzVector(const vpThetaUVector& tu); - /*! - Construction from 3 angles (in radian). - \param phi : \f$\varphi\f$ angle around the \f$z\f$ axis. - \param theta : \f$\theta\f$ angle around the \f$y\f$ axis. - \param psi : \f$\psi\f$ angle around the \f$z\f$ axis. - */ - void buildFrom(const double phi, const double theta, const double psi) - { - r[0] = phi ; - r[1] = theta ; - r[2] = psi ; - } + vpRzyzVector(const double phi, const double theta, const double psi); + + //! Destructor. + virtual ~vpRzyzVector() {}; // convert a rotation matrix into Rzyz vector vpRzyzVector buildFrom(const vpRotationMatrix& R) ; @@ -192,6 +171,8 @@ class VISP_EXPORT vpRzyzVector : public vpRotationVector // convert a ThetaU vector into a Rzyz vector vpRzyzVector buildFrom(const vpThetaUVector& R) ; + void buildFrom(const double phi, const double theta, const double psi); + vpRzyzVector &operator=(double x) ; } ; diff --git a/src/math/robust/vpScale.h b/modules/core/include/visp3/core/vpScale.h similarity index 81% rename from src/math/robust/vpScale.h rename to modules/core/include/visp3/core/vpScale.h index 97a60bc6807ef47c8a894dead2385979a44f18d0..182b5031b37c054ab774c2adcfc58d92d50ec77e 100644 --- a/src/math/robust/vpScale.h +++ b/modules/core/include/visp3/core/vpScale.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpScale.h 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Median Absolute Deviation (MAD), MPDE, Mean shift kernel density estimation. * @@ -57,15 +53,13 @@ #ifndef VPSCALE_HH #define VPSCALE_HH -#define EPANECHNIKOV 0 - -#include <visp/vpColVector.h> +#include <visp3/core/vpColVector.h> #include <math.h> /*! \class vpScale - \ingroup Robust + \ingroup group_core_robust \brief Contains different methods for estimating the robust scale of an error distribution. @@ -82,13 +76,12 @@ class VISP_EXPORT vpScale private: double bandwidth; unsigned int dimension; - int kernel_type; public: //! Constructor vpScale(); - vpScale(double kernel_bandwidth, unsigned int dim=1, int type=EPANECHNIKOV); + vpScale(double kernel_bandwidth, unsigned int dim=1); //! Destructor virtual ~vpScale(void); diff --git a/src/network/vpServer.h b/modules/core/include/visp3/core/vpServer.h similarity index 89% rename from src/network/vpServer.h rename to modules/core/include/visp3/core/vpServer.h index b1873e2cea824fc70ffeabcd275a4e7734760a74..5d4e1cecfe744dfc94acd1f20912bd11e2a3a465 100644 --- a/src/network/vpServer.h +++ b/modules/core/include/visp3/core/vpServer.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpServer.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * TCP Server * @@ -42,16 +38,16 @@ #ifndef vpServer_H #define vpServer_H -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> -#include <visp/vpException.h> -#include <visp/vpNetwork.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpNetwork.h> /*! \class vpServer - \ingroup Network + \ingroup group_core_network \brief This class represents a Transmission Control Protocol (TCP) server. @@ -63,7 +59,7 @@ documentation. \code -#include <visp/vpServer.h> +#include <visp3/core/vpServer.h> #include <iostream> int main(int argc,const char** argv) @@ -101,9 +97,9 @@ int main(int argc,const char** argv) It correspond to the client used in the second exemple of vpClient class' documentation. \code -#include <visp/vpServer.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> +#include <visp3/core/vpServer.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> #include "vpRequestImage.h" //See vpRequest class documentation diff --git a/src/tracking/forward-projection/vpSphere.h b/modules/core/include/visp3/core/vpSphere.h similarity index 83% rename from src/tracking/forward-projection/vpSphere.h rename to modules/core/include/visp3/core/vpSphere.h index dfef7c9539b0f41038121a8fa2b8e5e6f3a8b648..e4d87b3ed26a1ebcd7d06d465e7a09c6e6351315 100644 --- a/src/tracking/forward-projection/vpSphere.h +++ b/modules/core/include/visp3/core/vpSphere.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSphere.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Sphere feature. * @@ -48,15 +44,15 @@ #define vpSphere_hh -#include <visp/vpMath.h> -#include <visp/vpDebug.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpHomogeneousMatrix.h> -#include <visp/vpForwardProjection.h> +#include <visp3/core/vpForwardProjection.h> #include <math.h> /*! \class vpSphere - \ingroup TrackingFeature GeometryFeature + \ingroup group_core_geometry \brief Class that defines what is a sphere. Forward projection of a sphere. diff --git a/modules/core/include/visp3/core/vpSubColVector.h b/modules/core/include/visp3/core/vpSubColVector.h new file mode 100644 index 0000000000000000000000000000000000000000..99a5b702a39f515c1716c7bddf8440f5f91bdf9a --- /dev/null +++ b/modules/core/include/visp3/core/vpSubColVector.h @@ -0,0 +1,96 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Mask on a vpColVector . + * + * Authors: + * Laneurit Jean + * + *****************************************************************************/ + +#ifndef __VP_SUB_COL_VECTOR__ +#define __VP_SUB_COL_VECTOR__ + +#include <visp3/core/vpColVector.h> + +/*! + \file vpSubColVector.h + + \brief Definition of the vpSubColVector class +*/ + +/*! + \class vpSubColVector + \ingroup group_core_matrices + This class provides a mask on a vpColVector. It has internally a + pointer to the parent vpColVector. + All properties of vpColVector are available with + a vpSubColVector. + + \author Jean Laneurit (IRISA - INRIA Rennes) + + \sa vpMatrix vpColvector vpRowVector +*/ +class VISP_EXPORT vpSubColVector : public vpColVector +{ + +private : + //! Copy constructor unavaible + vpSubColVector(const vpSubColVector& /* m */); + +protected : + + //! Number of row of parent vpColvector at initialization + unsigned int pRowNum; + //! Parent vpColvector + vpColVector *parent; + +public: + + vpSubColVector(); + vpSubColVector(vpColVector &v, const unsigned int & offset,const unsigned int & nrows); + virtual ~vpSubColVector(); + + void checkParentStatus() const; + + void init(vpColVector &v, const unsigned int & offset,const unsigned int & nrows); + + vpSubColVector &operator=(const vpSubColVector &B); + + vpSubColVector &operator=(const vpPoseVector &p); + vpSubColVector &operator=(const vpRotationVector &rv); + vpSubColVector &operator=(const vpTranslationVector &tv); + + vpSubColVector &operator=(const vpColVector &B); + vpSubColVector &operator=(const vpMatrix &B); + vpSubColVector &operator=(const double &x); +}; + +#endif diff --git a/src/math/matrix/vpSubMatrix.h b/modules/core/include/visp3/core/vpSubMatrix.h similarity index 85% rename from src/math/matrix/vpSubMatrix.h rename to modules/core/include/visp3/core/vpSubMatrix.h index 9dcae3e89a0e38f86b72357c73bec42b1d79765d..499a0126069c42d2566cbd379f7de740d92dc133 100644 --- a/src/math/matrix/vpSubMatrix.h +++ b/modules/core/include/visp3/core/vpSubMatrix.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSubMatrix.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Mask on a vpMatrix . * @@ -42,7 +38,7 @@ #ifndef __VP_SUB_MATRIX__ #define __VP_SUB_MATRIX__ -#include <visp/vpMatrix.h> +#include <visp3/core/vpMatrix.h> /*! @@ -53,7 +49,7 @@ /*! \class vpSubMatrix - \ingroup vpMath + \ingroup group_core_matrices \brief Definition of the vpSubMatrix vpSubMatrix class provides a mask on a vpMatrix all properties of vpMatrix are available with @@ -92,7 +88,7 @@ class VISP_EXPORT vpSubMatrix : public vpMatrix{ void init(vpMatrix &m, const unsigned int & row, const unsigned int &col , const unsigned int & nrows , const unsigned int & ncols); //!Check is parent vpRowVector has changed since initialization - void checkParentStatus(); + void checkParentStatus() const; //! Operation such as subA = subB vpSubMatrix & operator=(const vpSubMatrix &B); diff --git a/modules/core/include/visp3/core/vpSubRowVector.h b/modules/core/include/visp3/core/vpSubRowVector.h new file mode 100644 index 0000000000000000000000000000000000000000..15db6911c69c4f7017b5cf1f88d0c5c9b7c650e0 --- /dev/null +++ b/modules/core/include/visp3/core/vpSubRowVector.h @@ -0,0 +1,93 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Mask on a vpRowVector . + * + * Authors: + * Laneurit Jean + * + *****************************************************************************/ + +#ifndef __VP_SUB_ROW_VECTOR__ +#define __VP_SUB_ROW_VECTOR__ + +#include <visp3/core/vpRowVector.h> + + +/*! + \file vpSubRowVector.h + + \brief Definition of the vpSubRowVector class +*/ + +/*! + \class vpSubRowVector + \ingroup group_core_matrices + This class provides a mask on a vpRowVector. It has internally a + pointer to the parent vpRowVector. + All properties of vpRowVector are available with + a vpSubRowVector. + + \author Jean Laneurit (IRISA - INRIA Rennes) + + \sa vpMatrix vpColvector vpRowVector +*/ + +class VISP_EXPORT vpSubRowVector : public vpRowVector +{ + +private : + //! Copy constructor unavaible + vpSubRowVector(const vpSubRowVector& /* m */); + +protected : + + //! Number of row of parent vpColvector at initialization + unsigned int pColNum; + //! Parent vpColvector + vpRowVector *parent; + +public: + + vpSubRowVector(); + vpSubRowVector(vpRowVector &v, const unsigned int & offset,const unsigned int & ncols); + virtual ~vpSubRowVector(); + + void checkParentStatus() const; + + void init(vpRowVector &v, const unsigned int & offset,const unsigned int & ncols); + + vpSubRowVector & operator=(const vpSubRowVector &B); + vpSubRowVector & operator=(const vpRowVector &B); + vpSubRowVector & operator=(const vpMatrix &B); + vpSubRowVector & operator=(const double &x); +}; + +#endif diff --git a/src/math/transformation/vpThetaUVector.h b/modules/core/include/visp3/core/vpThetaUVector.h similarity index 79% rename from src/math/transformation/vpThetaUVector.h rename to modules/core/include/visp3/core/vpThetaUVector.h index 354e7b1df8a40769bdd2be840e17d2a80f1ba9fb..d44a8f2b4e6337ee43b56e063ee318b734fcc603 100644 --- a/src/math/transformation/vpThetaUVector.h +++ b/modules/core/include/visp3/core/vpThetaUVector.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpThetaUVector.h 4792 2014-07-18 11:56:02Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Theta U parameterization for the rotation. * @@ -51,25 +47,36 @@ class vpHomogeneousMatrix; class vpRotationMatrix; +class vpPoseVector; class vpRzyxVector; class vpRxyzVector; class vpRzyzVector; +class vpColVector; +class vpRotationVector; +class vpQuaternionVector; -#include <visp/vpRotationVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpRzyxVector.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpRotationVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpRzyxVector.h> +#include <visp3/core/vpQuaternionVector.h> /*! \class vpThetaUVector - \ingroup RotTransformation + \ingroup group_core_transformations + + \brief Implementation of a rotation vector as \f$\theta {\bf u}\f$ axis-angle + minimal representation. - \brief Class that consider the case of the \f$\theta {\bf u}\f$ + Class that consider the case of the \f$\theta {\bf u}\f$ parameterization for the rotation. + The vpThetaUVector class is derived from vpRotationVector. + The \f$\theta {\bf u}\f$ representation is one of the minimal representation of a rotation matrix, where \f${\bf u} = (u_{x} \; u_{y} \; u_{z})^{\top}\f$ @@ -105,9 +112,9 @@ class vpRzyzVector; \code #include <iostream> -#include <visp/vpMath.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpThetaUVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpThetaUVector.h> int main() { @@ -139,19 +146,13 @@ int main() */ class VISP_EXPORT vpThetaUVector : public vpRotationVector { - private: - //! initialize a size 3 vector - void init() ; static const double minimum; public: - - /*! Default constructor that initialize all the angles to zero. */ - vpThetaUVector() {} - /*! Copy constructor. */ - vpThetaUVector(const vpThetaUVector &tu) : vpRotationVector(tu) {} + vpThetaUVector(); + vpThetaUVector(const vpThetaUVector &tu); // constructor initialize a Theta U vector from a homogeneous matrix vpThetaUVector(const vpHomogeneousMatrix & M) ; @@ -165,12 +166,11 @@ public: vpThetaUVector(const vpRzyzVector& rzyz) ; // constructor initialize a Theta U vector from a RxyzVector vpThetaUVector(const vpRxyzVector& rxyz) ; + vpThetaUVector(const vpQuaternionVector& q) ; - /*! - Build a \f$\theta {\bf u}\f$ vector from 3 angles in radian. - */ - vpThetaUVector(const double tux, const double tuy, const double tuz) : - vpRotationVector (3) { r[0]=tux;r[1]=tuy;r[2]=tuz; } + vpThetaUVector(const double tux, const double tuy, const double tuz); + //! Destructor. + virtual ~vpThetaUVector() {}; // convert an homogeneous matrix into Theta U vector vpThetaUVector buildFrom(const vpHomogeneousMatrix& M) ; @@ -184,6 +184,9 @@ public: vpThetaUVector buildFrom(const vpRzyzVector &zyz) ; // convert an Rxyz vector into Theta U vector vpThetaUVector buildFrom(const vpRxyzVector &xyz) ; + vpThetaUVector buildFrom(const vpQuaternionVector &q) ; + + void buildFrom(const double tux, const double tuy, const double tuz); vpThetaUVector &operator=(double x) ; @@ -192,10 +195,3 @@ public: } ; #endif - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ - diff --git a/src/tools/time/vpTime.h b/modules/core/include/visp3/core/vpTime.h similarity index 66% rename from src/tools/time/vpTime.h rename to modules/core/include/visp3/core/vpTime.h index b21b2f194000672ea8a5f5d032143512a18ad354..a61def4137fb493f8554810640c7d1af839360f7 100644 --- a/src/tools/time/vpTime.h +++ b/modules/core/include/visp3/core/vpTime.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpTime.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Time management and measurement. * @@ -50,18 +46,18 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> /*! \class vpTime - \ingroup Time + \ingroup group_core_time \brief Time management and measurement. The example below shows how to synchronize a loop to a given framerate. \code -#include <visp/vpTime.h> +#include <visp3/core/vpTime.h> int main() { @@ -76,17 +72,17 @@ int main() */ -class VISP_EXPORT vpTime +namespace vpTime { -public: - static double minTimeForUsleepCall; - static double measureTimeSecond() ; - static double measureTimeMs() ; - static double measureTimeMicros() ; - static void sleepMs(double t); - static int wait(double t0, double t) ; - static void wait(double t) ; -} ; +VISP_EXPORT double getMinTimeForUsleepCall(); +VISP_EXPORT double measureTimeSecond() ; +VISP_EXPORT double measureTimeMs() ; +VISP_EXPORT double measureTimeMicros() ; +VISP_EXPORT void sleepMs(double t); +VISP_EXPORT int wait(double t0, double t) ; +VISP_EXPORT void wait(double t) ; + +}; #endif diff --git a/src/tracking/general-tracking-issues/vpTracker.h b/modules/core/include/visp3/core/vpTracker.h similarity index 83% rename from src/tracking/general-tracking-issues/vpTracker.h rename to modules/core/include/visp3/core/vpTracker.h index 3acc3b76c7f3a8947e61c30600f7cc1fedcd843f..56f0701290d1041f19849f045406fdee43d4d972 100644 --- a/src/tracking/general-tracking-issues/vpTracker.h +++ b/modules/core/include/visp3/core/vpTracker.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpTracker.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Generic tracker. * @@ -49,13 +45,14 @@ \brief Class that defines what is a generic tracker. */ -#include <visp/vpImage.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpHomogeneousMatrix.h> /*! \class vpTracker + \ingroup group_core_trackers \brief Class that defines what is a feature generic tracker. A tracker is able to track features with parameters expressed in: @@ -68,8 +65,6 @@ */ class VISP_EXPORT vpTracker { - - public: /*! Feature coordinates expressed in the image plane \e p. They correspond diff --git a/src/tracking/general-tracking-issues/vpTrackingException.h b/modules/core/include/visp3/core/vpTrackingException.h similarity index 86% rename from src/tracking/general-tracking-issues/vpTrackingException.h rename to modules/core/include/visp3/core/vpTrackingException.h index 4528593aa776fd194a5de7f36d9c051c82fc0bf0..bf8f51a831efcd2b3d3ec8beba8def655f4d8e5b 100644 --- a/src/tracking/general-tracking-issues/vpTrackingException.h +++ b/modules/core/include/visp3/core/vpTrackingException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpTrackingException.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exceptions that can be emited by the vpTracking class and its derivates. * @@ -54,7 +50,7 @@ */ /* Classes standards. */ -#include <visp/vpException.h> +#include <visp3/core/vpException.h> #include <iostream> /* Classe std::ostream. */ #include <string> /* Classe string. */ /* ------------------------------------------------------------------------- */ @@ -63,7 +59,7 @@ /*! \class vpTrackingException - \ingroup Exception + \ingroup group_core_debug \brief Error that can be emited by the vpTracker class and its derivates. */ class VISP_EXPORT vpTrackingException : public vpException diff --git a/modules/core/include/visp3/core/vpTranslationVector.h b/modules/core/include/visp3/core/vpTranslationVector.h new file mode 100644 index 0000000000000000000000000000000000000000..ad5a3b9e0385db54b2b95129e71e1b65fb96f42f --- /dev/null +++ b/modules/core/include/visp3/core/vpTranslationVector.h @@ -0,0 +1,166 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Translation vector. + * + * Authors: + * Eric Marchand + * Fabien Spindler + * + *****************************************************************************/ + + + +#ifndef vpTRANSLATIONVECTOR_H +#define vpTRANSLATIONVECTOR_H + +/*! + \file vpTranslationVector.h + \brief Class that consider the case of a translation vector. +*/ + +#include <visp3/core/vpArray2D.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpPoseVector.h> + + +/*! + \class vpTranslationVector + + \ingroup group_core_transformations + + \brief Class that consider the case of a translation vector. + + Let us denote \f$^{a}{\bf t}_{b} = [t_x,t_y,t_z]^\top\f$ the translation + from frame \f$ a \f$ to frame \f$ b \f$. The representation of a + translation is a column vector of dimension 3. + + Translations are expressed in meters. + + The code below shows how to use a translation vector to build an + homogeneous matrix. + + \code +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpTranslationVector.h> + +int main() +{ + vpTranslationVector t; // Translation vector + + // Initialization of the translation vector + t[0] = 0.2; // tx = 0.2 meters + t[1] = -0.1; // ty = -0.1 meters + t[2] = 1.0; // tz = 1 meters + + // Construction of a rotation matrix + vpRotationMatrix R; // Set to identity by default + + // Construction of an homogeneous matrix + vpHomogeneousMatrix M(t, R); +} + \endcode +*/ +class VISP_EXPORT vpTranslationVector : public vpArray2D<double> +{ +public: + + /*! + Default constructor. + The translation vector is initialized to zero. + */ + vpTranslationVector() : vpArray2D<double>(3, 1) {}; + vpTranslationVector(const double tx, const double ty, const double tz) ; + vpTranslationVector(const vpTranslationVector &tv); + vpTranslationVector(const vpHomogeneousMatrix &M); + vpTranslationVector(const vpPoseVector &p); + + vpTranslationVector buildFrom(const double tx, const double ty, const double tz) ; + vpTranslationVector buildFrom(const vpHomogeneousMatrix& M) ; + vpTranslationVector buildFrom(const vpPoseVector& p) ; + + double euclideanNorm() const; + + // operators + + // translation vectors additions c = a + b (a, b unchanged) + vpTranslationVector operator+(const vpTranslationVector &tv) const ; + // translation vectors substraction c = a - b (a, b unchanged) + vpTranslationVector operator-(const vpTranslationVector &tv) const ; + // negate t = -a (t is unchanged) + vpTranslationVector operator-() const ; + vpMatrix operator*(const vpRowVector &v) const; + // b = x * a (x=scalar) + vpTranslationVector operator*(const double x) const; + vpTranslationVector & operator*=(double x); + vpTranslationVector operator/(const double x) const; + vpTranslationVector & operator/=(double x); + // Copy operator. Allow operation such as A = v + vpTranslationVector &operator=(const vpTranslationVector &tv); + + vpTranslationVector &operator=(double x) ; + + //! Operator that allows to set a value of an element \f$t_i\f$: t[i] = x + inline double &operator [](unsigned int n) { return *(data + n); } + //! Operator that allows to get the value of an element \f$t_i\f$: x = t[i] + inline const double &operator [](unsigned int n) const { return *(data+n); } + + /*! + This function is not applicable to a translation vector that is always a + 3-by-1 column vector. + \exception vpException::fatalError When this function is called. + */ + void resize(const unsigned int nrows, const unsigned int ncols, + const bool flagNullify = true) + { + (void)nrows; + (void)ncols; + (void)flagNullify; + throw(vpException(vpException::fatalError, "Cannot resize a translation vector")); + }; + + void set(const double tx, const double ty, const double tz) ; + + // Skew Symmetric matrix + vpMatrix skew() const ; + + double sumSquare() const; + + vpRowVector t() const; + + static vpTranslationVector cross(const vpTranslationVector &a, + const vpTranslationVector &b) ; + static vpMatrix skew(const vpTranslationVector &tv) ; + static void skew(const vpTranslationVector &tv, vpMatrix &M) ; +} ; + +#endif diff --git a/src/tools/geometry/vpTriangle.h b/modules/core/include/visp3/core/vpTriangle.h similarity index 87% rename from src/tools/geometry/vpTriangle.h rename to modules/core/include/visp3/core/vpTriangle.h index 98f1aa9d16862e71298aab6945882e2276379476..64de1db661d7c9b6e6876ace56ad6620506da17c 100644 --- a/src/tools/geometry/vpTriangle.h +++ b/modules/core/include/visp3/core/vpTriangle.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpTriangle.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Defines a 2D triangle. * @@ -45,6 +41,7 @@ /*! \class vpTriangle + \ingroup group_core_geometry \brief Defines a 2D triangle. A triangle is internally represented by three 2D points. @@ -52,8 +49,8 @@ By default the three coordinates in the \f$ (i,j) \f$ frame (see vpImagePoint class documentation for more details about the frame.) are \f$ (0,0) \f$, \f$ (1,0) \f$ and \f$ (0,1) \f$. */ -#include <visp/vpImagePoint.h> -#include <visp/vpMatrix.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpMatrix.h> class VISP_EXPORT vpTriangle { diff --git a/modules/core/include/visp3/core/vpUniRand.h b/modules/core/include/visp3/core/vpUniRand.h new file mode 100644 index 0000000000000000000000000000000000000000..b595a7230e259681f5f0aad01fa84b90d1c3d367 --- /dev/null +++ b/modules/core/include/visp3/core/vpUniRand.h @@ -0,0 +1,93 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Generation of random number with uniform and normal probability density. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +#ifndef vpUniRand_hh +#define vpUniRand_hh + +#include <visp3/core/vpConfig.h> + +/*! + \class vpUniRand + + \ingroup group_core_random + \brief Class for generating random numbers with uniform probability density. + + The algorithms and notations used are described in \cite Gentle:2004. + + The following example shows how to use this class to generate 10 numbers between 0 and 5. +\code +#include <iostream> +#include <visp3/core/vpUniRand.h> + +int main() +{ + vpUniRand r; + for(unsigned int i=0;i<10;++i) + std::cout << 5*r() << std::endl; +} +\endcode + */ +class VISP_EXPORT vpUniRand +{ + long a; + long m; //2^31-1 + long q; //integer part of m/a + long r;//r=m mod a + double normalizer; //we use a normalizer > m to ensure ans will never be 1 (it is the case if x = 739806647) + +private: + void draw0(); +protected: + long x; + double draw1(); + +public: + //! Default constructor. + vpUniRand(const long seed = 0) + : a(16807), m(2147483647), q(127773), r(2836), normalizer(2147484721.0), x((seed)? seed : 739806647) + {} + + //! Default destructor. + virtual ~vpUniRand() {}; + + //! Operator that allows to get a random value. + double operator()() { + return draw1(); + } +}; + +#endif diff --git a/src/math/transformation/vpVelocityTwistMatrix.h b/modules/core/include/visp3/core/vpVelocityTwistMatrix.h similarity index 55% rename from src/math/transformation/vpVelocityTwistMatrix.h rename to modules/core/include/visp3/core/vpVelocityTwistMatrix.h index 1ca88bc486caed47ae1990ee4210b8ffbe2d3497..afe4c6d510bdbcf157ff4f1d5f67efe10670bdad 100644 --- a/src/math/transformation/vpVelocityTwistMatrix.h +++ b/modules/core/include/visp3/core/vpVelocityTwistMatrix.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpVelocityTwistMatrix.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Velocity twist transformation matrix. * @@ -43,24 +39,30 @@ #ifndef vpVelocityRwistMatrix_h #define vpVelocityRwistMatrix_h -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRotationMatrix.h> +#include <visp3/core/vpArray2D.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRotationMatrix.h> +class vpHomogeneousMatrix; +class vpColVector; /*! \class vpVelocityTwistMatrix - \ingroup TwistTransformation + \ingroup group_core_transformations - \brief Class that consider the particular case of twist + \brief Implementation of a velocity twist matrix and operations on such kind of matrices. + + Class that consider the particular case of twist transformation matrix that allows to transform a velocity skew from one frame to an other. - The vpVelocityTwistMatrix is derived from vpMatrix. + The vpVelocityTwistMatrix class is derived from vpArray2D<double>. - A twist transformation matrix is 6x6 matrix defined as + A twist transformation matrix is a 6x6 matrix that express a velocity in frame <em>a</em> knowing + velocity in <em>b</em>. This matrix is defined as: \f[ ^a{\bf V}_b = \left[\begin{array}{cc} ^a{\bf R}_b & [^a{\bf t}_b]_\times \; ^a{\bf R}_b\\ @@ -68,17 +70,18 @@ \end{array} \right] \f] - that expressed a velocity in frame <em>a</em> knowing velocity in <em>b</em>. - \f$ ^a{\bf R}_b \f$ is a rotation matrix and + where \f$ ^a{\bf R}_b \f$ is a rotation matrix and \f$ ^a{\bf t}_b \f$ is a translation vector. + The vpVelocityTwistMatrix is derived from vpArray2D. + The code belows shows for example how to convert a velocity skew from camera frame to a fix frame. \code -#include <visp/vpColVector.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpVelocityTwistMatrix.h> int main() { @@ -99,60 +102,83 @@ int main() } \endcode */ -class VISP_EXPORT vpVelocityTwistMatrix : public vpMatrix +class VISP_EXPORT vpVelocityTwistMatrix : public vpArray2D<double> { friend class vpMatrix; public: // basic constructor - vpVelocityTwistMatrix() ; + vpVelocityTwistMatrix(); // copy constructor - vpVelocityTwistMatrix(const vpVelocityTwistMatrix &V) ; + vpVelocityTwistMatrix(const vpVelocityTwistMatrix &V); // constructor from an homogeneous transformation - vpVelocityTwistMatrix(const vpHomogeneousMatrix &M) ; + vpVelocityTwistMatrix(const vpHomogeneousMatrix &M); // Construction from Translation and rotation (ThetaU parameterization) vpVelocityTwistMatrix(const vpTranslationVector &t, const vpThetaUVector &thetau) ; // Construction from Translation and rotation (matrix parameterization) - vpVelocityTwistMatrix(const vpTranslationVector &t, const vpRotationMatrix &R) ; - vpVelocityTwistMatrix(const double tx, const double ty, const double tz, - const double tux, const double tuy, const double tuz) ; + vpVelocityTwistMatrix(const vpTranslationVector &t, const vpRotationMatrix &R); + vpVelocityTwistMatrix(const double tx, const double ty, const double tz, + const double tux, const double tuy, const double tuz); + /*! + Destructor. + */ + virtual ~vpVelocityTwistMatrix() {}; - // Basic initialisation (identity) - void init() ; vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, - const vpRotationMatrix &R); + const vpRotationMatrix &R); vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, - const vpThetaUVector &thetau); + const vpThetaUVector &thetau); vpVelocityTwistMatrix buildFrom(const vpHomogeneousMatrix &M) ; + void extract( vpRotationMatrix &R) const; + void extract(vpTranslationVector &t) const; + // Basic initialisation (identity) - void setIdentity() ; + void eye() ; + + vpVelocityTwistMatrix inverse() const ; + void inverse(vpVelocityTwistMatrix &V) const; vpVelocityTwistMatrix operator*(const vpVelocityTwistMatrix &V) const ; vpMatrix operator*(const vpMatrix &M) const ; - vpColVector operator*(const vpColVector &v) const ; - // copy operator from vpMatrix (handle with care) vpVelocityTwistMatrix &operator=(const vpVelocityTwistMatrix &V); - //! invert the twist matrix - vpVelocityTwistMatrix inverse() const ; - //! invert the twist matrix - void inverse(vpVelocityTwistMatrix &Wi) const; - - //! extract the rotational matrix from the twist matrix - void extract( vpRotationMatrix &R) const; - //! extract the translation vector from the twist matrix - void extract(vpTranslationVector &t) const; + int print(std::ostream& s, unsigned int length, char const* intro=0) const; + + /*! + This function is not applicable to a velocity twist matrix that is always a + 6-by-6 matrix. + \exception vpException::fatalError When this function is called. + */ + void resize(const unsigned int nrows, const unsigned int ncols, + const bool flagNullify = true) + { + (void)nrows; + (void)ncols; + (void)flagNullify; + throw(vpException(vpException::fatalError, "Cannot resize a velocity twist matrix")); + }; + +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + /*! + @name Deprecated functions + */ + //@{ + /*! + \deprecated Provided only for compat with previous releases. + This function does nothing. + */ + vp_deprecated void init() {}; + /*! + \deprecated You should rather use eye(). + */ + vp_deprecated void setIdentity(); + //@} +#endif } ; #endif - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/tools/xml/vpXmlParser.h b/modules/core/include/visp3/core/vpXmlParser.h old mode 100755 new mode 100644 similarity index 95% rename from src/tools/xml/vpXmlParser.h rename to modules/core/include/visp3/core/vpXmlParser.h index 76d6bff3904560b36051be334bb47d6b47872bf1..e3323a0e8e8c8a15bf4e689264f137a6842658a5 --- a/src/tools/xml/vpXmlParser.h +++ b/modules/core/include/visp3/core/vpXmlParser.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpXmlParser.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tools to automatise the creation of xml parser based on the libXML2 * @@ -47,11 +43,11 @@ \brief Tools to simplify the creation of xml parser based on the libXML2 */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 -#include <visp/vpException.h> +#include <visp3/core/vpException.h> #include <libxml/parser.h> diff --git a/src/camera/vpXmlParserCamera.h b/modules/core/include/visp3/core/vpXmlParserCamera.h similarity index 94% rename from src/camera/vpXmlParserCamera.h rename to modules/core/include/visp3/core/vpXmlParserCamera.h index 26a9d993f94d5f444d0be31589e6595e09e248fe..ccd6a2a6e23db66097f8eea48d4deabe30205755 100644 --- a/src/camera/vpXmlParserCamera.h +++ b/modules/core/include/visp3/core/vpXmlParserCamera.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpXmlParserCamera.h 5006 2014-11-24 15:57:45Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * XML parser to load and save camera intrinsic parameters. * @@ -52,19 +48,19 @@ #ifndef vpXMLPARSERCAMERA_H #define vpXMLPARSERCAMERA_H -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 #include <string> -#include <visp/vpCameraParameters.h> -#include <visp/vpXmlParser.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpXmlParser.h> #include <libxml/xmlmemory.h> /* Functions of libxml. */ /*! \class vpXmlParserCamera - \ingroup CameraModelTransformation CameraModel + \ingroup group_core_camera \brief XML parser to load and save intrinsic camera parameters. @@ -104,8 +100,8 @@ Example of loading existing camera parameters from an XML file: \code -#include <visp/vpCameraParameters.h> -#include <visp/vpXmlParserCamera.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpXmlParserCamera.h> int main() { @@ -151,8 +147,8 @@ int main() Example of writing an XML file containing intrinsic camera parameters: \code -#include <visp/vpCameraParameters.h> -#include <visp/vpXmlParserCamera.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpXmlParserCamera.h> int main() { diff --git a/src/math/transformation/vpXmlParserHomogeneousMatrix.h b/modules/core/include/visp3/core/vpXmlParserHomogeneousMatrix.h similarity index 87% rename from src/math/transformation/vpXmlParserHomogeneousMatrix.h rename to modules/core/include/visp3/core/vpXmlParserHomogeneousMatrix.h index 27d288126c7a92af4ddbaf447ff192a34bf937b2..7a83c2987fa7214c60dfa9d87d9b9ab8c4c75d4a 100644 --- a/src/math/transformation/vpXmlParserHomogeneousMatrix.h +++ b/modules/core/include/visp3/core/vpXmlParserHomogeneousMatrix.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpXmlParserHomogeneousMatrix.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * XML parser to load and save Homogeneous Matrix in a XML file * @@ -49,26 +45,26 @@ #ifndef vpXMLPARSERHOMOGENEOUSMATRIX_H #define vpXMLPARSERHOMOGENEOUSMATRIX_H -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 #include <string> -#include <visp/vpXmlParser.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/core/vpXmlParser.h> +#include <visp3/core/vpHomogeneousMatrix.h> #include <libxml/xmlmemory.h> /* Functions of libxml. */ /*! \class vpXmlParserHomogeneousMatrix - \ingroup PoseTransformation + \ingroup group_core_transformations - \brief XML parser to load and save an homogenous matrix in a file. + \brief XML parser to load and save an homogeneous matrix in a file. To have a complete description of the homogeneous matrix implemented in ViSP, see vpHomogeneousMatrix. - Example of an XML file "homogenous_matrixes.xml" containing a Pose vector + Example of an XML file "homogeneous_matrixes.xml" containing a Pose vector that will be converted in an homogeneous matrix: \code @@ -97,7 +93,7 @@ #include <iostream> #include <string> -#include <visp/vpXmlParserHomogeneousMatrix.h> +#include <visp3/core/vpXmlParserHomogeneousMatrix.h> int main(int argc, char* argv[]) { @@ -110,7 +106,7 @@ int main(int argc, char* argv[]) // Define the name of the matrix to load std::string name = "eMc"; - if (p.parse(eMc,"homogenous_matrixes.xml", name) != vpXmlParserHomogeneousMatrix::SEQUENCE_OK) { + if (p.parse(eMc,"homogeneous_matrixes.xml", name) != vpXmlParserHomogeneousMatrix::SEQUENCE_OK) { std::cout << "Cannot found the Homogeneous matrix named " << name << "." << std::endl; } else @@ -131,7 +127,7 @@ int main(int argc, char* argv[]) #include <iostream> #include <string> -#include <visp/vpXmlParserHomogeneousMatrix.h> +#include <visp3/core/vpXmlParserHomogeneousMatrix.h> int main(int argc, char* argv[]) { @@ -148,7 +144,7 @@ int main(int argc, char* argv[]) // Define name of the file xml to fill char filename[FILENAME_MAX]; - sprintf(filename, "%s", "homogenous_matrixes.xml"); + sprintf(filename, "%s", "homogeneous_matrixes.xml"); if (p.save(M, filename, name_M) != vpXmlParserHomogeneousMatrix::SEQUENCE_OK) { std::cout << "Cannot save the Homogeneous matrix" << std::endl; diff --git a/src/camera/vpCameraParameters.cpp b/modules/core/src/camera/vpCameraParameters.cpp similarity index 84% rename from src/camera/vpCameraParameters.cpp rename to modules/core/src/camera/vpCameraParameters.cpp index 8900c032656ca6b0c5e3aacc76f4a7f1f88010da..c17d6bb24e96f74f0b20c4775ed8396b42e347c1 100644 --- a/src/camera/vpCameraParameters.cpp +++ b/modules/core/src/camera/vpCameraParameters.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpCameraParameters.cpp 5215 2015-01-27 19:03:32Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Camera intrinsic parameters. * @@ -48,10 +44,10 @@ */ -#include <visp/vpCameraParameters.h> -#include <visp/vpDebug.h> -#include <visp/vpException.h> -#include <visp/vpRotationMatrix.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpRotationMatrix.h> #include <cmath> #include <limits> #include <iostream> @@ -178,8 +174,8 @@ vpCameraParameters::init() The following sample code shows how to use this function: \code -#include <visp/vpCameraParameters.h> -#include <visp/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpImage.h> int main() { @@ -245,8 +241,8 @@ vpCameraParameters::initPersProjWithoutDistortion(const double cam_px, const dou The following sample code shows how to use this function: \code -#include <visp/vpCameraParameters.h> -#include <visp/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpImage.h> int main() { @@ -359,8 +355,8 @@ vpCameraParameters::initFromCalibrationMatrix(const vpMatrix& _K) The following sample code shows how to use this function: \code -#include <visp/vpCameraParameters.h> -#include <visp/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpImage.h> int main() { @@ -439,126 +435,94 @@ vpCameraParameters::computeFov(const unsigned int &w, const unsigned int &h) fovNormals = std::vector<vpColVector>(4); isFov = true; - - double half_hFovAngle = atan((double)w / ( 2.0 * px )); - double half_vFovAngle = atan((double)h / ( 2.0 * py )); + + double hFovAngle = atan(((double)w - u0) * ( 1.0 / px )); + double vFovAngle = atan(( v0 ) * ( 1.0 / py )); + double minushFovAngle = atan(( u0 ) * ( 1.0 / px )); + double minusvFovAngle = atan(((double)h - v0) * ( 1.0 / py )); width = w; height = h; - + vpColVector n(3); n = 0; n[0] = 1.0; - - vpRotationMatrix Rleft (0,-half_hFovAngle,0); - vpRotationMatrix Rright(0, half_hFovAngle,0); - + + vpRotationMatrix Rleft(0,-minushFovAngle,0); + vpRotationMatrix Rright(0,hFovAngle,0); + vpColVector nLeft, nRight; - + nLeft = Rleft * (-n); fovNormals[0] = nLeft.normalize(); - + nRight = Rright * n; fovNormals[1] = nRight.normalize(); - + n = 0; n[1] = 1.0; - - vpRotationMatrix Rup ( half_vFovAngle,0,0); - vpRotationMatrix Rdown(-half_vFovAngle,0,0); - + + vpRotationMatrix Rup(vFovAngle,0,0); + vpRotationMatrix Rdown(-minusvFovAngle,0,0); + vpColVector nUp, nDown; - + nUp = Rup * (-n); fovNormals[2] = nUp.normalize(); - + nDown = Rdown * n; fovNormals[3] = nDown.normalize(); - m_hFovAngle = 2 * half_hFovAngle; - m_vFovAngle = 2 * half_vFovAngle; + m_hFovAngle = hFovAngle + minushFovAngle; + m_vFovAngle = vFovAngle + minusvFovAngle; } } /*! - Return the calibration matrix \f$K\f$. - - \f$K\f$ is 3x3 matrix given by: + Return the camera matrix \f$K\f$ given by: - \f$ K = \left(\begin{array}{ccc} + \f$ K = \left[\begin{array}{ccc} p_x & 0 & u_0 \\ 0 & p_y & v_0 \\ 0 & 0 & 1 - \end{array} \right) \f$ - - \warning : this function is useful only in the case of perspective - projection without distortion. + \end{array} \right] \f$ \sa get_K_inverse() */ vpMatrix vpCameraParameters::get_K() const { - vpMatrix K; - switch(projModel){ - case vpCameraParameters::perspectiveProjWithoutDistortion : - K.resize(3,3) ; - K = 0.0 ; - K[0][0] = px ; - K[1][1] = py ; - K[0][2] = u0 ; - K[1][2] = v0 ; - K[2][2] = 1.0 ; - break; - case vpCameraParameters::perspectiveProjWithDistortion : - default : - vpERROR_TRACE("\n\t getting K matrix in the case of projection \ - with distortion has no sense"); - throw(vpException(vpException::notImplementedError, - "\n\t getting K matrix in the case of projection \ - with distortion has no sense")); - } + vpMatrix K(3, 3, 0.); + K[0][0] = px ; + K[1][1] = py ; + K[0][2] = u0 ; + K[1][2] = v0 ; + K[2][2] = 1.0 ; + return K; } /*! - Return the calibration matrix \f$K^{-1}\f$. - - \f$K^{-1}\f$ is 3x3 matrix given by: + Return the inverted camera matrix \f$K^{-1}\f$ given by: - \f$ K^{-1} = \left(\begin{array}{ccc} + \f$ K^{-1} = \left[\begin{array}{ccc} 1/p_x & 0 & -u_0/p_x \\ 0 & 1/p_y & -v_0/p_y \\ 0 & 0 & 1 - \end{array} \right) \f$ - - \warning : this function is useful only in the case of perspective - projection without distortion. + \end{array} \right] \f$ \sa get_K() */ vpMatrix vpCameraParameters::get_K_inverse() const { - vpMatrix K_inv; - switch(projModel){ - case vpCameraParameters::perspectiveProjWithoutDistortion : - K_inv.resize(3,3) ; - K_inv = 0.0 ; - K_inv[0][0] = inv_px ; - K_inv[1][1] = inv_py ; - K_inv[0][2] = -u0*inv_px ; - K_inv[1][2] = -v0*inv_py ; - K_inv[2][2] = 1.0 ; - break; - case vpCameraParameters::perspectiveProjWithDistortion : - default : - vpERROR_TRACE("\n\t getting K^-1 matrix in the case of projection \ - with distortion has no sense"); - throw(vpException(vpException::notImplementedError, - "\n\t getting K matrix in the case of projection \ - with distortion has no sense")); - } + vpMatrix K_inv(3, 3, 0.); + K_inv[0][0] = inv_px ; + K_inv[1][1] = inv_py ; + K_inv[0][2] = -u0*inv_px ; + K_inv[1][2] = -v0*inv_py ; + K_inv[2][2] = 1.0 ; + return K_inv; } diff --git a/src/camera/vpMeterPixelConversion.cpp b/modules/core/src/camera/vpMeterPixelConversion.cpp similarity index 86% rename from src/camera/vpMeterPixelConversion.cpp rename to modules/core/src/camera/vpMeterPixelConversion.cpp index a7ab8768af542b0d3c637936110cf9ff79e44f66..f0969fe5f0f8e6fef313c92de97901631fe19feb 100644 --- a/src/camera/vpMeterPixelConversion.cpp +++ b/modules/core/src/camera/vpMeterPixelConversion.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMeterPixelConversion.cpp 4740 2014-05-26 07:15:44Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Meter to pixel conversion. * @@ -45,11 +41,11 @@ \brief meter to pixel conversion */ -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpException.h> -#include <visp/vpMath.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpDebug.h> //! Line coordinates conversion (rho,theta). void diff --git a/src/camera/vpPixelMeterConversion.cpp b/modules/core/src/camera/vpPixelMeterConversion.cpp similarity index 85% rename from src/camera/vpPixelMeterConversion.cpp rename to modules/core/src/camera/vpPixelMeterConversion.cpp index d05735bcab5a01370f5461bfbdb3c72d85953e0b..17b1c1bf781e03b782351f1d35dbb11751a9bae5 100644 --- a/src/camera/vpPixelMeterConversion.cpp +++ b/modules/core/src/camera/vpPixelMeterConversion.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPixelMeterConversion.cpp 5060 2014-12-12 18:31:03Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pixel to meter conversion. * @@ -44,11 +40,11 @@ \file vpPixelMeterConversion.cpp \brief Pixel to meter conversion. */ -#include<visp/vpPixelMeterConversion.h> -#include<visp/vpCameraParameters.h> -#include<visp/vpException.h> -#include<visp/vpMath.h> -#include<visp/vpDebug.h> +#include<visp3/core/vpPixelMeterConversion.h> +#include<visp3/core/vpCameraParameters.h> +#include<visp3/core/vpException.h> +#include<visp3/core/vpMath.h> +#include<visp3/core/vpDebug.h> //! line coordinates conversion (rho,theta) diff --git a/src/camera/vpXmlParserCamera.cpp b/modules/core/src/camera/vpXmlParserCamera.cpp similarity index 98% rename from src/camera/vpXmlParserCamera.cpp rename to modules/core/src/camera/vpXmlParserCamera.cpp index d47716faa7153b970e4ddc367bde438c7116d36d..5016b5c1f130c5f5f21b7ee6ec6904ac25e5fa46 100644 --- a/src/camera/vpXmlParserCamera.cpp +++ b/modules/core/src/camera/vpXmlParserCamera.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpXmlParserCamera.cpp 5264 2015-02-04 13:49:55Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * XML parser to load and save camera intrinsic parameters. * @@ -46,13 +42,13 @@ Class vpXmlParserCamera allowed to load and save intrinsic camera parameters */ -#include <visp/vpXmlParserCamera.h> +#include <visp3/core/vpXmlParserCamera.h> #ifdef VISP_HAVE_XML2 #include <stdlib.h> #include <string.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> /* -------------------------------------------------------------------------- */ /* --- LABEL XML ------------------------------------------------------------ */ /* -------------------------------------------------------------------------- */ @@ -1098,4 +1094,7 @@ vpXmlParserCamera::str2xmlcode (char * str, vpXmlCodeType & res) return back; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpXmlParserCamera.cpp.o) has no symbols +void dummy_vpXmlParserCamera() {}; #endif //VISP_HAVE_XML2 diff --git a/src/image/vpColor.cpp b/modules/core/src/display/vpColor.cpp old mode 100755 new mode 100644 similarity index 81% rename from src/image/vpColor.cpp rename to modules/core/src/display/vpColor.cpp index 27598c61ec1b98b9f51e34937e261eb3d30d2604..de2776490b642c3294a87305cf79ca28b7e41d39 --- a/src/image/vpColor.cpp +++ b/modules/core/src/display/vpColor.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpColor.cpp 4620 2014-01-27 21:28:32Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Color definition. * @@ -40,8 +36,12 @@ * *****************************************************************************/ -#include <visp/vpColor.h> +#include <visp3/core/vpColor.h> +// FS: Sould be improved to avoid the #if preprocessor line. Not a good idea to define colors in static. +// See also vpColor.h where things need to be improved. +//#if !defined(visp_EXPORTS) +#if !defined(VISP_USE_MSVC) || (defined(VISP_USE_MSVC) && !defined(VISP_BUILD_SHARED_LIBS)) /*!< Predefined black color with R=G=B=0 and identifier vpColor::id_black. */ vpColor const vpColor::black = vpColor(0, 0, 0, id_black); /*!< Predefined white color with R=G=B=255 and identifier vpColor::id_white. */ @@ -91,35 +91,34 @@ vpColor const vpColor::orange = vpColor(255, 165, 0, id_orange); /*!< Predefined purple color with R=128, G=0 and B=128 and identifier vpColor::id_purple. */ vpColor const vpColor::purple = vpColor(128, 0, 128, id_purple); +/*!< Predefined none color with R=G=B=0 and identifier vpColor::id_unknown. */ +vpColor const vpColor::none = vpColor(0, 0, 0, id_unknown); const unsigned int vpColor::nbColors = 18; - -vpColor colors[6] = {vpColor::blue,vpColor::green,vpColor::red,vpColor::cyan,vpColor::orange,vpColor::purple}; - /*!< Array of available colors. */ vpColor const vpColor::allColors[vpColor::nbColors] = { - vpColor::blue , // 12 - vpColor::green , // 9 - vpColor::red , // 6 - vpColor::cyan , // 15 - vpColor::purple , // 4 - vpColor::yellow , // 14 - vpColor::orange , // 16 - vpColor::lightBlue ,// 11 - vpColor::lightGreen,// 8 - vpColor::lightRed , // 5 - vpColor::darkBlue , // 13 - vpColor::darkGreen ,// 10 - vpColor::darkRed , // 7 - vpColor::lightGray ,// 2 - vpColor::gray , // 3 - vpColor::darkGray , // 4 - vpColor::black , // 0 - vpColor::white}; // 17 + vpColor::blue , // 12 + vpColor::green , // 9 + vpColor::red , // 6 + vpColor::cyan , // 15 + vpColor::purple , // 4 + vpColor::yellow , // 14 + vpColor::orange , // 16 + vpColor::lightBlue ,// 11 + vpColor::lightGreen,// 8 + vpColor::lightRed , // 5 + vpColor::darkBlue , // 13 + vpColor::darkGreen ,// 10 + vpColor::darkRed , // 7 + vpColor::lightGray ,// 2 + vpColor::gray , // 3 + vpColor::darkGray , // 4 + vpColor::black , // 0 + vpColor::white}; // 17 +#endif -/*!< Predefined none color with R=G=B=0 and identifier vpColor::id_unknown. */ -vpColor const vpColor::none = vpColor(0, 0, 0, id_unknown); +vpColor colors[6] = {vpColor::blue,vpColor::green,vpColor::red,vpColor::cyan,vpColor::orange,vpColor::purple}; /*! Compare two colors. diff --git a/src/device/display/vpDisplay.cpp b/modules/core/src/display/vpDisplay.cpp similarity index 95% rename from src/device/display/vpDisplay.cpp rename to modules/core/src/display/vpDisplay.cpp index 6a99f611c960ade518eb007953e6174579c8ddcb..908df2f98080d213414af1f5b60b20b71363f078 100644 --- a/src/device/display/vpDisplay.cpp +++ b/modules/core/src/display/vpDisplay.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplay.cpp 5008 2014-11-25 17:59:43Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Image display. * @@ -42,13 +38,13 @@ #include <limits> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayException.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpDisplayException.h> +#include <visp3/core/vpImageConvert.h> -#include <visp/vpPoint.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpMath.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpMath.h> /*! @@ -263,13 +259,13 @@ vpDisplay::displayROI(const vpImage<unsigned char> &I, const vpRect &roi) The code below shows how to use this method. \code -#include <visp/vpConfig.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayOpenCV.h> +#include <visp3/core/vpConfig.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayOpenCV.h> int main() { @@ -368,21 +364,24 @@ vpDisplay::getImage ( const vpImage<unsigned char> &Isrc, \param color : Color used to display the frame in the image. - \param thickness : the thickness of the line + \param thickness : the thickness of the line. + + \param offset : Offset in pixels applied to the frame origin location in the image. */ void vpDisplay::displayFrame ( const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, - double size, - const vpColor &color, unsigned int thickness) + double size, const vpColor &color, + unsigned int thickness, + vpImagePoint offset) { // used by display - vpPoint o; o.setWorldCoordinates ( 0.0,0.0,0.0 ) ; - vpPoint x; x.setWorldCoordinates ( size,0.0,0.0 ) ; - vpPoint y; y.setWorldCoordinates ( 0.0,size,0.0 ) ; - vpPoint z; z.setWorldCoordinates ( 0.0,0.0,size ) ; + vpPoint o( 0.0, 0.0, 0.0); + vpPoint x(size, 0.0, 0.0); + vpPoint y( 0.0, size, 0.0); + vpPoint z( 0.0, 0.0, size); o.track ( cMo ) ; x.track ( cMo ) ; @@ -396,26 +395,26 @@ vpDisplay::displayFrame ( const vpImage<unsigned char> &I, vpMeterPixelConversion::convertPoint ( cam, o.p[0], o.p[1], ipo) ; vpMeterPixelConversion::convertPoint ( cam, x.p[0], x.p[1], ip1) ; - vpDisplay::displayArrow ( I, ipo, ip1, vpColor::red, 4*thickness, 2*thickness, thickness) ; + vpDisplay::displayArrow ( I, ipo+offset, ip1+offset, vpColor::red, 4*thickness, 2*thickness, thickness) ; vpMeterPixelConversion::convertPoint ( cam, y.p[0], y.p[1], ip1) ; - vpDisplay::displayArrow ( I, ipo, ip1, vpColor::green, 4*thickness, 2*thickness, thickness) ; + vpDisplay::displayArrow ( I, ipo+offset, ip1+offset, vpColor::green, 4*thickness, 2*thickness, thickness) ; vpMeterPixelConversion::convertPoint ( cam, z.p[0], z.p[1], ip1) ; - vpDisplay::displayArrow ( I,ipo, ip1, vpColor::blue, 4*thickness, 2*thickness, thickness) ; + vpDisplay::displayArrow ( I, ipo+offset, ip1+offset, vpColor::blue, 4*thickness, 2*thickness, thickness) ; } else { vpMeterPixelConversion::convertPoint ( cam, o.p[0], o.p[1], ipo) ; vpMeterPixelConversion::convertPoint ( cam, x.p[0], x.p[1], ip1) ; - vpDisplay::displayArrow ( I, ipo, ip1, color, 4*thickness, 2*thickness, thickness) ; + vpDisplay::displayArrow ( I, ipo+offset, ip1+offset, color, 4*thickness, 2*thickness, thickness) ; vpMeterPixelConversion::convertPoint ( cam, y.p[0], y.p[1], ip1) ; - vpDisplay::displayArrow ( I, ipo, ip1, color, 4*thickness, 2*thickness, thickness) ; + vpDisplay::displayArrow ( I, ipo+offset, ip1+offset, color, 4*thickness, 2*thickness, thickness) ; vpMeterPixelConversion::convertPoint ( cam, z.p[0], z.p[1], ip1) ; - vpDisplay::displayArrow ( I,ipo, ip1, color, 4*thickness, 2*thickness, thickness) ; + vpDisplay::displayArrow ( I, ipo+offset, ip1+offset, color, 4*thickness, 2*thickness, thickness) ; } } @@ -440,19 +439,21 @@ vpDisplay::displayFrame ( const vpImage<unsigned char> &I, \param thickness : the thickness of the line + \param offset : Offset in pixels applied to the frame origin location in the image. */ void vpDisplay::displayFrame ( const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color, - unsigned int thickness ) + unsigned int thickness, + vpImagePoint offset) { // used by display - vpPoint o; o.setWorldCoordinates ( 0.0,0.0,0.0 ) ; - vpPoint x; x.setWorldCoordinates ( size,0.0,0.0 ) ; - vpPoint y; y.setWorldCoordinates ( 0.0,size,0.0 ) ; - vpPoint z; z.setWorldCoordinates ( 0.0,0.0,size ) ; + vpPoint o( 0.0, 0.0, 0.0); + vpPoint x(size, 0.0, 0.0); + vpPoint y( 0.0, size, 0.0); + vpPoint z( 0.0, 0.0, size); o.track ( cMo ) ; x.track ( cMo ) ; @@ -465,26 +466,26 @@ vpDisplay::displayFrame ( const vpImage<vpRGBa> &I, vpMeterPixelConversion::convertPoint ( cam, o.p[0], o.p[1], ipo) ; vpMeterPixelConversion::convertPoint ( cam, x.p[0], x.p[1], ip1) ; - vpDisplay::displayArrow ( I, ipo, ip1, vpColor::red, 4, 2, thickness) ; + vpDisplay::displayArrow ( I, ipo+offset, ip1+offset, vpColor::red, 4, 2, thickness) ; vpMeterPixelConversion::convertPoint ( cam, y.p[0], y.p[1], ip1) ; - vpDisplay::displayArrow ( I, ipo, ip1, vpColor::green, 4, 2, thickness) ; + vpDisplay::displayArrow ( I, ipo+offset, ip1+offset, vpColor::green, 4, 2, thickness) ; vpMeterPixelConversion::convertPoint ( cam, z.p[0], z.p[1], ip1) ; - vpDisplay::displayArrow ( I,ipo, ip1, vpColor::blue, 4, 2, thickness) ; + vpDisplay::displayArrow ( I,ipo+offset, ip1+offset, vpColor::blue, 4, 2, thickness) ; } else { vpMeterPixelConversion::convertPoint ( cam, o.p[0], o.p[1], ipo) ; vpMeterPixelConversion::convertPoint ( cam, x.p[0], x.p[1], ip1) ; - vpDisplay::displayArrow ( I, ipo, ip1, color, 4*thickness, 2*thickness, thickness) ; + vpDisplay::displayArrow ( I, ipo+offset, ip1+offset, color, 4*thickness, 2*thickness, thickness) ; vpMeterPixelConversion::convertPoint ( cam, y.p[0], y.p[1], ip1) ; - vpDisplay::displayArrow ( I, ipo, ip1, color, 4*thickness, 2*thickness, thickness) ; + vpDisplay::displayArrow ( I, ipo+offset, ip1+offset, color, 4*thickness, 2*thickness, thickness) ; vpMeterPixelConversion::convertPoint ( cam, z.p[0], z.p[1], ip1) ; - vpDisplay::displayArrow ( I,ipo, ip1, color, 4*thickness, 2*thickness, thickness) ; + vpDisplay::displayArrow ( I, ipo+offset, ip1+offset, color, 4*thickness, 2*thickness, thickness) ; } } @@ -2209,11 +2210,11 @@ vpDisplay::displayRectangle(const vpImage<vpRGBa> &I, to show the overlay. Because it's time spending, use it parcimoniously. \code -#include <visp/vpDisplay.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpColor.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> int main() { vpImage<unsigned char> I(240, 380); @@ -2461,13 +2462,13 @@ vpDisplay::displayROI(const vpImage<vpRGBa> &I, const vpRect &roi) The code below shows how to use this method. \code -#include <visp/vpConfig.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayOpenCV.h> +#include <visp3/core/vpConfig.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayOpenCV.h> int main() { @@ -2551,12 +2552,12 @@ vpDisplay::getImage ( const vpImage<vpRGBa> &Isrc, vpImage<vpRGBa> &Idest ) to show the overlay. Because it's time spending, use it parcimoniously. \code -#include <visp/vpDisplay.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpColor.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpRGBa.h> int main() { vpImage<vpRGBa> I(240, 380); @@ -2901,12 +2902,12 @@ bool vpDisplay::getClickUp ( const vpImage<vpRGBa> &I, Below you will find an example showing how to use this method. \code -#include <visp/vpConfig.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> +#include <visp3/core/vpConfig.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> int main() { @@ -3008,12 +3009,12 @@ vpDisplay::getKeyboardEvent(const vpImage<unsigned char> &I, bool blocking) Below you will find an example showing how to use this method. \code -#include <visp/vpConfig.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> +#include <visp3/core/vpConfig.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> int main() { @@ -3317,12 +3318,12 @@ vpDisplay::getClickUp ( const vpImage<vpRGBa> &I, Below you will find an example showing how to use this method. \code -#include <visp/vpConfig.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> +#include <visp3/core/vpConfig.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> int main() { @@ -3423,12 +3424,12 @@ vpDisplay::getKeyboardEvent(const vpImage<vpRGBa> &I, bool blocking) Below you will find an example showing how to use this method. \code -#include <visp/vpConfig.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> +#include <visp3/core/vpConfig.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> int main() { diff --git a/src/visual-feature/vpFeatureDisplay.cpp b/modules/core/src/display/vpFeatureDisplay.cpp similarity index 95% rename from src/visual-feature/vpFeatureDisplay.cpp rename to modules/core/src/display/vpFeatureDisplay.cpp index 83fdd19801fe58d43a9b36d86528c51f0c3caf0f..6ab13e053833c5c37180d997307dcd2d5d2359c8 100644 --- a/src/visual-feature/vpFeatureDisplay.cpp +++ b/modules/core/src/display/vpFeatureDisplay.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureDisplay.cpp 4773 2014-07-10 17:09:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface with the image for feature display. * @@ -40,21 +36,21 @@ * *****************************************************************************/ -#include <visp/vpFeatureDisplay.h> +#include <visp3/core/vpFeatureDisplay.h> // Meter/pixel conversion -#include <visp/vpMeterPixelConversion.h> +#include <visp3/core/vpMeterPixelConversion.h> // display -#include <visp/vpDisplay.h> +#include <visp3/core/vpDisplay.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> // math -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> diff --git a/src/image/vpImageConvert.cpp b/modules/core/src/image/vpImageConvert.cpp similarity index 86% rename from src/image/vpImageConvert.cpp rename to modules/core/src/image/vpImageConvert.cpp index 2e6f3093dc2b88f1c20e47c3b940dac11f61d410..3780ce8e429cbfc75cc03666131e74e5f557a41f 100644 --- a/src/image/vpImageConvert.cpp +++ b/modules/core/src/image/vpImageConvert.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpImageConvert.cpp 5204 2015-01-24 13:18:18Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Convert image types. * @@ -48,9 +44,10 @@ #include <sstream> +#include <map> // image -#include <visp/vpImageConvert.h> +#include <visp3/core/vpImageConvert.h> bool vpImageConvert::YCbCrLUTcomputed = false; int vpImageConvert::vpCrr[256]; @@ -185,10 +182,10 @@ vpImageConvert::convert(const vpImage<unsigned char> &src, vpImage<double> &dest \param flip : Set to true to vertically flip the converted image. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> int main() { @@ -291,10 +288,10 @@ vpImageConvert::convert(const IplImage* src, vpImage<vpRGBa> & dest, bool flip) \param flip : Set to true to vertically flip the converted image. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> int main() { @@ -393,10 +390,10 @@ vpImageConvert::convert(const IplImage* src, vpImage<unsigned char> &dest, bool \param dest : destination image \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> int main() { @@ -481,10 +478,10 @@ vpImageConvert::convert(const vpImage<vpRGBa> & src, IplImage *&dest) \param dest : destination image \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> int main() { @@ -559,11 +556,11 @@ vpImageConvert::convert(const vpImage<unsigned char> & src, IplImage* &dest) \param flip : Set to true to vertically flip the converted image. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpRGBa.h> int main() { @@ -652,10 +649,10 @@ vpImageConvert::convert(const cv::Mat& src, vpImage<vpRGBa>& dest, const bool fl \param flip : Set to true to vertically flip the converted image. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> int main() { @@ -732,10 +729,10 @@ vpImageConvert::convert(const cv::Mat& src, vpImage<unsigned char>& dest, const \param dest : destination image (BGR format) \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> int main() { @@ -786,10 +783,10 @@ vpImageConvert::convert(const vpImage<vpRGBa> & src, cv::Mat& dest) will not modified the other. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> int main() { @@ -836,10 +833,10 @@ vpImageConvert::convert(const vpImage<unsigned char> & src, cv::Mat& dest, const \param copyData : Set to true to copy all the image content. If false we only update the image pointer. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> int main() { @@ -880,10 +877,10 @@ void vpImageConvert::convert(const vpImage<unsigned char> & src, \param copyData : Set to true to copy all the image content. If false we only update the image pointer. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> #if defined(VISP_HAVE_YARP) #include <yarp/sig/ImageFile.h> @@ -926,11 +923,11 @@ void vpImageConvert::convert(const yarp::sig::ImageOf< yarp::sig::PixelMono > *s \param copyData : Set to true to copy all the image content. If false we only update the image pointer. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpRGBa.h> int main() { @@ -970,11 +967,11 @@ void vpImageConvert::convert(const vpImage<vpRGBa> & src, \param copyData : Set to true to copy all the image content. If false we only update the image pointer. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpRGBa.h> #if defined(VISP_HAVE_YARP) #include <yarp/sig/ImageFile.h> @@ -1016,11 +1013,11 @@ void vpImageConvert::convert(const yarp::sig::ImageOf< yarp::sig::PixelRgba > *s \param dest : Destination image in YARP format. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpRGBa.h> int main() { @@ -1060,11 +1057,11 @@ void vpImageConvert::convert(const vpImage<vpRGBa> & src, yarp::sig::ImageOf< ya \param dest : Destination image in ViSP format. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpRGBa.h> #if defined(VISP_HAVE_YARP) #include <yarp/sig/ImageFile.h> @@ -1101,108 +1098,6 @@ void vpImageConvert::convert(const yarp::sig::ImageOf< yarp::sig::PixelRgb > *sr #endif -#if defined(VISP_HAVE_LIBJPEG) -#if JPEG_LIB_VERSION > 70 -/*! - Convert a vpImage\<unsigned char> to a JPEG compressed buffer - - \param src : Source image in ViSP format. - \param dest : Destination buffer in JPEG format. - \param destSize : Size of the destination buffer. - \param quality : purcentage of the quality of the compressed image. -*/ -void vpImageConvert::convertToJPEGBuffer(const vpImage<unsigned char> &src, - unsigned char **dest, long unsigned int &destSize, int quality) -{ - struct jpeg_compress_struct cinfo; - struct jpeg_error_mgr jerr; - - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_compress(&cinfo); - - *dest = NULL; - destSize = 0; - - jpeg_mem_dest(&cinfo, dest, &destSize); - - unsigned int width = src.getWidth(); - unsigned int height = src.getHeight(); - - cinfo.image_width = width; - cinfo.image_height = height; - cinfo.input_components = 1; - cinfo.in_color_space = JCS_GRAYSCALE; - jpeg_set_defaults(&cinfo); - jpeg_set_quality(&cinfo, quality, TRUE); - - jpeg_start_compress(&cinfo,TRUE); - - unsigned char *line; - line = new unsigned char[width]; - unsigned char* input = (unsigned char*)src.bitmap; - while (cinfo.next_scanline < cinfo.image_height) - { - for (unsigned int i = 0; i < width; i++) - { - line[i] = *(input); - input++; - } - jpeg_write_scanlines(&cinfo, &line, 1); - } - - jpeg_finish_compress(&cinfo); - jpeg_destroy_compress(&cinfo); - delete [] line; -} - -/*! - Decompress a JPEG buffer in a vpImage\<unsigned char> - - \param src : Source buffer in JPEG format. - \param srcSize : Size of the source buffer. - \param dest : Destination image in ViSP format. -*/ -void vpImageConvert::convertToJPEGBuffer(unsigned char *src, long unsigned int srcSize, - vpImage<unsigned char> &dest) -{ - struct jpeg_decompress_struct cinfo; - struct jpeg_error_mgr jerr; - - cinfo.err = jpeg_std_error(&jerr); - jpeg_create_decompress(&cinfo); - - jpeg_mem_src(&cinfo, src, srcSize); - jpeg_read_header(&cinfo, TRUE); - - unsigned int width = cinfo.image_width; - unsigned int height = cinfo.image_height; - - if ( (width != dest.getWidth()) || (height != dest.getHeight()) ) - dest.resize(height,width); - - jpeg_start_decompress(&cinfo); - - unsigned int rowbytes = cinfo.output_width * (unsigned int)(cinfo.output_components); - JSAMPARRAY buf = (*cinfo.mem->alloc_sarray) ((j_common_ptr) &cinfo, JPOOL_IMAGE, rowbytes, 1); - - if (cinfo.out_color_space == JCS_GRAYSCALE) - { - unsigned int row; - while (cinfo.output_scanline<cinfo.output_height) - { - row = cinfo.output_scanline; - jpeg_read_scanlines(&cinfo,buf,1); - memcpy(dest[row], buf[0], rowbytes); - } - } - - jpeg_finish_decompress(&cinfo); - jpeg_destroy_decompress(&cinfo); -} -#endif -#endif // defined(VISP_HAVE_LIBJPEG) - - #define vpSAT(c) \ if (c & (~255)) { if (c < 0) c = 0; else c = 255; } /*! @@ -3420,9 +3315,9 @@ void vpImageConvert::YCrCbToRGBa(unsigned char *ycrcb, unsigned char *rgba, unsi Example code using split : \code -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> int main() { @@ -3498,6 +3393,70 @@ void vpImageConvert::split(const vpImage<vpRGBa> &src, } } +/*! + Merge 4 channels into an RGBa image. + \param R : Red channel. + \param G : Green channel. + \param B : Blue channel. + \param a : Alpha channel. + \param RGBa : Destination RGBa image. +*/ +void vpImageConvert::merge(const vpImage<unsigned char> *R, + const vpImage<unsigned char> *G, + const vpImage<unsigned char> *B, + const vpImage<unsigned char> *a, + vpImage<vpRGBa> &RGBa) { + //Check if the input channels have all the same dimensions + std::map<unsigned int, unsigned int> mapOfWidths, mapOfHeights; + if(R != NULL) { + mapOfWidths[R->getWidth()]++; + mapOfHeights[R->getHeight()]++; + } + + if(G != NULL) { + mapOfWidths[G->getWidth()]++; + mapOfHeights[G->getHeight()]++; + } + + if(B != NULL) { + mapOfWidths[B->getWidth()]++; + mapOfHeights[B->getHeight()]++; + } + + if(a != NULL) { + mapOfWidths[a->getWidth()]++; + mapOfHeights[a->getHeight()]++; + } + + if(mapOfWidths.size() == 1 && mapOfHeights.size() == 1) { + unsigned int width = mapOfWidths.begin()->first; + unsigned int height = mapOfHeights.begin()->first; + + RGBa.resize(height, width); + + unsigned int size = width*height; + for(unsigned int i = 0; i < size; i++) { + if(R != NULL) { + RGBa.bitmap[i].R = R->bitmap[i]; + } + + if(G != NULL) { + RGBa.bitmap[i].G = G->bitmap[i]; + } + + if(B != NULL) { + RGBa.bitmap[i].B = B->bitmap[i]; + } + + if(a != NULL) { + RGBa.bitmap[i].A = a->bitmap[i]; + } + } + } else { + throw vpException(vpException::dimensionError, "Mismatch dimensions !"); + } +} + /*! Converts a MONO16 grey scale image (each pixel is coded by two bytes) into a @@ -3547,6 +3506,270 @@ void vpImageConvert::MONO16ToRGBa(unsigned char *grey16, unsigned char *rgba, un } } +void vpImageConvert::HSV2RGB(const double *hue_, const double *saturation_, const double *value_, unsigned char *rgb, + const unsigned int size, const unsigned int step) { + for(unsigned int i = 0; i < size; i++) { + double h, s, v; + double f, p, q, t; + double hue = hue_[i], saturation = saturation_[i], value = value_[i]; + + if (vpMath::equal(saturation, 0.0, std::numeric_limits<double>::epsilon())) { + hue = value; + saturation = value; + } else { + h = hue * 6.0; + s = saturation; + v = value; + + if (vpMath::equal(h, 6.0, std::numeric_limits<double>::epsilon())) { + h = 0.0; + } + + f = h - (int) h; + p = v * (1.0 - s); + q = v * (1.0 - s * f); + t = v * (1.0 - s * (1.0 - f)); + + switch ((int) h) { + case 0: + hue = v; + saturation = t; + value = p; + break; + + case 1: + hue = q; + saturation = v; + value = p; + break; + + case 2: + hue = p; + saturation = v; + value = t; + break; + + case 3: + hue = p; + saturation = q; + value = v; + break; + + case 4: + hue = t; + saturation = p; + value = v; + break; + + default: //case 5: + hue = v; + saturation = p; + value = q; + break; + } + } + + rgb[i*step] = (unsigned char) vpMath::round(hue * 255.0); + rgb[i*step + 1] = (unsigned char) vpMath::round(saturation * 255.0); + rgb[i*step + 2] = (unsigned char) vpMath::round(value * 255.0); + } +} + +void vpImageConvert::RGB2HSV(const unsigned char *rgb, double *hue, double *saturation, double *value, + const unsigned int size, const unsigned int step) { + for(unsigned int i = 0; i < size; i++) { + double red, green, blue; + double h, s, v; + double min, max; + double delta; + + red = rgb[i*step] / 255.0; + green = rgb[i*step + 1] / 255.0; + blue = rgb[i*step + 2] / 255.0; + + if (red > green) { + max = (std::max)(red, blue); + min = (std::min)(green, blue); + } else { + max = (std::max)(green, blue); + min = (std::min)(red, blue); + } + + v = max; + + if (!vpMath::equal(max, 0.0, std::numeric_limits<double>::epsilon())) { + s = (max - min) / max; + } else { + s = 0.0; + } + + if (vpMath::equal(s, 0.0, std::numeric_limits<double>::epsilon())) { + h = 0.0; + } else { + delta = max - min; + if (vpMath::equal(delta, 0.0, std::numeric_limits<double>::epsilon())) { + delta = 1.0; + } + + if (vpMath::equal(red, max, std::numeric_limits<double>::epsilon())) { + h = (green - blue) / delta; + } else if (vpMath::equal(green, max, std::numeric_limits<double>::epsilon())) { + h = 2 + (blue - red) / delta; + } else { + h = 4 + (red - green) / delta; + } + + h /= 6.0; + if (h < 0.0) { + h += 1.0; + } else if (h > 1.0) { + h -= 1.0; + } + } + + hue[i] = h; + saturation[i] = s; + value[i] = v; + } +} + +/*! + Converts an array of hue, saturation and value to an array of RGBa values. + + \param hue : Array of hue values (range between [0 - 1]). + \param saturation : Array of saturation values (range between [0 - 1]). + \param value : Array of value values (range between [0 - 1]). + \param rgba : RGBa array values (with alpha channel set to zero) converted from HSV color space. + \param size : The total image size or the number of pixels. +*/ +void vpImageConvert::HSVToRGBa(const double *hue, const double *saturation, const double *value, unsigned char *rgba, + const unsigned int size) { + vpImageConvert::HSV2RGB(hue, saturation, value, rgba, size, 4); +} + +/*! + Converts an array of hue, saturation and value to an array of RGBa values. + + \param hue : Array of hue values (range between [0 - 255]). + \param saturation : Array of saturation values (range between [0 - 255]). + \param value : Array of value values (range between [0 - 255]). + \param rgba : RGBa array values (with alpha channel set to zero) converted from HSV color space. + \param size : The total image size or the number of pixels. +*/ +void vpImageConvert::HSVToRGBa(const unsigned char *hue, const unsigned char *saturation, const unsigned char *value, + unsigned char *rgba, const unsigned int size) { + for(unsigned int i = 0; i < size; i++) { + double h = hue[i] / 255.0, s = saturation[i] / 255.0, v = value[i] / 255.0; + + vpImageConvert::HSVToRGBa(&h, &s, &v, (rgba + i*4), 1); + } +} + +/*! + Converts an array of RGBa to an array of hue, saturation, value values. + The alpha channel is not used. + + \param rgba : RGBa array values. + \param hue : Array of hue values converted from RGB color space (range between [0 - 1]). + \param saturation : Array of saturation values converted from RGB color space (range between [0 - 1]). + \param value : Array of value values converted from RGB color space (range between [0 - 1]). + \param size : The total image size or the number of pixels. +*/ +void vpImageConvert::RGBaToHSV(const unsigned char *rgba, double *hue, double *saturation, double *value, + const unsigned int size) { + vpImageConvert::RGB2HSV(rgba, hue, saturation, value, size, 4); +} + +/*! + Converts an array of RGBa to an array of hue, saturation, value values. + The alpha channel is not used. + + \param rgba : RGBa array values. + \param hue : Array of hue values converted from RGB color space (range between [0 - 255]). + \param saturation : Array of saturation values converted from RGB color space (range between [0 - 255]). + \param value : Array of value values converted from RGB color space (range between [0 - 255]). + \param size : The total image size or the number of pixels. +*/ +void vpImageConvert::RGBaToHSV(const unsigned char *rgba, unsigned char *hue, unsigned char *saturation, + unsigned char *value, const unsigned int size) { + for(unsigned int i = 0; i < size; i++) { + double h, s, v; + vpImageConvert::RGBaToHSV((rgba + i*4), &h, &s, &v, 1); + + hue[i] = (unsigned char) (255.0 * h); + saturation[i] = (unsigned char) (255.0 * s); + value[i] = (unsigned char) (255.0 * v); + } +} + +/*! + Converts an array of hue, saturation and value to an array of RGB values. + + \param hue : Array of hue values (range between [0 - 1]). + \param saturation : Array of saturation values (range between [0 - 1]). + \param value : Array of value values (range between [0 - 1]). + \param rgb : RGB array values converted from RGB color space. + \param size : The total image size or the number of pixels. +*/ +void vpImageConvert::HSVToRGB(const double *hue, const double *saturation, const double *value, unsigned char *rgb, + const unsigned int size) { + vpImageConvert::HSV2RGB(hue, saturation, value, rgb, size, 3); +} + +/*! + Converts an array of hue, saturation and value to an array of RGB values. + + \param hue : Array of hue values (range between [0 - 255]). + \param saturation : Array of saturation values (range between [0 - 255]). + \param value : Array of value values (range between [0 - 255]). + \param rgb : RGB array values converted from HSV color space. + \param size : The total image size or the number of pixels. +*/ +void vpImageConvert::HSVToRGB(const unsigned char *hue, const unsigned char *saturation, const unsigned char *value, + unsigned char *rgb, const unsigned int size) { + for(unsigned int i = 0; i < size; i++) { + double h = hue[i] / 255.0, s = saturation[i] / 255.0, v = value[i] / 255.0; + + vpImageConvert::HSVToRGB(&h, &s, &v, (rgb + i*3), 1); + } +} + +/*! + Converts an array of RGB to an array of hue, saturation, value values. + + \param rgb : RGB array values. + \param hue : Array of hue values converted from RGB color space (range between [0 - 1]). + \param saturation : Array of saturation values converted from RGB color space (range between [0 - 1]). + \param value : Array of value values converted from RGB color space (range between [0 - 1]). + \param size : The total image size or the number of pixels. +*/ +void vpImageConvert::RGBToHSV(const unsigned char *rgb, double *hue, double *saturation, double *value, + const unsigned int size) { + vpImageConvert::RGB2HSV(rgb, hue, saturation, value, size, 3); +} + +/*! + Converts an array of RGB to an array of hue, saturation, value values. + + \param rgb : RGB array values. + \param hue : Array of hue values converted from RGB color space (range between [0 - 255]). + \param saturation : Array of saturation values converted from RGB color space (range between [0 - 255]). + \param value : Array of value values converted from RGB color space (range between [0 - 255]). + \param size : The total image size or the number of pixels. +*/ +void vpImageConvert::RGBToHSV(const unsigned char *rgb, unsigned char *hue, unsigned char *saturation, unsigned char *value, + const unsigned int size) { + for(unsigned int i = 0; i < size; i++) { + double h, s, v; + + vpImageConvert::RGBToHSV((rgb + i*3), &h, &s, &v, 1); + + hue[i] = (unsigned char) (255.0 * h); + saturation[i] = (unsigned char) (255.0 * s); + value[i] = (unsigned char) (255.0 * v); + } +} + /* * Local variables: * c-basic-offset: 2 diff --git a/src/image/vpImageFilter.cpp b/modules/core/src/image/vpImageFilter.cpp similarity index 94% rename from src/image/vpImageFilter.cpp rename to modules/core/src/image/vpImageFilter.cpp index 1739fe8266fbdbcbe38d0cf8e410842e4cdba07b..8088d2ae9d17dc532e6827b7ceae1f19673d8a00 100644 --- a/src/image/vpImageFilter.cpp +++ b/modules/core/src/image/vpImageFilter.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImageFilter.cpp 5200 2015-01-24 08:34:54Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Various image tools, convolution, ... * @@ -39,8 +35,8 @@ * *****************************************************************************/ -#include <visp/vpImageFilter.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpImageFilter.h> +#include <visp3/core/vpImageConvert.h> #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020408) # include <opencv2/imgproc/imgproc.hpp> #elif defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020101) @@ -141,9 +137,9 @@ vpImageFilter::filter(const vpImage<double> &I, The following example shows how to use the method: \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageFilter.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImageFilter.h> int main() { @@ -338,6 +334,26 @@ void vpImageFilter::gaussianBlur(const vpImage<unsigned char> &I, vpImage<double delete[] fg; } +/*! + Apply a Gaussian blur to a double image. + \param I : Input double image. + \param GI : Filtered image. + \param size : Filter size. This value should be odd. + \param sigma : Gaussian standard deviation. If it is equal to zero or negative, it is computed from filter size as sigma = (size-1)/6. + \param normalize : Flag indicating whether to normalize the filter coefficients or not. + + */ +void vpImageFilter::gaussianBlur(const vpImage<double> &I, vpImage<double>& GI, unsigned int size, double sigma, bool normalize) +{ + double *fg=new double[(size+1)/2] ; + vpImageFilter::getGaussianKernel(fg, size, sigma, normalize) ; + vpImage<double> GIx ; + vpImageFilter::filterX(I, GIx,fg,size); + vpImageFilter::filterY(GIx, GI,fg,size); + GIx.destroy(); + delete[] fg; +} + /*! Return the coefficients of a Gaussian filter. diff --git a/src/image/vpImagePoint.cpp b/modules/core/src/image/vpImagePoint.cpp similarity index 86% rename from src/image/vpImagePoint.cpp rename to modules/core/src/image/vpImagePoint.cpp index c0a833969da8b61002db6b81ba5da7ae3d2876ea..fa44a4dcc598ec6940e09d62ddc12cecaa63fd89 100644 --- a/src/image/vpImagePoint.cpp +++ b/modules/core/src/image/vpImagePoint.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImagePoint.cpp 5244 2015-02-03 06:44:17Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D point useful for image processing * @@ -41,10 +37,9 @@ *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpImagePoint.h> -#include <visp/vpRect.h> -#include <visp/vpHomography.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpRect.h> /*! @@ -63,30 +58,6 @@ bool vpImagePoint::inRectangle( const vpRect &rect ) const this->j >= rect.getLeft()); } -/*! - Project the current image point (in frame b) into the frame a using the - homography aHb. - - \param aHb : Homography defining the relation between frame a and frame b. - \return The projected image point in the frame a. -*/ -vpImagePoint -vpImagePoint::projection(const vpHomography& aHb) -{ - vpImagePoint ap; - - double i_a = aHb[0][0] * i + aHb[0][1] * j + aHb[0][2]; - double j_a = aHb[1][0] * i + aHb[1][1] * j + aHb[1][2]; - double k_a = aHb[2][0] * i + aHb[2][1] * j + aHb[2][2]; - - if(std::fabs(k_a) > std::numeric_limits<double>::epsilon()){ - ap.set_i(i_a / k_a); - ap.set_j(j_a / k_a); - } - - return ap; -} - /*! Operator +=. @@ -96,7 +67,7 @@ vpImagePoint::projection(const vpHomography& aHb) \code #include <iostream> #include <vector> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> int main() { @@ -128,7 +99,7 @@ vpImagePoint& vpImagePoint::operator+=(const vpImagePoint &ip) { \code #include <iostream> #include <vector> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> int main() { @@ -222,7 +193,7 @@ VISP_EXPORT vpImagePoint operator+=( const vpImagePoint &ip1, const vpImagePoint \code #include <iostream> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> int main() { @@ -245,7 +216,7 @@ VISP_EXPORT vpImagePoint operator+( const vpImagePoint &ip1, const int offset ) \code #include <iostream> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> int main() { @@ -279,7 +250,7 @@ VISP_EXPORT vpImagePoint operator-( const vpImagePoint &ip1, const vpImagePoint \code #include <iostream> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> int main() { @@ -302,7 +273,7 @@ VISP_EXPORT vpImagePoint operator-( const vpImagePoint &ip1, const int offset ) \code #include <iostream> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> int main() { @@ -325,7 +296,7 @@ VISP_EXPORT vpImagePoint operator-( const vpImagePoint &ip1, const double offset \code #include <iostream> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> int main() { @@ -348,7 +319,7 @@ VISP_EXPORT vpImagePoint operator*( const vpImagePoint &ip1, const double scale \code #include <iostream> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> int main() { @@ -377,7 +348,7 @@ VISP_EXPORT vpImagePoint operator/( const vpImagePoint &ip1, const double scale \code #include <iostream> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> int main() { vpImagePoint ip; diff --git a/src/image/vpImageTools.cpp b/modules/core/src/image/vpImageTools.cpp similarity index 92% rename from src/image/vpImageTools.cpp rename to modules/core/src/image/vpImageTools.cpp index 091bef3f7275b811d0b6798f2bb5188afbe29cc5..ae1f2b9618b221ec026f4f4f50de98fad23ad62e 100644 --- a/src/image/vpImageTools.cpp +++ b/modules/core/src/image/vpImageTools.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImageTools.cpp 5236 2015-01-30 13:51:42Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Image tools. * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpImageTools.h> +#include <visp3/core/vpImageTools.h> /*! @@ -73,9 +69,9 @@ thresholding this image at level 127 can be done by: \code -#include <visp/vpImageTools.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> int main() { diff --git a/src/image/vpRGBa.cpp b/modules/core/src/image/vpRGBa.cpp similarity index 89% rename from src/image/vpRGBa.cpp rename to modules/core/src/image/vpRGBa.cpp index 297b320586f873876472acdce125428fc27d4f72..368c1885841ec0e822482f06dd0640aad6b4aa18 100644 --- a/src/image/vpRGBa.cpp +++ b/modules/core/src/image/vpRGBa.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRGBa.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * RGBA pixel. * @@ -47,10 +43,10 @@ */ -#include <visp/vpRGBa.h> -#include <visp/vpColor.h> -#include <visp/vpDebug.h> -#include <visp/vpException.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpException.h> /*! @@ -129,16 +125,7 @@ bool vpRGBa::operator==(const vpRGBa &v) */ bool vpRGBa::operator!=(const vpRGBa &v) { - if (R == v.R) - return false; - if (G == v.G) - return false; - if (B == v.B) - return false; - if (A == v.A) - return false; - - return true ; + return (R != v.R || G != v.G || B != v.B || A != v.A); } /*! diff --git a/src/math/kalman/vpKalmanFilter.cpp b/modules/core/src/math/kalman/vpKalmanFilter.cpp similarity index 96% rename from src/math/kalman/vpKalmanFilter.cpp rename to modules/core/src/math/kalman/vpKalmanFilter.cpp index 8fe3cd916e03168397b2b6cc58ec50eac1009a9a..b78757389d50408ae1abbc1b55b82e5d0e0c1710 100644 --- a/src/math/kalman/vpKalmanFilter.cpp +++ b/modules/core/src/math/kalman/vpKalmanFilter.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpKalmanFilter.cpp 5060 2014-12-12 18:31:03Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -45,7 +42,7 @@ \brief Generic kalman filtering implementation. */ -#include <visp/vpKalmanFilter.h> +#include <visp3/core/vpKalmanFilter.h> #include <math.h> #include <stdlib.h> @@ -212,7 +209,7 @@ vpKalmanFilter::prediction() */ void -vpKalmanFilter::filtering(vpColVector &z) +vpKalmanFilter::filtering(const vpColVector &z) { if (verbose_mode) std::cout << "z " << std::endl << z << std::endl ; diff --git a/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp b/modules/core/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp similarity index 97% rename from src/math/kalman/vpLinearKalmanFilterInstantiation.cpp rename to modules/core/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp index dbd55d47eabd5a36f9e399faf1055e84deb5b36e..9f65574ad539b4f16608285a4f43dd71100d96cc 100644 --- a/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp +++ b/modules/core/src/math/kalman/vpLinearKalmanFilterInstantiation.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpLinearKalmanFilterInstantiation.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -44,9 +41,9 @@ \brief Implementation of some specific Kalman filters. */ -#include <visp/vpLinearKalmanFilterInstantiation.h> -#include <visp/vpDebug.h> -#include <visp/vpException.h> +#include <visp3/core/vpLinearKalmanFilterInstantiation.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpException.h> #include <math.h> #include <stdlib.h> @@ -94,7 +91,7 @@ dimensional signal. \code -#include <visp/vpLinearKalmanFilterInstantiation.h> +#include <visp3/core/vpLinearKalmanFilterInstantiation.h> int main() { @@ -119,7 +116,7 @@ int main() velocities from velocity measures. \code -#include <visp/vpLinearKalmanFilterInstantiation.h> +#include <visp3/core/vpLinearKalmanFilterInstantiation.h> int main() { @@ -463,7 +460,7 @@ vpLinearKalmanFilterInstantiation::initStateConstVel_MeasurePos(unsigned int n_s measures. \code -#include <visp/vpLinearKalmanFilterInstantiation.h> +#include <visp3/core/vpLinearKalmanFilterInstantiation.h> int main() { @@ -681,7 +678,7 @@ vpLinearKalmanFilterInstantiation::initStateConstVelWithColoredNoise_MeasureVel( measures. \code -#include <visp/vpLinearKalmanFilterInstantiation.h> +#include <visp3/core/vpLinearKalmanFilterInstantiation.h> int main() { diff --git a/modules/core/src/math/matrix/vpColVector.cpp b/modules/core/src/math/matrix/vpColVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cb2d9e5148a56f9c73c29616041e4e07f37a8d14 --- /dev/null +++ b/modules/core/src/math/matrix/vpColVector.cpp @@ -0,0 +1,1274 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Provide some simple operation on column vectors. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + + +/*! + \file vpColVector.cpp + \brief Class that provides a data structure for the column vectors as well + as a set of operations on these vectors +*/ + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <cmath> // std::fabs +#include <limits> // numeric_limits +#include <string.h> +#include <math.h> +#include <sstream> +#include <assert.h> + +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpRotationVector.h> + + +//! Operator that allows to add two column vectors. +vpColVector +vpColVector::operator+(const vpColVector &v) const +{ + if (getRows() != v.getRows() ) { + throw(vpException(vpException::dimensionError, + "Cannot add (%dx1) column vector to (%dx1) column vector", + getRows(), v.getRows())) ; + } + vpColVector r(rowNum); + + for (unsigned int i=0;i<rowNum;i++) + r[i] = (*this)[i] + v[i]; + return r; +} + +//! Operator that allows to add two column vectors. +vpColVector & +vpColVector::operator+=(vpColVector v) +{ + if (getRows() != v.getRows() ) { + throw(vpException(vpException::dimensionError, + "Cannot add (%dx1) column vector to (%dx1) column vector", + getRows(), v.getRows())) ; + } + + for (unsigned int i=0;i<rowNum;i++) + (*this)[i] += v[i]; + return (*this); +} +//! Operator that allows to substract two column vectors. +vpColVector & +vpColVector::operator-=(vpColVector v) +{ + if (getRows() != v.getRows() ) { + throw(vpException(vpException::dimensionError, + "Cannot substract (%dx1) column vector to (%dx1) column vector", + getRows(), v.getRows())) ; + } + + for (unsigned int i=0;i<rowNum;i++) + (*this)[i] -= v[i]; + return (*this); +} + + +/*! + Operator that performs the dot product between two column vectors. + + \exception vpException::dimensionError If the vector dimension differ. + + \sa dotProd() + */ +double +vpColVector::operator*(const vpColVector &v) const +{ + if (size() != v.size()) { + throw(vpException(vpException::dimensionError, + "Cannot compute the dot product between column vectors with different dimensions (%d) and (%d)", + size(), v.size())); + } + double r = 0 ; + + for (unsigned int i=0;i<rowNum;i++) + r += (*this)[i] * v[i]; + return r; +} + +/*! + + Multiply a column vector by a row vector. + + \param v : Row vector. + + \return The resulting matrix. + +*/ +vpMatrix vpColVector::operator*(const vpRowVector &v) const +{ + vpMatrix M(rowNum, v.getCols()); + for (unsigned int i=0; i<rowNum; i++) { + for (unsigned int j=0; j<v.getCols(); j++) { + M[i][j] = (*this)[i] * v[j]; + } + } + return M; +} + +//! operator substraction of two vectors V = A-v +vpColVector vpColVector::operator-(const vpColVector &m) const +{ + if (getRows() != m.getRows() ) { + throw(vpException(vpException::dimensionError, + "Bad size during vpColVector (%dx1) and vpColVector (%dx1) substraction", + getRows(), m.getRows())) ; + } + vpColVector v(rowNum); + + for (unsigned int i=0;i<rowNum;i++) + v[i] = (*this)[i] - m[i]; + return v; +} + +/*! + Construct a column vector from a part of an input column vector \e v. + + \param v : Input column vector used for initialization. + \param r : row index in \e v that corresponds to the first element of the column vector to contruct. + \param nrows : Number of rows of the constructed column vector. + + The sub-vector starting from v[r] element and ending on v[r+nrows-1] element + is used to initialize the contructed column vector. + + \sa init() +*/ +vpColVector::vpColVector (const vpColVector &v, unsigned int r, unsigned int nrows) + : vpArray2D<double>(nrows, 1) +{ + init(v, r, nrows); +} + +/*! + Initialize the column vector from a part of an input column vector \e v. + + \param v : Input column vector used for initialization. + \param r : row index in \e v that corresponds to the first element of the column vector to contruct. + \param nrows : Number of rows of the constructed column vector. + + The sub-vector starting from v[r] element and ending on v[r+nrows-1] element + is used to initialize the contructed column vector. + + The following code shows how to use this function: +\code +#include <visp3/core/vpColVector.h> + +int main() +{ + vpColVector v(4); + int val = 0; + for(size_t i=0; i<v.getRows(); i++) { + v[i] = val++; + } + std::cout << "v: " << v.t() << std::endl; + + vpColVector w; + w.init(v, 0, 2); + std::cout << "w: " << w.t() << std::endl; + +} +\endcode + It produces the following output: + \code +v: 0 1 2 3 +w: 1 2 + \endcode + */ +void +vpColVector::init(const vpColVector &v, unsigned int r, unsigned int nrows) +{ + unsigned int rnrows = r+nrows ; + + if (rnrows > v.getRows()) + throw(vpException(vpException::dimensionError, + "Bad row dimension (%d > %d) used to initialize vpColVector", + rnrows, v.getRows())); + resize(nrows); + + if (this->rowPtrs == NULL) // Fix coverity scan: explicit null dereferenced + return; // Noting to do + for (unsigned int i=r ; i < rnrows; i++) + (*this)[i-r] = v[i]; +} + +vpColVector::vpColVector (const vpRotationVector &v) + : vpArray2D<double>(v.size(), 1) +{ + for (unsigned int i=0; i< v.size(); i++) + (*this)[i] = v[i]; +} + +vpColVector::vpColVector (const vpPoseVector &p) + : vpArray2D<double>(p.size(), 1) +{ + for (unsigned int i=0; i< p.size(); i++) + (*this)[i] = p[i]; +} + +vpColVector::vpColVector (const vpTranslationVector &v) + : vpArray2D<double>(v.size(), 1) +{ + for (unsigned int i=0; i< v.size(); i++) + (*this)[i] = v[i]; +} + +//! Constructor that take column j of matrix M. +vpColVector::vpColVector (const vpMatrix &M, unsigned int j) + : vpArray2D<double>(M.getRows(), 1) +{ + for(unsigned int i=0; i< M.getCols(); i++) + (*this)[i] = M[i][j]; +} + +/*! + Constructor that creates a column vector from a m-by-1 matrix \e M. + + \exception vpException::dimensionError If the matrix is not a m-by-1 matrix. + */ +vpColVector::vpColVector (const vpMatrix &M) + : vpArray2D<double>(M.getRows(), 1) +{ + if(M.getCols()!=1) { + throw(vpException(vpException::dimensionError, + "Cannot construct a (%dx1) row vector from a (%dx%d) matrix", + M.getRows(), M.getRows(), M.getCols())) ; + } + + for(unsigned int i=0; i< M.getRows(); i++) + (*this)[i] = M[i][0]; +} + +/*! + Constructor that creates a column vector from a std vector of double. + */ +vpColVector::vpColVector (const std::vector<double> &v) + : vpArray2D<double>(1, (unsigned int)v.size()) +{ + for(unsigned int i=0; i< v.size(); i++) + (*this)[i] = v[i]; +} +/*! + Constructor that creates a column vector from a std vector of float. + */ +vpColVector::vpColVector (const std::vector<float> &v) + : vpArray2D<double>(1, (unsigned int)v.size()) +{ + for(unsigned int i=0; i< v.size(); i++) + (*this)[i] = (double)(v[i]); +} + +/*! + Operator that allows to negate all the column vector elements. + + \code + vpColVector r(3, 1); + // r contains [1 1 1]^T + vpColVector v = -r; + // v contains [-1 -1 -1]^T + \endcode + */ +vpColVector vpColVector::operator-() const +{ + vpColVector A ; + try { + A.resize(rowNum) ; + } + catch(vpException &/*e*/) + { + vpERROR_TRACE("Error caught") ; + throw ; + } + + double *vd = A.data ; double *d = data ; + + for (unsigned int i=0; i<rowNum; i++) + *(vd++)= - (*d++); + + return A; +} + +/*! + Operator that allows to multiply each element of a column vector by a scalar. + + \param x : The scalar. + + \return The column vector multiplied by the scalar. The current + column vector (*this) is unchanged. + + \code + vpColVector v(3); + v[0] = 1; + v[1] = 2; + v[2] = 3; + + vpColVector w = v * 3; + // v is unchanged + // w is now equal to : [3, 6, 9] + \endcode +*/ +vpColVector vpColVector::operator*(double x) const +{ + vpColVector v(rowNum); + + double *vd = v.data ; double *d = data ; + + for (unsigned int i=0;i<rowNum;i++) + *(vd++) = (*d++) * x; + return v; +} + +/*! + Operator that allows to multiply each element of a column vector by a scalar. + + \param x : The scalar. + + \return The column vector multiplied by the scalar. + + \code + vpColVector v(3); + v[0] = 1; + v[1] = 2; + v[2] = 3; + + v *= 3; + // v is now equal to : [3, 6, 9] + \endcode +*/ +vpColVector &vpColVector::operator*=(double x) +{ + for (unsigned int i=0;i<rowNum;i++) + (*this)[i] *= x; + return (*this); +} + +/*! + Operator that allows to divide each element of a column vector by a scalar. + + \param x : The scalar. + + \return The column vector divided by the scalar. + + \code + vpColVector v(3); + v[0] = 8; + v[1] = 4; + v[2] = 2; + + v /= 2; + // v is now equal to : [4, 2, 1] + \endcode +*/ +vpColVector &vpColVector::operator/=(double x) +{ + for (unsigned int i=0;i<rowNum;i++) + (*this)[i] /= x; + return (*this); +} + +/*! + Operator that allows to divide each element of a column vector by a scalar. + + \param x : The scalar. + + \return The column vector divided by the scalar. The current + column vector (*this) is unchanged. + + \code + vpColVector v(3); + v[0] = 8; + v[1] = 4; + v[2] = 2; + + vpColVector w = v / 2; + // v is unchanged + // w is now equal to : [4, 2, 1] + \endcode +*/ +vpColVector vpColVector::operator/(double x) const +{ + vpColVector v(rowNum); + + double *vd = v.data ; double *d = data ; + + for (unsigned int i=0;i<rowNum;i++) + *(vd++) = (*d++) / x; + return v; +} + +/*! + Transform a m-by-1 matrix into a column vector. + \warning Handled with care; M should be a 1 column matrix. + \exception vpException::dimensionError If the matrix has more than 1 column. +*/ +vpColVector &vpColVector::operator=(const vpMatrix &M) +{ + if (M.getCols() !=1) { + throw (vpException(vpException::dimensionError, + "Cannot transform a (%dx%d) matrix into a column vector", + M.getRows(), M.getCols())); + } + + try { + resize(M.getRows()); + } + catch(...) { + throw ; + } + + memcpy(data, M.data, rowNum*sizeof(double)) ; + + return (*this); +} + +/*! + Initialize a row vector from a standard vector of double. +*/ +vpColVector & vpColVector::operator=(const std::vector<double> &v) +{ + resize((unsigned int)v.size()); + for(unsigned int i=0; i<v.size(); i++) + (*this)[i] = v[i]; + return *this; +} +/*! + Initialize a row vector from a standard vector of double. +*/ +vpColVector & vpColVector::operator=(const std::vector<float> &v) +{ + resize((unsigned int)v.size()); + for(unsigned int i=0; i<v.size(); i++) + (*this)[i] = (float)v[i]; + return *this; +} + +vpColVector &vpColVector::operator=(const vpColVector &v) +{ + unsigned int k = v.rowNum ; + if (rowNum != k){ + try { + resize(k); + } + catch(...) + { + throw ; + } + } + + memcpy(data, v.data, rowNum*sizeof(double)) ; + return *this; +} + +/*! + Operator that allows to convert a translation vector into a column vector. + */ +vpColVector &vpColVector::operator=(const vpTranslationVector &tv) +{ + unsigned int k = tv.getRows() ; + if (rowNum != k){ + try { + resize(k); + } + catch(...) + { + throw ; + } + } + + memcpy(data, tv.data, rowNum*sizeof(double)) ; + return *this; +} +/*! + Operator that allows to convert a rotation vector into a column vector. + */ +vpColVector &vpColVector::operator=(const vpRotationVector &rv) +{ + unsigned int k = rv.getRows() ; + if (rowNum != k){ + try { + resize(k); + } + catch(...) + { + throw ; + } + } + + memcpy(data, rv.data, rowNum*sizeof(double)) ; + return *this; +} +/*! + Operator that allows to convert a pose vector into a column vector. + */ +vpColVector &vpColVector::operator=(const vpPoseVector &p) +{ + unsigned int k = p.getRows() ; + if (rowNum != k){ + try { + resize(k); + } + catch(...) + { + throw ; + } + } + + memcpy(data, p.data, rowNum*sizeof(double)) ; + return *this; +} + +/*! + Copy operator. + Allows operation such as A << v + \code +#include <visp3/core/vpColVector.h> + +int main() +{ + vpColVector A, B(5); + for (unsigned int i=0; i<B.size(); i++) + B[i] = i; + A << B; + std::cout << "A: " << A.t() << std::endl; +} + \endcode + In column vector A we get: + \code +A: 0 1 2 3 4 + \endcode + */ +vpColVector & vpColVector::operator<<(const vpColVector &v) +{ + *this = v; + return *this; +} + +/*! + Assigment operator. Allow operation such as A = *v + + The following example shows how to use this operator. + \code +#include <visp3/core/vpColVector.h> + +int main() +{ + size_t n = 5; + vpColVector A(n); + double *B = new double [n]; + for (unsigned int i = 0; i < n; i++) + B[i] = i; + A << B; + std::cout << "A: " << A.t() << std::endl; + delete [] B; +} + \endcode + It produces the following output: + \code +A: 0 1 2 3 4 + \endcode + */ +vpColVector & vpColVector::operator<<( double *x ) +{ + for (unsigned int i=0; i<rowNum; i++) { + for (unsigned int j=0; j<colNum; j++) { + rowPtrs[i][j] = *x++; + } + } + return *this; +} + +//! Set each element of the column vector to x. +vpColVector & vpColVector::operator=(double x) +{ + double *d = data ; + + for (unsigned int i=0;i<rowNum;i++) + *(d++)= x ; + return *this; +} + +/*! + Transpose the column vector. The resulting vector becomes a row vector. +*/ +vpRowVector vpColVector::t() const +{ + vpRowVector v(rowNum); + memcpy(v.data, data, rowNum*sizeof(double)) ; + return v; +} + +/*! + Transpose the column vector. The resulting vector becomes a row vector. + \sa t() +*/ +vpRowVector vpColVector::transpose() const +{ + return t(); +} + +/*! + Transpose the column vector. The resulting vector \e v becomes a row vector. + \sa t() +*/ +void vpColVector::transpose(vpRowVector &v) const +{ + v = t(); +} + + +/*! + \relates vpColVector + Allows to multiply a scalar by a column vector. +*/ +vpColVector operator*(const double &x, const vpColVector &v) +{ + vpColVector vout ; + vout = v*x ; + return vout ; +} + +/*! + Compute end return the dot product of two column vectors: + \f[ a \cdot b = \sum_{i=0}^n a_i * b_i\f] where \e n is the dimension of both vectors. + + \exception vpException::dimensionError If the vector dimension differ. +*/ +double +vpColVector::dotProd(const vpColVector &a, const vpColVector &b) +{ + if (a.data==NULL) { + throw(vpException(vpException::fatalError, + "Cannot compute the dot product: first vector empty")) ; + } + if (b.data==NULL) { + throw(vpException(vpException::fatalError, + "Cannot compute the dot product: second vector empty")) ; + } + if (a.size() != b.size()) { + throw(vpException(vpException::dimensionError, + "Cannot compute the dot product between column vectors with different dimensions (%d) and (%d)", + a.size(), b.size())); + } + + double *ad = a.data ; double *bd = b.data ; + + double c = 0 ; + for (unsigned int i=0 ; i < a.getRows() ; i++) + c += *(ad++)* *(bd++) ; + // vpMatrix c = (a.t() * b); + // return c[0][0]; + return c ; +} + +/*! + Normalise the vector: + + \f[ + {\bf x}_i = \frac{{\bf x}_i}{\sqrt{\sum_{i=1}^{n}x^2_i}} + \f] +*/ + vpColVector &vpColVector::normalize(vpColVector &x) const + { + x = x/sqrt(x.sumSquare()); + + return x; + } + + +/*! + Normalise the vector: + + \f[ + {\bf x}_i = \frac{{\bf x}_i}{\sqrt{\sum_{i=1}^{n}x^2_i}} + \f] +*/ +vpColVector &vpColVector::normalize() +{ + + double sum_square = sumSquare(); + + //if (sum != 0.0) + if (std::fabs(sum_square) > std::numeric_limits<double>::epsilon()) + *this /= sqrt(sum_square) ; + + // If sum = 0, we have a nul vector. So we return just. + return *this; +} + +/*! + Return a column vector with elements of \e v that are reverse sorted. + \sa sort() + */ +vpColVector +vpColVector::invSort(const vpColVector &v) +{ + if (v.data==NULL) { + throw(vpException(vpException::fatalError, + "Cannot sort content of column vector: vector empty")) ; + } + vpColVector tab ; + tab = v ; + unsigned int nb_permutation = 1 ; + unsigned int i = 0 ; + while (nb_permutation !=0 ) + { + nb_permutation = 0 ; + for (unsigned int j = v.getRows()-1 ; j >= i+1 ; j--) + { + if ((tab[j]>tab[j-1])) + { + double tmp = tab[j] ; + tab[j] = tab[j-1] ; + tab[j-1] = tmp ; + nb_permutation++ ; + } + } + i++ ; + } + + return tab ; +} + +/*! + Return a column vector with elements of \e v that are sorted. + \sa invSort() + */ +vpColVector +vpColVector::sort(const vpColVector &v) +{ + if (v.data==NULL) { + throw(vpException(vpException::fatalError, + "Cannot sort content of column vector: vector empty")) ; + } + vpColVector tab ; + tab = v ; + unsigned int nb_permutation = 1 ; + unsigned int i = 0 ; + while (nb_permutation !=0 ) + { + nb_permutation = 0 ; + for (unsigned int j = v.getRows()-1 ; j >= i+1 ; j--) + { + if ((tab[j]<tab[j-1])) + { + double tmp = tab[j] ; + tab[j] = tab[j-1] ; + tab[j-1] = tmp ; + nb_permutation++ ; + } + } + i++ ; + } + + return tab ; +} + +/*! + Stack column vector with a new element at the end of the vector. + + \param d : Element to stack to the existing vector. + + \code + vpColVector v(3, 1); + // v is equal to [1 1 1]^T + v.stack(-2); + // v is equal to [1 1 1 -2]^T + \endcode + + \sa stack(const vpColVector &, const vpColVector &) + \sa stack(const vpColVector &, const vpColVector &, vpColVector &) + +*/ +void vpColVector::stack(const double &d) +{ + this->resize(rowNum+1,false); + (*this)[rowNum-1] = d; +} + +/*! + Stack column vectors. + + \param v : Vector to stack to the existing one. + + \code + vpColVector v1(3, 1); + // v1 is equal to [1 1 1]^T + vpColVector v2(2, 3); + // v2 is equal to [3 3]^T + v1.stack(v2); + // v1 is equal to [1 1 1 3 3]^T + \endcode + + \sa stack(const vpColVector &, const double &) + \sa stack(const vpColVector &, const vpColVector &) + \sa stack(const vpColVector &, const vpColVector &, vpColVector &) + +*/ +void vpColVector::stack(const vpColVector &v) +{ + *this = vpColVector::stack(*this, v); +} + +/*! + Stack column vectors. + + \param A : Initial vector. + \param B : Vector to stack at the end of A. + \return Stacked vector \f$[A B]^T\f$. + + \code + vpColVector A(3); + vpColVector B(5); + vpColVector C; + C = vpColVector::stack(A, B); // C = [A B]T + // C is now an 8 dimension column vector + \endcode + + \sa stack(const vpColVector &) + \sa stack(const vpColVector &, const vpColVector &, vpColVector &) +*/ +vpColVector vpColVector::stack(const vpColVector &A, const vpColVector &B) +{ + vpColVector C; + vpColVector::stack(A, B, C); + return C; +} + +/*! + Stack column vectors. + + \param A : Initial vector. + \param B : Vector to stack at the end of A. + \param C : Resulting stacked vector \f$C = [A B]^T\f$. + + \code + vpColVector A(3); + vpColVector B(5); + vpColVector C; + vpColVector::stack(A, B, C); // C = [A B]T + // C is now an 8 dimension column vector + \endcode + + \sa stack(const vpColVector &) + \sa stack(const vpColVector &, const vpColVector &) +*/ +void vpColVector::stack(const vpColVector &A, const vpColVector &B, vpColVector &C) +{ + unsigned int nrA = A.getRows(); + unsigned int nrB = B.getRows(); + + if (nrA == 0 && nrB == 0) { + C.resize(0); + return; + } + + if (nrB == 0) { + C = A; + return; + } + + if (nrA == 0) { + C = B; + return; + } + + // General case + C.resize(nrA + nrB); + + for (unsigned int i=0; i<nrA; i++) + C[i] = A[i]; + + for (unsigned int i=0; i<nrB; i++) + C[nrA+i] = B[i]; +} + +/*! + Compute the mean value of all the elements of the vector. +*/ +double vpColVector::mean(const vpColVector &v) +{ + if (v.data==NULL) { + throw(vpException(vpException::fatalError, + "Cannot compute column vector mean: vector empty")) ; + } + double mean = 0 ; + double *vd = v.data ; + for (unsigned int i=0 ; i < v.getRows() ; i++) + mean += *(vd++) ; + + return mean/v.getRows(); +} + +/*! + Compute the median value of all the elements of the vector. +*/ +double +vpColVector::median(const vpColVector &v) +{ + if (v.data==NULL) { + throw(vpException(vpException::fatalError, + "Cannot compute column vector median: vector empty")) ; + } + + std::vector<double> vectorOfDoubles(v.size()); + for(unsigned int i = 0; i < v.size(); i++) { + vectorOfDoubles[i] = v[i]; + } + + return vpMath::getMedian(vectorOfDoubles); +} + +/*! + Compute the standard deviation value of all the elements of the vector. +*/ +double +vpColVector::stdev(const vpColVector &v, const bool useBesselCorrection) +{ + if (v.data==NULL) { + throw(vpException(vpException::fatalError, + "Cannot compute column vector stdev: vector empty")) ; + } + + double mean_value = mean(v); + double sum_squared_diff = 0.0; + for(unsigned int i = 0; i < v.size(); i++) { + sum_squared_diff += (v[i]-mean_value) * (v[i]-mean_value); + } + + double divisor = (double) v.size(); + if(useBesselCorrection && v.size() > 1) { + divisor = divisor-1; + } + + return std::sqrt(sum_squared_diff / divisor); +} + +/*! + Compute the skew symmetric matrix \f$[{\bf v}]_\times\f$ of vector v. + + \f[ \mbox{if} \quad {\bf V} = \left( \begin{array}{c} x \\ y \\ z + \end{array}\right), \quad \mbox{then} \qquad + [{\bf v}]_\times = \left( \begin{array}{ccc} + 0 & -z & y \\ + z & 0 & -x \\ + -y & x & 0 + \end{array}\right) + \f] + + \param v : Input vector used to compute the skew symmetric matrix. +*/ +vpMatrix +vpColVector::skew(const vpColVector &v) +{ + vpMatrix M ; + if (v.getRows() != 3) { + throw(vpException(vpException::dimensionError, + "Cannot compute skew vector of a non 3-dimention vector (%d)", + v.getRows())) ; + } + + M.resize(3,3) ; + M[0][0] = 0 ; M[0][1] = -v[2] ; M[0][2] = v[1] ; + M[1][0] = v[2] ; M[1][1] = 0 ; M[1][2] = -v[0] ; + M[2][0] = -v[1] ; M[2][1] = v[0] ; M[2][2] = 0 ; + + return M ; +} + +/*! + Compute and return the cross product of two vectors \f$a \times b\f$. + + \param a : 3-dimension column vector. + \param b : 3-dimension column vector. + \return The cross product \f$a \times b\f$. + + \exception vpException::dimensionError If the vectors dimension is not equal to 3. +*/ +vpColVector vpColVector::crossProd(const vpColVector &a, const vpColVector &b) +{ + if (a.getRows() != 3 || b.getRows() != 3) { + throw(vpException(vpException::dimensionError, + "Cannot compute the cross product between column vector with dimension %d and %d", + a.getRows(), b.getRows())); + } + + return vpColVector::skew(a) * b; +} + + +/*! + Reshape the column vector in a matrix. + \param nrows : number of rows of the matrix + \param ncols : number of columns of the matrix + \return The reshaped matrix. +*/ +vpMatrix vpColVector::reshape(const unsigned int &nrows,const unsigned int &ncols){ + vpMatrix M(nrows, ncols); + reshape(M, nrows, ncols); + return M; +} + +/*! + Reshape the column vector in a matrix. + \param M : the reshaped matrix. + \param nrows : number of rows of the matrix. + \param ncols : number of columns of the matrix. +*/ +void vpColVector::reshape(vpMatrix & M,const unsigned int &nrows,const unsigned int &ncols){ + if(dsize!=nrows*ncols) { + throw(vpException(vpException::dimensionError, + "Cannot reshape (%dx1) column vector in (%dx%d) matrix", + rowNum, M.getRows(), M.getCols())) ; + } + try { + if ((M.getRows() != nrows) || (M.getCols() != ncols)) M.resize(nrows,ncols); + } + catch(...) { + throw ; + } + + for(unsigned int j =0; j< ncols; j++) + for(unsigned int i =0; i< nrows; i++) + M[i][j]=data[j*ncols+i]; +} + +/*! + Insert a column vector. + \param i : Index of the first element to introduce. This index starts from 0. + \param v : Column vector to insert. + + The following example shows how to use this function: + \code +#include <visp3/core/vpColVector.h> + +int main() +{ + vpColVector v(4); + for (unsigned int i=0; i < v.size(); i++) + v[i] = i; + std::cout << "v: " << v.t() << std::endl; + + vpColVector w(2); + for (unsigned int i=0; i < w.size(); i++) + w[i] = i+10; + std::cout << "w: " << w.t() << std::endl; + + v.insert(1, w); + std::cout << "v: " << v.t() << std::endl; +} + \endcode + It produces the following output: + \code +v: 0 1 2 3 +w: 10 11 +v: 0 10 11 3 + \endcode + */ +void vpColVector::insert(unsigned int i, const vpColVector &v) +{ + if (i+v.size() > this->size()) + throw(vpException(vpException::dimensionError, "Unable to insert a column vector")); + for (unsigned int j=0; j < v.size(); j++) + (*this)[i+j] = v[j]; +} + +/*! + + Pretty print a column vector. The data are tabulated. + The common widths before and after the decimal point + are set with respect to the parameter maxlen. + + \param s Stream used for the printing. + + \param length The suggested width of each vector element. + The actual width grows in order to accomodate the whole integral part, + and shrinks if the whole extent is not needed for all the numbers. + \param intro The introduction which is printed before the vector. + Can be set to zero (or omitted), in which case + the introduction is not printed. + + \return Returns the common total width for all vector elements. + + \sa std::ostream &operator<<(std::ostream &s, const vpArray2D<Type> &A) +*/ +int +vpColVector::print(std::ostream& s, unsigned int length, char const* intro) const +{ + typedef std::string::size_type size_type; + + unsigned int m = getRows(); + unsigned int n = 1; + + std::vector<std::string> values(m*n); + std::ostringstream oss; + std::ostringstream ossFixed; + std::ios_base::fmtflags original_flags = oss.flags(); + + // ossFixed <<std::fixed; + ossFixed.setf ( std::ios::fixed, std::ios::floatfield ); + + size_type maxBefore=0; // the length of the integral part + size_type maxAfter=0; // number of decimals plus + // one place for the decimal point + for (unsigned int i=0;i<m;++i) { + oss.str(""); + oss << (*this)[i]; + if (oss.str().find("e")!=std::string::npos){ + ossFixed.str(""); + ossFixed << (*this)[i]; + oss.str(ossFixed.str()); + } + + values[i]=oss.str(); + size_type thislen=values[i].size(); + size_type p=values[i].find('.'); + + if (p==std::string::npos){ + maxBefore=vpMath::maximum(maxBefore, thislen); + // maxAfter remains the same + } else{ + maxBefore=vpMath::maximum(maxBefore, p); + maxAfter=vpMath::maximum(maxAfter, thislen-p-1); + } + + } + + size_type totalLength=length; + // increase totalLength according to maxBefore + totalLength=vpMath::maximum(totalLength,maxBefore); + // decrease maxAfter according to totalLength + maxAfter=std::min(maxAfter, totalLength-maxBefore); + if (maxAfter==1) maxAfter=0; + + // the following line is useful for debugging + //std::cerr <<totalLength <<" " <<maxBefore <<" " <<maxAfter <<"\n"; + + if (intro) s <<intro; + s <<"["<<m<<","<<n<<"]=\n"; + + for (unsigned int i=0;i<m;i++) { + s <<" "; + size_type p=values[i].find('.'); + s.setf(std::ios::right, std::ios::adjustfield); + s.width((std::streamsize)maxBefore); + s <<values[i].substr(0,p).c_str(); + + if (maxAfter>0){ + s.setf(std::ios::left, std::ios::adjustfield); + if (p!=std::string::npos){ + s.width((std::streamsize)maxAfter); + s <<values[i].substr(p,maxAfter).c_str(); + } else{ + assert(maxAfter>1); + s.width((std::streamsize)maxAfter); + s <<".0"; + } + } + + s <<' '; + + s <<std::endl; + } + + s.flags(original_flags); // restore s to standard state + + return (int)(maxBefore+maxAfter); +} + +/*! + Return the sum square of all the elements \f$v_{i}\f$ of the column vector v(m). + + \return The value \f[\sum{i=0}^{m} v_i^{2}\f]. + */ +double vpColVector::sumSquare() const +{ + double sum_square=0.0; + double x ; + + for (unsigned int i=0;i<rowNum;i++) { + x=rowPtrs[i][0]; + sum_square += x*x; + } + + return sum_square; +} + +/*! + Compute and return the Euclidean norm \f$ ||x|| = \sqrt{ \sum{v_{i}^2}} \f$. + + \return The Euclidean norm if the vector is initialized, 0 otherwise. + +*/ +double vpColVector::euclideanNorm() const +{ + double norm=0.0; + double x ; + for (unsigned int i=0;i<dsize;i++) { + x = *(data +i); norm += x*x; + } + + return sqrt(norm); +} + +/*! + + Compute and return the infinity norm \f$ {||x||}_{\infty} = + max\left({\mid x_{i} \mid}\right) \f$ with \f$i \in + \{0, ..., m-1\}\f$ where \e m is the vector size and \f$x_i\f$ an element of the vector. + + \return The infinity norm if the matrix is initialized, 0 otherwise. + + \sa euclideanNorm() +*/ +double vpColVector::infinityNorm() const +{ + double norm=0.0; + double x ; + for (unsigned int i=0;i<rowNum;i++){ + x = fabs ( (*this)[i] ) ; + if (x > norm) { + norm = x; + } + } + return norm; +} diff --git a/modules/core/src/math/matrix/vpMatrix.cpp b/modules/core/src/math/matrix/vpMatrix.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4a1374e2e5456469b40248f53e443a7bd6e3ee1f --- /dev/null +++ b/modules/core/src/math/matrix/vpMatrix.cpp @@ -0,0 +1,3575 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Matrix manipulation. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + + + +/*! +\file vpMatrix.cpp +\brief Definition of the vpMatrix class +*/ + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <vector> +#include <sstream> +#include <algorithm> +#include <assert.h> +#include <fstream> +#include <string> +#include <cmath> // std::fabs +#include <limits> // numeric_limits + +#include <visp3/core/vpConfig.h> + +#ifdef VISP_HAVE_GSL +#include <gsl/gsl_linalg.h> +#endif + +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpDebug.h> + +//Prototypes of specific functions +vpMatrix subblock(const vpMatrix &, unsigned int, unsigned int); + + +/*! + Construct a matrix as a sub-matrix of the input matrix \e M. + \sa init(const vpMatrix &M, unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols) +*/ +vpMatrix::vpMatrix(const vpMatrix &M, + unsigned int r, unsigned int c, + unsigned int nrows, unsigned int ncols) + : vpArray2D<double>() +{ + if (((r + nrows) > M.rowNum) || ((c + ncols) > M.colNum)) { + throw(vpException(vpException::dimensionError, + "Cannot construct a sub matrix (%dx%d) starting at position (%d,%d) that is not contained in the original matrix (%dx%d)", + nrows, ncols, r, c, M.rowNum, M.colNum)) ; + } + + init(M, r, c, nrows, ncols); +} + +/*! + Initialize the matrix from a part of an input matrix \e M. + + \param M : Input matrix used for initialization. + \param r : row index in matrix M. + \param c : column index in matrix M. + \param nrows : Number of rows of the matrix that should be initialized. + \param ncols : Number of columns of the matrix that should be initialized. + + The sub-matrix starting from M[r][c] element and ending on M[r+nrows-1][c+ncols-1] element + is used to initialize the matrix. + + The following code shows how to use this function: +\code +#include <visp3/core/vpMatrix.h> + +int main() +{ + vpMatrix M(4,5); + int val = 0; + for(size_t i=0; i<M.getRows(); i++) { + for(size_t j=0; j<M.getCols(); j++) { + M[i][j] = val++; + } + } + M.print (std::cout, 4, "M "); + + vpMatrix N; + N.init(M, 0, 1, 2, 3); + N.print (std::cout, 4, "N "); +} +\endcode + It produces the following output: + \code +M [4,5]= + 0 1 2 3 4 + 5 6 7 8 9 + 10 11 12 13 14 + 15 16 17 18 19 +N [2,3]= + 1 2 3 + 6 7 8 + \endcode + */ +void +vpMatrix::init(const vpMatrix &M, unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols) +{ + unsigned int rnrows = r+nrows ; + unsigned int cncols = c+ncols ; + + if (rnrows > M.getRows()) + throw(vpException(vpException::dimensionError, + "Bad row dimension (%d > %d) used to initialize vpMatrix", rnrows, M.getRows())); + if (cncols > M.getCols()) + throw(vpException(vpException::dimensionError, + "Bad column dimension (%d > %d) used to initialize vpMatrix", cncols, M.getCols())); + resize(nrows, ncols); + + if (this->rowPtrs == NULL) // Fix coverity scan: explicit null dereferenced + return; // Noting to do + for (unsigned int i=r ; i < rnrows; i++) + for (unsigned int j=c ; j < cncols; j++) + (*this)[i-r][j-c] = M[i][j] ; +} + +/*! + Set an n-by-n matrix to identity with ones on the diagonal and zeros + else where. +*/ +void +vpMatrix::eye(unsigned int n) +{ + try { + eye(n, n); + } + catch(...) { + throw ; + } +} + +/*! + Set an m-by-n matrix to identity with ones on the diagonal and zeros + else where. +*/ +void +vpMatrix::eye(unsigned int m, unsigned int n) +{ + try { + resize(m,n) ; + } + catch(...) { + throw ; + } + + eye(); +} + +/*! + Set an m-by-n matrix to identity with ones on the diagonal and zeros + else where. +*/ +void +vpMatrix::eye() +{ + for (unsigned int i=0; i<rowNum; i++) { + for (unsigned int j=0; j<colNum; j++) { + if (i == j) (*this)[i][j] = 1.0; + else (*this)[i][j] = 0; + } + } +} + +/*! + Set the matrix diagonal elements to \e val. + More generally set M[i][i] = val. +*/ +void +vpMatrix::setIdentity(const double & val) +{ + for (unsigned int i=0;i<rowNum;i++) + for (unsigned int j=0;j<colNum;j++) + if (i==j) (*this)[i][j] = val ; + else (*this)[i][j] = 0; +} + + +/*! + Compute and return the transpose of the matrix. +*/ +vpMatrix vpMatrix::t() const +{ + vpMatrix At ; + + try { + At.resize(colNum, rowNum); + } + catch(...) + { + throw ; + } + + for (unsigned int i=0;i<rowNum;i++) { + double *coli = (*this)[i] ; + for (unsigned int j=0;j<colNum;j++) + At[j][i] = coli[j]; + } + return At; +} + + +/*! + Compute and return the transpose of the matrix. + + \sa t() +*/ +vpMatrix vpMatrix::transpose()const +{ + vpMatrix At ; + transpose(At); + return At; +} + +/*! + Compute \e At the transpose of the matrix. + \param At (output) : Resulting transpose matrix. + \sa t() +*/ +void vpMatrix::transpose(vpMatrix & At ) const +{ + try { + At.resize(colNum,rowNum); + } + catch(...) + { + throw ; + } + + size_t A_step = colNum; + double ** AtRowPtrs = At.rowPtrs; + + for( unsigned int i = 0; i < colNum; i++ ) { + double * row_ = AtRowPtrs[i]; + double * col = rowPtrs[0]+i; + for( unsigned int j = 0; j < rowNum; j++, col+=A_step ) + *(row_++)=*col; + } +} + + +/*! + Computes the \f$AA^T\f$ operation \f$B = A*A^T\f$ + \return \f$A*A^T\f$ + \sa AAt(vpMatrix &) const +*/ +vpMatrix vpMatrix::AAt() const +{ + vpMatrix B; + + AAt(B); + + return B; +} + +/*! + Compute the AAt operation such as \f$B = A*A^T\f$. + + The result is placed in the parameter \e B and not returned. + + A new matrix won't be allocated for every use of the function. This + results in a speed gain if used many times with the same result + matrix size. + + \sa AAt() +*/ +void vpMatrix::AAt(vpMatrix &B) const +{ + try { + if ((B.rowNum != rowNum) || (B.colNum != rowNum)) B.resize(rowNum,rowNum); + } + catch(...) + { + throw ; + } + + // compute A*A^T + for(unsigned int i=0;i<rowNum;i++){ + for(unsigned int j=i;j<rowNum;j++){ + double *pi = rowPtrs[i];// row i + double *pj = rowPtrs[j];// row j + + // sum (row i .* row j) + double ssum=0; + for(unsigned int k=0; k < colNum ;k++) + ssum += *(pi++)* *(pj++); + + B[i][j]=ssum; //upper triangle + if(i!=j) + B[j][i]=ssum; //lower triangle + } + } +} + +/*! + Compute the AtA operation such as \f$B = A^T*A\f$. + + The result is placed in the parameter \e B and not returned. + + A new matrix won't be allocated for every use of the function. This + results in a speed gain if used many times with the same result matrix + size. + + \sa AtA() +*/ +void vpMatrix::AtA(vpMatrix &B) const +{ + try { + if ((B.rowNum != colNum) || (B.colNum != colNum)) B.resize(colNum,colNum); + } + catch(...) + { + throw ; + } + + unsigned int i,j,k; + double s; + double *ptr; + double *Bi; + for (i=0;i<colNum;i++) + { + Bi = B[i] ; + for (j=0;j<i;j++) + { + ptr=data; + s = 0 ; + for (k=0;k<rowNum;k++) + { + s +=(*(ptr+i)) * (*(ptr+j)); + ptr+=colNum; + } + *Bi++ = s ; + B[j][i] = s; + } + ptr=data; + s = 0 ; + for (k=0;k<rowNum;k++) + { + s +=(*(ptr+i)) * (*(ptr+i)); + ptr+=colNum; + } + *Bi = s; + } +} + + +/*! + Compute the AtA operation such as \f$B = A^T*A\f$ + \return \f$A^T*A\f$ + \sa AtA(vpMatrix &) const +*/ +vpMatrix vpMatrix::AtA() const +{ + vpMatrix B; + + AtA(B); + + return B; +} + +/*! + Copy operator that allows to convert on of the following container that + inherit from vpArray2D such as vpMatrix, vpRotationMatrix, vpHomogeneousMatrix, + vpPoseVector, vpColVector, vpRowVector... into a vpMatrix. + + \param A : 2D array to be copied. + + The following example shows how to create a matrix from an homogeneous matrix: + \code + vpRotationMatrix R; + vpMatrix M = R; + \endcode + +*/ +vpMatrix & +vpMatrix::operator=(const vpArray2D<double> &A) +{ + try { + resize(A.getRows(), A.getCols()) ; + } + catch(...) { + throw ; + } + + memcpy(data, A.data, dsize*sizeof(double)); + + return *this; +} + +//! Set all the element of the matrix A to \e x. +vpMatrix & +vpMatrix::operator=(double x) +{ + for (unsigned int i=0;i<rowNum;i++) + for(unsigned int j=0;j<colNum;j++) + rowPtrs[i][j] = x; + + return *this; +} + + +/*! + Assigment from an array of double. This methos has to be used carefully since + the array allocated behind \e x pointer should have the same dimension than the matrix. +*/ +vpMatrix & +vpMatrix::operator<<( double *x ) +{ + for (unsigned int i=0; i<rowNum; i++) { + for (unsigned int j=0; j<colNum; j++) { + rowPtrs[i][j] = *x++; + } + } + return *this; +} + +/*! + + Create a diagonal matrix with the element of a vector. + + \param A : Vector which element will be put in the diagonal. + + \sa createDiagonalMatrix() + +\code +#include <iostream> + +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMatrix.h> + +int main() +{ + vpMatrix A; + vpColVector v(3); + + v[0] = 1; + v[1] = 2; + v[2] = 3; + + A.diag(v); + + std::cout << "A:\n" << A << std::endl; +} +\endcode + + Matrix A is now equal to: +\code +1 0 0 +0 2 0 +0 0 3 +\endcode +*/ +void +vpMatrix::diag(const vpColVector &A) +{ + unsigned int rows = A.getRows() ; + try { + this->resize(rows,rows) ; + } + catch(...) { + throw ; + } + (*this) = 0 ; + for (unsigned int i=0 ; i< rows ; i++ ) + (* this)[i][i] = A[i] ; +} + +/*! + + Set the matrix as a diagonal matrix where each element on the diagonal is set to \e val. + Elements that are not on the diagonal are set to 0. + + \param val : Value to set. + + \sa eye() + +\code +#include <iostream> + +#include <visp3/core/vpMatrix.h> + +int main() +{ + vpMatrix A(3, 4); + + A.diag(2); + + std::cout << "A:\n" << A << std::endl; +} +\endcode + + Matrix A is now equal to: +\code +2 0 0 0 +0 2 0 0 +0 0 2 0 +\endcode +*/ +void +vpMatrix::diag(const double &val) +{ + (*this) = 0; + unsigned int min_ = (rowNum < colNum) ? rowNum : colNum; + for (unsigned int i=0 ; i< min_ ; i++ ) + (* this)[i][i] = val; +} + + +/*! + + Create a diagonal matrix with the element of a vector \f$ DA_{ii} = A_i \f$. + + \param A : Vector which element will be put in the diagonal. + + \param DA : Diagonal matrix DA[i][i] = A[i] + +\sa diag() +*/ + +void +vpMatrix::createDiagonalMatrix(const vpColVector &A, vpMatrix &DA) +{ + unsigned int rows = A.getRows() ; + try { + DA.resize(rows,rows) ; + } + catch(...) + { + throw ; + } + DA =0 ; + for (unsigned int i=0 ; i< rows ; i++ ) + DA[i][i] = A[i] ; +} + +/*! + Operator that allows to multiply a matrix by a translation vector. + The matrix should be of dimension (3x3) + */ +vpTranslationVector +vpMatrix::operator*(const vpTranslationVector &tv) const +{ + vpTranslationVector t_out; + + if (rowNum != 3 || colNum != 3) { + throw(vpException(vpException::dimensionError, + "Cannot multiply a (%dx%d) matrix by a (%dx%d) translation vector", + rowNum, colNum, tv.getRows(), tv.getCols())) ; + } + + for (unsigned int j=0;j<3;j++) t_out[j]=0 ; + + for (unsigned int j=0;j<3;j++) { + double tj = tv[j] ; // optimization em 5/12/2006 + for (unsigned int i=0;i<3;i++) { + t_out[i]+=rowPtrs[i][j] * tj; + } + } + return t_out; +} + +/*! + Operation w = A * v (matrix A is unchanged, v and w are column vectors). + \sa multMatrixVector() to avoid matrix allocation for each use. +*/ +vpColVector +vpMatrix::operator*(const vpColVector &v) const +{ + vpColVector v_out; + vpMatrix::multMatrixVector(*this, v, v_out); + return v_out; +} + +/*! + Operation w = A * v (v and w are vectors). + + A new matrix won't be allocated for every use of the function + (Speed gain if used many times with the same result matrix size). + + \sa operator*(const vpColVector &v) const +*/ +void vpMatrix::multMatrixVector(const vpMatrix &A, const vpColVector &v, vpColVector &w) +{ + if (A.colNum != v.getRows()) { + throw(vpException(vpException::dimensionError, + "Cannot multiply a (%dx%d) matrix by a (%d) column vector", + A.getRows(), A.getCols(), v.getRows())) ; + } + + try { + if (A.rowNum != w.rowNum) w.resize(A.rowNum); + } + catch(...) { + throw ; + } + + w = 0.0; + for (unsigned int j=0;j<A.colNum;j++) { + double vj = v[j] ; // optimization em 5/12/2006 + for (unsigned int i=0;i<A.rowNum;i++) { + w[i]+=A.rowPtrs[i][j] * vj; + } + } +} + +//--------------------------------- +// Matrix operations. +//--------------------------------- + +/*! + Operation C = A * B. + + The result is placed in the third parameter C and not returned. + A new matrix won't be allocated for every use of the function + (speed gain if used many times with the same result matrix size). + + \sa operator*() +*/ +void vpMatrix::mult2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) +{ + try { + if ((A.rowNum != C.rowNum) || (B.colNum != C.colNum)) C.resize(A.rowNum,B.colNum); + } + catch(...) { + throw ; + } + + if (A.colNum != B.rowNum) { + throw(vpException(vpException::dimensionError, + "Cannot multiply (%dx%d) matrix by (%dx%d) matrix", + A.getRows(), A.getCols(), B.getRows(), B.getCols())) ; + } + + // 5/12/06 some "very" simple optimization to avoid indexation + unsigned int BcolNum = B.colNum; + unsigned int BrowNum = B.rowNum; + unsigned int i,j,k; + double **BrowPtrs = B.rowPtrs; + for (i=0;i<A.rowNum;i++) + { + double *rowptri = A.rowPtrs[i]; + double *ci = C[i]; + for (j=0;j<BcolNum;j++) + { + double s = 0; + for (k=0;k<BrowNum;k++) s += rowptri[k] * BrowPtrs[k][j]; + ci[j] = s; + } + } +} + +/*! + \warning This function is provided for compat with previous releases. You should + rather use the functionalities provided in vpRotationMatrix class. + + Operation C = A * B. + + The result is placed in the third parameter C and not returned. + A new matrix won't be allocated for every use of the function + (speed gain if used many times with the same result matrix size). + + \exception vpException::dimensionError If matrices are not 3-by-3 dimension. + +*/ +void vpMatrix::mult2Matrices(const vpMatrix &A, const vpMatrix &B, vpRotationMatrix &C) +{ + if (A.colNum != 3 || A.rowNum != 3 || B.colNum != 3 || B.rowNum != 3) { + throw(vpException(vpException::dimensionError, + "Cannot multiply (%dx%d) matrix by (%dx%d) matrix as a rotation matrix", + A.getRows(), A.getCols(), B.getRows(), B.getCols())) ; + } + + // 5/12/06 some "very" simple optimization to avoid indexation + unsigned int BcolNum = B.colNum; + unsigned int BrowNum = B.rowNum; + unsigned int i,j,k; + double **BrowPtrs = B.rowPtrs; + for (i=0;i<A.rowNum;i++) + { + double *rowptri = A.rowPtrs[i]; + double *ci = C[i]; + for (j=0;j<BcolNum;j++) + { + double s = 0; + for (k=0;k<BrowNum;k++) s += rowptri[k] * BrowPtrs[k][j]; + ci[j] = s; + } + } +} + +/*! + \warning This function is provided for compat with previous releases. You should + rather use the functionalities provided in vpHomogeneousMatrix class. + + Operation C = A * B. + + The result is placed in the third parameter C and not returned. + A new matrix won't be allocated for every use of the function + (speed gain if used many times with the same result matrix size). + + \exception vpException::dimensionError If matrices are not 4-by-4 dimension. + +*/ +void vpMatrix::mult2Matrices(const vpMatrix &A, const vpMatrix &B, vpHomogeneousMatrix &C) +{ + if (A.colNum != 4 || A.rowNum != 4 || B.colNum != 4 || B.rowNum != 4) { + throw(vpException(vpException::dimensionError, + "Cannot multiply (%dx%d) matrix by (%dx%d) matrix as a rotation matrix", + A.getRows(), A.getCols(), B.getRows(), B.getCols())) ; + } + + // 5/12/06 some "very" simple optimization to avoid indexation + unsigned int BcolNum = B.colNum; + unsigned int BrowNum = B.rowNum; + unsigned int i,j,k; + double **BrowPtrs = B.rowPtrs; + for (i=0;i<A.rowNum;i++) + { + double *rowptri = A.rowPtrs[i]; + double *ci = C[i]; + for (j=0;j<BcolNum;j++) + { + double s = 0; + for (k=0;k<BrowNum;k++) s += rowptri[k] * BrowPtrs[k][j]; + ci[j] = s; + } + } +} + +/*! + \warning This function is provided for compat with previous releases. You should + rather use multMatrixVector() that is more explicit. + + Operation C = A * B. + + The result is placed in the third parameter C and not returned. + A new matrix won't be allocated for every use of the function + (speed gain if used many times with the same result matrix size). + + \sa multMatrixVector() +*/ +void vpMatrix::mult2Matrices(const vpMatrix &A, const vpColVector &B, vpColVector &C) +{ + vpMatrix::multMatrixVector(A, B, C); +} + +/*! + Operation C = A * B (A is unchanged). + \sa mult2Matrices() to avoid matrix allocation for each use. +*/ +vpMatrix vpMatrix::operator*(const vpMatrix &B) const +{ + vpMatrix C; + + vpMatrix::mult2Matrices(*this,B,C); + + return C; +} + +/*! + Operator that allow to multiply a matrix by a rotation matrix. + The matrix should be of dimension m-by-3. +*/ +vpMatrix vpMatrix::operator*(const vpRotationMatrix &R) const +{ + if (colNum != R.getRows()) { + throw(vpException(vpException::dimensionError, + "Cannot multiply (%dx%d) matrix by (3x3) rotation matrix", + rowNum, colNum)) ; + } + vpMatrix C(rowNum, 3); + + unsigned int RcolNum = R.getCols(); + unsigned int RrowNum = R.getRows(); + for (unsigned int i=0;i<rowNum;i++) + { + double *rowptri = rowPtrs[i]; + double *ci = C[i]; + for (unsigned int j=0;j<RcolNum;j++) + { + double s = 0; + for (unsigned int k=0;k<RrowNum;k++) s += rowptri[k] * R[k][j]; + ci[j] = s; + } + } + + return C; +} +/*! + Operator that allow to multiply a matrix by a velocity twist matrix. + The matrix should be of dimension m-by-6. +*/ +vpMatrix vpMatrix::operator*(const vpVelocityTwistMatrix &V) const +{ + if (colNum != V.getRows()) { + throw(vpException(vpException::dimensionError, + "Cannot multiply (%dx%d) matrix by (3x3) velocity twist matrix", + rowNum, colNum)) ; + } + vpMatrix M(rowNum, 6); + + unsigned int VcolNum = V.getCols(); + unsigned int VrowNum = V.getRows(); + for (unsigned int i=0;i<rowNum;i++) + { + double *rowptri = rowPtrs[i]; + double *ci = M[i]; + for (unsigned int j=0;j<VcolNum;j++) + { + double s = 0; + for (unsigned int k=0;k<VrowNum;k++) s += rowptri[k] * V[k][j]; + ci[j] = s; + } + } + + return M; +} +/*! + Operator that allow to multiply a matrix by a force/torque twist matrix. + The matrix should be of dimension m-by-6. +*/ +vpMatrix vpMatrix::operator*(const vpForceTwistMatrix &V) const +{ + if (colNum != V.getRows()) { + throw(vpException(vpException::dimensionError, + "Cannot multiply (%dx%d) matrix by (3x3) force/torque twist matrix", + rowNum, colNum)) ; + } + vpMatrix M(rowNum, 6); + + unsigned int VcolNum = V.getCols(); + unsigned int VrowNum = V.getRows(); + for (unsigned int i=0;i<rowNum;i++) + { + double *rowptri = rowPtrs[i]; + double *ci = M[i]; + for (unsigned int j=0;j<VcolNum;j++) + { + double s = 0; + for (unsigned int k=0;k<VrowNum;k++) s += rowptri[k] * V[k][j]; + ci[j] = s; + } + } + + return M; +} + +/*! +Operation C = A*wA + B*wB + +The result is placed in the third parameter C and not returned. +A new matrix won't be allocated for every use of the function +(Speed gain if used many times with the same result matrix size). + +\sa operator+() +*/ + +void vpMatrix::add2WeightedMatrices(const vpMatrix &A, const double &wA, const vpMatrix &B,const double &wB, vpMatrix &C){ + try + { + if ((A.rowNum != C.rowNum) || (B.colNum != C.colNum)) C.resize(A.rowNum,B.colNum); + } + catch(...) { + throw ; + } + + if ((A.colNum != B.getCols())||(A.rowNum != B.getRows())) { + throw(vpException(vpException::dimensionError, + "Cannot add (%dx%d) matrix with (%dx%d) matrix", + A.getRows(), A.getCols(), B.getRows(), B.getCols())) ; + } + + double ** ArowPtrs=A.rowPtrs; + double ** BrowPtrs=B.rowPtrs; + double ** CrowPtrs=C.rowPtrs; + + for (unsigned int i=0;i<A.rowNum;i++) + for(unsigned int j=0;j<A.colNum;j++) + CrowPtrs[i][j] = wB*BrowPtrs[i][j]+wA*ArowPtrs[i][j]; +} + +/*! + Operation C = A + B. + + The result is placed in the third parameter C and not returned. + A new matrix won't be allocated for every use of the function + (speed gain if used many times with the same result matrix size). + + \sa operator+() +*/ +void vpMatrix::add2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) +{ + try { + if ((A.rowNum != C.rowNum) || (B.colNum != C.colNum)) C.resize(A.rowNum,B.colNum); + } + catch(...) { + throw ; + } + + if ((A.colNum != B.getCols())||(A.rowNum != B.getRows())) { + throw(vpException(vpException::dimensionError, + "Cannot add (%dx%d) matrix with (%dx%d) matrix", + A.getRows(), A.getCols(), B.getRows(), B.getCols())) ; + } + + double ** ArowPtrs=A.rowPtrs; + double ** BrowPtrs=B.rowPtrs; + double ** CrowPtrs=C.rowPtrs; + + for (unsigned int i=0;i<A.rowNum;i++) { + for(unsigned int j=0;j<A.colNum;j++) { + CrowPtrs[i][j] = BrowPtrs[i][j]+ArowPtrs[i][j]; + } + } +} + +/*! + \warning This function is provided for compat with previous releases. You should + rather use the functionalities provided in vpColVector class. + + Operation C = A + B. + + The result is placed in the third parameter C and not returned. + A new vector won't be allocated for every use of the function + (speed gain if used many times with the same result matrix size). + + \sa vpColVector::operator+() +*/ +void vpMatrix::add2Matrices(const vpColVector &A, const vpColVector &B, vpColVector &C) +{ + try { + if ((A.rowNum != C.rowNum) || (B.colNum != C.colNum)) C.resize(A.rowNum); + } + catch(...) { + throw ; + } + + if ((A.colNum != B.getCols())||(A.rowNum != B.getRows())) { + throw(vpException(vpException::dimensionError, + "Cannot add (%dx%d) matrix with (%dx%d) matrix", + A.getRows(), A.getCols(), B.getRows(), B.getCols())) ; + } + + double ** ArowPtrs=A.rowPtrs; + double ** BrowPtrs=B.rowPtrs; + double ** CrowPtrs=C.rowPtrs; + + for (unsigned int i=0;i<A.rowNum;i++) { + for(unsigned int j=0;j<A.colNum;j++) { + CrowPtrs[i][j] = BrowPtrs[i][j]+ArowPtrs[i][j]; + } + } +} + +/*! + Operation C = A + B (A is unchanged). + \sa add2Matrices() to avoid matrix allocation for each use. +*/ +vpMatrix vpMatrix::operator+(const vpMatrix &B) const +{ + vpMatrix C; + vpMatrix::add2Matrices(*this,B,C); + return C; +} + + +/*! + \warning This function is provided for compat with previous releases. You should + rather use the functionalities provided in vpColVector class. + + Operation C = A - B on column vectors. + + The result is placed in the third parameter C and not returned. + A new vector won't be allocated for every use of the function + (speed gain if used many times with the same result matrix size). + + \exception vpException::dimensionError If A and B vectors have not the same size. + + \sa vpColVector::operator-() +*/ +void vpMatrix::sub2Matrices(const vpColVector &A, const vpColVector &B, vpColVector &C) +{ + try { + if ((A.rowNum != C.rowNum) || (A.colNum != C.colNum)) C.resize(A.rowNum); + } + catch(...) { + throw ; + } + + if ( (A.colNum != B.getCols())||(A.rowNum != B.getRows())) { + throw(vpException(vpException::dimensionError, + "Cannot substract (%dx%d) matrix to (%dx%d) matrix", + A.getRows(), A.getCols(), B.getRows(), B.getCols())) ; + } + + double ** ArowPtrs=A.rowPtrs; + double ** BrowPtrs=B.rowPtrs; + double ** CrowPtrs=C.rowPtrs; + + for (unsigned int i=0;i<A.rowNum;i++) { + for(unsigned int j=0;j<A.colNum;j++) { + CrowPtrs[i][j] = ArowPtrs[i][j]-BrowPtrs[i][j]; + } + } +} + +/*! + Operation C = A - B. + + The result is placed in the third parameter C and not returned. + A new matrix won't be allocated for every use of the function + (speed gain if used many times with the same result matrix size). + + \exception vpException::dimensionError If A and B matrices have not the same size. + + \sa operator-() +*/ +void vpMatrix::sub2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) +{ + try { + if ((A.rowNum != C.rowNum) || (A.colNum != C.colNum)) C.resize(A.rowNum,A.colNum); + } + catch(...) { + throw ; + } + + if ( (A.colNum != B.getCols())||(A.rowNum != B.getRows())) { + throw(vpException(vpException::dimensionError, + "Cannot substract (%dx%d) matrix to (%dx%d) matrix", + A.getRows(), A.getCols(), B.getRows(), B.getCols())) ; + } + + double ** ArowPtrs=A.rowPtrs; + double ** BrowPtrs=B.rowPtrs; + double ** CrowPtrs=C.rowPtrs; + + for (unsigned int i=0;i<A.rowNum;i++) { + for(unsigned int j=0;j<A.colNum;j++) { + CrowPtrs[i][j] = ArowPtrs[i][j]-BrowPtrs[i][j]; + } + } +} + +/*! + Operation C = A - B (A is unchanged). + \sa sub2Matrices() to avoid matrix allocation for each use. +*/ +vpMatrix vpMatrix::operator-(const vpMatrix &B) const +{ + vpMatrix C; + vpMatrix::sub2Matrices(*this,B,C); + return C; +} + +//! Operation A = A + B + +vpMatrix &vpMatrix::operator+=(const vpMatrix &B) +{ + if ( (colNum != B.getCols())||(rowNum != B.getRows())) { + throw(vpException(vpException::dimensionError, + "Cannot add (%dx%d) matrix to (%dx%d) matrix", + rowNum, colNum, B.getRows(), B.getCols())) ; + } + + double ** BrowPtrs=B.rowPtrs; + + for (unsigned int i=0;i<rowNum;i++) + for(unsigned int j=0;j<colNum;j++) + rowPtrs[i][j] += BrowPtrs[i][j]; + + return *this; +} + +//! Operation A = A - B +vpMatrix & vpMatrix::operator-=(const vpMatrix &B) +{ + if ( (colNum != B.getCols())||(rowNum != B.getRows())) { + throw(vpException(vpException::dimensionError, + "Cannot substract (%dx%d) matrix to (%dx%d) matrix", + rowNum, colNum, B.getRows(), B.getCols())) ; + } + + double ** BrowPtrs=B.rowPtrs; + for (unsigned int i=0;i<rowNum;i++) + for(unsigned int j=0;j<colNum;j++) + rowPtrs[i][j] -= BrowPtrs[i][j]; + + return *this; +} + +/*! + Operation C = -A. + + The result is placed in the second parameter C and not returned. + A new matrix won't be allocated for every use of the function + (Speed gain if used many times with the same result matrix size). + + \sa operator-(void) +*/ +void vpMatrix::negateMatrix(const vpMatrix &A, vpMatrix &C) +{ + try { + if ((A.rowNum != C.rowNum) || (A.colNum != C.colNum)) C.resize(A.rowNum,A.colNum); + } + catch(...) { + throw ; + } + + double ** ArowPtrs=A.rowPtrs; + double ** CrowPtrs=C.rowPtrs; + + // t0=vpTime::measureTimeMicros(); + for (unsigned int i=0;i<A.rowNum;i++) + for(unsigned int j=0;j<A.colNum;j++) + CrowPtrs[i][j]= -ArowPtrs[i][j]; +} + +/*! + Operation C = -A (A is unchanged). + \sa negateMatrix() to avoid matrix allocation for each use. +*/ +vpMatrix vpMatrix::operator-() const //negate +{ + vpMatrix C; + vpMatrix::negateMatrix(*this,C); + return C; +} + + +double +vpMatrix::sum() const +{ + double s=0.0; + for (unsigned int i=0;i<rowNum;i++) + { + for(unsigned int j=0;j<colNum;j++) + { + s += rowPtrs[i][j]; + } + } + + return s; +} + + +//--------------------------------- +// Matrix/vector operations. +//--------------------------------- + + + + +//--------------------------------- +// Matrix/real operations. +//--------------------------------- + +/*! + \relates vpMatrix + Allow to multiply a scalar by a matrix. +*/ +vpMatrix operator*(const double &x,const vpMatrix &B) +{ + vpMatrix C(B.getRows(), B.getCols()); + + unsigned int Brow = B.getRows() ; + unsigned int Bcol = B.getCols() ; + + for (unsigned int i=0;i<Brow;i++) + for(unsigned int j=0;j<Bcol;j++) + C[i][j]= B[i][j]*x; + + return C ; +} + +/*! + Operator that allows to multiply all the elements of a matrix + by a scalar. + */ +vpMatrix vpMatrix::operator*(double x) const +{ + vpMatrix M(rowNum,colNum); + + for (unsigned int i=0;i<rowNum;i++) + for(unsigned int j=0;j<colNum;j++) + M[i][j]= rowPtrs[i][j]*x; + + return M; +} + +//! Cij = Aij / x (A is unchanged) +vpMatrix vpMatrix::operator/(double x) const +{ + vpMatrix C; + + try { + C.resize(rowNum,colNum); + } + catch(...) { + throw ; + } + + //if (x == 0) { + if (std::fabs(x) <= std::numeric_limits<double>::epsilon()) { + throw vpException(vpException::divideByZeroError, "Divide matrix by zero scalar"); + } + + double xinv = 1/x ; + + for (unsigned int i=0;i<rowNum;i++) + for(unsigned int j=0;j<colNum;j++) + C[i][j]=rowPtrs[i][j]*xinv; + + return C; +} + + +//! Add x to all the element of the matrix : Aij = Aij + x +vpMatrix & vpMatrix::operator+=(double x) +{ + for (unsigned int i=0;i<rowNum;i++) + for(unsigned int j=0;j<colNum;j++) + rowPtrs[i][j]+=x; + + return *this; +} + + +//! Substract x to all the element of the matrix : Aij = Aij - x +vpMatrix & vpMatrix::operator-=(double x) +{ + for (unsigned int i=0;i<rowNum;i++) + for(unsigned int j=0;j<colNum;j++) + rowPtrs[i][j]-=x; + + return *this; +} + +/*! + Operator that allows to multiply all the elements of a matrix + by a scalar. + */ +vpMatrix & vpMatrix::operator*=(double x) +{ + for (unsigned int i=0;i<rowNum;i++) + for(unsigned int j=0;j<colNum;j++) + rowPtrs[i][j]*=x; + + return *this; +} + +//! Divide all the element of the matrix by x : Aij = Aij / x +vpMatrix & vpMatrix::operator/=(double x) +{ + //if (x == 0) + if (std::fabs(x) <= std::numeric_limits<double>::epsilon()) + throw vpException(vpException::divideByZeroError, "Divide matrix by zero scalar"); + + double xinv = 1/x ; + + for (unsigned int i=0;i<rowNum;i++) + for(unsigned int j=0;j<colNum;j++) + rowPtrs[i][j]*=xinv; + + return *this; +} + +//---------------------------------------------------------------- +// Matrix Operation +//---------------------------------------------------------------- + + + + + + + +/*! + Stacks columns of a matrix in a vector. + \param out : a vpColVector. +*/ +void vpMatrix::stackColumns(vpColVector &out ){ + + try { + if ((out.rowNum != colNum*rowNum) || (out.colNum != 1)) out.resize(rowNum); + } + catch(...) { + throw ; + } + + double *optr=out.data; + for(unsigned int j =0;j<colNum ; j++){ + for(unsigned int i =0;i<rowNum ; i++){ + *(optr++)=rowPtrs[i][j]; + } + } +} + +/*! + Stacks columns of a matrix in a vector. + \return a vpColVector. +*/ +vpColVector vpMatrix::stackColumns() +{ + vpColVector out(colNum*rowNum); + stackColumns(out); + return out; +} + +/*! + Stacks rows of a matrix in a vector + \param out : a vpRowVector. +*/ +void vpMatrix::stackRows(vpRowVector &out) +{ + try { + if ((out.getRows() != 1) || (out.getCols() != colNum*rowNum)) out.resize(rowNum); + } + catch(...) { + throw ; + } + + double *mdata=data; + double *optr=out.data; + for(unsigned int i =0;i<dsize ; i++){ + *(optr++)=*(mdata++); + } +} +/*! + Stacks rows of a matrix in a vector. + \return a vpRowVector. +*/ +vpRowVector vpMatrix::stackRows() +{ + vpRowVector out(colNum*rowNum); + stackRows(out ); + return out; +} + +/*! + Compute Kronecker product matrix. + \param m1 : vpMatrix; + \param m2 : vpMatrix; + \param out : The kronecker product : \f$ m1 \otimes m2 \f$ +*/ +void vpMatrix::kron(const vpMatrix &m1, const vpMatrix &m2 , vpMatrix &out) +{ + unsigned int r1= m1.getRows(); + unsigned int c1= m1.getCols(); + unsigned int r2= m2.getRows(); + unsigned int c2= m2.getCols(); + + if (r1*r2 !=out.rowNum || c1*c2!= out.colNum ) + { + vpERROR_TRACE("Kronecker prodect bad dimension of output vpMatrix") ; + throw(vpException(vpException::dimensionError, + "In Kronecker product bad dimension of output matrix")); + } + + for(unsigned int r =0;r<r1 ; r++){ + for(unsigned int c =0;c<c1 ; c++){ + double alpha = m1[r][c]; + double *m2ptr = m2[0]; + unsigned int roffset= r*r2; + unsigned int coffset= c*c2; + for(unsigned int rr =0;rr<r2 ; rr++){ + for(unsigned int cc =0;cc<c2 ;cc++){ + out[roffset+rr][coffset+cc]= alpha* *(m2ptr++); + } + } + } + } + +} + +/*! + Compute Kronecker product matrix. + \param m : vpMatrix. + \param out : If m1.kron(m2) out contains the kronecker product's result : \f$ m1 \otimes m2 \f$. +*/ +void vpMatrix::kron(const vpMatrix &m , vpMatrix &out) const +{ + kron(*this,m,out); +} + +/*! + Compute Kronecker product matrix. + \param m1 : vpMatrix; + \param m2 : vpMatrix; + \return The kronecker product : \f$ m1 \otimes m2 \f$ +*/ +vpMatrix vpMatrix::kron(const vpMatrix &m1, const vpMatrix &m2) +{ + unsigned int r1= m1.getRows(); + unsigned int c1= m1.getCols(); + unsigned int r2= m2.getRows(); + unsigned int c2= m2.getCols(); + + vpMatrix out(r1*r2,c1*c2); + + for(unsigned int r =0;r<r1 ; r++){ + for(unsigned int c =0;c<c1 ; c++){ + double alpha = m1[r][c]; + double *m2ptr = m2[0]; + unsigned int roffset= r*r2; + unsigned int coffset= c*c2; + for(unsigned int rr =0;rr<r2 ; rr++){ + for(unsigned int cc =0;cc<c2 ;cc++){ + out[roffset+rr ][coffset+cc]= alpha* *(m2ptr++); + } + } + } + } + return out; +} + + +/*! + Compute Kronecker product matrix. + \param m : vpMatrix; + \return m1.kron(m2) The kronecker product : \f$ m1 \otimes m2 \f$ +*/ +vpMatrix vpMatrix::kron(const vpMatrix &m) const +{ + return kron(*this,m); +} + +/*! + + Solve a linear system \f$ A X = B \f$ using Singular Value + Decomposition (SVD). + + Non destructive wrt. A and B. + + \param b : Vector\f$ B \f$. + + \param x : Vector \f$ X \f$. + + Here an example: +\code +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMatrix.h> + +int main() +{ +vpMatrix A(3,3); + +A[0][0] = 4.64; +A[0][1] = 0.288; +A[0][2] = -0.384; + +A[1][0] = 0.288; +A[1][1] = 7.3296; +A[1][2] = 2.2272; + +A[2][0] = -0.384; +A[2][1] = 2.2272; +A[2][2] = 6.0304; + +vpColVector X(3), B(3); +B[0] = 1; +B[1] = 2; +B[2] = 3; + +A.solveBySVD(B, X); + +// Obtained values of X +// X[0] = 0.2468; +// X[1] = 0.120782; +// X[2] = 0.468587; + +std::cout << "X:\n" << X << std::endl; +} +\endcode + +\sa solveBySVD(const vpColVector &) +*/ +void +vpMatrix::solveBySVD(const vpColVector &b, vpColVector &x) const +{ + x = pseudoInverse(1e-6)*b ; +} + + +/*! + + Solve a linear system \f$ A X = B \f$ using Singular Value + Decomposition (SVD). + + Non destructive wrt. A and B. + + \param B : Vector\f$ B \f$. + + \return Vector \f$ X \f$. + + Here an example: +\code +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMatrix.h> + +int main() +{ +vpMatrix A(3,3); + +A[0][0] = 4.64; +A[0][1] = 0.288; +A[0][2] = -0.384; + +A[1][0] = 0.288; +A[1][1] = 7.3296; +A[1][2] = 2.2272; + +A[2][0] = -0.384; +A[2][1] = 2.2272; +A[2][2] = 6.0304; + +vpColVector X(3), B(3); +B[0] = 1; +B[1] = 2; +B[2] = 3; + +X = A.solveBySVD(B); +// Obtained values of X +// X[0] = 0.2468; +// X[1] = 0.120782; +// X[2] = 0.468587; + +std::cout << "X:\n" << X << std::endl; +} +\endcode + +\sa solveBySVD(const vpColVector &, vpColVector &) +*/ +vpColVector vpMatrix::solveBySVD(const vpColVector &B) const +{ + vpColVector X(colNum); + + solveBySVD(B, X); + return X; +} + + +/*! + + Singular value decomposition (SVD). + + \f[ M = U \Sigma V^{\top} \f] + + \warning Destructive method wrt. to the matrix \f$ M \f$ to + decompose. You should make a COPY of that matrix if needed not to + CHANGE. + + \param w : Vector of singular values. \f$ \Sigma = diag(w) \f$. + + \param v : Matrix \f$ V \f$. + + \return Matrix \f$ U \f$. + + \warning If the GNU Scientific Library (GSL) third party library is used to compute the SVD + decomposition, the singular values \f$ \Sigma_{i,i} \f$ are ordered in decreasing + fashion in \e w. This is not the case, if the GSL is not detected by ViSP. + + Here an example of SVD decomposition of a non square Matrix M. + +\code +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMatrix.h> + +int main() +{ + vpMatrix M(3,2); + M[0][0] = 1; + M[1][0] = 2; + M[2][0] = 0.5; + + M[0][1] = 6; + M[1][1] = 8 ; + M[2][1] = 9 ; + + vpMatrix v; + vpColVector w; + vpMatrix Mrec; + vpMatrix Sigma; + + M.svd(w, v); + // Here M is modified and is now equal to U + + // Construct the diagonal matrix from the singular values + Sigma.diag(w); + + // Reconstruct the initial matrix M using the decomposition + Mrec = M * Sigma * v.t(); + + // Here, Mrec is obtained equal to the initial value of M + // Mrec[0][0] = 1; + // Mrec[1][0] = 2; + // Mrec[2][0] = 0.5; + // Mrec[0][1] = 6; + // Mrec[1][1] = 8 ; + // Mrec[2][1] = 9 ; + + std::cout << "Reconstructed M matrix: \n" << Mrec << std::endl; +} +\endcode + +*/ +void +vpMatrix::svd(vpColVector& w, vpMatrix& v) +{ +#if 1 /* no verification */ + { + w.resize( this->getCols() ); + v.resize( this->getCols(), this->getCols() ); + +#if defined (VISP_HAVE_LAPACK_C) + svdLapack(w,v); +#elif (VISP_HAVE_OPENCV_VERSION >= 0x020101) // Require opencv >= 2.1.1 + svdOpenCV(w,v); +#elif defined (VISP_HAVE_GSL) /* be careful of the copy below */ + svdGsl(w,v) ; +#else + svdNr(w,v) ; +#endif + + //svdNr(w,v) ; + } +#else /* verification of the SVD */ + { + int pb = 0; + unsigned int i,j,k,nrows,ncols; + vpMatrix A, Asvd; + + A = (*this); /* copy because svd is destructive */ + + w.resize( this->getCols() ); + v.resize( this->getCols(), this->getCols() ); +#ifdef VISP_HAVE_GSL /* be careful of the copy above */ + svdGsl(w,v) ; +#else + svdNr(w,v) ; +#endif + //svdNr(w,v) ; + + nrows = A.getRows(); + ncols = A.getCols(); + Asvd.resize(nrows,ncols); + + for (i = 0 ; i < nrows ; i++) + { + for (j = 0 ; j < ncols ; j++) + { + Asvd[i][j] = 0.0; + for (k=0 ; k < ncols ; k++) Asvd[i][j] += (*this)[i][k]*w[k]*v[j][k]; + } + } + for (i=0;i<nrows;i++) + { + for (j=0;j<ncols;j++) if (fabs(A[i][j]-Asvd[i][j]) > 1e-6) pb = 1; + } + if (pb == 1) + { + printf("pb in SVD\n"); + std::cout << " A : " << std::endl << A << std::endl; + std::cout << " Asvd : " << std::endl << Asvd << std::endl; + } + // else printf("SVD ok ;-)\n"); /* It's so good... */ + } +#endif +} +/*! + Compute the pseudo inverse of the matrix \f$Ap = A^+\f$ + \param Ap : The pseudo inverse \f$ A^+ \f$. + \param svThreshold : Threshold used to test the singular values. + \return Return the rank of the matrix A +*/ + +unsigned int +vpMatrix::pseudoInverse(vpMatrix &Ap, double svThreshold) const +{ + vpColVector sv ; + return pseudoInverse(Ap, sv, svThreshold) ; +} + +/*! + Compute and return the pseudo inverse of a n-by-m matrix : \f$ A^+ \f$ + \param svThreshold : Threshold used to test the singular values. + + \return Pseudo inverse of the matrix. + + Here an example to compute the inverse of a n-by-n matrix. If the + matrix is n-by-n it is also possible to use inverseByLU(). + +\code +#include <visp3/core/vpMatrix.h> + +int main() +{ + vpMatrix A(4,4); + + A[0][0] = 1/1.; A[0][1] = 1/2.; A[0][2] = 1/3.; A[0][3] = 1/4.; + A[1][0] = 1/5.; A[1][1] = 1/3.; A[1][2] = 1/3.; A[1][3] = 1/5.; + A[2][0] = 1/6.; A[2][1] = 1/4.; A[2][2] = 1/2.; A[2][3] = 1/6.; + A[3][0] = 1/7.; A[3][1] = 1/5.; A[3][2] = 1/6.; A[3][3] = 1/7.; + + // Compute the inverse + vpMatrix A_1; // A^-1 + A_1 = A.pseudoInverse(); + std::cout << "Inverse by pseudo inverse: \n" << A_1 << std::endl; + + std::cout << "A*A^-1: \n" << A * A_1 << std::endl; +} +\endcode + + \sa inverseByLU() + +*/ +vpMatrix +vpMatrix::pseudoInverse(double svThreshold) const +{ + vpMatrix Ap ; + vpColVector sv ; + pseudoInverse(Ap, sv, svThreshold) ; + return Ap ; +} + +/*! + Compute the pseudo inverse of the matrix \f$Ap = A^+\f$ + \param Ap : The pseudo inverse \f$ A^+ \f$. + \param sv : Singular values. + \param svThreshold : Threshold used to test the singular values. + \return Return the rank of the matrix A +*/ +unsigned int +vpMatrix::pseudoInverse(vpMatrix &Ap, vpColVector &sv, double svThreshold) const +{ + vpMatrix imA, imAt ; + return pseudoInverse(Ap, sv, svThreshold, imA, imAt) ; +} + +/*! + Compute the pseudo inverse of the matrix \f$Ap = A^+\f$ along with Ker A, Ker \f$A^T\f$, Im A and Im \f$A^T\f$ + + Pseudo inverse, kernel and image are computed using the SVD decomposition. + + A is an m x n matrix, + if m >=n the svd works on A other wise it works on \f$A^T\f$. + + Therefore if m>=n we have + + \f[ + {\bf A}_{m\times n} = {\bf U}_{m\times m} {\bf S}_{m\times n} {\bf V^\top}_{n\times n} + \f] + \f[ + {\bf A}_{m\times n} = \left[\begin{array}{ccc}\mbox{Im} {\bf A} & | & + \mbox{Ker} {\bf A^\top} \end{array} \right] {\bf S} + \left[ + \begin{array}{c} (\mbox{Im} {\bf A^\top})^\top \\ (\mbox{Ker}{\bf A})^\top \end{array}\right] + \f] + where + Im(A) is an m x r matrix (r is the rank of A) and + Im(A^T) is an r x n matrix + + \param Ap : The pseudo inverse \f$ A^+ \f$. + \param sv : Singular values. + \param svThreshold : Threshold used to test the singular values. + \param imAt : Image A^T + \param imA: Image A + \return Return the rank of the matrix A + +*/ +unsigned int +vpMatrix::pseudoInverse(vpMatrix &Ap, + vpColVector &sv, double svThreshold, + vpMatrix &imA, + vpMatrix &imAt) const +{ + + unsigned int i, j, k ; + + unsigned int nrows, ncols; + unsigned int nrows_orig = getRows() ; + unsigned int ncols_orig = getCols() ; + Ap.resize(ncols_orig,nrows_orig) ; + + if (nrows_orig >= ncols_orig) + { + nrows = nrows_orig; + ncols = ncols_orig; + } + else + { + nrows = ncols_orig; + ncols = nrows_orig; + } + + vpMatrix a(nrows,ncols) ; + vpMatrix a1(ncols,nrows); + vpMatrix v(ncols,ncols) ; + sv.resize(ncols) ; + + if (nrows_orig >= ncols_orig) a = *this; + else a = (*this).t(); + + a.svd(sv,v); + + // compute the highest singular value and the rank of h + double maxsv = 0 ; + for (i=0 ; i < ncols ; i++) + if (fabs(sv[i]) > maxsv) maxsv = fabs(sv[i]) ; + + unsigned int rank = 0 ; + for (i=0 ; i < ncols ; i++) + if (fabs(sv[i]) > maxsv*svThreshold) rank++ ; + + /*------------------------------------------------------- */ + for (i = 0 ; i < ncols ; i++) + { + for (j = 0 ; j < nrows ; j++) + { + a1[i][j] = 0.0; + + for (k=0 ; k < ncols ; k++) + if (fabs(sv[k]) > maxsv*svThreshold) + { + a1[i][j] += v[i][k]*a[j][k]/sv[k]; + } + } + } + if (nrows_orig >= ncols_orig) Ap = a1; + else Ap = a1.t(); + + if (nrows_orig >= ncols_orig) + { + // compute dim At + imAt.resize(ncols_orig,rank) ; + for (i=0 ; i < ncols_orig ; i++) + for (j=0 ; j < rank ; j++) + imAt[i][j] = v[i][j] ; + + // compute dim A + imA.resize(nrows_orig,rank) ; + for (i=0 ; i < nrows_orig ; i++) + for (j=0 ; j < rank ; j++) + imA[i][j] = a[i][j] ; + } + else + { + // compute dim At + imAt.resize(ncols_orig,rank) ; + for (i=0 ; i < ncols_orig ; i++) + for (j=0 ; j < rank ; j++) + imAt[i][j] = a[i][j] ; + + imA.resize(nrows_orig,rank) ; + for (i=0 ; i < nrows_orig ; i++) + for (j=0 ; j < rank ; j++) + imA[i][j] = v[i][j] ; + + } + +#if 0 // debug + { + int pb = 0; + vpMatrix A, ApA, AAp, AApA, ApAAp ; + + nrows = nrows_orig; + ncols = ncols_orig; + + A.resize(nrows,ncols) ; + A = *this ; + + ApA = Ap * A; + AApA = A * ApA; + ApAAp = ApA * Ap; + AAp = A * Ap; + + for (i=0;i<nrows;i++) + { + for (j=0;j<ncols;j++) if (fabs(AApA[i][j]-A[i][j]) > 1e-6) pb = 1; + } + for (i=0;i<ncols;i++) + { + for (j=0;j<nrows;j++) if (fabs(ApAAp[i][j]-Ap[i][j]) > 1e-6) pb = 1; + } + for (i=0;i<nrows;i++) + { + for (j=0;j<nrows;j++) if (fabs(AAp[i][j]-AAp[j][i]) > 1e-6) pb = 1; + } + for (i=0;i<ncols;i++) + { + for (j=0;j<ncols;j++) if (fabs(ApA[i][j]-ApA[j][i]) > 1e-6) pb = 1; + } + if (pb == 1) + { + printf("pb in pseudo inverse\n"); + std::cout << " A : " << std::endl << A << std::endl; + std::cout << " Ap : " << std::endl << Ap << std::endl; + std::cout << " A - AApA : " << std::endl << A - AApA << std::endl; + std::cout << " Ap - ApAAp : " << std::endl << Ap - ApAAp << std::endl; + std::cout << " AAp - (AAp)^T : " << std::endl << AAp - AAp.t() << std::endl; + std::cout << " ApA - (ApA)^T : " << std::endl << ApA - ApA.t() << std::endl; + } + // else printf("Ap OK ;-) \n"); + + } +#endif + + // std::cout << v << std::endl ; + return rank ; +} + + + +/*! + Compute the pseudo inverse of the matrix \f$Ap = A^+\f$ along with Ker A, Ker \f$A^T\f$, Im A and Im \f$A^T\f$ + + Pseudo inverse, kernel and image are computed using the SVD decomposition. + + A is an m x n matrix, + if m >=n the svd works on A other wise it works on \f$A^T\f$. + + Therefore if m>=n we have + +\f[ +{\bf A}_{m\times n} = {\bf U}_{m\times m} {\bf S}_{m\times n} {\bf V^\top}_{n\times n} +\f] +\f[ +{\bf A}_{m\times n} = \left[\begin{array}{ccc}\mbox{Im} {\bf A} & | & +\mbox{Ker} {\bf A^\top} \end{array} \right] {\bf S} +\left[ +\begin{array}{c} (\mbox{Im} {\bf A^\top})^\top \\ (\mbox{Ker}{\bf A})^\top \end{array}\right] +\f] +where +Im(A) is an m x r matrix (r is the rank of A) and +Im(A^T) is an r x n matrix + + + \param Ap : The pseudo inverse \f$ A^+ \f$. + \param sv : Singular values. + \param svThreshold : Threshold used to test the singular values. + \param imA: Image A + \param imAt : Image A^T + \param kerA : null space of A + \return Return the rank of the matrix A + +*/ +unsigned int +vpMatrix::pseudoInverse(vpMatrix &Ap, + vpColVector &sv, double svThreshold, + vpMatrix &imA, + vpMatrix &imAt, + vpMatrix &kerA) const +{ + + unsigned int i, j, k ; + + unsigned int nrows, ncols; + unsigned int nrows_orig = getRows() ; + unsigned int ncols_orig = getCols() ; + Ap.resize(ncols_orig,nrows_orig) ; + + if (nrows_orig >= ncols_orig) + { + nrows = nrows_orig; + ncols = ncols_orig; + } + else + { + nrows = ncols_orig; + ncols = nrows_orig; + } + + vpMatrix a(nrows,ncols) ; + vpMatrix a1(ncols,nrows); + vpMatrix v(ncols,ncols) ; + sv.resize(ncols) ; + + if (nrows_orig >= ncols_orig) a = *this; + else a = (*this).t(); + + a.svd(sv,v); + + // compute the highest singular value and the rank of h + double maxsv = 0 ; + for (i=0 ; i < ncols ; i++) + if (fabs(sv[i]) > maxsv) maxsv = fabs(sv[i]) ; + + unsigned int rank = 0 ; + for (i=0 ; i < ncols ; i++) + if (fabs(sv[i]) > maxsv*svThreshold) rank++ ; + + + + /*------------------------------------------------------- */ + for (i = 0 ; i < ncols ; i++) + { + for (j = 0 ; j < nrows ; j++) + { + a1[i][j] = 0.0; + + for (k=0 ; k < ncols ; k++) + if (fabs(sv[k]) > maxsv*svThreshold) + { + a1[i][j] += v[i][k]*a[j][k]/sv[k]; + } + } + } + if (nrows_orig >= ncols_orig) Ap = a1; + else Ap = a1.t(); + + if (nrows_orig >= ncols_orig) + { + // compute dim At + imAt.resize(ncols_orig,rank) ; + for (i=0 ; i < ncols_orig ; i++) + for (j=0 ; j < rank ; j++) + imAt[i][j] = v[i][j] ; + + // compute dim A + imA.resize(nrows_orig,rank) ; + for (i=0 ; i < nrows_orig ; i++) + for (j=0 ; j < rank ; j++) + imA[i][j] = a[i][j] ; + } + else + { + // compute dim At + imAt.resize(ncols_orig,rank) ; + for (i=0 ; i < ncols_orig ; i++) + for (j=0 ; j < rank ; j++) + imAt[i][j] = a[i][j] ; + + imA.resize(nrows_orig,rank) ; + for (i=0 ; i < nrows_orig ; i++) + for (j=0 ; j < rank ; j++) + imA[i][j] = v[i][j] ; + + } + + vpMatrix cons(ncols_orig, ncols_orig); + cons = 0; + + for (j = 0; j < ncols_orig; j++) + { + for (i = 0; i < ncols_orig; i++) + { + if (fabs(sv[i]) <= maxsv*svThreshold) + { + cons[i][j] = v[j][i]; + } + } + } + + vpMatrix Ker (ncols_orig-rank, ncols_orig); + k = 0; + for (j = 0; j < ncols_orig ; j++) + { + //if ( cons.row(j+1).sumSquare() != 0) + if ( std::fabs(cons.getRow(j).sumSquare()) > std::numeric_limits<double>::epsilon()) + { + for (i = 0; i < cons.getCols(); i++) + Ker[k][i] = cons[j][i]; + + k++; + } + } + kerA = Ker; + +#if 0 // debug + { + int pb = 0; + vpMatrix A, ApA, AAp, AApA, ApAAp ; + + nrows = nrows_orig; + ncols = ncols_orig; + + A.resize(nrows,ncols) ; + A = *this ; + + ApA = Ap * A; + AApA = A * ApA; + ApAAp = ApA * Ap; + AAp = A * Ap; + + for (i=0;i<nrows;i++) + { + for (j=0;j<ncols;j++) if (fabs(AApA[i][j]-A[i][j]) > 1e-6) pb = 1; + } + for (i=0;i<ncols;i++) + { + for (j=0;j<nrows;j++) if (fabs(ApAAp[i][j]-Ap[i][j]) > 1e-6) pb = 1; + } + for (i=0;i<nrows;i++) + { + for (j=0;j<nrows;j++) if (fabs(AAp[i][j]-AAp[j][i]) > 1e-6) pb = 1; + } + for (i=0;i<ncols;i++) + { + for (j=0;j<ncols;j++) if (fabs(ApA[i][j]-ApA[j][i]) > 1e-6) pb = 1; + } + if (pb == 1) + { + printf("pb in pseudo inverse\n"); + std::cout << " A : " << std::endl << A << std::endl; + std::cout << " Ap : " << std::endl << Ap << std::endl; + std::cout << " A - AApA : " << std::endl << A - AApA << std::endl; + std::cout << " Ap - ApAAp : " << std::endl << Ap - ApAAp << std::endl; + std::cout << " AAp - (AAp)^T : " << std::endl << AAp - AAp.t() << std::endl; + std::cout << " ApA - (ApA)^T : " << std::endl << ApA - ApA.t() << std::endl; + std::cout << " KerA : " << std::endl << kerA << std::endl; + } + // else printf("Ap OK ;-) \n"); + + } +#endif + + // std::cout << v << std::endl ; + return rank ; +} + +/*! + Extract a column vector from a matrix. + \warning All the indexes start from 0 in this function. + \param j : Index of the column to extract. If col=0, the first column is extracted. + \param i_begin : Index of the row that gives the location of the first element of the column vector to extract. + \param column_size : Size of the column vector to extract. + \return The extracted column vector. + + The following example shows how to use this function: + \code +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMatrix.h> + +int main() +{ + vpMatrix A(4,4); + + for(unsigned int i=0; i < A.getRows(); i++) + for(unsigned int j=0; j < A.getCols(); j++) + A[i][j] = i*A.getCols()+j; + + A.print(std::cout, 4); + + vpColVector cv = A.getCol(1, 1, 3); + std::cout << "Column vector: \n" << cv << std::endl; +} + \endcode +It produces the following output: + \code +[4,4]= + 0 1 2 3 + 4 5 6 7 + 8 9 10 11 + 12 13 14 15 +column vector: +5 +9 +13 + \endcode + */ +vpColVector +vpMatrix::getCol(const unsigned int j, const unsigned int i_begin, const unsigned int column_size) const +{ + if (i_begin + column_size > getRows() || j >= getCols()) + throw(vpException(vpException::dimensionError, "Unable to extract a column vector from the matrix")); + vpColVector c(column_size); + for (unsigned int i=0 ; i < column_size ; i++) + c[i] = (*this)[i_begin+i][j]; + return c; +} + +/*! + Extract a column vector from a matrix. + \warning All the indexes start from 0 in this function. + \param j : Index of the column to extract. If j=0, the first column is extracted. + \return The extracted column vector. + + The following example shows how to use this function: + \code +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMatrix.h> + +int main() +{ + vpMatrix A(4,4); + + for(unsigned int i=0; i < A.getRows(); i++) + for(unsigned int j=0; j < A.getCols(); j++) + A[i][j] = i*A.getCols()+j; + + A.print(std::cout, 4); + + vpColVector cv = A.getCol(1); + std::cout << "Column vector: \n" << cv << std::endl; +} + \endcode +It produces the following output: + \code +[4,4]= + 0 1 2 3 + 4 5 6 7 + 8 9 10 11 + 12 13 14 15 +column vector: +1 +5 +9 +13 + \endcode + */ +vpColVector +vpMatrix::getCol(const unsigned int j) const +{ + if (j >= getCols()) + throw(vpException(vpException::dimensionError, "Unable to extract a column vector from the matrix")); + unsigned int nb_rows = getRows(); + vpColVector c(nb_rows); + for (unsigned int i=0 ; i < nb_rows ; i++) + c[i] = (*this)[i][j]; + return c; +} + +/*! + Extract a row vector from a matrix. + \warning All the indexes start from 0 in this function. + \param i : Index of the row to extract. If i=0, the first row is extracted. + \return The extracted row vector. + + The following example shows how to use this function: + \code +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpRowVector.h> + +int main() +{ + vpMatrix A(4,4); + + for(unsigned int i=0; i < A.getRows(); i++) + for(unsigned int j=0; j < A.getCols(); j++) + A[i][j] = i*A.getCols()+j; + + A.print(std::cout, 4); + + vpRowVector rv = A.getRow(1); + std::cout << "Row vector: \n" << rv << std::endl; +} \endcode +It produces the following output: + \code +[4,4]= + 0 1 2 3 + 4 5 6 7 + 8 9 10 11 + 12 13 14 15 +Row vector: +4 5 6 7 + \endcode + */ +vpRowVector +vpMatrix::getRow(const unsigned int i) const +{ + if (i >= getRows()) + throw(vpException(vpException::dimensionError, "Unable to extract a row vector from the matrix")); + unsigned int nb_cols = getCols(); + vpRowVector r( nb_cols ); + for (unsigned int j=0 ; j < nb_cols ; j++) + r[j] = (*this)[i][j]; + return r; +} + +/*! + Extract a row vector from a matrix. + \warning All the indexes start from 0 in this function. + \param i : Index of the row to extract. If i=0, the first row is extracted. + \param j_begin : Index of the column that gives the location of the first element of the row vector to extract. + \param row_size : Size of the row vector to extract. + \return The extracted row vector. + + The following example shows how to use this function: + \code +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpRowVector.h> + +int main() +{ + vpMatrix A(4,4); + + for(unsigned int i=0; i < A.getRows(); i++) + for(unsigned int j=0; j < A.getCols(); j++) + A[i][j] = i*A.getCols()+j; + + A.print(std::cout, 4); + + vpRowVector rv = A.getRow(1, 1, 3); + std::cout << "Row vector: \n" << rv << std::endl; +} \endcode +It produces the following output: + \code +[4,4]= + 0 1 2 3 + 4 5 6 7 + 8 9 10 11 + 12 13 14 15 +Row vector: +5 6 7 + \endcode + */ +vpRowVector +vpMatrix::getRow(const unsigned int i, const unsigned int j_begin, const unsigned int row_size) const +{ + if (j_begin + row_size > getCols() || i >= getRows()) + throw(vpException(vpException::dimensionError, "Unable to extract a row vector from the matrix")); + vpRowVector r(row_size); + for (unsigned int j=0 ; j < row_size ; j++) + r[j] = (*this)[i][j_begin+i]; + return r; +} + +/*! + Stack matrix \e B to the end of matrix \e A and return the resulting matrix [ A B ]^T + + \param A : Upper matrix. + \param B : Lower matrix. + \return Stacked matrix [ A B ]^T + + \warning A and B must have the same number of columns. +*/ +vpMatrix +vpMatrix::stack(const vpMatrix &A, const vpMatrix &B) +{ + vpMatrix C ; + + try{ + vpMatrix::stack(A, B, C) ; + } + catch(...) { + throw ; + } + + return C ; +} + +/*! + Stack row vector \e r to matrix \e A and return the resulting matrix [ A r ]^T + + \param A : Upper matrix. + \param r : Lower matrix. + \return Stacked matrix [ A r ]^T + + \warning \e A and \e r must have the same number of columns. +*/ +vpMatrix +vpMatrix::stack(const vpMatrix &A, const vpRowVector &r) +{ + vpMatrix C ; + + try{ + vpMatrix::stack(A, r, C) ; + } + catch(...) { + throw ; + } + + return C ; +} + +/*! + Stack matrix \e B to the end of matrix \e A and return the resulting matrix in \e C. + + \param A : Upper matrix. + \param B : Lower matrix. + \param C : Stacked matrix C = [ A B ]^T + + \warning A and B must have the same number of columns. +*/ +void +vpMatrix::stack(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) +{ + unsigned int nra = A.getRows() ; + unsigned int nrb = B.getRows() ; + + if (nra !=0) + if (A.getCols() != B.getCols()) { + throw(vpException(vpException::dimensionError, + "Cannot stack (%dx%d) matrix with (%dx%d) matrix", + A.getRows(), A.getCols(), B.getRows(), B.getCols())) ; + } + + try { + C.resize(nra+nrb,B.getCols() ) ; + } + catch(...) { + throw ; + } + + unsigned int i,j ; + for (i=0 ; i < nra ; i++) { + for (j=0 ; j < A.getCols() ; j++) + C[i][j] = A[i][j] ; + } + + for (i=0 ; i < nrb ; i++) { + for (j=0 ; j < B.getCols() ; j++) { + C[i+nra][j] = B[i][j] ; + } + } +} + +/*! + Stack row vector \e v to the end of matrix \e A and return the resulting matrix in \e C. + + \param A : Upper matrix. + \param r : Lower row vector. + \param C : Stacked matrix C = [ A r ]^T + + \warning A and r must have the same number of columns. +*/ +void +vpMatrix::stack(const vpMatrix &A, const vpRowVector &r, vpMatrix &C) +{ + unsigned int nra = A.getRows() ; + + if (nra !=0) + if (A.getCols() != r.getCols()) { + throw(vpException(vpException::dimensionError, + "Cannot stack (%dx%d) matrix with (1x%d) row vector", + A.getRows(), A.getCols(), r.getCols())) ; + } + + try { + C.resize(nra+1,r.getCols() ) ; + } + catch(...) { + throw ; + } + + unsigned int i,j ; + for (i=0 ; i < nra ; i++) { + for (j=0 ; j < A.getCols() ; j++) + C[i][j] = A[i][j] ; + } + + for (j=0 ; j < r.getCols() ; j++) { + C[nra][j] = r[j] ; + } +} + +/*! + Insert matrix B in matrix A at the given position. + + \param A : Main matrix. + \param B : Matrix to insert. + \param r : Index of the row where to add the matrix. + \param c : Index of the column where to add the matrix. + \return Matrix with B insert in A. + + \warning Throw exception if the sizes of the matrices do not allow the insertion. +*/ +vpMatrix +vpMatrix::insert(const vpMatrix &A, const vpMatrix &B, + const unsigned int r, const unsigned int c) +{ + vpMatrix C ; + + try{ + insert(A,B, C, r, c) ; + } + catch(...) { + throw; + } + + return C ; +} + +/*! + \relates vpMatrix + Insert matrix B in matrix A at the given position. + + \param A : Main matrix. + \param B : Matrix to insert. + \param C : Result matrix. + \param r : Index of the row where to insert matrix B. + \param c : Index of the column where to insert matrix B. + + \warning Throw exception if the sizes of the matrices do not + allow the insertion. +*/ +void +vpMatrix::insert(const vpMatrix &A, const vpMatrix &B, vpMatrix &C, + const unsigned int r, const unsigned int c) +{ + if( ( (r + B.getRows()) <= A.getRows() ) && + ( (c + B.getCols()) <= A.getCols() ) ){ + try { + C.resize(A.getRows(),A.getCols() ) ; + } + catch(...) { + throw ; + } + for(unsigned int i=0; i<A.getRows(); i++){ + for(unsigned int j=0; j<A.getCols(); j++){ + if(i >= r && i < (r + B.getRows()) && j >= c && j < (c+B.getCols())){ + C[i][j] = B[i-r][j-c]; + } + else{ + C[i][j] = A[i][j]; + } + } + } + } + else{ + throw vpException(vpException::dimensionError, + "Cannot insert (%dx%d) matrix in (%dx%d) matrix at position (%d,%d)", + B.getRows(), B.getCols(), A.getCols(), A.getRows(), r, c); + } +} + +/*! + Juxtapose to matrices C = [ A B ]. + + \f$ C = \left( \begin{array}{cc} A & B \end{array}\right) \f$ + + \param A : Left matrix. + \param B : Right matrix. + \return Juxtaposed matrix C = [ A B ] + + \warning A and B must have the same number of column +*/ +vpMatrix +vpMatrix::juxtaposeMatrices(const vpMatrix &A, const vpMatrix &B) +{ + vpMatrix C ; + + try{ + juxtaposeMatrices(A,B, C) ; + } + catch(...) { + throw ; + } + + return C ; +} + +/*! + \relates vpMatrix + Juxtapose to matrices C = [ A B ]. + + \f$ C = \left( \begin{array}{cc} A & B \end{array}\right) \f$ + + \param A : Left matrix. + \param B : Right matrix. + \param C : Juxtaposed matrix C = [ A B ] + + \warning A and B must have the same number of rows. +*/ +void +vpMatrix::juxtaposeMatrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) +{ + unsigned int nca = A.getCols() ; + unsigned int ncb = B.getCols() ; + + if (nca !=0) + if (A.getRows() != B.getRows()) { + throw(vpException(vpException::dimensionError, + "Cannot juxtapose (%dx%d) matrix with (%dx%d) matrix", + A.getRows(), A.getCols(), B.getRows(), B.getCols())) ; + } + + try { + C.resize(B.getRows(),nca+ncb) ; + } + catch(...) { + throw ; + } + + unsigned int i,j ; + for (i=0 ; i < C.getRows(); i++) + for (j=0 ; j < nca ; j++) + C[i][j] = A[i][j] ; + + for (i=0 ; i < C.getRows() ; i++) + for (j=0 ; j < ncb ; j++){ + C[i][nca+j] = B[i][j] ; + } +} + + +//-------------------------------------------------------------------- +// Output +//-------------------------------------------------------------------- + +/*! + + Pretty print a matrix. The data are tabulated. + The common widths before and after the decimal point + are set with respect to the parameter maxlen. + + \param s Stream used for the printing. + + \param length The suggested width of each matrix element. + The actual width grows in order to accomodate the whole integral part, + and shrinks if the whole extent is not needed for all the numbers. + \param intro The introduction which is printed before the matrix. + Can be set to zero (or omitted), in which case + the introduction is not printed. + + \return Returns the common total width for all matrix elements + + \sa std::ostream &operator<<(std::ostream &s, const vpArray2D<Type> &A) +*/ +int +vpMatrix::print(std::ostream& s, unsigned int length, char const* intro) const +{ + typedef std::string::size_type size_type; + + unsigned int m = getRows(); + unsigned int n = getCols(); + + std::vector<std::string> values(m*n); + std::ostringstream oss; + std::ostringstream ossFixed; + std::ios_base::fmtflags original_flags = oss.flags(); + + // ossFixed <<std::fixed; + ossFixed.setf ( std::ios::fixed, std::ios::floatfield ); + + size_type maxBefore=0; // the length of the integral part + size_type maxAfter=0; // number of decimals plus + // one place for the decimal point + for (unsigned int i=0;i<m;++i) { + for (unsigned int j=0;j<n;++j){ + oss.str(""); + oss << (*this)[i][j]; + if (oss.str().find("e")!=std::string::npos){ + ossFixed.str(""); + ossFixed << (*this)[i][j]; + oss.str(ossFixed.str()); + } + + values[i*n+j]=oss.str(); + size_type thislen=values[i*n+j].size(); + size_type p=values[i*n+j].find('.'); + + if (p==std::string::npos){ + maxBefore=vpMath::maximum(maxBefore, thislen); + // maxAfter remains the same + } else{ + maxBefore=vpMath::maximum(maxBefore, p); + maxAfter=vpMath::maximum(maxAfter, thislen-p-1); + } + } + } + + size_type totalLength=length; + // increase totalLength according to maxBefore + totalLength=vpMath::maximum(totalLength,maxBefore); + // decrease maxAfter according to totalLength + maxAfter=std::min(maxAfter, totalLength-maxBefore); + if (maxAfter==1) maxAfter=0; + + // the following line is useful for debugging + //std::cerr <<totalLength <<" " <<maxBefore <<" " <<maxAfter <<"\n"; + + if (intro) s <<intro; + s <<"["<<m<<","<<n<<"]=\n"; + + for (unsigned int i=0;i<m;i++) { + s <<" "; + for (unsigned int j=0;j<n;j++){ + size_type p=values[i*n+j].find('.'); + s.setf(std::ios::right, std::ios::adjustfield); + s.width((std::streamsize)maxBefore); + s <<values[i*n+j].substr(0,p).c_str(); + + if (maxAfter>0){ + s.setf(std::ios::left, std::ios::adjustfield); + if (p!=std::string::npos){ + s.width((std::streamsize)maxAfter); + s <<values[i*n+j].substr(p,maxAfter).c_str(); + } else{ + assert(maxAfter>1); + s.width((std::streamsize)maxAfter); + s <<".0"; + } + } + + s <<' '; + } + s <<std::endl; + } + + s.flags(original_flags); // restore s to standard state + + return (int)(maxBefore+maxAfter); +} + + +/*! + Print using matlab syntax, to be put in matlab later. + + Print using the following form: + \code +[ a,b,c; +d,e,f; +g,h,i] + \endcode +*/ +std::ostream & vpMatrix::matlabPrint(std::ostream & os) const +{ + os << "[ "; + for (unsigned int i=0; i < this->getRows(); ++ i) { + for (unsigned int j=0; j < this ->getCols(); ++ j) { + os << (*this)[i][j] << ", "; + } + if (this ->getRows() != i+1) { os << ";" << std::endl; } + else { os << "]" << std::endl; } + } + return os; +}; + +/*! + Print using MAPLE matrix input format. + +Print using the following way so that this output can be directly copied into MAPLE: + \code +([ +[0.939846, 0.0300754, 0.340272, ], +[0.0300788, 0.984961, -0.170136, ], +[-0.340272, 0.170136, 0.924807, ], +]) + \endcode +*/ +std::ostream & vpMatrix::maplePrint(std::ostream & os) const +{ + os << "([ " << std::endl; + for (unsigned int i=0; i < this->getRows(); ++ i) { + os << "["; + for (unsigned int j=0; j < this->getCols(); ++ j) { + os << (*this)[i][j] << ", "; + } + os << "]," << std::endl; + } + os << "])" << std::endl; + return os; +}; + +/*! + Print matrix in csv format. + + Print as comma separated values so that this output can be imported into any program which has a csv data import option: + \code +0.939846, 0.0300754, 0.340272 +0.0300788, 0.984961, -0.170136 +-0.340272, 0.170136, 0.924807 + \endcode +*/ +std::ostream & vpMatrix::csvPrint(std::ostream & os) const +{ + for (unsigned int i=0; i < this->getRows(); ++ i) { + for (unsigned int j=0; j < this->getCols(); ++ j) { + os << (*this)[i][j]; + if (!(j==(this->getCols()-1))) + os << ", "; + } + os << std::endl; + } + return os; +}; + + +/*! + Print to be used as part of a C++ code later. + + Print under the following form: + \code +vpMatrix A(6,4); +A[0][0] = 1.4; +A[0][1] = 0.6; ... + \endcode + + \param os: the stream to be printed in. + \param matrixName: name of the matrix, "A" by default, to be used for + the line vpMatrix A(6,7) (see example). + \param octet: if false, print using double, if true, print byte per byte + each bytes of the double array. +*/ +std::ostream & vpMatrix::cppPrint(std::ostream & os, const char * matrixName, bool octet) const +{ + const char defaultName [] = "A"; + if (NULL == matrixName) + { + matrixName = defaultName; + } + os << "vpMatrix " << defaultName + << " (" << this ->getRows () + << ", " << this ->getCols () << "); " <<std::endl; + + for (unsigned int i=0; i < this->getRows(); ++ i) + { + for (unsigned int j=0; j < this ->getCols(); ++ j) + { + if (! octet) + { + os << defaultName << "[" << i << "][" << j + << "] = " << (*this)[i][j] << "; " << std::endl; + } + else + { + for (unsigned int k = 0; k < sizeof(double); ++ k) + { + os << "((unsigned char*)&(" << defaultName + << "[" << i << "][" << j << "]) )[" << k + <<"] = 0x" <<std::hex<< + (unsigned int)((unsigned char*)& ((*this)[i][j])) [k] + << "; " << std::endl; + } + } + } + os << std::endl; + } + return os; +}; + +/*! + Compute the determinant of the matrix using the LU Decomposition. + + \return The determinant of the matrix if the matrix is square, 0 otherwise. + + See the Numerical Recipes in C page 43 for further explanations. +*/ + +double vpMatrix::detByLU() const +{ + double det_ = 0; + + // Test wether the matrix is squred + if (rowNum == colNum) + { + // create a temporary matrix that will be modified by LUDcmp + vpMatrix tmp(*this); + + // using th LUdcmp based on NR codes + // it modified the tmp matrix in a special structure of type : + // b11 b12 b13 b14 + // a21 b22 b23 b24 + // a21 a32 b33 b34 + // a31 a42 a43 b44 + + unsigned int * perm = new unsigned int[rowNum]; // stores the permutations + int d; // +- 1 fi the number of column interchange is even or odd + tmp.LUDcmp(perm, d); + delete[]perm; + + // compute the determinant that is the product of the eigen values + det_ = (double) d; + for(unsigned int i=0;i<rowNum;i++) + { + det_*=tmp[i][i]; + } + } + else { + throw(vpException(vpException::fatalError, + "Cannot compute LU decomposition on a non square matrix (%dx%d)", + rowNum, colNum)) ; + } + return det_ ; +} + + + +/*! + Stack A at the end of the current matrix, or copy if the matrix has no dimensions : this = [ this A ]^T. + + Here an example for a robot velocity log : +\code +vpMatrix A; +vpColVector v(6); +for(unsigned int i = 0;i<100;i++) +{ + robot.getVelocity(vpRobot::ARTICULAR_FRAME, v); + Velocities.stackMatrices(v.t()); +} +\endcode +*/ +void vpMatrix::stack(const vpMatrix &A) +{ + if(rowNum == 0) + *this = A; + else + *this = vpMatrix::stack(*this, A); +} + +/*! + Stack row vector \e r at the end of the current matrix, or copy if the matrix has no dimensions : this = [ this r ]^T. +*/ +void vpMatrix::stack(const vpRowVector &r) +{ + if(rowNum == 0) + *this = r; + else + *this = vpMatrix::stack(*this, r); +} + + +/*! + Insert matrix A at the given position in the current matrix. + + \warning Throw vpException::dimensionError if the + dimensions of the matrices do not allow the operation. + + \param A : The matrix to insert. + \param r : The index of the row to begin to insert data. + \param c : The index of the column to begin to insert data. +*/ +void vpMatrix::insert(const vpMatrix&A, const unsigned int r, + const unsigned int c) +{ + if( (r + A.getRows() ) <= rowNum && (c + A.getCols() ) <= colNum ){ + // recopy matrix A in the current one, does not call static function to avoid initialisation and recopy of matrix + for(unsigned int i=r; i<(r+A.getRows()); i++){ + for(unsigned int j=c; j<(c+A.getCols()); j++){ + (*this)[i][j] = A[i-r][j-c]; + } + } + } + else{ + throw vpException(vpException::dimensionError, + "Cannot insert (%dx%d) matrix in (%dx%d) matrix at position (%d,%d)", + A.getRows(), A.getCols(), rowNum, colNum, r, c); + } +} + + +/*! + Compute the eigenvalues of a n-by-n real symmetric matrix. + + \return The eigenvalues of a n-by-n real symmetric matrix. + + \warning This method is only available if the Gnu Scientific Library + (GSL) is detected as a third party library. + + \exception vpException::dimensionError If the matrix is not square. + \exception vpException::fatalError If the matrix is not symmetric. + \exception vpException::functionNotImplementedError If the GSL library is not detected. + + Here an example: +\code +#include <iostream> + +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMatrix.h> + +int main() +{ + vpMatrix A(3,3); // A is a symmetric matrix + A[0][0] = 1/1.; A[0][1] = 1/2.; A[0][2] = 1/3.; + A[1][0] = 1/2.; A[1][1] = 1/3.; A[1][2] = 1/4.; + A[2][0] = 1/3.; A[2][1] = 1/4.; A[2][2] = 1/5.; + std::cout << "Initial symmetric matrix: \n" << A << std::endl; + + // Compute the eigen values + vpColVector evalue; // Eigenvalues + evalue = A.eigenValues(); + std::cout << "Eigen values: \n" << evalue << std::endl; +} +\endcode + + \sa eigenValues(vpColVector &, vpMatrix &) + +*/ +vpColVector vpMatrix::eigenValues() const +{ + if (rowNum != colNum) { + throw(vpException(vpException::dimensionError, + "Cannot compute eigen values on a non square matrix (%dx%d)", + rowNum, colNum)) ; + } + +#ifdef VISP_HAVE_GSL /* be careful of the copy below */ + { + // Check if the matrix is symetric: At - A = 0 + vpMatrix At_A = (*this).t() - (*this); + for (unsigned int i=0; i < rowNum; i++) { + for (unsigned int j=0; j < rowNum; j++) { + //if (At_A[i][j] != 0) { + if (std::fabs(At_A[i][j]) > std::numeric_limits<double>::epsilon()) { + throw(vpException(vpException::fatalError, + "Cannot compute eigen values on a non symetric matrix")) ; + } + } + } + + vpColVector evalue(rowNum); // Eigen values + + gsl_vector *eval = gsl_vector_alloc (rowNum); + gsl_matrix *evec = gsl_matrix_alloc (rowNum, colNum); + + gsl_eigen_symmv_workspace * w = gsl_eigen_symmv_alloc (rowNum); + gsl_matrix *m = gsl_matrix_alloc(rowNum, colNum); + + unsigned int Atda = m->tda ; + for (unsigned int i=0 ; i < rowNum ; i++){ + unsigned int k = i*Atda ; + for (unsigned int j=0 ; j < colNum ; j++) + m->data[k+j] = (*this)[i][j] ; + } + gsl_eigen_symmv (m, eval, evec, w); + + gsl_eigen_symmv_sort (eval, evec, GSL_EIGEN_SORT_ABS_ASC); + + for (unsigned int i=0; i < rowNum; i++) { + evalue[i] = gsl_vector_get (eval, i); + } + + gsl_eigen_symmv_free (w); + gsl_vector_free (eval); + gsl_matrix_free (m); + gsl_matrix_free (evec); + + return evalue; + } +#else + { + throw(vpException(vpException::functionNotImplementedError, + "Eigen values computation is not implemented. You should install GSL rd party")) ; + } +#endif +} + +/*! + Compute the eigenvalues of a n-by-n real symmetric matrix. + \return The eigenvalues of a n-by-n real symmetric matrix. + + \warning This method is only available if the Gnu Scientific Library + (GSL) is detected as a third party library. + + \param evalue : Eigenvalues of the matrix. + + \param evector : Eigenvector of the matrix. + + \exception vpException::dimensionError If the matrix is not square. + \exception vpException::fatalError If the matrix is not symmetric. + \exception vpException::functionNotImplementedError If the GSL library is not detected. + + Here an example: +\code +#include <iostream> + +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMatrix.h> + +int main() +{ + vpMatrix A(4,4); // A is a symmetric matrix + A[0][0] = 1/1.; A[0][1] = 1/2.; A[0][2] = 1/3.; A[0][3] = 1/4.; + A[1][0] = 1/2.; A[1][1] = 1/3.; A[1][2] = 1/4.; A[1][3] = 1/5.; + A[2][0] = 1/3.; A[2][1] = 1/4.; A[2][2] = 1/5.; A[2][3] = 1/6.; + A[3][0] = 1/4.; A[3][1] = 1/5.; A[3][2] = 1/6.; A[3][3] = 1/7.; + std::cout << "Initial symmetric matrix: \n" << A << std::endl; + + vpColVector d; // Eigenvalues + vpMatrix V; // Eigenvectors + + // Compute the eigenvalues and eigenvectors + A.eigenValues(d, V); + std::cout << "Eigen values: \n" << d << std::endl; + std::cout << "Eigen vectors: \n" << V << std::endl; + + vpMatrix D; + D.diag(d); // Eigenvalues are on the diagonal + + std::cout << "D: " << D << std::endl; + + // Verification: A * V = V * D + std::cout << "AV-VD = 0 ? \n" << (A*V) - (V*D) << std::endl; +} +\endcode + +\sa eigenValues() + +*/ +#ifdef VISP_HAVE_GSL /* be careful of the copy below */ +void vpMatrix::eigenValues(vpColVector &evalue, vpMatrix &evector) const +#else +void vpMatrix::eigenValues(vpColVector & /* evalue */, vpMatrix & /* evector */) const +#endif +{ + if (rowNum != colNum) { + throw(vpException(vpException::dimensionError, + "Cannot compute eigen values on a non square matrix (%dx%d)", + rowNum, colNum)) ; + } + +#ifdef VISP_HAVE_GSL /* be careful of the copy below */ + { + // Check if the matrix is symetric: At - A = 0 + vpMatrix At_A = (*this).t() - (*this); + for (unsigned int i=0; i < rowNum; i++) { + for (unsigned int j=0; j < rowNum; j++) { + //if (At_A[i][j] != 0) { + if (std::fabs(At_A[i][j]) > std::numeric_limits<double>::epsilon()) { + throw(vpException(vpException::fatalError, + "Cannot compute eigen values on a non symetric matrix")) ; + } + } + } + + // Resize the output matrices + evalue.resize(rowNum); + evector.resize(rowNum, colNum); + + gsl_vector *eval = gsl_vector_alloc (rowNum); + gsl_matrix *evec = gsl_matrix_alloc (rowNum, colNum); + + gsl_eigen_symmv_workspace * w = gsl_eigen_symmv_alloc (rowNum); + gsl_matrix *m = gsl_matrix_alloc(rowNum, colNum); + + unsigned int Atda = m->tda ; + for (unsigned int i=0 ; i < rowNum ; i++){ + unsigned int k = i*Atda ; + for (unsigned int j=0 ; j < colNum ; j++) + m->data[k+j] = (*this)[i][j] ; + } + gsl_eigen_symmv (m, eval, evec, w); + + gsl_eigen_symmv_sort (eval, evec, GSL_EIGEN_SORT_ABS_ASC); + + for (unsigned int i=0; i < rowNum; i++) { + evalue[i] = gsl_vector_get (eval, i); + } + Atda = evec->tda ; + for (unsigned int i=0; i < rowNum; i++) { + unsigned int k = i*Atda ; + for (unsigned int j=0; j < rowNum; j++) { + evector[i][j] = evec->data[k+j]; + } + } + + gsl_eigen_symmv_free (w); + gsl_vector_free (eval); + gsl_matrix_free (m); + gsl_matrix_free (evec); + } +#else + { + throw(vpException(vpException::functionNotImplementedError, + "Eigen values computation is not implemented. You should install GSL rd party")) ; + } +#endif +} + + +/*! + Function to compute the null space (the kernel) of the interaction matrix A which is not full rank. + The null space ( the kernel ) of a matrix A is defined as Null(A) = Ker(A) = {X : A*X =0}. + + \param kerA : The matrix to contain the null space (kernel) of A defined by the row vectors (A*KerA.t()=0) + \param svThreshold : Specify the used threshold in the svd(...) function (a function to compute the singular value decomposition) + + \return the rank of the matrix. +*/ + +unsigned int +vpMatrix::kernel(vpMatrix &kerA, double svThreshold) const +{ + unsigned int i, j ; + unsigned int nbline = getRows() ; + unsigned int nbcol = getCols() ; + + if ( (nbline <= 0) || (nbcol <= 0) ) { + throw( vpException(vpException::dimensionError, "Cannot compute kernel of a zero-size matrix") ); + } + + vpMatrix A ; // Copy of the matrix, SVD function is destructive + vpColVector sv(nbcol) ; // singular values + vpMatrix v(nbcol,nbcol) ; // V matrix of singular value decomposition + + // Copy and resize matrix to have at least as many rows as columns + // kernel is computed in svd method only if the matrix has more rows than columns + + if (nbline < nbcol) A.resize(nbcol,nbcol) ; + else A.resize(nbline,nbcol) ; + + for (i=0 ; i < nbline ; i++) + { + for (j=0 ; j < nbcol ; j++) + { + A[i][j] = (*this)[i][j] ; + } + } + + A.svd(sv,v); + + // Compute the highest singular value and rank of the matrix + double maxsv = 0 ; + for (i=0 ; i < nbcol ; i++) + if (fabs(sv[i]) > maxsv) maxsv = fabs(sv[i]) ; + + unsigned int rank = 0 ; + for (i=0 ; i < nbcol ; i++) + if (fabs(sv[i]) > maxsv*svThreshold) rank++ ; + + if (rank != nbcol) + { + vpMatrix Ker(nbcol-rank,nbcol) ; + unsigned int k = 0 ; + for (j = 0 ; j < nbcol ; j++) + { + //if( v.col(j) in kernel and non zero ) + if ( (fabs(sv[j]) <= maxsv*svThreshold) && (std::fabs(v.getCol(j).sumSquare()) > std::numeric_limits<double>::epsilon())) + { + // Ker.Row(k) = v.Col(j) ; + for (i=0 ; i < v.getRows() ; i++) + { + Ker[k][i] = v[i][j]; + } + k++; + } + } + kerA = Ker ; + } + else + { + kerA.resize(0,0); + } + + return rank ; +} + +/*! + Compute the determinant of a n-by-n matrix. + + \param method : Method used to compute the determinant. Default LU + decomposition methos is faster than the method based on Gaussian + elimination. + + \return Determinant of the matrix. + + \code +#include <iostream> + +#include <visp3/core/vpMatrix.h> + +int main() +{ + vpMatrix A(3,3); + A[0][0] = 1/1.; A[0][1] = 1/2.; A[0][2] = 1/3.; + A[1][0] = 1/3.; A[1][1] = 1/4.; A[1][2] = 1/5.; + A[2][0] = 1/6.; A[2][1] = 1/7.; A[2][2] = 1/8.; + std::cout << "Initial matrix: \n" << A << std::endl; + + // Compute the determinant + std:: cout << "Determinant by default method : " << + A.det() << std::endl; + std:: cout << "Determinant by LU decomposition: " << + A.det(vpMatrix::LU_DECOMPOSITION ) << std::endl; +} +\endcode +*/ +double vpMatrix::det(vpDetMethod method) const +{ + double det_ = 0; + + if ( method == LU_DECOMPOSITION ) + { + det_ = this->detByLU(); + } + + return (det_); +} + +/*! + + Compute the exponential matrix of a square matrix. + + \return Return the exponential matrix. + +*/ +vpMatrix +vpMatrix::expm() const +{ + if(colNum != rowNum) { + throw(vpException(vpException::dimensionError, + "Cannot compute the exponential of a non square (%dx%d) matrix", + rowNum, colNum )); + } + else + { +#ifdef VISP_HAVE_GSL + size_t size_ = rowNum * colNum; + double *b = new double [size_]; + for (size_t i=0; i< size_; i++) + b[i] = 0.; + gsl_matrix_view m = gsl_matrix_view_array(this->data, rowNum, colNum); + gsl_matrix_view em = gsl_matrix_view_array(b, rowNum, colNum); + gsl_linalg_exponential_ss(&m.matrix, &em.matrix, 0); + //gsl_matrix_fprintf(stdout, &em.matrix, "%g"); + vpMatrix expA(rowNum, colNum); + memcpy(expA.data, b, size_ * sizeof(double)); + + delete [] b; + return expA; +#else + vpMatrix _expE(rowNum, colNum); + vpMatrix _expD(rowNum, colNum); + vpMatrix _expX(rowNum, colNum); + vpMatrix _expcX(rowNum, colNum); + vpMatrix _eye(rowNum, colNum); + + _eye.eye(); + vpMatrix exp(*this); + + // double f; + int e; + double c = 0.5; + int q = 6; + int p = 1; + + double nA = 0; + for (unsigned int i = 0; i < rowNum;i++) + { + double sum = 0; + for (unsigned int j=0; j < colNum; j++) + { + sum += fabs((*this)[i][j]); + } + if (sum>nA||i==0) + { + nA=sum; + } + } + + /* f = */ frexp(nA, &e); + //double s = (0 > e+1)?0:e+1; + double s = e+1; + + double sca = 1.0 / pow(2.0,s); + exp=sca*exp; + _expX=*this; + _expE=c*exp+_eye; + _expD=-c*exp+_eye; + for (int k=2;k<=q;k++) + { + c = c * ((double)(q-k+1)) / ((double)(k*(2*q-k+1))); + _expcX=exp*_expX; + _expX=_expcX; + _expcX=c*_expX; + _expE=_expE+_expcX; + if (p) _expD=_expD+_expcX; + else _expD=_expD- _expcX; + p = !p; + } + _expX=_expD.inverseByLU(); + exp=_expX*_expE; + for (int k=1;k<=s;k++) + { + _expE=exp*exp; + exp=_expE; + } + return exp; +#endif + } +} + +/**************************************************************************************************************/ +/**************************************************************************************************************/ + + +//Specific functions + +/* +input:: matrix M(nCols,nRows), nCols > 3, nRows > 3 , nCols == nRows. + +output:: the complement matrix of the element (rowNo,colNo). +This is the matrix obtained from M after elimenating the row rowNo and column colNo + +example: +1 2 3 +M = 4 5 6 +7 8 9 +1 3 +subblock(M, 1, 1) give the matrix 7 9 +*/ +vpMatrix subblock(const vpMatrix &M, unsigned int col, unsigned int row) +{ + vpMatrix M_comp(M.getRows()-1,M.getCols()-1); + + for ( unsigned int i = 0 ; i < col ; i++) + { + for ( unsigned int j = 0 ; j < row ; j++) + M_comp[i][j]=M[i][j]; + for ( unsigned int j = row+1 ; j < M.getRows() ; j++) + M_comp[i][j-1]=M[i][j]; + } + for ( unsigned int i = col+1 ; i < M.getCols(); i++) + { + for ( unsigned int j = 0 ; j < row ; j++) + M_comp[i-1][j]=M[i][j]; + for ( unsigned int j = row+1 ; j < M.getRows() ; j++) + M_comp[i-1][j-1]=M[i][j]; + } + return M_comp; +} + +/*! + \return The condition number, the ratio of the largest singular value of the matrix to the smallest. + */ +double vpMatrix::cond() const +{ + vpMatrix v; + vpColVector w; + + vpMatrix M; + M = *this; + + M.svd(w, v); + double min=w[0]; + double max=w[0]; + for(unsigned int i=0;i<M.getCols();i++) + { + if(min>w[i])min=w[i]; + if(max<w[i])max=w[i]; + } + return max/min; +} + +/*! + Compute \f${\bf H} + \alpha * diag({\bf H})\f$ + \param H : input Matrix \f${\bf H}\f$. This matrix should be square. + \param alpha : Scalar \f$\alpha\f$ + \param HLM : Resulting operation. + */ +void vpMatrix::computeHLM(const vpMatrix &H, const double &alpha, vpMatrix &HLM) +{ + if(H.getCols() != H.getRows()) { + throw(vpException(vpException::dimensionError, + "Cannot compute HLM on a non square matrix (%dx%d)", + H.getRows(), H.getCols() )); + } + HLM.resize(H.getRows(), H.getCols()); + + for(unsigned int i=0;i<H.getCols();i++) + { + for(unsigned int j=0;j<H.getCols();j++) + { + HLM[i][j]=H[i][j]; + if(i==j) + HLM[i][j]+= alpha*H[i][j]; + } + } +} + +/*! + Compute and return the Euclidean norm \f$ ||x|| = \sqrt{ \sum{A_{ij}^2}} \f$. + + \return The Euclidean norm if the matrix is initialized, 0 otherwise. + + \sa infinityNorm() +*/ +double vpMatrix::euclideanNorm() const +{ + double norm=0.0; + double x ; + for (unsigned int i=0;i<dsize;i++) { + x = *(data +i); norm += x*x; + } + + return sqrt(norm); +} + +/*! + + Compute and return the infinity norm \f$ {||x||}_{\infty} = + max\left(\sum_{j=0}^{n}{\mid x_{ij} \mid}\right) \f$ with \f$i \in + \{0, ..., m\}\f$ where \f$(m,n)\f$ is the matrix size. + + \return The infinity norm if the matrix is initialized, 0 otherwise. + + \sa euclideanNorm() +*/ +double vpMatrix::infinityNorm() const +{ + double norm=0.0; + double x ; + for (unsigned int i=0;i<rowNum;i++){ + x = 0; + for (unsigned int j=0; j<colNum;j++){ + x += fabs (*(*(rowPtrs + i)+j)) ; + } + if (x > norm) { + norm = x; + } + } + return norm; +} + +/*! + Return the sum square of all the \f$A_{ij}\f$ elements of the matrix \f$A(m, n)\f$. + + \return The value \f$\sum A_{ij}^{2}\f$. + */ +double vpMatrix::sumSquare() const +{ + double sum_square=0.0; + double x ; + + for (unsigned int i=0;i<rowNum;i++) { + for(unsigned int j=0;j<colNum;j++) { + x=rowPtrs[i][j]; + sum_square += x*x; + } + } + + return sum_square; +} + +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) +vpMatrix vpMatrix::stackMatrices(const vpColVector &A, const vpColVector &B) +{ + return (vpMatrix)(vpColVector::stack(A, B)); +} + +void vpMatrix::stackMatrices(const vpColVector &A, const vpColVector &B, vpColVector &C) +{ + vpColVector::stack(A, B, C); +} + +vpMatrix vpMatrix::stackMatrices(const vpMatrix &A, const vpRowVector &B) +{ + return vpMatrix::stack(A, B); +}; + +void vpMatrix::stackMatrices(const vpMatrix &A, const vpRowVector &B, vpMatrix &C) +{ + vpMatrix::stack(A, B, C); +}; +#endif //#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + diff --git a/src/math/matrix/vpMatrix_cholesky.cpp b/modules/core/src/math/matrix/vpMatrix_cholesky.cpp similarity index 80% rename from src/math/matrix/vpMatrix_cholesky.cpp rename to modules/core/src/math/matrix/vpMatrix_cholesky.cpp index ec4af3f496e163d8116c16b3010599b1ed790d03..cec10f80f0e05e70e1e69cc91db339418835dea6 100644 --- a/src/math/matrix/vpMatrix_cholesky.cpp +++ b/modules/core/src/math/matrix/vpMatrix_cholesky.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMatrix_lu.cpp 3530 2012-01-03 10:52:12Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Matrix Cholesky decomposition. * @@ -39,26 +35,23 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#include <visp/vpMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpColVector.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpMatrixException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> -#ifdef VISP_HAVE_LAPACK +#ifdef VISP_HAVE_LAPACK_C extern "C" void dpotrf_ (char *uplo, int *n, double *a, int *lda, int *info); extern "C" int dpotri_(char *uplo, int *n, double *a, int *lda, int *info); -#endif - -#ifdef VISP_HAVE_LAPACK vpMatrix vpMatrix::inverseByCholeskyLapack() const{ int rowNum_ = (int)this->getRows(); int lda = (int)rowNum_; //lda is the number of rows because we don't use a submatrix @@ -82,7 +75,6 @@ vpMatrix vpMatrix::inverseByCholeskyLapack() const{ return A; } -#endif /*! Compute the inverse of a n-by-n matrix using the Cholesky decomposition. @@ -93,7 +85,7 @@ vpMatrix vpMatrix::inverseByCholeskyLapack() const{ Here an example: \code -#include <visp/vpMatrix.h> +#include <visp3/core/vpMatrix.h> int main() { @@ -117,7 +109,6 @@ int main() \sa pseudoInverse() */ -#if defined(VISP_HAVE_LAPACK) vpMatrix vpMatrix::inverseByCholesky() const { @@ -128,9 +119,10 @@ vpMatrix::inverseByCholesky() const throw(vpMatrixException(vpMatrixException::matrixError, "Cannot invert a non-square vpMatrix")) ; } -#ifdef VISP_HAVE_LAPACK return inverseByCholeskyLapack(); -#endif } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpMatrixLapack.cpp.o) has no symbols +void dummy_vpMatrixLapack() {}; #endif diff --git a/modules/core/src/math/matrix/vpMatrix_covariance.cpp b/modules/core/src/math/matrix/vpMatrix_covariance.cpp new file mode 100644 index 0000000000000000000000000000000000000000..81106cd2e7eb05a17bd7f6c0c0a7728028244cc1 --- /dev/null +++ b/modules/core/src/math/matrix/vpMatrix_covariance.cpp @@ -0,0 +1,215 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Covariance matrix computation. + * + * Authors: + * Aurelien Yol + * + *****************************************************************************/ + +#include <limits> // numeric_limits +#include <cmath> // std::fabs() + +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpMatrixException.h> + + +/*! + Compute the covariance matrix of the parameters x from a least squares minimisation defined as: + Ax = b + + \param A : Matrix A from Ax = b. + + \param x : Vector x from Ax = b corresponding to the parameters to estimate. + + \param b : Vector b from Ax = b. +*/ +vpMatrix vpMatrix::computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b) +{ +// double denom = ((double)(A.getRows()) - (double)(A.getCols())); // To consider OLS Estimate for sigma + double denom = ((double)(A.getRows())); // To consider MLE Estimate for sigma + + if(denom <= std::numeric_limits<double>::epsilon()) + throw vpMatrixException(vpMatrixException::divideByZeroError, "Impossible to compute covariance matrix: not enough data"); + +// double sigma2 = ( ((b.t())*b) - ( (b.t())*A*x ) ); // Should be equivalent to line bellow. + double sigma2 = (b - (A * x)).t() * (b - (A * x)); + + sigma2 /= denom; + + return (A.t()*A).pseudoInverse(A.getCols()*std::numeric_limits<double>::epsilon())*sigma2; +} + +/*! + Compute the covariance matrix of the parameters x from a least squares minimisation defined as: + WAx = Wb + + \param A : Matrix A from WAx = Wb. + + \param x : Vector x from WAx = Wb corresponding to the parameters to estimate. + + \param b : Vector b from WAx = Wb. + + \param W : Diagonal weigths matrix from WAx = Wb. +*/ +vpMatrix vpMatrix::computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b, const vpMatrix &W) +{ + double denom = 0.0; + vpMatrix W2(W.getCols(),W.getCols()); + for(unsigned int i = 0 ; i < W.getCols() ; i++){ + denom += W[i][i]; + W2[i][i] = W[i][i]*W[i][i]; + } + + if(denom <= std::numeric_limits<double>::epsilon()) + throw vpMatrixException(vpMatrixException::divideByZeroError, "Impossible to compute covariance matrix: not enough data"); + +// double sigma2 = ( ((W*b).t())*W*b - ( ((W*b).t())*W*A*x ) ); // Should be equivalent to line bellow. + double sigma2 = (W * b - (W * A * x)).t() * (W*b - (W * A * x)); + sigma2 /= denom; + + return (A.t()*(W2)*A).pseudoInverse(A.getCols()*std::numeric_limits<double>::epsilon())*sigma2; +} + +/*! + Compute the covariance matrix of an image-based virtual visual servoing. + This assumes the optimization has been done via v = Ls.pseudoInverse() * DeltaS. + + \param cMo : Pose matrix that has been computed with the v. + + \param deltaS : Error vector used in v = Ls.pseudoInverse() * DeltaS + + \param Ls : interaction matrix used in v = Ls.pseudoInverse() * DeltaS +*/ +vpMatrix +vpMatrix::computeCovarianceMatrixVVS(const vpHomogeneousMatrix &cMo, const vpColVector &deltaS, const vpMatrix &Ls) +{ + vpMatrix Js; + vpColVector deltaP; + vpMatrix::computeCovarianceMatrixVVS(cMo,deltaS,Ls,Js,deltaP); + + return vpMatrix::computeCovarianceMatrix(Js,deltaP,deltaS); +} + +/*! + Compute the covariance matrix of an image-based virtual visual servoing. + This assumes the optimization has been done via v = (W * Ls).pseudoInverse() * W * DeltaS. + + \param cMo : Pose matrix that has been computed with the v. + + \param deltaS : Error vector used in v = (W * Ls).pseudoInverse() * W * DeltaS. + + \param Ls : interaction matrix used in v = (W * Ls).pseudoInverse() * W * DeltaS. + + \param W : Weight matrix used in v = (W * Ls).pseudoInverse() * W * DeltaS. +*/ +vpMatrix +vpMatrix::computeCovarianceMatrixVVS(const vpHomogeneousMatrix &cMo, const vpColVector &deltaS, const vpMatrix &Ls, const vpMatrix &W) +{ + vpMatrix Js; + vpColVector deltaP; + vpMatrix::computeCovarianceMatrixVVS(cMo,deltaS,Ls,Js,deltaP); + + return vpMatrix::computeCovarianceMatrix(Js,deltaP,deltaS,W); +} + +void +vpMatrix::computeCovarianceMatrixVVS(const vpHomogeneousMatrix &cMo, const vpColVector &deltaS, const vpMatrix &Ls, vpMatrix &Js, vpColVector &deltaP) +{ + //building Lp + vpMatrix LpInv(6,6); + LpInv = 0; + LpInv[0][0] = -1.0; + LpInv[1][1] = -1.0; + LpInv[2][2] = -1.0; + + vpTranslationVector ctoInit; + + cMo.extract(ctoInit); + vpMatrix ctoInitSkew = ctoInit.skew(); + + vpThetaUVector thetau; + cMo.extract(thetau); + + vpColVector tu(3); + for(unsigned int i = 0 ; i < 3 ; i++) + tu[i] = thetau[i]; + + double theta = sqrt(tu.sumSquare()) ; + +// vpMatrix Lthetau(3,3); + vpMatrix LthetauInvAnalytic(3,3); + vpMatrix I3(3,3); + I3.eye(); +// Lthetau = -I3; + LthetauInvAnalytic = -I3; + + if(theta / (2.0 * M_PI) > std::numeric_limits<double>::epsilon()) + { + // Computing [theta/2 u]_x + vpColVector theta2u(3) ; + for (unsigned int i=0 ; i < 3 ; i++) { + theta2u[i] = tu[i]/2.0 ; + } + vpMatrix theta2u_skew = vpColVector::skew(theta2u); + + vpColVector u(3) ; + for (unsigned int i=0 ; i < 3 ; i++) { + u[i] = tu[i]/theta ; + } + vpMatrix u_skew = vpColVector::skew(u); + +// Lthetau += (theta2u_skew - (1.0-vpMath::sinc(theta)/vpMath::sqr(vpMath::sinc(theta/2.0)))*u_skew*u_skew); + LthetauInvAnalytic += -(vpMath::sqr(vpMath::sinc(theta/2.0)) * theta2u_skew - (1.0-vpMath::sinc(theta))*u_skew*u_skew); + } + +// vpMatrix LthetauInv = Lthetau.inverseByLU(); + + ctoInitSkew = ctoInitSkew * LthetauInvAnalytic; + + for(unsigned int a = 0 ; a < 3 ; a++) + for(unsigned int b = 0 ; b < 3 ; b++) + LpInv[a][b+3] = ctoInitSkew[a][b]; + + for(unsigned int a = 0 ; a < 3 ; a++) + for(unsigned int b = 0 ; b < 3 ; b++) + LpInv[a+3][b+3] = LthetauInvAnalytic[a][b]; + + // Building Js + Js = Ls * LpInv; + + // building deltaP + deltaP = (Js).pseudoInverse(Js.getRows()*std::numeric_limits<double>::epsilon()) * deltaS; +} diff --git a/src/math/matrix/vpMatrix_lu.cpp b/modules/core/src/math/matrix/vpMatrix_lu.cpp similarity index 91% rename from src/math/matrix/vpMatrix_lu.cpp rename to modules/core/src/math/matrix/vpMatrix_lu.cpp index 18be650f3eca81487f4b8826b1ef370e078ee12c..72d7b60a8ab06fb647ceca3964d4a5b2df369a22 100644 --- a/src/math/matrix/vpMatrix_lu.cpp +++ b/modules/core/src/math/matrix/vpMatrix_lu.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMatrix_lu.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Matrix LU decomposition. * @@ -39,20 +35,20 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpColVector.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpMatrixException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> #include <cmath> // std::fabs #include <limits> // numeric_limits @@ -210,7 +206,7 @@ void vpMatrix::LUBksb(unsigned int *perm, vpColVector& b) Here an example: \code -#include <visp/vpMatrix.h> +#include <visp3/core/vpMatrix.h> int main() { diff --git a/src/math/matrix/vpMatrix_qr.cpp b/modules/core/src/math/matrix/vpMatrix_qr.cpp similarity index 91% rename from src/math/matrix/vpMatrix_qr.cpp rename to modules/core/src/math/matrix/vpMatrix_qr.cpp index e56d02943a86d047d74d82e9e606d51ab2cd8b7b..a353923ccc74a877c9078a60b43b565e2fe205b4 100644 --- a/src/math/matrix/vpMatrix_qr.cpp +++ b/modules/core/src/math/matrix/vpMatrix_qr.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMatrix_lu.cpp 3530 2012-01-03 10:52:12Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Matrix QR decomposition. * @@ -40,22 +36,22 @@ *****************************************************************************/ #include <algorithm> // for std::min and std::max -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#include <visp/vpMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpColVector.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpMatrixException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int allocate_work(double** work); -#ifdef VISP_HAVE_LAPACK +#ifdef VISP_HAVE_LAPACK_C extern "C" int dgeqrf_(int *m, int *n, double*a, int *lda, double *tau, double *work, int *lwork, int *info); extern "C" int dormqr_(char *side, char *trans, int *m, int *n, int *k, double *a, int *lda, double *tau, double *c__, @@ -72,7 +68,7 @@ int allocate_work(double** work) *work = new double[dimWork]; return (int)dimWork; } -#ifdef VISP_HAVE_LAPACK +#ifdef VISP_HAVE_LAPACK_C vpMatrix vpMatrix::inverseByQRLapack() const{ int rowNum_ = (int)this->getRows(); int colNum_ = (int)this->getCols(); @@ -200,7 +196,7 @@ vpMatrix vpMatrix::inverseByQRLapack() const{ Here an example: \code -#include <visp/vpMatrix.h> +#include <visp3/core/vpMatrix.h> int main() { @@ -223,7 +219,7 @@ int main() \sa pseudoInverse() */ -#if defined(VISP_HAVE_LAPACK) +#if defined(VISP_HAVE_LAPACK_C) vpMatrix vpMatrix::inverseByQR() const { @@ -234,7 +230,7 @@ vpMatrix::inverseByQR() const throw(vpMatrixException(vpMatrixException::matrixError, "Cannot invert a non-square vpMatrix")) ; } -#ifdef VISP_HAVE_LAPACK +#ifdef VISP_HAVE_LAPACK_C return inverseByQRLapack(); #endif } diff --git a/src/math/matrix/vpMatrix_svd.cpp b/modules/core/src/math/matrix/vpMatrix_svd.cpp similarity index 96% rename from src/math/matrix/vpMatrix_svd.cpp rename to modules/core/src/math/matrix/vpMatrix_svd.cpp index 97ff0d6f2fb38798e4b887ba86ed0c2a7045badb..81dbf4d34e051fc7040c26640368f437839365be 100644 --- a/src/math/matrix/vpMatrix_svd.cpp +++ b/modules/core/src/math/matrix/vpMatrix_svd.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMatrix_svd.cpp 4896 2014-09-10 16:41:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Matrix SVD decomposition. * @@ -39,16 +35,16 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpColVector.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpMatrixException.h> +#include <visp3/core/vpDebug.h> #include <cmath> // std::fabs @@ -565,7 +561,7 @@ void vpMatrix::svdOpenCV(vpColVector& w, vpMatrix& v){ #endif -#ifdef VISP_HAVE_LAPACK +#ifdef VISP_HAVE_LAPACK_C extern "C" int dgesdd_(char *jobz, int *m, int *n, double *a, int *lda, double *s, double *u, int *ldu, double *vt, int *ldvt, double *work, int *lwork, int *iwork, int *info); #include <stdio.h> #include <string.h> diff --git a/modules/core/src/math/matrix/vpRowVector.cpp b/modules/core/src/math/matrix/vpRowVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5412ea0c8807ff2ff8088150ddab608fba09a7c8 --- /dev/null +++ b/modules/core/src/math/matrix/vpRowVector.cpp @@ -0,0 +1,1015 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Operation on row vectors. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + + +/*! + \file vpRowVector.cpp + \brief Definition of vpRowVector class member +*/ + +#include <string.h> +#include <stdlib.h> +#include <sstream> +#include <assert.h> + +#include <visp3/core/vpArray2D.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpRowVector.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpDebug.h> + +//! Copy operator. Allow operation such as A = v +vpRowVector & vpRowVector::operator=(const vpRowVector &v) +{ + unsigned int k = v.colNum ; + if (colNum != k){ + try { + resize(k); + } + catch(...) + { + throw; + } + } + + memcpy(data, v.data, colNum*sizeof(double)) ; + + return *this; +} + +/*! + Initialize a row vector from a 1-by-n size matrix. + \warning Handled with care m should be a 1 column matrix. + + \exception vpException::dimensionError If the matrix is not a 1-by-n dimension matrix. +*/ +vpRowVector & vpRowVector::operator=(const vpMatrix &M) +{ + if (M.getRows() != 1 ) { + throw(vpException(vpException::dimensionError, + "Cannot initialize a (1x%d) row vector from a (%dx%d) matrix", + M.getCols(), M.getRows(), M.getCols())) ; + } + + if (M.getCols() != colNum) + resize(M.getCols()); + + memcpy(data, M.data, colNum*sizeof(double)) ; + return *this; +} + +/*! + Initialize a row vector from a standard vector of double. +*/ +vpRowVector & vpRowVector::operator=(const std::vector<double> &v) +{ + resize((unsigned int)v.size()); + for(unsigned int i=0; i<v.size(); i++) + (*this)[i] = v[i]; + return *this; +} +/*! + Initialize a row vector from a standard vector of double. +*/ +vpRowVector & vpRowVector::operator=(const std::vector<float> &v) +{ + resize((unsigned int)v.size()); + for(unsigned int i=0; i<v.size(); i++) + (*this)[i] = (float)v[i]; + return *this; +} + +//! Initialize each element of the vector with \e x. +vpRowVector & vpRowVector::operator=(double x) +{ + for (unsigned int i=0; i<rowNum; i++) { + for (unsigned int j=0; j<colNum; j++) { + rowPtrs[i][j] = x; + } + } + return *this; +} + +/*! + + Multiply a row vector by a column vector. + + \param x : Column vector. + + \warning The number of elements of the two vectors must be equal. + + \exception vpException::dimensionError : If the number of elements of the + two vectors is not the same. + + \return A scalar. + +*/ +double vpRowVector::operator*(const vpColVector &x) const +{ + unsigned int nelements = x.getRows(); + if (getCols() != nelements ) { + throw(vpException(vpException::dimensionError, + "Cannot multiply (1x%d) row vector by (%dx1) column vector", + colNum, x.getRows())) ; + } + + double scalar = 0.0; + + for (unsigned int i=0; i<nelements; i++) { + scalar += (*this)[i] * x[i]; + } + return scalar; +} +/*! + + Multiply a row vector by a matrix. + + \param M : Matrix. + + \warning The number of elements of the row vector must be equal to the number + of rows of the matrix. + + \exception vpException::dimensionError If the number of elements of the + row vector is not equal to the number of rows of the matrix. + + \return The resulting row vector. + +*/ +vpRowVector vpRowVector::operator*(const vpMatrix &M) const +{ + vpRowVector c(M.getCols()); + + if (colNum != M.getRows()) { + throw(vpException(vpException::dimensionError, + "Cannot multiply (1x%d) row vector by (%dx%d) matrix", + colNum, M.getRows(), M.getCols())) ; + } + + c = 0.0; + + for (unsigned int i=0;i<colNum;i++) { + double bi = data[i] ; // optimization em 5/12/2006 + for (unsigned int j=0;j<M.getCols();j++) { + c[j]+=bi*M[i][j]; + } + } + + return c ; +} + +/*! + Operator that allows to multiply each element of a row vector by a scalar. + + \param x : The scalar. + + \return The row vector multiplied by the scalar. The current + row vector (*this) is unchanged. + + \code + vpRowVector v(3); + v[0] = 1; + v[1] = 2; + v[2] = 3; + + vpRowVector w = v * 3; + // v is unchanged + // w is now equal to : [3 6 9] + \endcode +*/ +vpRowVector vpRowVector::operator*(double x) const +{ + vpRowVector v(colNum); + + double *vd = v.data ; double *d = data ; + + for (unsigned int i=0;i<colNum;i++) + *(vd++) = (*d++) * x; + return v; +} + +/*! + Operator that allows to multiply each element of a row vector by a scalar. + + \param x : The scalar. + + \return The row vector multiplied by the scalar. + + \code + vpRowVector v(3); + v[0] = 1; + v[1] = 2; + v[2] = 3; + + v *= 3; + // v is now equal to : [3 6 9] + \endcode +*/ +vpRowVector &vpRowVector::operator*=(double x) +{ + for (unsigned int i=0;i<colNum;i++) + (*this)[i] *= x; + return (*this); +} + +/*! + Operator that allows to divide each element of a row vector by a scalar. + + \param x : The scalar. + + \return The row vector divided by the scalar. The current + row vector (*this) is unchanged. + + \code + vpRowVector v(3); + v[0] = 8; + v[1] = 4; + v[2] = 2; + + vpRowVector w = v / 2; + // v is equal to : [8 4 2] + // w is equal to : [4 2 1] + \endcode +*/ +vpRowVector vpRowVector::operator/(double x) const +{ + vpRowVector v(colNum); + + double *vd = v.data ; double *d = data ; + + for (unsigned int i=0;i<colNum;i++) + *(vd++) = (*d++) / x; + return v; +} + +/*! + Operator that allows to divide each element of a row vector by a scalar. + + \param x : The scalar. + + \return The row vector divided by the scalar. + + \code + vpRowVector v(3); + v[0] = 8; + v[1] = 4; + v[2] = 2; + // v is equal to : [8 4 2] + + v /= 2; + // v is equal to : [4 2 1] + \endcode +*/ +vpRowVector &vpRowVector::operator/=(double x) +{ + for (unsigned int i=0;i<colNum;i++) + (*this)[i] /= x; + return (*this); +} + +/*! + Operator that allows to negate all the row vector elements. + + \code + vpRowVector r(3, 1); + // r contains [1 1 1] + vpRowVector v = -r; + // v contains [-1 -1 -1] + \endcode + */ +vpRowVector vpRowVector::operator-() const +{ + vpRowVector A(colNum); + + double *vd = A.data ; double *d = data ; + + for (unsigned int i=0; i<colNum; i++) + *(vd++)= - (*d++); + + return A; +} + +/*! + Operator that allows to substract to row vectors that have the same size. + \exception vpException::dimensionError If the vectors size differ. + */ +vpRowVector vpRowVector::operator-(const vpRowVector &m) const +{ + if (getCols() != m.getCols() ) { + throw(vpException(vpException::dimensionError, + "Cannot substract (1x%d) row vector to (1x%d) row vector", + getCols(), m.getCols())) ; + } + + vpRowVector v(colNum) ; + + for (unsigned int i=0;i<colNum;i++) + v[i] = (*this)[i] - m[i]; + return v; +} + +/*! + Operator that allows to add to row vectors that have the same size. + \exception vpException::dimensionError If the vectors size differ. + */ +vpRowVector vpRowVector::operator+(const vpRowVector &v) const +{ + if (getCols() != v.getCols() ) { + throw(vpException(vpException::dimensionError, + "Cannot add (1x%d) row vector to (1x%d) row vector", + getCols(), v.getCols())) ; + } + + vpRowVector r(colNum) ; + + for (unsigned int i=0;i<colNum;i++) + r[i] = (*this)[i] + v[i]; + return r; +} + +/*! + Operator that allows to add two row vectors that have the same size. + \exception vpException::dimensionError If the size of the two vectors differ. + */ +vpRowVector & +vpRowVector::operator+=(vpRowVector v) +{ + if (getCols() != v.getCols() ) { + throw(vpException(vpException::dimensionError, + "Cannot add (1x%d) row vector to (1x%d) row vector", + getCols(), v.getCols())) ; + } + + for (unsigned int i=0;i<colNum;i++) + (*this)[i] += v[i]; + return (*this); +} + +/*! + Operator that allows to substract two row vectors that have the same size. + \exception vpException::dimensionError If the size of the two vectors differ. + */ +vpRowVector & +vpRowVector::operator-=(vpRowVector v) +{ + if (getCols() != v.getCols() ) { + throw(vpException(vpException::dimensionError, + "Cannot substract (1x%d) row vector to (1x%d) row vector", + getCols(), v.getCols())) ; + } + + for (unsigned int i=0;i<colNum;i++) + (*this)[i] -= v[i]; + return (*this); +} + +/*! + Copy operator. + Allows operation such as A << v + \code +#include <visp3/core/vpRowVector.h> + +int main() +{ + vpRowVector A, B(5); + for (unsigned int i=0; i<B.size(); i++) + B[i] = i; + A << B; + std::cout << "A: " << A << std::endl; +} + \endcode + In row vector A we get: + \code +A: 0 1 2 3 4 + \endcode + + */ +vpRowVector & vpRowVector::operator<<(const vpRowVector &v) +{ + *this = v; + return *this; +} + +/*! + Transpose the row vector. The resulting vector becomes a column vector. +*/ +vpColVector vpRowVector::t() const +{ + vpColVector v(colNum); + memcpy(v.data, data, colNum*sizeof(double)) ; + return v; +} + +/*! + Transpose the row vector. The resulting vector becomes a column vector. + \sa t() +*/ +vpColVector vpRowVector::transpose() const +{ + return t(); +} +/*! + Transpose the row vector. The resulting vector \e v becomes a column vector. + \sa t() +*/ +void vpRowVector::transpose(vpColVector &v) const +{ + v = t(); +} + +/*! + Constructor that creates a row vector corresponding to row \e i + of matrix \e M. + */ +vpRowVector::vpRowVector (const vpMatrix &M, unsigned int i) + : vpArray2D<double>(1, M.getCols()) +{ + for(unsigned int j=0; j< M.getCols(); j++) + (*this)[j] = M[i][j]; +} +/*! + Constructor that creates a row vector from a 1-by-n matrix \e M. + + \exception vpException::dimensionError If the matrix is not a 1-by-n matrix. + */ +vpRowVector::vpRowVector (const vpMatrix &M) + : vpArray2D<double>(1, M.getCols()) +{ + if(M.getRows()!=1) { + throw(vpException(vpException::dimensionError, + "Cannot construct a (1x%d) row vector from a (%dx%d) matrix", + M.getCols(), M.getRows(), M.getCols())) ; + } + + for(unsigned int j=0; j< M.getCols(); j++) + (*this)[j] = M[0][j]; +} + +/*! + Constructor that creates a row vector from a std vector of double. + */ +vpRowVector::vpRowVector (const std::vector<double> &v) + : vpArray2D<double>(1, (unsigned int)v.size()) +{ + for(unsigned int j=0; j< v.size(); j++) + (*this)[j] = v[j]; +} +/*! + Constructor that creates a row vector from a std vector of float. + */ +vpRowVector::vpRowVector (const std::vector<float> &v) + : vpArray2D<double>(1, (unsigned int)v.size()) +{ + for(unsigned int j=0; j< v.size(); j++) + (*this)[j] = (double)(v[j]); +} + +/*! + Construct a row vector from a part of an input row vector \e v. + + \param v : Input row vector used for initialization. + \param c : column index in \e v that corresponds to the first element of the row vector to contruct. + \param ncols : Number of columns of the constructed row vector. + + The sub-vector starting from v[c] element and ending on v[c+ncols-1] element + is used to initialize the contructed row vector. + + \sa init() +*/ +vpRowVector::vpRowVector (const vpRowVector &v, unsigned int c, unsigned int ncols) + : vpArray2D<double>(1, ncols) +{ + init(v, c, ncols); +} + +/*! + Normalise the vector given as input parameter and return the normalized vector: + + \f[ + {\bf x} = \frac{{\bf x}}{\sqrt{\sum_{i=1}^{n}x^2_i}} + \f] + where \f$x_i\f$ is an element of the row vector \f$\bf x\f$. +*/ +vpRowVector &vpRowVector::normalize(vpRowVector &x) const +{ + x = x/sqrt(x.sumSquare()); + + return x; +} + + +/*! + Normalise the vector modifying the vector as: + + \f[ + {\bf x} = \frac{{\bf x}}{\sqrt{\sum_{i=1}^{n}x^2_i}} + \f] + where \f$x_i\f$ is an element of the row vector \f$\bf x\f$. +*/ +vpRowVector &vpRowVector::normalize() +{ + double sum_square = sumSquare(); + if (std::fabs(sum_square) > std::numeric_limits<double>::epsilon()) { + *this /= sqrt(sum_square) ; + } + + // If sum = 0, we have a nul vector. So we return just. + return *this; +} + +/*! + Reshape the row vector in a matrix. + \param nrows : number of rows of the matrix. + \param ncols : number of columns of the matrix. + \return The resulting matrix. + + \exception vpException::dimensionError If the matrix and the row vector have not the same size. +*/ +vpMatrix vpRowVector::reshape(const unsigned int &nrows,const unsigned int &ncols) +{ + vpMatrix M(nrows,ncols); + reshape(M, nrows, ncols); + return M; +} + +/*! + Reshape the row vector in a matrix. + \param M : the reshaped matrix. + \param nrows : number of rows of the matrix. + \param ncols : number of columns of the matrix. + + \exception vpException::dimensionError If the matrix and the row vector have not the same size. +*/ +void vpRowVector::reshape(vpMatrix & M,const unsigned int &nrows,const unsigned int &ncols){ + if(dsize!=nrows*ncols) { + throw(vpException(vpException::dimensionError, + "Cannot reshape (1x%d) row vector in (%dx%d) matrix", + colNum, M.getRows(), M.getCols())) ; + } + try { + if ((M.getRows() != nrows) || (M.getCols() != ncols)) M.resize(nrows,ncols); + } + catch(...) { + throw ; + } + for(unsigned int i =0; i< nrows; i++) + for(unsigned int j =0; j< ncols; j++) + M[i][j]=data[i*nrows+j]; +} + +/*! + Insert a row vector. + \param i : Index of the first element to introduce. This index starts from 0. + \param v : Row vector to insert. + + The following example shows how to use this function: + \code +#include <visp/vpRowVector.h> + +int main() +{ + vpRowVector v(4); + for (unsigned int i=0; i < v.size(); i++) + v[i] = i; + std::cout << "v: " << v << std::endl; + + vpRowVector w(2); + for (unsigned int i=0; i < w.size(); i++) + w[i] = i+10; + std::cout << "w: " << w << std::endl; + + v.insert(1, w); + std::cout << "v: " << v << std::endl; +} \endcode + It produces the following output: + \code +v: 0 1 2 3 +w: 10 11 +v: 0 10 11 3 + \endcode + */ +void vpRowVector::insert(unsigned int i, const vpRowVector &v) +{ + if (i+v.size() > this->size()) + throw(vpException(vpException::dimensionError, + "Unable to insert (1x%d) row vector in (1x%d) row vector at position (%d)", + v.getCols(), colNum, i)); + for (unsigned int j=0; j < v.size(); j++) + (*this)[i+j] = v[j]; +} + +/*! + Stack row vector with a new element at the end of the vector. + + \param d : Element to stack to the existing one. + + \code + vpRowVector v(3, 1); + // v is equal to [1 1 1] + v.stack(-2); + // v is equal to [1 1 1 -2] + \endcode + + \sa stack(const vpRowVector &, const vpRowVector &) + \sa stack(const vpRowVector &, const vpRowVector &, vpRowVector &) + +*/ +void vpRowVector::stack(const double &d) +{ + this->resize(colNum+1,false); + (*this)[colNum-1] = d; +} + +/*! + Stack row vectors. + + \param v : Vector to stack to the existing one. + + \code + vpRowVector v1(3, 1); + // v1 is equal to [1 1 1] + vpRowVector v2(2, 3); + // v2 is equal to [3 3] + v1.stack(v2); + // v1 is equal to [1 1 1 3 3] + \endcode + + \sa stack(const vpRowVector &, const double &) + \sa stack(const vpRowVector &, const vpRowVector &) + \sa stack(const vpRowVector &, const vpRowVector &, vpRowVector &) + +*/ +void vpRowVector::stack(const vpRowVector &v) +{ + *this = vpRowVector::stack(*this, v); +} + +/*! + Stack row vectors. + + \param A : Initial vector. + \param B : Vector to stack at the end of A. + \return Stacked vector \f$[A B]\f$. + + \code + vpRowVector r1(3, 1); + // r1 is equal to [1 1 1] + vpRowVector r2(2, 3); + // r2 is equal to [3 3] + vpRowVector v; + v = vpRowVector::stack(r1, r2); + // v is equal to [1 1 1 3 3] + \endcode + + \sa stack(const vpRowVector &) + \sa stack(const vpRowVector &, const vpRowVector &, vpRowVector &) +*/ +vpRowVector vpRowVector::stack(const vpRowVector &A, const vpRowVector &B) +{ + vpRowVector C; + vpRowVector::stack(A, B, C); + return C; +} + +/*! + Stack row vectors. + + \param A : Initial vector. + \param B : Vector to stack at the end of A. + \param C : Resulting stacked vector \f$C = [A B]\f$. + + \code + vpRowVector r1(3, 1); + // r1 is equal to [1 1 1] + vpRowVector r2(2, 3); + // r2 is equal to [3 3] + vpRowVector v; + vpRowVector::stack(r1, r2, v); + // v is equal to [1 1 1 3 3] + \endcode + + \sa stack(const vpRowVector &) + \sa stack(const vpRowVector &, const vpRowVector &) +*/ +void vpRowVector::stack(const vpRowVector &A, const vpRowVector &B, vpRowVector &C) +{ + unsigned int nrA = A.getCols(); + unsigned int nrB = B.getCols(); + + if (nrA == 0 && nrB == 0) { + C.resize(0); + return; + } + + if (nrB == 0) { + C = A; + return; + } + + if (nrA == 0) { + C = B; + return; + } + + // General case + C.resize(nrA + nrB); + + for (unsigned int i=0; i<nrA; i++) + C[i] = A[i]; + + for (unsigned int i=0; i<nrB; i++) + C[nrA+i] = B[i]; +} + +/*! + Compute the mean value of all the elements of the vector. +*/ +double vpRowVector::mean(const vpRowVector &v) +{ + if (v.data == NULL) { + throw(vpException(vpException::fatalError, + "Cannot compute mean value of an empty row vector")); + } + + double mean = 0; + double *vd = v.data; + for (unsigned int i = 0; i < v.getCols(); i++) + mean += *(vd++); + + return mean / v.getCols(); +} + +/*! + Compute the median value of all the elements of the vector. +*/ +double +vpRowVector::median(const vpRowVector &v) +{ + if (v.data==NULL) { + throw(vpException(vpException::fatalError, + "Cannot compute mean value of an empty row vector")); + } + + std::vector<double> vectorOfDoubles(v.size()); + for(unsigned int i = 0; i < v.size(); i++) { + vectorOfDoubles[i] = v[i]; + } + + return vpMath::getMedian(vectorOfDoubles); +} + +/*! + Compute the standard deviation value of all the elements of the vector. +*/ +double +vpRowVector::stdev(const vpRowVector &v, const bool useBesselCorrection) +{ + if (v.data==NULL) { + throw(vpException(vpException::fatalError, + "Cannot compute mean value of an empty row vector")); + } + + double mean_value = mean(v); + double sum_squared_diff = 0.0; + for(unsigned int i = 0; i < v.size(); i++) { + sum_squared_diff += (v[i]-mean_value) * (v[i]-mean_value); + } + + double divisor = (double) v.size(); + if(useBesselCorrection && v.size() > 1) { + divisor = divisor-1; + } + + return std::sqrt(sum_squared_diff / divisor); +} + +/*! + + Pretty print a row vector. The data are tabulated. + The common widths before and after the decimal point + are set with respect to the parameter maxlen. + + \param s Stream used for the printing. + + \param length The suggested width of each row vector element. + The actual width grows in order to accomodate the whole integral part, + and shrinks if the whole extent is not needed for all the numbers. + \param intro The introduction which is printed before the vector. + Can be set to zero (or omitted), in which case + the introduction is not printed. + + \return Returns the common total width for all vector elements. + + \sa std::ostream &operator<<(std::ostream &s, const vpArray2D<Type> &A) +*/ +int +vpRowVector::print(std::ostream& s, unsigned int length, char const* intro) const +{ + typedef std::string::size_type size_type; + + unsigned int m = 1; + unsigned int n = getCols(); + + std::vector<std::string> values(m*n); + std::ostringstream oss; + std::ostringstream ossFixed; + std::ios_base::fmtflags original_flags = oss.flags(); + + // ossFixed <<std::fixed; + ossFixed.setf ( std::ios::fixed, std::ios::floatfield ); + + size_type maxBefore=0; // the length of the integral part + size_type maxAfter=0; // number of decimals plus + // one place for the decimal point + for (unsigned int j=0;j<n;++j){ + oss.str(""); + oss << (*this)[j]; + if (oss.str().find("e")!=std::string::npos){ + ossFixed.str(""); + ossFixed << (*this)[j]; + oss.str(ossFixed.str()); + } + + values[j]=oss.str(); + size_type thislen=values[j].size(); + size_type p=values[j].find('.'); + + if (p==std::string::npos){ + maxBefore=vpMath::maximum(maxBefore, thislen); + // maxAfter remains the same + } else{ + maxBefore=vpMath::maximum(maxBefore, p); + maxAfter=vpMath::maximum(maxAfter, thislen-p-1); + } + } + + + size_type totalLength=length; + // increase totalLength according to maxBefore + totalLength=vpMath::maximum(totalLength,maxBefore); + // decrease maxAfter according to totalLength + maxAfter=std::min(maxAfter, totalLength-maxBefore); + if (maxAfter==1) maxAfter=0; + + // the following line is useful for debugging + //std::cerr <<totalLength <<" " <<maxBefore <<" " <<maxAfter <<"\n"; + + if (intro) s <<intro; + s <<"["<<m<<","<<n<<"]=\n"; + + s <<" "; + for (unsigned int j=0;j<n;j++){ + size_type p=values[j].find('.'); + s.setf(std::ios::right, std::ios::adjustfield); + s.width((std::streamsize)maxBefore); + s <<values[j].substr(0,p).c_str(); + + if (maxAfter>0){ + s.setf(std::ios::left, std::ios::adjustfield); + if (p!=std::string::npos){ + s.width((std::streamsize)maxAfter); + s <<values[j].substr(p,maxAfter).c_str(); + } else{ + assert(maxAfter>1); + s.width((std::streamsize)maxAfter); + s <<".0"; + } + } + + s <<' '; + } + s <<std::endl; + + + s.flags(original_flags); // restore s to standard state + + return (int)(maxBefore+maxAfter); +} + +/*! + Allows to multiply a scalar by row vector. +*/ +vpRowVector operator*(const double &x,const vpRowVector &v) +{ + vpRowVector vout ; + vout = v*x ; + return vout ; +} + +/*! + Return the sum square of all the elements \f$v_{i}\f$ of the row vector v(n). + + \return The sum square value: \f$\sum_{j=0}^{n} v_j^{2}\f$. + */ +double vpRowVector::sumSquare() const +{ + double sum_square=0.0; + double x ; + + for (unsigned int j=0;j<colNum;j++) { + x=rowPtrs[0][j]; + sum_square += x*x; + } + + return sum_square; +} + +/*! + Compute and return the Euclidean norm \f$ ||x|| = \sqrt{ \sum{v_{i}^2}} \f$. + + \return The Euclidean norm if the vector is initialized, 0 otherwise. +*/ +double vpRowVector::euclideanNorm() const +{ + double norm=0.0; + double x ; + for (unsigned int i=0;i<dsize;i++) { + x = *(data +i); norm += x*x; + } + + return sqrt(norm); +} + +/*! + Initialize the row vector from a part of an input row vector \e v. + + \param v : Input row vector used for initialization. + \param c : column index in \e v that corresponds to the first element of the row vector to contruct. + \param ncols : Number of columns of the constructed row vector. + + The sub-vector starting from v[c] element and ending on v[c+ncols-1] element + is used to initialize the contructed row vector. + + The following code shows how to use this function: +\code +#include <visp3/core/vpRowVector.h> + +int main() +{ + vpRowVector v(4); + int val = 0; + for(size_t i=0; i<v.getCols(); i++) { + v[i] = val++; + } + std::cout << "v: " << v << std::endl; + + vpRowVector w; + w.init(v, 1, 2); + std::cout << "w: " << w << std::endl; +} +\endcode + It produces the following output: + \code +v: 0 1 2 3 +w: 1 2 + \endcode + */ +void +vpRowVector::init(const vpRowVector &v, unsigned int c, unsigned int ncols) +{ + unsigned int cncols = c+ncols ; + + if (cncols > v.getCols()) + throw(vpException(vpException::dimensionError, + "Bad column dimension (%d > %d) used to initialize vpRowVector", + cncols, v.getCols())); + resize(ncols); + if (this->rowPtrs == NULL) // Fix coverity scan: explicit null dereferenced + return; // Noting to do + for (unsigned int i=0 ; i < ncols; i++) + (*this)[i] = v[i+c]; +} diff --git a/modules/core/src/math/matrix/vpSubColVector.cpp b/modules/core/src/math/matrix/vpSubColVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..92fe2e30ec01d19e15718e8a8b1fc6cafbaab6a8 --- /dev/null +++ b/modules/core/src/math/matrix/vpSubColVector.cpp @@ -0,0 +1,244 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Mask on a vpColVector. + * + * Authors: + * Laneurit Jean + * + *****************************************************************************/ + +#include <stdlib.h> + +#include <visp3/core/vpSubColVector.h> +#include <visp3/core/vpException.h> + +//! Default constructor that creates an empty vector. +vpSubColVector::vpSubColVector() + : vpColVector(), pRowNum(0), parent(NULL) +{ +} + +/*! + Construct a sub-column vector from a parent column vector. + \param v : parent column vector. + \param offset : offset where the sub-column vector starts in the parent column vector. + \param nrows : size of the sub-column vector. +*/ +vpSubColVector::vpSubColVector(vpColVector &v, const unsigned int & offset, const unsigned int & nrows) + : vpColVector(), pRowNum(0), parent(NULL) +{ + init(v, offset, nrows); +} + +/*! + Initialize a sub-column vector from a parent column vector. + \param v : parent column vector. + \param offset : offset where the sub-column vector starts in the parent column vector. + \param nrows : size of the sub-column vector. +*/ +void vpSubColVector::init(vpColVector &v, + const unsigned int & offset, + const unsigned int & nrows) +{ + if (!v.data) { + throw(vpException(vpException::fatalError, + "Cannot initialize a sub-column vector from an empty parent column vector")) ; + } + + if(offset+nrows<=v.getRows()){ + data=v.data+offset; + + rowNum=nrows; + colNum = 1; + + pRowNum=v.getRows(); + parent=&v; + + if(rowPtrs){ + free(rowPtrs); + } + + rowPtrs=(double**)malloc( parent->getRows() * sizeof(double*)); + for(unsigned int i=0;i<nrows;i++) + rowPtrs[i]=v.data+i+offset; + + dsize = rowNum ; + } else { + throw(vpException(vpException::dimensionError, + "Cannot create a sub-column vector that is not completely containt in the parrent column vector")) ; + } +} + +//! Destructor that set the pointer to the parrent column vector to NULL. +vpSubColVector::~vpSubColVector(){ + data=NULL ; +} + +/*! + This method can be used to detect if the parent column vector + always exits or its size have not changed. + If this not the case an exception is thrown. +*/ +void vpSubColVector::checkParentStatus() const{ + if (!data) { + throw(vpException(vpException::fatalError, + "The parent of the current sub-column vector has been destroyed")) ; + } + if(pRowNum!=parent->getRows()){ + throw(vpException(vpException::dimensionError, + "The size of the parent sub-column vector has changed")) ; + } +} + +/*! + Allow to initialize a sub-column vector from an other one using operation A = B. + Notice that the sub-column vector is not resized to the dimension of \e B. + + \param B : a sub-column vector. +*/ +vpSubColVector & vpSubColVector::operator=(const vpSubColVector &B) +{ + if ( rowNum != B.getRows()) { + throw(vpException(vpException::dimensionError, + "Cannot initialize (%dx1) sub-column vector from (%dx1) sub-column vector", + rowNum, B.getRows())) ; + } + + for (unsigned int i=0;i<rowNum;i++) + data[i] = B[i]; + return *this; +} + +/*! + Allow to initialize a sub-column vector from a column vector using operation A = B. + Notice that the sub-column vector is not resized to the dimension of \e B. + \param B : a column vector. +*/ +vpSubColVector & vpSubColVector::operator=(const vpColVector &B) +{ + if ( rowNum != B.getRows()) { + throw(vpException(vpException::dimensionError, + "Cannot initialize (%dx1) sub-column vector from (%dx1) column vector", + rowNum, B.getRows())) ; + } + + for (unsigned int i=0;i<rowNum;i++) + data[i] = B[i]; + + return *this; +} + +/*! + Allow to initialize a sub-column vector from a m-by-1 matrix using operation A = B. + Notice that the sub-column vector is not resized to the dimension of \e B. + \param B : a matrix of size m-by-1. +*/ +vpSubColVector & vpSubColVector::operator=(const vpMatrix &B) +{ + if ((B.getCols()!=1)||(rowNum != B.getRows())) { + throw(vpException(vpException::dimensionError, + "Cannot initialize (%dx1) sub-column vector from (%dx%d) matrix", + rowNum, B.getRows(), B.getCols())) ; + } + + for (unsigned int i=0;i<rowNum;i++) + data[i] = B[i][1]; + return *this; +} + +/*! + Set all the elements of the sub-column vector to \e x. + \param x : a scalar value. +*/ +vpSubColVector & vpSubColVector::operator=(const double &x) +{ + for (unsigned int i=0;i<rowNum;i++) + data[i] = x; + return *this; +} + +/*! + Operator that allows to convert a translation vector into a column vector. + */ +vpSubColVector &vpSubColVector::operator=(const vpTranslationVector &tv) +{ + unsigned int k = tv.getRows() ; + if (rowNum != k){ + try { + resize(k); + } + catch(...) + { + throw ; + } + } + + memcpy(data, tv.data, rowNum*sizeof(double)) ; + return *this; +} +/*! + Operator that allows to convert a rotation vector into a column vector. + */ +vpSubColVector &vpSubColVector::operator=(const vpRotationVector &rv) +{ + unsigned int k = rv.getRows() ; + if (rowNum != k){ + try { + resize(k); + } + catch(...) + { + throw ; + } + } + + memcpy(data, rv.data, rowNum*sizeof(double)) ; + return *this; +} +/*! + Operator that allows to convert a pose vector into a column vector. + */ +vpSubColVector &vpSubColVector::operator=(const vpPoseVector &p) +{ + unsigned int k = p.getRows() ; + if (rowNum != k){ + try { + resize(k); + } + catch(...) + { + throw ; + } + } + + memcpy(data, p.data, rowNum*sizeof(double)) ; + return *this; +} diff --git a/src/math/matrix/vpSubMatrix.cpp b/modules/core/src/math/matrix/vpSubMatrix.cpp similarity index 89% rename from src/math/matrix/vpSubMatrix.cpp rename to modules/core/src/math/matrix/vpSubMatrix.cpp index 6ba81a2f45d1684ed5457eaa774f386f342a49ba..19a146813468cc3a3969fcb93aec7bccc9faf00d 100644 --- a/src/math/matrix/vpSubMatrix.cpp +++ b/modules/core/src/math/matrix/vpSubMatrix.cpp @@ -1,12 +1,8 @@ /**************************************************************************** - * - * $Id: vpSubMatrix.cpp 4649 2014-02-07 14:57:11Z fspindle $ - * - * Copyright (C) 2005 - 2014 Inria. All rights reserved. * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -14,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -40,10 +35,10 @@ * *****************************************************************************/ -#include <visp/vpSubMatrix.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpSubMatrix.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpMatrixException.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> vpSubMatrix::vpSubMatrix() @@ -98,7 +93,6 @@ void vpSubMatrix::init(vpMatrix &m, const unsigned int &row_offset, const unsign rowPtrs[r]= m.data+col_offset+(r+row_offset)*pColNum; dsize = pRowNum*pColNum ; - trsize =0 ; }else{ vpERROR_TRACE("Submatrix cannot be contain in parent matrix") ; throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError,"Submatrix cannot be contain in parent matrix")) ; @@ -109,7 +103,7 @@ void vpSubMatrix::init(vpMatrix &m, const unsigned int &row_offset, const unsign \brief This method can be used to detect if the parent matrix always exits or its size have not changed and throw an exception is not */ -void vpSubMatrix::checkParentStatus(){ +void vpSubMatrix::checkParentStatus() const { if(!data){ vpERROR_TRACE("\n\t\t vpSubMatrix parent vpMatrix has been destroyed"); throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, diff --git a/modules/core/src/math/matrix/vpSubRowVector.cpp b/modules/core/src/math/matrix/vpSubRowVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..84c24694eb832cf8f2cefa6ef3c04be7619b4924 --- /dev/null +++ b/modules/core/src/math/matrix/vpSubRowVector.cpp @@ -0,0 +1,186 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Mask on a vpRowVector . + * + * Authors: + * Laneurit Jean + * + *****************************************************************************/ + +#include <stdlib.h> + +#include <visp3/core/vpSubRowVector.h> +#include <visp3/core/vpException.h> + +//! Default constructor that creates an empty vector. +vpSubRowVector::vpSubRowVector() + : vpRowVector(), pColNum(0), parent(NULL) +{ +} + +/*! + Construct a sub-row vector from a parent row vector. + \param v : parent row vector. + \param offset : offset where the sub-row vector starts in the parent row vector. + \param ncols : size of the sub-row vector. +*/ +vpSubRowVector::vpSubRowVector(vpRowVector &v, const unsigned int & offset,const unsigned int & ncols) + : vpRowVector(), pColNum(0), parent(NULL) +{ + init(v, offset, ncols); +} + +/*! + Initialize a sub-row vector from a parent row vector. + \param v : parent row vector. + \param offset : offset where the sub-row vector starts in the parent row vector. + \param ncols : size of the sub-row vector. +*/ +void vpSubRowVector::init(vpRowVector &v, const unsigned int & offset,const unsigned int & ncols) +{ + if (!v.data) { + throw(vpException(vpException::fatalError, + "Cannot initialize a sub-row vector from an empty parent row vector")) ; + } + + if(offset+ncols<=v.getCols()){ + data=v.data+offset; + + rowNum=1; + colNum = ncols; + + pColNum=v.getCols(); + parent=&v; + + if(rowPtrs) + free(rowPtrs); + + rowPtrs=(double**) malloc(1 * sizeof(double*)); + for(unsigned int i=0;i<1;i++) + rowPtrs[i]=v.data+i+offset; + + dsize = colNum ; + } else { + throw(vpException(vpException::dimensionError, + "Cannot create a sub-row vector that is not completely containt in the parrent row vector")) ; + } +} + +//! Destructor that set the pointer to the parrent row vector to NULL. +vpSubRowVector::~vpSubRowVector(){ + data=NULL ; +} + +/*! + This method can be used to detect if the parent row vector + always exits or its size have not changed. + If this not the case an exception is thrown. +*/ +void vpSubRowVector::checkParentStatus() const +{ + if(!data){ + throw(vpException(vpException::fatalError, + "The parent of the current sub-row vector has been destroyed")) ; + } + if(pColNum!=parent->getCols()){ + throw(vpException(vpException::dimensionError, + "The size of the parent sub-row vector has changed")) ; + } +} + +/*! + Allow to initialize a sub-row vector from an other one using operation A = B. + Notice that the sub-row vector is not resized to the dimension of \e B. + + \param B : a sub-row vector. +*/ +vpSubRowVector & vpSubRowVector::operator=(const vpSubRowVector &B) +{ + if ( colNum != B.getCols()) { + throw(vpException(vpException::dimensionError, + "Cannot initialize (1x%d) sub-row vector from (1x%d) sub-row vector", + colNum, B.getCols())) ; + } + + for (unsigned int i=0;i<rowNum;i++) + data[i] = B[i]; + + return *this; +} + +/*! + Allow to initialize a sub-row vector from a row vector using operation A = B. + Notice that the sub-row vector is not resized to the dimension of \e B. + + \param B : a row vector. +*/ +vpSubRowVector & vpSubRowVector::operator=(const vpRowVector &B) +{ + if ( colNum != B.getCols()) { + throw(vpException(vpException::dimensionError, + "Cannot initialize (1x%d) sub-row vector from (1x%d) row vector", + colNum, B.getCols())) ; + } + + for (unsigned int i=0;i<rowNum;i++) + data[i] = B[i]; + + return *this; +} + +/*! + Allow to initialize a sub-row vector from a matrix using operation A = B. + Notice that the sub-row vector is not resized to the dimension of \e B. + + \param B : a matrix of size 1-by-n. +*/ +vpSubRowVector & vpSubRowVector::operator=(const vpMatrix &B) +{ + if ((B.getRows()!=1)||(colNum != B.getCols())) { + throw(vpException(vpException::dimensionError, + "Cannot initialize (1x%d) sub-column vector from (%dx%d) matrix", + colNum, B.getRows(), B.getCols())) ; + } + + for (unsigned int i=0;i<rowNum;i++) + data[i] = B[i][1]; + return *this; +} +/*! + Set all the elements of the sub-row vector to \e x. + \param x : a scalar value. +*/ +vpSubRowVector & vpSubRowVector::operator=(const double &x) +{ + for (unsigned int i=0;i<rowNum;i++) + data[i] = x; + return *this; +} diff --git a/src/math/misc/vpHinkley.cpp b/modules/core/src/math/misc/vpHinkley.cpp old mode 100755 new mode 100644 similarity index 95% rename from src/math/misc/vpHinkley.cpp rename to modules/core/src/math/misc/vpHinkley.cpp index c24c1689366c79373d58ec70ed8104033e52963f..97facf657ab46c87b848b13dba8d86266cf5f452 --- a/src/math/misc/vpHinkley.cpp +++ b/modules/core/src/math/misc/vpHinkley.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHinkley.cpp 5060 2014-12-12 18:31:03Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Hinkley's cumulative sum test implementation. * @@ -48,10 +44,10 @@ */ -#include <visp/vpHinkley.h> -#include <visp/vpDebug.h> -#include <visp/vpIoTools.h> -#include <visp/vpMath.h> +#include <visp3/core/vpHinkley.h> +#include <visp3/core/vpDebug.h> +//#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> #include <stdio.h> #include <stdlib.h> diff --git a/modules/core/src/math/misc/vpMath.cpp b/modules/core/src/math/misc/vpMath.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d8a6ff56035d31dd24399fe8c38225eb22a998cb --- /dev/null +++ b/modules/core/src/math/misc/vpMath.cpp @@ -0,0 +1,262 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Simple mathematical function not available in the C math library (math.h). + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +/*! + \file vpMath.cpp + \brief Provides simple Math computation that are not available in + the C mathematics library (math.h) +*/ + +#include <stdint.h> +#include <numeric> +#include <functional> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpException.h> + + +#if defined(VISP_HAVE_FUNC__ISNAN) +# include <float.h> +#endif + +#if !(defined(VISP_HAVE_FUNC_ISNAN) || defined(VISP_HAVE_FUNC_STD_ISNAN)) || !(defined(VISP_HAVE_FUNC_ISINF) || defined(VISP_HAVE_FUNC_STD_ISINF)) +# if defined _MSC_VER || defined __BORLANDC__ +typedef __int64 int64; +typedef unsigned __int64 uint64; +# else +typedef int64_t int64; +typedef uint64_t uint64; +# endif + +#ifndef DOXYGEN_SHOULD_SKIP_THIS +typedef union Cv64suf +{ + int64 i; + uint64 u; + double f; +} +Cv64suf; +#endif +#endif + +const double vpMath::ang_min_sinc = 1.0e-8; +const double vpMath::ang_min_mc = 2.5e-4; + + +/*! + Check whether a double number is not a number (NaN) or not. + \param value : Double number to check. + \return Return true if value is not a number. + */ +bool vpMath::isNaN(const double value) +{ +#if defined(VISP_HAVE_FUNC_ISNAN) + return isnan(value); +#elif defined(VISP_HAVE_FUNC_STD_ISNAN) + return std::isnan(value); +#elif defined(VISP_HAVE_FUNC__ISNAN) + return (_isnan(value) != 0); +#else + #if 0 + //This trick should work for any compiler which claims to use IEEE floating point. + //Do not work with g++ and -ffast-math option. + return (value != value); + #else + //Taken from OpenCV source code CvIsNan() + Cv64suf ieee754; + ieee754.f = value; + return (((unsigned)(ieee754.u >> 32) & 0x7fffffff) + + ((unsigned)ieee754.u != 0) > 0x7ff00000) != 0; + #endif +#endif +} +/*! + Returns whether a double is an infinity value (either positive infinity or negative infinity). + \param value : Double number to check. + \return Return true if value is infinity. + */ +bool vpMath::isInf(const double value) +{ +#if defined(VISP_HAVE_FUNC_ISINF) + return isinf(value); +#elif defined(VISP_HAVE_FUNC_STD_ISINF) + return std::isinf(value); +#elif defined(VISP_HAVE_FUNC__FINITE) + return !_finite(value); +#else + //Taken from OpenCV source code CvIsInf() + Cv64suf ieee754; + ieee754.f = value; + return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) == 0x7ff00000 && + (unsigned)ieee754.u == 0; +#endif +} + +/*! + Compute \f$ (1-cos(x))/x^2 \f$ + + \param cosx : Value of cos(x). + \param x : Value of x. + + \return \f$ (1-cosx)/x^2 \f$ + +*/ +double vpMath::mcosc(double cosx, double x) +{ + if (fabs(x) < ang_min_mc) return 0.5 ; + else return ((1.0-cosx)/x/x) ; +} + +/*! + + Compute \f$ (1-sinc(x))/x^2 \f$ with \f$ sinc(x) = sinx / x \f$. + + \param sinx : value of sin(x). + \param x : Value of x. + + \return \f$ (1-sinc(x))/x^2 \f$ + +*/ +double vpMath::msinc(double sinx, double x) +{ + if (fabs(x) < ang_min_mc) return (1./6.0) ; + else return ((1.0-sinx/x)/x/x) ; +} + +/*! + + Compute sinus cardinal \f$ \frac{sin(x)}{x} \f$. + + \param x : Value of x. + + \return Sinus cardinal. + +*/ +double vpMath::sinc(double x) +{ + if (fabs(x) < ang_min_sinc) return 1.0 ; + else return sin(x)/x ; +} +/*! + + Compute sinus cardinal \f$ \frac{sin(x)}{x}\f$. + + \param sinx : Value of sin(x). + \param x : Value of x. + + \return Sinus cardinal. + +*/ +double vpMath::sinc(double sinx, double x) +{ + if (fabs(x) < ang_min_sinc) return 1.0 ; + else return (sinx/x) ; +} + +/*! + Compute the mean value for a vector of double. + + \param v : Vector of double values. + + \return The mean value. +*/ +double vpMath::getMean(const std::vector<double> &v) +{ + if(v.empty()) { + throw vpException(vpException::notInitialized, "Empty vector !"); + } + + double sum = 0.0; + size_t size = v.size(); + + sum = std::accumulate(v.begin(), v.end(), 0.0); + + return sum / (double) size; +} + +/*! + Compute the median value for a vector of double. + + \param v : Vector of double values. + + \return The median value. +*/ +double vpMath::getMedian(const std::vector<double> &v) { + if(v.empty()) { + throw vpException(vpException::notInitialized, "Empty vector !"); + } + + double median = 0.0; + std::vector<double> v_copy = v; + size_t size = v_copy.size(); + + if(size % 2 == 0) { + sort(v_copy.begin(), v_copy.end()); + median = (v_copy[size / 2 - 1] + v_copy[size / 2]) / 2.0; + } else { + std::nth_element(v_copy.begin(), v_copy.begin() + (int) (size/2), v_copy.end()); + median = v_copy[size/2]; + } + + return median; +} + +/*! + Compute the standard deviation value for a vector of double. + + \param v : Vector of double values. + \param useBesselCorrection : If true, the Bessel correction is used (normalize by N-1). + + \return The standard deviation value. +*/ +double vpMath::getStdev(const std::vector<double> &v, const bool useBesselCorrection) { + if(v.empty()) { + throw vpException(vpException::notInitialized, "Empty vector !"); + } + + double mean = getMean(v); + + std::vector<double> diff(v.size()); + std::transform(v.begin(), v.end(), diff.begin(), + std::bind2nd(std::minus<double>(), mean)); + double sq_sum = std::inner_product(diff.begin(), diff.end(), diff.begin(), 0.0); + double divisor = (double) v.size(); + if(useBesselCorrection && v.size() > 1) { + divisor = divisor-1; + } + + return std::sqrt(sq_sum / divisor); +} diff --git a/modules/core/src/math/random-generator/vpGaussRand.cpp b/modules/core/src/math/random-generator/vpGaussRand.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3712e71c9d5d294ab36da76307104d13d06618b2 --- /dev/null +++ b/modules/core/src/math/random-generator/vpGaussRand.cpp @@ -0,0 +1,73 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Generation of random number with uniform and normal probability density. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +#include <math.h> +#include <visp3/core/vpGaussRand.h> + +/*! + Generate a normal random variable using the Box-Muller generator. + + Generate a normal random variable with mean 0 and standard deviation of 1. + To adjust to some other distribution, multiply by the standard deviation and + add the mean. Box-Muller method +*/ +double +vpGaussRand::gaussianDraw() +{ + double v1, v2, rsq; + static bool AlreadyDone = false; + static double x2; + + if (AlreadyDone) { + AlreadyDone=false; + return x2; + } + + else { + + do { + v1=2*draw1()-1; + v2=2*draw1()-1; + rsq=v1*v1+v2*v2; + } while (rsq >= 1); + + double fac=sqrt(-2*log(rsq)/rsq); + x2=v2*fac; + AlreadyDone=true; + return v1*fac; + } +} diff --git a/src/math/misc/vpNoise.cpp b/modules/core/src/math/random-generator/vpUniRand.cpp similarity index 62% rename from src/math/misc/vpNoise.cpp rename to modules/core/src/math/random-generator/vpUniRand.cpp index 39f9ef766b34ccd29aedcbb23e83418d2d743da8..6e4a40151d2fafb5e22c46a8762ae96e66f2b7d0 100644 --- a/src/math/misc/vpNoise.cpp +++ b/modules/core/src/math/random-generator/vpUniRand.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpNoise.cpp 4975 2014-11-17 15:59:42Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Generation of random number with uniform and normal probability density. * @@ -39,17 +35,8 @@ * *****************************************************************************/ -#include <visp/vpNoise.h> #include <math.h> - -/*! - \file vpNoise.cpp - \brief Class for generating random numbers with uniform and normal probability density. - - The algorithms and notations used are described in \cite Gentle:2004. - -*/ - +#include <visp3/core/vpUniRand.h> /*! Minimal random number generator of Park and Miller \cite Park:1988. Returns a @@ -58,10 +45,8 @@ */ inline void vpUniRand::draw0() -//minimal standard -//Park and Miller random number generator { - /*unsigned*/ long k= x/q;//temp value for computing without overflow + long k= x/q;//temp value for computing without overflow x = a*(x-k*q)-k*r; if (x < 0) x += m; //compute x without overflow } @@ -110,38 +95,3 @@ vpUniRand::draw1() return ans; } - -/*! - Generate a normal random variable using the Box-Muller generator. - - Generate a normal random variable with mean 0 and standard deviation of 1. - To adjust to some other distribution, multiply by the standard deviation and - add the mean. Box-Muller method -*/ -double -vpGaussRand::gaussianDraw() -{ - double v1, v2, rsq; - static bool AlreadyDone = false; - static double x2; - - if (AlreadyDone) { - AlreadyDone=false; - return x2; - } - - else { - - do { - v1=2*draw1()-1; - v2=2*draw1()-1; - rsq=v1*v1+v2*v2; - } while (rsq >= 1); - - double fac=sqrt(-2*log(rsq)/rsq); - x2=v2*fac; - AlreadyDone=true; - return v1*fac; - } -} - diff --git a/src/math/robust/vpRobust.cpp b/modules/core/src/math/robust/vpRobust.cpp similarity index 98% rename from src/math/robust/vpRobust.cpp rename to modules/core/src/math/robust/vpRobust.cpp index 86c0aab3e1741cc98d58e4e285948cb62a22b8e2..d0b3e0f8c14e762228d399b35ec01af48bdcb217 100644 --- a/src/math/robust/vpRobust.cpp +++ b/modules/core/src/math/robust/vpRobust.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobust.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * M-Estimator and various influence function. * @@ -47,11 +43,11 @@ -#include <visp/vpDebug.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> -#include <visp/vpRobust.h> +#include <visp3/core/vpRobust.h> #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/src/math/robust/vpScale.cpp b/modules/core/src/math/robust/vpScale.cpp similarity index 90% rename from src/math/robust/vpScale.cpp rename to modules/core/src/math/robust/vpScale.cpp index d8d4553f5a161ad34d0d0439fe96ea5956a7d235..f098e85c6a1fd585bca744dca01cf05bb72a69ad 100644 --- a/src/math/robust/vpScale.cpp +++ b/modules/core/src/math/robust/vpScale.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpScale.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Median Absolute Deviation (MAD), MPDE, Mean shift kernel density estimation. * @@ -46,9 +42,9 @@ -#include <visp/vpColVector.h> -#include <visp/vpMath.h> -#include <visp/vpScale.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpScale.h> #include <stdlib.h> #include <cmath> // std::fabs #include <limits> // numeric_limits @@ -60,7 +56,7 @@ //! Constructor vpScale::vpScale() - : bandwidth(0.02), dimension(1), kernel_type(EPANECHNIKOV) + : bandwidth(0.02), dimension(1) { #if (DEBUG_LEVEL2) std::cout << "vpScale constructor reached" << std::endl; @@ -72,8 +68,8 @@ vpScale::vpScale() } //! Constructor -vpScale::vpScale(double kernel_bandwidth, unsigned int dim, int type) - : bandwidth(kernel_bandwidth), dimension(dim), kernel_type(type) +vpScale::vpScale(double kernel_bandwidth, unsigned int dim) + : bandwidth(kernel_bandwidth), dimension(dim) { #if (DEBUG_LEVEL2) diff --git a/src/math/spline/vpBSpline.cpp b/modules/core/src/math/spline/vpBSpline.cpp similarity index 97% rename from src/math/spline/vpBSpline.cpp rename to modules/core/src/math/spline/vpBSpline.cpp index c78e194db1f83d286abb2b5caa39fc0d74652cc1..e6e832eeee8fcb128031a8368ad9bc429297a21c 100644 --- a/src/math/spline/vpBSpline.cpp +++ b/modules/core/src/math/spline/vpBSpline.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpBSpline.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * This class implements the B-Spline * @@ -39,8 +35,8 @@ * *****************************************************************************/ -#include <visp/vpBSpline.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpBSpline.h> +#include <visp3/core/vpDebug.h> /*! Basic constructor. diff --git a/src/math/transformation/vpExponentialMap.cpp b/modules/core/src/math/transformation/vpExponentialMap.cpp similarity index 95% rename from src/math/transformation/vpExponentialMap.cpp rename to modules/core/src/math/transformation/vpExponentialMap.cpp index 128df2245fe113c8bec358cf473b18b9be3bac64..9159b075044e0eea66f5e5d31bbe9a55bb9a765f 100644 --- a/src/math/transformation/vpExponentialMap.cpp +++ b/modules/core/src/math/transformation/vpExponentialMap.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpExponentialMap.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exponential map. * @@ -40,7 +36,7 @@ * *****************************************************************************/ -#include <visp/vpExponentialMap.h> +#include <visp3/core/vpExponentialMap.h> /*! diff --git a/src/math/transformation/vpForceTwistMatrix.cpp b/modules/core/src/math/transformation/vpForceTwistMatrix.cpp similarity index 55% rename from src/math/transformation/vpForceTwistMatrix.cpp rename to modules/core/src/math/transformation/vpForceTwistMatrix.cpp index 96b3acad657253d13f7403f211ec2e812bd11ba7..f8c7d20c5f809a7e1b25813ef7e27c14f87f4749 100644 --- a/src/math/transformation/vpForceTwistMatrix.cpp +++ b/modules/core/src/math/transformation/vpForceTwistMatrix.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpForceTwistMatrix.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Twist transformation matrix that allows to transform forces from one * frame to an other. @@ -40,14 +36,12 @@ * *****************************************************************************/ -#include <visp/vpForceTwistMatrix.h> +#include <sstream> +#include <assert.h> -// Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> - -// Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpForceTwistMatrix.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpDebug.h> /*! @@ -67,8 +61,6 @@ vpForceTwistMatrix & vpForceTwistMatrix::operator=(const vpForceTwistMatrix &M) { - init() ; - for (int i=0; i<6; i++) { for (int j=0; j<6; j++) { rowPtrs[i][j] = M.rowPtrs[i][j]; @@ -80,38 +72,28 @@ vpForceTwistMatrix::operator=(const vpForceTwistMatrix &M) /*! - Initialize the force/torque 6 by 6 twist matrix as identity. + Initialize the force/torque 6 by 6 twist matrix to identity. */ - void -vpForceTwistMatrix::init() +vpForceTwistMatrix::eye() { - unsigned int i,j ; - - try { - resize(6,6) ; - } - catch(vpException me) { - vpERROR_TRACE("Error caught") ; - throw ; - } - - for (i=0 ; i < 6 ; i++) { - for (j=0 ; j < 6; j++) { + for (unsigned int i=0 ; i < 6 ; i++) { + for (unsigned int j=0 ; j < 6; j++) { if (i==j) - (*this)[i][j] = 1.0 ; + (*this)[i][j] = 1.0 ; else - (*this)[i][j] = 0.0; + (*this)[i][j] = 0.0; } } } /*! - Initialize a force/torque twist transformation matrix as identity. + Initialize a force/torque twist transformation matrix to identity. */ -vpForceTwistMatrix::vpForceTwistMatrix() : vpMatrix() +vpForceTwistMatrix::vpForceTwistMatrix() + : vpArray2D<double>(6,6) { - init() ; + eye() ; } /*! @@ -121,16 +103,16 @@ vpForceTwistMatrix::vpForceTwistMatrix() : vpMatrix() \param F : Force/torque twist matrix used as initializer. */ -vpForceTwistMatrix::vpForceTwistMatrix(const vpForceTwistMatrix &F) : vpMatrix() +vpForceTwistMatrix::vpForceTwistMatrix(const vpForceTwistMatrix &F) + : vpArray2D<double>(6,6) { - init() ; *this = F ; } /*! Initialize a force/torque twist transformation matrix from an - homogeneous matrix. Given the homogenous transformation + homogeneous matrix. Given the homogeneous transformation \f[ ^a{\bf M}_b = \left(\begin{array}{cc} ^a{\bf R}_b & ^a{\bf t}_b\\ @@ -151,9 +133,9 @@ vpForceTwistMatrix::vpForceTwistMatrix(const vpForceTwistMatrix &F) : vpMatrix() transformation matrix. */ -vpForceTwistMatrix::vpForceTwistMatrix(const vpHomogeneousMatrix &M) : vpMatrix() +vpForceTwistMatrix::vpForceTwistMatrix(const vpHomogeneousMatrix &M) + : vpArray2D<double>(6,6) { - init() ; buildFrom(M); } @@ -162,16 +144,16 @@ vpForceTwistMatrix::vpForceTwistMatrix(const vpHomogeneousMatrix &M) : vpMatrix( Initialize a force/torque twist transformation matrix from a translation vector \e t and a rotation vector with \f$\theta u \f$ parametrization. - \param tv : Translation vector. + \param t : Translation vector. \param thetau : \f$\theta u\f$ rotation vector. */ -vpForceTwistMatrix::vpForceTwistMatrix(const vpTranslationVector &tv, - const vpThetaUVector &thetau) : vpMatrix() +vpForceTwistMatrix::vpForceTwistMatrix(const vpTranslationVector &t, + const vpThetaUVector &thetau) + : vpArray2D<double>(6,6) { - init() ; - buildFrom(tv, thetau) ; + buildFrom(t, thetau) ; } /*! @@ -179,49 +161,44 @@ vpForceTwistMatrix::vpForceTwistMatrix(const vpTranslationVector &tv, Initialize a force/torque twist transformation matrix from a translation vector \e t and a rotation matrix R. - \param tv : Translation vector. + \param t : Translation vector. \param R : Rotation matrix. */ -vpForceTwistMatrix::vpForceTwistMatrix(const vpTranslationVector &tv, - const vpRotationMatrix &R) +vpForceTwistMatrix::vpForceTwistMatrix(const vpTranslationVector &t, + const vpRotationMatrix &R) + : vpArray2D<double>(6,6) { - init() ; - buildFrom(tv,R) ; + buildFrom(t, R) ; } /*! Initialize a force/torque twist transformation matrix from a translation vector - \e t and a rotation vector with \f$\theta u \f$ parametrization. + \f${\bf t}=(t_x, t_y, t_z)^T\f$ and a rotation vector with \f$\theta {\bf u}=(\theta u_x, \theta u_y, \theta u_z)^T \f$ parametrization. \param tx,ty,tz : Translation vector in meters. - \param tux,tuy,tuz : \f$\theta u\f$ rotation vector expressed in radians. + \param tux,tuy,tuz : \f$\theta {\bf u}\f$ rotation vector expressed in radians. */ -vpForceTwistMatrix::vpForceTwistMatrix(const double tx, - const double ty, - const double tz, - const double tux, - const double tuy, - const double tuz) : vpMatrix() +vpForceTwistMatrix::vpForceTwistMatrix(const double tx, const double ty, const double tz, + const double tux, const double tuy, const double tuz) + : vpArray2D<double>(6,6) { - init() ; vpTranslationVector T(tx,ty,tz) ; vpThetaUVector tu(tux,tuy,tuz) ; buildFrom(T,tu) ; } /*! - Set the twist transformation matrix to identity. - + \sa eye() */ void vpForceTwistMatrix::setIdentity() { - init() ; + eye() ; } @@ -231,7 +208,7 @@ vpForceTwistMatrix::setIdentity() other skew transformation matrix. \code -#include <visp/vpForceTwistMatrix.h> +#include <visp3/core/vpForceTwistMatrix.h> int main() { @@ -252,7 +229,7 @@ vpForceTwistMatrix::operator*(const vpForceTwistMatrix &F) const for (unsigned int j=0;j<6;j++) { double s =0 ; for (unsigned int k=0;k<6;k++) - s +=rowPtrs[i][k] * F.rowPtrs[k][j]; + s +=rowPtrs[i][k] * F.rowPtrs[k][j]; Fout[i][j] = s ; } } @@ -262,17 +239,18 @@ vpForceTwistMatrix::operator*(const vpForceTwistMatrix &F) const /*! Operator that allows to multiply a skew transformation matrix by a matrix. - \exception vpMatrixException::incorrectMatrixSizeError If M is not a 6 rows + \exception vpException::dimensionError If M is not a 6 rows dimension matrix. */ vpMatrix vpForceTwistMatrix::operator*(const vpMatrix &M) const { - if (6 != M.getRows()) - { - vpERROR_TRACE("vpForceTwistMatrix mismatch in vpForceTwistMatrix/vpMatrix multiply") ; - throw(vpMatrixException::incorrectMatrixSizeError) ; + if (6 != M.getRows()) { + throw(vpException(vpException::dimensionError, + "Cannot multiply (6x6) force/torque twist matrix by a (%dx%d) matrix", + M.getRows(), M.getCols())); + } vpMatrix p(6, M.getCols()) ; @@ -280,7 +258,7 @@ vpForceTwistMatrix::operator*(const vpMatrix &M) const for (unsigned int j=0;j<M.getCols();j++) { double s =0 ; for (unsigned int k=0;k<6;k++) - s += rowPtrs[i][k] * M[k][j]; + s += rowPtrs[i][k] * M[k][j]; p[i][j] = s ; } } @@ -302,14 +280,13 @@ vpForceTwistMatrix::operator*(const vpMatrix &M) const The example below shows how to handle that transformation. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> -#include <visp/vpForceTwistMatrix.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpForceTwistMatrix.h> int main() { - // Get the force/torque measures from the sensor vpColVector sH(6); // Force/torque measures given by the sensor @@ -333,7 +310,7 @@ int main() } \endcode - \exception vpMatrixException::incorrectMatrixSizeError If \f$ \bf H \f$is not a 6 + \exception vpException::dimensionError If \f$ \bf H \f$is not a 6 dimension vector. */ @@ -342,10 +319,10 @@ vpForceTwistMatrix::operator*(const vpColVector &H) const { vpColVector Hout(6); - if (6 != H.getRows()) - { - vpERROR_TRACE("vpForceTwistMatrix mismatch in vpForceTwistMatrix/vector multiply") ; - throw(vpMatrixException::incorrectMatrixSizeError) ; + if (6 != H.getRows()) { + throw (vpException(vpException::dimensionError, + "Cannot multiply a (6x6) force/torque twist matrix by a %d dimension column vector", + H.getRows())); } Hout = 0.0; @@ -363,19 +340,19 @@ vpForceTwistMatrix::operator*(const vpColVector &H) const /*! Build a force/torque twist transformation matrix from a translation vector - \e t and a rotation matrix M. + \e t and a rotation matrix R. - \param tv : Translation vector. + \param t : Translation vector. \param R : Rotation matrix. */ vpForceTwistMatrix -vpForceTwistMatrix::buildFrom(const vpTranslationVector &tv, +vpForceTwistMatrix::buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R) { unsigned int i, j; - vpMatrix skewaR = tv.skew(tv)*R ; + vpMatrix skewaR = t.skew(t)*R ; for (i=0 ; i < 3 ; i++) { for (j=0 ; j < 3 ; j++) { @@ -394,7 +371,7 @@ vpForceTwistMatrix::buildFrom(const vpTranslationVector &tv, \param tv : Translation vector. - \param thetau : \f$\theta u\f$ rotation vector. + \param thetau : \f$\theta {\bf u}\f$ rotation vector. */ vpForceTwistMatrix @@ -430,8 +407,107 @@ vpForceTwistMatrix::buildFrom(const vpHomogeneousMatrix &M) return (*this) ; } -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +/*! + + Pretty print a velocity twist matrix. The data are tabulated. + The common widths before and after the decimal point + are set with respect to the parameter maxlen. + + \param s Stream used for the printing. + + \param length The suggested width of each matrix element. + The actual width grows in order to accomodate the whole integral part, + and shrinks if the whole extent is not needed for all the numbers. + \param intro The introduction which is printed before the matrix. + Can be set to zero (or omitted), in which case + the introduction is not printed. + + \return Returns the common total width for all matrix elements + + \sa std::ostream &operator <<(ostream &s,const vpMatrix &m) +*/ +int +vpForceTwistMatrix::print(std::ostream& s, unsigned int length, char const* intro) const +{ + typedef std::string::size_type size_type; + + unsigned int m = getRows(); + unsigned int n = getCols(); + + std::vector<std::string> values(m*n); + std::ostringstream oss; + std::ostringstream ossFixed; + std::ios_base::fmtflags original_flags = oss.flags(); + + // ossFixed <<std::fixed; + ossFixed.setf ( std::ios::fixed, std::ios::floatfield ); + + size_type maxBefore=0; // the length of the integral part + size_type maxAfter=0; // number of decimals plus + // one place for the decimal point + for (unsigned int i=0;i<m;++i) { + for (unsigned int j=0;j<n;++j){ + oss.str(""); + oss << (*this)[i][j]; + if (oss.str().find("e")!=std::string::npos){ + ossFixed.str(""); + ossFixed << (*this)[i][j]; + oss.str(ossFixed.str()); + } + + values[i*n+j]=oss.str(); + size_type thislen=values[i*n+j].size(); + size_type p=values[i*n+j].find('.'); + + if (p==std::string::npos){ + maxBefore=vpMath::maximum(maxBefore, thislen); + // maxAfter remains the same + } else{ + maxBefore=vpMath::maximum(maxBefore, p); + maxAfter=vpMath::maximum(maxAfter, thislen-p-1); + } + } + } + + size_type totalLength=length; + // increase totalLength according to maxBefore + totalLength=vpMath::maximum(totalLength,maxBefore); + // decrease maxAfter according to totalLength + maxAfter=std::min(maxAfter, totalLength-maxBefore); + if (maxAfter==1) maxAfter=0; + + // the following line is useful for debugging + //std::cerr <<totalLength <<" " <<maxBefore <<" " <<maxAfter <<"\n"; + + if (intro) s <<intro; + s <<"["<<m<<","<<n<<"]=\n"; + + for (unsigned int i=0;i<m;i++) { + s <<" "; + for (unsigned int j=0;j<n;j++){ + size_type p=values[i*n+j].find('.'); + s.setf(std::ios::right, std::ios::adjustfield); + s.width((std::streamsize)maxBefore); + s <<values[i*n+j].substr(0,p).c_str(); + + if (maxAfter>0){ + s.setf(std::ios::left, std::ios::adjustfield); + if (p!=std::string::npos){ + s.width((std::streamsize)maxAfter); + s <<values[i*n+j].substr(p,maxAfter).c_str(); + } else{ + assert(maxAfter>1); + s.width((std::streamsize)maxAfter); + s <<".0"; + } + } + + s <<' '; + } + s <<std::endl; + } + + s.flags(original_flags); // restore s to standard state + + return (int)(maxBefore+maxAfter); +} diff --git a/src/math/transformation/vpHomogeneousMatrix.cpp b/modules/core/src/math/transformation/vpHomogeneousMatrix.cpp similarity index 54% rename from src/math/transformation/vpHomogeneousMatrix.cpp rename to modules/core/src/math/transformation/vpHomogeneousMatrix.cpp index 10783a9ed7cc65d1a6841c619e90dbbcc18843a7..c0d3eeef5142be6a1df99ad68ddc939634c8f674 100644 --- a/src/math/transformation/vpHomogeneousMatrix.cpp +++ b/modules/core/src/math/transformation/vpHomogeneousMatrix.cpp @@ -1,754 +1,862 @@ -/**************************************************************************** - * - * $Id: vpHomogeneousMatrix.cpp 5130 2015-01-06 18:50:43Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Homogeneous matrix. - * - * Authors: - * Eric Marchand - * - *****************************************************************************/ - - -/*! - \file vpHomogeneousMatrix.cpp - \brief Defines vpHomogeneousMatrix class. Class that consider - the particular case of an homogeneous matrix. -*/ - -#include <visp/vpDebug.h> -#include <visp/vpMatrix.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpQuaternionVector.h> - -// Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> - -// Debug trace -#include <visp/vpDebug.h> - - -/*! - Initialize a 4x4 momogeneous matrix as identity. -*/ -void -vpHomogeneousMatrix::init() -{ - unsigned int i,j ; - - try { - resize(4,4) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - - - for (i=0 ; i < 4 ; i++) - for (j=0 ; j < 4; j++) - if (i==j) - (*this)[i][j] = 1.0 ; - else - (*this)[i][j] = 0.0; - -} - -vpHomogeneousMatrix::vpHomogeneousMatrix(const vpTranslationVector &tv, - const vpQuaternionVector &q) : vpMatrix() -{ - init(); - buildFrom(tv,q); -} - -/*! - Initialize an homogeneous matrix as identity. -*/ -vpHomogeneousMatrix::vpHomogeneousMatrix() : vpMatrix() -{ - init() ; -} - - -/*! - Initialize an homogeneous matrix from another homogeneous matrix. -*/ -vpHomogeneousMatrix::vpHomogeneousMatrix(const vpHomogeneousMatrix &M) : vpMatrix() -{ - init() ; - *this = M ; -} - -vpHomogeneousMatrix::vpHomogeneousMatrix(const vpTranslationVector &tv, - const vpThetaUVector &tu) : vpMatrix() -{ - init() ; - buildFrom(tv,tu) ; -} - -vpHomogeneousMatrix::vpHomogeneousMatrix(const vpTranslationVector &tv, - const vpRotationMatrix &R) : vpMatrix() -{ - init() ; - insert(R) ; - insert(tv) ; -} - -vpHomogeneousMatrix::vpHomogeneousMatrix(const vpPoseVector &p) : vpMatrix() -{ - - init() ; - buildFrom(p[0],p[1],p[2],p[3],p[4],p[5]) ; -} - -/*! - Creates an homogeneous matrix from a vector. - \param v : Vector of 12 or 16 values corresponding to the values of the homogeneous matrix. - - The following example shows how to use this function: - \code -#include <visp/vpHomogeneousMatrix.h> - -int main() -{ - std::vector<float> v(12, 0); - v[1] = -1.; // ry=-90 - v[4] = 1.; // rx=90 - v[10] = -1.; // rz=-90 - v[3] = 0.3; // tx - v[7] = 0.4; // ty - v[11] = 0.5; // tz - - std::cout << "v: "; - for(unsigned int i=0; i<v.size(); i++) - std::cout << v[i] << " "; - std::cout << std::endl; - - vpHomogeneousMatrix M(v); - std::cout << "M:\n" << M << std::endl; -} - \endcode - - It produces the following printings: - \code -v: 0 -1 0 0.3 1 0 0 0.4 0 0 -1 0.5 -M: -0 -1 0 0.3000000119 -1 0 0 0.400000006 -0 0 -1 0.5 -0 0 0 1 - \endcode - */ -vpHomogeneousMatrix::vpHomogeneousMatrix(const std::vector<float> &v) : vpMatrix() -{ - init() ; - buildFrom(v) ; -} - -/*! - Creates an homogeneous matrix from a vector. - \param v : Vector of 12 or 16 values corresponding to the values of the homogeneous matrix. - - The following example shows how to use this function: - \code -#include <visp/vpHomogeneousMatrix.h> - -int main() -{ - std::vector<double> v(12, 0); - v[1] = -1.; // ry=-90 - v[4] = 1.; // rx=90 - v[10] = -1.; // rz=-90 - v[3] = 0.3; // tx - v[7] = 0.4; // ty - v[11] = 0.5; // tz - - std::cout << "v: "; - for(unsigned int i=0; i<v.size(); i++) - std::cout << v[i] << " "; - std::cout << std::endl; - - vpHomogeneousMatrix M(v); - std::cout << "M:\n" << M << std::endl; -} - \endcode - - It produces the following printings: - \code -v: 0 -1 0 0.3 1 0 0 0.4 0 0 -1 0.5 -M: -0 -1 0 0.3 -1 0 0 0.4 -0 0 -1 0.5 -0 0 0 1 - \endcode - */ -vpHomogeneousMatrix::vpHomogeneousMatrix(const std::vector<double> &v) : vpMatrix() -{ - init() ; - buildFrom(v) ; -} - -vpHomogeneousMatrix::vpHomogeneousMatrix(const double tx, - const double ty, - const double tz, - const double tux, - const double tuy, - const double tuz) : vpMatrix() -{ - init() ; - buildFrom(tx, ty, tz,tux, tuy, tuz) ; -} - -void -vpHomogeneousMatrix::buildFrom(const vpTranslationVector &tv, - const vpThetaUVector &tu) -{ - insert(tu) ; - insert(tv) ; -} - -void -vpHomogeneousMatrix::buildFrom(const vpTranslationVector &tv, - const vpRotationMatrix &R) -{ - init() ; - insert(R) ; - insert(tv) ; -} - - -void -vpHomogeneousMatrix::buildFrom(const vpPoseVector &p) -{ - - vpTranslationVector tv(p[0],p[1],p[2]) ; - vpThetaUVector tu(p[3],p[4],p[5]) ; - - insert(tu) ; - insert(tv) ; -} - -void vpHomogeneousMatrix::buildFrom(const vpTranslationVector &tv, - const vpQuaternionVector &q) -{ - insert(tv); - insert(q); -} - -void -vpHomogeneousMatrix::buildFrom(const double tx, - const double ty, - const double tz, - const double tux, - const double tuy, - const double tuz) -{ - vpRotationMatrix R(tux, tuy, tuz) ; - vpTranslationVector tv(tx, ty, tz) ; - - insert(R) ; - insert(tv) ; -} - -/*! - Converts a vector to an homogeneous matrix. - \param v : Vector of 12 or 16 values corresponding to the values of the homogeneous matrix. - - The following example shows how to use this function: - \code -#include <visp/vpHomogeneousMatrix.h> - -int main() -{ - std::vector<float> v(12, 0); - v[1] = -1.; // ry=-90 - v[4] = 1.; // rx=90 - v[10] = -1.; // rz=-90 - v[3] = 0.3; // tx - v[7] = 0.4; // ty - v[11] = 0.5; // tz - - std::cout << "v: "; - for(unsigned int i=0; i<v.size(); i++) - std::cout << v[i] << " "; - std::cout << std::endl; - - vpHomogeneousMatrix M; - M.buildFrom(v); - std::cout << "M:\n" << M << std::endl; -} - \endcode - - It produces the following printings: - \code -v: 0 -1 0 0.3 1 0 0 0.4 0 0 -1 0.5 -M: -0 -1 0 0.3000000119 -1 0 0 0.400000006 -0 0 -1 0.5 -0 0 0 1 - \endcode - */ -void -vpHomogeneousMatrix::buildFrom(const std::vector<float> &v) -{ - if (v.size() != 12 && v.size() != 16) { - throw(vpException(vpException::dimensionError, "Cannot convert std::vector<float> to vpHomogeneousMatrix")); - } - - for (unsigned int i=0; i < 12; i++) - this->data[i] = (double)v[i]; -} - -/*! - Converts a vector to an homogeneous matrix. - \param v : Vector of 12 or 16 values corresponding to the values of the homogeneous matrix. - - The following example shows how to use this function: - \code -#include <visp/vpHomogeneousMatrix.h> - -int main() -{ - std::vector<double> v(12, 0); - v[1] = -1.; // ry=-90 - v[4] = 1.; // rx=90 - v[10] = -1.; // rz=-90 - v[3] = 0.3; // tx - v[7] = 0.4; // ty - v[11] = 0.5; // tz - - std::cout << "v: "; - for(unsigned int i=0; i<v.size(); i++) - std::cout << v[i] << " "; - std::cout << std::endl; - - vpHomogeneousMatrix M; - M.buildFrom(v); - std::cout << "M:\n" << M << std::endl; -} - \endcode - - It produces the following printings: - \code -v: 0 -1 0 0.3 1 0 0 0.4 0 0 -1 0.5 -M: -0 -1 0 0.3 -1 0 0 0.4 -0 0 -1 0.5 -0 0 0 1 - \endcode - */ -void -vpHomogeneousMatrix::buildFrom(const std::vector<double> &v) -{ - if (v.size() != 12 && v.size() != 16) { - throw(vpException(vpException::dimensionError, "Cannot convert std::vector<double> to vpHomogeneousMatrix")); - } - - for (unsigned int i=0; i < 12; i++) - this->data[i] = v[i]; -} - -/*! - Affectation of two homogeneous matrices. - - \param M : *this = M -*/ -vpHomogeneousMatrix & -vpHomogeneousMatrix::operator=(const vpHomogeneousMatrix &M) -{ - - if (rowPtrs != M.rowPtrs) init() ; - - for (int i=0; i<4; i++) - { - for (int j=0; j<4; j++) - { - rowPtrs[i][j] = M.rowPtrs[i][j]; - } - } - return *this; -} - -/*! - Allow homogeneous matrix multiplication. - - \code -#include <visp/vpHomogeneousMatrix.h> - -int main() -{ - vpHomogeneousMatrix aMb, bMc; - // Initialize aMb and bMc... - - // Compute aMc * bMc - vpHomogeneousMatrix aMc = aMb * bMc; -} - \endcode - -*/ -vpHomogeneousMatrix -vpHomogeneousMatrix::operator*(const vpHomogeneousMatrix &M) const -{ - vpHomogeneousMatrix p,p1 ; - - vpRotationMatrix R1, R2, R ; - vpTranslationVector T1, T2 , T; - - - extract(T1) ; - M.extract(T2) ; - - extract (R1) ; - M.extract (R2) ; - - R = R1*R2 ; - - T = R1*T2 + T1 ; - - p.insert(T) ; - p.insert(R) ; - - return p; -} - -vpColVector -vpHomogeneousMatrix::operator*(const vpColVector &v) const -{ - vpColVector p(rowNum); - - p = 0.0; - - for (unsigned int j=0;j<4;j++) { - for (unsigned int i=0;i<4;i++) { - p[i]+=rowPtrs[i][j] * v[j]; - } - } - - return p; -} - - -/*********************************************************************/ - -/*! - Test if the 3x3 rotational part of the homogeneous matrix is really - a rotation matrix. -*/ -bool -vpHomogeneousMatrix::isAnHomogeneousMatrix() const -{ - vpRotationMatrix R ; - extract(R) ; - - return R.isARotationMatrix() ; -} - -/*! - Extract the rotational matrix from the homogeneous matrix. - \param R : rotational component as a rotation matrix. -*/ -void -vpHomogeneousMatrix::extract(vpRotationMatrix &R) const -{ - unsigned int i,j ; - - for (i=0 ; i < 3 ; i++) - for (j=0 ; j < 3; j++) - R[i][j] = (*this)[i][j] ; -} - -/*! - Extract the translation vector from the homogeneous matrix. -*/ -void -vpHomogeneousMatrix::extract(vpTranslationVector &tv) const -{ - tv[0] = (*this)[0][3] ; - tv[1] = (*this)[1][3] ; - tv[2] = (*this)[2][3] ; -} -/*! - Extract the rotation as a Theta U vector. -*/ -void -vpHomogeneousMatrix::extract(vpThetaUVector &tu) const -{ - - vpRotationMatrix R; - (*this).extract(R); - tu.buildFrom(R); -} - -/*! - Extract the rotation as a quaternion. -*/ -void -vpHomogeneousMatrix::extract(vpQuaternionVector &q) const -{ - vpRotationMatrix R; - (*this).extract(R); - q.buildFrom(R); -} - -/*! - Insert the rotational component of the homogeneous matrix. -*/ -void -vpHomogeneousMatrix::insert(const vpRotationMatrix &R) -{ - unsigned int i,j ; - - for (i=0 ; i < 3 ; i++) - for (j=0 ; j < 3; j++) - (*this)[i][j] = R[i][j] ; -} - -/*! - - Insert the rotational component of the homogeneous matrix from a - theta u rotation vector. - -*/ -void -vpHomogeneousMatrix::insert(const vpThetaUVector &tu) -{ - vpRotationMatrix R(tu) ; - insert(R) ; -} - -/*! - Insert the translational component in a homogeneous matrix. -*/ -void -vpHomogeneousMatrix::insert(const vpTranslationVector &T) -{ - (*this)[0][3] = T[0] ; - (*this)[1][3] = T[1] ; - (*this)[2][3] = T[2] ; -} - -/*! - - Insert the rotational component of the homogeneous matrix from a - quaternion rotation vector. - -*/ -void -vpHomogeneousMatrix::insert(const vpQuaternionVector &q){ - insert(vpRotationMatrix(q)); -} - -/*! - Invert the homogeneous matrix - - \return \f$\left[\begin{array}{cc} - {\bf R} & {\bf t} \\ - {\bf 0}_{1\times 3} & 1 - \end{array} - \right]^{-1} = \left[\begin{array}{cc} - {\bf R}^T & -{\bf R}^T {\bf t} \\ - {\bf 0}_{1\times 3} & 1 - \end{array} - \right]\f$ - -*/ -vpHomogeneousMatrix -vpHomogeneousMatrix::inverse() const -{ - vpHomogeneousMatrix Mi ; - - - vpRotationMatrix R ; extract(R) ; - vpTranslationVector T ; extract(T) ; - - vpTranslationVector RtT ; RtT = -(R.t()*T) ; - - - Mi.insert(R.t()) ; - Mi.insert(RtT) ; - - return Mi ; -} - -/*! - Set transformation to identity. -*/ -void vpHomogeneousMatrix::eye() -{ - (*this)[0][0] = 1 ; - (*this)[1][1] = 1 ; - (*this)[2][2] = 1 ; - - (*this)[0][1] = (*this)[0][2] = 0 ; - (*this)[1][0] = (*this)[1][2] = 0 ; - (*this)[2][0] = (*this)[2][1] = 0 ; - - (*this)[0][3] = 0 ; - (*this)[1][3] = 0 ; - (*this)[2][3] = 0 ; -} - -/*! - Invert the homogeneous matrix. - - \param M : The inverted homogenous matrix: \f$\left[\begin{array}{cc} - {\bf R} & {\bf t} \\ - {\bf 0}_{1\times 3} & 1 - \end{array} - \right]^{-1} = \left[\begin{array}{cc} - {\bf R}^T & -{\bf R}^T {\bf t} \\ - {\bf 0}_{1\times 3} & 1 - \end{array} - \right]\f$ - -*/ -void -vpHomogeneousMatrix::inverse(vpHomogeneousMatrix &M) const -{ - M = inverse() ; -} - - -/*! - Write an homogeneous matrix in an output file stream. - - \param f : Output file stream. The homogeneous matrix is saved as a - 4 by 4 matrix. - - The code below shows how to save an homogenous matrix in a file. - - \code - // Contruct an homogeneous matrix - vpTranslationVector t(1,2,3); - vpRxyzVector r(M_PI, 0, -M_PI/4.); - vpRotationMatrix R(r); - vpHomogeneousMatrix M(t, R); - - // Save the content of the matrix in "homogeneous.dat" - std::ofstream f("homogeneous.dat"); - M.save(f); - \endcode - - \sa load() -*/ -void -vpHomogeneousMatrix::save(std::ofstream &f) const -{ - if (! f.fail()) - { - f << *this ; - } - else - { - vpERROR_TRACE("\t\t file not open " ); - throw(vpException(vpException::ioError, "\t\t file not open")) ; - } -} - - -/*! - - Read an homogeneous matrix from an input file stream. The - homogeneous matrix is considered as a 4 by 4 matrix. - - \param f : Input file stream. - - The code below shows how to get an homogenous matrix from a file. - - \code - vpHomogeneousMatrix M; - - std::ifstream f("homogeneous.dat"); - M.load(f); - \endcode - - \sa save() -*/ -void -vpHomogeneousMatrix::load(std::ifstream &f) -{ - if (! f.fail()) - { - for (unsigned int i=0 ; i < 4 ; i++) - for (unsigned int j=0 ; j < 4 ; j++) - { - f >> (*this)[i][j] ; - } - } - else - { - vpERROR_TRACE("\t\t file not open " ); - throw(vpException(vpException::ioError, "\t\t file not open")) ; - } -} - -//! Print the matrix as a vector [T thetaU] -void -vpHomogeneousMatrix::print() -{ - vpPoseVector r(*this) ; - std::cout << r.t() ; -} -//! Basic initialisation (identity) -void -vpHomogeneousMatrix::setIdentity() -{ - init() ; -} - -/*! - Converts an homogenous matrix to a vector of 12 floats. - \param M : Converted matrix. - */ -void vpHomogeneousMatrix::convert(std::vector<float> &M) -{ - M.resize(12); - for(unsigned int i=0; i < 12; i++) - M[i] = (float)(this->data[i]); -} - -/*! - Converts an homogenous matrix to a vector of 12 doubles. - \param M : Converted matrix. - */ -void vpHomogeneousMatrix::convert(std::vector<double> &M) -{ - M.resize(12); - for(unsigned int i=0; i < 12; i++) - M[i] = this->data[i]; -} +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Homogeneous matrix. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + + +/*! + \file vpHomogeneousMatrix.cpp + \brief Defines vpHomogeneousMatrix class. Class that consider + the particular case of an homogeneous matrix. +*/ + +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpQuaternionVector.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpException.h> + +/*! + Construct an homogeneous matrix from a translation vector and quaternion rotation vector. + */ +vpHomogeneousMatrix::vpHomogeneousMatrix(const vpTranslationVector &t, + const vpQuaternionVector &q) + : vpArray2D<double>(4, 4) +{ + buildFrom(t,q); + (*this)[3][3] = 1.; +} + +/*! + Default constructor that initialize an homogeneous matrix as identity. +*/ +vpHomogeneousMatrix::vpHomogeneousMatrix() + : vpArray2D<double>(4, 4) +{ + eye() ; +} + +/*! + Copy constructor that initialize an homogeneous matrix from another homogeneous matrix. +*/ +vpHomogeneousMatrix::vpHomogeneousMatrix(const vpHomogeneousMatrix &M) + : vpArray2D<double>(4, 4) +{ + *this = M; +} + +/*! + Construct an homogeneous matrix from a translation vector and \f$\theta {\bf u}\f$ rotation vector. + */ +vpHomogeneousMatrix::vpHomogeneousMatrix(const vpTranslationVector &t, + const vpThetaUVector &tu) + : vpArray2D<double>(4, 4) +{ + buildFrom(t, tu); + (*this)[3][3] = 1.; +} + +/*! + Construct an homogeneous matrix from a translation vector and a rotation matrix. + */ +vpHomogeneousMatrix::vpHomogeneousMatrix(const vpTranslationVector &t, + const vpRotationMatrix &R) + : vpArray2D<double>(4, 4) +{ + insert(R); + insert(t); + (*this)[3][3] = 1.; +} + +/*! + Construct an homogeneous matrix from a pose vector. + */ +vpHomogeneousMatrix::vpHomogeneousMatrix(const vpPoseVector &p) + : vpArray2D<double>(4, 4) +{ + buildFrom(p[0], p[1], p[2], p[3], p[4], p[5]) ; + (*this)[3][3] = 1.; +} + +/*! + Construct an homogeneous matrix from a vector of float. + \param v : Vector of 12 or 16 values corresponding to the values of the homogeneous matrix. + + The following example shows how to use this function: + \code +#include <visp3/core/vpHomogeneousMatrix.h> + +int main() +{ + std::vector<float> v(12, 0); + v[1] = -1.; // ry=-90 + v[4] = 1.; // rx=90 + v[10] = -1.; // rz=-90 + v[3] = 0.3; // tx + v[7] = 0.4; // ty + v[11] = 0.5; // tz + + std::cout << "v: "; + for(unsigned int i=0; i<v.size(); i++) + std::cout << v[i] << " "; + std::cout << std::endl; + + vpHomogeneousMatrix M(v); + std::cout << "M:\n" << M << std::endl; +} + \endcode + + It produces the following printings: + \code +v: 0 -1 0 0.3 1 0 0 0.4 0 0 -1 0.5 +M: +0 -1 0 0.3000000119 +1 0 0 0.400000006 +0 0 -1 0.5 +0 0 0 1 + \endcode + */ +vpHomogeneousMatrix::vpHomogeneousMatrix(const std::vector<float> &v) + : vpArray2D<double>(4, 4) +{ + buildFrom(v) ; + (*this)[3][3] = 1.; +} + +/*! + Construct an homogeneous matrix from a vector of double. + \param v : Vector of 12 or 16 values corresponding to the values of the homogeneous matrix. + + The following example shows how to use this function: + \code +#include <visp3/core/vpHomogeneousMatrix.h> + +int main() +{ + std::vector<double> v(12, 0); + v[1] = -1.; // ry=-90 + v[4] = 1.; // rx=90 + v[10] = -1.; // rz=-90 + v[3] = 0.3; // tx + v[7] = 0.4; // ty + v[11] = 0.5; // tz + + std::cout << "v: "; + for(unsigned int i=0; i<v.size(); i++) + std::cout << v[i] << " "; + std::cout << std::endl; + + vpHomogeneousMatrix M(v); + std::cout << "M:\n" << M << std::endl; +} + \endcode + + It produces the following printings: + \code +v: 0 -1 0 0.3 1 0 0 0.4 0 0 -1 0.5 +M: +0 -1 0 0.3 +1 0 0 0.4 +0 0 -1 0.5 +0 0 0 1 + \endcode + */ +vpHomogeneousMatrix::vpHomogeneousMatrix(const std::vector<double> &v) + : vpArray2D<double>(4, 4) +{ + buildFrom(v) ; + (*this)[3][3] = 1.; +} + +/*! + Construct an homogeneous matrix from a translation vector \f${\bf t}=(t_x, t_y, t_z)^T\f$ + and a \f$\theta {\bf u}=(\theta u_x, \theta u_y, \theta u_z)^T\f$ rotation vector. + */ +vpHomogeneousMatrix::vpHomogeneousMatrix(const double tx, + const double ty, + const double tz, + const double tux, + const double tuy, + const double tuz) + : vpArray2D<double>(4, 4) +{ + buildFrom(tx, ty, tz, tux, tuy, tuz); + (*this)[3][3] = 1.; +} + +/*! + Build an homogeneous matrix from a translation vector + and a \f$\theta {\bf u}\f$ rotation vector. + */ +void +vpHomogeneousMatrix::buildFrom(const vpTranslationVector &t, + const vpThetaUVector &tu) +{ + insert(tu) ; + insert(t) ; +} + +/*! + Build an homogeneous matrix from a translation vector + and a rotation matrix. + */ +void +vpHomogeneousMatrix::buildFrom(const vpTranslationVector &t, + const vpRotationMatrix &R) +{ + insert(R) ; + insert(t) ; +} + +/*! + Build an homogeneous matrix from a pose vector. + */ +void +vpHomogeneousMatrix::buildFrom(const vpPoseVector &p) +{ + vpTranslationVector tv(p[0], p[1], p[2]); + vpThetaUVector tu(p[3], p[4], p[5]); + + insert(tu) ; + insert(tv) ; +} + +/*! + Build an homogeneous matrix from a translation vector + and a quaternion rotation vector. + */ +void vpHomogeneousMatrix::buildFrom(const vpTranslationVector &t, + const vpQuaternionVector &q) +{ + insert(t); + insert(q); +} + +/*! + Build an homogeneous matrix from a translation vector \f${\bf t}=(t_x, t_y, t_z)^T\f$ + and a \f$\theta {\bf u}=(\theta u_x, \theta u_y, \theta u_z)^T\f$ rotation vector. + */ +void +vpHomogeneousMatrix::buildFrom(const double tx, + const double ty, + const double tz, + const double tux, + const double tuy, + const double tuz) +{ + vpRotationMatrix R(tux, tuy, tuz) ; + vpTranslationVector t(tx, ty, tz) ; + + insert(R) ; + insert(t) ; +} + +/*! + Build an homogeneous matrix from a vector of float. + \param v : Vector of 12 or 16 values corresponding to the values of the homogeneous matrix. + + The following example shows how to use this function: + \code +#include <visp3/core/vpHomogeneousMatrix.h> + +int main() +{ + std::vector<float> v(12, 0); + v[1] = -1.; // ry=-90 + v[4] = 1.; // rx=90 + v[10] = -1.; // rz=-90 + v[3] = 0.3; // tx + v[7] = 0.4; // ty + v[11] = 0.5; // tz + + std::cout << "v: "; + for(unsigned int i=0; i<v.size(); i++) + std::cout << v[i] << " "; + std::cout << std::endl; + + vpHomogeneousMatrix M; + M.buildFrom(v); + std::cout << "M:\n" << M << std::endl; +} + \endcode + + It produces the following printings: + \code +v: 0 -1 0 0.3 1 0 0 0.4 0 0 -1 0.5 +M: +0 -1 0 0.3000000119 +1 0 0 0.400000006 +0 0 -1 0.5 +0 0 0 1 + \endcode + */ +void +vpHomogeneousMatrix::buildFrom(const std::vector<float> &v) +{ + if (v.size() != 12 && v.size() != 16) { + throw(vpException(vpException::dimensionError, "Cannot convert std::vector<float> to vpHomogeneousMatrix")); + } + + for (unsigned int i=0; i < 12; i++) + this->data[i] = (double)v[i]; +} + +/*! + Build an homogeneous matrix from a vector of double. + \param v : Vector of 12 or 16 values corresponding to the values of the homogeneous matrix. + + The following example shows how to use this function: + \code +#include <visp3/core/vpHomogeneousMatrix.h> + +int main() +{ + std::vector<double> v(12, 0); + v[1] = -1.; // ry=-90 + v[4] = 1.; // rx=90 + v[10] = -1.; // rz=-90 + v[3] = 0.3; // tx + v[7] = 0.4; // ty + v[11] = 0.5; // tz + + std::cout << "v: "; + for(unsigned int i=0; i<v.size(); i++) + std::cout << v[i] << " "; + std::cout << std::endl; + + vpHomogeneousMatrix M; + M.buildFrom(v); + std::cout << "M:\n" << M << std::endl; +} + \endcode + + It produces the following printings: + \code +v: 0 -1 0 0.3 1 0 0 0.4 0 0 -1 0.5 +M: +0 -1 0 0.3 +1 0 0 0.4 +0 0 -1 0.5 +0 0 0 1 + \endcode + */ +void +vpHomogeneousMatrix::buildFrom(const std::vector<double> &v) +{ + if (v.size() != 12 && v.size() != 16) { + throw(vpException(vpException::dimensionError, "Cannot convert std::vector<double> to vpHomogeneousMatrix")); + } + + for (unsigned int i=0; i < 12; i++) + this->data[i] = v[i]; +} + +/*! + Copy operator that allows to set an homogeneous matrix from an other one. + + \param M : Matrix to copy. +*/ +vpHomogeneousMatrix & +vpHomogeneousMatrix::operator=(const vpHomogeneousMatrix &M) +{ + for (int i=0; i<4; i++) { + for (int j=0; j<4; j++) { + rowPtrs[i][j] = M.rowPtrs[i][j]; + } + } + return *this; +} + +/*! + Operator that allow to multiply an homogeneous matrix by an other one. + + \code +#include <visp3/core/vpHomogeneousMatrix.h> + +int main() +{ + vpHomogeneousMatrix aMb, bMc; + // Initialize aMb and bMc... + + // Compute aMc * bMc + vpHomogeneousMatrix aMc = aMb * bMc; +} + \endcode + +*/ +vpHomogeneousMatrix +vpHomogeneousMatrix::operator*(const vpHomogeneousMatrix &M) const +{ + vpHomogeneousMatrix p,p1 ; + + vpRotationMatrix R1, R2, R ; + vpTranslationVector T1, T2 , T; + + extract(T1) ; + M.extract(T2) ; + + extract (R1) ; + M.extract (R2) ; + + R = R1*R2 ; + + T = R1*T2 + T1 ; + + p.insert(T) ; + p.insert(R) ; + + return p; +} + +/*! + Operator that allow to multiply an homogeneous matrix by a 4-dimension column vector. + + \exception vpException::dimensionError : If the vector \e v is not a 4-dimension vector. +*/ +vpColVector +vpHomogeneousMatrix::operator*(const vpColVector &v) const +{ + if (v.getRows() != 4) { + throw(vpException(vpException::dimensionError, + "Cannot multiply a (4x4) homogeneous matrix by a (%dx1) column vector", + v.getRows())); + } + vpColVector p(rowNum); + + p = 0.0; + + for (unsigned int j=0;j<4;j++) { + for (unsigned int i=0;i<4;i++) { + p[i]+=rowPtrs[i][j] * v[j]; + } + } + + return p; +} + +/*! + From the coordinates of the point in camera frame b and the transformation between + camera frame a and camera frame b computes the coordinates of the point in camera frame a. + + \param bP : 3D coordinates of the point in camera frame bP. + + \return A point with 3D coordinates in the camera frame a. The coordinates in the world or object + frame are set to the same coordinates than the one in the camera frame. +*/ +vpPoint vpHomogeneousMatrix::operator*(const vpPoint& bP) const +{ + vpPoint aP ; + + vpColVector v(4),v1(4) ; + + v[0] = bP.get_X() ; + v[1] = bP.get_Y() ; + v[2] = bP.get_Z() ; + v[3] = bP.get_W() ; + + v1[0] = (*this)[0][0]*v[0] + (*this)[0][1]*v[1]+ (*this)[0][2]*v[2]+ (*this)[0][3]*v[3] ; + v1[1] = (*this)[1][0]*v[0] + (*this)[1][1]*v[1]+ (*this)[1][2]*v[2]+ (*this)[1][3]*v[3] ; + v1[2] = (*this)[2][0]*v[0] + (*this)[2][1]*v[1]+ (*this)[2][2]*v[2]+ (*this)[2][3]*v[3] ; + v1[3] = (*this)[3][0]*v[0] + (*this)[3][1]*v[1]+ (*this)[3][2]*v[2]+ (*this)[3][3]*v[3] ; + + v1 /= v1[3] ; + + // v1 = M*v ; + aP.set_X(v1[0]) ; + aP.set_Y(v1[1]) ; + aP.set_Z(v1[2]) ; + aP.set_W(v1[3]) ; + + aP.set_oX(v1[0]) ; + aP.set_oY(v1[1]) ; + aP.set_oZ(v1[2]) ; + aP.set_oW(v1[3]) ; + + return aP ; +} + +/*********************************************************************/ + +/*! + Test if the 3x3 rotational part of the homogeneous matrix is really + a rotation matrix. +*/ +bool +vpHomogeneousMatrix::isAnHomogeneousMatrix() const +{ + vpRotationMatrix R ; + extract(R) ; + + return R.isARotationMatrix() ; +} + +/*! + Extract the rotational matrix from the homogeneous matrix. + \param R : rotational component as a rotation matrix. +*/ +void +vpHomogeneousMatrix::extract(vpRotationMatrix &R) const +{ + for (unsigned int i=0 ; i < 3 ; i++) + for (unsigned int j=0 ; j < 3; j++) + R[i][j] = (*this)[i][j] ; +} + +/*! + Extract the translation vector from the homogeneous matrix. +*/ +void +vpHomogeneousMatrix::extract(vpTranslationVector &t) const +{ + t[0] = (*this)[0][3] ; + t[1] = (*this)[1][3] ; + t[2] = (*this)[2][3] ; +} +/*! + Extract the rotation as a \f$\theta \bf u\f$ vector. +*/ +void +vpHomogeneousMatrix::extract(vpThetaUVector &tu) const +{ + vpRotationMatrix R; + (*this).extract(R); + tu.buildFrom(R); +} + +/*! + Extract the rotation as a quaternion. +*/ +void +vpHomogeneousMatrix::extract(vpQuaternionVector &q) const +{ + vpRotationMatrix R; + (*this).extract(R); + q.buildFrom(R); +} + +/*! + Insert the rotational component of the homogeneous matrix. +*/ +void +vpHomogeneousMatrix::insert(const vpRotationMatrix &R) +{ + for (unsigned int i=0 ; i < 3 ; i++) + for (unsigned int j=0 ; j < 3; j++) + (*this)[i][j] = R[i][j] ; +} + +/*! + + Insert the rotational component of the homogeneous matrix from a + \f$theta {\bf u}\f$ rotation vector. + +*/ +void +vpHomogeneousMatrix::insert(const vpThetaUVector &tu) +{ + vpRotationMatrix R(tu) ; + insert(R) ; +} + +/*! + Insert the translational component in a homogeneous matrix. +*/ +void +vpHomogeneousMatrix::insert(const vpTranslationVector &t) +{ + (*this)[0][3] = t[0] ; + (*this)[1][3] = t[1] ; + (*this)[2][3] = t[2] ; +} + +/*! + + Insert the rotational component of the homogeneous matrix from a + quaternion rotation vector. + +*/ +void +vpHomogeneousMatrix::insert(const vpQuaternionVector &q){ + insert(vpRotationMatrix(q)); +} + +/*! + Invert the homogeneous matrix + + \return \f$\left[\begin{array}{cc} + {\bf R} & {\bf t} \\ + {\bf 0}_{1\times 3} & 1 + \end{array} + \right]^{-1} = \left[\begin{array}{cc} + {\bf R}^T & -{\bf R}^T {\bf t} \\ + {\bf 0}_{1\times 3} & 1 + \end{array} + \right]\f$ + +*/ +vpHomogeneousMatrix +vpHomogeneousMatrix::inverse() const +{ + vpHomogeneousMatrix Mi ; + + vpRotationMatrix R ; extract(R) ; + vpTranslationVector T ; extract(T) ; + + vpTranslationVector RtT ; RtT = -(R.t()*T) ; + + + Mi.insert(R.t()) ; + Mi.insert(RtT) ; + + return Mi ; +} + +/*! + Set transformation to identity. +*/ +void vpHomogeneousMatrix::eye() +{ + (*this)[0][0] = 1 ; + (*this)[1][1] = 1 ; + (*this)[2][2] = 1 ; + (*this)[3][3] = 1 ; + + (*this)[0][1] = (*this)[0][2] = (*this)[0][3] = 0 ; + (*this)[1][0] = (*this)[1][2] = (*this)[1][3] = 0 ; + (*this)[2][0] = (*this)[2][1] = (*this)[2][3] = 0 ; + (*this)[3][0] = (*this)[3][1] = (*this)[3][2] = 0 ; +} + +/*! + Invert the homogeneous matrix. + + \param M : The inverted homogeneous matrix: \f$\left[\begin{array}{cc} + {\bf R} & {\bf t} \\ + {\bf 0}_{1\times 3} & 1 + \end{array} + \right]^{-1} = \left[\begin{array}{cc} + {\bf R}^T & -{\bf R}^T {\bf t} \\ + {\bf 0}_{1\times 3} & 1 + \end{array} + \right]\f$ + +*/ +void +vpHomogeneousMatrix::inverse(vpHomogeneousMatrix &M) const +{ + M = inverse() ; +} + + +/*! + Write an homogeneous matrix in an output file stream. + + \param f : Output file stream. The homogeneous matrix is saved as a + 4 by 4 matrix. + + The code below shows how to save an homogeneous matrix in a file. + + \code + // Contruct an homogeneous matrix + vpTranslationVector t(1,2,3); + vpRxyzVector r(M_PI, 0, -M_PI/4.); + vpRotationMatrix R(r); + vpHomogeneousMatrix M(t, R); + + // Save the content of the matrix in "homogeneous.dat" + std::ofstream f("homogeneous.dat"); + M.save(f); + \endcode + + \sa load() +*/ +void +vpHomogeneousMatrix::save(std::ofstream &f) const +{ + if (! f.fail()) { + f << *this ; + } + else { + throw(vpException(vpException::ioError, + "Cannot save homogeneous matrix: ostream not open")) ; + } +} + + +/*! + + Read an homogeneous matrix from an input file stream. The + homogeneous matrix is considered as a 4 by 4 matrix. + + \param f : Input file stream. + + The code below shows how to get an homogeneous matrix from a file. + + \code + vpHomogeneousMatrix M; + + std::ifstream f("homogeneous.dat"); + M.load(f); + \endcode + + \sa save() +*/ +void +vpHomogeneousMatrix::load(std::ifstream &f) +{ + if (! f.fail()) { + for (unsigned int i=0 ; i < 4 ; i++) { + for (unsigned int j=0 ; j < 4 ; j++) { + f >> (*this)[i][j] ; + } + } + } + else { + throw(vpException(vpException::ioError, + "Cannot laad homogeneous matrix: ifstream not open")) ; + } +} + +//! Print the matrix as a pose vector \f$({\bf t}^T \theta {\bf u}^T)\f$ +void +vpHomogeneousMatrix::print() const +{ + vpPoseVector r(*this) ; + std::cout << r.t() ; +} +/*! + Set homogeneous matrix to identity. + \sa eye() + */ +void +vpHomogeneousMatrix::setIdentity() +{ + eye() ; +} + +/*! + Converts an homogeneous matrix to a vector of 12 floats. + \param M : Converted matrix. + */ +void vpHomogeneousMatrix::convert(std::vector<float> &M) +{ + M.resize(12); + for(unsigned int i=0; i < 12; i++) + M[i] = (float)(this->data[i]); +} + +/*! + Converts an homogeneous matrix to a vector of 12 doubles. + \param M : Converted matrix. + */ +void vpHomogeneousMatrix::convert(std::vector<double> &M) +{ + M.resize(12); + for(unsigned int i=0; i < 12; i++) + M[i] = this->data[i]; +} + +/*! + Return the translation vector from the homogeneous transformation matrix. + */ +vpTranslationVector vpHomogeneousMatrix::getTranslationVector() +{ + vpTranslationVector tr; + this->extract(tr); + return tr; +} + +/*! + Return the rotation matrix from the homogeneous transformation matrix. + */ +vpRotationMatrix vpHomogeneousMatrix::getRotationMatrix() +{ + vpRotationMatrix R; + this->extract(R); + return R; +} + +/*! + Return the \f$\theta {\bf u}\f$ vector that corresponds to the rotation part of the + homogeneous transformation. + */ +vpThetaUVector vpHomogeneousMatrix::getThetaUVector() +{ + vpThetaUVector tu; + this->extract(tu); + return tu; +} + +/*! + Extract a column vector from an homogeneous matrix. + \warning All the indexes start from 0 in this function. + \param j : Index of the column to extract. If j=0, the first column is extracted. + \return The extracted column vector. + + The following example shows how to use this function: + \code +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> + +int main() +{ + vpHomogeneousMatrix M; + + vpColVector t = M.getCol(3); + std::cout << "Last column: \n" << t << std::endl; +} + \endcode +It produces the following output: + \code +Last column: +0 +0 +1 +0 + \endcode + */ +vpColVector +vpHomogeneousMatrix::getCol(const unsigned int j) const +{ + if (j >= getCols()) + throw(vpException(vpException::dimensionError, + "Unable to extract a column vector from the homogeneous matrix")); + unsigned int nb_rows = getRows(); + vpColVector c(nb_rows); + for (unsigned int i=0 ; i < nb_rows ; i++) + c[i] = (*this)[i][j]; + return c; +} diff --git a/modules/core/src/math/transformation/vpPoseVector.cpp b/modules/core/src/math/transformation/vpPoseVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9314c855d66e36ea59d8019813fc9045d4efd883 --- /dev/null +++ b/modules/core/src/math/transformation/vpPoseVector.cpp @@ -0,0 +1,536 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Pose object. A pose is a size 6 vector [t, tu]^T where tu is + * a rotation vector (theta u representation) and t is a translation vector. + * + * Authors: + * Eric Marchand + * Fabien Spindler + * + *****************************************************************************/ + + +/*! + \file vpPoseVector.cpp + \brief Pose vector. + +*/ + +#include <sstream> +#include <assert.h> + +#include <visp3/core/vpPoseVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpMatrixException.h> +#include <visp3/core/vpException.h> + + +/*! + + Default constructor that construct a 6 dimension pose vector \f$ [\bf t, \theta \bf + u]^\top\f$ where \f$ \theta \bf u\f$ is a rotation vector \f$[\theta + u_x, \theta u_y, \theta u_z]^\top\f$ and \f$ \bf t \f$ is a + translation vector \f$[t_x, t_y, t_z]^\top\f$. + + The pose vector is initialized to zero. + +*/ +vpPoseVector::vpPoseVector() + : vpArray2D<double>(6, 1) +{} + +/*! + + Construct a 6 dimension pose vector \f$ [\bf{t}, \theta + \bf{u}]^\top\f$ from 3 translations and 3 \f$ \theta \bf{u}\f$ + angles. + + Translations are expressed in meters, while rotations in radians. + + \param tx,ty,tz : Translations \f$[t_x, t_y, t_z]^\top\f$ + respectively along the x, y and z axis (in meters). + + \param tux,tuy,tuz : Rotations \f$[\theta u_x, \theta u_y, \theta + u_z]^\top\f$ respectively around the x, y and z axis (in radians). + +*/ +vpPoseVector::vpPoseVector(const double tx, + const double ty, + const double tz, + const double tux, + const double tuy, + const double tuz) + : vpArray2D<double>(6, 1) +{ + (*this)[0] = tx; + (*this)[1] = ty; + (*this)[2] = tz; + + (*this)[3] = tux; + (*this)[4] = tuy; + (*this)[5] = tuz; +} + +/*! + + Construct a 6 dimension pose vector \f$ [\bf t, \theta \bf + u]^\top\f$ from a translation vector \f$ \bf tv \f$ and a \f$\theta + \bf u\f$ vector. + + \param tv : Translation vector \f$ \bf t \f$. + \param tu : \f$\theta \bf u\f$ rotation vector. + +*/ +vpPoseVector::vpPoseVector(const vpTranslationVector& tv, + const vpThetaUVector& tu) + : vpArray2D<double>(6, 1) +{ + buildFrom(tv, tu) ; +} + +/*! + + Construct a 6 dimension pose vector \f$ [\bf t, \theta \bf + u]^\top\f$ from a translation vector \f$ \bf t \f$ and a rotation + matrix \f$ \bf R \f$. + + \param tv : Translation vector \f$ \bf t \f$. + + \param R : Rotation matrix \f$ \bf R \f$ from which \f$\theta \bf + u\f$ vector is extracted to initialise the pose vector. + +*/ +vpPoseVector::vpPoseVector(const vpTranslationVector& tv, + const vpRotationMatrix& R) + : vpArray2D<double>(6, 1) +{ + buildFrom(tv, R) ; +} + +/*! + + Construct a 6 dimension pose vector \f$ [\bf t, \theta \bf + u]^\top\f$ from an homogeneous matrix \f$ \bf M \f$. + + \param M : Homogeneous matrix \f$ \bf M \f$ from which translation + \f$ \bf t \f$ and \f$\theta \bf u \f$ vectors are extracted to + initialize the pose vector. + +*/ +vpPoseVector::vpPoseVector(const vpHomogeneousMatrix& M) + : vpArray2D<double>(6, 1) +{ + buildFrom(M) ; +} + +/*! + + Set the 6 dimension pose vector \f$ [\bf{t}, \theta + \bf{u}]^\top\f$ from 3 translations and 3 \f$ \theta \bf{u}\f$ + angles. + + Translations are expressed in meters, while rotations in radians. + + \param tx,ty,tz : Translations \f$[t_x, t_y, t_z]^\top\f$ + respectively along the x, y and z axis (in meters). + + \param tux,tuy,tuz : Rotations \f$[\theta u_x, \theta u_y, \theta + u_z]^\top\f$ respectively around the x, y and z axis (in radians). + +*/ +void +vpPoseVector::set(const double tx, const double ty, const double tz, + const double tux, const double tuy, const double tuz) +{ + (*this)[0] = tx; + (*this)[1] = ty; + (*this)[2] = tz; + + (*this)[3] = tux; + (*this)[4] = tuy; + (*this)[5] = tuz; +} + +/*! + Build a 6 dimension pose vector \f$ [\bf t, \theta \bf u]^\top\f$ + from 3 translations and 3 \f$ \theta \bf{u}\f$ angles. + + Translations are expressed in meters, while rotations in radians. + + \param tx,ty,tz : Translations \f$[t_x, t_y, t_z]^\top\f$ + respectively along the x, y and z axis (in meters). + + \param tux,tuy,tuz : Rotations \f$[\theta u_x, \theta u_y, \theta + u_z]^\top\f$ respectively around the x, y and z axis (in radians). + + \return The build pose vector. + + \sa set() +*/ +vpPoseVector +vpPoseVector::buildFrom(const double tx, const double ty, const double tz, + const double tux, const double tuy, const double tuz) +{ + (*this)[0] = tx; + (*this)[1] = ty; + (*this)[2] = tz; + + (*this)[3] = tux; + (*this)[4] = tuy; + (*this)[5] = tuz; + return *this ; +} + +/*! + Build a 6 dimension pose vector \f$ [\bf t, \theta \bf u]^\top\f$ from + an homogeneous matrix \f$ \bf M \f$. + + \param M : Homogeneous matrix \f$ \bf M \f$ from which translation \f$ + \bf t \f$ and \f$\theta \bf u \f$ vectors are extracted to initialize + the pose vector. + + \return The build pose vector. + +*/ +vpPoseVector +vpPoseVector::buildFrom(const vpHomogeneousMatrix& M) +{ + vpRotationMatrix R ; M.extract(R) ; + vpTranslationVector tv ; M.extract(tv) ; + buildFrom(tv,R) ; + return *this ; +} + +/*! + + Build a 6 dimension pose vector \f$ [\bf t, \theta \bf u]^\top\f$ + from a translation vector \f$ \bf t \f$ and a \f$\theta \bf u\f$ + vector. + + \param tv : Translation vector \f$ \bf t \f$. + \param tu : \f$\theta \bf u\f$ rotation vector. + + \return The build pose vector. +*/ +vpPoseVector +vpPoseVector::buildFrom(const vpTranslationVector& tv, + const vpThetaUVector& tu) +{ + for (unsigned int i =0 ; i < 3 ; i++) { + (*this)[i] = tv[i] ; + (*this)[i+3] = tu[i] ; + } + return *this ; +} + +/*! + + Build a 6 dimension pose vector \f$ [\bf t, \theta \bf u]^\top\f$ + from a translation vector \f$ \bf t \f$ and a rotation matrix \f$ + \bf R \f$. + + \param tv : Translation vector \f$ \bf t \f$. + + \param R : Rotation matrix \f$ \bf R \f$ from which \f$\theta \bf + u\f$ vector is extracted to initialise the pose vector. + + \return The build pose vector. +*/ +vpPoseVector +vpPoseVector::buildFrom(const vpTranslationVector& tv, + const vpRotationMatrix& R) +{ + vpThetaUVector tu ; + tu.buildFrom(R) ; + + buildFrom(tv, tu) ; + return *this ; +} + +/*! + Extract the translation vector from the homogeneous matrix. +*/ +void +vpPoseVector::extract(vpTranslationVector &tv) const +{ + tv[0] = (*this)[0]; + tv[1] = (*this)[1]; + tv[2] = (*this)[2]; +} + +/*! + Extract the rotation as a \f$\theta \bf u\f$ vector. +*/ +void +vpPoseVector::extract(vpThetaUVector &tu) const +{ + tu[0] = (*this)[3]; + tu[1] = (*this)[4]; + tu[2] = (*this)[5]; +} +/*! + Extract the rotation as a quaternion vector. +*/ +void +vpPoseVector::extract(vpQuaternionVector &q) const +{ + vpRotationMatrix R((*this)[3], (*this)[4], (*this)[5]); + q.buildFrom(R); +} +/*! + Extract the rotation as a rotation matrix. +*/ +void +vpPoseVector::extract(vpRotationMatrix &R) const +{ + R.buildFrom((*this)[3], (*this)[4], (*this)[5]); +} +/*! + Return the translation vector that corresponds to the translation part of the + pose vector. + */ +vpTranslationVector vpPoseVector::getTranslationVector() const +{ + vpTranslationVector tr((*this)[0], (*this)[1], (*this)[2]); + return tr; +} + +/*! + Return the rotation matrix that corresponds to the rotation part of the + pose vector. + */ +vpRotationMatrix vpPoseVector::getRotationMatrix() const +{ + vpRotationMatrix R((*this)[0], (*this)[1], (*this)[2]); + return R; +} + +/*! + Return the \f$\theta {\bf u}\f$ vector that corresponds to the rotation part of the + pose vector. + */ +vpThetaUVector vpPoseVector::getThetaUVector() const +{ + vpThetaUVector tu((*this)[0], (*this)[1], (*this)[2]); + return tu; +} + +/*! + + Prints to the standart stream the pose vector. + + \warning Values concerning the \f$ \theta {\bf u}\f$ rotation are + converted in degrees. + + The following code + \code + // Create a pose vector + vpPoseVector r(1, 2, 3, M_PI, -M_PI, 0); + r.print(); + \endcode + produces the output: + + \code + 1 2 3 180 -180 0 + \endcode + + \sa std::ostream &operator<<(std::ostream &s, const vpArray2D<Type> &A) +*/ +void +vpPoseVector::print() const +{ + for (unsigned int i =0 ; i < 6 ; i++) + if (i<3) std::cout << (*this)[i] <<" " ; + else std::cout << vpMath::deg((*this)[i]) <<" " ; + std::cout <<std::endl ; +} + +/*! + + Save the pose vector in the output file stream. + + \param f : Output file stream. Should be open before entering in this method. + + \exception vpException::ioError : If the output stream is not open. + + \sa load() +*/ +void +vpPoseVector::save(std::ofstream &f) const +{ + if (! f.fail()) { + f << *this ; + } + else { + throw(vpException(vpException::ioError, + "Cannot save the pose vector: ofstream not openned")) ; + } +} + + +/*! + Read a pose vector from an input file stream. + + \param f : The input file stream..Should be open before entering in + this method. + + \exception vpException::ioError : If the input file stream is not open. + + \sa save() +*/ +void +vpPoseVector::load(std::ifstream &f) +{ + if (! f.fail()) { + for (unsigned int i=0 ; i < 6 ; i++) { + f >> (*this)[i] ; + } + } + else { + throw(vpException(vpException::ioError, + "Cannot read pose vector: ifstream not openned")) ; + } +} + +/* + Transpose the pose vector. The resulting vector becomes a row vector. + +*/ +vpRowVector vpPoseVector::t() const +{ + vpRowVector v(rowNum); + memcpy(v.data, data, rowNum*sizeof(double)) ; + return v; +} + +/*! + + Pretty print a pose vector. The data are tabulated. + The common widths before and after the decimal point + are set with respect to the parameter maxlen. + + \param s Stream used for the printing. + + \param length The suggested width of each vector element. + The actual width grows in order to accomodate the whole integral part, + and shrinks if the whole extent is not needed for all the numbers. + \param intro The introduction which is printed before the vector. + Can be set to zero (or omitted), in which case + the introduction is not printed. + + \return Returns the common total width for all vector elements. + + \sa std::ostream &operator<<(std::ostream &s, const vpArray2D<Type> &A) +*/ +int +vpPoseVector::print(std::ostream& s, unsigned int length, char const* intro) const +{ + typedef std::string::size_type size_type; + + unsigned int m = getRows(); + unsigned int n = 1; + + std::vector<std::string> values(m*n); + std::ostringstream oss; + std::ostringstream ossFixed; + std::ios_base::fmtflags original_flags = oss.flags(); + + // ossFixed <<std::fixed; + ossFixed.setf ( std::ios::fixed, std::ios::floatfield ); + + size_type maxBefore=0; // the length of the integral part + size_type maxAfter=0; // number of decimals plus + // one place for the decimal point + for (unsigned int i=0;i<m;++i) { + oss.str(""); + oss << (*this)[i]; + if (oss.str().find("e")!=std::string::npos){ + ossFixed.str(""); + ossFixed << (*this)[i]; + oss.str(ossFixed.str()); + } + + values[i]=oss.str(); + size_type thislen=values[i].size(); + size_type p=values[i].find('.'); + + if (p==std::string::npos){ + maxBefore=vpMath::maximum(maxBefore, thislen); + // maxAfter remains the same + } else{ + maxBefore=vpMath::maximum(maxBefore, p); + maxAfter=vpMath::maximum(maxAfter, thislen-p-1); + } + + } + + size_type totalLength=length; + // increase totalLength according to maxBefore + totalLength=vpMath::maximum(totalLength,maxBefore); + // decrease maxAfter according to totalLength + maxAfter=std::min(maxAfter, totalLength-maxBefore); + if (maxAfter==1) maxAfter=0; + + // the following line is useful for debugging + //std::cerr <<totalLength <<" " <<maxBefore <<" " <<maxAfter <<"\n"; + + if (intro) s <<intro; + s <<"["<<m<<","<<n<<"]=\n"; + + for (unsigned int i=0;i<m;i++) { + s <<" "; + size_type p=values[i].find('.'); + s.setf(std::ios::right, std::ios::adjustfield); + s.width((std::streamsize)maxBefore); + s <<values[i].substr(0,p).c_str(); + + if (maxAfter>0){ + s.setf(std::ios::left, std::ios::adjustfield); + if (p!=std::string::npos){ + s.width((std::streamsize)maxAfter); + s <<values[i].substr(p,maxAfter).c_str(); + } else{ + assert(maxAfter>1); + s.width((std::streamsize)maxAfter); + s <<".0"; + } + } + + s <<' '; + + s <<std::endl; + } + + s.flags(original_flags); // restore s to standard state + + return (int)(maxBefore+maxAfter); +} diff --git a/modules/core/src/math/transformation/vpQuaternionVector.cpp b/modules/core/src/math/transformation/vpQuaternionVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0f15a40ad6e1916a17958fd1707065ef7e7e1e65 --- /dev/null +++ b/modules/core/src/math/transformation/vpQuaternionVector.cpp @@ -0,0 +1,268 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Quaternion vector. + * + * Authors: + * Filip Novotny + * + *****************************************************************************/ + + +#include <visp3/core/vpQuaternionVector.h> +#include <visp3/core/vpMath.h> +#include <stdio.h> +#include <string.h> +#include <algorithm> + + +// minimum value of sine +const double vpQuaternionVector::minimum = 0.0001; + +/*! + \file vpQuaternionVector.cpp + \brief Defines a quaternion and common operations on it. +*/ + +/*! Default constructor that initialize all the 4 angles to zero. */ +vpQuaternionVector::vpQuaternionVector() + : vpRotationVector(4) +{} + +/*! Copy constructor. */ +vpQuaternionVector::vpQuaternionVector(const vpQuaternionVector &q) + : vpRotationVector(q) +{} + +//! Constructor from doubles. +vpQuaternionVector::vpQuaternionVector(const double x_, const double y_, + const double z_,const double w_) + : vpRotationVector(4) +{ + set(x_, y_, z_, w_); +} + +/*! + Constructs a quaternion from a rotation matrix. + + \param R : Matrix containing a rotation. +*/ +vpQuaternionVector::vpQuaternionVector(const vpRotationMatrix &R) + : vpRotationVector(4) +{ + buildFrom(R); +} + +/*! + Constructor that initialize \f$R_{xyz}=(\varphi,\theta,\psi)\f$ Euler + angles vector from a \f$\theta {\bf u}\f$ vector. + \param tu : \f$\theta {\bf u}\f$ representation of a rotation used here as + input to initialize the Euler angles. +*/ +vpQuaternionVector::vpQuaternionVector(const vpThetaUVector& tu) + : vpRotationVector (4) +{ + buildFrom(tu) ; +} + + +/*! + Manually change values of a quaternion. + \param qx : x quaternion parameter. + \param qy : y quaternion parameter. + \param qz : z quaternion parameter. + \param qw : w quaternion parameter. +*/ +void vpQuaternionVector::set(const double qx, const double qy, + const double qz, const double qw) +{ + data[0]=qx; + data[1]=qy; + data[2]=qz; + data[3]=qw; +} +/*! + Manually change values of a quaternion. + \param qx : x quaternion parameter. + \param qy : y quaternion parameter. + \param qz : z quaternion parameter. + \param qw : w quaternion parameter. + + \sa set() +*/ +vpQuaternionVector +vpQuaternionVector::buildFrom(const double qx, const double qy, + const double qz, const double qw) +{ + set(qx, qy, qz, qw); + return *this; +} + +/*! + Convert a \f$\theta {\bf u}\f$ vector into a quaternion. + \param tu : \f$\theta {\bf u}\f$ representation of a rotation used here as + input. + \return Quaternion vector. +*/ +vpQuaternionVector +vpQuaternionVector::buildFrom(const vpThetaUVector& tu) +{ + vpRotationMatrix R(tu) ; + buildFrom(R) ; + + return *this ; +} +/*! + Quaternion addition. + + Adds two quaternions. Addition is component-wise. + + \param q : quaternion to add. +*/ +vpQuaternionVector vpQuaternionVector::operator+(const vpQuaternionVector &q) const +{ + return vpQuaternionVector(x()+q.x(), y()+q.y(), z()+q.z(), w()+q.w()); +} +/*! + Quaternion substraction. + + Substracts a quaternion from another. Substraction is component-wise. + + \param q : quaternion to substract. +*/ +vpQuaternionVector vpQuaternionVector::operator-(const vpQuaternionVector &q) const +{ + return vpQuaternionVector(x()-q.x(), y()-q.y(), z()-q.z(), w()-q.w()); +} + +//! Negate operator. Returns a quaternion defined by (-x,-y,-z-,-w). +vpQuaternionVector vpQuaternionVector::operator-() const +{ + return vpQuaternionVector(-x(), -y(), -z(), -w()); +} + +//! Multiplication by scalar. Returns a quaternion defined by (lx,ly,lz,lw). +vpQuaternionVector vpQuaternionVector::operator*(const double l) const +{ + return vpQuaternionVector(l*x(),l*y(),l*z(),l*w()); +} + +//! Multiply two quaternions. +vpQuaternionVector vpQuaternionVector::operator* (const vpQuaternionVector &rq) const { + return vpQuaternionVector(w() * rq.x() + x() * rq.w() + y() * rq.z() - z() * rq.y(), + w() * rq.y() + y() * rq.w() + z() * rq.x() - x() * rq.z(), + w() * rq.z() + z() * rq.w() + x() * rq.y() - y() * rq.x(), + w() * rq.w() - x() * rq.x() - y() * rq.y() - z() * rq.z()); +} + +//! Division by scalar. Returns a quaternion defined by (x/l,y/l,z/l,w/l). +vpQuaternionVector vpQuaternionVector::operator/(const double l) const +{ + if(vpMath::nul(l, std::numeric_limits<double>::epsilon())) { + throw vpException(vpException::fatalError, "Division by scalar l==0 !"); + } + + return vpQuaternionVector(x()/l,y()/l,z()/l,w()/l); +} + +/*! + Constructs a quaternion from a rotation matrix. + + \param R : Rotation matrix. +*/ +vpQuaternionVector +vpQuaternionVector::buildFrom(const vpRotationMatrix &R) +{ + vpThetaUVector tu(R); + vpColVector u; + double theta; + tu.extract(theta, u); + + theta *= 0.5; + + double sinTheta_2 = sin(theta); + set( u[0] * sinTheta_2, u[1] * sinTheta_2, u[2] * sinTheta_2, cos(theta) ); + return *this; +} + +/*! + Quaternion conjugate. + + \return The conjugate quaternion. +*/ +vpQuaternionVector vpQuaternionVector::conjugate() const { + return vpQuaternionVector( -x(), -y(), -z(), w() ); +} + +/*! + Quaternion inverse. + + \return The inverse quaternion. +*/ +vpQuaternionVector vpQuaternionVector::inverse() const { + vpQuaternionVector q_inv; + + double mag_square = w()*w() + x()*x() + y()*y() + z()*z(); + if(!vpMath::nul(mag_square, std::numeric_limits<double>::epsilon())) { + q_inv = this->conjugate() / mag_square; + } else { + std::cerr << "The current quaternion is null ! The inverse cannot be computed !" << std::endl; + } + + return q_inv; +} + +/*! + Quaternion magnitude or norm. + + \return The magnitude or norm of the quaternion. +*/ +double vpQuaternionVector::magnitude() const { + return sqrt( w()*w() + x()*x() + y()*y() + z()*z() ); +} + +/*! + Normalize the quaternion. +*/ +void vpQuaternionVector::normalize() { + double mag = magnitude(); + if(!vpMath::nul(mag, std::numeric_limits<double>::epsilon())) { + set( x()/mag, y()/mag, z()/mag, w()/mag ); + } +} + +//! Returns x-component of the quaternion. +double vpQuaternionVector::x() const {return data[0];} +//! Returns y-component of the quaternion. +double vpQuaternionVector::y() const {return data[1];} +//! Returns z-component of the quaternion. +double vpQuaternionVector::z() const {return data[2];} +//! Returns w-component of the quaternion. +double vpQuaternionVector::w() const {return data[3];} diff --git a/modules/core/src/math/transformation/vpRotationMatrix.cpp b/modules/core/src/math/transformation/vpRotationMatrix.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5ad51049ffc33c748f0c9fe29f9dd8274be5d5ed --- /dev/null +++ b/modules/core/src/math/transformation/vpRotationMatrix.cpp @@ -0,0 +1,756 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Rotation matrix. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +/*! + \file vpRotationMatrix.cpp + \brief Class that consider + the particular case of rotation matrix +*/ + + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpMatrix.h> + +// Rotation classes +#include <visp3/core/vpRotationMatrix.h> + + +// Exception +#include <visp3/core/vpException.h> + +// Debug trace +#include <visp3/core/vpDebug.h> +#include <math.h> +const double vpRotationMatrix::threshold = 1e-6; + + +/*! + Initializes the rotation matrix as identity. + + \sa eye() +*/ +void +vpRotationMatrix::setIdentity() +{ + eye(); +} +/*! + Initialize the rotation matrix as identity. + + \sa setIdentity() +*/ +void +vpRotationMatrix::eye() +{ + for (unsigned int i=0 ; i < 3 ; i++) { + for (unsigned int j=0 ; j < 3; j++) { + if (i==j) + (*this)[i][j] = 1.0; + else + (*this)[i][j] = 0.0; + } + } +} + +/*! + Set the current rotation matrix from a rotation matrix \e R. + + \param R : Rotation matrix. + \code + vpRotationMatrix R1(vpMath::rad(10, vpMath::rad(20), vpMath::rad(30)); + vpRotationMatrix R2 = R1; + \endcode +*/ +vpRotationMatrix & +vpRotationMatrix::operator=(const vpRotationMatrix &R) +{ + for (unsigned int i=0; i<3; i++) { + for (unsigned int j=0; j<3; j++) { + rowPtrs[i][j] = R.rowPtrs[i][j]; + } + } + + return *this; +} + +/*! + Converts a 3-by-3 matrix into a rotation matrix. + + \param M : Input matrix. + + \code + vpMatrix M; + M.eye() + vpRotationMatrix R = M; + \endcode + + \exception vpException::fatalError If the input matrix is not a rotation matrix. + + \sa isARotationMatrix() +*/ +vpRotationMatrix & +vpRotationMatrix::operator=(const vpMatrix &M) +{ + if ((M.getCols() !=3) &&(M.getRows() !=3)) { + throw(vpException(vpException::dimensionError, + "Cannot set a (3x3) rotation matrix from a (%dx%d) matrix", + M.getRows(), M.getCols())); + } + + for (unsigned int i=0; i<3; i++) { + for (unsigned int j=0; j<3; j++) { + (*this)[i][j] = M[i][j]; + } + } + + if (isARotationMatrix() == false) { + throw(vpException(vpException::fatalError, + "Cannot set a rotation matrix from a matrix that is not a rotation matrix")); + } + + return *this; +} + +/*! + Compute the product between two rotation matrices. + */ +vpRotationMatrix +vpRotationMatrix::operator*(const vpRotationMatrix &R) const +{ + vpRotationMatrix p ; + + for (unsigned int i=0;i<3;i++) { + for (unsigned int j=0;j<3;j++) { + double s =0 ; + for (unsigned int k=0;k<3;k++) + s +=rowPtrs[i][k] * R.rowPtrs[k][j]; + p[i][j] = s ; + } + } + return p; +} +/*! + Operator that allows to multiply a rotation matrix by a 3-by-3 matrix. + Allows for example to multiply a rotation matrix by a skew matrix. + \code + vpRotationMatrix R; + vpTranslationVector t; + vpMatrix M = t.skew(); + vpMatrix RM = R * M; + \endcode + + \exception vpException::dimensionError : If \e M is not + a 3-by-3 dimension matrix. + +*/ +vpMatrix +vpRotationMatrix::operator*(const vpMatrix &M) const +{ + if (M.getRows() != 3 || M.getCols() != 3) { + throw(vpException(vpException::dimensionError, + "Cannot set a (3x3) rotation matrix from a (%dx%d) matrix", + M.getRows(), M.getCols())); + } + vpMatrix p(3, 3) ; + + for (unsigned int i=0;i<3;i++) { + for (unsigned int j=0;j<3;j++) { + double s =0 ; + for (unsigned int k=0;k<3;k++) + s +=(*this)[i][k] * M[k][j]; + p[i][j] = s ; + } + } + return p; +} + +/*! + + Operator that allows to multiply a rotation matrix by a 3 dimension + column vector. + + \param v : Three dimension column vector. + + \return The product of the rotation matrix by the column vector + + \exception vpException::dimensionError If the column + vector \e v is not a 3 dimension vector. + + The code below shows how to use this operator. +\code +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpColVector.h> + +int main() +{ + vpColVector p1(3), p2(3); + vpRotationMatrix R; + + p2 = R * p1; + + return 0; +} +\endcode + +*/ +vpColVector +vpRotationMatrix::operator*(const vpColVector &v) const +{ + if (v.getRows() != 3) { + throw (vpException(vpException::dimensionError, + "Cannot multiply a (3x3) rotation matrix by a %d dimension column vector", + v.getRows())); + } + vpColVector v_out(3); + + for (unsigned int j=0;j<colNum;j++) { + double vj = v[j] ; // optimization em 5/12/2006 + for (unsigned int i=0;i<rowNum;i++) { + v_out[i] += rowPtrs[i][j] * vj; + } + } + + return v_out; +} + + +/*! + Multiply a rotation matrix by a translation vector and return the resulting translation vector. + */ +vpTranslationVector +vpRotationMatrix::operator*(const vpTranslationVector &tv) const +{ + vpTranslationVector p ; + + for (unsigned int j=0;j<3;j++) + p[j] = 0; + + for (unsigned int j=0;j<3;j++) { + for (unsigned int i=0;i<3;i++) { + p[i] += rowPtrs[i][j] * tv[j]; + } + } + + return p; +} + +/*! + Operator that allows to multiply all the elements of a rotation matrix + by a scalar. + */ +vpRotationMatrix vpRotationMatrix::operator*(double x) const +{ + vpRotationMatrix R; + + for (unsigned int i=0;i<rowNum;i++) + for(unsigned int j=0;j<colNum;j++) + R[i][j]= rowPtrs[i][j]*x; + + return R; +} + +/*! + Operator that allows to multiply all the elements of a rotation matrix + by a scalar. + */ +vpRotationMatrix & vpRotationMatrix::operator*=(double x) +{ + for (unsigned int i=0;i<rowNum;i++) + for(unsigned int j=0;j<colNum;j++) + rowPtrs[i][j]*=x; + + return *this; +} + +/*********************************************************************/ + +/*! + Test if the rotation matrix is really a rotation matrix. +*/ +bool +vpRotationMatrix::isARotationMatrix() const +{ + unsigned int i,j ; + bool isRotation = true ; + + // test R^TR = Id ; + vpRotationMatrix RtR = (*this).t()*(*this) ; + for (i=0 ; i < 3 ; i++) { + for (j=0 ; j < 3 ; j++) { + if (i==j) { + if (fabs(RtR[i][j]-1) > threshold) isRotation = false ; + } + else { + if (fabs(RtR[i][j]) > threshold) isRotation = false ; + } + } + } + // test if it is a basis + // test || Ci || = 1 + for (i=0 ; i < 3 ; i++) { + if ((sqrt(vpMath::sqr(RtR[0][i]) + + vpMath::sqr(RtR[1][i]) + + vpMath::sqr(RtR[2][i])) - 1) > threshold) isRotation = false ; + } + + // test || Ri || = 1 + for (i=0 ; i < 3 ; i++) { + if ((sqrt(vpMath::sqr(RtR[i][0]) + + vpMath::sqr(RtR[i][1]) + + vpMath::sqr(RtR[i][2])) - 1) > threshold) isRotation = false ; + } + + // test if the basis is orthogonal + return isRotation ; +} + + +/*! + Default constructor that initialise a 3-by-3 rotation matrix to identity. +*/ +vpRotationMatrix::vpRotationMatrix() : vpArray2D<double>(3,3) +{ + eye(); +} + + +/*! + Copy contructor that construct a 3-by-3 rotation matrix from another rotation matrix. +*/ +vpRotationMatrix::vpRotationMatrix(const vpRotationMatrix &M) : vpArray2D<double>(3,3) +{ + (*this) = M ; +} +/*! + Construct a 3-by-3 rotation matrix from an homogeneous matrix. +*/ +vpRotationMatrix::vpRotationMatrix(const vpHomogeneousMatrix &M) : vpArray2D<double>(3,3) +{ + buildFrom(M); +} + +/*! + Construct a 3-by-3 rotation matrix from \f$ \theta {\bf u}\f$ angle representation. + */ +vpRotationMatrix::vpRotationMatrix(const vpThetaUVector &tu) : vpArray2D<double>(3,3) +{ + buildFrom(tu) ; +} + +/*! + Construct a 3-by-3 rotation matrix from a pose vector. + */ +vpRotationMatrix::vpRotationMatrix(const vpPoseVector &p) : vpArray2D<double>(3,3) +{ + buildFrom(p) ; +} + +/*! + Construct a 3-by-3 rotation matrix from \f$ R(z,y,z) \f$ Euler angle representation. + */ +vpRotationMatrix::vpRotationMatrix(const vpRzyzVector &euler) : vpArray2D<double>(3,3) +{ + buildFrom(euler) ; +} + +/*! + Construct a 3-by-3 rotation matrix from \f$ R(x,y,z) \f$ Euler angle representation. + */ +vpRotationMatrix::vpRotationMatrix(const vpRxyzVector &Rxyz) : vpArray2D<double>(3,3) +{ + buildFrom(Rxyz) ; +} + +/*! + Construct a 3-by-3 rotation matrix from \f$ R(z,y,x) \f$ Euler angle representation. + */ +vpRotationMatrix::vpRotationMatrix(const vpRzyxVector &Rzyx) : vpArray2D<double>(3,3) +{ + buildFrom(Rzyx) ; +} + +/*! + Construct a 3-by-3 rotation matrix from \f$ \theta {\bf u}=(\theta u_x, \theta u_y, \theta u_z)^T\f$ angle representation. + */ +vpRotationMatrix::vpRotationMatrix(const double tux, const double tuy, const double tuz) : vpArray2D<double>(3,3) +{ + buildFrom(tux, tuy, tuz) ; +} + +/*! + Construct a 3-by-3 rotation matrix from quaternion angle representation. + */ +vpRotationMatrix::vpRotationMatrix(const vpQuaternionVector& q) : vpArray2D<double>(3,3) +{ + buildFrom(q); +} + +/*! + Return the rotation matrix transpose which is also the inverse of the rotation matrix. + + \sa inverse() +*/ +vpRotationMatrix +vpRotationMatrix::t() const +{ + vpRotationMatrix Rt ; + + unsigned int i,j; + for (i=0;i<3;i++) + for (j=0;j<3;j++) + Rt[j][i] = (*this)[i][j]; + + return Rt; +} + +/*! + Return the rotation matrix inverse which is also the transpose of the rotation matrix. + + \sa t() +*/ +vpRotationMatrix vpRotationMatrix::inverse() const +{ + vpRotationMatrix Ri = (*this).t() ; + + return Ri ; +} + +/*! + Inverse the rotation matrix. + + \param R (output): Inverted rotation matrix. + + \code +#include <visp3/core/vpRotationMatrix.h> + +int main() +{ + vpRotationMatrix R, Rinv; + // ... Update rotation matrix R + // Compute the inverse in Rinv + R.inverse(Rinv); +} + \endcode +*/ +void +vpRotationMatrix::inverse(vpRotationMatrix &R) const +{ + R = inverse(); +} + +/*! + Print to std::cout the rotation matrix as a \f$ \theta {\bf u} \f$ angle representation vector. + */ +void +vpRotationMatrix::printVector() +{ + vpThetaUVector tu(*this) ; + + for (unsigned int i=0; i<3; i++) + std::cout << tu[i] << " " ; + + std::cout << std::endl ; +} + + +/*! + Transform a \f$ \theta {\bf u}\f$ angle representation into a rotation matrix. + + The rotation is computed using : + \f[ + R = \cos{ \theta} \; {I}_{3} + (1 - \cos{ \theta}) \; u u^{T} + \sin{ \theta} \; [u]_\times + \f] +*/ +vpRotationMatrix +vpRotationMatrix::buildFrom(const vpThetaUVector &v) +{ + unsigned int i,j; + double theta, si, co, sinc, mcosc; + vpRotationMatrix R; + + theta = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); + si = sin(theta); + co = cos(theta); + sinc = vpMath::sinc(si,theta); + mcosc = vpMath::mcosc(co,theta); + + R[0][0] = co + mcosc*v[0]*v[0]; + R[0][1] = -sinc*v[2] + mcosc*v[0]*v[1]; + R[0][2] = sinc*v[1] + mcosc*v[0]*v[2]; + R[1][0] = sinc*v[2] + mcosc*v[1]*v[0]; + R[1][1] = co + mcosc*v[1]*v[1]; + R[1][2] = -sinc*v[0] + mcosc*v[1]*v[2]; + R[2][0] = -sinc*v[1] + mcosc*v[2]*v[0]; + R[2][1] = sinc*v[0] + mcosc*v[2]*v[1]; + R[2][2] = co + mcosc*v[2]*v[2]; + + for (i=0;i<3;i++) for (j=0;j<3;j++) (*this)[i][j] = R[i][j]; + + return *this ; +} + +/*! + Build a rotation matrix from an homogeneous matrix. +*/ +vpRotationMatrix +vpRotationMatrix::buildFrom(const vpHomogeneousMatrix &M) +{ + for (unsigned int i=0 ; i < 3 ; i++) + for (unsigned int j=0 ; j < 3; j++) + (*this)[i][j] = M[i][j] ; + + return *this ; +} + +/*! + Build a rotation matrix from a pose vector. + + \sa buildFrom(const vpThetaUVector &) +*/ +vpRotationMatrix +vpRotationMatrix::buildFrom(const vpPoseVector &p) +{ + vpThetaUVector tu(p); + return buildFrom(tu); +} + +/*! + Transform a vector representing the Euler angle + into a rotation matrix. + Rzyz(\f$ \phi, \theta , \psi \f$) = Rot(\f$ z,\phi \f$) Rot(\f$ y,\theta \f$) Rot(\f$ z,\psi \f$) + +*/ +vpRotationMatrix +vpRotationMatrix::buildFrom(const vpRzyzVector &v) +{ + double c0,c1,c2,s0,s1,s2; + + c0 = cos(v[0]); + c1 = cos(v[1]); + c2 = cos(v[2]); + s0 = sin(v[0]); + s1 = sin(v[1]); + s2 = sin(v[2]); + + (*this)[0][0] = c0*c1*c2 - s0*s2; + (*this)[0][1] = -c0*c1*s2 - s0*c2; + (*this)[0][2] = c0*s1; + (*this)[1][0] = s0*c1*c2+c0*s2 ; + (*this)[1][1] = -s0*c1*s2 + c0*c2 ; + (*this)[1][2] = s0*s1; + (*this)[2][0] = -s1*c2; + (*this)[2][1] = s1*s2; + (*this)[2][2] = c1; + + return (*this) ; +} + + +/*! + + Transform a vector representing the Rxyz angle into a rotation + matrix. + Rxyz(\f$ \phi,\theta, \psi \f$) = Rot(\f$ x, \psi \f$) Rot(\f$ y, \theta \f$ + ) Rot(\f$ z,\phi \f$) + +*/ +vpRotationMatrix +vpRotationMatrix::buildFrom(const vpRxyzVector &v) +{ + double c0,c1,c2,s0,s1,s2; + + c0 = cos(v[0]); + c1 = cos(v[1]); + c2 = cos(v[2]); + s0 = sin(v[0]); + s1 = sin(v[1]); + s2 = sin(v[2]); + + (*this)[0][0] = c1*c2; + (*this)[0][1] = -c1*s2; + (*this)[0][2] = s1; + (*this)[1][0] = c0*s2+s0*s1*c2; + (*this)[1][1] = c0*c2-s0*s1*s2; + (*this)[1][2] = -s0*c1; + (*this)[2][0] = -c0*s1*c2+s0*s2; + (*this)[2][1] = c0*s1*s2+c2*s0; + (*this)[2][2] = c0*c1; + + return (*this) ; +} + + + +/*! + Transform a vector representing the Rzyx angle + into a rotation matrix. + Rxyz(\f$ \phi, \theta , \psi \f$) = + Rot(\f$ z, \psi \f$) Rot(\f$ y, \theta \f$)Rot(\f$ x, \phi \f$) +*/ +vpRotationMatrix +vpRotationMatrix::buildFrom(const vpRzyxVector &v) +{ + double c0,c1,c2,s0,s1,s2; + + c0 = cos(v[0]); + c1 = cos(v[1]); + c2 = cos(v[2]); + s0 = sin(v[0]); + s1 = sin(v[1]); + s2 = sin(v[2]); + + (*this)[0][0] = c0*c1 ; + (*this)[0][1] = c0*s1*s2 - s0*c2 ; + (*this)[0][2] = c0*s1*c2 + s0*s2 ; + + (*this)[1][0] = s0*c1 ; + (*this)[1][1] = s0*s1*s2 + c0*c2 ; + (*this)[1][2] = s0*s1*c2 - c0*s2 ; + + (*this)[2][0] = -s1 ; + (*this)[2][1] = c1*s2 ; + (*this)[2][2] = c1*c2 ; + + return (*this) ; +} + + + +/*! + Construct a 3-by-3 rotation matrix from \f$ \theta {\bf u}=(\theta u_x, \theta u_y, \theta u_z)^T\f$ angle representation. + */ +vpRotationMatrix +vpRotationMatrix::buildFrom(const double tux, + const double tuy, + const double tuz) +{ + vpThetaUVector tu(tux, tuy, tuz) ; + buildFrom(tu) ; + return *this ; +} + + +/*! + Construct a 3-by-3 rotation matrix from a quaternion representation. + */ +vpRotationMatrix +vpRotationMatrix::buildFrom(const vpQuaternionVector& q){ + double a = q.w(); + double b = q.x(); + double c = q.y(); + double d = q.z(); + (*this)[0][0] = a*a+b*b-c*c-d*d; + (*this)[0][1] = 2*b*c-2*a*d; + (*this)[0][2] = 2*a*c+2*b*d; + + (*this)[1][0] = 2*a*d+2*b*c; + (*this)[1][1] = a*a-b*b+c*c-d*d; + (*this)[1][2] = 2*c*d-2*a*b; + + (*this)[2][0] = 2*b*d-2*a*c; + (*this)[2][1] = 2*a*b+2*c*d; + (*this)[2][2] = a*a-b*b-c*c+d*d; + return *this; +} + +/*! + Allow to multiply a scalar by a rotation matrix. +*/ +vpRotationMatrix operator*(const double &x,const vpRotationMatrix &R) +{ + vpRotationMatrix C; + + unsigned int Rrow = R.getRows() ; + unsigned int Rcol = R.getCols() ; + + for (unsigned int i=0;i<Rrow;i++) + for(unsigned int j=0;j<Rcol;j++) + C[i][j]= R[i][j]*x; + + return C ; +} + +/*! + Return the \f$\theta {\bf u}\f$ vector that corresponds to the rotation matrix. + */ +vpThetaUVector vpRotationMatrix::getThetaUVector() +{ + vpThetaUVector tu; + tu.buildFrom(*this); + return tu; +} + +/*! + Extract a column vector from a rotation matrix. + \warning All the indexes start from 0 in this function. + \param j : Index of the column to extract. If j=0, the first column is extracted. + \return The extracted column vector. + + The following example shows how to use this function: + \code +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpRotationMatrix.h> + +int main() +{ + vpRotationMatrix R; + + vpColVector r = R.getCol(2); + std::cout << "Last column: \n" << r << std::endl; +} + \endcode +It produces the following output: + \code +Last column: +0 +0 +1 + \endcode + */ +vpColVector +vpRotationMatrix::getCol(const unsigned int j) const +{ + if (j >= getCols()) + throw(vpException(vpException::dimensionError, + "Unable to extract a column vector from the homogeneous matrix")); + unsigned int nb_rows = getRows(); + vpColVector c(nb_rows); + for (unsigned int i=0 ; i < nb_rows ; i++) + c[i] = (*this)[i][j]; + return c; +} + diff --git a/modules/core/src/math/transformation/vpRotationVector.cpp b/modules/core/src/math/transformation/vpRotationVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..85bdb415cc8f63b3b4034c790bb86170e62456dd --- /dev/null +++ b/modules/core/src/math/transformation/vpRotationVector.cpp @@ -0,0 +1,112 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Generic rotation vector (cannot be used as is !). + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +#include <algorithm> +#include <math.h> + +#include <visp3/core/vpRotationVector.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpRowVector.h> + +/*! + \file vpRotationVector.cpp + \brief Class that consider the case of a generic rotation vector + (cannot be used as is !). +*/ + + + +/*! + Return the transpose of the rotation vector. + +*/ +vpRowVector vpRotationVector::t() const +{ + vpRowVector v(dsize); + + for (unsigned int i=0; i< dsize; i++) + v[i] = data[i]; + + return v; +} + +/*! + Operator that allows to multiply each element of a rotation vector by a scalar. + + \param x : The scalar. + + \return The rotation vector multiplied by the scalar as a column vector. The current + rotation vector (*this) is unchanged. + +*/ +vpColVector vpRotationVector::operator*(double x) const +{ + vpColVector v(dsize); + + for (unsigned int i=0;i<dsize;i++) + v[i] = (*this)[i] * x; + return v; +} + +/*! + \relates vpRotationVector + Allows to multiply a scalar by rotaion vector. +*/ +vpColVector operator*(const double &x,const vpRotationVector &v) +{ + vpColVector vout ; + vout = v*x ; + return vout ; +} + +/*! + Return the sum square of all the elements \f$r_{i}\f$ of the rotation vector r(m). + + \return The value \f[\sum{i=0}^{m} r_i^{2}\f]. + */ +double vpRotationVector::sumSquare() const +{ + double sum_square=0.0; + double x ; + + for (unsigned int i=0;i<rowNum;i++) { + x=rowPtrs[i][0]; + sum_square += x*x; + } + + return sum_square; +} diff --git a/src/math/transformation/vpRxyzVector.cpp b/modules/core/src/math/transformation/vpRxyzVector.cpp similarity index 56% rename from src/math/transformation/vpRxyzVector.cpp rename to modules/core/src/math/transformation/vpRxyzVector.cpp index cc2218ebbbeced06f55104b9531996d10106778e..c85a11a89c8384bbb6c0b0ef10263f8bf230d5b1 100644 --- a/src/math/transformation/vpRxyzVector.cpp +++ b/modules/core/src/math/transformation/vpRxyzVector.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRxyzVector.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Rxyz angle parameterization for the rotation. * Rxyz(phi,theta,psi) = Rot(x,phi)Rot(y,theta)Rot(z,psi). @@ -41,15 +37,37 @@ * *****************************************************************************/ - -#include <visp/vpRxyzVector.h> #include <math.h> + +#include <visp3/core/vpRxyzVector.h> + /*! \file vpRxyzVector.cpp \brief class that consider the case of the Rxyz angle parameterization for the rotation : Rxyz(phi,theta,psi) = Rot(x,phi)Rot(y,theta)Rot(z,psi) */ +/*! Default constructor that initialize all the 3 angles to zero. */ +vpRxyzVector::vpRxyzVector() + : vpRotationVector(3) +{} + +/*! Copy constructor. */ +vpRxyzVector::vpRxyzVector(const vpRxyzVector &rxyz) + : vpRotationVector(rxyz) +{} + +/*! + Constructor from 3 angles (in radian). + \param phi : \f$\varphi\f$ angle around the \f$x\f$ axis. + \param theta : \f$\theta\f$ angle around the \f$y\f$ axis. + \param psi : \f$\psi\f$ angle around the \f$z\f$ axis. +*/ +vpRxyzVector::vpRxyzVector(const double phi, const double theta, const double psi) + : vpRotationVector (3) +{ + buildFrom(phi, theta, psi); +} /*! Constructor that initialize \f$R_{xyz}=(\varphi,\theta,\psi)\f$ Euler @@ -57,17 +75,19 @@ \param R : Rotation matrix used to initialize the Euler angles. */ vpRxyzVector::vpRxyzVector(const vpRotationMatrix& R) + : vpRotationVector (3) { buildFrom(R) ; } /*! Constructor that initialize \f$R_{xyz}=(\varphi,\theta,\psi)\f$ Euler - angles vector from a \f$\theta u\f$ vector. - \param tu : \f$\theta u\f$ representation of a rotation used here as + angles vector from a \f$\theta {\bf u}\f$ vector. + \param tu : \f$\theta {\bf u}\f$ representation of a rotation used here as input to initialize the Euler angles. */ vpRxyzVector::vpRxyzVector(const vpThetaUVector& tu) + : vpRotationVector (3) { buildFrom(tu) ; } @@ -82,7 +102,6 @@ vpRxyzVector::vpRxyzVector(const vpThetaUVector& tu) vpRxyzVector vpRxyzVector::buildFrom(const vpRotationMatrix& R) { - double COEF_MIN_ROT = 1e-6; double phi ; @@ -94,68 +113,15 @@ vpRxyzVector::buildFrom(const vpRotationMatrix& R) double theta = atan2(R[0][2], -si*R[1][2] + co*R[2][2]) ; double psi = atan2(co*R[1][0] + si*R[2][0], co*R[1][1] + si*R[2][1]); - r[0] = phi ; - r[1] = theta ; - r[2] = psi ; - - if (0) // test new version wrt old version - { - // old version - - double v1; - double r2[3]; // has to be replaced by r below if good version - - v1 = R[0][2]; - if (v1 > 1.0 ) v1 = 1.0; - if (v1 < -1.0 ) v1 = -1.0; - r2[1] = asin(v1); - if ( fabs(fabs(r2[1]) - M_PI_2) < 0.00001) - { - r2[0] = 0.0; - r2[2] = atan2(R[1][0],R[1][1]); - } - else - { - r2[0] = atan2(-R[1][2],R[2][2]); - r2[2] = atan2(-R[0][1],R[0][0]); - } - // verification of the new version - int pb = 0; - int i; - for (i=0;i<3;i++) - { - if (fabs(r[i] - r2[i]) > 1e-5) pb = 1; - } - if (pb == 1) - { - printf("vpRxyzVector::buildFrom(const vpRotationMatrix& R)\n"); - printf(" r : %lf %lf %lf\n",r[0],r[1],r[2]); - printf(" r2 : %lf %lf %lf\n",r2[0],r2[1],r2[2]); - printf(" r - r2 : %lf %lf %lf\n",r[0]-r2[0],r[1]-r2[1],r[2]-r2[2]); - } - } - - // What is below corresponds to another representation, but which one??? - /* double phi ; - if ((fabs(R[1][2]) < 1e-6)&&(fabs(R[2][2]) < 1e-6)) phi = 0 ; - else phi = atan2(R[1][2], R[2][2]) ; - - double si = sin(phi) ; - double co = cos(phi) ; - double theta = atan2(R[0][2], -si*R[1][2] + co*R[2][2]) ; - double psi = atan2(co*R[0][1]+si*R[0][2], co*R[1][1]+si*R[1][2]); - - r[0] = phi ; - r[1] = theta ; - r[2] = psi ;*/ + buildFrom(phi, theta, psi); return *this ; } /*! - Convert a \f$\theta u\f$ vector into a \f$R_{xyz}=(\varphi,\theta,\psi)\f$ + Convert a \f$\theta {\bf u}\f$ vector into a \f$R_{xyz}=(\varphi,\theta,\psi)\f$ Euler angles vector. - \param tu : \f$\theta u\f$ representation of a rotation used here as + \param tu : \f$\theta {\bf u}\f$ representation of a rotation used here as input. \return \f$R_{xyz}=(\varphi,\theta,\psi)\f$ Euler angles vector. */ @@ -169,8 +135,43 @@ vpRxyzVector::buildFrom(const vpThetaUVector& tu) return *this ; } -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +/*! + Construction from 3 angles (in radian). + \param phi : \f$\varphi\f$ angle around the \f$x\f$ axis. + \param theta : \f$\theta\f$ angle around the \f$y\f$ axis. + \param psi : \f$\psi\f$ angle around the \f$z\f$ axis. +*/ +void +vpRxyzVector::buildFrom(const double phi, const double theta, const double psi) +{ + data[0] = phi ; + data[1] = theta ; + data[2] = psi ; +} + +/*! + + Initialize each element of the vector to the same angle value \e v. + + \param v : Angle value to set for each element of the vector. + +\code +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRxyzVector.h> + +int main() +{ + vpRxyzVector v; + + // Initialise the rotation vector + v = vpMath::rad( 45.f); // All the 3 angles are set to 45 degrees +} +\endcode +*/ +vpRxyzVector &vpRxyzVector::operator=(double v) +{ + for (unsigned int i=0; i< dsize; i++) + data[i] = v; + + return *this; +} diff --git a/src/math/transformation/vpRzyxVector.cpp b/modules/core/src/math/transformation/vpRzyxVector.cpp similarity index 56% rename from src/math/transformation/vpRzyxVector.cpp rename to modules/core/src/math/transformation/vpRzyxVector.cpp index abeab6c93b1581c986a702e39986904f7de4ba00..0a629d10cc02596e086f4c969aced43603c2bdb0 100644 --- a/src/math/transformation/vpRzyxVector.cpp +++ b/modules/core/src/math/transformation/vpRzyxVector.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRzyxVector.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Rzyx angle parameterization for the rotation. * Rzyx(phi,theta,psi) = Rot(z,phi)Rot(y,theta)Rot(x,psi) @@ -42,7 +38,7 @@ *****************************************************************************/ -#include <visp/vpRzyxVector.h> +#include <visp3/core/vpRzyxVector.h> #include <math.h> /*! \file vpRzyxVector.cpp @@ -51,24 +47,47 @@ */ +/*! Default constructor that initialize all the 3 angles to zero. */ +vpRzyxVector::vpRzyxVector() + : vpRotationVector(3) +{} + +/*! Copy constructor. */ +vpRzyxVector::vpRzyxVector(const vpRzyxVector &rzyx) + : vpRotationVector(rzyx) +{} + +/*! + Constructor from 3 angles (in radian). + \param phi : \f$\varphi\f$ angle around the \f$z\f$ axis. + \param theta : \f$\theta\f$ angle around the \f$y\f$ axis. + \param psi : \f$\psi\f$ angle around the \f$x\f$ axis. +*/ +vpRzyxVector::vpRzyxVector(const double phi, const double theta, const double psi) + : vpRotationVector (3) +{ + buildFrom(phi, theta, psi); +} + /*! Constructor that initialize \f$R_{zyx}=(\varphi,\theta,\psi)\f$ Euler angles from a rotation matrix. \param R : Rotation matrix used to initialize the Euler angles. */ vpRzyxVector::vpRzyxVector(const vpRotationMatrix& R) + : vpRotationVector (3) { buildFrom(R) ; } - /*! Constructor that initialize \f$R_{zyx}=(\varphi,\theta,\psi)\f$ Euler - angles vector from a \f$\theta u\f$ vector. - \param tu : \f$\theta u\f$ representation of a rotation used here as + angles vector from a \f$\theta {\bf u}\f$ vector. + \param tu : \f$\theta {\bf u}\f$ representation of a rotation used here as input to initialize the Euler angles. */ vpRzyxVector::vpRzyxVector(const vpThetaUVector& tu) + : vpRotationVector (3) { buildFrom(tu) ; } @@ -103,18 +122,16 @@ vpRzyxVector::buildFrom(const vpRotationMatrix& R) double psi = atan2(si*ax-co*ay,-si*ox+co*oy); - r[0] = phi ; - r[1] = theta ; - r[2] = psi ; + buildFrom(phi, theta, psi); return *this ; } /*! - Convert a \f$\theta u\f$ vector into a \f$R_{zyx}=(\varphi,\theta,\psi)\f$ + Convert a \f$\theta {\bf u}\f$ vector into a \f$R_{zyx}=(\varphi,\theta,\psi)\f$ Euler angles vector. - \param tu : \f$\theta u\f$ representation of a rotation used here as + \param tu : \f$\theta {\bf u}\f$ representation of a rotation used here as input. \return \f$R_{zyx}=(\varphi,\theta,\psi)\f$ Euler angles vector. */ @@ -128,9 +145,43 @@ vpRzyxVector::buildFrom(const vpThetaUVector& tu) return *this ; } +/*! + Construction from 3 angles (in radian). + \param phi : \f$\varphi\f$ angle around the \f$z\f$ axis. + \param theta : \f$\theta\f$ angle around the \f$y\f$ axis. + \param psi : \f$\psi\f$ angle around the \f$x\f$ axis. +*/ +void +vpRzyxVector::buildFrom(const double phi, const double theta, const double psi) +{ + data[0] = phi ; + data[1] = theta ; + data[2] = psi ; +} + +/*! + + Initialize each element of the vector to the same angle value \e v. + + \param v : Angle value to set for each element of the vector. + +\code +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRzyxVector.h> -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +int main() +{ + vpRzyxVector v; + + // Initialise the rotation vector + v = vpMath::rad( 45.f); // All the 3 angles are set to 45 degrees +} +\endcode +*/ +vpRzyxVector &vpRzyxVector::operator=(double v) +{ + for (unsigned int i=0; i< dsize; i++) + data[i] = v; + + return *this; +} diff --git a/src/math/transformation/vpRzyzVector.cpp b/modules/core/src/math/transformation/vpRzyzVector.cpp similarity index 54% rename from src/math/transformation/vpRzyzVector.cpp rename to modules/core/src/math/transformation/vpRzyzVector.cpp index d0d0eb2fb61a79db98076d30e9c5a4fd2654ff00..a57623f8cad05e2fa23d8489f15e46c03f292311 100644 --- a/src/math/transformation/vpRzyzVector.cpp +++ b/modules/core/src/math/transformation/vpRzyzVector.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRzyzVector.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Euler angles parameterization for the rotation. * Rzyz(phi,theta,psi) = Rot(z,phi)Rot(y,theta)Rot(z,psi) @@ -42,7 +38,7 @@ *****************************************************************************/ -#include <visp/vpRzyzVector.h> +#include <visp3/core/vpRzyzVector.h> #include <math.h> /*! @@ -51,28 +47,50 @@ Rzyz(phi,theta,psi) = Rot(z,phi)Rot(y,theta)Rot(z,psi) */ +/*! Default constructor that initialize all the 3 angles to zero. */ +vpRzyzVector::vpRzyzVector() + : vpRotationVector (3) +{} +/*! Copy constructor. */ +vpRzyzVector::vpRzyzVector(const vpRzyzVector &rzyz) + : vpRotationVector(rzyz) +{} + +/*! + Constructor from 3 angles (in radian). + \param phi : \f$\varphi\f$ angle around the \f$z\f$ axis. + \param theta : \f$\theta\f$ angle around the \f$y\f$ axis. + \param psi : \f$\psi\f$ angle around the \f$z\f$ axis. +*/ +vpRzyzVector::vpRzyzVector(const double phi, const double theta, const double psi) + : vpRotationVector (3) +{ + buildFrom(phi, theta, psi); +} + /*! Constructor that initialize \f$R_{zyz}=(\varphi,\theta,\psi)\f$ Euler angles from a rotation matrix. \param R : Rotation matrix used to initialize the Euler angles. */ vpRzyzVector::vpRzyzVector(const vpRotationMatrix& R) + : vpRotationVector (3) { buildFrom(R) ; } /*! Constructor that initialize \f$R_{zyz}=(\varphi,\theta,\psi)\f$ Euler - angles vector from a \f$\theta u\f$ vector. - \param tu : \f$\theta u\f$ representation of a rotation used here as + angles vector from a \f$\theta {\bf u}\f$ vector. + \param tu : \f$\theta {\bf u}\f$ representation of a rotation used here as input to initialize the Euler angles. */ vpRzyzVector::vpRzyzVector(const vpThetaUVector& tu) + : vpRotationVector (3) { buildFrom(tu) ; } - /*! Convert a rotation matrix into a \f$R_{zyz}=(\varphi,\theta,\psi)\f$ Euler angles vector. @@ -83,42 +101,39 @@ vpRzyzVector::vpRzyzVector(const vpThetaUVector& tu) vpRzyzVector vpRzyzVector::buildFrom(const vpRotationMatrix& R) { - double phi ; - if ((fabs(R[1][2]) < 1e-6) &&(fabs(R[0][2]) < 1e-6)) - phi = 0 ; - else - phi = atan2(R[1][2],R[0][2]) ; - double cphi = cos(phi) ; - double sphi = sin(phi) ; + double phi ; + if ((fabs(R[1][2]) < 1e-6) &&(fabs(R[0][2]) < 1e-6)) + phi = 0 ; + else + phi = atan2(R[1][2],R[0][2]) ; + double cphi = cos(phi) ; + double sphi = sin(phi) ; - double theta = atan2(cphi*R[0][2]+sphi*R[1][2],R[2][2]); + double theta = atan2(cphi*R[0][2]+sphi*R[1][2],R[2][2]); - double psi = atan2(-sphi*R[0][0]+cphi*R[1][0],-sphi*R[0][1]+cphi*R[1][1]) ; + double psi = atan2(-sphi*R[0][0]+cphi*R[1][0],-sphi*R[0][1]+cphi*R[1][1]) ; - r[0] = phi ; - r[1] = theta ; - r[2] = psi ; + buildFrom(phi, theta, psi); - return *this ; + return *this ; } /*! - Convert a \f$\theta u\f$ vector into a \f$R_{zyz}=(\varphi,\theta,\psi)\f$ + Convert a \f$\theta {\bf u}\f$ vector into a \f$R_{zyz}=(\varphi,\theta,\psi)\f$ Euler angles vector. - \param tu : \f$\theta u\f$ representation of a rotation used here as + \param tu : \f$\theta {\bf u}\f$ representation of a rotation used here as input. \return \f$R_{zyz}=(\varphi,\theta,\psi)\f$ Euler angles vector. */ vpRzyzVector vpRzyzVector::buildFrom(const vpThetaUVector& tu) { + vpRotationMatrix R ; + R.buildFrom(tu) ; + buildFrom(R) ; - vpRotationMatrix R ; - R.buildFrom(tu) ; - buildFrom(R) ; - - return *this ; + return *this ; } /*! @@ -128,8 +143,8 @@ vpRzyzVector::buildFrom(const vpThetaUVector& tu) \param v : Angle value to set for each element of the vector. \code -#include <visp/vpMath.h> -#include <visp/vpRzyzVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRzyzVector.h> int main() { @@ -142,9 +157,22 @@ int main() */ vpRzyzVector &vpRzyzVector::operator=(double v) { - for (int i=0; i< 3; i++) - r[i] = v; + for (unsigned int i=0; i< dsize; i++) + data[i] = v; return *this; } +/*! + Construction from 3 angles (in radian). + \param phi : \f$\varphi\f$ angle around the \f$z\f$ axis. + \param theta : \f$\theta\f$ angle around the \f$y\f$ axis. + \param psi : \f$\psi\f$ angle around the \f$z\f$ axis. +*/ +void +vpRzyzVector::buildFrom(const double phi, const double theta, const double psi) +{ + data[0] = phi ; + data[1] = theta ; + data[2] = psi ; +} diff --git a/modules/core/src/math/transformation/vpThetaUVector.cpp b/modules/core/src/math/transformation/vpThetaUVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3a78e3bb0d26e2b262845eb802188cab0ef01c41 --- /dev/null +++ b/modules/core/src/math/transformation/vpThetaUVector.cpp @@ -0,0 +1,320 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Theta U parameterization for the rotation. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +/*! +\file vpThetaUVector.cpp +\brief class that consider the case of the Theta U parameterization for the +rotation +*/ + +#include <cmath> // std::fabs +#include <limits> // numeric_limits + +#include <visp3/core/vpThetaUVector.h> + +const double vpThetaUVector::minimum = 0.0001; + +/*! Default constructor that initialize all the 3 angles to zero. */ +vpThetaUVector::vpThetaUVector() + : vpRotationVector(3) +{} +/*! Copy constructor. */ +vpThetaUVector::vpThetaUVector(const vpThetaUVector &tu) + : vpRotationVector(tu) +{} + +/*! +Initialize a \f$\theta {\bf u}\f$ vector from an homogeneous matrix. +*/ +vpThetaUVector::vpThetaUVector(const vpHomogeneousMatrix& M) + : vpRotationVector(3) +{ + buildFrom(M) ; +} +/*! +Initialize a \f$\theta {\bf u}\f$ vector from a pose vector. +*/ +vpThetaUVector::vpThetaUVector(const vpPoseVector& p) + : vpRotationVector(3) +{ + buildFrom(p) ; +} +/*! +Initialize a \f$\theta {\bf u}\f$ vector from a rotation matrix. +*/ +vpThetaUVector::vpThetaUVector(const vpRotationMatrix& R) + : vpRotationVector(3) +{ + buildFrom(R) ; +} + +/*! +Initialize a \f$\theta {\bf u}\f$ vector from an Euler z-y-x +representation vector. +*/ +vpThetaUVector::vpThetaUVector(const vpRzyxVector& rzyx) + : vpRotationVector(3) +{ + buildFrom(rzyx) ; +} +/*! +Initialize a \f$\theta {\bf u}\f$ vector from an Euler z-y-z +representation vector. +*/ +vpThetaUVector::vpThetaUVector(const vpRzyzVector& rzyz) + : vpRotationVector(3) +{ + buildFrom(rzyz) ; +} +/*! +Initialize a \f$\theta {\bf u}\f$ vector from an Euler x-y-z +representation vector. +*/ +vpThetaUVector::vpThetaUVector(const vpRxyzVector& rxyz) + : vpRotationVector(3) +{ + buildFrom(rxyz) ; +} +/*! +Initialize a \f$\theta {\bf u}\f$ vector from a quaternion +representation vector. +*/ +vpThetaUVector::vpThetaUVector(const vpQuaternionVector& q) + : vpRotationVector(4) +{ + buildFrom(q) ; +} + +/*! + Build a \f$\theta {\bf u}\f$ vector from 3 angles in radian. +*/ +vpThetaUVector::vpThetaUVector(const double tux, const double tuy, const double tuz) + : vpRotationVector (3) +{ + buildFrom(tux, tuy, tuz); +} + +/*! +Converts an homogeneous matrix into a \f$\theta {\bf u}\f$ vector. +*/ +vpThetaUVector +vpThetaUVector::buildFrom(const vpHomogeneousMatrix& M) +{ + vpRotationMatrix R; + + M.extract(R); + buildFrom(R); + + return *this ; +} +/*! +Converts a pose vector into a \f$\theta {\bf u}\f$ vector copying +the \f$\theta {\bf u}\f$ values contained in the pose vector. +*/ +vpThetaUVector +vpThetaUVector::buildFrom(const vpPoseVector& p) +{ + for(unsigned int i=0; i<3; i++) + data[i] = p[i+3]; + + return *this ; +} + +/*! +Converts a rotation matrix into a \f$\theta {\bf u}\f$ vector. +*/ +vpThetaUVector +vpThetaUVector::buildFrom(const vpRotationMatrix& R) +{ + double s,c,theta,sinc; + + s = (R[1][0]-R[0][1])*(R[1][0]-R[0][1]) + + (R[2][0]-R[0][2])*(R[2][0]-R[0][2]) + + (R[2][1]-R[1][2])*(R[2][1]-R[1][2]); + s = sqrt(s)/2.0; + c = (R[0][0]+R[1][1]+R[2][2]-1.0)/2.0; + theta=atan2(s,c); /* theta in [0, PI] since s > 0 */ + + // General case when theta != pi. If theta=pi, c=-1 + if ( (1+c) > minimum) // Since -1 <= c <= 1, no fabs(1+c) is required + { + sinc = vpMath::sinc(s,theta); + + data[0] = (R[2][1]-R[1][2])/(2*sinc); + data[1] = (R[0][2]-R[2][0])/(2*sinc); + data[2] = (R[1][0]-R[0][1])/(2*sinc); + } + else /* theta near PI */ + { + if ( (R[0][0]-c) < std::numeric_limits<double>::epsilon() ) + data[0] = 0.; + else + data[0] = theta*(sqrt((R[0][0]-c)/(1-c))); + if ((R[2][1]-R[1][2]) < 0) data[0] = -data[0]; + + if ( (R[1][1]-c) < std::numeric_limits<double>::epsilon() ) + data[1] = 0.; + else + data[1] = theta*(sqrt((R[1][1]-c)/(1-c))); + + if ((R[0][2]-R[2][0]) < 0) data[1] = -data[1]; + + if ( (R[2][2]-c) < std::numeric_limits<double>::epsilon() ) + data[2] = 0.; + else + data[2] = theta*(sqrt((R[2][2]-c)/(1-c))); + + if ((R[1][0]-R[0][1]) < 0) data[2] = -data[2]; + } + + return *this ; +} +/*! +Build a \f$\theta {\bf u}\f$ vector from an Euler z-y-x +representation vector. +*/ +vpThetaUVector +vpThetaUVector::buildFrom(const vpRzyxVector& rzyx) +{ + vpRotationMatrix R(rzyx) ; + + buildFrom(R) ; + return *this ; +} +/*! +Build a \f$\theta {\bf u}\f$ vector from an Euler z-y-z +representation vector. +*/ +vpThetaUVector +vpThetaUVector::buildFrom(const vpRzyzVector& rzyz) +{ + vpRotationMatrix R(rzyz) ; + + buildFrom(R) ; + return *this ; +} +/*! +Build a \f$\theta {\bf u}\f$ vector from an Euler x-y-z +representation vector. +*/ +vpThetaUVector +vpThetaUVector::buildFrom(const vpRxyzVector& rxyz) +{ + vpRotationMatrix R(rxyz) ; + + buildFrom(R) ; + return *this ; +} + +/*! +Build a \f$\theta {\bf u}\f$ vector from a quaternion +representation vector. +*/ +vpThetaUVector +vpThetaUVector::buildFrom(const vpQuaternionVector& q) +{ + vpRotationMatrix R(q) ; + + buildFrom(R) ; + return *this ; +} + +/*! + + Initialize each element of the \f$\theta {\bf u}\f$ vector to the + same angle value \e v. + + \param v : Angle value to set for each element of the \f$\theta {\bf + u}\f$ vector. + +\code +#include <visp3/core/vpMath.h> +#include <visp3/core/vpThetaUVector.h> + +int main() +{ + vpThetaUVector tu; + + // Initialise the theta U rotation vector + tu = vpMath::rad( 45.f); // All the 3 angles are set to 45 degrees +} +\endcode +*/ +vpThetaUVector &vpThetaUVector::operator=(double v) +{ + for (unsigned int i=0; i< dsize; i++) + data[i] = v; + + return *this; +} + +/*! + +Extract the rotation angle \f$ \theta \f$ and the unit vector +\f$\bf u \f$ from the \f$ \theta {\bf u} \f$ representation. + +\param theta : Rotation angle \f$ \theta \f$. + +\param u : Unit vector \f${\bf u} = (u_{x},u_{y},u_{z})^{\top} \f$ +representing the rotation axis. + +*/ +void +vpThetaUVector::extract(double &theta, vpColVector &u) const +{ + u.resize(3); + + theta = sqrt(data[0]*data[0] + data[1]*data[1] + data[2]*data[2]); + //if (theta == 0) { + if (std::fabs(theta) <= std::numeric_limits<double>::epsilon()) { + u = 0; + return; + } + for (unsigned int i=0 ; i < 3 ; i++) + u[i] = data[i] / theta ; +} + +/*! + Build a \f$\theta {\bf u}\f$ vector from 3 angles in radian. +*/ +void +vpThetaUVector::buildFrom(const double tux, const double tuy, const double tuz) +{ + data[0] = tux; + data[1] = tuy; + data[2] = tuz; +} diff --git a/modules/core/src/math/transformation/vpTranslationVector.cpp b/modules/core/src/math/transformation/vpTranslationVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..234283c44af511cca69cab1e933bd7783ca6803f --- /dev/null +++ b/modules/core/src/math/transformation/vpTranslationVector.cpp @@ -0,0 +1,543 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Translation vector. + * + * Authors: + * Eric Marchand + * Fabien Spindler + * + *****************************************************************************/ + + +#include <stdio.h> +#include <string.h> + +#include <visp3/core/vpTranslationVector.h> + +/*! + \file vpTranslationVector.cpp + \brief Class that consider the case of a translation vector. +*/ + +/*! + Construct a translation vector \f$ \bf t \f$ from 3 doubles. + + \param tx,ty,tz : Translation respectively along x, y and z axis. Values are in meters. + +*/ +vpTranslationVector::vpTranslationVector(const double tx, const double ty, const double tz) + : vpArray2D<double>(3, 1) +{ + (*this)[0] = tx; + (*this)[1] = ty; + (*this)[2] = tz; +} + +/*! + Construct a translation vector \f$ \bf t \f$ from the translation contained in + an homogeneous matrix. + + \param M : Homogeneous matrix where translations are in meters. + +*/ +vpTranslationVector::vpTranslationVector(const vpHomogeneousMatrix &M) + : vpArray2D<double>(3, 1) +{ + M.extract( *this ); +} + +/*! + Construct a translation vector \f$ \bf t \f$ from the translation contained in + a pose vector. + + \param p : Pose vector where translations are in meters. + +*/ +vpTranslationVector::vpTranslationVector(const vpPoseVector &p) + : vpArray2D<double>(3, 1) +{ + (*this)[0] = p[0]; + (*this)[1] = p[1]; + (*this)[2] = p[2]; +} + +/*! + Copy constructor. + + \param tv : Translation vector to copy. + + \code + vpTranslationVector t1(1,2,3); // Create and initialize a translation vector + + vpTranslationVector t2(t1); // t2 is now a copy of t1 + \endcode + +*/ +vpTranslationVector::vpTranslationVector (const vpTranslationVector &tv) + : vpArray2D<double>(tv) +{ +} + +/*! + Build a 3 dimension translation vector \f$ \bf t\f$ from + an homogeneous matrix \f$ \bf M \f$. + + \param M : Homogeneous matrix \f$ \bf M \f$ from which translation \f$ + \bf t \f$ and \f$\theta \bf u \f$ vectors are extracted to initialize + the pose vector. + + \return The build pose vector. + +*/ +vpTranslationVector +vpTranslationVector::buildFrom(const vpHomogeneousMatrix& M) +{ + M.extract( *this ); + return *this ; +} + +/*! + Build a 3 dimension translation vector \f$ \bf t\f$ from + the translation contained in a pose vector. + + \param p : Pose vector where translations are in meters. + + \return The build pose vector. + +*/ +vpTranslationVector +vpTranslationVector::buildFrom(const vpPoseVector& p) +{ + (*this)[0] = p[0]; + (*this)[1] = p[1]; + (*this)[2] = p[2]; + return *this ; +} + +/*! + Build a 3 dimension translation vector \f$ \bf t\f$ from 3 doubles. + + \param tx,ty,tz : Translation respectively along x, y and z axis in meter. + + \return The build pose vector. + \sa set() +*/ +vpTranslationVector +vpTranslationVector::buildFrom(const double tx, const double ty, const double tz) +{ + set(tx, ty, tz); + return *this ; +} + +/*! + Initialize a translation vector from 3 doubles. + + \param tx,ty,tz : Translation respectively along x, y and z axis in meter. + +*/ +void +vpTranslationVector::set(const double tx, const double ty, const double tz) +{ + (*this)[0] = tx ; + (*this)[1] = ty ; + (*this)[2] = tz ; +} + +/*! + Operator that allows to add two translation vectors. + + \param tv : Translation vector to add. + + \return The sum of the current translation vector (*this) and the one to add. + \code + vpTranslationVector t1(1,2,3); + vpTranslationVector t2(4,5,6); + vpTranslationVector t3; + + t3 = t2 + t1; + // t1 and t2 leave unchanged + // t3 is now equal to : 5, 7, 9 + \endcode + +*/ +vpTranslationVector +vpTranslationVector::operator+(const vpTranslationVector &tv) const +{ + vpTranslationVector s; + + for (unsigned int i=0;i<3;i++) s[i] = (*this)[i]+tv[i] ; + + return s; +} + +/*! + Operator that allows to substract two translation vectors. + + \param tv : Translation vector to substract. + + \return The substraction of the current translation vector (*this) and the one to substract. + \code + vpTranslationVector t1(1,2,3); + vpTranslationVector t2(4,5,6); + vpTranslationVector t3; + + t3 = t2 - t1; + // t1 and t2 leave unchanged + // t3 is now equal to : 3, 3, 3 + \endcode + +*/ +vpTranslationVector +vpTranslationVector::operator-(const vpTranslationVector &tv) const +{ + vpTranslationVector sub ; + + for (unsigned int i=0;i<3;i++) sub[i] = (*this)[i]-tv[i] ; + + return sub; +} + + +/*! + Operator that allows to negate a translation vector. + + \return The negate translation. The current translation vector + (*this) is unchanged. + + \code + vpTranslationVector t1(1,2,3); + vpTranslationVector t2; + t2 = -t1; + // t1 is unchanged + // t2 is now equal to : [-1, -2, -3] + \endcode +*/ +vpTranslationVector vpTranslationVector::operator-() const //negate +{ + vpTranslationVector tv; + for (unsigned int i=0;i<dsize;i++) + { + *(tv.data + i) = -*(data + i) ; + } + + return tv; +} + +/*! + Operator that allows to multiply each element of a translation vector by a scalar. + + \param x : The scalar. + + \return The translation vector multiplied by the scalar. The current + translation vector (*this) is unchanged. + + \code + vpTranslationVector t1(1,2,3); + t2 = t1 * 3; + // t1 is unchanged + // t2 is now equal to : [3, 6, 9] + \endcode +*/ +vpTranslationVector vpTranslationVector::operator*(const double x) const +{ + vpTranslationVector tv; + for (unsigned int i=0;i<dsize;i++) { + *(tv.data + i) = (*(data + i)) * x ; + } + + return tv; +} + +/*! + + Multiply a 3-by-1 dimension translation vector by a 1-by-n row vector. + + \param v : Row vector. + + \return The resulting matrix that is 3-by-n dimension. + +*/ +vpMatrix vpTranslationVector::operator*(const vpRowVector &v) const +{ + vpMatrix M(rowNum, v.getCols()); + for (unsigned int i=0; i<rowNum; i++) { + for (unsigned int j=0; j<v.getCols(); j++) { + M[i][j] = (*this)[i] * v[j]; + } + } + return M; +} + +/*! + Operator that allows to multiply each element of a translation vector by a scalar. + + \param x : The scalar. + + \return The translation vector multiplied by the scalar. +*/ +vpTranslationVector &vpTranslationVector::operator*=(double x) +{ + for (unsigned int i=0;i<rowNum;i++) + (*this)[i] *= x; + return (*this); +} +/*! + Operator that allows to divide each element of a translation vector by a scalar. + + \param x : The scalar. + + \return The column vector divided by the scalar. +*/ +vpTranslationVector &vpTranslationVector::operator/=(double x) +{ + for (unsigned int i=0;i<rowNum;i++) + (*this)[i] /= x; + return (*this); +} + +/*! + Operator that allows to divide each element of a translation vector by a scalar. + + \param x : The scalar. + + \return The translation vector divided by the scalar. The current + translation vector (*this) is unchanged. + + \code + vpTranslationVector t1(8,4,2); + t2 = t1 / 2; + // t1 is unchanged + // t2 is now equal to : [4, 2, 1] + \endcode +*/ +vpTranslationVector vpTranslationVector::operator/(const double x) const +{ + vpTranslationVector tv; + for (unsigned int i=0;i<dsize;i++) { + *(tv.data + i) = (*(data + i)) / x ; + } + + return tv; +} + +/*! + Copy operator. + \param tv : Translation vector to copy + \return A copy of \e tv. + + \code + vpTranslationVector t1(1,2,3); + vpTranslationVector t2; + t2 = t1; + // t1 is unchanged + // t2 is now equal to t1 : 1, 2, 3 + \endcode +*/ +vpTranslationVector &vpTranslationVector::operator=(const vpTranslationVector &tv) +{ + unsigned int k = tv.rowNum ; + if (rowNum != k){ + try { + resize(k, 1); + } + catch(...) + { + throw ; + } + } + + memcpy(data, tv.data, rowNum*sizeof(double)) ; + + return *this; +} + +/*! + Initialize each element of a translation vector to the same value x. + + \param x : Value to set for each element of the translation vector. + + \code + vpTranslationVector t; + t = 3; + // Here t is set to 3,3,3 + \endcode +*/ +vpTranslationVector & vpTranslationVector::operator=(double x) +{ + double *d = data ; + + for (int i=0;i<3;i++) + *(d++)= x ; + + return *this; +} + +/*! + Compute the skew symmetric matrix \f$M\f$ of translation vector \e tv. + + \f[ \mbox{if} \quad {\bf t} = \left( \begin{array}{c} t_x \\ t_y \\ t_z + \end{array}\right), \quad \mbox{then} \qquad + M = \left( \begin{array}{ccc} + 0 & -t_z & t_y \\ + t_z & 0 & -t_x \\ + -t_y & t_x & 0 + \end{array}\right) + \f] + + \param tv : Translation vector in input used to compute the skew symmetric + matrix M. + + \param M : Skew symmetric matrix of translation vector \f$t\f$. +*/ +void +vpTranslationVector::skew(const vpTranslationVector &tv, vpMatrix &M) +{ + M.resize(3,3) ; + M[0][0] = 0 ; M[0][1] = -tv[2] ; M[0][2] = tv[1] ; + M[1][0] = tv[2] ; M[1][1] = 0 ; M[1][2] = -tv[0] ; + M[2][0] = -tv[1]; M[2][1] = tv[0] ; M[2][2] = 0 ; +} + +/*! + + Compute the skew symmetric matrix \f$M\f$ of translation vector \e tv. + + \f[ \mbox{if} \quad {\bf t} = \left( \begin{array}{c} t_x \\ t_y \\ t_z + \end{array}\right), \quad \mbox{then} \qquad + M = \left( \begin{array}{ccc} + 0 & -t_z & t_y \\ + t_z & 0 & -t_x \\ + -t_y & t_x & 0 + \end{array}\right) + \f] + + \param tv : Translation vector in input. + + \return Skew symmetric matrix \f$M\f$ of translation vector \f$t\f$. + +*/ +vpMatrix +vpTranslationVector::skew(const vpTranslationVector &tv) +{ + vpMatrix M(3, 3); + skew(tv,M); + return M; +} + +/*! + + Compute the skew symmetric matrix \f$M\f$ of the translation vector (matrice + de pre-produit vectoriel), where + + \f[ M = \left( \begin{array}{ccc} + 0 & -t_z & t_y \\ + t_z & 0 & -t_x \\ + -t_y & t_x & 0 + \end{array}\right) + \f] + + and where \f$(t_x,t_y,t_z)\f$ are the coordinates of the translation + vector. + + \return Skew symmetric matrix \f$M\f$ of the translation vector. + +*/ +vpMatrix +vpTranslationVector::skew() const +{ + vpMatrix M(3, 3); + skew(*this,M); + return M; +} + + +/*! + + Return the cross product of two translation vectors \f$a \times b\f$. + + \param a,b : Translation vectors in input. + + \return The cross product of two translation vectors \f$a \times + b\f$. +*/ +vpTranslationVector +vpTranslationVector::cross(const vpTranslationVector &a, + const vpTranslationVector &b) +{ + vpMatrix skew_a = vpTranslationVector::skew(a) ; + return (vpTranslationVector)(skew_a * b); +} + +/*! + Transpose the translation vector. The resulting vector becomes a row vector. +*/ +vpRowVector vpTranslationVector::t() const +{ + vpRowVector v(rowNum); + memcpy(v.data, data, rowNum*sizeof(double)) ; + return v; +} + +/*! + Compute and return the Euclidean norm of the translation vector + \f$ ||x|| = \sqrt{ \sum{t_{i}^2}} \f$. + + \return The Euclidean norm if the vector is initialized, 0 otherwise. + +*/ +double vpTranslationVector::euclideanNorm() const +{ + double norm=0.0; + double x ; + for (unsigned int i=0;i<dsize;i++) { + x = *(data +i); norm += x*x; + } + + return sqrt(norm); +} + +/*! + Return the sum square of all the elements \f$t_{i}\f$ of the translation vector t(m). + + \return The value \f[\sum{i=0}^{m} t_i^{2}\f]. + */ +double vpTranslationVector::sumSquare() const +{ + double sum_square=0.0; + double x ; + + for (unsigned int i=0;i<rowNum;i++) { + x=rowPtrs[i][0]; + sum_square += x*x; + } + + return sum_square; +} diff --git a/src/math/transformation/vpVelocityTwistMatrix.cpp b/modules/core/src/math/transformation/vpVelocityTwistMatrix.cpp similarity index 53% rename from src/math/transformation/vpVelocityTwistMatrix.cpp rename to modules/core/src/math/transformation/vpVelocityTwistMatrix.cpp index add5bec6568b3d147fd76e614d1d37a8a1939893..f12951e5d71aeb89f104152cf989b4e433380061 100644 --- a/src/math/transformation/vpVelocityTwistMatrix.cpp +++ b/modules/core/src/math/transformation/vpVelocityTwistMatrix.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpVelocityTwistMatrix.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Velocity twist transformation matrix. * @@ -39,14 +35,11 @@ * *****************************************************************************/ -#include <visp/vpVelocityTwistMatrix.h> - -// Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> +#include <sstream> +#include <assert.h> -// Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/core/vpException.h> /*! @@ -59,22 +52,20 @@ /*! - Copy operator. + Copy operator that allow to set a velocity twist matrix from an other one. \param V : Velocity twist matrix to copy. */ vpVelocityTwistMatrix & vpVelocityTwistMatrix::operator=(const vpVelocityTwistMatrix &V) { - init() ; - for (int i=0; i<6; i++) + { + for (int j=0; j<6; j++) { - for (int j=0; j<6; j++) - { - rowPtrs[i][j] = V.rowPtrs[i][j]; - } + rowPtrs[i][j] = V.rowPtrs[i][j]; } + } return *this; } @@ -83,35 +74,24 @@ vpVelocityTwistMatrix::operator=(const vpVelocityTwistMatrix &V) /*! Initialize a 6x6 velocity twist matrix as identity. */ - void -vpVelocityTwistMatrix::init() -{ - unsigned int i,j ; - - try { - resize(6,6) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - - for (i=0 ; i < 6 ; i++) - for (j=0 ; j < 6; j++) +vpVelocityTwistMatrix::eye() +{ + for (unsigned int i=0 ; i < 6 ; i++) + for (unsigned int j=0 ; j < 6; j++) if (i==j) - (*this)[i][j] = 1.0 ; + (*this)[i][j] = 1.0 ; else - (*this)[i][j] = 0.0; + (*this)[i][j] = 0.0; } /*! Initialize a velocity twist transformation matrix as identity. */ -vpVelocityTwistMatrix::vpVelocityTwistMatrix() : vpMatrix() +vpVelocityTwistMatrix::vpVelocityTwistMatrix() + : vpArray2D<double>(6, 6) { - init() ; + eye() ; } /*! @@ -119,9 +99,9 @@ vpVelocityTwistMatrix::vpVelocityTwistMatrix() : vpMatrix() \param V : Velocity twist matrix used as initializer. */ -vpVelocityTwistMatrix::vpVelocityTwistMatrix(const vpVelocityTwistMatrix &V) : vpMatrix() +vpVelocityTwistMatrix::vpVelocityTwistMatrix(const vpVelocityTwistMatrix &V) + : vpArray2D<double>(6, 6) { - init() ; *this = V; } @@ -135,9 +115,9 @@ vpVelocityTwistMatrix::vpVelocityTwistMatrix(const vpVelocityTwistMatrix &V) : v transformation matrix. */ -vpVelocityTwistMatrix::vpVelocityTwistMatrix(const vpHomogeneousMatrix &M) : vpMatrix() +vpVelocityTwistMatrix::vpVelocityTwistMatrix(const vpHomogeneousMatrix &M) + : vpArray2D<double>(6, 6) { - init() ; buildFrom(M); } @@ -146,16 +126,16 @@ vpVelocityTwistMatrix::vpVelocityTwistMatrix(const vpHomogeneousMatrix &M) : vpM Initialize a velocity twist transformation matrix from a translation vector \e t and a rotation vector with \f$\theta u \f$ parametrization. - \param tv : Translation vector. + \param t : Translation vector. \param thetau : \f$\theta u\f$ rotation vector. */ -vpVelocityTwistMatrix::vpVelocityTwistMatrix(const vpTranslationVector &tv, - const vpThetaUVector &thetau) : vpMatrix() +vpVelocityTwistMatrix::vpVelocityTwistMatrix(const vpTranslationVector &t, + const vpThetaUVector &thetau) + : vpArray2D<double>(6, 6) { - init() ; - buildFrom(tv, thetau) ; + buildFrom(t, thetau) ; } /*! @@ -163,35 +143,36 @@ vpVelocityTwistMatrix::vpVelocityTwistMatrix(const vpTranslationVector &tv, Initialize a velocity twist transformation matrix from a translation vector \e t and a rotation matrix M. - \param tv : Translation vector. + \param t : Translation vector. \param R : Rotation matrix. */ -vpVelocityTwistMatrix::vpVelocityTwistMatrix(const vpTranslationVector &tv, - const vpRotationMatrix &R) +vpVelocityTwistMatrix::vpVelocityTwistMatrix(const vpTranslationVector &t, + const vpRotationMatrix &R) + : vpArray2D<double>(6, 6) { - init() ; - buildFrom(tv,R) ; + buildFrom(t,R) ; } /*! Initialize a velocity twist transformation matrix from a translation vector - \e t and a rotation vector with \f$\theta u \f$ parametrization. + \f${\bf t}=(t_x, t_y, t_z)^T\f$ and a rotation vector with \f$\theta {\bf u}=(\theta u_x, \theta u_y, \theta u_z)^T \f$ + parametrization. \param tx,ty,tz : Translation vector in meters. - \param tux,tuy,tuz : \f$\theta u\f$ rotation vector expressed in radians. + \param tux,tuy,tuz : \f$\theta {\bf u}\f$ rotation vector expressed in radians. */ vpVelocityTwistMatrix::vpVelocityTwistMatrix(const double tx, const double ty, const double tz, const double tux, const double tuy, - const double tuz) : vpMatrix() + const double tuz) + : vpArray2D<double>(6, 6) { - init() ; vpTranslationVector T(tx,ty,tz) ; vpThetaUVector tu(tux,tuy,tuz) ; buildFrom(T,tu) ; @@ -205,7 +186,7 @@ vpVelocityTwistMatrix::vpVelocityTwistMatrix(const double tx, void vpVelocityTwistMatrix::setIdentity() { - init() ; + eye() ; } @@ -222,12 +203,12 @@ vpVelocityTwistMatrix::operator*(const vpVelocityTwistMatrix &V) const for (unsigned int i=0;i<6;i++) for (unsigned int j=0;j<6;j++) - { - double s =0 ; - for (int k=0;k<6;k++) - s +=rowPtrs[i][k] * V.rowPtrs[k][j]; - p[i][j] = s ; - } + { + double s =0 ; + for (int k=0;k<6;k++) + s +=rowPtrs[i][k] * V.rowPtrs[k][j]; + p[i][j] = s ; + } return p; } @@ -238,16 +219,14 @@ vpVelocityTwistMatrix::operator*(const vpVelocityTwistMatrix &V) const camera velocity skew from the joint velocities knowing the robot jacobian. \code - #include <visp/vpConfig.h> - #include <visp/vpRobotAfma6.h> - #include <visp/vpColVector.h> - #include <visp/vpVelocityTwistMatrix.h> - - #ifdef VISP_HAVE_AFMA6 +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpVelocityTwistMatrix.h> - int main() - { - vpRobotAfma6 robot; +int main() +{ + vpSimulatorCamera robot; vpColVector q_vel(6); // Joint velocity on the 6 joints // ... q_vel need here to be initialized @@ -264,22 +243,19 @@ vpVelocityTwistMatrix::operator*(const vpVelocityTwistMatrix &V) const c_v = cVe * eJe * q_vel; return 0; - } - #endif +} \endcode - \exception vpMatrixException::incorrectMatrixSizeError If M is not a 6 rows - dimension matrix. + \exception vpException::dimensionError If M is not a 6 rows dimension matrix. */ vpMatrix vpVelocityTwistMatrix::operator*(const vpMatrix &M) const { - - if (6 != M.getRows()) - { - vpERROR_TRACE("vpVelocityTwistMatrix mismatch in vpVelocityTwistMatrix/vpMatrix multiply") ; - throw(vpMatrixException::incorrectMatrixSizeError) ; - } + if (6 != M.getRows()) { + throw(vpException(vpException::dimensionError, + "Cannot multiply a (6x6) velocity twist matrix by a (%dx%d) matrix", + M.getRows(), M.getCols())); + } vpMatrix p(6, M.getCols()) ; for (unsigned int i=0;i<6;i++) @@ -296,15 +272,11 @@ vpVelocityTwistMatrix::operator*(const vpMatrix &M) const /*! Operator that allows to multiply a twist transformation matrix by a - column vector. - - Operation c = V * v (V, the velocity skew transformation matrix is unchanged, - c and v are 6 dimension vectors). + 6-dimension column vector. \param v : Velocity skew vector. - \exception vpMatrixException::incorrectMatrixSizeError If v is not a 6 - dimension vector. + \exception vpException::dimensionError If v is not a 6 dimension column vector. */ vpColVector @@ -314,9 +286,9 @@ vpVelocityTwistMatrix::operator*(const vpColVector &v) const if (6 != v.getRows()) { - vpERROR_TRACE("vpVelocityTwistMatrix mismatch in vpVelocityTwistMatrix/vector multiply") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "Mismatch in vpVelocityTwistMatrix/vector multiply")) ; + throw(vpException(vpException::dimensionError, + "Cannot multiply a (6x6) velocity twist matrix by a (%d) column vector", + v.getRows())); } c = 0.0; @@ -338,17 +310,17 @@ vpVelocityTwistMatrix::operator*(const vpColVector &v) const Build a velocity twist transformation matrix from a translation vector \e t and a rotation matrix M. - \param tv : Translation vector. + \param t : Translation vector. \param R : Rotation matrix. */ vpVelocityTwistMatrix -vpVelocityTwistMatrix::buildFrom(const vpTranslationVector &tv, - const vpRotationMatrix &R) +vpVelocityTwistMatrix::buildFrom(const vpTranslationVector &t, + const vpRotationMatrix &R) { unsigned int i, j; - vpMatrix skewaR = tv.skew(tv)*R ; + vpMatrix skewaR = t.skew(t)*R ; for (i=0 ; i < 3 ; i++) for (j=0 ; j < 3 ; j++) @@ -366,20 +338,19 @@ vpVelocityTwistMatrix::buildFrom(const vpTranslationVector &tv, Initialize a velocity twist transformation matrix from a translation vector \e t and a rotation vector with \f$\theta u \f$ parametrization. - \param tv : Translation vector. + \param t : Translation vector. - \param thetau : \f$\theta u\f$ rotation vector. + \param thetau : \f$\theta {\bf u}\f$ rotation vector. */ vpVelocityTwistMatrix -vpVelocityTwistMatrix::buildFrom(const vpTranslationVector &tv, - const vpThetaUVector &thetau) +vpVelocityTwistMatrix::buildFrom(const vpTranslationVector &t, + const vpThetaUVector &thetau) { vpRotationMatrix R ; R.buildFrom(thetau) ; - buildFrom(tv,R) ; + buildFrom(t,R) ; return (*this) ; - } @@ -406,7 +377,7 @@ vpVelocityTwistMatrix::buildFrom(const vpHomogeneousMatrix &M) } -//! invert the twist matrix +//! Invert the velocity twist matrix. vpVelocityTwistMatrix vpVelocityTwistMatrix::inverse() const { @@ -421,14 +392,14 @@ vpVelocityTwistMatrix::inverse() const } -//! invert the twist matrix +//! Invert the velocity twist matrix. void -vpVelocityTwistMatrix::inverse(vpVelocityTwistMatrix &Wi) const +vpVelocityTwistMatrix::inverse(vpVelocityTwistMatrix &V) const { - Wi = inverse(); + V = inverse(); } -//! extract the rotational matrix from the twist matrix +//! Extract the rotation matrix from the velocity twist matrix. void vpVelocityTwistMatrix::extract( vpRotationMatrix &R) const { @@ -437,7 +408,7 @@ vpVelocityTwistMatrix::extract( vpRotationMatrix &R) const R[i][j] = (*this)[i][j]; } -//! extract the translation vector from the twist matrix +//! Extract the translation vector from the velocity twist matrix. void vpVelocityTwistMatrix::extract(vpTranslationVector &tv) const { @@ -453,8 +424,107 @@ vpVelocityTwistMatrix::extract(vpTranslationVector &tv) const tv[2] = skT[1][0]; } -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +/*! + + Pretty print a velocity twist matrix. The data are tabulated. + The common widths before and after the decimal point + are set with respect to the parameter maxlen. + + \param s Stream used for the printing. + + \param length The suggested width of each matrix element. + The actual width grows in order to accomodate the whole integral part, + and shrinks if the whole extent is not needed for all the numbers. + \param intro The introduction which is printed before the matrix. + Can be set to zero (or omitted), in which case + the introduction is not printed. + + \return Returns the common total width for all matrix elements + + \sa std::ostream &operator<<(std::ostream &s, const vpArray2D<Type> &A) +*/ +int +vpVelocityTwistMatrix::print(std::ostream& s, unsigned int length, char const* intro) const +{ + typedef std::string::size_type size_type; + + unsigned int m = getRows(); + unsigned int n = getCols(); + + std::vector<std::string> values(m*n); + std::ostringstream oss; + std::ostringstream ossFixed; + std::ios_base::fmtflags original_flags = oss.flags(); + + // ossFixed <<std::fixed; + ossFixed.setf ( std::ios::fixed, std::ios::floatfield ); + + size_type maxBefore=0; // the length of the integral part + size_type maxAfter=0; // number of decimals plus + // one place for the decimal point + for (unsigned int i=0;i<m;++i) { + for (unsigned int j=0;j<n;++j){ + oss.str(""); + oss << (*this)[i][j]; + if (oss.str().find("e")!=std::string::npos){ + ossFixed.str(""); + ossFixed << (*this)[i][j]; + oss.str(ossFixed.str()); + } + + values[i*n+j]=oss.str(); + size_type thislen=values[i*n+j].size(); + size_type p=values[i*n+j].find('.'); + + if (p==std::string::npos){ + maxBefore=vpMath::maximum(maxBefore, thislen); + // maxAfter remains the same + } else{ + maxBefore=vpMath::maximum(maxBefore, p); + maxAfter=vpMath::maximum(maxAfter, thislen-p-1); + } + } + } + + size_type totalLength=length; + // increase totalLength according to maxBefore + totalLength=vpMath::maximum(totalLength,maxBefore); + // decrease maxAfter according to totalLength + maxAfter=std::min(maxAfter, totalLength-maxBefore); + if (maxAfter==1) maxAfter=0; + + // the following line is useful for debugging + //std::cerr <<totalLength <<" " <<maxBefore <<" " <<maxAfter <<"\n"; + + if (intro) s <<intro; + s <<"["<<m<<","<<n<<"]=\n"; + + for (unsigned int i=0;i<m;i++) { + s <<" "; + for (unsigned int j=0;j<n;j++){ + size_type p=values[i*n+j].find('.'); + s.setf(std::ios::right, std::ios::adjustfield); + s.width((std::streamsize)maxBefore); + s <<values[i*n+j].substr(0,p).c_str(); + + if (maxAfter>0){ + s.setf(std::ios::left, std::ios::adjustfield); + if (p!=std::string::npos){ + s.width((std::streamsize)maxAfter); + s <<values[i*n+j].substr(p,maxAfter).c_str(); + } else{ + assert(maxAfter>1); + s.width((std::streamsize)maxAfter); + s <<".0"; + } + } + + s <<' '; + } + s <<std::endl; + } + + s.flags(original_flags); // restore s to standard state + + return (int)(maxBefore+maxAfter); +} diff --git a/src/math/transformation/vpXmlParserHomogeneousMatrix.cpp b/modules/core/src/math/transformation/vpXmlParserHomogeneousMatrix.cpp similarity index 95% rename from src/math/transformation/vpXmlParserHomogeneousMatrix.cpp rename to modules/core/src/math/transformation/vpXmlParserHomogeneousMatrix.cpp index 2c9befe835d32b82dad2ec26811d071b7e3ea687..ffe287150fd67235e2f40db044533a3db5c32f72 100644 --- a/src/math/transformation/vpXmlParserHomogeneousMatrix.cpp +++ b/modules/core/src/math/transformation/vpXmlParserHomogeneousMatrix.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpXmlParserHomogeneousMatrix.cpp 4920 2014-10-09 08:18:30Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * XML parser to load and save Homogeneous Matrix in a XML file * @@ -46,14 +42,14 @@ Class vpXmlParserHomogeneousMatrix allowed to load and save an homogeneous matrix in a XML file. */ -#include <visp/vpXmlParserHomogeneousMatrix.h> +#include <visp3/core/vpXmlParserHomogeneousMatrix.h> #ifdef VISP_HAVE_XML2 #include <stdlib.h> #include <string.h> -#include <visp/vpDebug.h> -#include <visp/vpThetaUVector.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpThetaUVector.h> /* -------------------------------------------------------------------------- */ /* --- LABEL XML ------------------------------------------------------------ */ /* -------------------------------------------------------------------------- */ @@ -144,10 +140,10 @@ vpXmlParserHomogeneousMatrix::parse(vpHomogeneousMatrix &M, const std::string &f } /*! - Save an homogenous matrix in an xml file. - \param M : homogenous matrix to save. + Save an homogeneous matrix in an xml file. + \param M : homogeneous matrix to save. \param filename : name of the xml file to fill. - \param name : name of the homogenous matrix. + \param name : name of the homogeneous matrix. \return error code. */ @@ -492,7 +488,7 @@ write (xmlNodePtr node, const std::string& name) vpThetaUVector tu(R); - // <homogenous_transformation> + // <homogeneous_transformation> node_tmp = xmlNewComment((xmlChar*)"Homogeneous Matrix"); xmlAddChild(node,node_tmp); node_matrix = xmlNewNode(NULL,(xmlChar*)LABEL_XML_M); @@ -605,4 +601,7 @@ vpXmlParserHomogeneousMatrix::str2xmlcode (char * str, vpXmlCodeType & res) return back; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpXmlParserHomogeneousMatrix.cpp.o) has no symbols +void dummy_vpXmlParserHomogeneousMatrix() {}; #endif //VISP_HAVE_XML2 diff --git a/src/tools/convert/vpConvert.cpp b/modules/core/src/tools/convert/vpConvert.cpp similarity index 97% rename from src/tools/convert/vpConvert.cpp rename to modules/core/src/tools/convert/vpConvert.cpp index a5294c51bc473b12a47d0c2b5014c0caabbf0596..cd8bdf8aa550d7d8d7b9f0647f2681e3db31f39e 100644 --- a/src/tools/convert/vpConvert.cpp +++ b/modules/core/src/tools/convert/vpConvert.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpIoTools.cpp 5214 2015-01-27 18:33:01Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Directory management. * @@ -48,7 +44,7 @@ #include <vector> // std::vector #include <algorithm> // std::transform -#include <visp/vpConvert.h> +#include <visp3/core/vpConvert.h> #if (VISP_HAVE_OPENCV_VERSION >= 0x020101) @@ -432,4 +428,7 @@ std::transform(from.begin(), from.end(), to.begin(), vpObjectPointToPoint3d); } } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpConvert.cpp.o) has no symbols +void dummy_vpConvert() {}; #endif diff --git a/src/exceptions/vpException.cpp b/modules/core/src/tools/exceptions/vpException.cpp similarity index 90% rename from src/exceptions/vpException.cpp rename to modules/core/src/tools/exceptions/vpException.cpp index c5eda2153f762d3744fd651c5d8fc1fb61bf6201..16bb5575d83f370a11781ac2658ff51f33dea354 100644 --- a/src/exceptions/vpException.cpp +++ b/modules/core/src/tools/exceptions/vpException.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpException.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exception handling. * @@ -45,7 +41,7 @@ */ #include <stdio.h> -#include "visp/vpException.h" +#include "visp3/core/vpException.h" /* ------------------------------------------------------------------------- */ diff --git a/src/tools/io/vpIoTools.cpp b/modules/core/src/tools/file/vpIoTools.cpp similarity index 91% rename from src/tools/io/vpIoTools.cpp rename to modules/core/src/tools/file/vpIoTools.cpp index ae85396e9684da12656efde4f65c03d84fe98c8c..5b6d2c73039145bface72c4581a87e73c78aa7b2 100644 --- a/src/tools/io/vpIoTools.cpp +++ b/modules/core/src/tools/file/vpIoTools.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpIoTools.cpp 5214 2015-01-27 18:33:01Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Directory management. * @@ -43,9 +39,9 @@ \file vpIoTools.cpp \brief File and directories basic tools. */ -#include <visp/vpIoTools.h> -#include <visp/vpDebug.h> -#include <visp/vpIoException.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpIoException.h> #include <stdlib.h> #include <stdio.h> #include <fstream> @@ -72,6 +68,30 @@ std::string vpIoTools::configFile = ""; std::vector<std::string> vpIoTools::configVars = std::vector<std::string>(); std::vector<std::string> vpIoTools::configValues = std::vector<std::string>(); +/*! + Sets the base name (prefix) of the experiment files. + + \param s : Prefix of the experiment files. +*/ +void vpIoTools::setBaseName(const std::string &s) {baseName = s;} +/*! + Sets the base directory of the experiment files. + + \param dir : Directory where the data will be saved. +*/ +void vpIoTools::setBaseDir(const std::string &dir) {baseDir = dir + "/";} +/*! + Gets the base name (prefix) of the experiment files. + + \return the base name of the experiment files. +*/ +std::string vpIoTools::getBaseName() {return baseName;} +/*! + Gets the full path of the experiment files : baseDir/baseName + + \return the full path of the experiment files. +*/ +std::string vpIoTools::getFullName() {return baseDir + baseName;} /*! Get the user name. @@ -181,7 +201,7 @@ vpIoTools::getUserName() \code #include <iostream> #include <string> -#include <visp/vpIoTools.h> +#include <visp3/core/vpIoTools.h> int main() { @@ -229,7 +249,7 @@ vpIoTools::getenv(const char *env) \code #include <iostream> #include <string> -#include <visp/vpIoTools.h> +#include <visp3/core/vpIoTools.h> int main() { @@ -796,11 +816,11 @@ bool vpIoTools::readConfigVar(const std::string &var, float &value) if(configVars[k] == var) { if(configValues[k].compare("PI") == 0) - value = M_PI; + value = (float) M_PI; else if(configValues[k].compare("PI/2") == 0) - value = M_PI/2; + value = (float) (M_PI/2.0); else if(configValues[k].compare("-PI/2") == 0) - value = -M_PI/2; + value = (float) (-M_PI/2.0); else value = (float) atof(configValues[k].c_str()); found = true; @@ -949,36 +969,36 @@ bool vpIoTools::readConfigVar(const std::string &var, std::string &value) \return true if the parameter could be read. */ -bool vpIoTools::readConfigVar(const std::string &var, vpMatrix &value, const unsigned int &nCols, const unsigned int &nRows) +bool vpIoTools::readConfigVar(const std::string &var, vpArray2D<double> &value, const unsigned int &nCols, const unsigned int &nRows) { bool found = false; std::string nb; for(unsigned int k=0;k<configVars.size() && found==false;++k) + { + if(configVars[k] == var) { - if(configVars[k] == var) - { found = true; - // resize or not - if(nCols != 0 && nRows != 0) - value.resize(nRows, nCols); - size_t ind=0,ind2; - for(unsigned int i=0;i<value.getRows();++i) + // resize or not + if(nCols != 0 && nRows != 0) + value.resize(nRows, nCols); + size_t ind=0,ind2; + for(unsigned int i=0;i<value.getRows();++i) for(unsigned int j=0;j<value.getCols();++j) - { - ind2 = configValues[k].find(",",ind); - nb = configValues[k].substr(ind,ind2-ind); - if(nb.compare("PI") == 0) - value[i][j] = M_PI; - else if(nb.compare("PI/2") == 0) - value[i][j] = M_PI/2; - else if(nb.compare("-PI/2") == 0) - value[i][j] = -M_PI/2; - else - value[i][j] = atof(nb.c_str()); - ind = ind2+1; - } - } + { + ind2 = configValues[k].find(",",ind); + nb = configValues[k].substr(ind,ind2-ind); + if(nb.compare("PI") == 0) + value[i][j] = M_PI; + else if(nb.compare("PI/2") == 0) + value[i][j] = M_PI/2; + else if(nb.compare("-PI/2") == 0) + value[i][j] = -M_PI/2; + else + value[i][j] = atof(nb.c_str()); + ind = ind2+1; + } } + } if(found == false) std::cout << var << " not found in config file" << std::endl; return found; @@ -1059,7 +1079,7 @@ void vpIoTools::saveConfigFile(const bool &actuallySave) /*! Get ViSP images data path. ViSP images data can be installed from Debian or Ubuntu \e visp-images-data package. - It can be also installed from ViSP-images.zip that can be found on http://team.inria.fr/lagadic/visp/download.html page. + It can be also installed from ViSP-images.zip that can be found on http://visp.inria.fr/download page. This function returns the path to the folder that contains the data. - It checks first if \e visp-images-data package is installed. In that case returns then \e /usr/share/visp-images-data". @@ -1073,7 +1093,7 @@ std::string vpIoTools::getViSPImagesDataPath() std::string data_path; std::string file_to_test("ViSP-images/mbt/cube.cao"); std::string filename; -#ifdef UNIX +#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX // Test if visp-images-data package is u-installed (Ubuntu and Debian) data_path = "/usr/share/visp-images-data"; filename = data_path + "/" + file_to_test; @@ -1405,3 +1425,71 @@ std::pair<std::string, std::string> vpIoTools::splitDrive(const std::string& pat return std::pair<std::string, std::string>("", pathname); #endif } + +/*! + Split a chain. + \param chain : Input chain to split. + \param sep : Character separator. + \return A vector that contains all the subchains. + + The following code shows how to use this function: + \code +#include <visp3/core/vpIoTools.h> + +int main() +{ + { + std::string chain("/home/user;/usr/local/include;/usr/include"); + std::string sep = ";"; + + std::vector<std::string> subChain = vpIoTools::splitChain(chain, sep); + std::cout << "Found the following subchains: " << std::endl; + for (size_t i=0; i < subChain.size(); i++) + std::cout << subChain[i] << std::endl; + } + + { + std::string chain("This is an other example"); + std::string sep = " "; + + std::vector<std::string> subChain = vpIoTools::splitChain(chain, sep); + std::cout << "Found the following subchains: " << std::endl; + for (size_t i=0; i < subChain.size(); i++) + std::cout << subChain[i] << std::endl; + } +} + \endcode + + It produces the following output: + \code +Found the following subchains: +/home/user +/usr/local/include +/usr/include +Found the following subchains: +This +is +an +other +example + \endcode + */ +std::vector<std::string> vpIoTools::splitChain(const std::string & chain, const std::string & sep) +{ + size_t startIndex = 0; + + std::string chainToSplit = chain; + std::vector<std::string> subChain; + size_t sepIndex = chainToSplit.find(sep); + + while(sepIndex != std::string::npos) { + + subChain.push_back( chainToSplit.substr(startIndex, sepIndex) ); + chainToSplit = chainToSplit.substr(sepIndex+1, chain.size()-1); + + sepIndex = chainToSplit.find(sep); + } + subChain.push_back(chainToSplit); + + return subChain; +} diff --git a/src/tools/geometry/vpPlane.cpp b/modules/core/src/tools/geometry/vpPlane.cpp similarity index 95% rename from src/tools/geometry/vpPlane.cpp rename to modules/core/src/tools/geometry/vpPlane.cpp index 58055c0b4cb49b53a15ddffa71b1125e2fc0fd35..045138b23c32e33f4d4aa14ad33dea8f12ff31e3 100644 --- a/src/tools/geometry/vpPlane.cpp +++ b/modules/core/src/tools/geometry/vpPlane.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPlane.cpp 4740 2014-05-26 07:15:44Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Plane geometrical structure. * @@ -46,7 +42,7 @@ \ingroup libtools */ -#include <visp/vpPlane.h> +#include <visp3/core/vpPlane.h> #include <cmath> // std::fabs #include <limits> // numeric_limits diff --git a/src/tools/geometry/vpPolygon.cpp b/modules/core/src/tools/geometry/vpPolygon.cpp similarity index 82% rename from src/tools/geometry/vpPolygon.cpp rename to modules/core/src/tools/geometry/vpPolygon.cpp index 4cef509fd821dd6d0c63c08c79066ecb52cf6257..3a8ff33b6d5bc98d3d5794595906e6a84bb8cb31 100644 --- a/src/tools/geometry/vpPolygon.cpp +++ b/modules/core/src/tools/geometry/vpPolygon.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPolygon.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Defines a generic 2D polygon. * @@ -43,11 +39,11 @@ -#include <visp/vpPolygon.h> -#include <visp/vpException.h> -#include <visp/vpDisplay.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpNoise.h> +#include <visp3/core/vpPolygon.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpUniRand.h> #include <set> #include <limits> /*! @@ -403,10 +399,71 @@ vpPolygon::updateBoundingBox() \param thickness : The thickness of the lines used to display the polygon. */ void -vpPolygon::display(const vpImage<unsigned char>& I, const vpColor& color, unsigned int thickness) +vpPolygon::display(const vpImage<unsigned char>& I, const vpColor& color, unsigned int thickness) const { const unsigned int N = (unsigned int)_corners.size(); for(unsigned int i=0; i<N; ++i){ vpDisplay::displayLine(I, _corners[i], _corners[(i+1)%N], color, thickness); } } + +bool +vpPolygon::intersect(const vpImagePoint& p1, const vpImagePoint& p2, const double &i_test, const double &j_test, const double &i, const double &j) +{ + double dx = p2.get_j() - p1.get_j(); + double dy = p2.get_i() - p1.get_i(); + double ex = j - j_test; + double ey = i - i_test; + + double den = dx * ey - dy * ex; + double t = 0, u = 0; + //if(den != 0){ + if(std::fabs(den) > std::fabs(den)*std::numeric_limits<double>::epsilon()){ + t = -( ey * ( p1.get_j() - j_test ) + ex * ( -p1.get_i() + i_test ) ) / den; + u = -( dx * ( -p1.get_i() + i_test ) + dy * ( p1.get_j() - j_test ) ) / den; + } + else{ + throw vpException(vpException::divideByZeroError, "denominator null"); + } + return ( t >= std::numeric_limits<double>::epsilon() && t < 1.0 && u >= std::numeric_limits<double>::epsilon() && u < 1.0); +} + +/*! + Test if an image point is inside a 2D polygon. + + \param roi : List of the polygon corners. + \param i : i-coordinate of the image point to test. + \param j : j-coordinate of the image point to test. + + \return True if the point defined by (i,j) is inside the polygon, False otherwise. +*/ +bool +vpPolygon::isInside(const std::vector<vpImagePoint>& roi, const double &i, const double &j) +{ + double i_test = 100000.; + double j_test = 100000.; + unsigned int nbInter = 0; + bool computeAgain = true; + + if(computeAgain){ + computeAgain = false; + for(unsigned int k=0; k< roi.size(); k++){ + try{ + if(vpPolygon::intersect(roi[k], roi[(k+1)%roi.size()], i, j, i_test, j_test)){ + nbInter++; + } + } + catch(...){ + computeAgain = true; + break; + } + } + + if(computeAgain){ + i_test += 100; + j_test -= 100; + nbInter = 0; + } + } + return ((nbInter%2) == 1); +} diff --git a/modules/core/src/tools/geometry/vpPolygon3D.cpp b/modules/core/src/tools/geometry/vpPolygon3D.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a2e0bc5fee9e5a6765537cd4551a809d87ff1cb0 --- /dev/null +++ b/modules/core/src/tools/geometry/vpPolygon3D.cpp @@ -0,0 +1,650 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Make the complete tracking of an object by using its CAD model + * + * Authors: + * Aurelien Yol + * + *****************************************************************************/ + +#include <limits.h> + +#include <visp3/core/vpConfig.h> +/*! + \file vpPolygon3D.cpp + \brief Implements a polygon of the model used by the model-based tracker. +*/ + +#include <visp3/core/vpPolygon3D.h> +#include <visp3/core/vpPolygon.h> + +/*! + Basic constructor. +*/ +vpPolygon3D::vpPolygon3D() + : nbpt(0), nbCornersInsidePrev(0), + p(NULL), polyClipped(), clippingFlag(vpPolygon3D::NO_CLIPPING), + distNearClip(0.001), distFarClip(100.) +{ +} + +vpPolygon3D::vpPolygon3D(const vpPolygon3D& mbtp) + : nbpt(mbtp.nbpt), nbCornersInsidePrev(mbtp.nbCornersInsidePrev), + p(NULL), polyClipped(mbtp.polyClipped), clippingFlag(mbtp.clippingFlag), + distNearClip(mbtp.distNearClip), distFarClip(mbtp.distFarClip) +{ + if (p) delete [] p; + p = new vpPoint [nbpt]; + for(unsigned int i = 0; i < nbpt; i++) + p[i] = mbtp.p[i]; +} + +vpPolygon3D& vpPolygon3D::operator=(const vpPolygon3D& mbtp) +{ + nbpt = mbtp.nbpt; + nbCornersInsidePrev = mbtp.nbCornersInsidePrev; + polyClipped = mbtp.polyClipped; + clippingFlag = mbtp.clippingFlag; + distNearClip = mbtp.distNearClip; + distFarClip = mbtp.distFarClip; + + if (p) delete [] p; + p = new vpPoint [nbpt]; + for(unsigned int i = 0; i < nbpt; i++) + p[i] = mbtp.p[i]; + + return (*this); +} + +/*! + Basic destructor. +*/ +vpPolygon3D::~vpPolygon3D() +{ + if (p !=NULL) + { + delete[] p; + p = NULL; + } +} + +/*! + Get a reference to a corner. + + \throw vpException::dimensionError if the _index is out of range. + + \param _index : the index of the corner +*/ +vpPoint & +vpPolygon3D::getPoint(const unsigned int _index) +{ + if(_index >= nbpt){ + throw vpException(vpException::dimensionError, "index out of range"); + } + return p[_index]; +} + +/*! + Set the number of points which are the corners of the polygon. + + \param nb : The number of corners. +*/ +void +vpPolygon3D::setNbPoint(const unsigned int nb) +{ + nbpt = nb ; + if (p != NULL) + delete[] p; + p = new vpPoint[nb] ; +} + +/*! + Add a corner point to the list of polygon's corners. + + \param n : The index of the corner. + \param P : The point to add. +*/ +void +vpPolygon3D::addPoint(const unsigned int n, const vpPoint &P) +{ + //if( p!NULL && n < nbpt ) + p[n] = P ; +} + +/*! + Project the 3D corner points into the image thanks to the pose of the camera. + + \param cMo : The pose of the camera. +*/ +void +vpPolygon3D::changeFrame(const vpHomogeneousMatrix &cMo) +{ + for (unsigned int i = 0 ; i < nbpt ; i++) + { + p[i].changeFrame(cMo) ; + p[i].projection() ; + } +} + +/*! + Compute the region of interest in the image according to the used clipping. + + \warning If the FOV clipping is used, camera normals have to be precomputed. + + \param cam : camera parameters used to compute the field of view. +*/ +void +vpPolygon3D::computePolygonClipped(const vpCameraParameters &cam) +{ + polyClipped.clear(); + std::vector<vpColVector> fovNormals; + std::vector<std::pair<vpPoint,unsigned int> > polyClippedTemp; + std::vector<std::pair<vpPoint,unsigned int> > polyClippedTemp2; + + if(cam.isFovComputed() && clippingFlag > 3) + fovNormals = cam.getFovNormals(); + + for(unsigned int i = 0 ; i < nbpt ; i++){ + p[i%nbpt].projection(); + polyClippedTemp.push_back(std::make_pair(p[i%nbpt],vpPolygon3D::NO_CLIPPING)); + } + + if(clippingFlag != vpPolygon3D::NO_CLIPPING) + for(unsigned int i = 1 ; i < 64 ; i=i*2) + { + if(((clippingFlag & i) == i) || ((clippingFlag > vpPolygon3D::FAR_CLIPPING) && (i==1))) + { + for(unsigned int j = 0 ; j < polyClippedTemp.size() ; j++) + { + vpPoint p1Clipped = polyClippedTemp[j].first; + vpPoint p2Clipped = polyClippedTemp[(j+1)%polyClippedTemp.size()].first; + + unsigned int p2ClippedInfoBefore = polyClippedTemp[(j+1)%polyClippedTemp.size()].second; + unsigned int p1ClippedInfo = polyClippedTemp[j].second; + unsigned int p2ClippedInfo = polyClippedTemp[(j+1)%polyClippedTemp.size()].second; + + bool problem = true; + + switch(i){ + case 1: + problem = !(vpPolygon3D::getClippedPointsDistance(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, + i, distNearClip)); + break; + case 2: + problem = !(vpPolygon3D::getClippedPointsDistance(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, + i, distFarClip)); + break; + case 4: + problem = !(vpPolygon3D::getClippedPointsFovGeneric(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, + fovNormals[0], vpPolygon3D::LEFT_CLIPPING)); + break; + case 8: + problem = !(vpPolygon3D::getClippedPointsFovGeneric(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, + fovNormals[1], vpPolygon3D::RIGHT_CLIPPING)); + break; + case 16: + problem = !(vpPolygon3D::getClippedPointsFovGeneric(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, + fovNormals[2], vpPolygon3D::UP_CLIPPING)); + break; + case 32: + problem = !(vpPolygon3D::getClippedPointsFovGeneric(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, + fovNormals[3], vpPolygon3D::DOWN_CLIPPING)); + break; + } + + if(!problem) + { + p1Clipped.projection(); + polyClippedTemp2.push_back(std::make_pair(p1Clipped, p1ClippedInfo)); + + if(p2ClippedInfo != p2ClippedInfoBefore) + { + p2Clipped.projection(); + polyClippedTemp2.push_back(std::make_pair(p2Clipped, p2ClippedInfo)); + } + + if(nbpt == 2){ + if(p2ClippedInfo == p2ClippedInfoBefore) + { + p2Clipped.projection(); + polyClippedTemp2.push_back(std::make_pair(p2Clipped, p2ClippedInfo)); + } + break; + } + } + } + + polyClippedTemp = polyClippedTemp2; + polyClippedTemp2.clear(); + } + } + + polyClipped = polyClippedTemp; +} + +/*! + Get the clipped points according to a plane equation. + + \param cam : camera parameters + \param p1 : First extremity of the line. + \param p2 : Second extremity of the line. + \param p1Clipped : Resulting p1. + \param p2Clipped : Resulting p2. + \param p1ClippedInfo : Resulting clipping flag for p1. + \param p2ClippedInfo : Resulting clipping flag for p2. + \param A : Param A from plane equation. + \param B : Param B from plane equation. + \param C : Param C from plane equation. + \param D : Param D from plane equation. + \param flag : flag specifying the clipping used when calling this function. + + \return True if the points have been clipped, False otherwise +*/ +bool +vpPolygon3D::getClippedPointsFovGeneric(const vpPoint &p1, const vpPoint &p2, + vpPoint &p1Clipped, vpPoint &p2Clipped, + unsigned int &p1ClippedInfo, unsigned int &p2ClippedInfo, + const vpColVector &normal, const unsigned int &flag) +{ + vpRowVector p1Vec(3); + p1Vec[0] = p1.get_X(); p1Vec[1] = p1.get_Y(); p1Vec[2] = p1.get_Z(); + p1Vec = p1Vec.normalize(); + + vpRowVector p2Vec(3); + p2Vec[0] = p2.get_X(); p2Vec[1] = p2.get_Y(); p2Vec[2] = p2.get_Z(); + p2Vec = p2Vec.normalize(); + + if((clippingFlag & flag) == flag){ + double beta1 = acos( p1Vec * normal ); + double beta2 = acos( p2Vec * normal ); + +// std::cout << beta1 << " && " << beta2 << std::endl; + + // if(!(beta1 < M_PI / 2.0 && beta2 < M_PI / 2.0)) + if(beta1 < M_PI / 2.0 && beta2 < M_PI / 2.0) + return false; + else if (beta1 < M_PI / 2.0 || beta2 < M_PI / 2.0){ + vpPoint pClipped; + double t = -(normal[0] * p1.get_X() + normal[1] * p1.get_Y() + normal[2] * p1.get_Z()); + t = t / ( normal[0] * (p2.get_X() - p1.get_X()) + normal[1] * (p2.get_Y() - p1.get_Y()) + normal[2] * (p2.get_Z() - p1.get_Z()) ); + + pClipped.set_X((p2.get_X() - p1.get_X())*t + p1.get_X()); + pClipped.set_Y((p2.get_Y() - p1.get_Y())*t + p1.get_Y()); + pClipped.set_Z((p2.get_Z() - p1.get_Z())*t + p1.get_Z()); + + if(beta1 < M_PI / 2.0){ + p1ClippedInfo = p1ClippedInfo | flag; + p1Clipped = pClipped; + } + else{ + p2ClippedInfo = p2ClippedInfo | flag; + p2Clipped = pClipped; + } + } + } + + return true; +} + +bool +vpPolygon3D::getClippedPointsDistance(const vpPoint &p1, const vpPoint &p2, + vpPoint &p1Clipped, vpPoint &p2Clipped, + unsigned int &p1ClippedInfo, unsigned int &p2ClippedInfo, + const unsigned int &flag, const double &distance) +{ + // Since p1 and p1Clipped can be the same object as well as p2 and p2Clipped + // to avoid a valgrind "Source and destination overlap in memcpy" error, + // we introduce a two temporary points. + vpPoint p1Clipped_, p2Clipped_; + p1Clipped_ = p1; + p2Clipped_ = p2; + + p1Clipped = p1Clipped_; + p2Clipped = p2Clipped_; + + + bool test1 = (p1Clipped.get_Z() < distance && p2Clipped.get_Z() < distance); + if(flag == vpPolygon3D::FAR_CLIPPING) + test1 = (p1Clipped.get_Z() > distance && p2Clipped.get_Z() > distance); + + bool test2 = (p1Clipped.get_Z() < distance || p2Clipped.get_Z() < distance); + if(flag == vpPolygon3D::FAR_CLIPPING) + test2 = (p1Clipped.get_Z() > distance || p2Clipped.get_Z() > distance); + + bool test3 = (p1Clipped.get_Z() < distance); + if(flag == vpPolygon3D::FAR_CLIPPING) + test3 = (p1Clipped.get_Z() > distance); + + if(test1) + return false; + + else if(test2){ + vpPoint pClippedNear; + double t; + t = (p2Clipped.get_Z() - p1Clipped.get_Z()); + t = (distance - p1Clipped.get_Z()) / t; + + pClippedNear.set_X((p2Clipped.get_X() - p1Clipped.get_X())*t + p1Clipped.get_X()); + pClippedNear.set_Y((p2Clipped.get_Y() - p1Clipped.get_Y())*t + p1Clipped.get_Y()); + pClippedNear.set_Z(distance); + + if(test3){ + p1Clipped = pClippedNear; + if(flag == vpPolygon3D::FAR_CLIPPING) + p1ClippedInfo = p1ClippedInfo | vpPolygon3D::FAR_CLIPPING; + else + p1ClippedInfo = p1ClippedInfo | vpPolygon3D::NEAR_CLIPPING; + } + else{ + p2Clipped = pClippedNear; + if(flag == vpPolygon3D::FAR_CLIPPING) + p2ClippedInfo = p2ClippedInfo | vpPolygon3D::FAR_CLIPPING; + else + p2ClippedInfo = p2ClippedInfo | vpPolygon3D::NEAR_CLIPPING; + } + } + + return true; +} + +/*! + Get the region of interest in the image. + + \warning Suppose that changeFrame() has already been called. + + \param cam : camera parameters. + + \return Image point corresponding to the region of interest. +*/ +std::vector<vpImagePoint> +vpPolygon3D::getRoi(const vpCameraParameters &cam) +{ + std::vector<vpImagePoint> roi; + for (unsigned int i = 0; i < nbpt; i ++){ + vpImagePoint ip; + vpMeterPixelConversion::convertPoint(cam, p[i].get_x(), p[i].get_y(), ip); + roi.push_back(ip); + } + + return roi; +} + +/*! + Get the region of interest in the image. + + \param cam : camera parameters. + \param cMo : pose. + + \return Image point corresponding to the region of interest. +*/ +std::vector<vpImagePoint> +vpPolygon3D::getRoi(const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo) +{ + changeFrame(cMo); + return getRoi(cam); +} + +#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS +/*! + Get the 3D points of the clipped region of interest. + + \warning Suppose that changeFrame() and computePolygonClipped() have already been called. + + \param points : resulting points. +*/ +void +vpPolygon3D::getRoiClipped(std::vector<vpPoint> &points) +{ + for(unsigned int i = 0 ; i < polyClipped.size() ; i++){ + points.push_back(polyClipped[i].first); + } +} +#endif + +/*! + Get the 3D clipped points and their clipping information. + + \warning Suppose that changeFrame() and computePolygonClipped() have already been called. + + \param poly : resulting points plus clipping information. +*/ +void +vpPolygon3D::getPolygonClipped(std::vector<std::pair<vpPoint,unsigned int> > &poly) +{ + poly = polyClipped; +} + +/*! + Get the 3D clipped points. + + \warning Suppose that changeFrame() and computePolygonClipped() have already been called. + + \param poly : resulting points. +*/ +void +vpPolygon3D::getPolygonClipped(std::vector<vpPoint> &poly) +{ + for(unsigned int i = 0 ; i < polyClipped.size() ; i++){ + poly.push_back(polyClipped[i].first); + } +} + +/*! + Get the region of interest clipped in the image. + + \warning Suppose that changeFrame() and computePolygonClipped() have already been called. + + \param cam : camera parameters. + \param roi : image point corresponding to the region of interest. +*/ +void +vpPolygon3D::getRoiClipped(const vpCameraParameters &cam, std::vector<vpImagePoint> &roi) +{ + for(unsigned int i = 0 ; i < polyClipped.size() ; i++){ + vpImagePoint ip; + vpMeterPixelConversion::convertPoint(cam,polyClipped[i].first.get_x(),polyClipped[i].first.get_y(),ip); +// std::cout << "## " << ip.get_j() << " - " << ip.get_i() << std::endl; + roi.push_back(ip); + } +} + +/*! + Get the region of interest clipped in the image. + + \param cam : camera parameters. + \param cMo : pose. + \param roi : image point corresponding to the region of interest. +*/ +void +vpPolygon3D::getRoiClipped(const vpCameraParameters &cam, std::vector<vpImagePoint> &roi, const vpHomogeneousMatrix &cMo) +{ + changeFrame(cMo); + computePolygonClipped(cam); + getRoiClipped(cam, roi); +} + +/*! + Get the region of interest clipped in the image and the information to know if it's a clipped point. + + \warning Suppose that changeFrame() and computePolygonClipped() have already been called. + + \param cam : camera parameters. + \param roi : image point corresponding to the region of interest with clipping information. +*/ +void +vpPolygon3D::getRoiClipped(const vpCameraParameters &cam, std::vector<std::pair<vpImagePoint,unsigned int> > &roi) +{ + for(unsigned int i = 0 ; i < polyClipped.size() ; i++){ + vpImagePoint ip; + polyClipped[i].first.projection(); + vpMeterPixelConversion::convertPoint(cam,polyClipped[i].first.get_x(),polyClipped[i].first.get_y(),ip); + roi.push_back(std::make_pair(ip, polyClipped[i].second)); + } +} + +/*! + Get the region of interest clipped in the image and the information to know if it's a clipped point. + + \param cam : camera parameters. + \param roi : image point corresponding to the region of interest with clipping information. + \param cMo : pose. +*/ +void +vpPolygon3D::getRoiClipped(const vpCameraParameters &cam, std::vector<std::pair<vpImagePoint,unsigned int> > &roi, const vpHomogeneousMatrix &cMo) +{ + changeFrame(cMo); + computePolygonClipped(cam); + getRoiClipped(cam, roi); +} + + + +/*! + Static method to check the number of points of a region defined by the vector of image point that are inside the image. + + \param I : The image used for its size. + \param cam : The camera parameters. +*/ +unsigned int +vpPolygon3D::getNbCornerInsideImage(const vpImage<unsigned char>& I, const vpCameraParameters &cam) +{ + unsigned int nbPolyIn = 0; + for (unsigned int i = 0; i < nbpt; i ++){ + if(p[i].get_Z() > 0){ + vpImagePoint ip; + vpMeterPixelConversion::convertPoint(cam, p[i].get_x(), p[i].get_y(), ip); + if((ip.get_i() >= 0) && (ip.get_j() >= 0) && (ip.get_i() < I.getHeight()) && (ip.get_j() < I.getWidth())) + nbPolyIn++; + } + } + + nbCornersInsidePrev = nbPolyIn; + + return nbPolyIn; +} + +//################################### +// Static functions +//################################### + +/*! + Static method to compute the clipped points from a set of initial points. + + \warning When using FOV clipping and personnal camera parameters, camera normals have to be computed before (see vpCameraParameters::computeFov()) + + \param ptIn : Input points + \param ptOut : Output points (result of the clipping). + \param cMo : Pose considered for the clipping. + \param clippingFlags: Clipping flag (see vpPolygon3D::vpPolygon3DClippingType). + \param cam : Camera parameters (Only used if clipping flags contain FOV clipping). + \param znear : Near clipping distance value (Only used if clipping flags contain Near clipping). + \param zfar : Far clipping distance value (Only used if clipping flags contain Far clipping). +*/ +void +vpPolygon3D::getClippedPolygon(const std::vector<vpPoint> &ptIn, std::vector<vpPoint> &ptOut, const vpHomogeneousMatrix &cMo, const unsigned int &clippingFlags, + const vpCameraParameters &cam, const double &znear, const double &zfar) +{ + ptOut.clear(); + vpPolygon3D poly; + poly.setNbPoint((unsigned int)ptIn.size()); + poly.setClipping(clippingFlags); + + if((clippingFlags & vpPolygon3D::NEAR_CLIPPING) == vpPolygon3D::NEAR_CLIPPING) + poly.setNearClippingDistance(znear); + + if((clippingFlags & vpPolygon3D::FAR_CLIPPING) == vpPolygon3D::FAR_CLIPPING) + poly.setFarClippingDistance(zfar); + + for(unsigned int i = 0; i < ptIn.size(); i++) + poly.addPoint(i,ptIn[i]); + + poly.changeFrame(cMo); + poly.computePolygonClipped(cam); + poly.getPolygonClipped(ptOut); +} + +void +vpPolygon3D::getMinMaxRoi(const std::vector<vpImagePoint> &iroi, int & i_min, int &i_max, int &j_min, int &j_max) +{ + // i_min_d = std::numeric_limits<double>::max(); // create an error under Windows. To fix it we have to add #undef max + double i_min_d = (double) INT_MAX; + double i_max_d = 0; + double j_min_d = (double) INT_MAX; + double j_max_d = 0; + + for (unsigned int i = 0; i < iroi.size(); i += 1){ + if(i_min_d > iroi[i].get_i()) + i_min_d = iroi[i].get_i(); + + if(iroi[i].get_i() < 0) + i_min_d = 1; + + if((iroi[i].get_i() > 0) && (i_max_d < iroi[i].get_i())) + i_max_d = iroi[i].get_i(); + + if(j_min_d > iroi[i].get_j()) + j_min_d = iroi[i].get_j(); + + if(iroi[i].get_j() < 0) + j_min_d = 1;//border + + if((iroi[i].get_j() > 0) && j_max_d < iroi[i].get_j()) + j_max_d = iroi[i].get_j(); + } + i_min = static_cast<int> (i_min_d); + i_max = static_cast<int> (i_max_d); + j_min = static_cast<int> (j_min_d); + j_max = static_cast<int> (j_max_d); +} + +/*! + Static method to check whether the region defined by the vector of image point + is contained entirely in the image. + + \param I : The image used for its size. + \param corners : The vector of points defining a region +*/ +bool +vpPolygon3D::roiInsideImage(const vpImage<unsigned char>& I, const std::vector<vpImagePoint>& corners) +{ + double nbPolyIn = 0; + for(unsigned int i=0; i<corners.size(); ++i){ + if((corners[i].get_i() >= 0) && (corners[i].get_j() >= 0) && + (corners[i].get_i() < I.getHeight()) && (corners[i].get_j() < I.getWidth())){ + nbPolyIn++; + } + } + + if(nbPolyIn < 3 && nbPolyIn < 0.7 * corners.size()) + return false; + + return true; +} diff --git a/src/tools/geometry/vpRect.cpp b/modules/core/src/tools/geometry/vpRect.cpp old mode 100755 new mode 100644 similarity index 93% rename from src/tools/geometry/vpRect.cpp rename to modules/core/src/tools/geometry/vpRect.cpp index 1dba245ec789388ea5fb282078783c8b6fe69676..2b7ea31d61c1f022e99ab3973f89204fad330386 --- a/src/tools/geometry/vpRect.cpp +++ b/modules/core/src/tools/geometry/vpRect.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRect.cpp 4917 2014-10-06 08:35:22Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Defines a rectangle in the plane. * @@ -46,8 +42,8 @@ */ -#include <visp/vpRect.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpRect.h> +#include <visp3/core/vpDebug.h> /*! diff --git a/src/tools/geometry/vpTriangle.cpp b/modules/core/src/tools/geometry/vpTriangle.cpp similarity index 91% rename from src/tools/geometry/vpTriangle.cpp rename to modules/core/src/tools/geometry/vpTriangle.cpp index 891037145b9fccd86fedb9966390f7f4105ce0c6..03026ce62a6f87391167a3b2cab5092f2971dfdd 100644 --- a/src/tools/geometry/vpTriangle.cpp +++ b/modules/core/src/tools/geometry/vpTriangle.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpTriangle.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Defines a 2D triangle. * @@ -40,8 +36,8 @@ * *****************************************************************************/ -#include <visp/vpTriangle.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpTriangle.h> +#include <visp3/core/vpDebug.h> /*! Basic constructor. diff --git a/src/tools/histogram/vpHistogram.cpp b/modules/core/src/tools/histogram/vpHistogram.cpp similarity index 79% rename from src/tools/histogram/vpHistogram.cpp rename to modules/core/src/tools/histogram/vpHistogram.cpp index b45b37ac28ffabb6dd1908527d17a6d1894ab357..aacdc33252d84a27084feab6885e03e6ad754eb3 100644 --- a/src/tools/histogram/vpHistogram.cpp +++ b/modules/core/src/tools/histogram/vpHistogram.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHistogram.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Gray level histogram manipulation. * @@ -48,8 +44,11 @@ */ -#include <visp/vpHistogram.h> #include <stdlib.h> +#include <visp3/core/vpHistogram.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpDisplay.h> + bool compare_vpHistogramPeak (vpHistogramPeak first, vpHistogramPeak second); @@ -156,17 +155,85 @@ vpHistogram::init(unsigned size_) Calculate the histogram from a gray level image. \param I : Gray level image. - + \param nbins : Number of bins to compute the histogram. */ -void vpHistogram::calculate(const vpImage<unsigned char> &I) +void vpHistogram::calculate(const vpImage<unsigned char> &I, const unsigned int nbins) { + if(size != nbins) { + if (histogram != NULL) { + delete [] histogram; + histogram = NULL; + } + + size = nbins > 256 ? 256 : (nbins > 0 ? nbins : 256); + if(nbins > 256 || nbins == 0) { + std::cerr << "nbins=" << nbins << " , nbins should be between ]0 ; 256] ; use by default nbins=256" << std::endl; + } + histogram = new unsigned int[size]; + } + memset(histogram, 0, size * sizeof(unsigned)); - for (unsigned i=0; i < I.getHeight(); i ++) { - for (unsigned j=0; j < I.getWidth(); j ++) { - histogram[ I[i][j] ] ++; + unsigned int lut[256]; + for(unsigned int i = 0; i < 256; i++) { + lut[i] = (unsigned int) (i * size / 256.0); + } + + unsigned int size_ = I.getWidth()*I.getHeight(); + unsigned char *ptrStart = (unsigned char*) I.bitmap; + unsigned char *ptrEnd = ptrStart + size_; + unsigned char *ptrCurrent = ptrStart; + + while(ptrCurrent != ptrEnd) { + histogram[ lut[ *ptrCurrent ] ] ++; + ++ptrCurrent; + } +} + +/*! + Display the histogram distribution in an image, the minimal image size is 36x36 px. + + \param I : Image with the histogram distribution displayed. + \param color : Color used for the display. + \param thickness : Thickness of the line. + \param maxValue_ : Maximum value in the histogram, if 0 it will be computed from the current histogram. + Useful to plot a 3 channels histogram for a RGB image for example to keep a coherent vertical scale between the channels. +*/ +void vpHistogram::display(const vpImage<unsigned char> &I, const vpColor &color, const unsigned int thickness, + const unsigned int maxValue_) { + unsigned int width = I.getWidth(), height = I.getHeight(); + //Minimal width and height are 36 px + if(width < 36 || height < 36) { + std::cerr << "Image I must have at least width >= 36 && height >= 36 !" << std::endl; + return; + } + + unsigned int maxValue = maxValue_; + if(maxValue == 0) { + for(unsigned int i = 0; i < size; i++) { + if(histogram[i] > maxValue) { + maxValue = histogram[i]; + } } } + + if (maxValue == 0) { + throw(vpException(vpException::divideByZeroError, + "Cannot display histogram; max value=0")); + } + //Keep 12 free pixels at the top + unsigned int max_height = height-12; + double ratio_height = max_height / (double) maxValue; + double ratio_width = (width-1) / (double) (size-1.0); + + for(unsigned int i = 1; i < size; i++) { + unsigned int value1 = histogram[i-1]; + unsigned int value2 = histogram[i]; + + vpImagePoint startPt((height-1)-(value1*ratio_height), (i-1)*ratio_width); + vpImagePoint endPt((height-1)-(value2*ratio_height), (i*ratio_width)); + vpDisplay::displayLine(I, startPt, endPt, color, thickness); + } } /*! @@ -902,223 +969,6 @@ vpHistogram::write(const char *filename) return true; } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - - \deprecated This method is deprecated. You should use getPeaks(std::list<vpHistogramPeak> &) instead. - - Build a list of all histogram peaks. This peak list is gray level - sorted from 0 to 255. That mean that the first peak has a gray level - less than the second one, etc. - - To sort this list from highest peak value to the lowest one, you can - use sort(). - - \param peaks : List of peaks. - \return The number of peaks in the histogram. - - \sa sort() -*/ -unsigned vpHistogram::getPeaks(vpList<vpHistogramPeak> & peaks) -{ - if (histogram == NULL) { - vpERROR_TRACE("Histogram array not initialised\n"); - throw (vpImageException(vpImageException::notInitializedError, - "Histogram array not initialised")) ; - } - - int prev_slope; // Previous histogram inclination - int next_slope; // Next histogram inclination - vpHistogramPeak p; // An histogram peak - unsigned nbpeaks; // Number of peaks in the histogram (ie local maxima) - - if ( ! peaks.empty() ) - peaks.kill(); - - peaks.front(); - - // Parse the histogram to get the local maxima - unsigned cpt = 0; - unsigned sum_level = 0; - nbpeaks = 0; - prev_slope = 1; - - for (unsigned i = 0; i < size-1; i++) { - next_slope = (int)histogram[i+1] - (int)histogram[i]; - -// if ((prev_slope < 0) && (next_slope > 0) ) { -// sum_level += i; -// cpt ++; -// continue; -// } - - if ((prev_slope > 0) && (next_slope == 0) ) { - sum_level += i + 1; - cpt ++; - continue; - } - - - // Peak detection - if ( (prev_slope > 0) && (next_slope < 0) ) { - sum_level += i; - cpt ++; - - unsigned int level = sum_level / cpt; - p.set((unsigned char)level, histogram[level]); - // vpTRACE("add %d %d", p.getLevel(), p.getValue()); - peaks.addRight(p); - - nbpeaks ++; - - } - - prev_slope = next_slope; - sum_level = 0; - cpt = 0; - } - if (prev_slope > 0) { - p.set((unsigned char)size-1u, histogram[size-1]); - // vpTRACE("add %d %d", p.getLevel(), p.getValue()); - peaks.addRight(p); - nbpeaks ++; - } - - return nbpeaks; -} - -/*! - - \deprecated This method is deprecated. You should use getValey(std::list<vpHistogramValey> &) instead. - - Build a list of all histogram valey. This valey list is gray level - sorted from 0 to 255. That mean that the first valey has a gray level - less than the second one, etc. - - \param valey : List of valey. - \return The number of valey in the histogram. - - \sa sort() -*/ -unsigned vpHistogram::getValey(vpList<vpHistogramValey> & valey) -{ - if (histogram == NULL) { - vpERROR_TRACE("Histogram array not initialised\n"); - throw (vpImageException(vpImageException::notInitializedError, - "Histogram array not initialised")) ; - } - - int prev_slope; // Previous histogram inclination - int next_slope; // Next histogram inclination - vpHistogramValey p; // An histogram valey - unsigned nbvaley; // Number of valey in the histogram (ie local minima) - - if ( ! valey.empty() ) - valey.kill(); - - valey.front(); - - // Parse the histogram to get the local minima - unsigned cpt = 0; - unsigned sum_level = 0; - nbvaley = 0; - prev_slope = -1; - - for (unsigned i = 0; i < size-1; i++) { - next_slope = (int)histogram[i+1] - (int)histogram[i]; - - if ((prev_slope < 0) && (next_slope == 0) ) { - sum_level += i + 1; - cpt ++; - continue; - } - - // Valey detection - if ( (prev_slope < 0) && (next_slope > 0) ) { - sum_level += i; - cpt ++; - - unsigned int level = sum_level / cpt; - p.set((unsigned char)level, histogram[level]); - // vpTRACE("add %d %d", p.getLevel(), p.getValue()); - valey.addRight(p); - - nbvaley ++; - - } - - prev_slope = next_slope; - sum_level = 0; - cpt = 0; - } - if (prev_slope < 0) { - p.set((unsigned char)size-1u, histogram[size-1]); - // vpTRACE("add %d %d", p.getLevel(), p.getValue()); - valey.addRight(p); - nbvaley ++; - } - - return nbvaley; -} - -/*! - \deprecated This method is deprecated. You should use sort(std::list<vpHistogramPeak> &) instead. - - Sort a list of histogram peaks from highest to the lowest. - - \param peaks : List of histogram peaks. - \return The number of peaks in the histogram. - - \sa getPeak() -*/ -unsigned vpHistogram::sort(vpList<vpHistogramPeak> & peaks) -{ - - vpList<vpHistogramPeak> _peaks; - vpHistogramPeak p, _p; // A peak - unsigned nbpeaks = 0; - - if ( peaks.empty() ) { - nbpeaks = 0; - return nbpeaks; - } - - _peaks = peaks; - peaks.kill(); // erase the output list - // Sort the list of peaks from highest to the lowest - peaks.front(); - _p = _peaks.value(); - // Add first value in the list - peaks.addRight(_p); - nbpeaks ++; - // parse the rest of the list - _peaks.next(); - while (! _peaks.outside() ) { - _p = _peaks.value(); - peaks.front(); - while (! peaks.outside() ) { - p = peaks.value(); - if (_p.getValue() > p.getValue()) { - peaks.addLeft(_p); - nbpeaks ++; - break; - } - if( peaks.nextOutside()) { - peaks.addRight(_p); - nbpeaks ++; - break; - } - - peaks.next(); - } - - _peaks.next(); - } - return nbpeaks; -} - -#endif // VISP_BUILD_DEPRECATED_FUNCTIONS - /* * Local variables: * c-basic-offset: 2 diff --git a/src/tools/histogram/vpHistogramPeak.cpp b/modules/core/src/tools/histogram/vpHistogramPeak.cpp similarity index 85% rename from src/tools/histogram/vpHistogramPeak.cpp rename to modules/core/src/tools/histogram/vpHistogramPeak.cpp index e7d22268ed8432864fa35756681e42ce261988ee..13050003d8f05b2bfdbf4525f074fbf9c48b3792 100644 --- a/src/tools/histogram/vpHistogramPeak.cpp +++ b/modules/core/src/tools/histogram/vpHistogramPeak.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHistogramPeak.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Gray level histogram manipulation. * @@ -46,7 +42,7 @@ */ -#include <visp/vpHistogramPeak.h> +#include <visp3/core/vpHistogramPeak.h> /*! diff --git a/src/tools/histogram/vpHistogramValey.cpp b/modules/core/src/tools/histogram/vpHistogramValey.cpp similarity index 82% rename from src/tools/histogram/vpHistogramValey.cpp rename to modules/core/src/tools/histogram/vpHistogramValey.cpp index cfffac76fd7a6d8e0ff09ed0cdadd5e02174a934..78fd3f8b89f2710217a41848cc555339d446935c 100644 --- a/src/tools/histogram/vpHistogramValey.cpp +++ b/modules/core/src/tools/histogram/vpHistogramValey.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHistogramValey.cpp 4620 2014-01-27 21:28:32Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Gray level histogram manipulation. * @@ -46,7 +42,7 @@ */ -#include <visp/vpHistogramValey.h> +#include <visp3/core/vpHistogramValey.h> /*! diff --git a/src/network/CMakeLists.txt b/modules/core/src/tools/network/CMakeLists.txt similarity index 100% rename from src/network/CMakeLists.txt rename to modules/core/src/tools/network/CMakeLists.txt diff --git a/src/network/vpClient.cpp b/modules/core/src/tools/network/vpClient.cpp similarity index 94% rename from src/network/vpClient.cpp rename to modules/core/src/tools/network/vpClient.cpp index 66e5e2a304c982bb0598bfe920856a349e4ab9e0..9ca5a87515a35ee8c9344acbc17f0844283ff6d2 100644 --- a/src/network/vpClient.cpp +++ b/modules/core/src/tools/network/vpClient.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpClient.cpp 4661 2014-02-10 19:34:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * TCP Client * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpClient.h> +#include <visp3/core/vpClient.h> vpClient::vpClient() : vpNetwork(), numberOfAttempts(0) diff --git a/src/network/vpNetwork.cpp b/modules/core/src/tools/network/vpNetwork.cpp similarity index 95% rename from src/network/vpNetwork.cpp rename to modules/core/src/tools/network/vpNetwork.cpp index 459e6e5c203502d272df85de9ba73c912c9bb977..98685eb90f2b57fd75f15749bdec842fbf6363a6 100644 --- a/src/network/vpNetwork.cpp +++ b/modules/core/src/tools/network/vpNetwork.cpp @@ -1,793 +1,789 @@ -/**************************************************************************** - * - * $Id: vpNetwork.cpp 4794 2014-07-21 17:43:22Z ayol $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * TCP Network - * - * Authors: - * Aurelien Yol - * - *****************************************************************************/ - - -#include <visp/vpNetwork.h> - -vpNetwork::vpNetwork() - : emitter(), receptor_list(), readFileDescriptor(), socketMax(0), request_list(), - max_size_message(999999), separator("[*@*]"), beginning("[*start*]"), end("[*end*]"), - param_sep("[*|*]"), currentMessageReceived(), tv(), tv_sec(0), tv_usec(10), - verboseMode(false) -{ - tv.tv_sec = tv_sec; - tv.tv_usec = tv_usec; - -#if defined(_WIN32) - //Enable the sockets to be used - //Note that: if we were using "winsock.h" instead of "winsock2.h" we would had to use: - //WSAStartup(MAKEWORD(1,0), &WSAData); - WSADATA WSAData; - WSAStartup(MAKEWORD(2,0), &WSAData); -#endif -} - -vpNetwork::~vpNetwork() -{ -#if defined(_WIN32) - WSACleanup(); -#endif -} - -/*! - Add a decoding request to the emitter. This request will be used to decode the received messages. - Each request must have a different id. - - \warning vpRequest is a virtual pure class. It has to be implemented according to the way how you want - to decode the message received. - - \sa vpNetwork::removeDecodingRequest() - - \param req : Request to add. -*/ -void vpNetwork::addDecodingRequest(vpRequest *req) -{ - bool alreadyHas = false; - - for(unsigned int i = 0 ; i < request_list.size() ; i++) - if(request_list[i]->getId() == req->getId()){ - alreadyHas = true; - break; - } - - if(alreadyHas) - std::cout << "Server already has one request with the similar ID. Request hasn't been added." << std::endl; - else - request_list.push_back(req); -} - -/*! - Delete a decoding request from the emitter. - - \sa vpNetwork::addDecodingRequest() - - \param id : Id of the request to delete. -*/ -void vpNetwork::removeDecodingRequest(const char *id) -{ - for(unsigned int i = 0 ; i < request_list.size() ; i++) - { - if(request_list[i]->getId() == id) - { - request_list.erase(request_list.begin()+(int)i); - break; - } - } -} - -/*! - Print the receptors. - - \param id : Message to display before the receptor's index. -*/ -void vpNetwork::print(const char *id) -{ - for(unsigned int i = 0 ; i < receptor_list.size() ; i++) - { - std::cout << id << i << " : " << inet_ntoa(receptor_list[i].receptorAddress.sin_addr) << std::endl; - } -} - -/*! - Get the receptor index from its name. The name can be either the IP, or its name on the network. - - \param name : Name of the receptor. - - \return Index of the receptor, or -1 if an error occurs. -*/ -int vpNetwork::getReceptorIndex(const char *name) -{ - struct hostent *server = gethostbyname(name); - - if ( server == NULL ) - { - std::string noSuchHostMessage( "ERROR, " ); - noSuchHostMessage.append( name ); - noSuchHostMessage.append( ": no such host\n" ); - vpERROR_TRACE( noSuchHostMessage.c_str(), "vpNetwork::getReceptorIndex()" ); - return -1; - } - - std::string ip = inet_ntoa(*(in_addr *)server->h_addr); - - for(int i = 0 ; i < (int)receptor_list.size() ; i++) - { - if(receptor_list[(unsigned)i].receptorIP == ip) - return i; - } - - return -1; -} - -/*! - Send a request to the first receptor in the list. - - \sa vpNetwork::sendRequestTo() - \sa vpNetwork::sendAndEncodeRequest() - \sa vpNetwork::sendAndEncodeRequestTo() - \sa vpNetwork::send() - \sa vpNetwork::sendTo() - - \param req : Request to send. - - \return The number of bytes that have been sent, -1 if an error occured. -*/ -int vpNetwork::sendRequest(vpRequest &req) -{ - return sendRequestTo(req,0); -} - -/*! - Send a request to a specific receptor. - - \sa vpNetwork::sendRequest() - \sa vpNetwork::sendAndEncodeRequest() - \sa vpNetwork::sendAndEncodeRequestTo() - \sa vpNetwork::send() - \sa vpNetwork::sendTo() - - \param req : Request to send. - \param dest : Index of the receptor receiving the request. - - \return The number of bytes that have been sent, -1 if an error occured. -*/ -int vpNetwork::sendRequestTo(vpRequest &req, const unsigned int &dest) -{ - int size = (int)receptor_list.size(); - int sizeMinusOne = (int)receptor_list.size()-1; - if(size == 0 || dest > (unsigned)sizeMinusOne) - { - if(verboseMode) - vpTRACE( "Cannot Send Request! Bad Index" ); - return 0; - } - - std::string message = beginning + req.getId() + separator; - - if(req.size() != 0){ - message += req[0]; - - for(unsigned int i = 1 ; i < req.size() ; i++){ - message += param_sep + req[i]; - } - } - - message += end; - - int flags = 0; -//#if ! defined(APPLE) && ! defined(SOLARIS) && ! defined(_WIN32) -#if defined(__linux__) - flags = MSG_NOSIGNAL; // Only for Linux -#endif - -#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX - int value = sendto(receptor_list[dest].socketFileDescriptorReceptor, message.c_str(), message.size(), flags, - (sockaddr*) &receptor_list[dest].receptorAddress,receptor_list[dest].receptorAddressSize); -#else - int value = sendto((unsigned)receptor_list[dest].socketFileDescriptorReceptor, message.c_str(), (int)message.size(), flags, - (sockaddr*) &receptor_list[dest].receptorAddress,receptor_list[dest].receptorAddressSize); -#endif - - return value; -} - -/*! - Send and encode a request to the first receptor in the list. - - \sa vpNetwork::sendRequestTo() - \sa vpNetwork::sendAndEncodeRequest() - \sa vpNetwork::sendAndEncodeRequestTo() - \sa vpNetwork::send() - \sa vpNetwork::sendTo() - - \param req : Request to send. - - \return The number of bytes that have been sent, -1 if an error occured. -*/ -int vpNetwork::sendAndEncodeRequest(vpRequest &req) -{ - req.encode(); - return sendRequest(req); -} - -/*! - Send and encode a request to a specific receptor. - - \sa vpNetwork::sendRequest() - \sa vpNetwork::sendAndEncodeRequest() - \sa vpNetwork::sendAndEncodeRequestTo() - \sa vpNetwork::send() - \sa vpNetwork::sendTo() - - \param req : Request to send. - \param dest : Index of the receptor receiving the request. - - \return The number of bytes that have been sent, -1 if an error occured. -*/ -int vpNetwork::sendAndEncodeRequestTo(vpRequest &req, const unsigned int &dest) -{ - req.encode(); - return sendRequestTo(req,dest); -} - -/*! - Receive requests untils there is requests to receive. - - \warning Requests will be received but not decoded. - - \sa vpNetwork::receive() - \sa vpNetwork::receiveRequestFrom() - \sa vpNetwork::receiveRequestOnce() - \sa vpNetwork::receiveRequestOnceFrom() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnce() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() -*/ -std::vector<int> vpNetwork::receiveRequest() -{ - _receiveRequest(); - return _handleRequests(); -} - -/*! - Receives requests, from a specific emitter, untils there is request to receive. - - \warning Requests will be received but not decoded. - - \sa vpNetwork::receive() - \sa vpNetwork::receiveRequest() - \sa vpNetwork::receiveRequestOnce() - \sa vpNetwork::receiveRequestOnceFrom() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnce() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() - - \param receptorEmitting : Index of the receptor emitting the message -*/ -std::vector<int> vpNetwork::receiveRequestFrom(const unsigned int &receptorEmitting) -{ - _receiveRequestFrom(receptorEmitting); - return _handleRequests(); -} - -/*! - Receives a message once (in the limit of the Maximum message size value). - This message can represent an entire request or not. Several calls to this function - might be necessary to get the entire request. - - \warning Requests will be received but not decoded. - - \sa vpNetwork::receive() - \sa vpNetwork::receiveRequestFrom() - \sa vpNetwork::receiveRequest() - \sa vpNetwork::receiveRequestOnceFrom() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnce() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() - - \return The number of bytes received, -1 if an error occured. -*/ -int vpNetwork::receiveRequestOnce() -{ - _receiveRequestOnce(); - return _handleFirstRequest(); -} - -/*! - Receives a message once (in the limit of the Maximum message size value), from a specific emitter. - This message can represent an entire request or not. Several calls to this function - might be necessary to get the entire request. - - \warning Requests will be received but not decoded. - - \sa vpNetwork::receive() - \sa vpNetwork::receiveRequestFrom() - \sa vpNetwork::receiveRequest() - \sa vpNetwork::receiveRequestOnce() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnce() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() - - \param receptorEmitting : Index of the receptor emitting the message. - - \return The number of bytes received, -1 if an error occured. -*/ -int vpNetwork::receiveRequestOnceFrom(const unsigned int &receptorEmitting) -{ - _receiveRequestOnceFrom(receptorEmitting); - return _handleFirstRequest(); -} - -/*! - Receives and decode requests untils there is requests to receive. - - \warning Requests will be received but not decoded. - - \sa vpNetwork::receive() - \sa vpNetwork::receiveRequestFrom() - \sa vpNetwork::receiveRequestOnce() - \sa vpNetwork::receiveRequestOnceFrom() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnce() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() -*/ -std::vector<int> vpNetwork::receiveAndDecodeRequest() -{ - std::vector<int> res = receiveRequest(); - for(unsigned int i = 0 ; i < res.size() ; i++) - if(res[i] != -1) - request_list[(unsigned)res[i]]->decode(); - - return res; -} - -/*! - Receives and decode requests, from a specific emitter, untils there is request to receive. - - \warning Requests will be received but not decoded. - - \sa vpNetwork::receive() - \sa vpNetwork::receiveRequest() - \sa vpNetwork::receiveRequestOnce() - \sa vpNetwork::receiveRequestOnceFrom() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnce() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() - - \param receptorEmitting : Index of the receptor emitting the message -*/ -std::vector<int> vpNetwork::receiveAndDecodeRequestFrom(const unsigned int &receptorEmitting) -{ - std::vector<int> res = receiveRequestFrom(receptorEmitting); - for(unsigned int i = 0 ; i < res.size() ; i++) - if(res[i] != -1) - request_list[(unsigned)res[i]]->decode(); - - return res; -} - -/*! - Receives a message once (in the limit of the Maximum message size value). - This message can represent an entire request or not. Several calls to this function - might be necessary to get the entire request. - If it represents an entire request, it decodes the request. - - \warning Requests will be received but not decoded. - - \sa vpNetwork::receive() - \sa vpNetwork::receiveRequestFrom() - \sa vpNetwork::receiveRequest() - \sa vpNetwork::receiveRequestOnceFrom() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnce() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() - - \return The number of bytes received, -1 if an error occured. -*/ -int vpNetwork::receiveAndDecodeRequestOnce() -{ - int res = receiveRequestOnce(); - if(res != -1) - request_list[(unsigned)res]->decode(); - - return res; -} - -/*! - Receives a message once (in the limit of the Maximum message size value), from a specific emitter. - This message can represent an entire request or not. Several calls to this function - might be necessary to get the entire request. - If it represents an entire request, it decodes the request. - - \warning Requests will be received but not decoded. - - \sa vpNetwork::receive() - \sa vpNetwork::receiveRequestFrom() - \sa vpNetwork::receiveRequest() - \sa vpNetwork::receiveRequestOnce() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnce() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() - - \param receptorEmitting : Index of the receptor emitting the message. - - \return The number of bytes received, -1 if an error occured. -*/ -int vpNetwork::receiveAndDecodeRequestOnceFrom(const unsigned int &receptorEmitting) -{ - int res = receiveRequestOnceFrom(receptorEmitting); - if(res != -1) - request_list[(unsigned)res]->decode(); - - return res; -} - - -//######## Definition of Template Functions ######## -//# # -//################################################## - - -/*! - Handle requests until there are requests to handle. - - \warning : This function doesn't decode the requests. If it does handle a request that hasn't been ran yet, - The request's parameters will be replace. - - \sa vpNetwork::handleFirstRequest() - - \return : The list of index corresponding to the requests that have been handled. -*/ -std::vector<int> vpNetwork::_handleRequests() -{ - std::vector<int> resIndex; - int index = _handleFirstRequest(); - - while(index != -1) - { - resIndex.push_back(index); - index = _handleFirstRequest(); - } - - return resIndex; -} - -/*! - Handle the first request in the queue. - - \warning : This function doesn't run the request. If it does handle a request that hasn't been ran yet, - The request's parameters will be replace. - - \sa vpNetwork::handleRequests() - - \return : The index of the request that has been handled. -*/ -int vpNetwork::_handleFirstRequest() -{ - size_t indStart = currentMessageReceived.find(beginning); - size_t indSep = currentMessageReceived.find(separator); - size_t indEnd = currentMessageReceived.find(end); - - if (indStart == std::string::npos && indSep == std::string::npos && indEnd == std::string::npos) - { - if(currentMessageReceived.size() != 0) - currentMessageReceived.clear(); - - if(verboseMode) - vpTRACE("Incorrect message"); - - return -1; - } - - if(indStart == std::string::npos || indSep == std::string::npos || indEnd == std::string::npos) - return -1; - - if(indEnd < indStart) - { - if(verboseMode) - vpTRACE("Incorrect message"); - currentMessageReceived.erase((unsigned)indStart,indEnd+end.size()); - return -1; - } - - size_t indStart2 = currentMessageReceived.find(beginning,indStart+1); - if(indStart2 != std::string::npos && indStart2 < indEnd) - { - if(verboseMode) - vpTRACE("Incorrect message"); - currentMessageReceived.erase((unsigned)indStart,(unsigned)indStart2); - return -1; - } - - size_t deb = indStart + beginning.size(); - std::string id = currentMessageReceived.substr((unsigned)deb, indSep - deb); - - deb = indSep+separator.size(); - std::string params = currentMessageReceived.substr((unsigned)deb, (unsigned)(indEnd - deb)); - -// std::cout << "Handling : " << currentMessageReceived.substr(indStart, indEnd+end.size() - indStart) << std::endl; - - int indRequest = 0; - bool hasBeenFound = false; - for(unsigned int i = 0 ; i < request_list.size() ; i++) - { - if(id == request_list[i]->getId()){ - hasBeenFound = true; - request_list[i]->clear(); - indRequest = (int)i; - break; - } - } - - if(!hasBeenFound){ - //currentMessageReceived.erase(indStart,indEnd+end.size()); - if(verboseMode) - vpTRACE("No request corresponds to the received message"); - return -1; - } - - size_t indDebParam = indSep + separator.size(); - size_t indEndParam = currentMessageReceived.find(param_sep,indDebParam); - - std::string param; - while(indEndParam != std::string::npos || indEndParam < indEnd) - { - param = currentMessageReceived.substr((unsigned)indDebParam,(unsigned)(indEndParam - indDebParam)); - request_list[(unsigned)indRequest]->addParameter(param); - indDebParam = indEndParam+param_sep.size(); - indEndParam = currentMessageReceived.find(param_sep,indDebParam); - } - - param = currentMessageReceived.substr((unsigned)indDebParam, indEnd - indDebParam); - request_list[(unsigned)indRequest]->addParameter(param); - currentMessageReceived.erase(indStart,indEnd+end.size()); - - return indRequest; -} - -/*! - Receive requests untils there is requests to receive. - - \warning Requests will be received but not decoded. - - \sa vpNetwork::receive() - \sa vpNetwork::receiveRequestFrom() - \sa vpNetwork::receiveRequestOnce() - \sa vpNetwork::receiveRequestOnceFrom() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnce() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() -*/ -void vpNetwork::_receiveRequest() -{ - while(_receiveRequestOnce() > 0) {}; -} - -/*! - Receives requests, from a specific emitter, untils there is request to receive. - - \warning Requests will be received but not decoded. - - \sa vpNetwork::receive() - \sa vpNetwork::receiveRequest() - \sa vpNetwork::receiveRequestOnce() - \sa vpNetwork::receiveRequestOnceFrom() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnce() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() - - \param receptorEmitting : Index of the receptor emitting the message -*/ -void vpNetwork::_receiveRequestFrom(const unsigned int &receptorEmitting) -{ - while(_receiveRequestOnceFrom(receptorEmitting) > 0) {}; -} - -/*! - Receives a message once (in the limit of the Maximum message size value). - This message can represent an entire request or not. Several calls to this function - might be necessary to get the entire request. - - \warning Requests will be received but not decoded. - - \sa vpNetwork::receive() - \sa vpNetwork::receiveRequestFrom() - \sa vpNetwork::receiveRequest() - \sa vpNetwork::receiveRequestOnceFrom() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnce() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() - - \return The number of bytes received, -1 if an error occured. -*/ -int vpNetwork::_receiveRequestOnce() -{ - if(receptor_list.size() == 0) - { - if(verboseMode) - vpTRACE( "No Receptor!" ); - return -1; - } - - tv.tv_sec = tv_sec; - tv.tv_usec = tv_usec; - - FD_ZERO(&readFileDescriptor); - - for(unsigned int i=0; i<receptor_list.size(); i++){ - if(i == 0) - socketMax = receptor_list[i].socketFileDescriptorReceptor; - - FD_SET((unsigned)receptor_list[i].socketFileDescriptorReceptor,&readFileDescriptor); - if(socketMax < receptor_list[i].socketFileDescriptorReceptor) socketMax = receptor_list[i].socketFileDescriptorReceptor; - } - - int value = select((int)socketMax+1,&readFileDescriptor,NULL,NULL,&tv); - int numbytes = 0; - - if(value == -1){ - if(verboseMode) - vpERROR_TRACE( "Select error" ); - return -1; - } - else if(value == 0){ - //Timeout - return 0; - } - else{ - for(unsigned int i=0; i<receptor_list.size(); i++){ - if(FD_ISSET((unsigned int)receptor_list[i].socketFileDescriptorReceptor,&readFileDescriptor)){ - char *buf = new char [max_size_message]; -#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX - numbytes=recv(receptor_list[i].socketFileDescriptorReceptor, buf, max_size_message, 0); -#else - numbytes=recv((unsigned int)receptor_list[i].socketFileDescriptorReceptor, buf, (int)max_size_message, 0); -#endif - - if(numbytes <= 0) - { - std::cout << "Disconnected : " << inet_ntoa(receptor_list[i].receptorAddress.sin_addr) << std::endl; - receptor_list.erase(receptor_list.begin()+(int)i); - delete [] buf; - return numbytes; - } - else if(numbytes > 0){ - std::string returnVal(buf, (unsigned int)numbytes); - currentMessageReceived.append(returnVal); - } - delete [] buf; - break; - } - } - } - - return numbytes; -} - -/*! - Receives a message once (in the limit of the Maximum message size value), from a specific emitter. - This message can represent an entire request or not. Several calls to this function - might be necessary to get the entire request. - - \warning Requests will be received but not decoded. - - \sa vpNetwork::receive() - \sa vpNetwork::receiveRequestFrom() - \sa vpNetwork::receiveRequest() - \sa vpNetwork::receiveRequestOnce() - \sa vpNetwork::receiveAndDecodeRequest() - \sa vpNetwork::receiveAndDecodeRequestFrom() - \sa vpNetwork::receiveAndDecodeRequestOnce() - \sa vpNetwork::receiveAndDecodeRequestOnceFrom() - - \param receptorEmitting : Index of the receptor emitting the message. - - \return The number of bytes received, -1 if an error occured. -*/ -int vpNetwork::_receiveRequestOnceFrom(const unsigned int &receptorEmitting) -{ - int size = (int)receptor_list.size(); - int sizeMinusOne = (int)receptor_list.size()-1; - if(size == 0 || receptorEmitting > (unsigned)sizeMinusOne ) - { - if(verboseMode) - vpTRACE( "No receptor at the specified index!" ); - return -1; - } - - tv.tv_sec = tv_sec; - tv.tv_usec = tv_usec; - - FD_ZERO(&readFileDescriptor); - - socketMax = receptor_list[receptorEmitting].socketFileDescriptorReceptor; - FD_SET((unsigned int)receptor_list[receptorEmitting].socketFileDescriptorReceptor,&readFileDescriptor); - - int value = select((int)socketMax+1,&readFileDescriptor,NULL,NULL,&tv); - int numbytes = 0; - if(value == -1){ - if(verboseMode) - vpERROR_TRACE( "Select error" ); - return -1; - } - else if(value == 0){ - //Timeout - return 0; - } - else{ - if(FD_ISSET((unsigned int)receptor_list[receptorEmitting].socketFileDescriptorReceptor,&readFileDescriptor)){ - char *buf = new char [max_size_message]; -#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX - numbytes=recv(receptor_list[receptorEmitting].socketFileDescriptorReceptor, buf, max_size_message, 0); -#else - numbytes=recv((unsigned int)receptor_list[receptorEmitting].socketFileDescriptorReceptor, buf, (int)max_size_message, 0); -#endif - if(numbytes <= 0) - { - std::cout << "Disconnected : " << inet_ntoa(receptor_list[receptorEmitting].receptorAddress.sin_addr) << std::endl; - receptor_list.erase(receptor_list.begin()+(int)receptorEmitting); - delete [] buf; - return numbytes; - } - else if(numbytes > 0){ - std::string returnVal(buf, (unsigned int)numbytes); - currentMessageReceived.append(returnVal); - } - delete [] buf; - } - } - - return numbytes; -} - - - +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * TCP Network + * + * Authors: + * Aurelien Yol + * + *****************************************************************************/ + + +#include <visp3/core/vpNetwork.h> + +vpNetwork::vpNetwork() + : emitter(), receptor_list(), readFileDescriptor(), socketMax(0), request_list(), + max_size_message(999999), separator("[*@*]"), beginning("[*start*]"), end("[*end*]"), + param_sep("[*|*]"), currentMessageReceived(), tv(), tv_sec(0), tv_usec(10), + verboseMode(false) +{ + tv.tv_sec = tv_sec; + tv.tv_usec = tv_usec; + +#if defined(_WIN32) + //Enable the sockets to be used + //Note that: if we were using "winsock.h" instead of "winsock2.h" we would had to use: + //WSAStartup(MAKEWORD(1,0), &WSAData); + WSADATA WSAData; + WSAStartup(MAKEWORD(2,0), &WSAData); +#endif +} + +vpNetwork::~vpNetwork() +{ +#if defined(_WIN32) + WSACleanup(); +#endif +} + +/*! + Add a decoding request to the emitter. This request will be used to decode the received messages. + Each request must have a different id. + + \warning vpRequest is a virtual pure class. It has to be implemented according to the way how you want + to decode the message received. + + \sa vpNetwork::removeDecodingRequest() + + \param req : Request to add. +*/ +void vpNetwork::addDecodingRequest(vpRequest *req) +{ + bool alreadyHas = false; + + for(unsigned int i = 0 ; i < request_list.size() ; i++) + if(request_list[i]->getId() == req->getId()){ + alreadyHas = true; + break; + } + + if(alreadyHas) + std::cout << "Server already has one request with the similar ID. Request hasn't been added." << std::endl; + else + request_list.push_back(req); +} + +/*! + Delete a decoding request from the emitter. + + \sa vpNetwork::addDecodingRequest() + + \param id : Id of the request to delete. +*/ +void vpNetwork::removeDecodingRequest(const char *id) +{ + for(unsigned int i = 0 ; i < request_list.size() ; i++) + { + if(request_list[i]->getId() == id) + { + request_list.erase(request_list.begin()+(int)i); + break; + } + } +} + +/*! + Print the receptors. + + \param id : Message to display before the receptor's index. +*/ +void vpNetwork::print(const char *id) +{ + for(unsigned int i = 0 ; i < receptor_list.size() ; i++) + { + std::cout << id << i << " : " << inet_ntoa(receptor_list[i].receptorAddress.sin_addr) << std::endl; + } +} + +/*! + Get the receptor index from its name. The name can be either the IP, or its name on the network. + + \param name : Name of the receptor. + + \return Index of the receptor, or -1 if an error occurs. +*/ +int vpNetwork::getReceptorIndex(const char *name) +{ + struct hostent *server = gethostbyname(name); + + if ( server == NULL ) + { + std::string noSuchHostMessage( "ERROR, " ); + noSuchHostMessage.append( name ); + noSuchHostMessage.append( ": no such host\n" ); + vpERROR_TRACE( noSuchHostMessage.c_str(), "vpNetwork::getReceptorIndex()" ); + return -1; + } + + std::string ip = inet_ntoa(*(in_addr *)server->h_addr); + + for(int i = 0 ; i < (int)receptor_list.size() ; i++) + { + if(receptor_list[(unsigned)i].receptorIP == ip) + return i; + } + + return -1; +} + +/*! + Send a request to the first receptor in the list. + + \sa vpNetwork::sendRequestTo() + \sa vpNetwork::sendAndEncodeRequest() + \sa vpNetwork::sendAndEncodeRequestTo() + \sa vpNetwork::send() + \sa vpNetwork::sendTo() + + \param req : Request to send. + + \return The number of bytes that have been sent, -1 if an error occured. +*/ +int vpNetwork::sendRequest(vpRequest &req) +{ + return sendRequestTo(req,0); +} + +/*! + Send a request to a specific receptor. + + \sa vpNetwork::sendRequest() + \sa vpNetwork::sendAndEncodeRequest() + \sa vpNetwork::sendAndEncodeRequestTo() + \sa vpNetwork::send() + \sa vpNetwork::sendTo() + + \param req : Request to send. + \param dest : Index of the receptor receiving the request. + + \return The number of bytes that have been sent, -1 if an error occured. +*/ +int vpNetwork::sendRequestTo(vpRequest &req, const unsigned int &dest) +{ + int size = (int)receptor_list.size(); + int sizeMinusOne = (int)receptor_list.size()-1; + if(size == 0 || dest > (unsigned)sizeMinusOne) + { + if(verboseMode) + vpTRACE( "Cannot Send Request! Bad Index" ); + return 0; + } + + std::string message = beginning + req.getId() + separator; + + if(req.size() != 0){ + message += req[0]; + + for(unsigned int i = 1 ; i < req.size() ; i++){ + message += param_sep + req[i]; + } + } + + message += end; + + int flags = 0; +//#if ! defined(APPLE) && ! defined(SOLARIS) && ! defined(_WIN32) +#if defined(__linux__) + flags = MSG_NOSIGNAL; // Only for Linux +#endif + +#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX + int value = sendto(receptor_list[dest].socketFileDescriptorReceptor, message.c_str(), message.size(), flags, + (sockaddr*) &receptor_list[dest].receptorAddress,receptor_list[dest].receptorAddressSize); +#else + int value = sendto((unsigned)receptor_list[dest].socketFileDescriptorReceptor, message.c_str(), (int)message.size(), flags, + (sockaddr*) &receptor_list[dest].receptorAddress,receptor_list[dest].receptorAddressSize); +#endif + + return value; +} + +/*! + Send and encode a request to the first receptor in the list. + + \sa vpNetwork::sendRequestTo() + \sa vpNetwork::sendAndEncodeRequest() + \sa vpNetwork::sendAndEncodeRequestTo() + \sa vpNetwork::send() + \sa vpNetwork::sendTo() + + \param req : Request to send. + + \return The number of bytes that have been sent, -1 if an error occured. +*/ +int vpNetwork::sendAndEncodeRequest(vpRequest &req) +{ + req.encode(); + return sendRequest(req); +} + +/*! + Send and encode a request to a specific receptor. + + \sa vpNetwork::sendRequest() + \sa vpNetwork::sendAndEncodeRequest() + \sa vpNetwork::sendAndEncodeRequestTo() + \sa vpNetwork::send() + \sa vpNetwork::sendTo() + + \param req : Request to send. + \param dest : Index of the receptor receiving the request. + + \return The number of bytes that have been sent, -1 if an error occured. +*/ +int vpNetwork::sendAndEncodeRequestTo(vpRequest &req, const unsigned int &dest) +{ + req.encode(); + return sendRequestTo(req,dest); +} + +/*! + Receive requests untils there is requests to receive. + + \warning Requests will be received but not decoded. + + \sa vpNetwork::receive() + \sa vpNetwork::receiveRequestFrom() + \sa vpNetwork::receiveRequestOnce() + \sa vpNetwork::receiveRequestOnceFrom() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnce() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() +*/ +std::vector<int> vpNetwork::receiveRequest() +{ + _receiveRequest(); + return _handleRequests(); +} + +/*! + Receives requests, from a specific emitter, untils there is request to receive. + + \warning Requests will be received but not decoded. + + \sa vpNetwork::receive() + \sa vpNetwork::receiveRequest() + \sa vpNetwork::receiveRequestOnce() + \sa vpNetwork::receiveRequestOnceFrom() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnce() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() + + \param receptorEmitting : Index of the receptor emitting the message +*/ +std::vector<int> vpNetwork::receiveRequestFrom(const unsigned int &receptorEmitting) +{ + _receiveRequestFrom(receptorEmitting); + return _handleRequests(); +} + +/*! + Receives a message once (in the limit of the Maximum message size value). + This message can represent an entire request or not. Several calls to this function + might be necessary to get the entire request. + + \warning Requests will be received but not decoded. + + \sa vpNetwork::receive() + \sa vpNetwork::receiveRequestFrom() + \sa vpNetwork::receiveRequest() + \sa vpNetwork::receiveRequestOnceFrom() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnce() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() + + \return The number of bytes received, -1 if an error occured. +*/ +int vpNetwork::receiveRequestOnce() +{ + _receiveRequestOnce(); + return _handleFirstRequest(); +} + +/*! + Receives a message once (in the limit of the Maximum message size value), from a specific emitter. + This message can represent an entire request or not. Several calls to this function + might be necessary to get the entire request. + + \warning Requests will be received but not decoded. + + \sa vpNetwork::receive() + \sa vpNetwork::receiveRequestFrom() + \sa vpNetwork::receiveRequest() + \sa vpNetwork::receiveRequestOnce() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnce() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() + + \param receptorEmitting : Index of the receptor emitting the message. + + \return The number of bytes received, -1 if an error occured. +*/ +int vpNetwork::receiveRequestOnceFrom(const unsigned int &receptorEmitting) +{ + _receiveRequestOnceFrom(receptorEmitting); + return _handleFirstRequest(); +} + +/*! + Receives and decode requests untils there is requests to receive. + + \warning Requests will be received but not decoded. + + \sa vpNetwork::receive() + \sa vpNetwork::receiveRequestFrom() + \sa vpNetwork::receiveRequestOnce() + \sa vpNetwork::receiveRequestOnceFrom() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnce() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() +*/ +std::vector<int> vpNetwork::receiveAndDecodeRequest() +{ + std::vector<int> res = receiveRequest(); + for(unsigned int i = 0 ; i < res.size() ; i++) + if(res[i] != -1) + request_list[(unsigned)res[i]]->decode(); + + return res; +} + +/*! + Receives and decode requests, from a specific emitter, untils there is request to receive. + + \warning Requests will be received but not decoded. + + \sa vpNetwork::receive() + \sa vpNetwork::receiveRequest() + \sa vpNetwork::receiveRequestOnce() + \sa vpNetwork::receiveRequestOnceFrom() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnce() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() + + \param receptorEmitting : Index of the receptor emitting the message +*/ +std::vector<int> vpNetwork::receiveAndDecodeRequestFrom(const unsigned int &receptorEmitting) +{ + std::vector<int> res = receiveRequestFrom(receptorEmitting); + for(unsigned int i = 0 ; i < res.size() ; i++) + if(res[i] != -1) + request_list[(unsigned)res[i]]->decode(); + + return res; +} + +/*! + Receives a message once (in the limit of the Maximum message size value). + This message can represent an entire request or not. Several calls to this function + might be necessary to get the entire request. + If it represents an entire request, it decodes the request. + + \warning Requests will be received but not decoded. + + \sa vpNetwork::receive() + \sa vpNetwork::receiveRequestFrom() + \sa vpNetwork::receiveRequest() + \sa vpNetwork::receiveRequestOnceFrom() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnce() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() + + \return The number of bytes received, -1 if an error occured. +*/ +int vpNetwork::receiveAndDecodeRequestOnce() +{ + int res = receiveRequestOnce(); + if(res != -1) + request_list[(unsigned)res]->decode(); + + return res; +} + +/*! + Receives a message once (in the limit of the Maximum message size value), from a specific emitter. + This message can represent an entire request or not. Several calls to this function + might be necessary to get the entire request. + If it represents an entire request, it decodes the request. + + \warning Requests will be received but not decoded. + + \sa vpNetwork::receive() + \sa vpNetwork::receiveRequestFrom() + \sa vpNetwork::receiveRequest() + \sa vpNetwork::receiveRequestOnce() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnce() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() + + \param receptorEmitting : Index of the receptor emitting the message. + + \return The number of bytes received, -1 if an error occured. +*/ +int vpNetwork::receiveAndDecodeRequestOnceFrom(const unsigned int &receptorEmitting) +{ + int res = receiveRequestOnceFrom(receptorEmitting); + if(res != -1) + request_list[(unsigned)res]->decode(); + + return res; +} + + +//######## Definition of Template Functions ######## +//# # +//################################################## + + +/*! + Handle requests until there are requests to handle. + + \warning : This function doesn't decode the requests. If it does handle a request that hasn't been ran yet, + The request's parameters will be replace. + + \sa vpNetwork::handleFirstRequest() + + \return : The list of index corresponding to the requests that have been handled. +*/ +std::vector<int> vpNetwork::_handleRequests() +{ + std::vector<int> resIndex; + int index = _handleFirstRequest(); + + while(index != -1) + { + resIndex.push_back(index); + index = _handleFirstRequest(); + } + + return resIndex; +} + +/*! + Handle the first request in the queue. + + \warning : This function doesn't run the request. If it does handle a request that hasn't been ran yet, + The request's parameters will be replace. + + \sa vpNetwork::handleRequests() + + \return : The index of the request that has been handled. +*/ +int vpNetwork::_handleFirstRequest() +{ + size_t indStart = currentMessageReceived.find(beginning); + size_t indSep = currentMessageReceived.find(separator); + size_t indEnd = currentMessageReceived.find(end); + + if (indStart == std::string::npos && indSep == std::string::npos && indEnd == std::string::npos) + { + if(currentMessageReceived.size() != 0) + currentMessageReceived.clear(); + + if(verboseMode) + vpTRACE("Incorrect message"); + + return -1; + } + + if(indStart == std::string::npos || indSep == std::string::npos || indEnd == std::string::npos) + return -1; + + if(indEnd < indStart) + { + if(verboseMode) + vpTRACE("Incorrect message"); + currentMessageReceived.erase((unsigned)indStart,indEnd+end.size()); + return -1; + } + + size_t indStart2 = currentMessageReceived.find(beginning,indStart+1); + if(indStart2 != std::string::npos && indStart2 < indEnd) + { + if(verboseMode) + vpTRACE("Incorrect message"); + currentMessageReceived.erase((unsigned)indStart,(unsigned)indStart2); + return -1; + } + + size_t deb = indStart + beginning.size(); + std::string id = currentMessageReceived.substr((unsigned)deb, indSep - deb); + + deb = indSep+separator.size(); + std::string params = currentMessageReceived.substr((unsigned)deb, (unsigned)(indEnd - deb)); + +// std::cout << "Handling : " << currentMessageReceived.substr(indStart, indEnd+end.size() - indStart) << std::endl; + + int indRequest = 0; + bool hasBeenFound = false; + for(unsigned int i = 0 ; i < request_list.size() ; i++) + { + if(id == request_list[i]->getId()){ + hasBeenFound = true; + request_list[i]->clear(); + indRequest = (int)i; + break; + } + } + + if(!hasBeenFound){ + //currentMessageReceived.erase(indStart,indEnd+end.size()); + if(verboseMode) + vpTRACE("No request corresponds to the received message"); + return -1; + } + + size_t indDebParam = indSep + separator.size(); + size_t indEndParam = currentMessageReceived.find(param_sep,indDebParam); + + std::string param; + while(indEndParam != std::string::npos || indEndParam < indEnd) + { + param = currentMessageReceived.substr((unsigned)indDebParam,(unsigned)(indEndParam - indDebParam)); + request_list[(unsigned)indRequest]->addParameter(param); + indDebParam = indEndParam+param_sep.size(); + indEndParam = currentMessageReceived.find(param_sep,indDebParam); + } + + param = currentMessageReceived.substr((unsigned)indDebParam, indEnd - indDebParam); + request_list[(unsigned)indRequest]->addParameter(param); + currentMessageReceived.erase(indStart,indEnd+end.size()); + + return indRequest; +} + +/*! + Receive requests untils there is requests to receive. + + \warning Requests will be received but not decoded. + + \sa vpNetwork::receive() + \sa vpNetwork::receiveRequestFrom() + \sa vpNetwork::receiveRequestOnce() + \sa vpNetwork::receiveRequestOnceFrom() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnce() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() +*/ +void vpNetwork::_receiveRequest() +{ + while(_receiveRequestOnce() > 0) {}; +} + +/*! + Receives requests, from a specific emitter, untils there is request to receive. + + \warning Requests will be received but not decoded. + + \sa vpNetwork::receive() + \sa vpNetwork::receiveRequest() + \sa vpNetwork::receiveRequestOnce() + \sa vpNetwork::receiveRequestOnceFrom() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnce() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() + + \param receptorEmitting : Index of the receptor emitting the message +*/ +void vpNetwork::_receiveRequestFrom(const unsigned int &receptorEmitting) +{ + while(_receiveRequestOnceFrom(receptorEmitting) > 0) {}; +} + +/*! + Receives a message once (in the limit of the Maximum message size value). + This message can represent an entire request or not. Several calls to this function + might be necessary to get the entire request. + + \warning Requests will be received but not decoded. + + \sa vpNetwork::receive() + \sa vpNetwork::receiveRequestFrom() + \sa vpNetwork::receiveRequest() + \sa vpNetwork::receiveRequestOnceFrom() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnce() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() + + \return The number of bytes received, -1 if an error occured. +*/ +int vpNetwork::_receiveRequestOnce() +{ + if(receptor_list.size() == 0) + { + if(verboseMode) + vpTRACE( "No Receptor!" ); + return -1; + } + + tv.tv_sec = tv_sec; + tv.tv_usec = tv_usec; + + FD_ZERO(&readFileDescriptor); + + for(unsigned int i=0; i<receptor_list.size(); i++){ + if(i == 0) + socketMax = receptor_list[i].socketFileDescriptorReceptor; + + FD_SET((unsigned)receptor_list[i].socketFileDescriptorReceptor,&readFileDescriptor); + if(socketMax < receptor_list[i].socketFileDescriptorReceptor) socketMax = receptor_list[i].socketFileDescriptorReceptor; + } + + int value = select((int)socketMax+1,&readFileDescriptor,NULL,NULL,&tv); + int numbytes = 0; + + if(value == -1){ + if(verboseMode) + vpERROR_TRACE( "Select error" ); + return -1; + } + else if(value == 0){ + //Timeout + return 0; + } + else{ + for(unsigned int i=0; i<receptor_list.size(); i++){ + if(FD_ISSET((unsigned int)receptor_list[i].socketFileDescriptorReceptor,&readFileDescriptor)){ + char *buf = new char [max_size_message]; +#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX + numbytes=recv(receptor_list[i].socketFileDescriptorReceptor, buf, max_size_message, 0); +#else + numbytes=recv((unsigned int)receptor_list[i].socketFileDescriptorReceptor, buf, (int)max_size_message, 0); +#endif + + if(numbytes <= 0) + { + std::cout << "Disconnected : " << inet_ntoa(receptor_list[i].receptorAddress.sin_addr) << std::endl; + receptor_list.erase(receptor_list.begin()+(int)i); + delete [] buf; + return numbytes; + } + else if(numbytes > 0){ + std::string returnVal(buf, (unsigned int)numbytes); + currentMessageReceived.append(returnVal); + } + delete [] buf; + break; + } + } + } + + return numbytes; +} + +/*! + Receives a message once (in the limit of the Maximum message size value), from a specific emitter. + This message can represent an entire request or not. Several calls to this function + might be necessary to get the entire request. + + \warning Requests will be received but not decoded. + + \sa vpNetwork::receive() + \sa vpNetwork::receiveRequestFrom() + \sa vpNetwork::receiveRequest() + \sa vpNetwork::receiveRequestOnce() + \sa vpNetwork::receiveAndDecodeRequest() + \sa vpNetwork::receiveAndDecodeRequestFrom() + \sa vpNetwork::receiveAndDecodeRequestOnce() + \sa vpNetwork::receiveAndDecodeRequestOnceFrom() + + \param receptorEmitting : Index of the receptor emitting the message. + + \return The number of bytes received, -1 if an error occured. +*/ +int vpNetwork::_receiveRequestOnceFrom(const unsigned int &receptorEmitting) +{ + int size = (int)receptor_list.size(); + int sizeMinusOne = (int)receptor_list.size()-1; + if(size == 0 || receptorEmitting > (unsigned)sizeMinusOne ) + { + if(verboseMode) + vpTRACE( "No receptor at the specified index!" ); + return -1; + } + + tv.tv_sec = tv_sec; + tv.tv_usec = tv_usec; + + FD_ZERO(&readFileDescriptor); + + socketMax = receptor_list[receptorEmitting].socketFileDescriptorReceptor; + FD_SET((unsigned int)receptor_list[receptorEmitting].socketFileDescriptorReceptor,&readFileDescriptor); + + int value = select((int)socketMax+1,&readFileDescriptor,NULL,NULL,&tv); + int numbytes = 0; + if(value == -1){ + if(verboseMode) + vpERROR_TRACE( "Select error" ); + return -1; + } + else if(value == 0){ + //Timeout + return 0; + } + else{ + if(FD_ISSET((unsigned int)receptor_list[receptorEmitting].socketFileDescriptorReceptor,&readFileDescriptor)){ + char *buf = new char [max_size_message]; +#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX + numbytes=recv(receptor_list[receptorEmitting].socketFileDescriptorReceptor, buf, max_size_message, 0); +#else + numbytes=recv((unsigned int)receptor_list[receptorEmitting].socketFileDescriptorReceptor, buf, (int)max_size_message, 0); +#endif + if(numbytes <= 0) + { + std::cout << "Disconnected : " << inet_ntoa(receptor_list[receptorEmitting].receptorAddress.sin_addr) << std::endl; + receptor_list.erase(receptor_list.begin()+(int)receptorEmitting); + delete [] buf; + return numbytes; + } + else if(numbytes > 0){ + std::string returnVal(buf, (unsigned int)numbytes); + currentMessageReceived.append(returnVal); + } + delete [] buf; + } + } + + return numbytes; +} + + + diff --git a/src/network/vpRequest.cpp b/modules/core/src/tools/network/vpRequest.cpp similarity index 84% rename from src/network/vpRequest.cpp rename to modules/core/src/tools/network/vpRequest.cpp index 4195c39a66974eb2d56d1b83188165a4a889dc41..cd4ea881a4a5a4b1f04e2651d6ddd1f24137e885 100644 --- a/src/network/vpRequest.cpp +++ b/modules/core/src/tools/network/vpRequest.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpRequest.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Network request. * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpRequest.h> +#include <visp3/core/vpRequest.h> vpRequest::vpRequest() : request_id(""), listOfParams() diff --git a/src/network/vpServer.cpp b/modules/core/src/tools/network/vpServer.cpp similarity index 96% rename from src/network/vpServer.cpp rename to modules/core/src/tools/network/vpServer.cpp index 01647acc34f818a0230c8f687e39877ff8e6c4a6..f96e5aed17692141c9f9a4b2ffb5bd5e7e020259 100644 --- a/src/network/vpServer.cpp +++ b/modules/core/src/tools/network/vpServer.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpServer.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * TCP Server * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpServer.h> +#include <visp3/core/vpServer.h> /*! diff --git a/src/tools/time/vpTime.cpp b/modules/core/src/tools/time/vpTime.cpp similarity index 75% rename from src/tools/time/vpTime.cpp rename to modules/core/src/tools/time/vpTime.cpp index e1d5adc84d83656e6a3cf3c525b54726f22ba3d7..0abc2c6d940e09738a9f716bc94e9c5e841925a7 100644 --- a/src/tools/time/vpTime.cpp +++ b/modules/core/src/tools/time/vpTime.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpTime.cpp 4622 2014-01-28 17:40:36Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Time management and measurement. * @@ -42,8 +38,8 @@ -#include <visp/vpTime.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpTime.h> +#include <visp3/core/vpDebug.h> #include <iostream> @@ -64,26 +60,37 @@ # include <winbase.h> #endif -double vpTime::minTimeForUsleepCall = 4; /*! This time is in - milli-seconds. Threshold to - activate usleep() in waiting - methods (see wait()). This - threshold is needed, because - usleep() is not accurate on many - machines. Call sleep() functions - during the time to wait minus - vpTime::minTimeForUsleepCall. The - rest of the time to wait is managed - by a while loop. */ +#ifndef DOXYGEN_SHOULD_SKIP_THIS +namespace vpTime +{ +#endif +/*! + This time is in milli-seconds. Threshold to activate usleep() in waiting + methods (see wait()). This threshold is needed, because usleep() is not + accurate on many machines. Call sleep() functions during the time to wait + minus vpTime::minTimeForUsleepCall. The rest of the time to wait is managed + by a while loop. +*/ +double minTimeForUsleepCall = 4; /*! + \return The time during which a while loop is used to handle the time + wainting functions. When the time to wait is greater than that value, we use + non blocking functions like usleep() instead. + */ +double getMinTimeForUsleepCall() +{ + return minTimeForUsleepCall; +} + +/*! + \fn vpTime::measureTimeMs() Return the time in milliseconds since January 1st 1970. \sa measureTimeMicros(), measureTimeSecond() */ -double -vpTime::measureTimeMs() +double measureTimeMs() { #if defined(_WIN32) LARGE_INTEGER time, frequency; @@ -92,8 +99,8 @@ vpTime::measureTimeMs() return(timeGetTime()); } else{ - QueryPerformanceCounter(&time); - return (double)(1000.0*time.QuadPart/frequency.QuadPart); + QueryPerformanceCounter(&time); + return (double)(1000.0*time.QuadPart/frequency.QuadPart); } #elif !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX struct timeval tp; @@ -102,14 +109,12 @@ vpTime::measureTimeMs() #endif } - /*! Return the time in microseconds since January 1st 1970. \sa measureTimeMs(), measureTimeSecond() */ -double -vpTime::measureTimeMicros() +double measureTimeMicros() { #if defined(_WIN32) LARGE_INTEGER time, frequency; @@ -118,8 +123,8 @@ vpTime::measureTimeMicros() return(timeGetTime()); } else{ - QueryPerformanceCounter(&time); - return (double)(1000000.0*time.QuadPart/frequency.QuadPart); + QueryPerformanceCounter(&time); + return (double)(1000000.0*time.QuadPart/frequency.QuadPart); } #else @@ -129,8 +134,6 @@ vpTime::measureTimeMicros() #endif } - - /*! Wait t miliseconds after t0 (in ms). @@ -144,9 +147,7 @@ vpTime::measureTimeMicros() \return 0 : The function did wait. \return 1 : The time was already over, no need to wait. */ - -int -vpTime::wait(double t0, double t) +int wait(double t0, double t) { double timeCurrent, timeToWait; timeCurrent = measureTimeMs(); @@ -176,7 +177,6 @@ vpTime::wait(double t0, double t) } } - /*! Wait t miliseconds from now. @@ -186,7 +186,7 @@ vpTime::wait(double t0, double t) \param t : Time to wait in ms. */ -void vpTime::wait(double t) +void wait(double t) { double t0, timeCurrent, timeToWait; t0 = timeCurrent = measureTimeMs(); @@ -197,7 +197,7 @@ void vpTime::wait(double t) return; else { #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX - if (timeToWait > vpTime::minTimeForUsleepCall) { + if (timeToWait > vpTime::minTimeForUsleepCall) { usleep((unsigned long )((timeToWait-vpTime::minTimeForUsleepCall)*1000)); } #elif defined(_WIN32) @@ -222,7 +222,7 @@ void vpTime::wait(double t) \sa measureTimeMs() */ -double vpTime::measureTimeSecond() +double measureTimeSecond() { return vpTime::measureTimeMs()/1000.0 ; } @@ -233,13 +233,15 @@ double vpTime::measureTimeSecond() \param t : Time to sleep in ms. */ -void vpTime::sleepMs(double t) +void sleepMs(double t) { #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX - usleep((unsigned long )(t*1000)); + usleep((unsigned long )(t*1000)); #elif defined(_WIN32) - Sleep((DWORD)(t)); + Sleep((DWORD)(t)); #endif } - +#ifndef DOXYGEN_SHOULD_SKIP_THIS +}; +#endif diff --git a/src/tools/xml/vpXmlParser.cpp b/modules/core/src/tools/xml/vpXmlParser.cpp old mode 100755 new mode 100644 similarity index 95% rename from src/tools/xml/vpXmlParser.cpp rename to modules/core/src/tools/xml/vpXmlParser.cpp index 28a59ec7c959b52fe37eceba95de078668e0dad8..599c2ad1da024e19d64fb3909d478f669f9c70fb --- a/src/tools/xml/vpXmlParser.cpp +++ b/modules/core/src/tools/xml/vpXmlParser.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpXmlParser.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tool to automatise the creation of xml parser based on the libXML2 * @@ -39,13 +35,13 @@ * *****************************************************************************/ -#include <visp/vpXmlParser.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpXmlParser.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 -#include <visp/vpException.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpDebug.h> #include <libxml/parser.h> #include <string> @@ -409,11 +405,7 @@ vpXmlParser::save(const std::string& filename, const bool append) xmlFreeDoc(doc); } - - - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpXmlParser.cpp.o) has no symbols +void dummy_vpXmlParser() {}; #endif - - - - diff --git a/src/tracking/forward-projection/vpCircle.cpp b/modules/core/src/tracking/forward-projection/vpCircle.cpp similarity index 80% rename from src/tracking/forward-projection/vpCircle.cpp rename to modules/core/src/tracking/forward-projection/vpCircle.cpp index 58a22b1044207eefff7fc0f18dd9b23d93acae78..d91ac415505733753f2a5ffeb6a4c5b436012271 100644 --- a/src/tracking/forward-projection/vpCircle.cpp +++ b/modules/core/src/tracking/forward-projection/vpCircle.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpCircle.cpp 4772 2014-07-10 17:05:53Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Visual feature circle. * @@ -40,9 +36,9 @@ *****************************************************************************/ -#include <visp/vpCircle.h> +#include <visp3/core/vpCircle.h> -#include <visp/vpFeatureDisplay.h> +#include <visp3/core/vpFeatureDisplay.h> void vpCircle::init() @@ -357,3 +353,58 @@ vpCircle *vpCircle::duplicate() const vpCircle *feature = new vpCircle(*this) ; return feature ; } + +/*! + Computes the coordinates of the point corresponding to the intersection + between a circle and a line. + + \warning This functions assumes changeFrame() and projection() have already been called. + + \sa changeFrame(), projection() + + \param circle : Circle to consider for the intersection. + \param cam : Camera parameters that have to be used for the intersection computation. + \param rho : The rho parameter of the line. + \param theta : The theta parameter of the line. + \param i : resulting i-coordinate of the intersection point. + \param j : resulting j-coordinate of the intersection point. +*/ +void +vpCircle::computeIntersectionPoint(const vpCircle &circle, const vpCameraParameters &cam, const double &rho, const double &theta, double &i, double &j) +{ + // This was taken from the code of art-v1. (from the artCylinder class) + double px = cam.get_px() ; + double py = cam.get_py() ; + double u0 = cam.get_u0() ; + double v0 = cam.get_v0() ; + + double mu11 = circle.p[3]; + double mu02 = circle.p[4]; + double mu20 = circle.p[2]; + double Xg = u0 + circle.p[0]*px; + double Yg = v0 + circle.p[1]*py; + + // Find Intersection between line and ellipse in the image. + + // Optimised calculation for X + double stheta = sin(theta); + double ctheta = cos(theta); + double sctheta = stheta*ctheta; + double m11yg = mu11*Yg; + double ctheta2 = vpMath::sqr(ctheta); + double m02xg = mu02*Xg; + double m11stheta = mu11*stheta; + j = ((mu11*Xg*sctheta-mu20*Yg*sctheta+mu20*rho*ctheta + -m11yg+m11yg*ctheta2+m02xg-m02xg*ctheta2+ + m11stheta*rho)/(mu20*ctheta2+2.0*m11stheta*ctheta + +mu02-mu02*ctheta2)); + //Optimised calculation for Y + double rhom02 = rho*mu02; + double sctheta2 = stheta*ctheta2; + double ctheta3 = ctheta2*ctheta; + i = (-(-rho*mu11*stheta*ctheta-rhom02+rhom02*ctheta2 + +mu11*Xg*sctheta2-mu20*Yg*sctheta2-ctheta*mu11*Yg + +ctheta3*mu11*Yg+ctheta*mu02*Xg-ctheta3*mu02*Xg)/ + (mu20*ctheta2+2.0*mu11*stheta*ctheta+mu02- + mu02*ctheta2)/stheta); +} diff --git a/src/tracking/forward-projection/vpCylinder.cpp b/modules/core/src/tracking/forward-projection/vpCylinder.cpp similarity index 96% rename from src/tracking/forward-projection/vpCylinder.cpp rename to modules/core/src/tracking/forward-projection/vpCylinder.cpp index 208538c0ecf0340551d087c6bb0d23d6aaade291..ab2ecaa61e5daf5aebeaa8259d2246c0f8cf0236 100644 --- a/src/tracking/forward-projection/vpCylinder.cpp +++ b/modules/core/src/tracking/forward-projection/vpCylinder.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpCylinder.cpp 4908 2014-09-19 06:55:24Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Cylinder feature. * @@ -40,8 +36,8 @@ *****************************************************************************/ -#include <visp/vpCylinder.h> -#include <visp/vpFeatureDisplay.h> +#include <visp3/core/vpCylinder.h> +#include <visp3/core/vpFeatureDisplay.h> void diff --git a/src/tracking/forward-projection/vpForwardProjection.cpp b/modules/core/src/tracking/forward-projection/vpForwardProjection.cpp similarity index 87% rename from src/tracking/forward-projection/vpForwardProjection.cpp rename to modules/core/src/tracking/forward-projection/vpForwardProjection.cpp index d1c30f352ae02e71f045e068361303bc28d13719..027bbcb4bc3bf431350ea0156efa52d3852261c4 100644 --- a/src/tracking/forward-projection/vpForwardProjection.cpp +++ b/modules/core/src/tracking/forward-projection/vpForwardProjection.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpForwardProjection.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Forward projection. * @@ -40,8 +36,8 @@ *****************************************************************************/ -#include <visp/vpForwardProjection.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpForwardProjection.h> +#include <visp3/core/vpDebug.h> /*! diff --git a/src/tracking/forward-projection/vpLine.cpp b/modules/core/src/tracking/forward-projection/vpLine.cpp similarity index 96% rename from src/tracking/forward-projection/vpLine.cpp rename to modules/core/src/tracking/forward-projection/vpLine.cpp index 1b103840dbd068d1fd4613dbd1ecef0f912468e8..8e251427f5d63dcf87a50e5c93fc9029aac689aa 100644 --- a/src/tracking/forward-projection/vpLine.cpp +++ b/modules/core/src/tracking/forward-projection/vpLine.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpLine.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Line feature. * @@ -40,12 +36,12 @@ *****************************************************************************/ -#include <visp/vpLine.h> +#include <visp3/core/vpLine.h> -#include <visp/vpDebug.h> -#include <visp/vpMath.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpMath.h> -#include <visp/vpFeatureDisplay.h> +#include <visp3/core/vpFeatureDisplay.h> /*! \file vpLine.cpp diff --git a/modules/core/src/tracking/forward-projection/vpPoint.cpp b/modules/core/src/tracking/forward-projection/vpPoint.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7f4cda3de3e8e0a00eedd8b7f738fee29cb16d99 --- /dev/null +++ b/modules/core/src/tracking/forward-projection/vpPoint.cpp @@ -0,0 +1,500 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Point feature. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + + +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpFeatureDisplay.h> + +/*! + \file vpPoint.cpp + \brief class that defines what is a point +*/ + + + +void +vpPoint::init() +{ + p.resize(3) ; p = 0 ; p[2] = 1 ; + oP.resize(4) ; oP = 0 ; oP[3] = 1 ; + cP.resize(4) ; cP = 0 ; cP[3] = 1 ; + + //default value Z (1 meters) + set_Z(1) ; +} + +vpPoint::vpPoint() +{ + init(); +} + +/*! + Construction from 3D coordinates in the object frame. + \param oX, oY, oZ: Coordinates of a 3D point in the object frame. +*/ +vpPoint::vpPoint(double oX, double oY, double oZ) +{ + init(); + setWorldCoordinates(oX, oY, oZ); +} + +/*! + Construction from 3D point world coordinates. We mean here the coordinates of the point in the object frame. + \param P: Vector containing the coordinates of the 3D point in the object frame. This vector could be + of dimension 3 or 4. + - If dimension is 3, \e P corresponds to the normalized coordinates P = (X, Y, Z, 1) + where P[0]=X, P[1]=Y, P[2]=Z. + - If dimension is 4, \e P corresponds to the normalized coordinates P = (X, Y, Z, W) + where P[0]=X, P[1]=Y, P[2]=Z and P[3]=W. +*/ +vpPoint::vpPoint(const vpColVector &P) +{ + init(); + setWorldCoordinates(P); +} + +/*! + Construction from 3D point world coordinates. We mean here the coordinates of the point in the object frame. + \param P: Vector containing the coordinates of the 3D point in the object frame. This vector could be + of dimension 3 or 4. + - If dimension is 3, \e P corresponds to the normalized coordinates P = (X, Y, Z, 1) + where P[0]=X, P[1]=Y, P[2]=Z. + - If dimension is 4, \e P corresponds to the normalized coordinates P = (X, Y, Z, W) + where P[0]=X, P[1]=Y, P[2]=Z and P[3]=W. +*/ +vpPoint::vpPoint(const std::vector<double> &P) +{ + init(); + setWorldCoordinates(P); +} + +/*! + Set the 3D point world coordinates. We mean here the coordinates of the point in the object frame. + \param oX, oY, oZ: Coordinates of a 3D point in the object frame. +*/ +void +vpPoint::setWorldCoordinates(const double oX, const double oY, const double oZ) +{ + oP[0] = oX; + oP[1] = oY; + oP[2] = oZ; + oP[3] = 1; +} + +/*! + Set the 3D point world coordinates. We mean here the coordinates of the point in the object frame. + \param P: Vector containing the coordinates of the 3D point in the object frame. This vector could be + of dimension 3 or 4. + - If dimension is 3, \e P corresponds to the normalized coordinates P = (X, Y, Z, 1) + where P[0]=X, P[1]=Y, P[2]=Z. + - If dimension is 4, \e P corresponds to the normalized coordinates P = (X, Y, Z, W) + where P[0]=X, P[1]=Y, P[2]=Z and P[3]=W. +*/ +void +vpPoint::setWorldCoordinates(const vpColVector &P) +{ + if (P.size() == 3) { + oP[0] = P[0]; + oP[1] = P[1]; + oP[2] = P[2]; + oP[3] = 1.; + } + else if (P.size() == 4) { + oP[0] = P[0]; + oP[1] = P[1]; + oP[2] = P[2]; + oP[3] = P[3]; + oP /= oP[3] ; + } + else { + throw(vpException(vpException::dimensionError, + "Cannot initialize vpPoint from vector with size %d", P.size())); + } +} + +/*! + Set the 3D point world coordinates. We mean here the coordinates of the point in the object frame. + \param P: Vector containing the coordinates of the 3D point in the object frame. This vector could be + of dimension 3 or 4. + - If dimension is 3, \e P corresponds to the normalized coordinates P = (X, Y, Z, 1) + where P[0]=X, P[1]=Y, P[2]=Z. + - If dimension is 4, \e P corresponds to the normalized coordinates P = (X, Y, Z, W) + where P[0]=X, P[1]=Y, P[2]=Z and P[3]=W. +*/ +void +vpPoint::setWorldCoordinates(const std::vector<double> &P) +{ + if (P.size() == 3) { + oP[0] = P[0]; + oP[1] = P[1]; + oP[2] = P[2]; + oP[3] = 1.; + } + else if (P.size() == 4) { + oP[0] = P[0]; + oP[1] = P[1]; + oP[2] = P[2]; + oP[3] = P[3]; + oP /= oP[3] ; + } + else { + throw(vpException(vpException::dimensionError, + "Cannot initialize vpPoint from vector with size %d", P.size())); + } +} + +//! Get the point world coordinates. We mean here the coordinates of the point in the object frame. +void +vpPoint::getWorldCoordinates(double& oX, double& oY, double& oZ) +{ + oX = oP[0]; + oY = oP[1]; + oZ = oP[2]; +} + + +/*! + Get the point world coordinates. We mean here the coordinates of the point in the object frame. + \param P: Normalized coordinates of the point in the object frame P = (X, Y, Z, 1) + */ +void +vpPoint::getWorldCoordinates(vpColVector &P) +{ + P = oP; +} +/*! + Get the point world coordinates. We mean here the coordinates of the point in the object frame. + \param P: Normalized coordinates of the point in the object frame P = (X, Y, Z, 1) + */ +void +vpPoint::getWorldCoordinates(std::vector<double> &P) +{ + P.resize(oP.size()); + for(unsigned int i = 0; i < oP.size(); i++) + P[i] = oP[i]; +} + +/*! + Return the point world coordinates. We mean here the coordinates of the point in the object frame. + \return Normalized coordinates of the point in the object frame P = (X, Y, Z, 1) + */ +vpColVector +vpPoint::getWorldCoordinates(void) +{ + return this->oP; +} + +/*! + Compute the perspective projection of a point _cP. + + \param _cP : Three dimension vector that corresponds to the coordinates of the point in the camera frame. + \param _p : Coordinates of the point in the image plane obtained by perspective projection. +*/ +void +vpPoint::projection(const vpColVector &_cP, vpColVector &_p) +{ + _p.resize(3) ; + + _p[0] = _cP[0]/_cP[2] ; + _p[1] = _cP[1]/_cP[2] ; + _p[2] = 1 ; +} + +/*! + From the 3D coordinates of the point in the object frame set using for example + setWorldCoordinates() or set_oX(), set_oY(), set_oZ(), compute the 3D coordinates + of the point in the camera frame. + + \param cMo : Transformation from camera to object frame. + \param _cP : 3D coordinates of the point in the camera frame. +*/ +void +vpPoint::changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &_cP) +{ + + _cP.resize(4) ; + + _cP[0] = cMo[0][0]*oP[0]+ cMo[0][1]*oP[1]+ cMo[0][2]*oP[2]+ cMo[0][3]*oP[3] ; + _cP[1] = cMo[1][0]*oP[0]+ cMo[1][1]*oP[1]+ cMo[1][2]*oP[2]+ cMo[1][3]*oP[3] ; + _cP[2] = cMo[2][0]*oP[0]+ cMo[2][1]*oP[1]+ cMo[2][2]*oP[2]+ cMo[2][3]*oP[3] ; + _cP[3] = cMo[3][0]*oP[0]+ cMo[3][1]*oP[1]+ cMo[3][2]*oP[2]+ cMo[3][3]*oP[3] ; + + double d = 1/_cP[3] ; + _cP[0] *=d ; + _cP[1] *=d ; + _cP[2] *=d ; + _cP[3] *=d ; ; +} + +/*! + From the 3D coordinates of the point in the object frame set using for example + setWorldCoordinates() or set_oX(), set_oY(), set_oZ(), compute the 3D coordinates + of the point in the camera frame. + + \param cMo : Transformation from camera to object frame. + +*/ +void vpPoint::changeFrame(const vpHomogeneousMatrix &cMo) { + double X = cMo[0][0]*oP[0]+ cMo[0][1]*oP[1]+ cMo[0][2]*oP[2]+ cMo[0][3]*oP[3] ; + double Y = cMo[1][0]*oP[0]+ cMo[1][1]*oP[1]+ cMo[1][2]*oP[2]+ cMo[1][3]*oP[3] ; + double Z = cMo[2][0]*oP[0]+ cMo[2][1]*oP[1]+ cMo[2][2]*oP[2]+ cMo[2][3]*oP[3] ; + double W = cMo[3][0]*oP[0]+ cMo[3][1]*oP[1]+ cMo[3][2]*oP[2]+ cMo[3][3]*oP[3] ; + + double d = 1/W ; + cP[0] =X*d ; + cP[1] =Y*d ; + cP[2] =Z*d ; + cP[3] =1 ; +} + +#if 0 +/*! + From the coordinates of the point in camera frame b and the transformation between + camera frame a and camera frame b computes the coordinates of the point in camera frame a. + + \param aMb : 3D transformation between camera frame a and b. + \param bP : 3D coordinates of the point in camera frame bP. + + \return A point with 3D coordinates in the camera frame a. The coordinates in the world or object + frame are set to the same coordinates than the one in the camera frame. +*/ +const vpPoint +operator*(const vpHomogeneousMatrix &aMb, const vpPoint& bP) +{ + vpPoint aP ; + + vpColVector v(4),v1(4) ; + + v[0] = bP.get_X() ; + v[1] = bP.get_Y() ; + v[2] = bP.get_Z() ; + v[3] = bP.get_W() ; + + v1[0] = aMb[0][0]*v[0] + aMb[0][1]*v[1]+ aMb[0][2]*v[2]+ aMb[0][3]*v[3] ; + v1[1] = aMb[1][0]*v[0] + aMb[1][1]*v[1]+ aMb[1][2]*v[2]+ aMb[1][3]*v[3] ; + v1[2] = aMb[2][0]*v[0] + aMb[2][1]*v[1]+ aMb[2][2]*v[2]+ aMb[2][3]*v[3] ; + v1[3] = aMb[3][0]*v[0] + aMb[3][1]*v[1]+ aMb[3][2]*v[2]+ aMb[3][3]*v[3] ; + + v1 /= v1[3] ; + + // v1 = M*v ; + aP.set_X(v1[0]) ; + aP.set_Y(v1[1]) ; + aP.set_Z(v1[2]) ; + aP.set_W(v1[3]) ; + + aP.set_oX(v1[0]) ; + aP.set_oY(v1[1]) ; + aP.set_oZ(v1[2]) ; + aP.set_oW(v1[3]) ; + + return aP ; +} + +/*! + From the coordinates of the point in image plane b and the homography between image + a and b computes the coordinates of the point in image plane a. + + \param aHb : Homography between image a and b. + \param bP : 2D coordinates of the point in the image plane b. + + \return A point with 2D coordinates in the image plane a. +*/ +const vpPoint +operator*(const vpHomography &aHb, const vpPoint& bP) +{ + vpPoint aP ; + vpColVector v(3),v1(3) ; + + v[0] = bP.get_x() ; + v[1] = bP.get_y() ; + v[2] = bP.get_w() ; + + v1[0] = aHb[0][0]*v[0] + aHb[0][1]*v[1]+ aHb[0][2]*v[2] ; + v1[1] = aHb[1][0]*v[0] + aHb[1][1]*v[1]+ aHb[1][2]*v[2] ; + v1[2] = aHb[2][0]*v[0] + aHb[2][1]*v[1]+ aHb[2][2]*v[2] ; + + // v1 = M*v ; + aP.set_x(v1[0]) ; + aP.set_y(v1[1]) ; + aP.set_w(v1[2]) ; + + return aP ; +} +#endif +//! For memory issue (used by the vpServo class only). +vpPoint *vpPoint::duplicate() const +{ + vpPoint *feature = new vpPoint(*this) ; + return feature ; +} + +/*! + Display the point in the image. +*/ +void +vpPoint::display(const vpImage<unsigned char> &I, + const vpHomogeneousMatrix &cMo, + const vpCameraParameters &cam, + const vpColor &color, + const unsigned int thickness) +{ + + vpColVector _cP, _p ; + changeFrame(cMo,_cP) ; + + if(_cP[2] < 0) // no display if point is behind the camera + return; + + vpPoint::projection(_cP,_p) ; + vpFeatureDisplay::displayPoint(_p[0],_p[1], cam, I, color, thickness) ; +} + +/*! + Display the point in the image. +*/ +void +vpPoint::display(const vpImage<vpRGBa> &I, + const vpHomogeneousMatrix &cMo, + const vpCameraParameters &cam, + const vpColor &color, + const unsigned int thickness) +{ + vpColVector _cP, _p ; + changeFrame(cMo,_cP) ; + + if(_cP[2] < 0) // no display if point is behind the camera + return; + + vpPoint::projection(_cP,_p) ; + vpFeatureDisplay::displayPoint(_p[0],_p[1], cam, I, color, thickness) ; +} + +VISP_EXPORT std::ostream& operator<<(std::ostream& os, const vpPoint& /* vpp */) +{ + return( os<<"vpPoint" ); +} + +vpPoint& +vpPoint::operator=(const vpPoint& vpp ) +{ + p = vpp.p; + cP = vpp.cP; + oP = vpp.oP; + cPAvailable = vpp.cPAvailable; + + return *this; +} + +/*! + Display the point in the image. +*/ +void +vpPoint::display(const vpImage<unsigned char> &I, + const vpCameraParameters &cam, + const vpColor &color, + const unsigned int thickness) +{ + vpFeatureDisplay::displayPoint(p[0], p[1], cam, I, color, thickness) ; +} + +// Get coordinates +//! Get the point X coordinate in the camera frame. +double vpPoint::get_X() const { return cP[0] ; } +//! Get the point Y coordinate in the camera frame. +double vpPoint::get_Y() const { return cP[1] ; } +//! Get the point Z coordinate in the camera frame. +double vpPoint::get_Z() const { return cP[2] ; } +//! Get the point W coordinate in the camera frame. +double vpPoint::get_W() const { return cP[3] ; } + +//! Get the point X coordinate in the object frame. +double vpPoint::get_oX() const { return oP[0] ; } +//! Get the point Y coordinate in the object frame. +double vpPoint::get_oY() const { return oP[1] ; } +//! Get the point Z coordinate in the object frame. +double vpPoint::get_oZ() const { return oP[2] ; } +//! Get the point W coordinate in the object frame. +double vpPoint::get_oW() const { return oP[3] ; } + +//! Get the point x coordinate in the image plane. +double vpPoint::get_x() const { return p[0] ; } +//! Get the point y coordinate in the image plane. +double vpPoint::get_y() const { return p[1] ; } +//! Get the point w coordinate in the image plane. +double vpPoint::get_w() const { return p[2] ; } + +/*! + Perspective projection of the point. + + Projection onto the //image plane of the point. Update the object + attribute p (2D //homogeneous coordinates) according to object + attribute cP (current //3D coordinates in the camera frame). + +*/ +void vpPoint::projection() { + double d = 1/cP[2] ; + p[0] = cP[0]*d ; + p[1] = cP[1]*d ; + p[2] = 1 ; +} + +//! Set the point X coordinate in the camera frame. +void vpPoint::set_X(const double X) { cP[0] = X ; } +//! Set the point Y coordinate in the camera frame. +void vpPoint::set_Y(const double Y) { cP[1] = Y ; } +//! Set the point Z coordinate in the camera frame. +void vpPoint::set_Z(const double Z) { cP[2] = Z ; } +//! Set the point W coordinate in the camera frame. +void vpPoint::set_W(const double W) { cP[3] = W ; } + +//! Set the point X coordinate in the object frame. +void vpPoint::set_oX(const double oX) { oP[0] = oX ; } +//! Set the point Y coordinate in the object frame. +void vpPoint::set_oY(const double oY) { oP[1] = oY ; } +//! Set the point Z coordinate in the object frame. +void vpPoint::set_oZ(const double oZ) { oP[2] = oZ ; } +//! Set the point W coordinate in the object frame. +void vpPoint::set_oW(const double oW) { oP[3] = oW ; } + +//! Set the point x coordinate in the image plane. +void vpPoint::set_x(const double x) { p[0] = x ; } +//! Set the point y coordinate in the image plane. +void vpPoint::set_y(const double y) { p[1] = y ; } +//! Set the point w coordinate in the image plane. +void vpPoint::set_w(const double w) { p[2] = w ; } diff --git a/src/tracking/forward-projection/vpSphere.cpp b/modules/core/src/tracking/forward-projection/vpSphere.cpp similarity index 91% rename from src/tracking/forward-projection/vpSphere.cpp rename to modules/core/src/tracking/forward-projection/vpSphere.cpp index 4e380e443994c11ca6c678e72297b1759c342c8e..81f217291f21595f2fb774ad05ea93b22828d979 100644 --- a/src/tracking/forward-projection/vpSphere.cpp +++ b/modules/core/src/tracking/forward-projection/vpSphere.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSphere.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Sphere feature. * @@ -40,8 +36,8 @@ *****************************************************************************/ -#include <visp/vpSphere.h> -#include <visp/vpFeatureDisplay.h> +#include <visp3/core/vpSphere.h> +#include <visp3/core/vpFeatureDisplay.h> void diff --git a/src/tracking/moments/vpMoment.cpp b/modules/core/src/tracking/moments/vpMoment.cpp similarity index 85% rename from src/tracking/moments/vpMoment.cpp rename to modules/core/src/tracking/moments/vpMoment.cpp index df576f6d17bca6e5f4792d3bf3c5e3355bced1c4..ee1c9a4d13826ae36e091216ca4cb74d602ef310 100644 --- a/src/tracking/moments/vpMoment.cpp +++ b/modules/core/src/tracking/moments/vpMoment.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMoment.cpp 4709 2014-03-28 17:37:12Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Base for 2D moment descriptor * @@ -45,9 +41,9 @@ */ -#include <visp/vpMomentObject.h> -#include <visp/vpMoment.h> -#include <visp/vpMomentDatabase.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMoment.h> +#include <visp3/core/vpMomentDatabase.h> #include <cstring> /*! Default constructor @@ -60,11 +56,11 @@ vpMoment::vpMoment(): object(NULL), moments(NULL), values() {} If the moment depends on other moments, these moments must be linked to the same database. \attention Two moments of the same class cannot be stored in the same database \code -#include <visp/vpMomentObject.h> -#include <visp/vpPoint.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentDatabase.h> -#include <visp/vpMomentCentered.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpMomentCentered.h> int main() { diff --git a/src/tracking/moments/vpMomentAlpha.cpp b/modules/core/src/tracking/moments/vpMomentAlpha.cpp similarity index 92% rename from src/tracking/moments/vpMomentAlpha.cpp rename to modules/core/src/tracking/moments/vpMomentAlpha.cpp index 8a180db4b378541f063c6559e29cd175d42e4171..4be9276c324e4012e59367ccad4cfb4cc9a69c3b 100644 --- a/src/tracking/moments/vpMomentAlpha.cpp +++ b/modules/core/src/tracking/moments/vpMomentAlpha.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentAlpha.cpp 4713 2014-03-28 18:02:26Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Alpha moment descriptor for in-plane orientation. * @@ -39,9 +35,9 @@ * *****************************************************************************/ -#include <visp/vpMomentAlpha.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentCentered.h> +#include <visp3/core/vpMomentAlpha.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentCentered.h> #include <cmath> /*! diff --git a/src/tracking/moments/vpMomentArea.cpp b/modules/core/src/tracking/moments/vpMomentArea.cpp similarity index 86% rename from src/tracking/moments/vpMomentArea.cpp rename to modules/core/src/tracking/moments/vpMomentArea.cpp index 371362d8acee218a668b84623c059664c6c59e8c..80ca2e62efb30cdbc2cab0b40ba04a5e7acd3e7e 100644 --- a/src/tracking/moments/vpMomentArea.cpp +++ b/modules/core/src/tracking/moments/vpMomentArea.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentArea.cpp 3530 2012-01-03 10:52:12Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D area of the object * @@ -38,10 +34,10 @@ * Manikandan Bakthavatchalam * *****************************************************************************/ -#include <visp/vpMomentArea.h> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentDatabase.h> +#include <visp3/core/vpMomentArea.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentDatabase.h> #include <cmath> /*! diff --git a/src/tracking/moments/vpMomentAreaNormalized.cpp b/modules/core/src/tracking/moments/vpMomentAreaNormalized.cpp similarity index 88% rename from src/tracking/moments/vpMomentAreaNormalized.cpp rename to modules/core/src/tracking/moments/vpMomentAreaNormalized.cpp index 4b2865b337b5700a3b6431fcb18dbf457b794a6a..bf3db21a5ab3fe6906b9a57108a9ffbbecbcafc0 100644 --- a/src/tracking/moments/vpMomentAreaNormalized.cpp +++ b/modules/core/src/tracking/moments/vpMomentAreaNormalized.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentAreaNormalized.cpp 4713 2014-03-28 18:02:26Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D normalized surface moment descriptor (usually described as An) * @@ -38,10 +34,10 @@ * Filip Novotny * *****************************************************************************/ -#include <visp/vpMomentAreaNormalized.h> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentDatabase.h> +#include <visp3/core/vpMomentAreaNormalized.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentDatabase.h> #include <cmath> diff --git a/src/tracking/moments/vpMomentBasic.cpp b/modules/core/src/tracking/moments/vpMomentBasic.cpp similarity index 85% rename from src/tracking/moments/vpMomentBasic.cpp rename to modules/core/src/tracking/moments/vpMomentBasic.cpp index 9dfb71f905fb4702cbd7a59f443ddc3cc71ba745..d9011b3b7f1c25f43f222d9bbe1cd75c20c4b193 100644 --- a/src/tracking/moments/vpMomentBasic.cpp +++ b/modules/core/src/tracking/moments/vpMomentBasic.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentBasic.cpp 4711 2014-03-28 17:41:47Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Basic moment descriptor * @@ -39,8 +35,8 @@ * *****************************************************************************/ -#include <visp/vpMomentBasic.h> -#include <visp/vpMomentObject.h> +#include <visp3/core/vpMomentBasic.h> +#include <visp3/core/vpMomentObject.h> /*! Default constructor. */ diff --git a/src/tracking/moments/vpMomentCInvariant.cpp b/modules/core/src/tracking/moments/vpMomentCInvariant.cpp similarity index 95% rename from src/tracking/moments/vpMomentCInvariant.cpp rename to modules/core/src/tracking/moments/vpMomentCInvariant.cpp index 20230acb13202db68910ed3256bba797ce94f0c8..b02b49a322ad34db913d69815970cf5c3e48fb11 100644 --- a/src/tracking/moments/vpMomentCInvariant.cpp +++ b/modules/core/src/tracking/moments/vpMomentCInvariant.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentCInvariant.cpp 5304 2015-02-10 17:03:04Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Descriptor for various invariants used to drive space roations around X and Y axis. * @@ -39,9 +35,9 @@ * *****************************************************************************/ -#include <visp/vpMomentCInvariant.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentObject.h> +#include <visp3/core/vpMomentCInvariant.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentObject.h> /*! Default constructor. diff --git a/src/tracking/moments/vpMomentCentered.cpp b/modules/core/src/tracking/moments/vpMomentCentered.cpp similarity index 92% rename from src/tracking/moments/vpMomentCentered.cpp rename to modules/core/src/tracking/moments/vpMomentCentered.cpp index 2e0a06693af33aa59e7b73179b9cdc0105a0beff..7a34536a4f3eff34a41996875780408c57cea384 100644 --- a/src/tracking/moments/vpMomentCentered.cpp +++ b/modules/core/src/tracking/moments/vpMomentCentered.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentCentered.cpp 4712 2014-03-28 17:55:43Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Centered moment descriptor * @@ -39,9 +35,9 @@ * *****************************************************************************/ -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentGravityCenter.h> #include <exception> #include <cassert> diff --git a/src/tracking/moments/vpMomentCommon.cpp b/modules/core/src/tracking/moments/vpMomentCommon.cpp similarity index 84% rename from src/tracking/moments/vpMomentCommon.cpp rename to modules/core/src/tracking/moments/vpMomentCommon.cpp index 9c67fcdf96f86d0cb211530bc221917d27d472f1..06450f89ba10a8cd9d395e5bab59332a86ef0588 100644 --- a/src/tracking/moments/vpMomentCommon.cpp +++ b/modules/core/src/tracking/moments/vpMomentCommon.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentCommon.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pre-filled moment database with all commonly used moments. * @@ -39,8 +35,8 @@ * *****************************************************************************/ -#include <visp/vpMomentCommon.h> -#include <visp/vpMomentObject.h> +#include <visp3/core/vpMomentCommon.h> +#include <visp3/core/vpMomentObject.h> /*! Default constructor. Initializes the common database with the following moments: @@ -51,26 +47,21 @@ \param dstZ : destination depth. \param flg_sxsyfromnormalized : flag to enable calculation of sx,sy from normalized moments. */ -vpMomentCommon::vpMomentCommon(double dstSurface,std::vector<double> ref,double refAlpha,double dstZ, bool flg_sxsyfromnormalized): - momentBasic(), - momentGravity(), - momentCentered(), - momentGravityNormalized(), - momentSurfaceNormalized(dstSurface,dstZ), - momentCInvariant(), - momentAlpha(ref,refAlpha), - momentArea() +vpMomentCommon::vpMomentCommon(double dstSurface,std::vector<double> ref,double refAlpha,double dstZ, bool flg_sxsyfromnormalized) + : vpMomentDatabase(), momentBasic(), momentGravity(), momentCentered(), momentGravityNormalized(), + momentSurfaceNormalized(dstSurface,dstZ), momentCInvariant(), momentAlpha(ref,refAlpha), + momentArea() { - momentCInvariant = new vpMomentCInvariant(flg_sxsyfromnormalized); - - momentBasic.linkTo(*this); - momentGravity.linkTo(*this); - momentCentered.linkTo(*this); - momentGravityNormalized.linkTo(*this); - momentSurfaceNormalized.linkTo(*this); - momentCInvariant->linkTo(*this); - momentAlpha.linkTo(*this); - momentArea.linkTo(*this); + momentCInvariant = new vpMomentCInvariant(flg_sxsyfromnormalized); + + momentBasic.linkTo(*this); + momentGravity.linkTo(*this); + momentCentered.linkTo(*this); + momentGravityNormalized.linkTo(*this); + momentSurfaceNormalized.linkTo(*this); + momentCInvariant->linkTo(*this); + momentAlpha.linkTo(*this); + momentArea.linkTo(*this); } /*! @@ -82,10 +73,10 @@ vpMomentGravityCenter,vpMomentCentered,vpMomentAlpha,vpMomentCInvariant,vpMoment Example of using a preconfigured database to compute one of the C-invariants: \code -#include <visp/vpMomentObject.h> -#include <visp/vpPoint.h> -#include <visp/vpMomentCInvariant.h> -#include <visp/vpMomentCommon.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMomentCInvariant.h> +#include <visp3/core/vpMomentCommon.h> #include <iostream> int main() diff --git a/src/tracking/moments/vpMomentDatabase.cpp b/modules/core/src/tracking/moments/vpMomentDatabase.cpp similarity index 87% rename from src/tracking/moments/vpMomentDatabase.cpp rename to modules/core/src/tracking/moments/vpMomentDatabase.cpp index f0c6f15713e1135a544b0eeaaab65f72cec488d9..6fbbda7cafd0b80ebf96ad6bd4ed89c8ae3e82d5 100644 --- a/src/tracking/moments/vpMomentDatabase.cpp +++ b/modules/core/src/tracking/moments/vpMomentDatabase.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentDatabase.cpp 4620 2014-01-27 21:28:32Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pseudo-database used to handle dependencies between moments * @@ -39,11 +35,11 @@ * *****************************************************************************/ -#include <visp/vpMomentDatabase.h> -#include <visp/vpMoment.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpMoment.h> #include <typeinfo> #include <iostream> -#include <visp/vpMomentObject.h> +#include <visp3/core/vpMomentObject.h> /*! Adds a moment to the database. diff --git a/src/tracking/moments/vpMomentGravityCenter.cpp b/modules/core/src/tracking/moments/vpMomentGravityCenter.cpp similarity index 83% rename from src/tracking/moments/vpMomentGravityCenter.cpp rename to modules/core/src/tracking/moments/vpMomentGravityCenter.cpp index 3d1e38fc37fbd39b43a0acf2bdda841fb5b01375..d5d14afbd8a37c9c68e87bf80f47fac46ce94793 100644 --- a/src/tracking/moments/vpMomentGravityCenter.cpp +++ b/modules/core/src/tracking/moments/vpMomentGravityCenter.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentGravityCenter.cpp 4713 2014-03-28 18:02:26Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D Gravity Center moment descriptor (usually described by the pair Xg,Yg) * @@ -39,8 +35,8 @@ * *****************************************************************************/ -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentObject.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentObject.h> /*! Computes the two gravity center coordinates commonly called \f$x_g\f$ and \f$y_g\f$. */ diff --git a/src/tracking/moments/vpMomentGravityCenterNormalized.cpp b/modules/core/src/tracking/moments/vpMomentGravityCenterNormalized.cpp similarity index 86% rename from src/tracking/moments/vpMomentGravityCenterNormalized.cpp rename to modules/core/src/tracking/moments/vpMomentGravityCenterNormalized.cpp index 15da64662ade4a4ceef79255038be7129a6432d4..971eeabf8f5cc6e0541e1f229f3365078a6be409 100644 --- a/src/tracking/moments/vpMomentGravityCenterNormalized.cpp +++ b/modules/core/src/tracking/moments/vpMomentGravityCenterNormalized.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMomentGravityCenterNormalized.cpp 4713 2014-03-28 18:02:26Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D normalized gravity center moment descriptor (usually described by the pair Xn,Yn) * @@ -39,10 +35,10 @@ * *****************************************************************************/ -#include <visp/vpMomentGravityCenterNormalized.h> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentAreaNormalized.h> +#include <visp3/core/vpMomentGravityCenterNormalized.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentAreaNormalized.h> /*! Computes normalized gravity center moment. diff --git a/src/tracking/moments/vpMomentObject.cpp b/modules/core/src/tracking/moments/vpMomentObject.cpp similarity index 93% rename from src/tracking/moments/vpMomentObject.cpp rename to modules/core/src/tracking/moments/vpMomentObject.cpp index 52b518d75c87fa0bc6165a951d642226a7bedb4c..ee2dfb287c01abacb94a2f8d6fb930bd21df8a54 100644 --- a/src/tracking/moments/vpMomentObject.cpp +++ b/modules/core/src/tracking/moments/vpMomentObject.cpp @@ -1,660 +1,656 @@ -/**************************************************************************** - * - * $Id: vpMomentObject.cpp 5301 2015-02-10 16:36:52Z mbakthav $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Object input structure used by moments. - * - * Authors: - * Filip Novotny - * - *****************************************************************************/ - -#include <visp/vpMomentBasic.h> -#include <visp/vpMomentObject.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpConfig.h> -#include <stdexcept> - -#include <cmath> -#include <limits> - -#ifdef VISP_HAVE_OPENMP -#include <omp.h> -#endif -#include <cassert> - -/*! - Computes moments from a vector of points describing a polygon. - The points must be stored in a clockwise order. Used internally. - \param p : moment order (first index) - \param q : moment order (second index) - \param points : vector of points in a clockwise order - - \return moment value -*/ -double vpMomentObject::calc_mom_polygon(unsigned int p, unsigned int q, const std::vector<vpPoint>& points){ - unsigned int i,k,l; - double den,mom,s; - double x_k; - double x_p_k; - double y_l; - double y_q_l; - - den = static_cast<double>( (p+q+2)*(p+q+1)*vpMath::comb(p+q,p) ); - - mom = 0.0; - for (i=1;i<=points.size()-1;i++) - { - s = 0.0; - x_k=1; - for (k=0;k<=p;k++) - { - y_l=1; - x_p_k = pow(points[i-1].get_x(), (int)(p-k)); - for (l=0;l<=q;l++) - { - y_q_l=pow(points[i-1].get_y(), (int)(q-l)); - - s += static_cast<double>( - vpMath::comb(k+l,l) - *vpMath::comb(p+q-k-l,q-l) - *x_k - *x_p_k - *y_l - *y_q_l ); - - y_l*=points[i].get_y(); - - } - x_k*=points[i].get_x(); - - } - - s *= ((points[i-1].get_x())*(points[i].get_y())-(points[i].get_x())*(points[i-1].get_y())); - mom += s; - } - mom /= den; - return(mom); -} - -/*! - Caching to avoid redundant multiplications. - - \param cache : Lookup table that contains the order by order values. For example, - if the order is 3, cache will contain: - \code - 1 x x^2 - y x*y x^2*y - y^2 x*y^2 x^2*y^2 - \endcode - - \param x, y : Coordinates of a point. -*/ -void vpMomentObject::cacheValues(std::vector<double>& cache,double x, double y){ - cache[0]=1; - - for(register unsigned int i=1;i<order;i++) - cache[i]=cache[i-1]*x; - - for(register unsigned int j=order;j<order*order;j+=order) - cache[j]=cache[j-order]*y; - - for(register unsigned int j=1;j<order;j++){ - for(register unsigned int i=1;i<order-j;i++){ - cache[j*order+i] = cache[j*order]*cache[i]; - } - } -} - -/*! - * Manikandan.B - * Need to cache intensity along with the coordinates for photometric moments - */ -void vpMomentObject::cacheValues(std::vector<double>& cache,double x, double y, double IntensityNormalized) { - - cache[0]=IntensityNormalized; - - double invIntensityNormalized = 0.; - if (std::fabs(IntensityNormalized)>=std::numeric_limits<double>::epsilon()) - invIntensityNormalized = 1.0/IntensityNormalized; - - for(register unsigned int i=1;i<order;i++) - cache[i]=cache[i-1]*x; - - for(register unsigned int j=order;j<order*order;j+=order) - cache[j]=cache[j-order]*y; - - for(register unsigned int j=1;j<order;j++){ - for(register unsigned int i=1;i<order-j;i++){ - cache[j*order+i] = cache[j*order]*cache[i]*invIntensityNormalized; - } - } -} - - -/*! - Computes basic moments from a vector of points. - There are two cases: - -# Dense case specified by setType(vpMomentObject::DENSE_POLYGON): - - The points are the vertices describing a closed contour polygon. - - They must be stored in a clockwise order. - - The first and the last points should be the same to close the contour. - -# Discrete case specified by setType(vpMomentObject::DISCRETE) - - The points will be interpreted as a discrete point cloud. - - \param points : Vector of points. - - The code below shows how to use this function to consider a dense object defined by a closed contour. - - \code -#include <visp/vpMomentObject.h> -#include <visp/vpPoint.h> - -int main() -{ - // Define the contour of an object by a 5 clockwise vertices on a plane - vpPoint p; - std::vector<vpPoint> vec_p; // vector that contains the vertices of the contour polygon - - p.set_x(-0.2); p.set_y(0.1); // coordinates in meters in the image plane (vertex 1) - vec_p.push_back(p); - p.set_x(+0.3); p.set_y(0.1); // coordinates in meters in the image plane (vertex 2) - vec_p.push_back(p); - p.set_x(+0.2); p.set_y(-0.1); // coordinates in meters in the image plane (vertex 3) - vec_p.push_back(p); - p.set_x(-0.2); p.set_y(-0.15); // coordinates in meters in the image plane (vertex 4) - vec_p.push_back(p); - p.set_x(-0.2); p.set_y(0.1); // close the contour (vertex 5 = vertex 1) - vec_p.push_back(p); - - vpMomentObject obj(4); // Create an image moment object with 4 as maximum order - obj.setType(vpMomentObject::DENSE_POLYGON); // The object is defined by a countour polygon - obj.fromVector(vec_p); // Init the dense object with the polygon - - return 0; -} - \endcode - - This other example shows how to consider an object as a discrete set of four points. - - \code -#include <visp/vpMomentObject.h> -#include <visp/vpPoint.h> - -int main() -{ - // Define 4 discrete points on a plane - vpPoint p; - std::vector<vpPoint> vec_p; // vector that contains the 4 points - - p.set_x(-0.2); p.set_y(0.1); // coordinates in meters in the image plane (point 1) - vec_p.push_back(p); - p.set_x(+0.3); p.set_y(0.1); // coordinates in meters in the image plane (point 2) - vec_p.push_back(p); - p.set_x(+0.2); p.set_y(-0.1); // coordinates in meters in the image plane (point 3) - vec_p.push_back(p); - p.set_x(-0.2); p.set_y(-0.15); // coordinates in meters in the image plane (point 4) - vec_p.push_back(p); - - vpMomentObject obj(4); // Create an image moment object with 4 as maximum order - obj.setType(vpMomentObject::DISCRETE); // The object is constituted by discrete points - obj.fromVector(vec_p); // Init the dense object with the points - - return 0; -} - \endcode -*/ -void vpMomentObject::fromVector(std::vector<vpPoint>& points){ - if(type==vpMomentObject::DENSE_POLYGON){ - if( - std::abs(points.rbegin()->get_x()-points.begin()->get_x())>std::numeric_limits<double>::epsilon() || - std::abs(points.rbegin()->get_y()-points.begin()->get_y())>std::numeric_limits<double>::epsilon() - ){ - points.resize(points.size()+1); - points[points.size()-1] = points[0]; - } - for(register unsigned int j=0;j<order*order;j++){ - values[j]=calc_mom_polygon(j%order,j/order,points); - } - }else{ - std::vector<double> cache(order*order,0.); - values.assign(order*order,0); - for(register unsigned int i=0;i<points.size();i++){ - cacheValues(cache,points[i].get_x(),points[i].get_y()); - for(register unsigned int j=0;j<order;j++){ - for(register unsigned int k=0;k<order-j;k++){ - values[j*order+k]+=cache[j*order+k]; - } - } - } - } -} - -/*! - Computes basic moments from an image. - There is no assumption made about whether the input is dense or discrete but it's more common to use vpMomentObject::DENSE_FULL_OBJECT with this method. - - \param image : Image to consider. - \param threshold : Pixels with a luminance lower than this threshold will be considered. - \param cam : Camera parameters used to convert pixels coordinates in meters in the image plane. - - The code below shows how to use this function. - \code -#include <visp/vpMomentObject.h> -#include <visp/vpImage.h> - -int main() -{ - vpCameraParameters cam; // Camera parameters used for pixel to meter conversion - vpImage<unsigned char> I(288, 384); // Image used to define the object - // ... Initialize the image - - unsigned char threshold = 128; // Gray level used to define which part of the image belong to the dense object - - vpMomentObject obj(3); // Create an image moment object with 3 as maximum order - obj.fromImage(I, threshold, cam); // Initialize the object from the image - - return 0; -} - \endcode -*/ - -void vpMomentObject::fromImage(const vpImage<unsigned char>& image, unsigned char threshold, const vpCameraParameters& cam){ -#ifdef VISP_HAVE_OPENMP - #pragma omp parallel shared(threshold) - { - std::vector<double> curvals(order*order); - curvals.assign(order*order,0.); - unsigned int i_, j_; - - #pragma omp for nowait//automatically organize loop counter between threads - for(int i=0;i<(int)image.getCols();i++){ - for(int j=0;j<(int)image.getRows();j++){ - i_ = static_cast<unsigned int>(i); - j_ = static_cast<unsigned int>(j); - if(image[j_][i_]>threshold){ - double x=0; - double y=0; - vpPixelMeterConversion::convertPoint(cam,i_,j_,x,y); - - double xval=1.; - double yval=1.; - for(register unsigned int k=0;k<order;k++){ - xval=1.; - for(register unsigned int l=0;l<order-k;l++){ - curvals[(k*order+l)]+=(xval*yval); - xval*=x; - } - yval*=y; - } - } - } - } - - #pragma omp master //only set this variable in master thread - { - values.assign(order*order, 0.); - } - - #pragma omp barrier - - for(register unsigned int k=0;k<order;k++){ - for(register unsigned int l=0;l<order-k;l++){ - #pragma omp atomic - values[k*order+l]+= curvals[k*order+l]; - } - } - - } -#else - std::vector<double> cache(order*order,0.); - values.assign(order*order,0); - for(register unsigned int i=0;i<image.getCols();i++){ - for(register unsigned int j=0;j<image.getRows();j++){ - if(image[j][i]>threshold){ - double x=0; - double y=0; - vpPixelMeterConversion::convertPoint(cam,i,j,x,y); - cacheValues(cache,x,y); - for(register unsigned int k=0;k<order;k++){ - for(register unsigned int l=0;l<order-k;l++){ - values[k*order+l]+=cache[k*order+l]; - } - } - } - } - } -#endif - - //Normalisation equivalent to sampling interval/pixel size delX x delY - double norm_factor = 1./(cam.get_px()*cam.get_py()); - for (std::vector<double>::iterator it = values.begin(); it!=values.end(); it++) { - *it = (*it) * norm_factor; - } -} - -/*! - * Manikandan. B - * Photometric moments v2 - * Intended to be used by 'vpMomentObject's of type DENSE_FULL_OBJECT - * @param image : Grayscale image - * @param cam : Camera parameters (to change to ) - * @param bg_type : White/Black background surrounding the image - * @param normalize_with_pix_size : This flag if SET, the moments, after calculation are normalized w.r.t pixel size - * available from camera parameters - */ -void vpMomentObject::fromImage(const vpImage<unsigned char>& image, const vpCameraParameters& cam, - vpCameraImgBckGrndType bg_type, bool normalize_with_pix_size) -{ - std::vector<double> cache(order*order,0.); - values.assign(order*order,0); - - // (x,y) - Pixel co-ordinates in metres - double x=0; - double y=0; - //for indexing into cache[] and values[] - unsigned int idx = 0; - unsigned int kidx = 0; - - double intensity = 0; - double intensity_white = 0; - - //double Imax = static_cast<double>(image.getMaxValue()); - double Imax = 255.; // To check the effect of gray level change. ISR Coimbra - - double iscale = 1.0; - if (flg_normalize_intensity) // This makes the image a probability density function - iscale = 1.0/Imax; - - if (bg_type == vpMomentObject::WHITE) { - /////////// WHITE BACKGROUND /////////// - for(register unsigned int j=0;j<image.getRows();j++){ - for(register unsigned int i=0;i<image.getCols();i++){ - x = 0; - y = 0; - intensity = (double)(image[j][i])*iscale; - intensity_white = 1. - intensity; - - vpPixelMeterConversion::convertPoint(cam,i,j,x,y); - cacheValues(cache,x,y, intensity_white); // Modify 'cache' which has x^p*y^q to x^p*y^q*(1 - I(x,y)) - - // Copy to "values" - for(register unsigned int k=0;k<order;k++){ - kidx = k*order; - for(register unsigned int l=0;l<order-k;l++){ - idx = kidx+l; - values[idx]+= cache[idx]; - } - } - } - } - } - else { - /////////// BLACK BACKGROUND /////////// - for(register unsigned int j=0;j<image.getRows();j++){ - for(register unsigned int i=0;i<image.getCols();i++){ - x = 0; - y = 0; - intensity = (double)(image[j][i])*iscale; - vpPixelMeterConversion::convertPoint(cam,i,j,x,y); - - // Cache values for fast moment calculation - cacheValues(cache,x,y, intensity); // Modify 'cache' which has x^p*y^q to x^p*y^q*I(x,y) - - // Copy to moments array 'values' - for(register unsigned int k=0;k<order;k++){ - kidx = k*order; - for(register unsigned int l=0;l<order-k;l++){ - idx = kidx+l; - values[idx]+= cache[idx]; - } - } - - } - } - } - - if (normalize_with_pix_size){ - // Normalisation equivalent to sampling interval/pixel size delX x delY - double norm_factor = 1./(cam.get_px()*cam.get_py()); - for (std::vector<double>::iterator it = values.begin(); it!=values.end(); it++) { - *it = (*it) * norm_factor; - } - } -} - -/*! - Does exactly the work of the default constructor as it existed in the very - first version of vpMomentObject - */ -void -vpMomentObject::init(unsigned int orderinp) { - order = orderinp + 1; - type = vpMomentObject::DENSE_FULL_OBJECT; - flg_normalize_intensity = true; // By default, the intensity values are normalized - values.resize((order+1)*(order+1)); - values.assign((order+1)*(order+1),0); -} - -/*! - Helper to copy constructor - */ -void -vpMomentObject::init(const vpMomentObject& objin){ - order = objin.getOrder()+1; - type = objin.getType(); - flg_normalize_intensity = objin.flg_normalize_intensity; - values.resize(objin.values.size()); - values = objin.values; -} - -/*! - Default constructor. - Initializes the object with the maximum used order. You cannot use higher order moments than the order of the moment object. - The parameter specified is the highest desired included order. - All orders up to this values will be computed. In other words, a vpMomentObject will compute all \f$ m_{ij} \f$ moments with \f$ i+j \in [0..order] \f$. - - \param max_order : Maximum reached order (i+j) to be used. All - considered i+j will be of order smaller or equal than this - parameter. For example if this parameter is 5, all moment values of - order 0 to 5 included will be computed. - - Mani : outsourced the constructor work to void init (unsigned int orderinp); -*/ -vpMomentObject::vpMomentObject(unsigned int max_order) - : flg_normalize_intensity(true), order(max_order+1), type(vpMomentObject::DENSE_FULL_OBJECT), - values() -{ - init(max_order); -} - -/*! - Copy constructor - */ -vpMomentObject::vpMomentObject(const vpMomentObject& srcobj) - : flg_normalize_intensity(true), order(1), type(vpMomentObject::DENSE_FULL_OBJECT), - values() -{ - init(srcobj); -} - -/*! - Returns all basic moment values \f$m_{ij}\f$ with \f$i \in [0:\mbox{order}]\f$ and \f$j \in [0:\mbox{order}]\f$. - - \return Vector of moment values. To access \f$m_{ij}\f$, you have to read vpMomentObject::get()[j*(order+1)+i]. - - For example, if the maximal order is 3, the following values are provided: - \code -m00 m10 m20 m01 m11 m21 m02 m12 m12 m30 m03 - \endcode - - To access for example to the basic moment m12, you should use this kind of code: - \code -vpMomentObject obj(3); -// ... initialise the object using fromVector() or fromImage() -std::vector mij = obj.get(); -double m12; -m12 = mij[2*(obj.getOrder()+1)+1]; // i=1 and j=2 - \endcode -*/ -const std::vector<double>& vpMomentObject::get() const { - return values; - -} - -/*! - Returns the basic moment value \f$m_{ij}\f$ corresponding to i,j indexes - - \param i : First moment index, with \f$i+j \leq order\f$. - \param j : Second moment index, with \f$i+j \leq order\f$. -*/ -double vpMomentObject::get(unsigned int i, unsigned int j) const { - assert(i+j<=getOrder()); - if(i+j>=order) throw vpException(vpException::badValue,"The requested value has not been computed, you should specify a higher order."); - - return values[j*order+i]; -} - -/*! - Sets the basic moment value \f$m_{ij}\f$ corresponding to i,j indexes - \param i : First moment index, with \f$i+j \leq order\f$. - \param j : Second moment index, with \f$i+j \leq order\f$. - \param value_ij : Moment value. -*/ -void vpMomentObject::set(unsigned int i, unsigned int j, const double& value_ij){ - assert(i+j<=getOrder()); - if(i+j>=order) throw vpException(vpException::badValue,"The requested value cannot be set, you should specify a higher order for the moment object."); - values[j*order+i] = value_ij; -} - -/*! - Outputs the basic moment's values \f$m_{ij}\f$ to a stream presented as a matrix. - The first line corresponds to \f$m_{0[0:order]}\f$, the second one to \f$m_{1[0:order]}\f$ - Values in table corresponding to a higher order are marked with an "x" and not computed. - - For example, if the maximal order is 3, the following values are provided: - - \code - m00 m10 m20 m30 - m01 m11 m21 x - m02 m12 x x - m03 x x x - \endcode - -*/ -VISP_EXPORT std::ostream & operator<<(std::ostream & os, const vpMomentObject& m){ - for(unsigned int i = 0;i<m.values.size();i++){ - - if(i%(m.order)==0) - os << std::endl; - - if((i%(m.order)+i/(m.order))<m.order) - os << m.values[i] ; - else - os << "x"; - - os << "\t"; - - } - - return os; -} - -/*! - Outputs the raw moment values \f$m_{ij}\f$ in indexed form. - The moment values are same as provided by the operator << which outputs x for uncalculated moments. - */ -void -vpMomentObject::printWithIndices(const vpMomentObject& momobj, std::ostream& os) { - std::vector<double> moment = momobj.get(); - os << std::endl <<"Order of vpMomentObject: "<<momobj.getOrder()<<std::endl; - // Print out values. This is same as printing using operator << - for(unsigned int k=0; k<=momobj.getOrder(); k++) { - for(unsigned int l=0; l<(momobj.getOrder()+1)-k; l++){ - os << "m[" << l << "," << k << "] = " << moment[k*(momobj.getOrder()+1)+ l] << "\t"; - } - os << std::endl; - } - os <<std::endl; -} - -/*! - This function returns a vpMatrix of size (order+1, order+1). -\code - vpMomentObject obj(8); - obj.setType(vpMomentObject::DENSE_FULL_OBJECT); - obj.fromImageWeighted(I, cam, vpMomentObject::BLACK); // cam should have the camera parameters - vpMatrix Mpq = vpMomentObject::convertTovpMatrix(obj); -\endcode - Instead of accessing the moment m21 as obj.get(2,1), you can now do Mpq[2][1]. - This is useful when you want to use the functions available in vpMatrix. - One use case i see now is to copy the contents of the matrix to a file or std::cout. - For instance, like - \code - // Print to console - Mpq.maplePrint(std::cout); - // Or write to a file - std::ofstream fileMpq("Mpq.csv"); - Mpq.maplePrint(fileMpq); -\endcode - -The output can be copied and pasted to MAPLE as a matrix. - -\warning -The moments that are not calculated have zeros. For instance, for a vpMomentObject of order 8, -the moment m[7,2] is not calculated. It will have 0 by default. User discretion is advised. -*/ -vpMatrix -vpMomentObject::convertTovpMatrix(const vpMomentObject& momobj) { - std::vector<double> moment = momobj.get(); - unsigned int order = momobj.getOrder(); - vpMatrix M(order+1, order+1); - for(unsigned int k=0; k<=order; k++) { - for(unsigned int l=0; l<(order+1)-k; l++){ - M[l][k] = moment[k*(order+1)+ l]; - } - } - return M; -} - -/*! - Nothing to destruct. This will allow for a polymorphic usage - For instance, - \code - vpMomentObject* obj = new vpWeightedMomentObject(weightfunc,ORDER); where vpWeightedMomentObject is child class of vpMomentObject - \endcode - */ -vpMomentObject::~vpMomentObject(){ -// deliberate empty -} +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Object input structure used by moments. + * + * Authors: + * Filip Novotny + * + *****************************************************************************/ + +#include <visp3/core/vpMomentBasic.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/core/vpConfig.h> +#include <stdexcept> + +#include <cmath> +#include <limits> + +#ifdef VISP_HAVE_OPENMP +#include <omp.h> +#endif +#include <cassert> + +/*! + Computes moments from a vector of points describing a polygon. + The points must be stored in a clockwise order. Used internally. + \param p : moment order (first index) + \param q : moment order (second index) + \param points : vector of points in a clockwise order + + \return moment value +*/ +double vpMomentObject::calc_mom_polygon(unsigned int p, unsigned int q, const std::vector<vpPoint>& points){ + unsigned int i,k,l; + double den,mom,s; + double x_k; + double x_p_k; + double y_l; + double y_q_l; + + den = static_cast<double>( (p+q+2)*(p+q+1)*vpMath::comb(p+q,p) ); + + mom = 0.0; + for (i=1;i<=points.size()-1;i++) + { + s = 0.0; + x_k=1; + for (k=0;k<=p;k++) + { + y_l=1; + x_p_k = pow(points[i-1].get_x(), (int)(p-k)); + for (l=0;l<=q;l++) + { + y_q_l=pow(points[i-1].get_y(), (int)(q-l)); + + s += static_cast<double>( + vpMath::comb(k+l,l) + *vpMath::comb(p+q-k-l,q-l) + *x_k + *x_p_k + *y_l + *y_q_l ); + + y_l*=points[i].get_y(); + + } + x_k*=points[i].get_x(); + + } + + s *= ((points[i-1].get_x())*(points[i].get_y())-(points[i].get_x())*(points[i-1].get_y())); + mom += s; + } + mom /= den; + return(mom); +} + +/*! + Caching to avoid redundant multiplications. + + \param cache : Lookup table that contains the order by order values. For example, + if the order is 3, cache will contain: + \code + 1 x x^2 + y x*y x^2*y + y^2 x*y^2 x^2*y^2 + \endcode + + \param x, y : Coordinates of a point. +*/ +void vpMomentObject::cacheValues(std::vector<double>& cache,double x, double y){ + cache[0]=1; + + for(register unsigned int i=1;i<order;i++) + cache[i]=cache[i-1]*x; + + for(register unsigned int j=order;j<order*order;j+=order) + cache[j]=cache[j-order]*y; + + for(register unsigned int j=1;j<order;j++){ + for(register unsigned int i=1;i<order-j;i++){ + cache[j*order+i] = cache[j*order]*cache[i]; + } + } +} + +/*! + * Manikandan.B + * Need to cache intensity along with the coordinates for photometric moments + */ +void vpMomentObject::cacheValues(std::vector<double>& cache,double x, double y, double IntensityNormalized) { + + cache[0]=IntensityNormalized; + + double invIntensityNormalized = 0.; + if (std::fabs(IntensityNormalized)>=std::numeric_limits<double>::epsilon()) + invIntensityNormalized = 1.0/IntensityNormalized; + + for(register unsigned int i=1;i<order;i++) + cache[i]=cache[i-1]*x; + + for(register unsigned int j=order;j<order*order;j+=order) + cache[j]=cache[j-order]*y; + + for(register unsigned int j=1;j<order;j++){ + for(register unsigned int i=1;i<order-j;i++){ + cache[j*order+i] = cache[j*order]*cache[i]*invIntensityNormalized; + } + } +} + + +/*! + Computes basic moments from a vector of points. + There are two cases: + -# Dense case specified by setType(vpMomentObject::DENSE_POLYGON): + - The points are the vertices describing a closed contour polygon. + - They must be stored in a clockwise order. + - The first and the last points should be the same to close the contour. + -# Discrete case specified by setType(vpMomentObject::DISCRETE) + - The points will be interpreted as a discrete point cloud. + + \param points : Vector of points. + + The code below shows how to use this function to consider a dense object defined by a closed contour. + + \code +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpPoint.h> + +int main() +{ + // Define the contour of an object by a 5 clockwise vertices on a plane + vpPoint p; + std::vector<vpPoint> vec_p; // vector that contains the vertices of the contour polygon + + p.set_x(-0.2); p.set_y(0.1); // coordinates in meters in the image plane (vertex 1) + vec_p.push_back(p); + p.set_x(+0.3); p.set_y(0.1); // coordinates in meters in the image plane (vertex 2) + vec_p.push_back(p); + p.set_x(+0.2); p.set_y(-0.1); // coordinates in meters in the image plane (vertex 3) + vec_p.push_back(p); + p.set_x(-0.2); p.set_y(-0.15); // coordinates in meters in the image plane (vertex 4) + vec_p.push_back(p); + p.set_x(-0.2); p.set_y(0.1); // close the contour (vertex 5 = vertex 1) + vec_p.push_back(p); + + vpMomentObject obj(4); // Create an image moment object with 4 as maximum order + obj.setType(vpMomentObject::DENSE_POLYGON); // The object is defined by a countour polygon + obj.fromVector(vec_p); // Init the dense object with the polygon + + return 0; +} + \endcode + + This other example shows how to consider an object as a discrete set of four points. + + \code +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpPoint.h> + +int main() +{ + // Define 4 discrete points on a plane + vpPoint p; + std::vector<vpPoint> vec_p; // vector that contains the 4 points + + p.set_x(-0.2); p.set_y(0.1); // coordinates in meters in the image plane (point 1) + vec_p.push_back(p); + p.set_x(+0.3); p.set_y(0.1); // coordinates in meters in the image plane (point 2) + vec_p.push_back(p); + p.set_x(+0.2); p.set_y(-0.1); // coordinates in meters in the image plane (point 3) + vec_p.push_back(p); + p.set_x(-0.2); p.set_y(-0.15); // coordinates in meters in the image plane (point 4) + vec_p.push_back(p); + + vpMomentObject obj(4); // Create an image moment object with 4 as maximum order + obj.setType(vpMomentObject::DISCRETE); // The object is constituted by discrete points + obj.fromVector(vec_p); // Init the dense object with the points + + return 0; +} + \endcode +*/ +void vpMomentObject::fromVector(std::vector<vpPoint>& points){ + if(type==vpMomentObject::DENSE_POLYGON){ + if( + std::abs(points.rbegin()->get_x()-points.begin()->get_x())>std::numeric_limits<double>::epsilon() || + std::abs(points.rbegin()->get_y()-points.begin()->get_y())>std::numeric_limits<double>::epsilon() + ){ + points.resize(points.size()+1); + points[points.size()-1] = points[0]; + } + for(register unsigned int j=0;j<order*order;j++){ + values[j]=calc_mom_polygon(j%order,j/order,points); + } + }else{ + std::vector<double> cache(order*order,0.); + values.assign(order*order,0); + for(register unsigned int i=0;i<points.size();i++){ + cacheValues(cache,points[i].get_x(),points[i].get_y()); + for(register unsigned int j=0;j<order;j++){ + for(register unsigned int k=0;k<order-j;k++){ + values[j*order+k]+=cache[j*order+k]; + } + } + } + } +} + +/*! + Computes basic moments from an image. + There is no assumption made about whether the input is dense or discrete but it's more common to use vpMomentObject::DENSE_FULL_OBJECT with this method. + + \param image : Image to consider. + \param threshold : Pixels with a luminance lower than this threshold will be considered. + \param cam : Camera parameters used to convert pixels coordinates in meters in the image plane. + + The code below shows how to use this function. + \code +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpImage.h> + +int main() +{ + vpCameraParameters cam; // Camera parameters used for pixel to meter conversion + vpImage<unsigned char> I(288, 384); // Image used to define the object + // ... Initialize the image + + unsigned char threshold = 128; // Gray level used to define which part of the image belong to the dense object + + vpMomentObject obj(3); // Create an image moment object with 3 as maximum order + obj.fromImage(I, threshold, cam); // Initialize the object from the image + + return 0; +} + \endcode +*/ + +void vpMomentObject::fromImage(const vpImage<unsigned char>& image, unsigned char threshold, const vpCameraParameters& cam){ +#ifdef VISP_HAVE_OPENMP + #pragma omp parallel shared(threshold) + { + std::vector<double> curvals(order*order); + curvals.assign(order*order,0.); + unsigned int i_, j_; + + #pragma omp for nowait//automatically organize loop counter between threads + for(int i=0;i<(int)image.getCols();i++){ + for(int j=0;j<(int)image.getRows();j++){ + i_ = static_cast<unsigned int>(i); + j_ = static_cast<unsigned int>(j); + if(image[j_][i_]>threshold){ + double x=0; + double y=0; + vpPixelMeterConversion::convertPoint(cam,i_,j_,x,y); + + double xval=1.; + double yval=1.; + for(register unsigned int k=0;k<order;k++){ + xval=1.; + for(register unsigned int l=0;l<order-k;l++){ + curvals[(k*order+l)]+=(xval*yval); + xval*=x; + } + yval*=y; + } + } + } + } + + #pragma omp master //only set this variable in master thread + { + values.assign(order*order, 0.); + } + + #pragma omp barrier + + for(register unsigned int k=0;k<order;k++){ + for(register unsigned int l=0;l<order-k;l++){ + //#pragma omp atomic // Removed since causes a build issue with msvc14 2015 + values[k*order+l]+= curvals[k*order+l]; + } + } + + } +#else + std::vector<double> cache(order*order,0.); + values.assign(order*order,0); + for(register unsigned int i=0;i<image.getCols();i++){ + for(register unsigned int j=0;j<image.getRows();j++){ + if(image[j][i]>threshold){ + double x=0; + double y=0; + vpPixelMeterConversion::convertPoint(cam,i,j,x,y); + cacheValues(cache,x,y); + for(register unsigned int k=0;k<order;k++){ + for(register unsigned int l=0;l<order-k;l++){ + values[k*order+l]+=cache[k*order+l]; + } + } + } + } + } +#endif + + //Normalisation equivalent to sampling interval/pixel size delX x delY + double norm_factor = 1./(cam.get_px()*cam.get_py()); + for (std::vector<double>::iterator it = values.begin(); it!=values.end(); it++) { + *it = (*it) * norm_factor; + } +} + +/*! + * Manikandan. B + * Photometric moments v2 + * Intended to be used by 'vpMomentObject's of type DENSE_FULL_OBJECT + * @param image : Grayscale image + * @param cam : Camera parameters (to change to ) + * @param bg_type : White/Black background surrounding the image + * @param normalize_with_pix_size : This flag if SET, the moments, after calculation are normalized w.r.t pixel size + * available from camera parameters + */ +void vpMomentObject::fromImage(const vpImage<unsigned char>& image, const vpCameraParameters& cam, + vpCameraImgBckGrndType bg_type, bool normalize_with_pix_size) +{ + std::vector<double> cache(order*order,0.); + values.assign(order*order,0); + + // (x,y) - Pixel co-ordinates in metres + double x=0; + double y=0; + //for indexing into cache[] and values[] + unsigned int idx = 0; + unsigned int kidx = 0; + + double intensity = 0; + double intensity_white = 0; + + //double Imax = static_cast<double>(image.getMaxValue()); + double Imax = 255.; // To check the effect of gray level change. ISR Coimbra + + double iscale = 1.0; + if (flg_normalize_intensity) // This makes the image a probability density function + iscale = 1.0/Imax; + + if (bg_type == vpMomentObject::WHITE) { + /////////// WHITE BACKGROUND /////////// + for(register unsigned int j=0;j<image.getRows();j++){ + for(register unsigned int i=0;i<image.getCols();i++){ + x = 0; + y = 0; + intensity = (double)(image[j][i])*iscale; + intensity_white = 1. - intensity; + + vpPixelMeterConversion::convertPoint(cam,i,j,x,y); + cacheValues(cache,x,y, intensity_white); // Modify 'cache' which has x^p*y^q to x^p*y^q*(1 - I(x,y)) + + // Copy to "values" + for(register unsigned int k=0;k<order;k++){ + kidx = k*order; + for(register unsigned int l=0;l<order-k;l++){ + idx = kidx+l; + values[idx]+= cache[idx]; + } + } + } + } + } + else { + /////////// BLACK BACKGROUND /////////// + for(register unsigned int j=0;j<image.getRows();j++){ + for(register unsigned int i=0;i<image.getCols();i++){ + x = 0; + y = 0; + intensity = (double)(image[j][i])*iscale; + vpPixelMeterConversion::convertPoint(cam,i,j,x,y); + + // Cache values for fast moment calculation + cacheValues(cache,x,y, intensity); // Modify 'cache' which has x^p*y^q to x^p*y^q*I(x,y) + + // Copy to moments array 'values' + for(register unsigned int k=0;k<order;k++){ + kidx = k*order; + for(register unsigned int l=0;l<order-k;l++){ + idx = kidx+l; + values[idx]+= cache[idx]; + } + } + + } + } + } + + if (normalize_with_pix_size){ + // Normalisation equivalent to sampling interval/pixel size delX x delY + double norm_factor = 1./(cam.get_px()*cam.get_py()); + for (std::vector<double>::iterator it = values.begin(); it!=values.end(); it++) { + *it = (*it) * norm_factor; + } + } +} + +/*! + Does exactly the work of the default constructor as it existed in the very + first version of vpMomentObject + */ +void +vpMomentObject::init(unsigned int orderinp) { + order = orderinp + 1; + type = vpMomentObject::DENSE_FULL_OBJECT; + flg_normalize_intensity = true; // By default, the intensity values are normalized + values.resize((order+1)*(order+1)); + values.assign((order+1)*(order+1),0); +} + +/*! + Helper to copy constructor + */ +void +vpMomentObject::init(const vpMomentObject& objin){ + order = objin.getOrder()+1; + type = objin.getType(); + flg_normalize_intensity = objin.flg_normalize_intensity; + values.resize(objin.values.size()); + values = objin.values; +} + +/*! + Default constructor. + Initializes the object with the maximum used order. You cannot use higher order moments than the order of the moment object. + The parameter specified is the highest desired included order. + All orders up to this values will be computed. In other words, a vpMomentObject will compute all \f$ m_{ij} \f$ moments with \f$ i+j \in [0..order] \f$. + + \param max_order : Maximum reached order (i+j) to be used. All + considered i+j will be of order smaller or equal than this + parameter. For example if this parameter is 5, all moment values of + order 0 to 5 included will be computed. + + Mani : outsourced the constructor work to void init (unsigned int orderinp); +*/ +vpMomentObject::vpMomentObject(unsigned int max_order) + : flg_normalize_intensity(true), order(max_order+1), type(vpMomentObject::DENSE_FULL_OBJECT), + values() +{ + init(max_order); +} + +/*! + Copy constructor + */ +vpMomentObject::vpMomentObject(const vpMomentObject& srcobj) + : flg_normalize_intensity(true), order(1), type(vpMomentObject::DENSE_FULL_OBJECT), + values() +{ + init(srcobj); +} + +/*! + Returns all basic moment values \f$m_{ij}\f$ with \f$i \in [0:\mbox{order}]\f$ and \f$j \in [0:\mbox{order}]\f$. + + \return Vector of moment values. To access \f$m_{ij}\f$, you have to read vpMomentObject::get()[j*(order+1)+i]. + + For example, if the maximal order is 3, the following values are provided: + \code +m00 m10 m20 m01 m11 m21 m02 m12 m12 m30 m03 + \endcode + + To access for example to the basic moment m12, you should use this kind of code: + \code +vpMomentObject obj(3); +// ... initialise the object using fromVector() or fromImage() +std::vector mij = obj.get(); +double m12; +m12 = mij[2*(obj.getOrder()+1)+1]; // i=1 and j=2 + \endcode +*/ +const std::vector<double>& vpMomentObject::get() const { + return values; + +} + +/*! + Returns the basic moment value \f$m_{ij}\f$ corresponding to i,j indexes + + \param i : First moment index, with \f$i+j \leq order\f$. + \param j : Second moment index, with \f$i+j \leq order\f$. +*/ +double vpMomentObject::get(unsigned int i, unsigned int j) const { + assert(i+j<=getOrder()); + if(i+j>=order) throw vpException(vpException::badValue,"The requested value has not been computed, you should specify a higher order."); + + return values[j*order+i]; +} + +/*! + Sets the basic moment value \f$m_{ij}\f$ corresponding to i,j indexes + \param i : First moment index, with \f$i+j \leq order\f$. + \param j : Second moment index, with \f$i+j \leq order\f$. + \param value_ij : Moment value. +*/ +void vpMomentObject::set(unsigned int i, unsigned int j, const double& value_ij){ + assert(i+j<=getOrder()); + if(i+j>=order) throw vpException(vpException::badValue,"The requested value cannot be set, you should specify a higher order for the moment object."); + values[j*order+i] = value_ij; +} + +/*! + Outputs the basic moment's values \f$m_{ij}\f$ to a stream presented as a matrix. + The first line corresponds to \f$m_{0[0:order]}\f$, the second one to \f$m_{1[0:order]}\f$ + Values in table corresponding to a higher order are marked with an "x" and not computed. + + For example, if the maximal order is 3, the following values are provided: + + \code + m00 m10 m20 m30 + m01 m11 m21 x + m02 m12 x x + m03 x x x + \endcode + +*/ +VISP_EXPORT std::ostream & operator<<(std::ostream & os, const vpMomentObject& m){ + for(unsigned int i = 0;i<m.values.size();i++){ + + if(i%(m.order)==0) + os << std::endl; + + if((i%(m.order)+i/(m.order))<m.order) + os << m.values[i] ; + else + os << "x"; + + os << "\t"; + + } + + return os; +} + +/*! + Outputs the raw moment values \f$m_{ij}\f$ in indexed form. + The moment values are same as provided by the operator << which outputs x for uncalculated moments. + */ +void +vpMomentObject::printWithIndices(const vpMomentObject& momobj, std::ostream& os) { + std::vector<double> moment = momobj.get(); + os << std::endl <<"Order of vpMomentObject: "<<momobj.getOrder()<<std::endl; + // Print out values. This is same as printing using operator << + for(unsigned int k=0; k<=momobj.getOrder(); k++) { + for(unsigned int l=0; l<(momobj.getOrder()+1)-k; l++){ + os << "m[" << l << "," << k << "] = " << moment[k*(momobj.getOrder()+1)+ l] << "\t"; + } + os << std::endl; + } + os <<std::endl; +} + +/*! + This function returns a vpMatrix of size (order+1, order+1). +\code + vpMomentObject obj(8); + obj.setType(vpMomentObject::DENSE_FULL_OBJECT); + obj.fromImageWeighted(I, cam, vpMomentObject::BLACK); // cam should have the camera parameters + vpMatrix Mpq = vpMomentObject::convertTovpMatrix(obj); +\endcode + Instead of accessing the moment m21 as obj.get(2,1), you can now do Mpq[2][1]. + This is useful when you want to use the functions available in vpMatrix. + One use case i see now is to copy the contents of the matrix to a file or std::cout. + For instance, like + \code + // Print to console + Mpq.maplePrint(std::cout); + // Or write to a file + std::ofstream fileMpq("Mpq.csv"); + Mpq.maplePrint(fileMpq); +\endcode + +The output can be copied and pasted to MAPLE as a matrix. + +\warning +The moments that are not calculated have zeros. For instance, for a vpMomentObject of order 8, +the moment m[7,2] is not calculated. It will have 0 by default. User discretion is advised. +*/ +vpMatrix +vpMomentObject::convertTovpMatrix(const vpMomentObject& momobj) { + std::vector<double> moment = momobj.get(); + unsigned int order = momobj.getOrder(); + vpMatrix M(order+1, order+1); + for(unsigned int k=0; k<=order; k++) { + for(unsigned int l=0; l<(order+1)-k; l++){ + M[l][k] = moment[k*(order+1)+ l]; + } + } + return M; +} + +/*! + Nothing to destruct. This will allow for a polymorphic usage + For instance, + \code + vpMomentObject* obj = new vpWeightedMomentObject(weightfunc,ORDER); where vpWeightedMomentObject is child class of vpMomentObject + \endcode + */ +vpMomentObject::~vpMomentObject(){ +// deliberate empty +} diff --git a/src/tracking/general-tracking-issues/vpTracker.cpp b/modules/core/src/tracking/vpTracker.cpp similarity index 78% rename from src/tracking/general-tracking-issues/vpTracker.cpp rename to modules/core/src/tracking/vpTracker.cpp index 4e3757115921cbfd90e20df5f7e0157afbc91034..5b61accdcdc6ab170801f495166be7441586d3ff 100644 --- a/src/tracking/general-tracking-issues/vpTracker.cpp +++ b/modules/core/src/tracking/vpTracker.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpTracker.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Generic tracker. * @@ -40,8 +36,8 @@ *****************************************************************************/ -#include <visp/vpTracker.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpTracker.h> +#include <visp3/core/vpDebug.h> /*! diff --git a/test/camera/testCameraParametersConversion.cpp b/modules/core/test/camera/testCameraParametersConversion.cpp similarity index 60% rename from test/camera/testCameraParametersConversion.cpp rename to modules/core/test/camera/testCameraParametersConversion.cpp index f8a70f9f77cfffe22ffa827638967bb1b5c9b52a..f86716b3b44f2792670d78111098f5c24cc0bc9c 100644 --- a/test/camera/testCameraParametersConversion.cpp +++ b/modules/core/test/camera/testCameraParametersConversion.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testCameraParametersConversion.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Performs various tests on the vpPixelMeterConversion and * vpPixelMeterConversion class. @@ -49,87 +45,18 @@ vpPixelMeterConversion class. */ -// List of allowed command line options -#define GETOPTARGS "h" - -#include <visp/vpMath.h> -#include <visp/vpDebug.h> -#include <visp/vpParseArgv.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/core/vpMath.h> #include <stdlib.h> #include <stdio.h> -void usage(const char *name, const char *badparam); -bool getOptions(int argc, const char **argv); - -/*! - - Print the program options. - -*/ -void usage(const char *name, const char *badparam) -{ - fprintf(stdout, "\n\ - Performs various tests on the vpPixelMeterConversion and\n\ - vpPixelMeterConversion class.\n\ -\n\ -SYNOPSIS\n\ - %s [-h]\n", name); - - fprintf(stdout, "\n\ -OPTIONS: Default\n\ - -h\n\ - Print the help.\n"); - - if (badparam) - fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); -} -/*! - - Set the program options. - - \return false if the program has to be stopped, true otherwise. - -*/ -bool getOptions(int argc, const char **argv) -{ - const char *optarg_; - int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { - - switch (c) { - case 'h': usage(argv[0], NULL); return false; break; - - default: - usage(argv[0], optarg_); - return false; break; - } - } - - if ((c == 1) || (c == -1)) { - // standalone param or error - usage(argv[0], NULL); - std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; - return false; - } - - return true; -} - - -int -main(int argc, const char ** argv) +int main() { try { - // Read the command line options - if (getOptions(argc, argv) == false) { - exit (-1); - } - vpCameraParameters cam; double px,py,u0,v0; px = 1657.429131; diff --git a/test/image/testConversion.cpp b/modules/core/test/image/testConversion.cpp similarity index 81% rename from test/image/testConversion.cpp rename to modules/core/test/image/testConversion.cpp index 4fe6cfd2fbd24874b438b80babc4bda958811a82..df0175778ee42e560ea5d0944e2fd77f35c0ddc3 100644 --- a/test/image/testConversion.cpp +++ b/modules/core/test/image/testConversion.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testConversion.cpp 5023 2014-12-03 16:07:48Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for image conversions. * @@ -41,14 +37,14 @@ #include <stdlib.h> -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> -#include <visp/vpDebug.h> -#include <visp/vpTime.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpTime.h> /*! @@ -59,7 +55,7 @@ */ // List of allowed command line options -#define GETOPTARGS "i:o:h" +#define GETOPTARGS "cdi:o:h" void usage(const char *name, const char *badparam, std::string ipath, std::string opath, std::string user); bool getOptions(int argc, const char **argv, std::string &ipath, std::string &opath, std::string user); @@ -133,6 +129,10 @@ bool getOptions(int argc, const char **argv, std::string &ipath, std::string &op case 'o': opath = optarg_; break; case 'h': usage(argv[0], NULL, ipath, opath, user); return false; break; + case 'c': + case 'd': + break; + default: usage(argv[0], optarg_, ipath, opath, user); return false; break; } @@ -555,9 +555,113 @@ main(int argc, const char ** argv) vpCTRACE << "Write " << filename << std::endl; vpImageIo::write(B, filename) ; vpCTRACE<< "Convert result in "<<std::endl<< filename << std::endl; + + //////////////////////////////////// + // Merge 4 vpImage<unsigned char> (RGBa) to vpImage<vpRGBa> + //////////////////////////////////// + vpImageConvert::split(Ic, &R, &G, &B, &a); + begintime = vpTime::measureTimeMs(); + vpImage<vpRGBa> I_merge; + for(int i=0; i<1000; i++){ + vpImageConvert::merge(&R, &G, &B, &a, I_merge); + } + endtime = vpTime::measureTimeMs(); + + std::cout<<"Time for 1000 merge (ms): "<< endtime - begintime <<std::endl; + + filename = vpIoTools::createFilePath(opath, "Klimt_merge.ppm"); + /* Save the the current image */ + vpImageIo::write(I_merge, filename) ; + + //////////////////////////////////// + // Convert a vpImage<vpRGBa> in RGB color space to a vpImage<vpRGBa> in HSV color + //////////////////////////////////// + unsigned int size = Ic.getWidth()*Ic.getHeight(); + unsigned int w = Ic.getWidth(), h = Ic.getHeight(); + unsigned char *hue = new unsigned char[size]; + unsigned char *saturation = new unsigned char[size]; + unsigned char *value = new unsigned char[size]; + + vpImageConvert::RGBaToHSV((unsigned char *) Ic.bitmap, hue, saturation, value, size); + vpImage<unsigned char> I_hue(hue, h, w); + vpImage<unsigned char> I_saturation(saturation, h, w); + vpImage<unsigned char> I_value(value, h, w); + vpImage<vpRGBa> I_HSV; + vpImageConvert::merge(&I_hue, &I_saturation, &I_value, NULL, I_HSV); + + filename = vpIoTools::createFilePath(opath, "Klimt_HSV.ppm"); + /* Save the the current image */ + vpImageIo::write(I_HSV, filename); + + //Check the conversion RGBa <==> HSV + double *hue2 = new double[size]; + double *saturation2 = new double[size]; + double *value2 = new double[size]; + vpImageConvert::RGBaToHSV((unsigned char *) Ic.bitmap, hue2, saturation2, value2, size); + + unsigned char *rgba = new unsigned char[size*4]; + vpImageConvert::HSVToRGBa(hue2, saturation2, value2, rgba, size); + + if(hue2 != NULL) { + delete[] hue2; + hue2 = NULL; + } + + if(saturation2 != NULL) { + delete[] saturation2; + saturation2 = NULL; + } + + if(value2 != NULL) { + delete[] value2; + value2 = NULL; + } + + vpImage<vpRGBa> I_HSV2RGBa((vpRGBa *) rgba, h, w); + filename = vpIoTools::createFilePath(opath, "Klimt_HSV2RGBa.ppm"); + /* Save the the current image */ + vpImageIo::write(I_HSV2RGBa, filename); + + for(unsigned int i = 0; i < Ic.getHeight(); i++) { + for(unsigned int j = 0; j < Ic.getWidth(); j++) { + if(Ic[i][j].R != I_HSV2RGBa[i][j].R || + Ic[i][j].G != I_HSV2RGBa[i][j].G || + Ic[i][j].B != I_HSV2RGBa[i][j].B) { + std::cerr << "Ic[i][j].R=" << static_cast<unsigned>(Ic[i][j].R) + << " ; I_HSV2RGBa[i][j].R=" << static_cast<unsigned>(I_HSV2RGBa[i][j].R) << std::endl; + std::cerr << "Ic[i][j].G=" << static_cast<unsigned>(Ic[i][j].G) + << " ; I_HSV2RGBa[i][j].G=" << static_cast<unsigned>(I_HSV2RGBa[i][j].G) << std::endl; + std::cerr << "Ic[i][j].B=" << static_cast<unsigned>(Ic[i][j].B) + << " ; I_HSV2RGBa[i][j].B=" << static_cast<unsigned>(I_HSV2RGBa[i][j].B) << std::endl; + throw vpException(vpException::fatalError, "Problem with conversion between RGB <==> HSV"); + } + } + } + + //////////////////////////////////// + // Test construction of vpImage from an array with copyData==true + //////////////////////////////////// + unsigned char *rgba2 = new unsigned char[size*4]; + memset(rgba2, 127, size*4); + vpImage<vpRGBa> I_copyData((vpRGBa *) rgba2, h, w, true); + + //Delete the array + if(rgba2 != NULL) { + delete[] rgba2; + rgba2 = NULL; + } + + filename = vpIoTools::createFilePath(opath, "I_copyData.ppm"); + /* Save the the current image */ + vpImageIo::write(I_copyData, filename); + + if(I_copyData.getSize() > 0) { + I_copyData[0][0].R = 10; + } + return 0; } - catch(vpException e) { + catch(vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return 1; } diff --git a/test/image/testCreateSubImage.cpp b/modules/core/test/image/testCreateSubImage.cpp similarity index 92% rename from test/image/testCreateSubImage.cpp rename to modules/core/test/image/testCreateSubImage.cpp index 9f33448d36de4cd0bc78bc2e0a6618864a839dd6..1c0e8d0e5a7e1ef8cf35241eb7ec30a38b898864 100644 --- a/test/image/testCreateSubImage.cpp +++ b/modules/core/test/image/testCreateSubImage.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testCreateSubImage.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for sub-image extraction. * @@ -39,13 +35,13 @@ * *****************************************************************************/ -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageTools.h> -#include <visp/vpIoTools.h> -#include <visp/vpRect.h> -#include <visp/vpParseArgv.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpRect.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> @@ -60,7 +56,7 @@ */ // List of allowed command line options -#define GETOPTARGS "i:o:h" +#define GETOPTARGS "cdi:o:h" void usage(const char *name, const char *badparam, std::string ipath, std::string opath, std::string user); bool getOptions(int argc, const char **argv, std::string &ipath, std::string &opath, std::string user); @@ -134,6 +130,10 @@ bool getOptions(int argc, const char **argv, std::string &ipath, std::string &op case 'o': opath = optarg_; break; case 'h': usage(argv[0], NULL, ipath, opath, user); return false; break; + case 'c': + case 'd': + break; + default: usage(argv[0], optarg_, ipath, opath, user); return false; break; } diff --git a/modules/core/test/image/testImageBinarise.cpp b/modules/core/test/image/testImageBinarise.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a863698d0d181728c91043740ed97b2fde58fb47 --- /dev/null +++ b/modules/core/test/image/testImageBinarise.cpp @@ -0,0 +1,179 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test for vpImageTools::binarise() function. + * + * Authors: + * Souriya Trinh + * + *****************************************************************************/ +/*! + \example testImageBinarise.cpp + + \brief Test vpImageTools::binarise() function. + +*/ + +#include <visp3/core/vpImageTools.h> + + +int main() +{ + std::cout << "Test vpImageTools::binarise() with different data types." << std::endl; + + unsigned int width = 5, height = 4; + unsigned char *uchar_array = new unsigned char[width*height]; + double *double_array = new double[width*height]; + vpRGBa *rgba_array = new vpRGBa[width*height]; + for(unsigned char i = 0; i < width*height; i++) { + uchar_array[i] = i; + double_array[i] = i; + rgba_array[i] = vpRGBa(i, i, i, i); + } + + vpImage<unsigned char> I(uchar_array, height, width); + vpImage<double> I_double(double_array, height, width); + vpImage<vpRGBa> I_rgba(rgba_array, height, width); + + std::cout << "I:" << std::endl; + for(unsigned int i = 0; i < I.getHeight(); i++) { + for(unsigned int j = 0; j < I.getWidth(); j++) { + std::cout << static_cast<unsigned>(I[i][j]) << " "; + } + std::cout << std::endl; + } + + std::cout << "\nI_double:" << std::endl; + for(unsigned int i = 0; i < I_double.getHeight(); i++) { + for(unsigned int j = 0; j < I_double.getWidth(); j++) { + std::cout << I_double[i][j] << " "; + } + std::cout << std::endl; + } + + std::cout << "\nI_rgba:" << std::endl; + for(unsigned int i = 0; i < I_rgba.getHeight(); i++) { + for(unsigned int j = 0; j < I_rgba.getWidth(); j++) { + std::cout << static_cast<unsigned>(I_rgba[i][j].R) << " ; " << static_cast<unsigned>(I_rgba[i][j].G) << " ; " + << static_cast<unsigned>(I_rgba[i][j].B) << " ; " << static_cast<unsigned int>(I_rgba[i][j].A) << std::endl; + } + std::cout << std::endl; + } + + vpImageTools::binarise(I, (unsigned char) 5, (unsigned char) 12, (unsigned char) 0, (unsigned char) 127, (unsigned char) 255); + vpImageTools::binarise(I_double, 5.0, 12.0, 0.0, 127.0, 255.0); + vpImageTools::binarise(I_rgba, vpRGBa(5), vpRGBa(12), vpRGBa(0), vpRGBa(127), vpRGBa(255)); + + std::cout << "\nI binarise:" << std::endl; + for(unsigned int i = 0; i < I.getHeight(); i++) { + for(unsigned int j = 0; j < I.getWidth(); j++) { + std::cout << static_cast<unsigned>(I[i][j]) << " "; + } + std::cout << std::endl; + } + + std::cout << "\nI_double binarise:" << std::endl; + for(unsigned int i = 0; i < I_double.getHeight(); i++) { + for(unsigned int j = 0; j < I_double.getWidth(); j++) { + std::cout << I_double[i][j] << " "; + } + std::cout << std::endl; + } + + std::cout << "\nI_rgba binarise:" << std::endl; + for(unsigned int i = 0; i < I_rgba.getHeight(); i++) { + for(unsigned int j = 0; j < I_rgba.getWidth(); j++) { + std::cout << static_cast<unsigned>(I_rgba[i][j].R) << " ; " << static_cast<unsigned>(I_rgba[i][j].G) << " ; " + << static_cast<unsigned>(I_rgba[i][j].B) << " ; " << static_cast<unsigned>(I_rgba[i][j].A) << std::endl; + } + std::cout << std::endl; + } + + + //Check if results are the same between iterate and LUT methods + width = 32; + height = 8; + unsigned char *uchar_array1 = new unsigned char[width*height]; + unsigned char *uchar_array2 = new unsigned char[width*height]; + for(unsigned int i = 0; i < 256; i++) { + uchar_array1[i] = (unsigned char) i; + uchar_array2[i] = (unsigned char) i; + } + + vpImage<unsigned char> I_uchar1(uchar_array1, height, width); + vpImage<unsigned char> I_uchar2(uchar_array2, height, width); + + unsigned char threshold1 = 50, threshold2 = 200; + unsigned char value1 = 4, value2 = 127, value3 = 250; + vpImageTools::binarise(I_uchar1, threshold1, threshold2, value1, value2, value3, false); + vpImageTools::binarise(I_uchar2, threshold1, threshold2, value1, value2, value3, true); + + for(unsigned int i = 0; i < height; i++) { + for(unsigned int j = 0; j < width; j++) { + if(I_uchar1[i][j] != I_uchar2[i][j]) { + std::cerr << "Results are different between iterate and LUT methods !" << std::endl; + return -1; + } + } + } + + + //Test performance between iterate and LUT methods + width = 640; + height = 480; + unsigned char *uchar_array_perf_lut = new unsigned char[width*height]; + unsigned char *uchar_array_perf_iterate = new unsigned char[width*height]; + for(unsigned int i = 0; i < width*height; i++) { + uchar_array_perf_lut[i] = (unsigned char) i; + uchar_array_perf_iterate[i] = (unsigned char) i; + } + + vpImage<unsigned char> I_perf_lut(uchar_array_perf_lut, height, width); + vpImage<unsigned char> I_perf_iterate(uchar_array_perf_iterate, height, width); + + unsigned int nbIterations = 100; + double t1 = vpTime::measureTimeMs(); + for(unsigned int cpt = 0; cpt < nbIterations; cpt++) { + vpImageTools::binarise(I_perf_iterate, threshold1, threshold2, value1, value2, value3, false); + } + t1 = vpTime::measureTimeMs() - t1; + std::cout << "Iterate: " << t1 << " ms for " << nbIterations << " iterations." << std::endl; + + double t2 = vpTime::measureTimeMs(); + for(unsigned int cpt = 0; cpt < nbIterations; cpt++) { + vpImageTools::binarise(I_perf_lut, threshold1, threshold2, value1, value2, value3, true); + } + t2 = vpTime::measureTimeMs() - t2; + std::cout << "LUT: " << t2 << " ms for " << nbIterations << " iterations." << std::endl; + + + std::cout << "\ntestImageBinarise ok !" << std::endl; + return 0; +} diff --git a/test/image/testImagePoint.cpp b/modules/core/test/image/testImagePoint.cpp similarity index 84% rename from test/image/testImagePoint.cpp rename to modules/core/test/image/testImagePoint.cpp index d21b6404a148548fcf5fdcdf2cd50ca50ab1d397..d5e8b0df0db0d11554d4aa791d1ed0691581fa5d 100644 --- a/test/image/testImagePoint.cpp +++ b/modules/core/test/image/testImagePoint.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testImagePoint.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for vpImagePoint class. * @@ -45,7 +41,7 @@ */ -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> #include <iostream> int main() diff --git a/test/image/testIoPGM.cpp b/modules/core/test/image/testIoPGM.cpp similarity index 93% rename from test/image/testIoPGM.cpp rename to modules/core/test/image/testIoPGM.cpp index 74a920511d55e1456cb43726a202f088a70a605e..aef19f075a41c8bdda254557e584c5130a7b740d 100644 --- a/test/image/testIoPGM.cpp +++ b/modules/core/test/image/testIoPGM.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testIoPGM.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read and write PGM images on the disk. * @@ -40,11 +36,11 @@ * *****************************************************************************/ -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> #include <stdio.h> @@ -56,7 +52,7 @@ */ // List of allowed command line options -#define GETOPTARGS "i:o:h" +#define GETOPTARGS "cdi:o:h" void usage(const char *name, const char *badparam, std::string ipath, std::string opath, std::string user); bool getOptions(int argc, const char **argv, std::string &ipath, std::string &opath, std::string user); @@ -129,6 +125,10 @@ bool getOptions(int argc, const char **argv, std::string &ipath, std::string &op case 'o': opath = optarg_; break; case 'h': usage(argv[0], NULL, ipath, opath, user); return false; break; + case 'c': + case 'd': + break; + default: usage(argv[0], optarg_, ipath, opath, user); return false; break; } diff --git a/test/image/testIoPPM.cpp b/modules/core/test/image/testIoPPM.cpp similarity index 94% rename from test/image/testIoPPM.cpp rename to modules/core/test/image/testIoPPM.cpp index 35ea8bedd5f134200842e1ad013fe4e5976aa47e..f99a78f57ae0b0db88acee1572dfd4210767ac39 100644 --- a/test/image/testIoPPM.cpp +++ b/modules/core/test/image/testIoPPM.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testIoPPM.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read and write PGM images on the disk. * @@ -40,11 +36,11 @@ * *****************************************************************************/ -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> #include <stdio.h> @@ -57,7 +53,7 @@ */ // List of allowed command line options -#define GETOPTARGS "i:o:h" +#define GETOPTARGS "cdi:o:h" void usage(const char *name, const char *badparam, std::string ipath, std::string opath, std::string user); bool getOptions(int argc, const char **argv, std::string &ipath, std::string &opath, std::string user); @@ -131,6 +127,10 @@ bool getOptions(int argc, const char **argv, std::string &ipath, std::string &op case 'o': opath = optarg_; break; case 'h': usage(argv[0], NULL, ipath, opath, user); return false; break; + case 'c': + case 'd': + break; + default: usage(argv[0], optarg_, ipath, opath, user); return false; break; } diff --git a/modules/core/test/image/testPerformanceLUT.cpp b/modules/core/test/image/testPerformanceLUT.cpp new file mode 100644 index 0000000000000000000000000000000000000000..557e49e4eba23d4c3b32320e17a8817460079791 --- /dev/null +++ b/modules/core/test/image/testPerformanceLUT.cpp @@ -0,0 +1,351 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test performance between iteration and LUT. + * + * Authors: + * Souriya Trinh + * + *****************************************************************************/ + +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpMath.h> +#include <stdlib.h> +#include <stdio.h> + +/*! + \example testPerformanceLUT.cpp + + \brief Test performance between iteration and LUT. + +*/ + +// List of allowed command line options +#define GETOPTARGS "cdi:o:h" + +void usage(const char *name, const char *badparam, std::string ipath, std::string opath, std::string user); +bool getOptions(int argc, const char **argv, std::string &ipath, std::string &opath, std::string user); + +/* + + Print the program options. + + \param name : Program name. + \param badparam : Bad parameter name. + \param ipath: Input image path. + \param opath : Output image path. + \param user : Username. + + */ +void usage(const char *name, const char *badparam, std::string ipath, std::string opath, std::string user) +{ + fprintf(stdout, "\n\ +Test performance between methods to iterate over pixel image.\n\ +\n\ +SYNOPSIS\n\ + %s [-i <input image path>] [-o <output image path>]\n\ + [-h]\n \ +", name); + + fprintf(stdout, "\n\ +OPTIONS: Default\n\ + -i <input image path> %s\n\ + Set image input path.\n\ + From this path read \"ViSP-images/Klimt/Klimt.pgm\"\n\ + image.\n\ + Setting the VISP_INPUT_IMAGE_PATH environment\n\ + variable produces the same behaviour than using\n\ + this option.\n\ +\n\ + -o <output image path> %s\n\ + Set image output path.\n\ + From this directory, creates the \"%s\"\n\ + subdirectory depending on the username, where \n\ + Klimt_grey.pgm output image is written.\n\ +\n\ + -h\n\ + Print the help.\n\n", + ipath.c_str(), opath.c_str(), user.c_str()); + + if (badparam) + fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); +} + +/*! + + Set the program options. + + \param argc : Command line number of parameters. + \param argv : Array of command line parameters. + \param ipath: Input image path. + \param opath : Output image path. + \param user : Username. + \return false if the program has to be stopped, true otherwise. + +*/ +bool getOptions(int argc, const char **argv, std::string &ipath, std::string &opath, std::string user) +{ + const char *optarg_; + int c; + while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { + + switch (c) { + case 'i': ipath = optarg_; break; + case 'o': opath = optarg_; break; + case 'h': usage(argv[0], NULL, ipath, opath, user); return false; break; + + case 'c': + case 'd': + break; + + default: + usage(argv[0], optarg_, ipath, opath, user); return false; break; + } + } + + if ((c == 1) || (c == -1)) { + // standalone param or error + usage(argv[0], NULL, ipath, opath, user); + std::cerr << "ERROR: " << std::endl; + std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; + return false; + } + + return true; +} + +/*! + Iterate over pixels using raw pointer and adjust the pixel intensities with the formula: + new_intensity = old_intensitie * alpha + beta. + + \param I : Input color image. + \param alpha : Gain. + \param beta: Offset. +*/ +void iterate_method1(vpImage<vpRGBa> &I, const double alpha, const double beta) { + unsigned int size = I.getWidth() * I.getHeight(); + unsigned char *ptrStart = (unsigned char*) I.bitmap; + unsigned char *ptrEnd = ptrStart + size*4; + unsigned char *ptrCurrent = ptrStart; + + while(ptrCurrent != ptrEnd) { + *ptrCurrent = vpMath::saturate<unsigned char>((*ptrCurrent) * alpha + beta); + ++ptrCurrent; + } +} + +/*! + Iterate over pixels using a double for loop and adjust the pixel intensities with the formula: + new_intensity = old_intensitie * alpha + beta. + + \param I : Input color image. + \param alpha : Gain. + \param beta: Offset. +*/ +void iterate_method2(vpImage<vpRGBa> &I, const double alpha, const double beta) { + for(unsigned int i = 0; i < I.getHeight(); i++) { + for(unsigned int j = 0; j < I.getWidth(); j++) { + I[i][j].R = vpMath::saturate<unsigned char>(I[i][j].R * alpha + beta); + I[i][j].G = vpMath::saturate<unsigned char>(I[i][j].G * alpha + beta); + I[i][j].B = vpMath::saturate<unsigned char>(I[i][j].B * alpha + beta); + I[i][j].A = vpMath::saturate<unsigned char>(I[i][j].A * alpha + beta); + } + } +} + +/*! + Using a look-up table, adjust the pixel intensities. + + \param I : Input color image. + \param lut : Look-up table mapping for each intensity the new corresponding value. +*/ +void lut_method(vpImage<vpRGBa> &I, const vpRGBa (&lut)[256]) { + I.performLut(lut); +} + +int +main(int argc, const char ** argv) +{ + try { + std::string env_ipath; + std::string opt_ipath; + std::string opt_opath; + std::string ipath; + std::string opath; + std::string filename; + std::string username; + + // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value + env_ipath = vpIoTools::getViSPImagesDataPath(); + + // Set the default input path + if (! env_ipath.empty()) + ipath = env_ipath; + + // Set the default output path +#if defined(_WIN32) + opt_opath = "C:/temp"; +#else + opt_opath = "/tmp"; +#endif + + // Get the user login name + vpIoTools::getUserName(username); + + // Read the command line options + if (getOptions(argc, argv, opt_ipath, opt_opath, username) == false) { + exit (-1); + } + + // Get the option values + if (!opt_ipath.empty()) + ipath = opt_ipath; + if (!opt_opath.empty()) + opath = opt_opath; + + // Append to the output path string, the login name of the user + opath = vpIoTools::createFilePath(opath, username); + + // Test if the output path exist. If no try to create it + if (vpIoTools::checkDirectory(opath) == false) { + try { + // Create the dirname + vpIoTools::makeDirectory(opath); + } + catch (...) { + usage(argv[0], NULL, ipath, opt_opath, username); + std::cerr << std::endl + << "ERROR:" << std::endl; + std::cerr << " Cannot create " << opath << std::endl; + std::cerr << " Check your -o " << opt_opath << " option " << std::endl; + exit(-1); + } + } + + // Compare ipath and env_ipath. If they differ, we take into account + // the input path comming from the command line option + if (!opt_ipath.empty() && !env_ipath.empty()) { + if (ipath != env_ipath) { + std::cout << std::endl + << "WARNING: " << std::endl; + std::cout << " Since -i <visp image path=" << ipath << "> " + << " is different from VISP_IMAGE_PATH=" << env_ipath << std::endl + << " we skip the environment variable." << std::endl; + } + } + + // Test if an input path is set + if (opt_ipath.empty() && env_ipath.empty()){ + usage(argv[0], NULL, ipath, opt_opath, username); + std::cerr << std::endl + << "ERROR:" << std::endl; + std::cerr << " Use -i <visp image path> option or set VISP_INPUT_IMAGE_PATH " + << std::endl + << " environment variable to specify the location of the " << std::endl + << " image path where test images are located." << std::endl << std::endl; + exit(-1); + } + + + // + // Here starts really the test + // + + // Create a grey level image + vpImage<vpRGBa> I_iterate1, I_iterate2, I_lut; + + // Load a grey image from the disk + filename = vpIoTools::createFilePath(ipath, "ViSP-images/Klimt/Klimt.ppm"); + std::cout << "Read image: " << filename << std::endl; + vpImageIo::read(I_iterate1, filename); + vpImageIo::read(I_iterate2, filename); + vpImageIo::read(I_lut, filename); + + std::cout << "I=" << I_iterate1.getWidth() << "x" << I_iterate1.getHeight() << std::endl; + + double alpha = 1.5, beta = -30.0; + unsigned int nbIterations = 10; + + //Iterate method 1 + double t_iterate1 = vpTime::measureTimeMs(); + for(unsigned int cpt = 0; cpt < nbIterations; cpt++) { + iterate_method1(I_iterate1, alpha, beta); + } + t_iterate1 = vpTime::measureTimeMs() - t_iterate1; + std::cout << "t_iterate1=" << t_iterate1 << " ms ; t_iterate1/" << nbIterations << "=" + << (t_iterate1/nbIterations) << " ms" << std::endl; + + filename = vpIoTools::createFilePath(opath, "Klimt_performance_iterate1.ppm"); + vpImageIo::write(I_iterate1, filename); + + + //Iterate method 2 + double t_iterate2 = vpTime::measureTimeMs(); + for(unsigned int cpt = 0; cpt < nbIterations; cpt++) { + iterate_method2(I_iterate2, alpha, beta); + } + t_iterate2 = vpTime::measureTimeMs() - t_iterate2; + std::cout << "t_iterate2=" << t_iterate2 << " ms ; t_iterate2/" << nbIterations << "=" + << (t_iterate2/nbIterations) << " ms" << std::endl; + + filename = vpIoTools::createFilePath(opath, "Klimt_performance_iterate2.ppm"); + vpImageIo::write(I_iterate2, filename); + + + //LUT method + double t_lut = vpTime::measureTimeMs(); + for(unsigned int cpt = 0; cpt < nbIterations; cpt++) { + //Construct the LUT + vpRGBa lut[256]; + for(unsigned int i = 0; i < 256; i++) { + lut[i].R = vpMath::saturate<unsigned char>(alpha * i + beta); + lut[i].G = vpMath::saturate<unsigned char>(alpha * i + beta); + lut[i].B = vpMath::saturate<unsigned char>(alpha * i + beta); + lut[i].A = vpMath::saturate<unsigned char>(alpha * i + beta); + } + + lut_method(I_lut, lut); + } + t_lut = vpTime::measureTimeMs() - t_lut; + std::cout << "t_lut=" << t_lut << " ms ; t_lut/" << nbIterations << "=" + << (t_lut/nbIterations) << " ms" << std::endl; + + filename = vpIoTools::createFilePath(opath, "Klimt_performance_lut.ppm"); + vpImageIo::write(I_lut, filename); + return 0; + } + catch(vpException &e) { + std::cerr << "Catch an exception: " << e.what() << std::endl; + return 1; + } +} diff --git a/test/image/testReadImage.cpp b/modules/core/test/image/testReadImage.cpp similarity index 92% rename from test/image/testReadImage.cpp rename to modules/core/test/image/testReadImage.cpp index 68cae29d2947f17b3e217bd37f8f16d835f8bfe0..553880fa71e0b87c6a3520de973a962f86f98637 100644 --- a/test/image/testReadImage.cpp +++ b/modules/core/test/image/testReadImage.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testReadImage.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read images on the disk. * @@ -39,11 +35,11 @@ * *****************************************************************************/ -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpParseArgv.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> @@ -55,7 +51,7 @@ */ // List of allowed command line options -#define GETOPTARGS "i:p:h" +#define GETOPTARGS "cdi:p:h" void usage(const char *name, const char *badparam, std::string ipath, std::string ppath); bool getOptions(int argc, const char **argv, std::string &ipath, std::string &ppath); @@ -125,6 +121,10 @@ bool getOptions(int argc, const char **argv, std::string &ipath, std::string &pp case 'p': ppath = optarg_; break; case 'h': usage(argv[0], NULL, ipath, ppath); return false; break; + case 'c': + case 'd': + break; + default: usage(argv[0], optarg_, ipath, ppath); return false; break; } diff --git a/test/image/testUndistortImage.cpp b/modules/core/test/image/testUndistortImage.cpp similarity index 93% rename from test/image/testUndistortImage.cpp rename to modules/core/test/image/testUndistortImage.cpp index a29ce28c28a315d0068e4c90abb3331546381a04..2c79331b3cd46d6f21293d601b426352491a9064 100644 --- a/test/image/testUndistortImage.cpp +++ b/modules/core/test/image/testUndistortImage.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testUndistortImage.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for image undistortion. * @@ -41,14 +37,14 @@ -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageTools.h> -#include <visp/vpIoTools.h> -#include <visp/vpParseArgv.h> -#include <visp/vpDebug.h> -#include <visp/vpTime.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpTime.h> #include <stdlib.h> /*! \example testUndistortImage.cpp @@ -61,7 +57,7 @@ */ // List of allowed command line options -#define GETOPTARGS "i:o:h" +#define GETOPTARGS "cdi:o:h" //#define COLOR #define BW @@ -139,6 +135,10 @@ bool getOptions(int argc, const char **argv, std::string &ipath, std::string &op case 'o': opath = optarg_; break; case 'h': usage(argv[0], NULL, ipath, opath, user); return false; break; + case 'c': + case 'd': + break; + default: usage(argv[0], optarg_, ipath, opath, user); return false; break; } diff --git a/modules/core/test/math/testArray2D.cpp b/modules/core/test/math/testArray2D.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5d84d3589ed9cc20f6401c0eee48d0b479aa8b5a --- /dev/null +++ b/modules/core/test/math/testArray2D.cpp @@ -0,0 +1,163 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test some vpColVector functionalities. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +/*! + \example testArray2D.cpp + + Test some vpArray2D functionalities. +*/ + +#include <cmath> +#include <vector> +#include <limits> + +#include <visp3/core/vpTranslationVector.h> + +template<typename Type> +bool test(const std::string &s, const vpArray2D<Type> &A, const std::vector<Type> &bench) +{ + static unsigned int cpt = 0; + std::cout << "** Test " << ++cpt << std::endl; + std::cout << s << "(" << A.getRows() << "," << A.getCols() << ") = \n" << A << std::endl; + if(bench.size() != A.size()) { + std::cout << "Test fails: bad size wrt bench" << std::endl; + return false; + } + for (unsigned int i=0; i<A.size(); i++) { + if (std::fabs(A.data[i]-bench[i]) > std::fabs(A.data[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } + + return true; +} + +int main() +{ + int err = 1; + { + // test default constructor + vpArray2D<double> A; + std::vector<double> bench; + if (test("A", A, bench) == false) + return err; + } + { + // test copy constructor + vpArray2D<double> A(3, 4); + + std::vector<double> bench(12); + for(unsigned int i=0; i<3; i++) { + for(unsigned int j=0; j<4; j++) { + A[i][j] = (double)(i+j); + bench[i*4+j] = (double)(i+j); + } + } + if (test("A", A, bench) == false) + return err; + + vpArray2D<double> B(A); + if (test("B", B, bench) == false) + return err; + std::cout << "Min/Max: " << B.getMinValue() << " " << B.getMaxValue() << std::endl; + } + { + // test constructor with initial value + vpArray2D<double> A(3, 4, 2.); + std::vector<double> bench1(12, 2); + if (test("A", A, bench1) == false) + return err; + + A.resize(5, 6); + std::vector<double> bench2(30, 0); + if (test("A", A, bench2) == false) + return err; + + A = -2.; + std::vector<double> bench3(30, -2); + if (test("A", A, bench3) == false) + return err; + } + + // Test with float + { + // test default constructor + vpArray2D<float> A; + std::vector<float> bench; + if (test("A", A, bench) == false) + return err; + } + { + // test copy constructor + vpArray2D<float> A(3, 4); + + std::vector<float> bench(12); + for(unsigned int i=0; i<3; i++) { + for(unsigned int j=0; j<4; j++) { + A[i][j] = (float)(i+j); + bench[i*4+j] = (float)(i+j); + } + } + if (test("A", A, bench) == false) + return err; + + vpArray2D<float> B(A); + if (test("B", B, bench) == false) + return err; + std::cout << "Min/Max: " << B.getMinValue() << " " << B.getMaxValue() << std::endl; + } + { + // test constructor with initial value + vpArray2D<float> A(3, 4, 2.); + std::vector<float> bench1(12, 2); + if (test("A", A, bench1) == false) + return err; + + A.resize(5, 6); + std::vector<float> bench2(30, 0); + if (test("A", A, bench2) == false) + return err; + + A = -2.; + std::vector<float> bench3(30, -2); + if (test("A", A, bench3) == false) + return err; + } + std::cout << "All tests succeed" << std::endl; + return 0; +} diff --git a/modules/core/test/math/testColVector.cpp b/modules/core/test/math/testColVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4e44aab30d515f48ef90a7ae6b96bb08fd2ef171 --- /dev/null +++ b/modules/core/test/math/testColVector.cpp @@ -0,0 +1,292 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test some vpColVector functionalities. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +/*! + \example testColVector.cpp + + Test some vpColVector functionalities. +*/ + +#include <stdlib.h> +#include <stdio.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpColVector.h> + + +bool test(const std::string &s, const vpColVector &v, const std::vector<double> &bench) +{ + static unsigned int cpt = 0; + std::cout << "** Test " << ++cpt << std::endl; + std::cout << s << "(" << v.getRows() << "," << v.getCols() << ") = [" << v.t() << "]^T" << std::endl; + if(bench.size() != v.size()) { + std::cout << "Test fails: bad size wrt bench" << std::endl; + return false; + } + for (unsigned int i=0; i<v.size(); i++) { + if (std::fabs(v[i]-bench[i]) > std::fabs(v[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } + + return true; +} + + + +int main() +{ + int err = 1; + + { + vpColVector v; + + v.resize(4); + v = 3; + std::vector<double> bench1(4, 3); + if (test("v", v, bench1) == false) + return err; + std::vector<double> bench2(4, 3./6); + v.normalize(); + if (test("v", v, bench2) == false) + return err; + + v.resize(5, 1, true); + std::vector<double> bench3(5, 0); + if (test("v", v, bench3) == false) + return err; + } + + { + vpColVector v(4); + std::vector<double> bench1(4); + for(unsigned int i=0; i<v.size(); i++) { + v[i] = (double)i; + bench1[i] = (double)i; + } + if (test("v", v, bench1) == false) + return err; + + vpColVector w; + w.init(v, 0, 2); + std::vector<double> bench2; + bench2.push_back(0); + bench2.push_back(1); + if (test("w", w, bench2) == false) + return err; + + std::vector<double> bench3; + bench3.push_back(1); + bench3.push_back(2); + bench3.push_back(3); + + vpColVector r1; + for(size_t i=0; i<4; i++) + r1.stack((double)i); + + vpColVector r2 = r1.extract(1, 3); + if (test("r2", r2, bench3) == false) + return err; + } + { + vpMatrix M(4, 1); + std::vector<double> bench(4); + for(unsigned int i=0; i<M.getRows(); i++) { + M[i][0] = i; + bench[i] = i; + } + if (test("M", M, bench) == false) + return err; + vpColVector v; + v = M; + if (test("v", v, bench) == false) + return err; + vpColVector w(M); + if (test("w", w, bench) == false) + return err; + vpColVector z1(bench); + if (test("z1", z1, bench) == false) + return err; + vpColVector z2 = bench; + if (test("z2", z2, bench) == false) + return err; + } + { + vpColVector v(3); + v[0] = 1; + v[1] = 2; + v[2] = 3; + std::vector<double> bench1; + bench1.push_back(3); + bench1.push_back(6); + bench1.push_back(9); + + vpColVector w = v * 3; + // v is unchanged + // w is now equal to : [3 6 9] + if (test("w", w, bench1) == false) + return err; + + vpColVector x(w); + if (test("x", x, bench1) == false) + return err; + + std::vector<float> bench2; + bench2.push_back(3); + bench2.push_back(6); + bench2.push_back(9); + vpColVector y1(bench2); + if (test("y1", y1, bench1) == false) + return err; + vpColVector y2 = bench2; + if (test("y2", y2, bench1) == false) + return err; + } + { + vpColVector r1(3, 1); + vpColVector r2 = -r1; + std::vector<double> bench(3,-1); + // v contains [-1 -1 -1] + if (test("r2", r2, bench) == false) + return err; + r2.stack(-2); + bench.push_back(-2); + if (test("r2", r2, bench) == false) + return err; + vpColVector r3 = vpColVector::stack(r1, r2); + std::vector<double> bench3(7, 1); + bench3[3] = bench3[4] = bench3[5] = -1; + bench3[6] = -2; + if (test("r3", r3, bench3) == false) + return err; + + r1.stack(r2); + if (test("r1", r1, bench3) == false) + return err; + } + { + vpColVector r1(3, 2); + vpColVector r2(3, 4); + std::cout << "test r1: " << r1 << std::endl; + std::cout << "test r2: " << r2 << std::endl; + vpColVector r = r1 + r2; + std::cout << "test r1+r2: " << r1+r2 << std::endl; + std::cout << "test r: " << r << std::endl; + std::vector<double> bench(3, 6); + if (test("r", r, bench) == false) + return err; + r1 += r2; + if (test("r1", r1, bench) == false) + return err; + } + { + vpColVector r1(3, 2); + vpColVector r2(3, 4); + vpColVector r = r1 - r2; + std::vector<double> bench(3, -2); + if (test("r", r, bench) == false) + return err; + r1 -= r2; + if (test("r1", r1, bench) == false) + return err; + } + { + vpColVector r(5, 1); + r.clear(); + r.resize(5); + r = 5; + std::vector<double> bench(5, 5); + if (test("r", r, bench) == false) + return err; + } + { + // Test mean, median and standard deviation against Matlab with rng(0) and rand(10,1)*10 + vpColVector r(10); + r[0] = 8.1472; + r[1] = 9.0579; + r[2] = 1.2699; + r[3] = 9.1338; + r[4] = 6.3236; + r[5] = 0.9754; + r[6] = 2.7850; + r[7] = 5.4688; + r[8] = 9.5751; + r[9] = 9.6489; + + std::cout << "** Test mean" << std::endl; + double res = vpColVector::mean(r); + if(!vpMath::equal(res, 6.2386, 0.001)) { + std::cout << "Test fails: bad mean " << res << std::endl; + return err; + } + + std::cout << "** Test stdev" << std::endl; + res = vpColVector::stdev(r); + if(!vpMath::equal(res, 3.2810, 0.001)) { + std::cout << "Test fails: bad stdev " << res << std::endl; + return err; + } + + std::cout << "** Test stdev(bessel)" << std::endl; + res = vpColVector::stdev(r, true); + if(!vpMath::equal(res, 3.4585, 0.001)) { + std::cout << "Test fails: bad stdev(bessel) " << res << std::endl; + return err; + } + + std::cout << "** Test median" << std::endl; + res = vpColVector::median(r); + if(!vpMath::equal(res, 7.2354, 0.001)) { + std::cout << "Test fails: bad median " << res << std::endl; + return err; + } + + // Test median with odd number of elements + std::cout << "** Test median (odd)" << std::endl; + r.stack(1.5761); + res = vpColVector::median(r); + if(!vpMath::equal(res, 6.3236, 0.001)) { + std::cout << "Test fails: bad median (odd) " << res << std::endl; + return err; + } + std::cout << "r: [" << r << "]^T" << std::endl; + r.print(std::cout, 8, "r"); + } + std::cout << "All tests succeed" << std::endl; + return 0; +} diff --git a/test/math/testKalmanAcceleration.cpp b/modules/core/test/math/testKalmanAcceleration.cpp similarity index 88% rename from test/math/testKalmanAcceleration.cpp rename to modules/core/test/math/testKalmanAcceleration.cpp index e3ed84c08e2a6a1c1ced0d29989bb3747c76f50c..138502943841ed71b824d609be975f907fe71a65 100644 --- a/test/math/testKalmanAcceleration.cpp +++ b/modules/core/test/math/testKalmanAcceleration.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testKalmanAcceleration.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tests some vpLinearKalmanFilterInstantiation functionalities. * @@ -46,7 +42,7 @@ with constant acceleration state model. */ -#include <visp/vpLinearKalmanFilterInstantiation.h> +#include <visp3/core/vpLinearKalmanFilterInstantiation.h> #include <iostream> #include <fstream> diff --git a/test/math/testKalmanVelocity.cpp b/modules/core/test/math/testKalmanVelocity.cpp similarity index 90% rename from test/math/testKalmanVelocity.cpp rename to modules/core/test/math/testKalmanVelocity.cpp index 25f5b7c02a299ce1a6e99a9a8292f03728715ae5..b4bae5ab5bdd217c31fb24a486579915f9e450cf 100644 --- a/test/math/testKalmanVelocity.cpp +++ b/modules/core/test/math/testKalmanVelocity.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testKalmanVelocity.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tests some vpLinearKalmanFilterInstantiation functionalities. * @@ -46,7 +42,7 @@ with constant velocity state model. */ -#include <visp/vpLinearKalmanFilterInstantiation.h> +#include <visp3/core/vpLinearKalmanFilterInstantiation.h> #include <iostream> #include <fstream> diff --git a/modules/core/test/math/testMath.cpp b/modules/core/test/math/testMath.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fc3ecb7de6a66f988cee742bbd29e4ce268557c3 --- /dev/null +++ b/modules/core/test/math/testMath.cpp @@ -0,0 +1,534 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test some vpColVector functionalities. + * + * Authors: + * Souriya Trinh + * + *****************************************************************************/ + +/*! + \example testMath.cpp + + Test some vpMath functionalities. +*/ + +#include <iostream> +#include <limits> +#include <cfloat> + +#include <visp3/core/vpMath.h> + +#if defined _MSC_VER && _MSC_VER >= 1200 + #pragma warning( disable: 4723 ) + +// 4723 : potential divide by 0 +#endif + +#ifdef WIN32 + #ifndef NAN + //https://msdn.microsoft.com/en-us/library/w22adx1s%28v=vs.120%29.aspx + //http://tdistler.com/2011/03/24/how-to-define-nan-not-a-number-on-windows + static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff}; + #define NAN (*(const float *) __nan) + #endif +#endif + +int main() { + //Test isNaN + if(vpMath::isNaN(0.0)) { + std::cerr << "Fail: IsNaN(0.0)=" << vpMath::isNaN(0.0) << " / should be false" << std::endl; + return -1; + } + + double num = 1.0, den = 0.0; + if(vpMath::isNaN(num/den)) { + std::cerr << "Fail: IsNaN(1.0/0.0)=" << vpMath::isNaN(num/den) << " / should be false" << std::endl; + return -1; + } + + if(!vpMath::isNaN(NAN)) { + std::cerr << "Fail: IsNaN(NAN)=" << vpMath::isNaN(NAN) << " / should be true" << std::endl; + return -1; + } + + num = 0.0; + if(!vpMath::isNaN(num/den)) { + std::cerr << "Fail: IsNaN(0.0/0.0)=" << vpMath::isNaN(num/den) << " / should be true" << std::endl; + return -1; + } + + if(!vpMath::isNaN(std::numeric_limits<double>::quiet_NaN())) { + std::cerr << "Fail: IsNaN(quiet_NaN)=" << vpMath::isNaN(std::numeric_limits<double>::quiet_NaN()) + << " / should be true" << std::endl; + return -1; + } + + if(!vpMath::isNaN(std::numeric_limits<double>::signaling_NaN())) { + std::cerr << "Fail: IsNaN(signaling_NaN)=" << vpMath::isNaN(std::numeric_limits<double>::signaling_NaN()) + << " / should be true" << std::endl; + return -1; + } + + if(vpMath::isNaN(std::numeric_limits<double>::infinity())) { + std::cerr << "Fail: IsNaN(infinity)=" << vpMath::isNaN(std::numeric_limits<double>::infinity()) + << " / should be false" << std::endl; + return -1; + } + + if(vpMath::isNaN(1.0 / std::numeric_limits<double>::epsilon())) { + std::cerr << "Fail: IsNaN(1.0/epsilon)=" << vpMath::isNaN(1.0/std::numeric_limits<double>::epsilon()) + << " / should be false" << std::endl; + return -1; + } + + if(!vpMath::isNaN(std::numeric_limits<double>::infinity() - std::numeric_limits<double>::infinity())) { + std::cerr << "Fail: IsNaN(1.0/epsilon)=" << vpMath::isNaN(1.0/std::numeric_limits<double>::epsilon()) + << " / should be true" << std::endl; + return -1; + } + + float a = 0.0f, b = 0.0f; + if(!vpMath::isNaN(a/b)) { + std::cerr << "Fail: IsNaN(0.0f/0.0f)=" << vpMath::isNaN(a/b) << " / should be true" << std::endl; + return -1; + } + std::cout << "vpMath::isNaN is Ok !" << std::endl; + + + //Test isInf +#if !defined(VISP_HAVE_FUNC__FINITE) + //Disable this test if using _finite as (!_finite(NAN)) returns true whereas isinf(NAN) returns false + if(vpMath::isInf(NAN)) { + std::cerr << "Fail: vpMath::isInf(NAN)=" << vpMath::isInf(NAN) << " / should be false" << std::endl; + return -1; + } +#endif + + if(!vpMath::isInf(1.0/a)) { + std::cerr << "Fail: vpMath::isInf(1.0/0.0)=" << vpMath::isInf(1.0/a) << " / should be true" << std::endl; + return -1; + } + + if(vpMath::isInf(0.0)) { + std::cerr << "Fail: vpMath::isInf(0.0)=" << vpMath::isInf(0.0) << " / should be false" << std::endl; + return -1; + } + + if(!vpMath::isInf(exp(800))) { + std::cerr << "Fail: vpMath::isInf(exp(800))=" << vpMath::isInf(exp(800)) << " / should be true" << std::endl; + return -1; + } + + if(vpMath::isInf(DBL_MIN/2.0)) { + std::cerr << "Fail: vpMath::isInf(DBL_MIN/2.0)=" << vpMath::isInf(DBL_MIN/2.0) << " / should be false" << std::endl; + return -1; + } + std::cout << "vpMath::isInf is Ok !" << std::endl; + + + //Test round + if(vpMath::round(2.3) != 2) { + std::cerr << "Fail: vpMath::round(2.3)=" << vpMath::round(2.3) << " / should be 2" << std::endl; + return -1; + } + + if(vpMath::round(3.8) != 4) { + std::cerr << "Fail: vpMath::round(3.8)=" << vpMath::round(3.8) << " / should be 4" << std::endl; + return -1; + } + + if(vpMath::round(5.5) != 6) { + std::cerr << "Fail: vpMath::round(5.5)=" << vpMath::round(5.5) << " / should be 6" << std::endl; + return -1; + } + + if(vpMath::round(-2.3) != -2) { + std::cerr << "Fail: vpMath::round(-2.3)=" << vpMath::round(-2.3) << " / should be -2" << std::endl; + return -1; + } + + if(vpMath::round(-3.8) != -4) { + std::cerr << "Fail: vpMath::round(-3.8)=" << vpMath::round(-3.8) << " / should be -4" << std::endl; + return -1; + } + + if(vpMath::round(-5.5) != -6) { + std::cerr << "Fail: vpMath::round(-5.5)=" << vpMath::round(-5.5) << " / should be -6" << std::endl; + return -1; + } + + if(vpMath::round(0.0) != 0) { + std::cerr << "Fail: vpMath::round(0.0)=" << vpMath::round(0.0) << " / should be 0" << std::endl; + return -1; + } + std::cout << "vpMath::round is Ok !" << std::endl; + + + //Test saturate functions + //unsigned char + char char_value = -127; + unsigned char uchar_value = vpMath::saturate<unsigned char>(char_value); + if(uchar_value != 0) { + std::cerr << "Fail: vpMath::saturate<unsigned char>(-127)=" << uchar_value << " / should be 0" << std::endl; + return -1; + } + + unsigned short ushort_value = 60000; + uchar_value = vpMath::saturate<unsigned char>(ushort_value); + if(uchar_value != UCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<unsigned char>(60000)=" << uchar_value << " / should be " << UCHAR_MAX << std::endl; + return -1; + } + + int int_value = 70000; + uchar_value = vpMath::saturate<unsigned char>(int_value); + if(uchar_value != UCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<unsigned char>(70000)=" << uchar_value << " / should be " << UCHAR_MAX << std::endl; + return -1; + } + + int_value = -70000; + uchar_value = vpMath::saturate<unsigned char>(int_value); + if(uchar_value != 0) { + std::cerr << "Fail: vpMath::saturate<unsigned char>(-70000)=" << uchar_value << " / should be 0" << std::endl; + return -1; + } + + short short_value = 30000; + uchar_value = vpMath::saturate<unsigned char>(short_value); + if(uchar_value != UCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<unsigned char>(30000)=" << uchar_value << " / should be " << UCHAR_MAX << std::endl; + return -1; + } + + short_value = -30000; + uchar_value = vpMath::saturate<unsigned char>(short_value); + if(uchar_value != 0) { + std::cerr << "Fail: vpMath::saturate<unsigned char>(-30000)=" << uchar_value << " / should be 0" << std::endl; + return -1; + } + + unsigned int uint_value = 10000; + uchar_value = vpMath::saturate<unsigned char>(uint_value); + if(uchar_value != UCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<unsigned char>(10000)=" << uchar_value << " / should be " << UCHAR_MAX << std::endl; + return -1; + } + + float float_value = 10000.1f; + uchar_value = vpMath::saturate<unsigned char>(float_value); + if(uchar_value != UCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<unsigned char>(10000.1f)=" << uchar_value << " / should be " << UCHAR_MAX << std::endl; + return -1; + } + + float_value = -10000.1f; + uchar_value = vpMath::saturate<unsigned char>(float_value); + if(uchar_value != 0) { + std::cerr << "Fail: vpMath::saturate<unsigned char>(-10000.1f)=" << uchar_value << " / should be 0" << std::endl; + return -1; + } + + double double_value = 10000.1; + uchar_value = vpMath::saturate<unsigned char>(double_value); + if(uchar_value != UCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<unsigned char>(10000.0)=" << uchar_value << " / should be " << UCHAR_MAX << std::endl; + return -1; + } + + double_value = -10000.1; + uchar_value = vpMath::saturate<unsigned char>(double_value); + if(uchar_value != 0) { + std::cerr << "Fail: vpMath::saturate<unsigned char>(-10000.0)=" << uchar_value << " / should be 0" << std::endl; + return -1; + } + std::cout << "vpMath::saturate<unsigned char>() is Ok !" << std::endl; + + + //char + uchar_value = 255; + char_value = vpMath::saturate<char>(uchar_value); + if(char_value != SCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<char>(255)=" << char_value << " / should be " << SCHAR_MAX << std::endl; + return -1; + } + + ushort_value = 60000; + char_value = vpMath::saturate<char>(ushort_value); + if(char_value != SCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<char>(60000)=" << char_value << " / should be " << SCHAR_MAX << std::endl; + return -1; + } + + int_value = 70000; + char_value = vpMath::saturate<char>(int_value); + if(char_value != SCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<char>(70000)=" << char_value << " / should be " << SCHAR_MAX << std::endl; + return -1; + } + + int_value = -70000; + char_value = vpMath::saturate<char>(int_value); + if(char_value != SCHAR_MIN) { + std::cerr << "Fail: vpMath::saturate<char>(-70000)=" << char_value << " / should be " << SCHAR_MIN << std::endl; + return -1; + } + + short_value = 30000; + char_value = vpMath::saturate<char>(short_value); + if(char_value != SCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<char>(30000)=" << char_value << " / should be " << SCHAR_MAX << std::endl; + return -1; + } + + short_value = -30000; + char_value = vpMath::saturate<char>(short_value); + if(char_value != SCHAR_MIN) { + std::cerr << "Fail: vpMath::saturate<char>(-30000)=" << char_value << " / should be " << SCHAR_MIN << std::endl; + return -1; + } + + uint_value = 10000; + char_value = vpMath::saturate<char>(uint_value); + if(char_value != SCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<char>(10000)=" << char_value << " / should be " << SCHAR_MAX << std::endl; + return -1; + } + + float_value = 10000.1f; + char_value = vpMath::saturate<char>(float_value); + if(char_value != SCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<char>(10000.1f)=" << char_value << " / should be " << SCHAR_MAX << std::endl; + return -1; + } + + float_value = -10000.1f; + char_value = vpMath::saturate<char>(float_value); + if(char_value != SCHAR_MIN) { + std::cerr << "Fail: vpMath::saturate<char>(-10000.1f)=" << char_value << " / should be " << SCHAR_MIN << std::endl; + return -1; + } + + double_value = 10000.1; + char_value = vpMath::saturate<char>(double_value); + if(char_value != SCHAR_MAX) { + std::cerr << "Fail: vpMath::saturate<char>(10000.1)=" << char_value << " / should be " << SCHAR_MAX << std::endl; + return -1; + } + + double_value = -10000.1; + char_value = vpMath::saturate<char>(double_value); + if(char_value != SCHAR_MIN) { + std::cerr << "Fail: vpMath::saturate<char>(-10000.1)=" << char_value << " / should be " << SCHAR_MIN << std::endl; + return -1; + } + std::cout << "vpMath::saturate<char>() is Ok !" << std::endl; + + + //unsigned short + char_value = -127; + ushort_value = vpMath::saturate<unsigned short>(char_value); + if(ushort_value != 0) { + std::cerr << "Fail: vpMath::saturate<unsigned short>(127)=" << ushort_value << " / should be 0" << std::endl; + return -1; + } + + short_value = -30000; + ushort_value = vpMath::saturate<unsigned short>(short_value); + if(ushort_value != 0) { + std::cerr << "Fail: vpMath::saturate<unsigned short>(-30000)=" << ushort_value << " / should be 0" << std::endl; + return -1; + } + + int_value = 70000; + ushort_value = vpMath::saturate<unsigned short>(int_value); + if(ushort_value != USHRT_MAX) { + std::cerr << "Fail: vpMath::saturate<unsigned short>(70000)=" << ushort_value << " / should be " << USHRT_MAX << std::endl; + return -1; + } + + int_value = -70000; + ushort_value = vpMath::saturate<unsigned short>(int_value); + if(ushort_value != 0) { + std::cerr << "Fail: vpMath::saturate<unsigned short>(-70000)=" << ushort_value << " / should be 0" << std::endl; + return -1; + } + + uint_value = 70000; + ushort_value = vpMath::saturate<unsigned short>(uint_value); + if(ushort_value != USHRT_MAX) { + std::cerr << "Fail: vpMath::saturate<unsigned short>(70000)=" << ushort_value << " / should be " << USHRT_MAX << std::endl; + return -1; + } + + float_value = 70000.1f; + ushort_value = vpMath::saturate<unsigned short>(float_value); + if(ushort_value != USHRT_MAX) { + std::cerr << "Fail: vpMath::saturate<unsigned short>(70000.1f)=" << ushort_value << " / should be " << USHRT_MAX << std::endl; + return -1; + } + + float_value = -10000.1f; + ushort_value = vpMath::saturate<unsigned short>(float_value); + if(ushort_value != 0) { + std::cerr << "Fail: vpMath::saturate<unsigned short>(-10000.1f)=" << ushort_value << " / should be 0" << std::endl; + return -1; + } + + double_value = 70000.1; + ushort_value = vpMath::saturate<unsigned short>(double_value); + if(ushort_value != USHRT_MAX) { + std::cerr << "Fail: vpMath::saturate<unsigned short>(70000.1)=" << ushort_value << " / should be " << USHRT_MAX << std::endl; + return -1; + } + + double_value = -10000.1; + ushort_value = vpMath::saturate<unsigned short>(double_value); + if(ushort_value != 0) { + std::cerr << "Fail: vpMath::saturate<unsigned short>(-10000.1)=" << ushort_value << " / should be 0" << std::endl; + return -1; + } + std::cout << "vpMath::saturate<unsigned short>() is Ok !" << std::endl; + + + //short + ushort_value = 60000; + short_value = vpMath::saturate<short>(ushort_value); + if(short_value != SHRT_MAX) { + std::cerr << "Fail: vpMath::saturate<short>(60000)=" << short_value << " / should be " << SHRT_MAX << std::endl; + return -1; + } + + int_value = 70000; + short_value = vpMath::saturate<short>(int_value); + if(short_value != SHRT_MAX) { + std::cerr << "Fail: vpMath::saturate<short>(70000)=" << short_value << " / should be " << SHRT_MAX << std::endl; + return -1; + } + + int_value = -70000; + short_value = vpMath::saturate<short>(int_value); + if(short_value != SHRT_MIN) { + std::cerr << "Fail: vpMath::saturate<short>(-70000)=" << short_value << " / should be " << SHRT_MIN << std::endl; + return -1; + } + + uint_value = 70000; + short_value = vpMath::saturate<short>(uint_value); + if(short_value != SHRT_MAX) { + std::cerr << "Fail: vpMath::saturate<short>(70000)=" << short_value << " / should be " << SHRT_MAX << std::endl; + return -1; + } + + float_value = 70000.1f; + short_value = vpMath::saturate<short>(float_value); + if(short_value != SHRT_MAX) { + std::cerr << "Fail: vpMath::saturate<short>(70000.1f)=" << short_value << " / should be " << SHRT_MAX << std::endl; + return -1; + } + + float_value = -70000.1f; + short_value = vpMath::saturate<short>(float_value); + if(short_value != SHRT_MIN) { + std::cerr << "Fail: vpMath::saturate<short>(-70000.1f)=" << short_value << " / should be " << SHRT_MIN << std::endl; + return -1; + } + + double_value = 70000.1; + short_value = vpMath::saturate<short>(double_value); + if(short_value != SHRT_MAX) { + std::cerr << "Fail: vpMath::saturate<short>(70000.1)=" << short_value << " / should be " << SHRT_MAX << std::endl; + return -1; + } + + double_value = -70000.1; + short_value = vpMath::saturate<short>(double_value); + if(short_value != SHRT_MIN) { + std::cerr << "Fail: vpMath::saturate<short>(70000.1)=" << short_value << " / should be " << SHRT_MIN << std::endl; + return -1; + } + std::cout << "vpMath::saturate<short>() is Ok !" << std::endl; + + + //Test mean, median and standard deviation against Matlab with rng(0) and rand(10,1)*10 + std::vector<double> vectorOfDoubles(10); + vectorOfDoubles[0] = 8.1472; + vectorOfDoubles[1] = 9.0579; + vectorOfDoubles[2] = 1.2699; + vectorOfDoubles[3] = 9.1338; + vectorOfDoubles[4] = 6.3236; + vectorOfDoubles[5] = 0.9754; + vectorOfDoubles[6] = 2.7850; + vectorOfDoubles[7] = 5.4688; + vectorOfDoubles[8] = 9.5751; + vectorOfDoubles[9] = 9.6489; + + + double res = vpMath::getMean(vectorOfDoubles); + if(!vpMath::equal(res, 6.2386, 0.001)) { + std::cerr << "Problem with vpMath::getMean()=" << res << std::endl; + return -1; + } + std::cout << "vpMath::getMean() is Ok !" << std::endl; + + res = vpMath::getStdev(vectorOfDoubles); + if(!vpMath::equal(res, 3.2810, 0.001)) { + std::cerr << "Problem with vpMath::getStdev()=" << res << std::endl; + return -1; + } + + res = vpMath::getStdev(vectorOfDoubles, true); + if(!vpMath::equal(res, 3.4585, 0.001)) { + std::cerr << "Problem with vpMath::getStdev() with Bessel correction=" << res << std::endl; + return -1; + } + std::cout << "vpMath::getStdev() is Ok !" << std::endl; + + res = vpMath::getMedian(vectorOfDoubles); + if(!vpMath::equal(res, 7.2354, 0.001)) { + std::cerr << "Problem with vpMath::getMedian()=" << res << std::endl; + return -1; + } + + //Test median with odd number of elements + vectorOfDoubles.push_back(1.5761); + res = vpMath::getMedian(vectorOfDoubles); + if(!vpMath::equal(res, 6.3236, 0.001)) { + std::cerr << "Problem with vpMath::getMedian()=" << res << std::endl; + return -1; + } + std::cout << "vpMath::getMedian() is Ok !" << std::endl; + + + std::cout << "OK !" << std::endl; + return 0; +} diff --git a/test/math/testMatrix.cpp b/modules/core/test/math/testMatrix.cpp similarity index 69% rename from test/math/testMatrix.cpp rename to modules/core/test/math/testMatrix.cpp index 02aad08306bce368a47e6bcab18b39a189dad302..42679cd4e2a11b2e4306ea67b357260bd5d7d3a4 100644 --- a/test/math/testMatrix.cpp +++ b/modules/core/test/math/testMatrix.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testMatrix.cpp 5242 2015-01-30 18:22:41Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test some vpMatrix functionalities. * @@ -45,86 +41,50 @@ Test some vpMatrix functionalities. */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpParseArgv.h> -#include <visp/vpGEMM.h> - +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/core/vpGEMM.h> #include <stdlib.h> #include <stdio.h> -// List of allowed command line options -#define GETOPTARGS "h" - -void usage(const char *name, const char *badparam); -bool getOptions(int argc, const char **argv); - -/*! - - Print the program options. - -*/ -void usage(const char *name, const char *badparam) +bool test(const std::string &s, const vpMatrix &M, const std::vector<double> &bench) { - fprintf(stdout, "\n\ -Test some vpMatrix functionalities.\n\ -\n\ -SYNOPSIS\n\ - %s [-h]\n", name); - - fprintf(stdout, "\n\ -OPTIONS: Default\n\ - -h\n\ - Print the help.\n"); - - if (badparam) - fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); -} -/*! - - Set the program options. - - \return false if the program has to be stopped, true otherwise. - -*/ -bool getOptions(int argc, const char **argv) -{ - const char *optarg_; - int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { - - switch (c) { - case 'h': usage(argv[0], NULL); return false; break; - - default: - usage(argv[0], optarg_); - return false; break; - } - } - - if ((c == 1) || (c == -1)) { - // standalone param or error - usage(argv[0], NULL); - std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; + static unsigned int cpt = 0; + std::cout << "** Test " << ++cpt << std::endl; + std::cout << s << "(" << M.getRows() << "," << M.getCols() << ") = \n" << M << std::endl; + if(bench.size() != M.size()) { + std::cout << "Test fails: bad size wrt bench" << std::endl; return false; } + for (unsigned int i=0; i<M.size(); i++) { + if (std::fabs(M.data[i]-bench[i]) > std::fabs(M.data[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } return true; } - int -main(int argc, const char ** argv) +main() { try { - // Read the command line options - if (getOptions(argc, argv) == false) { - exit (-1); + int err = 1; + { + vpColVector c(6, 1); + vpRowVector r(6, 1); + std::vector<double> bench(6, 1); + vpMatrix M1(c); + if (test("M1", M1, bench) == false) + return err; + vpMatrix M2(r); + if (test("M2", M2, bench) == false) + return err; } { vpMatrix M(4,5); @@ -141,6 +101,40 @@ main(int argc, const char ** argv) N.init(M, 0, 1, 2, 3); std::cout <<"N "; N.print (std::cout, 4); + + if (vpMatrix::saveMatrix("matrix.mat", M, false, "My 4-by-5 matrix")) + std::cout << "Matrix saved in matrix.mat file" << std::endl; + else + return err; + + vpMatrix M1; + if (vpMatrix::loadMatrix("matrix.mat", M1, false)) + std::cout << "Matrix loaded from matrix.mat file: \n" << M1 << std::endl; + else + return err; + + if (vpMatrix::saveMatrixYAML("matrix.yml", M, "My 4-by-5 matrix")) + std::cout << "Matrix saved in matrix.yml file" << std::endl; + else + return err; + + vpMatrix M2; + if (vpMatrix::loadMatrixYAML("matrix.yml", M2)) + std::cout << "Matrix loaded from matrix.yml file: \n" << M2 << std::endl; + else + return err; + } + { + vpRotationMatrix R(vpMath::rad(10), vpMath::rad(20), vpMath::rad(30)); + std::cout << "R: \n" << R << std::endl; + vpMatrix M1(R); + std::cout << "M1: \n" << M1 << std::endl; + vpMatrix M2(M1); + std::cout << "M2: \n" << M2 << std::endl; + vpMatrix M3 = R; + std::cout << "M3: \n" << M3 << std::endl; + vpMatrix M4 = M1; + std::cout << "M4: \n" << M4 << std::endl; } { diff --git a/modules/core/test/math/testMatrixException.cpp b/modules/core/test/math/testMatrixException.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fee8ca7f3842e43350fa784d4f0ba492aebd3e3f --- /dev/null +++ b/modules/core/test/math/testMatrixException.cpp @@ -0,0 +1,73 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test matrix exceptions. + * + * Authors: + * Eric Marchand + * Fabien Spindler + * + *****************************************************************************/ + +/*! + \example testMatrixException.cpp + \brief Tests matrix exception +*/ + +#include <stdlib.h> +#include <stdio.h> + +#include <visp3/core/vpMatrix.h> + +int main() +{ + vpMatrix M ; + vpMatrix M1(2,3) ; + vpMatrix M2(3,3) ; + vpMatrix M3(2,2) ; + + std::cout << "** test matrix exception during multiplication" << std::endl; + + try { + M = M1*M3 ; + } + catch (vpException &e) { + std::cout << "Catch an exception: " << e << std::endl; + } + + std::cout << "** test matrix exception during addition" << std::endl; + + try { + M = M1+M3 ; + } + catch (vpException &e) { + std::cout << "Catch an exception: " << e << std::endl; + } +} diff --git a/test/math/testMatrixInverse.cpp b/modules/core/test/math/testMatrixInverse.cpp similarity index 93% rename from test/math/testMatrixInverse.cpp rename to modules/core/test/math/testMatrixInverse.cpp index 6051083539767d48694fc0925a16d1fa18832944..36d839e938a52c1ffcb94e65104960000ad9a740 100644 --- a/test/math/testMatrixInverse.cpp +++ b/modules/core/test/math/testMatrixInverse.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testSvd.cpp 3857 2012-07-25 11:47:30Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test various inversions. * @@ -47,11 +43,11 @@ -#include <visp/vpTime.h> +#include <visp3/core/vpTime.h> -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpColVector.h> +#include <visp3/io/vpParseArgv.h> #include <vector> #include <stdlib.h> #include <stdio.h> @@ -59,7 +55,7 @@ #include <iostream> #include <cmath> // List of allowed command line options -#define GETOPTARGS "n:i:pf:r:c:vh" +#define GETOPTARGS "cdn:i:pf:R:C:vh" void usage(const char *name, const char *badparam); bool getOptions(int argc, const char **argv, @@ -86,7 +82,7 @@ Outputs a comparison of these methods.\n\ \n\ SYNOPSIS\n\ %s [-n <number of matrices>] [-f <plot filename>]\n\ - [-r <number of rows>] [-c <number of columns>]\n\ + [-R <number of rows>] [-C <number of columns>]\n\ [-i <number of iterations>] [-p] [-h]\n", name); fprintf(stdout, "\n\ @@ -103,11 +99,11 @@ OPTIONS: Default\n\ the different inversion methods: \n\ QR,LU,Cholesky and Pseudo-inverse.\n\ \n\ - -r <number of rows>\n\ + -R <number of rows>\n\ Number of rows of the automatically generated matrices \n\ we test on.\n\ \n\ - -c <number of columns>\n\ + -C <number of columns>\n\ Number of colums of the automatically generated matrices \n\ we test on.\n\ \n\ @@ -156,15 +152,20 @@ bool getOptions(int argc, const char **argv, case 'p': use_plot_file = true; break; - case 'r': + case 'R': nbrows = (unsigned int)atoi(optarg_); break; - case 'c': + case 'C': nbcols = (unsigned int)atoi(optarg_); break; case 'v': verbose = true; break; + // add default options -c -d + case 'c': + break; + case 'd': + break; default: usage(argv[0], optarg_); return false; break; @@ -202,7 +203,7 @@ vpMatrix makeRandomMatrix(unsigned int nbrows, unsigned int nbcols) int main(int argc, const char ** argv) { -#ifdef VISP_HAVE_LAPACK +#ifdef VISP_HAVE_LAPACK_C try { unsigned int nb_matrices=1000; unsigned int nb_iterations=10; diff --git a/modules/core/test/math/testPoseVector.cpp b/modules/core/test/math/testPoseVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8c532c54bf6c09a8a0c9c4cc5b19772745c7e91b --- /dev/null +++ b/modules/core/test/math/testPoseVector.cpp @@ -0,0 +1,130 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test some vpColVector functionalities. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +/*! + \example testPoseVector.cpp + + Test some vpPoseVector functionalities. +*/ + +#include <cmath> +#include <vector> +#include <limits> + +#include <visp3/core/vpPoseVector.h> + +bool test(const std::string &s, const vpArray2D<double> &A, const std::vector<double> &bench) +{ + static unsigned int cpt = 0; + std::cout << "** Test " << ++cpt << std::endl; + std::cout << s << "(" << A.getRows() << "," << A.getCols() << ") =" << A << std::endl; + if(bench.size() != A.size()) { + std::cout << "Test fails: bad size wrt bench" << std::endl; + return false; + } + for (unsigned int i=0; i<A.size(); i++) { + if (std::fabs(A.data[i]-bench[i]) > std::fabs(A.data[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } + + return true; +} +int main() +{ + int err = 1; + { + vpPoseVector p; + std::vector<double> bench(6,0); + if (test("p", p, bench) == false) + return err; + p[0] = bench[0] = 0.1; + p[1] = bench[1] = 0.2; + p[2] = bench[2] = 0.3; + p[3] = bench[3] = vpMath::rad(10); + p[4] = bench[4] = vpMath::rad(20); + p[5] = bench[5] = vpMath::rad(30); + + if (test("p", p, bench) == false) + return err; + + vpPoseVector p1(p[0], p[1], p[2], p[3], p[4], p[5]); + if (test("p1", p1, bench) == false) + return err; + vpPoseVector p2(p1); + if (test("p2", p2, bench) == false) + return err; + vpPoseVector p3 = p1; + if (test("p3", p3, bench) == false) + return err; + vpPoseVector p4; + p4.set(p[0], p[1], p[2], p[3], p[4], p[5]); + if (test("p4", p4, bench) == false) + return err; + + vpTranslationVector t(p[0], p[1], p[2]); + vpThetaUVector tu(p[3], p[4], p[5]); + vpPoseVector p5(t, tu); + if (test("p5", p5, bench) == false) + return err; + vpPoseVector p6; + p6.buildFrom(t, tu); + if (test("p6", p6, bench) == false) + return err; + + vpHomogeneousMatrix M(t, tu); + vpPoseVector p7(M); + if (test("p7", p7, bench) == false) + return err; + vpPoseVector p8; + p8.buildFrom(M); + if (test("p8", p8, bench) == false) + return err; + + vpRotationMatrix R(tu); + vpPoseVector p9(t, R); + if (test("p9", p9, bench) == false) + return err; + vpPoseVector p10; + p10.buildFrom(t, R); + if (test("p10", p10, bench) == false) + return err; + } + std::cout << "All tests succeed" << std::endl; + return 0; +} diff --git a/modules/core/test/math/testQuaternion.cpp b/modules/core/test/math/testQuaternion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7dfd70fdc97a9c4888068df060246f1908cdbbe6 --- /dev/null +++ b/modules/core/test/math/testQuaternion.cpp @@ -0,0 +1,155 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Tests quaternion operations. + * + * Author: + * Souriya Trinh + * + *****************************************************************************/ + + +/*! + \file testQuaternion.cpp + \brief Tests quaternion operations. +*/ + + +#include <limits> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpQuaternionVector.h> +#include <visp3/core/vpException.h> + + +int main() +{ + try { + //Test addition of two quaternions + vpQuaternionVector q1(2.1, -1, -3.7, 1.5); + vpQuaternionVector q2(0.5, 1.4, 0.7, 2.5); + vpQuaternionVector q3 = q1 + q2; + std::cout << "q3=" << q3 << std::endl; + if(!vpMath::equal(q3.x(), 2.6, std::numeric_limits<double>::epsilon()) || + !vpMath::equal(q3.y(), 0.4, std::numeric_limits<double>::epsilon()) || + !vpMath::equal(q3.z(), -3.0, std::numeric_limits<double>::epsilon()) || + !vpMath::equal(q3.w(), 4.0, std::numeric_limits<double>::epsilon())) { + throw vpException(vpException::fatalError, "Problem with addition of two quaternions !"); + } + + + //Test subtraction of two quaternions + vpQuaternionVector q4 = q3-q1; + std::cout << "q4=" << q4 << std::endl; + if(!vpMath::equal(q4.x(), q2.x(), std::numeric_limits<double>::epsilon()*1e4) || + !vpMath::equal(q4.y(), q2.y(), std::numeric_limits<double>::epsilon()*1e4) || + !vpMath::equal(q4.z(), q2.z(), std::numeric_limits<double>::epsilon()*1e4) || + !vpMath::equal(q4.w(), q2.w(), std::numeric_limits<double>::epsilon()*1e4)) { + throw vpException(vpException::fatalError, "Problem with subtraction of two quaternions !"); + } + + + //Test multiplication of two quaternions + //https://www.wolframalpha.com/input/?i=quaternion+-Sin%5BPi%5D%2B3i%2B4j%2B3k+multiplied+by+-1j%2B3.9i%2B4-3k&lk=3 + vpQuaternionVector q5(3.0, 4.0, 3.0, -sin(M_PI)); + vpQuaternionVector q6(3.9, -1.0, -3.0, 4.0); + vpQuaternionVector q7 = q5 * q6; + std::cout << "q7=" << q7 << std::endl; + if(!vpMath::equal(q7.x(), 3.0, std::numeric_limits<double>::epsilon()*1e4) || + !vpMath::equal(q7.y(), 36.7, std::numeric_limits<double>::epsilon()*1e4) || + !vpMath::equal(q7.z(), -6.6, std::numeric_limits<double>::epsilon()*1e4) || + !vpMath::equal(q7.w(), 1.3, std::numeric_limits<double>::epsilon()*1e4)) { + throw vpException(vpException::fatalError, "Problem with multiplication of two quaternions !"); + } + + + //Test quaternion conjugate + vpQuaternionVector q7_conj = q7.conjugate(); + std::cout << "q7_conj=" << q7_conj << std::endl; + if(!vpMath::equal(q7_conj.x(), -3.0, std::numeric_limits<double>::epsilon()*1e4) || + !vpMath::equal(q7_conj.y(), -36.7, std::numeric_limits<double>::epsilon()*1e4) || + !vpMath::equal(q7_conj.z(), 6.6, std::numeric_limits<double>::epsilon()*1e4) || + !vpMath::equal(q7_conj.w(), 1.3, std::numeric_limits<double>::epsilon()*1e4)) { + throw vpException(vpException::fatalError, "Problem with quaternion conjugate !"); + } + + + //Test quaternion inverse + vpQuaternionVector q7_inv = q7.inverse(); + std::cout << "q7_inv=" << q7_inv << std::endl; + if(!vpMath::equal(q7_inv.x(), -0.00214111, 0.000001) || + !vpMath::equal(q7_inv.y(), -0.026193, 0.000001) || + !vpMath::equal(q7_inv.z(), 0.00471045, 0.000001) || + !vpMath::equal(q7_inv.w(), 0.000927816, 0.000001)) { + throw vpException(vpException::fatalError, "Problem with quaternion inverse !"); + } + + + //Test quaternion norm + double q7_norm = q7.magnitude(); + std::cout << "q7_norm=" << q7_norm << std::endl; + if(!vpMath::equal(q7_norm, 37.4318, 0.0001)) { + throw vpException(vpException::fatalError, "Problem with quaternion magnitude !"); + } + + + //Test quaternion normalization + q7.normalize(); + std::cout << "q7_unit=" << q7 << std::endl; + if(!vpMath::equal(q7.x(), 0.0801457, 0.00001) || + !vpMath::equal(q7.y(), 0.98045, 0.00001) || + !vpMath::equal(q7.z(), -0.176321, 0.00001) || + !vpMath::equal(q7.w(), 0.0347298, 0.00001)) { + throw vpException(vpException::fatalError, "Problem with quaternion normalization !"); + } + + + //Test copy constructor + vpQuaternionVector q_copy1 = vpQuaternionVector(0, 0, 1, 1); + std::cout << "q_copy1=" << q_copy1 << std::endl; + vpQuaternionVector q_copy2 = q_copy1; + q_copy1.set(1, 0, 1, 10); + std::cout << "q_copy1 after set=" << q_copy1 << std::endl; + std::cout << "q_copy2=" << q_copy2 << std::endl; + + + //Test assignment operator + vpQuaternionVector q_copy3(10, 10, 10, 10); + q_copy3 = q_copy1; + std::cout << "q_copy3=" << q_copy3 << std::endl; + + + std::cout << "vpQuaternion operations are ok !" << std::endl; + return 0; + } + catch(vpException &e) { + std::cerr << "Catch an exception: " << e << std::endl; + return 1; + } +} diff --git a/test/math/testRobust.cpp b/modules/core/test/math/testRobust.cpp similarity index 91% rename from test/math/testRobust.cpp rename to modules/core/test/math/testRobust.cpp index 5bf3cd4d90a5c86e702f66d16200439883324579..68fa671dd00746ca868e63fda98e63391230737f 100644 --- a/test/math/testRobust.cpp +++ b/modules/core/test/math/testRobust.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testRobust.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test some vpMath functionalities. * @@ -46,16 +42,16 @@ */ -#include <visp/vpRobust.h> +#include <visp3/core/vpRobust.h> #include <string> #include <fstream> -#include <visp/vpIoTools.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> #include <stdlib.h> #include <stdio.h> #include <iostream> // List of allowed command line options -#define GETOPTARGS "ho:" +#define GETOPTARGS "cdho:" void usage(const char *name, const char *badparam, std::string ofilename); bool getOptions(int argc, const char **argv, std::string &ofilename); @@ -118,6 +114,9 @@ bool getOptions(int argc, const char **argv, std::string &ofilename) case 'o': ofilename = optarg_; break; case 'h': usage(argv[0], NULL, ofilename); return false; break; + case 'c': + case 'd': + break; default: usage(argv[0], optarg_, ofilename); return false; break; diff --git a/modules/core/test/math/testRotation.cpp b/modules/core/test/math/testRotation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..eb0e0a8c7af3fd5464c13c3d0eb577fed6ca3dc8 --- /dev/null +++ b/modules/core/test/math/testRotation.cpp @@ -0,0 +1,359 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Tests transformation from various representations of rotation. + * + * Authors: + * Eric Marchand + * Fabien Spindler + * + *****************************************************************************/ + + +/*! + \file testRotation.cpp + \brief Tests transformation within various representations of rotation. +*/ + + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpQuaternionVector.h> + +#include <stdlib.h> +#include <stdio.h> +#include <cassert> +#include <limits> + +static unsigned int cpt = 0; + +bool test(const std::string &s, const vpArray2D<double> &v, const std::vector<double> &bench) +{ + std::cout << "** Test " << ++cpt << std::endl; + std::cout << s << "(" << v.getRows() << "," << v.getCols() << ") = [" << v << "]" << std::endl; + if(bench.size() != v.size()) { + std::cout << "Test fails: bad size wrt bench" << std::endl; + return false; + } + for (unsigned int i=0; i<v.size(); i++) { + if (std::fabs(v.data[i]-bench[i]) > std::fabs(v.data[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } + + return true; +} + +bool test(const std::string &s, const vpRotationVector &v, const double &bench) +{ + std::cout << "** Test " << ++cpt << std::endl; + std::cout << s << "(" << v.getRows() << "," << v.getCols() << ") = [" << v << "]" << std::endl; + for (unsigned int i=0; i<v.size(); i++) { + if (std::fabs(v[i]-bench) > std::fabs(v[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } + + return true; +} + +int main() +{ + try { + int err = 1; + { + vpThetaUVector r1(vpMath::rad(10), vpMath::rad(10), vpMath::rad(10)); + std::vector<double> bench1(3, vpMath::rad(10)); + if (test("r1", r1, bench1) == false) + return err; + + vpThetaUVector r2 = r1; + if (test("r2", r2, bench1) == false) + return err; + + if (test("r2", r2, vpMath::rad(10)) == false) + return err; + + vpThetaUVector r3; + r3 = vpMath::rad(10); + if (test("r3", r3, bench1) == false) + return err; + + std::cout << "** Test " << ++cpt << std::endl; + for(unsigned int i=0; i<r3.size(); i++) { + if (std::fabs(r3[i]-bench1[i]) > std::fabs(r3[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } + + vpColVector r4 = 0.5 * r1; + std::vector<double> bench2(3, vpMath::rad(5)); + if (test("r4", r4, bench2) == false) + return err; + + vpThetaUVector r5(r3); + if (test("r5", r5, bench1) == false) + return err; + } + { + vpRxyzVector r1(vpMath::rad(10), vpMath::rad(10), vpMath::rad(10)); + std::vector<double> bench1(3, vpMath::rad(10)); + if (test("r1", r1, bench1) == false) + return err; + + vpRxyzVector r2 = r1; + if (test("r2", r2, bench1) == false) + return err; + + if (test("r2", r2, vpMath::rad(10)) == false) + return err; + + vpRxyzVector r3; + r3 = vpMath::rad(10); + if (test("r3", r3, bench1) == false) + return err; + + std::cout << "** Test " << ++cpt << std::endl; + for(unsigned int i=0; i<r3.size(); i++) { + if (std::fabs(r3[i]-bench1[i]) > std::fabs(r3[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } + + vpColVector r4 = 0.5 * r1; + std::vector<double> bench2(3, vpMath::rad(5)); + if (test("r4", r4, bench2) == false) + return err; + + vpRxyzVector r5(r3); + if (test("r5", r5, bench1) == false) + return err; + } + { + vpRzyxVector r1(vpMath::rad(10), vpMath::rad(10), vpMath::rad(10)); + std::vector<double> bench1(3, vpMath::rad(10)); + if (test("r1", r1, bench1) == false) + return err; + + vpRzyxVector r2 = r1; + if (test("r2", r2, bench1) == false) + return err; + + if (test("r2", r2, vpMath::rad(10)) == false) + return err; + + vpRzyxVector r3; + r3 = vpMath::rad(10); + if (test("r3", r3, bench1) == false) + return err; + + std::cout << "** Test " << ++cpt << std::endl; + for(unsigned int i=0; i<r3.size(); i++) { + if (std::fabs(r3[i]-bench1[i]) > std::fabs(r3[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } + + vpColVector r4 = 0.5 * r1; + std::vector<double> bench2(3, vpMath::rad(5)); + if (test("r4", r4, bench2) == false) + return err; + + vpRzyxVector r5(r3); + if (test("r5", r5, bench1) == false) + return err; + } + { + vpRzyzVector r1(vpMath::rad(10), vpMath::rad(10), vpMath::rad(10)); + std::vector<double> bench1(3, vpMath::rad(10)); + if (test("r1", r1, bench1) == false) + return err; + + vpRzyzVector r2 = r1; + if (test("r2", r2, bench1) == false) + return err; + + if (test("r2", r2, vpMath::rad(10)) == false) + return err; + + vpRzyzVector r3; + r3 = vpMath::rad(10); + if (test("r3", r3, bench1) == false) + return err; + + std::cout << "** Test " << ++cpt << std::endl; + for(unsigned int i=0; i<r3.size(); i++) { + if (std::fabs(r3[i]-bench1[i]) > std::fabs(r3[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } + + vpColVector r4 = 0.5 * r1; + std::vector<double> bench2(3, vpMath::rad(5)); + if (test("r4", r4, bench2) == false) + return err; + + vpRzyzVector r5(r3); + if (test("r5", r5, bench1) == false) + return err; + } + { + vpQuaternionVector r1(vpMath::rad(10), vpMath::rad(10), vpMath::rad(10), vpMath::rad(10)); + std::vector<double> bench1(4, vpMath::rad(10)); + if (test("r1", r1, bench1) == false) + return err; + + vpQuaternionVector r2 = r1; + if (test("r2", r2, bench1) == false) + return err; + + if (test("r2", r2, vpMath::rad(10)) == false) + return err; + + vpQuaternionVector r3; + r3.set(vpMath::rad(10), vpMath::rad(10), vpMath::rad(10), vpMath::rad(10)); + if (test("r3", r3, bench1) == false) + return err; + + std::cout << "** Test " << ++cpt << std::endl; + for(unsigned int i=0; i<r3.size(); i++) { + if (std::fabs(r3[i]-bench1[i]) > std::fabs(r3[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } + + vpColVector r4 = 0.5 * r1; + std::vector<double> bench2(4, vpMath::rad(5)); + if (test("r4", r4, bench2) == false) + return err; + + vpQuaternionVector r5(r3); + if (test("r5", r5, bench1) == false) + return err; + } + { + vpRotationMatrix R; + for(int i=-10;i<10;i++){ + for(int j=-10;j<10;j++){ + vpThetaUVector tu(vpMath::rad(90+i), vpMath::rad(170+j), vpMath::rad(45)) ; + tu.buildFrom(vpRotationMatrix(tu)); //put some coherence into rotation convention + + std::cout << "Initialization " <<std::endl ; + + double theta; + vpColVector u; + tu.extract(theta, u); + + std::cout << "theta=" << vpMath::deg(theta) << std::endl ; + std::cout << "u=" << u << std::endl ; + + std::cout << "From vpThetaUVector to vpRotationMatrix " << std::endl ; + R.buildFrom(tu) ; + + std::cout << "Matrix R" ; + if (R.isARotationMatrix()==1) std::cout <<" is a rotation matrix " << std::endl ; + else std::cout <<" is not a rotation matrix " << std::endl ; + + std::cout << R << std::endl ; + + std::cout << "From vpRotationMatrix to vpQuaternionVector " << std::endl ; + vpQuaternionVector q(R); + std::cout << q <<std::endl ; + + R.buildFrom(q); + std::cout << "From vpQuaternionVector to vpRotationMatrix " << std::endl ; + + std::cout << "From vpRotationMatrix to vpRxyzVector " << std::endl ; + vpRxyzVector RxyzBuildFromR(R) ; + std::cout << RxyzBuildFromR <<std::endl ; + + + std::cout << "From vpRxyzVector to vpThetaUVector " << std::endl ; + std::cout << " use From vpRxyzVector to vpRotationMatrix " << std::endl ; + std::cout << " use From vpRotationMatrix to vpThetaUVector " << std::endl ; + + + vpThetaUVector tuBuildFromEu ; + tuBuildFromEu.buildFrom(R) ; + + std::cout << std::endl ; + std::cout << "result : should equivalent to the first one " << std::endl ; + + + double theta2; + vpColVector u2; + + tuBuildFromEu.extract(theta2, u2); + std::cout << "theta=" << vpMath::deg(theta2) << std::endl ; + std::cout << "u=" << u2 << std::endl ; + + assert(vpMath::abs(theta2-theta)<std::numeric_limits<double>::epsilon()*1e10); + assert(vpMath::abs(u[0]-u2[0])<std::numeric_limits<double>::epsilon()*1e10); + assert(vpMath::abs(u[1]-u2[1])<std::numeric_limits<double>::epsilon()*1e10); + assert(vpMath::abs(u[2]-u2[2])<std::numeric_limits<double>::epsilon()*1e10); + } + vpRzyzVector rzyz(vpMath::rad(180), vpMath::rad(120), vpMath::rad(45)) ; + std::cout << "Initialization vpRzyzVector " <<std::endl ; + std::cout << rzyz << std::endl ; + std::cout << "From vpRzyzVector to vpRotationMatrix " << std::endl ; + R.buildFrom(rzyz) ; + std::cout << "From vpRotationMatrix to vpRzyzVector " << std::endl ; + vpRzyzVector rzyz_final ; + rzyz_final.buildFrom(R) ; + std::cout << rzyz_final << std::endl ; + + vpRzyxVector rzyx(vpMath::rad(180), vpMath::rad(120), vpMath::rad(45)) ; + std::cout << "Initialization vpRzyxVector " <<std::endl ; + std::cout << rzyx << std::endl ; + std::cout << "From vpRzyxVector to vpRotationMatrix " << std::endl ; + R.buildFrom(rzyx) ; + std::cout << R << std::endl ; + std::cout << "From vpRotationMatrix to vpRzyxVector " << std::endl ; + vpRzyxVector rzyx_final ; + rzyx_final.buildFrom(R) ; + std::cout << rzyx_final << std::endl ; + } + } + std::cout << "All tests succeed" << std::endl; + return 0; + } + catch(vpException e) { + std::cout << "Catch an exception: " << e << std::endl; + return 1; + } +} diff --git a/modules/core/test/math/testRowVector.cpp b/modules/core/test/math/testRowVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..29810ffa4b020e4cd526cb9807f53217fc1e6da1 --- /dev/null +++ b/modules/core/test/math/testRowVector.cpp @@ -0,0 +1,286 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test some vpColVector functionalities. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +/*! + \example testRowVector.cpp + + Test some vpRowVector functionalities. +*/ + +#include <stdlib.h> +#include <stdio.h> + +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRowVector.h> + + +bool test(const std::string &s, const vpRowVector &v, const std::vector<double> &bench) +{ + static unsigned int cpt = 0; + std::cout << "** Test " << ++cpt << std::endl; + std::cout << s << "(" << v.getRows() << "," << v.getCols() << ") = [" << v << "]" << std::endl; + if(bench.size() != v.size()) { + std::cout << "Test fails: bad size wrt bench" << std::endl; + return false; + } + for (unsigned int i=0; i<v.size(); i++) { + if (std::fabs(v[i]-bench[i]) > std::fabs(v[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } + + return true; +} + +int main() +{ + int err = 1; + + { + vpRowVector v; + + v.resize(4); + v = 3; + std::vector<double> bench1(4, 3); + if (test("v", v, bench1) == false) + return err; + std::vector<double> bench2(4, 3./6); + v.normalize(); + if (test("v", v, bench2) == false) + return err; + + v.resize(1, 5, true); + std::vector<double> bench3(5, 0); + if (test("v", v, bench3) == false) + return err; + } + + { + vpRowVector v(4); + std::vector<double> bench1(4); + for(unsigned int i=0; i<v.size(); i++) { + v[i] = (double)i; + bench1[i] = (double)i; + } + if (test("v", v, bench1) == false) + return err; + + vpRowVector w; + w.init(v, 0, 2); + std::vector<double> bench2; + bench2.push_back(0); + bench2.push_back(1); + if (test("w", w, bench2) == false) + return err; + + std::vector<double> bench3; + bench3.push_back(1); + bench3.push_back(2); + bench3.push_back(3); + + vpRowVector r1; + for(size_t i=0; i<4; i++) + r1.stack((double)i); + + vpRowVector r2 = r1.extract(1, 3); + if (test("r2", r2, bench3) == false) + return err; + } + { + vpMatrix M(1, 4); + std::vector<double> bench(4); + for(unsigned int i=0; i<M.getCols(); i++) { + M[0][i] = i; + bench[i] = i; + } + if (test("M", M, bench) == false) + return err; + vpRowVector v; + v = M; + if (test("v", v, bench) == false) + return err; + vpRowVector w(M); + if (test("w", w, bench) == false) + return err; + vpRowVector z1(bench); + if (test("z1", z1, bench) == false) + return err; + vpRowVector z2 = bench; + if (test("z2", z2, bench) == false) + return err; + } + { + vpRowVector v(3); + v[0] = 1; + v[1] = 2; + v[2] = 3; + std::vector<double> bench1; + bench1.push_back(3); + bench1.push_back(6); + bench1.push_back(9); + + vpRowVector w = v * 3; + // v is unchanged + // w is now equal to : [3 6 9] + if (test("w", w, bench1) == false) + return err; + + vpRowVector x(w); + if (test("x", x, bench1) == false) + return err; + + std::vector<float> bench2; + bench2.push_back(3); + bench2.push_back(6); + bench2.push_back(9); + vpRowVector y1(bench2); + if (test("y1", y1, bench1) == false) + return err; + vpRowVector y2 = bench2; + if (test("y2", y2, bench1) == false) + return err; + } + { + vpRowVector r1(3, 1); + vpRowVector r2 = -r1; + std::vector<double> bench(3,-1); + // v contains [-1 -1 -1] + if (test("r2", r2, bench) == false) + return err; + r2.stack(-2); + bench.push_back(-2); + if (test("r2", r2, bench) == false) + return err; + vpRowVector r3 = vpRowVector::stack(r1, r2); + std::vector<double> bench3(7, 1); + bench3[3] = bench3[4] = bench3[5] = -1; + bench3[6] = -2; + if (test("r3", r3, bench3) == false) + return err; + + r1.stack(r2); + if (test("r1", r1, bench3) == false) + return err; + } + { + vpRowVector r1(3, 2); + vpRowVector r2(3, 4); + vpRowVector r = r1 + r2; + std::vector<double> bench(3, 6); + if (test("r", r, bench) == false) + return err; + r1 += r2; + if (test("r1", r1, bench) == false) + return err; + } + { + vpRowVector r1(3, 2); + vpRowVector r2(3, 4); + vpRowVector r = r1 - r2; + std::vector<double> bench(3, -2); + if (test("r", r, bench) == false) + return err; + r1 -= r2; + if (test("r1", r1, bench) == false) + return err; + } + { + vpRowVector r(5, 1); + r.clear(); + r.resize(5); + r = 5; + std::vector<double> bench(5, 5); + if (test("r", r, bench) == false) + return err; + } + { + // Test mean, median and standard deviation against Matlab with rng(0) and rand(10,1)*10 + vpRowVector r(10); + r[0] = 8.1472; + r[1] = 9.0579; + r[2] = 1.2699; + r[3] = 9.1338; + r[4] = 6.3236; + r[5] = 0.9754; + r[6] = 2.7850; + r[7] = 5.4688; + r[8] = 9.5751; + r[9] = 9.6489; + + std::cout << "** Test mean" << std::endl; + double res = vpRowVector::mean(r); + if(!vpMath::equal(res, 6.2386, 0.001)) { + std::cout << "Test fails: bad mean " << res << std::endl; + return err; + } + + std::cout << "** Test stdev" << std::endl; + res = vpRowVector::stdev(r); + if(!vpMath::equal(res, 3.2810, 0.001)) { + std::cout << "Test fails: bad stdev " << res << std::endl; + return err; + } + + std::cout << "** Test stdev(bessel)" << std::endl; + res = vpRowVector::stdev(r, true); + if(!vpMath::equal(res, 3.4585, 0.001)) { + std::cout << "Test fails: bad stdev(bessel) " << res << std::endl; + return err; + } + + std::cout << "** Test median" << std::endl; + res = vpRowVector::median(r); + if(!vpMath::equal(res, 7.2354, 0.001)) { + std::cout << "Test fails: bad median " << res << std::endl; + return err; + } + + // Test median with odd number of elements + std::cout << "** Test median (odd)" << std::endl; + r.stack(1.5761); + res = vpRowVector::median(r); + if(!vpMath::equal(res, 6.3236, 0.001)) { + std::cout << "Test fails: bad median (odd) " << res << std::endl; + return err; + } + std::cout << "r: [" << r << "]" << std::endl; + r.print(std::cout, 8, "r"); + } + std::cout << "All tests succeed" << std::endl; + return 0; +} diff --git a/test/math/testSvd.cpp b/modules/core/test/math/testSvd.cpp similarity index 72% rename from test/math/testSvd.cpp rename to modules/core/test/math/testSvd.cpp index 5963321ef4b1a8e2d7eadb5bf2b9cd66b3bba349..503856b512491e255d44253d72b4654111faecf3 100644 --- a/test/math/testSvd.cpp +++ b/modules/core/test/math/testSvd.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testSvd.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test various svd decompositions. * @@ -46,80 +42,21 @@ \brief Test various svd decompositions. */ +#include <visp3/core/vpTime.h> - -#include <visp/vpTime.h> - -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpColVector.h> #include <vector> #include <algorithm> #include <stdlib.h> #include <stdio.h> -// List of allowed command line options -#define GETOPTARGS "h" -void usage(const char *name, const char *badparam); -bool getOptions(int argc, const char **argv); bool testSvdOpenCvGSLCoherence(double epsilon); #ifdef VISP_HAVE_GSL bool testRandom(double epsilon); #endif -/*! - - Print the program options. - -*/ -void usage(const char *name, const char *badparam) -{ - fprintf(stdout, "\n\ -Test various svd decompositions.\n\ -\n\ -SYNOPSIS\n\ - %s [-h]\n", name); - - fprintf(stdout, "\n\ -OPTIONS: Default\n\ - -h\n\ - Print the help.\n"); - - if (badparam) - fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); -} -/*! - Set the program options. - - \return false if the program has to be stopped, true otherwise. - -*/ -bool getOptions(int argc, const char **argv) -{ - const char *optarg_; - int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { - - switch (c) { - case 'h': usage(argv[0], NULL); return false; break; - - default: - usage(argv[0], optarg_); - return false; break; - } - } - - if ((c == 1) || (c == -1)) { - // standalone param or error - usage(argv[0], NULL); - std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; - return false; - } - - return true; -} #define abs(x) ((x) < 0 ? - (x) : (x)) #ifdef VISP_HAVE_GSL @@ -191,14 +128,9 @@ bool testSvdOpenCvGSLCoherence(double epsilon) } int -main(int argc, const char ** argv) +main() { try { - // Read the command line options - if (getOptions(argc, argv) == false) { - exit (-1); - } - vpMatrix L(60000,6), Ls ; for (unsigned int i=0 ; i < L.getRows() ; i++) for (unsigned int j=0 ; j < L.getCols() ; j++) diff --git a/modules/core/test/math/testTranslationVector.cpp b/modules/core/test/math/testTranslationVector.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bb314d452b692666c3c361a8bdffe73dbc1def3d --- /dev/null +++ b/modules/core/test/math/testTranslationVector.cpp @@ -0,0 +1,135 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test some vpColVector functionalities. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + +/*! + \example testTranslationVector.cpp + + Test some vpTranslationVector functionalities. +*/ + +#include <cmath> +#include <vector> +#include <limits> + +#include <visp3/core/vpTranslationVector.h> + +bool test(const std::string &s, const vpArray2D<double> &A, const std::vector<double> &bench) +{ + static unsigned int cpt = 0; + std::cout << "** Test " << ++cpt << std::endl; + std::cout << s << "(" << A.getRows() << "," << A.getCols() << ") =" << A << std::endl; + if(bench.size() != A.size()) { + std::cout << "Test fails: bad size wrt bench" << std::endl; + return false; + } + for (unsigned int i=0; i<A.size(); i++) { + if (std::fabs(A.data[i]-bench[i]) > std::fabs(A.data[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } + + return true; +} +int main() +{ + int err = 1; + { + vpTranslationVector t; + std::vector<double> bench(3,0); + if (test("t", t, bench) == false) + return err; + } + { + vpTranslationVector t1(1, 2, 3); + std::vector<double> bench(3); + bench[0] = 1; + bench[1] = 2; + bench[2] = 3; + if (test("t1", t1, bench) == false) + return err; + + vpTranslationVector t2(4, 5, 6); + bench[0] = 4; + bench[1] = 5; + bench[2] = 6; + if (test("t2", t2, bench) == false) + return err; + + vpTranslationVector t3 = t1 + t2; + bench[0] = 5; + bench[1] = 7; + bench[2] = 9; + if (test("t3", t3, bench) == false) + return err; + + vpMatrix skew = t3.skew(); + std::vector<double> bench1(9, 0); + bench1[1] = -9; + bench1[2] = 7; + bench1[3] = 9; + bench1[5] = -5; + bench1[6] = -7; + bench1[7] = 5; + if (test("skew", skew, bench1) == false) + return err; + + vpTranslationVector t4; + t4.set(-1, -2, -3); + bench[0] = -1; + bench[1] = -2; + bench[2] = -3; + if (test("t4", t4, bench) == false) + return err; + + vpTranslationVector t5 = t4 * 2; + bench[0] = -2; + bench[1] = -4; + bench[2] = -6; + if (test("t5", t5, bench) == false) + return err; + + vpTranslationVector t6 = vpTranslationVector::cross(t4, t5); + bench[0] = 0; + bench[1] = 0; + bench[2] = 0; + if (test("t6", t6, bench) == false) + return err; + } + std::cout << "All tests succeed" << std::endl; + return 0; +} diff --git a/test/math/testTwistMatrix.cpp b/modules/core/test/math/testTwistMatrix.cpp similarity index 52% rename from test/math/testTwistMatrix.cpp rename to modules/core/test/math/testTwistMatrix.cpp index f0cd2dba11d93198ad70994de8a881ca50e67861..7f0f1489ddcf35bcdbeee542be41cc8bac3cd69b 100644 --- a/test/math/testTwistMatrix.cpp +++ b/modules/core/test/math/testTwistMatrix.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testTwistMatrix.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tests some vpMatrix functionalities. * @@ -47,90 +43,24 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> #include <stdio.h> -#include <visp/vpMath.h> -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpParseArgv.h> - -// List of allowed command line options -#define GETOPTARGS "h" -void usage(const char *name, const char *badparam); -bool getOptions(int argc, const char **argv); - -/*! - - Print the program options. - -*/ -void usage(const char *name, const char *badparam) -{ - fprintf(stdout, "\n\ -Tests some vpMatrix functionalities.\n\ -\n\ -SYNOPSIS\n\ - %s [-h]\n", name); - - fprintf(stdout, "\n\ -OPTIONS: Default\n\ - -h\n\ - Print the help.\n"); - - if (badparam) - fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); -} -/*! - - Set the program options. - - \return false if the program has to be stopped, true otherwise. - -*/ -bool getOptions(int argc, const char **argv) -{ - const char *optarg_; - int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { - - switch (c) { - case 'h': usage(argv[0], NULL); return false; break; - - default: - usage(argv[0], optarg_); - return false; break; - } - } - - if ((c == 1) || (c == -1)) { - // standalone param or error - usage(argv[0], NULL); - std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; - return false; - } - - return true; -} - +#include <visp3/core/vpMath.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpVelocityTwistMatrix.h> int -main(int argc, const char ** argv) +main() { try { - // Read the command line options - if (getOptions(argc, argv) == false) { - exit (-1); - } - vpTRACE("--------------------------"); vpTRACE("--- TEST vpVelocityTwistMatrix ---"); vpTRACE("--------------------------"); @@ -156,7 +86,6 @@ main(int argc, const char ** argv) vpTRACE("cVe twist matrix:"); cVe.print (std::cout, 6); - // Set a speed skew vpColVector ev(6); diff --git a/test/network/testClient.cpp b/modules/core/test/network/testClient.cpp similarity index 83% rename from test/network/testClient.cpp rename to modules/core/test/network/testClient.cpp index bdf7eb6516dc100cbf8fc9f1d5b61432dfb5fb66..ff6a0f3397ce32c90930919798936fa4b7083472 100644 --- a/test/network/testClient.cpp +++ b/modules/core/test/network/testClient.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: testClient.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for TCP client/Server. * @@ -46,7 +42,7 @@ */ #include <iostream> -#include <visp/vpClient.h> +#include <visp3/core/vpClient.h> int main() { diff --git a/test/network/testServer.cpp b/modules/core/test/network/testServer.cpp similarity index 83% rename from test/network/testServer.cpp rename to modules/core/test/network/testServer.cpp index e71f13b64524f01a7e9e822014af0deee7411014..c8644c2f44ac7da9f391b3e54025b82ca98e33da 100644 --- a/test/network/testServer.cpp +++ b/modules/core/test/network/testServer.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: testServer.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for TCP client/Server. * @@ -46,7 +42,7 @@ */ #include <iostream> -#include <visp/vpServer.h> +#include <visp3/core/vpServer.h> int main() { diff --git a/test/tools/convert/testConvert.cpp b/modules/core/test/tools/convert/testConvert.cpp similarity index 96% rename from test/tools/convert/testConvert.cpp rename to modules/core/test/tools/convert/testConvert.cpp index 92d8b85b9d0bad10d7427f3aa0cf66f54b80d829..d74683a9836458ae0cd52c85b31beba6929296ad 100644 --- a/test/tools/convert/testConvert.cpp +++ b/modules/core/test/tools/convert/testConvert.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testIoTools.cpp 5210 2015-01-26 10:51:11Z strinh $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test functions in vpIoTools. * @@ -49,8 +45,8 @@ #include <iostream> // std::cout #include <limits> // std::numeric_limits -#include <visp/vpConfig.h> -#include <visp/vpConvert.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpConvert.h> bool areSame(double a, double b) { diff --git a/test/tools/geometry/testPolygon.cpp b/modules/core/test/tools/geometry/testPolygon.cpp old mode 100755 new mode 100644 similarity index 91% rename from test/tools/geometry/testPolygon.cpp rename to modules/core/test/tools/geometry/testPolygon.cpp index 3a9f7c74fbf502bea4ba47aa7eac46823c4ddba8..21457b83f2536059bb111c97fa0fc71575a7756e --- a/test/tools/geometry/testPolygon.cpp +++ b/modules/core/test/tools/geometry/testPolygon.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testPolygon.cpp 5004 2014-11-24 08:24:18Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example which test the polygon. * @@ -40,15 +36,15 @@ *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpPolygon.h> -#include <visp/vpParseArgv.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpPolygon.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpImagePoint.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> #include <math.h> diff --git a/test/tools/io/testIoTools.cpp b/modules/core/test/tools/io/testIoTools.cpp similarity index 97% rename from test/tools/io/testIoTools.cpp rename to modules/core/test/tools/io/testIoTools.cpp index 871127ca3eae2af09f0300e283c5106252cbda02..9021fe3570c1ff759dbbbd35feb8498189999fb5 100644 --- a/test/tools/io/testIoTools.cpp +++ b/modules/core/test/tools/io/testIoTools.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testIoTools.cpp 5210 2015-01-26 10:51:11Z strinh $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test functions in vpIoTools. * @@ -50,7 +46,7 @@ #include <stdio.h> #include <string.h> #include <iostream> -#include <visp/vpIoTools.h> +#include <visp3/core/vpIoTools.h> int diff --git a/test/tools/time/testTime.cpp b/modules/core/test/tools/time/testTime.cpp similarity index 63% rename from test/tools/time/testTime.cpp rename to modules/core/test/tools/time/testTime.cpp index 259d9e602343d202f0cbca25732466deefd42428..98c22739e43d80e46b3edc5c4ee4f0bf0f6b38cc 100644 --- a/test/tools/time/testTime.cpp +++ b/modules/core/test/tools/time/testTime.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testTime.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Time management. * @@ -46,7 +42,7 @@ \brief Time management. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX # include <unistd.h> #elif defined(_WIN32) @@ -58,79 +54,11 @@ #include <stdio.h> #include <iostream> #include <time.h> -#include <visp/vpTime.h> -#include <visp/vpParseArgv.h> - -void usage(const char *name, const char *badparam); -bool getOptions(int argc, const char **argv); +#include <visp3/core/vpTime.h> -// List of allowed command line options -#define GETOPTARGS "h" - -/*! - - Print the program options. - -*/ -void usage(const char *name, const char *badparam) -{ - fprintf(stdout, "\n\ -Time management.\n\ -\n\ -SYNOPSIS\n\ - %s [-h]\n", name); - - fprintf(stdout, "\n\ -OPTIONS: Default\n\ - -h\n\ - Print the help.\n"); - - if (badparam) - fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); -} -/*! - - Set the program options. - - \return false if the program has to be stopped, true otherwise. - -*/ -bool getOptions(int argc, const char **argv) -{ - const char *optarg_; - int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { - - switch (c) { - case 'h': usage(argv[0], NULL); return false; break; - - default: - usage(argv[0], optarg_); - return false; break; - } - } - - if ((c == 1) || (c == -1)) { - // standalone param or error - usage(argv[0], NULL); - std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; - return false; - } - - return true; -} - - -int -main(int argc, const char ** argv) +int main() { try { - // Read the command line options - if (getOptions(argc, argv) == false) { - exit (-1); - } - double v = 0; double t0 = vpTime::measureTimeMs(); diff --git a/test/tools/xml/testXmlParser.cpp b/modules/core/test/tools/xml/testXmlParser.cpp old mode 100755 new mode 100644 similarity index 95% rename from test/tools/xml/testXmlParser.cpp rename to modules/core/test/tools/xml/testXmlParser.cpp index d0f074010a88445ba3ca7a1c602c516cabcc4300..c7b2b3da7afe998b8ea5000cbfb2303283ab897b --- a/test/tools/xml/testXmlParser.cpp +++ b/modules/core/test/tools/xml/testXmlParser.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testXmlParser.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example which describes how to use the xml parser class. * @@ -59,15 +55,15 @@ */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <iostream> #if defined(VISP_HAVE_XML2) -#include <visp/vpXmlParser.h> -#include <visp/vpDebug.h> -#include <visp/vpIoTools.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpXmlParser.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> #include <string> @@ -206,7 +202,7 @@ vpExampleDataParser::writeMainClass(xmlNodePtr node) /* -------------------------------------------------------------------------- */ // List of allowed command line options -#define GETOPTARGS "o:h" +#define GETOPTARGS "cdo:h" void usage(const char *name, const char *badparam, const std::string& opath, const std::string& user); bool getOptions(int argc, const char **argv, std::string &opath, const std::string& user); @@ -265,6 +261,10 @@ bool getOptions(int argc, const char **argv, std::string &opath, const std::stri case 'o': opath = optarg_; break; case 'h': usage(argv[0], NULL, opath, user); return false; break; + case 'c': + case 'd': + break; + default: usage(argv[0], optarg_, opath, user); return false; break; } diff --git a/example/device/CMakeLists.txt b/modules/detection/CMakeLists.txt similarity index 59% rename from example/device/CMakeLists.txt rename to modules/detection/CMakeLists.txt index 81f049dc0eb6f17392b0eeaaef45be6d546aff26..ee541e15fd94b937717df35a16f54c3f9212fcf2 100644 --- a/example/device/CMakeLists.txt +++ b/modules/detection/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,43 +10,46 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: -# ViSP overall configuration file. +# ViSP configuration file. # # Authors: # Fabien Spindler # ############################################################################# -# Set SRC_SUBDIRS variable to all the sub directories we want to parse during -# the build process. -# -# If you add/remove a directory, modify here -SET (SRC_SUBDIRS - display - framegrabber - kinect - laserscanner - light -) +# Add optional 3rd parties +set(opt_incs "") +set(opt_libs "") + +if(USE_ZBAR) + list(APPEND opt_incs ${ZBAR_INCLUDE_DIRS}) + list(APPEND opt_libs ${ZBAR_LIBRARIES}) +endif() +if(USE_DMTX) + list(APPEND opt_incs ${DMTX_INCLUDE_DIRS}) + list(APPEND opt_libs ${DMTX_LIBRARIES}) +endif() + +vp_add_module(detection visp_core) +vp_glob_module_sources() +vp_module_include_directories(${opt_incs}) +vp_create_module(${opt_libs}) -# Build process propagation in the sub directories -SUBDIRS(${SRC_SUBDIRS}) diff --git a/src/detection/vpDetectorBase.h b/modules/detection/include/visp3/detection/vpDetectorBase.h similarity index 62% rename from src/detection/vpDetectorBase.h rename to modules/detection/include/visp3/detection/vpDetectorBase.h index e0191f4d5bac711c86a4efbdc96e2e736db5228e..299287c8825a9ff1fe5c3d264a3e7a251101679a 100644 --- a/src/detection/vpDetectorBase.h +++ b/modules/detection/include/visp3/detection/vpDetectorBase.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id$ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -46,13 +43,13 @@ #include <string> #include <assert.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpRect.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpRect.h> /*! \class vpDetectorBase - + \ingroup group_detection_barcode group_detection_face Base class for object detection. This class is a generic class that can be used to detect: @@ -72,7 +69,7 @@ public: /*! Default constructor. */ - vpDetectorBase() : m_polygon(), m_message(), m_nb_objects(0) {} + vpDetectorBase(); /*! Default destructor. */ @@ -95,68 +92,32 @@ public: /*! Returns ith object container box as a vector of points. */ - std::vector<vpImagePoint> & getPolygon(size_t i) - { - if (i < m_polygon.size()) - return m_polygon[i]; - else - throw(vpException(vpException::badValue, "Bad index to retrieve object %d. Only %d objects are detected.", i, m_polygon.size())); - } + std::vector<vpImagePoint> & getPolygon(size_t i); + /*! Returns the contained message of the ith object if there is one. */ - std::string & getMessage(size_t i) - { - if (i < m_polygon.size()) - return m_message[i]; - else - throw(vpException(vpException::badValue, "Bad index to retrieve object %d . Only %d objects are detected.", i, m_polygon.size())); - } + std::string & getMessage(size_t i); + /*! Returns the contained message of the ith object if there is one. */ - std::vector< std::string > & getMessage() - { - return m_message; - } + std::vector< std::string > & getMessage() { return m_message; } + /*! Return the number of objects that are detected. */ size_t getNbObjects() const {return m_nb_objects; } + /*! Return the center of gravity location of the ith object. */ - vpImagePoint getCog(size_t i) const - { - vpImagePoint cog(0,0); - for(size_t j=0; j < m_polygon[i].size(); j++) { - cog += m_polygon[i][j]; - } - cog /= (double)m_polygon[i].size(); - return cog; - } + vpImagePoint getCog(size_t i) const ; + /*! Return the bounding box of the ith object. */ - vpRect getBBox(size_t i) const - { - assert(m_polygon[i].size() > 2); - - double left, right; - double top, bottom; - left = right = m_polygon[i][0].get_u(); - top = bottom = m_polygon[i][0].get_v(); - for(size_t j=0; j < m_polygon[i].size(); j++) { - double u = m_polygon[i][j].get_u(); - double v = m_polygon[i][j].get_v(); - if (u < left) left = u; - if (u > right) right = u; - if (v < top) top = v; - if (v > bottom) bottom = v; - } - vpRect roi(vpImagePoint(top, left), vpImagePoint(bottom, right)); - return roi; - } + vpRect getBBox(size_t i) const ; }; #endif diff --git a/src/detection/barcode/vpDetectorDataMatrixCode.h b/modules/detection/include/visp3/detection/vpDetectorDataMatrixCode.h similarity index 86% rename from src/detection/barcode/vpDetectorDataMatrixCode.h rename to modules/detection/include/visp3/detection/vpDetectorDataMatrixCode.h index 92a90e0e3f0027ba14277e5485bf1877b96bb866..3cf691f0b57aa2855a8f0fd02a0373a4dfb0ab91 100644 --- a/src/detection/barcode/vpDetectorDataMatrixCode.h +++ b/modules/detection/include/visp3/detection/vpDetectorDataMatrixCode.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id$ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -45,16 +42,16 @@ #include <utility> #include <string> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_DMTX -#include <visp/vpDetectorBase.h> -#include <visp/vpImage.h> +#include <visp3/detection/vpDetectorBase.h> +#include <visp3/core/vpImage.h> /*! \class vpDetectorDataMatrixCode - + \ingroup group_detection_barcode Base class for bar code detector. This class is a wrapper over libdmtx available from http://www.libdmtx.org/ @@ -65,8 +62,8 @@ The following sample code shows how to use this class to detect QR codes in an image. \code -#include <visp/vpDetectorDataMatrixCode.h> -#include <visp/vpImageIo.h> +#include <visp3/detection/vpDetectorDataMatrixCode.h> +#include <visp3/io/vpImageIo.h> int main() { diff --git a/src/detection/face/vpDetectorFace.h b/modules/detection/include/visp3/detection/vpDetectorFace.h similarity index 87% rename from src/detection/face/vpDetectorFace.h rename to modules/detection/include/visp3/detection/vpDetectorFace.h index d27ba882191976e8503d6806f62b5b338138f457..49abc3d24ddbfdf231388c7898212df74969cd0a 100644 --- a/src/detection/face/vpDetectorFace.h +++ b/modules/detection/include/visp3/detection/vpDetectorFace.h @@ -1,7 +1,7 @@ /**************************************************************************** * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -10,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,7 +38,7 @@ #ifndef __vpDetectorFace_h__ #define __vpDetectorFace_h__ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if (VISP_HAVE_OPENCV_VERSION >= 0x020200) @@ -47,18 +46,18 @@ #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> -#include <visp/vpDetectorBase.h> +#include <visp3/detection/vpDetectorBase.h> /*! \class vpDetectorFace - + \ingroup group_detection_face The vpDetectorFace class is a wrapper over OpenCV Haar cascade face detection capabilities. To use this class ViSP should be build against OpenCV 2.2.0 or a more recent version. The following sample code shows how to use this class to detect the largest face in the image. The cascade classifier file "haarcascade_frontalface_alt.xml" can be found in ViSP source code or in OpenCV. \code -#include <visp/vpDetectorFace.h> +#include <visp3/detection/vpDetectorFace.h> int main() { diff --git a/src/detection/barcode/vpDetectorQRCode.h b/modules/detection/include/visp3/detection/vpDetectorQRCode.h similarity index 86% rename from src/detection/barcode/vpDetectorQRCode.h rename to modules/detection/include/visp3/detection/vpDetectorQRCode.h index 3839ea0f9c0f5426caae7735dd206e41caaac00c..9302e143545f50ac6176c4bbc52f0e2ce98e5f7e 100644 --- a/src/detection/barcode/vpDetectorQRCode.h +++ b/modules/detection/include/visp3/detection/vpDetectorQRCode.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id$ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -45,18 +42,18 @@ #include <utility> #include <string> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_ZBAR #include <zbar.h> -#include <visp/vpDetectorBase.h> -#include <visp/vpImage.h> +#include <visp3/detection/vpDetectorBase.h> +#include <visp3/core/vpImage.h> /*! \class vpDetectorQRCode - + \ingroup group_detection_barcode Base class for bar code detector. This class is a wrapper over libzbar available from http://zbar.sourceforge.net/ @@ -67,8 +64,8 @@ The following sample code shows how to use this class to detect QR codes in an image. \code -#include <visp/vpDetectorQRCode.h> -#include <visp/vpImageIo.h> +#include <visp3/detection/vpDetectorQRCode.h> +#include <visp3/io/vpImageIo.h> int main() { diff --git a/src/detection/barcode/vpDetectorDataMatrixCode.cpp b/modules/detection/src/barcode/vpDetectorDataMatrixCode.cpp similarity index 85% rename from src/detection/barcode/vpDetectorDataMatrixCode.cpp rename to modules/detection/src/barcode/vpDetectorDataMatrixCode.cpp index b746697c7d67c460088c79219a92aa09be2b1f0f..a17def73bd6120a7d04589538259e06c0ad3dd19 100644 --- a/src/detection/barcode/vpDetectorDataMatrixCode.cpp +++ b/modules/detection/src/barcode/vpDetectorDataMatrixCode.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id$ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -40,13 +37,13 @@ #include <assert.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_DMTX #include <dmtx.h> -#include <visp/vpDetectorDataMatrixCode.h> +#include <visp3/detection/vpDetectorDataMatrixCode.h> /*! Default constructor that does nothing. @@ -124,4 +121,7 @@ bool vpDetectorDataMatrixCode::detect(const vpImage<unsigned char> &I) return detected; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpDetectorDataMatrixCode.cpp.o) has no symbols +void dummy_vpDetectorDataMatrixCode() {}; #endif diff --git a/src/detection/barcode/vpDetectorQRCode.cpp b/modules/detection/src/barcode/vpDetectorQRCode.cpp similarity index 83% rename from src/detection/barcode/vpDetectorQRCode.cpp rename to modules/detection/src/barcode/vpDetectorQRCode.cpp index 659ec301c7d5bffef218d020c053d0ecd2ea1711..fa3148fc9a986e31a5e14fefe43c10c975c38abb 100644 --- a/src/detection/barcode/vpDetectorQRCode.cpp +++ b/modules/detection/src/barcode/vpDetectorQRCode.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id$ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -38,11 +35,11 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_ZBAR -#include <visp/vpDetectorQRCode.h> +#include <visp3/detection/vpDetectorQRCode.h> /*! @@ -95,5 +92,7 @@ bool vpDetectorQRCode::detect(const vpImage<unsigned char> &I) return detected; } - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpDetectorQRCode.cpp.o) has no symbols +void dummy_vpDetectorQRCode() {}; #endif diff --git a/src/detection/face/vpDetectorFace.cpp b/modules/detection/src/face/vpDetectorFace.cpp similarity index 87% rename from src/detection/face/vpDetectorFace.cpp rename to modules/detection/src/face/vpDetectorFace.cpp index 0f1e1722803ab9ab02cb16db079f9daae1a7e1de..b4b6f262e8cbad3790095975ed46799499ff3cbb 100644 --- a/src/detection/face/vpDetectorFace.cpp +++ b/modules/detection/src/face/vpDetectorFace.cpp @@ -1,7 +1,7 @@ /**************************************************************************** * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -10,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -35,14 +34,14 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if (VISP_HAVE_OPENCV_VERSION >= 0x020200) #include <algorithm> -#include <visp/vpDetectorFace.h> -#include <visp/vpImageConvert.h> +#include <visp3/detection/vpDetectorFace.h> +#include <visp3/core/vpImageConvert.h> bool vpSortLargestFace(cv::Rect rect1, cv::Rect rect2) { @@ -125,5 +124,7 @@ bool vpDetectorFace::detect(const vpImage<unsigned char> &I) return detected; } - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpDetectorFace.cpp.o) has no symbols +void dummy_vpDetectorFace() {}; #endif diff --git a/modules/detection/src/vpDetectorBase.cpp b/modules/detection/src/vpDetectorBase.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bbc43ef123b39b706c6bcde6681d9b9cd00d863b --- /dev/null +++ b/modules/detection/src/vpDetectorBase.cpp @@ -0,0 +1,107 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Base class for object detection. + * + * Authors: + * Fabien Spindler + * + *****************************************************************************/ +#include <visp3/core/vpConfig.h> + +#include <visp3/detection/vpDetectorBase.h> + + /*! + Default constructor. + */ +vpDetectorBase::vpDetectorBase() : m_polygon(), m_message(), m_nb_objects(0) +{} + +/*! + Returns ith object container box as a vector of points. +*/ +std::vector<vpImagePoint> & +vpDetectorBase::getPolygon(size_t i) +{ + if (i < m_polygon.size()) + return m_polygon[i]; + else + throw(vpException(vpException::badValue, "Bad index to retrieve object %d. Only %d objects are detected.", i, m_polygon.size())); +} + +/*! + Returns the contained message of the ith object if there is one. +*/ +std::string & +vpDetectorBase::getMessage(size_t i) +{ + if (i < m_polygon.size()) + return m_message[i]; + else + throw(vpException(vpException::badValue, "Bad index to retrieve object %d . Only %d objects are detected.", i, m_polygon.size())); +} + +/*! + Return the center of gravity location of the ith object. +*/ +vpImagePoint +vpDetectorBase::getCog(size_t i) const +{ + vpImagePoint cog(0, 0); + for (size_t j = 0; j < m_polygon[i].size(); j++) { + cog += m_polygon[i][j]; + } + cog /= (double)m_polygon[i].size(); + return cog; +} + +/*! +Return the bounding box of the ith object. +*/ +vpRect +vpDetectorBase::getBBox(size_t i) const +{ + assert(m_polygon[i].size() > 2); + + double left, right; + double top, bottom; + left = right = m_polygon[i][0].get_u(); + top = bottom = m_polygon[i][0].get_v(); + for (size_t j = 0; j < m_polygon[i].size(); j++) { + double u = m_polygon[i][j].get_u(); + double v = m_polygon[i][j].get_v(); + if (u < left) left = u; + if (u > right) right = u; + if (v < top) top = v; + if (v > bottom) bottom = v; + } + vpRect roi(vpImagePoint(top, left), vpImagePoint(bottom, right)); + return roi; +} diff --git a/modules/gui/CMakeLists.txt b/modules/gui/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..8a47c7c91dd3163ab435a3d7543f19dfdbef065d --- /dev/null +++ b/modules/gui/CMakeLists.txt @@ -0,0 +1,68 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +# Add optional 3rd parties +set(opt_incs "") +set(opt_libs "") + +# Display X11, GTK, GDI, D3D9. OpenCV already handled by core module +if(USE_X11) + list(APPEND opt_incs ${X11_INCLUDE_DIR}) + list(APPEND opt_libs ${X11_LIBRARIES}) +endif() +if(USE_GTK2) + list(APPEND opt_incs ${GTK2_INCLUDE_DIRS}) + list(APPEND opt_libs ${GTK2_LIBRARIES}) + # FS next lines removed until they proved to be useful +# if(UNIX) +# ## ignore gtk pedantic warnings by gcc specific -isystem : +# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${GTK2_gtk_INCLUDE_PATH}") +# endif() +endif() +if(USE_GDI) + list(APPEND opt_libs ${GDI_LIBRARIES}) +endif() +if(USE_DIRECT3D) + list(APPEND opt_incs ${DIRECT3D_INCLUDE_DIRS}) + list(APPEND opt_libs ${DIRECT3D_LIBRARIES}) +endif() + +vp_add_module(gui visp_core) +vp_glob_module_sources() +vp_module_include_directories(${opt_incs}) +vp_create_module(${opt_libs}) +vp_add_tests(DEPENDS_ON visp_io) diff --git a/src/device/display/windows/vpD3DRenderer.h b/modules/gui/include/visp3/gui/vpD3DRenderer.h old mode 100755 new mode 100644 similarity index 92% rename from src/device/display/windows/vpD3DRenderer.h rename to modules/gui/include/visp3/gui/vpD3DRenderer.h index 5231be19dc0d62c7f0ad2aefd2e9291ca76f7eca..ff7998ecc0f066a3f251f263d54dd4fbb752812a --- a/src/device/display/windows/vpD3DRenderer.h +++ b/modules/gui/include/visp3/gui/vpD3DRenderer.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpD3DRenderer.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * D3D renderer for windows 32 display * @@ -41,7 +37,7 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_D3D9) ) @@ -50,8 +46,8 @@ #include <windows.h> #include <d3dx9.h> -#include <visp/vpWin32Renderer.h> -#include <visp/vpDisplayException.h> +#include <visp3/gui/vpWin32Renderer.h> +#include <visp3/core/vpDisplayException.h> #include <iostream> diff --git a/src/device/display/windows/vpDisplayD3D.h b/modules/gui/include/visp3/gui/vpDisplayD3D.h old mode 100755 new mode 100644 similarity index 83% rename from src/device/display/windows/vpDisplayD3D.h rename to modules/gui/include/visp3/gui/vpDisplayD3D.h index dd71b666f943b10f7be4293d8eecc378ec7ea5fa..dd7430373513e5ce8708406d7485d5c27fd41a63 --- a/src/device/display/windows/vpDisplayD3D.h +++ b/modules/gui/include/visp3/gui/vpDisplayD3D.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayD3D.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Windows 32 display using D3D * @@ -40,20 +36,20 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpDisplay.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDisplay.h> #if ( defined(VISP_HAVE_D3D9) ) #ifndef VPDISPLAYD3D_HH #define VPDISPLAYD3D_HH -#include <visp/vpDisplayWin32.h> +#include <visp3/gui/vpDisplayWin32.h> /*! \class vpDisplayD3D - \ingroup ImageGUI + \ingroup group_gui_display \brief Display for windows using Direct3D. @@ -64,9 +60,9 @@ The example below shows how to display an image with this video device. \code -#include <visp/vpConfig.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayD3D.h> +#include <visp3/core/vpConfig.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayD3D.h> int main() { diff --git a/src/device/display/windows/vpDisplayGDI.h b/modules/gui/include/visp3/gui/vpDisplayGDI.h old mode 100755 new mode 100644 similarity index 86% rename from src/device/display/windows/vpDisplayGDI.h rename to modules/gui/include/visp3/gui/vpDisplayGDI.h index ffe1b310cbe12bd7679b52528d9472388b105bf5..75cfad2f5a258526a92519dcd3b9146bf661b318 --- a/src/device/display/windows/vpDisplayGDI.h +++ b/modules/gui/include/visp3/gui/vpDisplayGDI.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayGDI.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Windows 32 display using GDI * @@ -39,20 +35,20 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpDisplay.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDisplay.h> #if ( defined(VISP_HAVE_GDI) ) #ifndef vpDisplayGDI_HH #define vpDisplayGDI_HH -#include <visp/vpDisplayWin32.h> +#include <visp3/gui/vpDisplayWin32.h> /*! \class vpDisplayGDI - \ingroup ImageGUI + \ingroup group_gui_display \brief Display for windows using GDI (available on any windows 32 platform). @@ -61,9 +57,9 @@ The example below shows how to display an image with this video device. \code -#include <visp/vpConfig.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayGDI.h> +#include <visp3/core/vpConfig.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayGDI.h> int main() { diff --git a/src/device/display/vpDisplayGTK.h b/modules/gui/include/visp3/gui/vpDisplayGTK.h similarity index 93% rename from src/device/display/vpDisplayGTK.h rename to modules/gui/include/visp3/gui/vpDisplayGTK.h index dc58ec2aca00089ead46a266a648c11b8e2e41fe..f292edff969eeef76c5d0eb1665e57298fa17e18 100644 --- a/src/device/display/vpDisplayGTK.h +++ b/modules/gui/include/visp3/gui/vpDisplayGTK.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayGTK.h 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Image display. * @@ -43,11 +39,11 @@ #ifndef vpDisplayGTK_h #define vpDisplayGTK_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_GTK) ) -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> #include <gtk/gtk.h> #include <gdk/gdkrgb.h> @@ -63,7 +59,7 @@ \class vpDisplayGTK - \ingroup ImageGUI + \ingroup group_gui_display \brief The vpDisplayGTK allows to display image using the GTK+ library version 1.2. @@ -72,10 +68,10 @@ The example below shows how to display an image with this video device. \code -#include <visp/vpConfig.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpConfig.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/core/vpImagePoint.h> int main() { diff --git a/src/device/display/vpDisplayOpenCV.h b/modules/gui/include/visp3/gui/vpDisplayOpenCV.h similarity index 83% rename from src/device/display/vpDisplayOpenCV.h rename to modules/gui/include/visp3/gui/vpDisplayOpenCV.h index 4848d619f38c54211ff61b70cb48bca7f540e9a0..c706947497e150fa6d5f7d67ece2f17d9f59c82f 100644 --- a/src/device/display/vpDisplayOpenCV.h +++ b/modules/gui/include/visp3/gui/vpDisplayOpenCV.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayOpenCV.h 5023 2014-12-03 16:07:48Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Image display. * @@ -43,12 +39,12 @@ #ifndef vpDisplayOpenCV_h #define vpDisplayOpenCV_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if defined(VISP_HAVE_OPENCV) -#include <visp/vpDisplay.h> -#include <visp/vpImage.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImageConvert.h> #if VISP_HAVE_OPENCV_VERSION >= 0x020101 # include <opencv2/core/core.hpp> @@ -69,16 +65,16 @@ \class vpDisplayOpenCV - \ingroup ImageGUI + \ingroup group_gui_display \brief The vpDisplayOpenCV allows to display image using the opencv library. The example below shows how to display an image with this video device. \code -#include <visp/vpConfig.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpConfig.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpImagePoint.h> int main() { @@ -160,7 +156,6 @@ private: static std::vector<std::string> m_listTitles; static unsigned int m_nbWindows ; int fontHeight; - int ncol, nrow ; int x_move; int y_move; bool move; @@ -183,6 +178,31 @@ private: int y_rbuttonup ; bool rbuttonup; +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpDisplayOpenCV(const vpDisplayOpenCV &) +// : vpDisplay(), +// #if (VISP_HAVE_OPENCV_VERSION < 0x020408) +// background(NULL), col(NULL), cvcolor(), font(NULL), +// #else +// background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f), +// #endif +// fontHeight(10), x_move(0), y_move(0) , move(false), +// x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false), +// x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false), +// x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false), +// x_lbuttonup(0), y_lbuttonup(0), lbuttonup(false), +// x_mbuttonup(0), y_mbuttonup(0), mbuttonup(false), +// x_rbuttonup(0), y_rbuttonup(0), rbuttonup(false) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpDisplayOpenCV &operator=(const vpDisplayOpenCV &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: vpDisplayOpenCV() ; vpDisplayOpenCV(int winx, int winy, const char *title=NULL) ; diff --git a/src/device/display/windows/vpDisplayWin32.h b/modules/gui/include/visp3/gui/vpDisplayWin32.h old mode 100755 new mode 100644 similarity index 91% rename from src/device/display/windows/vpDisplayWin32.h rename to modules/gui/include/visp3/gui/vpDisplayWin32.h index 3e6e68004b7a90bf58d7c4c88d171d54b5283462..7ac76f59d7d03a7f8d9fcc364320a5ebce96f750 --- a/src/device/display/windows/vpDisplayWin32.h +++ b/modules/gui/include/visp3/gui/vpDisplayWin32.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayWin32.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Windows 32 display base class * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) ) @@ -48,13 +44,13 @@ #include <string> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> #include <windows.h> -#include <visp/vpWin32Window.h> -#include <visp/vpWin32Renderer.h> -#include <visp/vpRect.h> -#include <visp/vpImagePoint.h> +#include <visp3/gui/vpWin32Window.h> +#include <visp3/gui/vpWin32Renderer.h> +#include <visp3/core/vpRect.h> +#include <visp3/core/vpImagePoint.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS /*! diff --git a/src/device/display/vpDisplayX.h b/modules/gui/include/visp3/gui/vpDisplayX.h similarity index 86% rename from src/device/display/vpDisplayX.h rename to modules/gui/include/visp3/gui/vpDisplayX.h index 7296f27b23e7e8c3ef61854de46adc92c187ece3..e9e97c1e49f962e4bfac375085d1b128fa5d40a7 100644 --- a/src/device/display/vpDisplayX.h +++ b/modules/gui/include/visp3/gui/vpDisplayX.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayX.h 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Image display. * @@ -42,8 +38,8 @@ #ifndef vpDisplayX_h #define vpDisplayX_h -#include <visp/vpConfig.h> -#include <visp/vpDisplay.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDisplay.h> #ifdef VISP_HAVE_X11 //namespace X11name @@ -56,8 +52,8 @@ //using namespace X11name ; -#include <visp/vpImage.h> -#include <visp/vpRect.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRect.h> @@ -70,7 +66,7 @@ /*! \class vpDisplayX - \ingroup ImageGUI + \ingroup group_gui_display \brief Define the X11 console to display images. @@ -82,10 +78,10 @@ The example below shows how to display an image with this video device. \code -#include <visp/vpConfig.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayX.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpConfig.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpImagePoint.h> int main() { @@ -158,7 +154,6 @@ private: Colormap lut ; GC context ; int screen ; - int planes; XEvent event; Pixmap pixmap; unsigned long *x_color; // Array of predefined colors @@ -166,11 +161,25 @@ private: unsigned short colortable[256]; XColor xcolor; XGCValues values; - int size ; bool ximage_data_init; unsigned int RMask, GMask, BMask; int RShift, GShift, BShift; +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpDisplayX(const vpDisplayX &) +// : vpDisplay(), display(NULL), window(), Ximage(NULL), lut(), context(), screen(), event(), pixmap(), +// x_color(NULL), screen_depth(8), xcolor(), values(), ximage_data_init(false), +// RMask(0), GMask(0), BMask(0), RShift(0), GShift(0), BShift(0) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpDisplayX &operator=(const vpDisplayX &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: vpDisplayX() ; vpDisplayX(int winx, int winy, const char *title=NULL) ; diff --git a/src/tools/plot/vpPlot.h b/modules/gui/include/visp3/gui/vpPlot.h similarity index 80% rename from src/tools/plot/vpPlot.h rename to modules/gui/include/visp3/gui/vpPlot.h index a5d672b1e916cccb61bab4e4b37966a572b0f5f4..8733a5f00d0aa67e6144245b70a72a40f7a8db7c 100644 --- a/src/tools/plot/vpPlot.h +++ b/modules/gui/include/visp3/gui/vpPlot.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPlot.h 5226 2015-01-29 17:05:35Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Plot curves. * @@ -47,27 +43,27 @@ #ifndef vpPlot_H #define vpPlot_H -#include <visp/vpConfig.h> -#include <visp/vpDisplay.h> -#include <visp/vpPlotGraph.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpPlotGraph.h> /*! \class vpPlot - \ingroup plot + \ingroup group_gui_plotter \brief This class enables real time drawing of 2D or 3D graphics. An instance of the class open a window which contains between 1 and 4 graphics. Each one contains a desired number of curves. \warning This class is only available if one of the display functionalities (X11, GDI, GTK, OpenCV or Direct3D) - is available. In visp/vpConfig.h header file, you should have VISP_HAVE_DISPLAY define. + is available. In visp3/core/vpConfig.h header file, you should have VISP_HAVE_DISPLAY define. The example below shows how to use the vpPlot class. An other example provided in tutoral-ibvs-plotter.cpp and described in \ref tutorial-plotter shows how to use this class to plot in real-time some curves during an image-based visual servo. \code -#include <visp/vpPlot.h> +#include <visp3/gui/vpPlot.h> int main () { @@ -131,9 +127,23 @@ class VISP_EXPORT vpPlot float factori; float factorj; - public: +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpPlot(const vpPlot &) +// : I(), display(NULL), graphNbr(0), graphList(NULL), margei(0), margej(0), +// factori(0), factorj(0) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpPlot &operator=(const vpPlot &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + +public: vpPlot(); - vpPlot(const unsigned int nbGraph, + vpPlot(const unsigned int nbGraph, const unsigned int height=700, const unsigned int width=700, const int x=-1, const int y=-1, const char *title=NULL); @@ -151,6 +161,10 @@ class VISP_EXPORT vpPlot void plot (const unsigned int graphNum, const unsigned int curveNum, const double x, const double y); void plot(const unsigned int graphNum, const double x, const vpColVector &v_y); + void plot(const unsigned int graphNum, const double x, const vpRowVector &v_y); + void plot(const unsigned int graphNum, const double x, const vpPoseVector &v_y); + void plot(const unsigned int graphNum, const double x, const vpTranslationVector &v_y); + void plot(const unsigned int graphNum, const double x, const vpRotationVector &v_y); vpMouseButton::vpMouseButtonType plot (const unsigned int graphNum, const unsigned int curveNum, const double x, const double y, const double z); vpMouseButton::vpMouseButtonType plot(const unsigned int graphNum, const double x, const vpColVector &v_y, const vpColVector &v_z); diff --git a/src/tools/plot/vpPlotCurve.h b/modules/gui/include/visp3/gui/vpPlotCurve.h similarity index 79% rename from src/tools/plot/vpPlotCurve.h rename to modules/gui/include/visp3/gui/vpPlotCurve.h index 32f6eaceebd317af99bcc8da114d0dd2107e3311..be877d77a715eac979e6578ece6a03f227d4f135 100644 --- a/src/tools/plot/vpPlotCurve.h +++ b/modules/gui/include/visp3/gui/vpPlotCurve.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPlotCurve.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Define a curve for the vpPlot class. * @@ -44,14 +40,14 @@ #ifndef vpPlotCurve_H #define vpPlotCurve_H -#include <visp/vpColor.h> -#include <visp/vpImage.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRect.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRect.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpPoint.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpPoint.h> #include <list> diff --git a/src/tools/plot/vpPlotGraph.h b/modules/gui/include/visp3/gui/vpPlotGraph.h similarity index 75% rename from src/tools/plot/vpPlotGraph.h rename to modules/gui/include/visp3/gui/vpPlotGraph.h index 2da1a0fb1fada3c0d3e69da46c88f11bc7756a20..30e32686300a597796f6aaab42f49902ddb1e6c2 100644 --- a/src/tools/plot/vpPlotGraph.h +++ b/modules/gui/include/visp3/gui/vpPlotGraph.h @@ -1,11 +1,8 @@ - /**************************************************************************** - * - * $Id: vpPlotGraph.h 5226 2015-01-29 17:05:35Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Define a graph for the vpPlot class. * @@ -45,17 +40,17 @@ #ifndef vpPlotGraph_H #define vpPlotGraph_H -#include <visp/vpColor.h> -#include <visp/vpImage.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> -#include <visp/vpPlotCurve.h> -#include <visp/vpMouseButton.h> +#include <visp3/gui/vpPlotCurve.h> +#include <visp3/core/vpMouseButton.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRect.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRect.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpPoint.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpPoint.h> #if defined(VISP_HAVE_DISPLAY) @@ -144,7 +139,28 @@ class vpPlotGraph unsigned int gridThickness; - public: +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpPlotGraph(const vpPlotGraph &) +// : xorg(0.), yorg(0.), zoomx(1.), zoomy(1.), xmax(10), ymax(10), xmin(0), ymin(-10), +// xdelt(1), ydelt(1), gridx(true), gridy(true), gridColor(), curveNbr(1), curveList(NULL), +// scaleInitialized(false), firstPoint(true), nbDivisionx(10), nbDivisiony(10), topLeft(), +// width(0), height(0), graphZone(), dTopLeft(), dWidth(0), dHeight(0), dGraphZone(), +// dTopLeft3D(), dGraphZone3D(), cam(), cMo(), cMf(), w_xval(0), w_xsize(0), w_yval(0), w_ysize(0), +// w_zval(0), w_zsize(0), ptXorg(0), ptYorg(0), ptZorg(0), zoomx_3D(1.), zoomy_3D(1.), zoomz_3D(1.), +// nbDivisionz(10), zorg(1.), zoomz(1.), zmax(10), zmin(-10), zdelt(1), old_iPr(), old_iPz(), +// blockedr(false), blockedz(false), blocked(false), epsi(5), epsj(6), +// dispUnit(false), dispTitle(false), dispLegend(false), gridThickness(1) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpPlotGraph &operator=(const vpPlotGraph &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + +public: vpPlotGraph(); ~vpPlotGraph(); diff --git a/src/simulator/coin-simulator/vpProjectionDisplay.h b/modules/gui/include/visp3/gui/vpProjectionDisplay.h similarity index 82% rename from src/simulator/coin-simulator/vpProjectionDisplay.h rename to modules/gui/include/visp3/gui/vpProjectionDisplay.h index 6c137692de43043e5c467e2d7360c4257d72279a..3177dcfe8da78341d2e6e1567644f66b04a5246d 100644 --- a/src/simulator/coin-simulator/vpProjectionDisplay.h +++ b/modules/gui/include/visp3/gui/vpProjectionDisplay.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpProjectionDisplay.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface with the image for feature display. * @@ -48,23 +44,24 @@ \brief interface with the image for feature display */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if defined (VISP_HAVE_DISPLAY) -#include <visp/vpCameraParameters.h> -#include <visp/vpColor.h> -#include <visp/vpImage.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpForwardProjection.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/core/vpForwardProjection.h> #include <list> /*! \class vpProjectionDisplay + \ingroup group_gui_projection \brief interface with the image for feature display */ class VISP_EXPORT vpProjectionDisplay diff --git a/src/device/display/windows/vpWin32API.h b/modules/gui/include/visp3/gui/vpWin32API.h similarity index 84% rename from src/device/display/windows/vpWin32API.h rename to modules/gui/include/visp3/gui/vpWin32API.h index 9dfd7575ecd8901b3955e85b3aa60e8fd1bcb796..545829fca311317d46bf6fc330cb38437a46473f 100644 --- a/src/device/display/windows/vpWin32API.h +++ b/modules/gui/include/visp3/gui/vpWin32API.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpWin32API.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * GDI renderer for windows 32 display * @@ -42,7 +38,7 @@ #ifndef vpWin32API_HH #define vpWin32API_HH -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) ) diff --git a/src/device/display/windows/vpWin32Renderer.h b/modules/gui/include/visp3/gui/vpWin32Renderer.h old mode 100755 new mode 100644 similarity index 91% rename from src/device/display/windows/vpWin32Renderer.h rename to modules/gui/include/visp3/gui/vpWin32Renderer.h index 5602b09f100039e6463c5b3cd39ddebee6abc6a4..b8268f481f0206a62ffc576f3b60b0b0c15ea3c4 --- a/src/device/display/windows/vpWin32Renderer.h +++ b/modules/gui/include/visp3/gui/vpWin32Renderer.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpWin32Renderer.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Windows 32 renderer base class * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) ) @@ -48,10 +44,10 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpImage.h> -#include <visp/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpColor.h> #include <windows.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> class VISP_EXPORT vpWin32Renderer { diff --git a/src/device/display/windows/vpWin32Window.h b/modules/gui/include/visp3/gui/vpWin32Window.h old mode 100755 new mode 100644 similarity index 86% rename from src/device/display/windows/vpWin32Window.h rename to modules/gui/include/visp3/gui/vpWin32Window.h index a3ea37c46070700e7ef94f25690deda5aaee91f6..e65996df9abcc9e0a5425fa266877f5f2b4cb0a5 --- a/src/device/display/windows/vpWin32Window.h +++ b/modules/gui/include/visp3/gui/vpWin32Window.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpWin32Window.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Windows 32 display's window class * @@ -40,7 +36,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) ) #ifndef vpWin32Window_HH @@ -50,10 +46,10 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS #include <windows.h> -#include <visp/vpWin32Renderer.h> -#include <visp/vpGDIRenderer.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayException.h> +#include <visp3/gui/vpWin32Renderer.h> +#include <visp3/core/vpGDIRenderer.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpDisplayException.h> //ViSP-defined messages for window's callback function diff --git a/src/device/display/vpDisplayGTK.cpp b/modules/gui/src/display/vpDisplayGTK.cpp similarity index 98% rename from src/device/display/vpDisplayGTK.cpp rename to modules/gui/src/display/vpDisplayGTK.cpp index 43d56c2c4b02893569ae01d8e07abf27e9e5b479..98329708d751db51e7850a9041d351dd97546d73 100644 --- a/src/device/display/vpDisplayGTK.cpp +++ b/modules/gui/src/display/vpDisplayGTK.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayGTK.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Image display. * @@ -47,7 +43,7 @@ \brief Define the GTK console to display images. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_GTK) ) @@ -58,14 +54,14 @@ #include <limits> // numeric_limits // Display stuff -#include <visp/vpDisplay.h> -#include <visp/vpDisplayGTK.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayGTK.h> //debug / exception -#include <visp/vpDebug.h> -#include <visp/vpDisplayException.h> -#include <visp/vpMath.h> -#include <visp/vpImageTools.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpDisplayException.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpImageTools.h> /*! @@ -125,8 +121,8 @@ vpDisplayGTK::vpDisplayGTK(vpImage<vpRGBa> &I, To initialize the display size, you need to call init(). \code -#include <visp/vpDisplayGTK.h> -#include <visp/vpImage.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/core/vpImage.h> int main() { @@ -160,8 +156,8 @@ vpDisplayGTK::vpDisplayGTK(int x, int y, const char *title) init(vpImage<vpRGBa> &, int, int, const char *). \code -#include <visp/vpDisplayGTK.h> -#include <visp/vpImage.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/core/vpImage.h> int main() { @@ -567,7 +563,7 @@ void vpDisplayGTK::displayImage(const vpImage<vpRGBa> &I) (unsigned char *)I.bitmap, (gint)(4*width)); - /* Permet de fermer la fen�tre si besoin (cas des s�quences d'images) */ + /* Permet de fermer la fenetre si besoin (cas des sequences d'images) */ //while (g_main_iteration(FALSE)); /* Le pixmap background devient le fond de la zone de dessin */ @@ -616,7 +612,7 @@ void vpDisplayGTK::displayImageROI ( const vpImage<vpRGBa> &I,const vpImagePoint (unsigned char *)Itemp.bitmap, (gint)(4*w)); - /* Permet de fermer la fen�tre si besoin (cas des s�quences d'images) */ + /* Permet de fermer la fenetre si besoin (cas des sequences d'images) */ //while (g_main_iteration(FALSE)); /* Le pixmap background devient le fond de la zone de dessin */ @@ -1713,10 +1709,7 @@ vpDisplayGTK::getPointerPosition ( vpImagePoint &ip) return true; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpDisplayGTK.cpp.o) has no symbols +void dummy_vpDisplayGTK() {}; #endif - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/device/display/vpDisplayOpenCV.cpp b/modules/gui/src/display/vpDisplayOpenCV.cpp similarity index 98% rename from src/device/display/vpDisplayOpenCV.cpp rename to modules/gui/src/display/vpDisplayOpenCV.cpp index a11addc44a48907e18a785a5f18bb961cbe9cd49..2c76e9f7d1e089bdba4118d0336b028d973cca08 100644 --- a/src/device/display/vpDisplayOpenCV.cpp +++ b/modules/gui/src/display/vpDisplayOpenCV.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayOpenCV.cpp 5204 2015-01-24 13:18:18Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Image display. * @@ -47,7 +43,7 @@ \brief Define the OpenCV console to display images. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if defined(VISP_HAVE_OPENCV) @@ -58,14 +54,14 @@ #include <limits> // numeric_limits // Display stuff -#include <visp/vpDisplay.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpMath.h> -#include <visp/vpImageTools.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpImageTools.h> //debug / exception -#include <visp/vpDebug.h> -#include <visp/vpDisplayException.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpDisplayException.h> #if (VISP_HAVE_OPENCV_VERSION >= 0x020408) @@ -95,12 +91,13 @@ vpDisplayOpenCV::vpDisplayOpenCV(vpImage<unsigned char> &I, int y, const char *title) : + vpDisplay(), #if (VISP_HAVE_OPENCV_VERSION < 0x020408) background(NULL), col(NULL), cvcolor(), font(NULL), #else background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f), #endif - fontHeight(10), ncol(0), nrow(0), x_move(0), y_move(0) , move(false), + fontHeight(10), x_move(0), y_move(0) , move(false), x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false), x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false), x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false), @@ -130,7 +127,7 @@ vpDisplayOpenCV::vpDisplayOpenCV(vpImage<vpRGBa> &I, #else background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f), #endif - fontHeight(10), ncol(0), nrow(0), x_move(0), y_move(0) , move(false), + fontHeight(10), x_move(0), y_move(0) , move(false), x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false), x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false), x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false), @@ -152,8 +149,8 @@ vpDisplayOpenCV::vpDisplayOpenCV(vpImage<vpRGBa> &I, To initialize the display size, you need to call init(). \code -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpImage.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpImage.h> int main() { @@ -170,7 +167,7 @@ vpDisplayOpenCV::vpDisplayOpenCV ( int x, int y, const char *title ) #else background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f), #endif - fontHeight(10), ncol(0), nrow(0), x_move(0), y_move(0) , move(false), + fontHeight(10), x_move(0), y_move(0) , move(false), x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false), x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false), x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false), @@ -216,8 +213,8 @@ vpDisplayOpenCV::vpDisplayOpenCV ( int x, int y, const char *title ) init(vpImage<vpRGBa> &, int, int, const char *). \code -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpImage.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpImage.h> int main() { @@ -234,7 +231,7 @@ vpDisplayOpenCV::vpDisplayOpenCV() #else background(), col(NULL), cvcolor(), font(cv::FONT_HERSHEY_PLAIN), fontScale(0.8f), #endif - fontHeight(10), ncol(0), nrow(0), x_move(0), y_move(0) , move(false), + fontHeight(10), x_move(0), y_move(0) , move(false), x_lbuttondown(0), y_lbuttondown(0), lbuttondown(false), x_mbuttondown(0), y_mbuttondown(0), mbuttondown(false), x_rbuttondown(0), y_rbuttondown(0), rbuttondown(false), @@ -2211,10 +2208,7 @@ vpDisplayOpenCV::getPointerPosition ( vpImagePoint &ip) //return false; // Never reached after throw() } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpDisplayOpenCV.cpp.o) has no symbols +void dummy_vpDisplayOpenCV() {}; #endif - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/device/display/vpDisplayX.cpp b/modules/gui/src/display/vpDisplayX.cpp similarity index 98% rename from src/device/display/vpDisplayX.cpp rename to modules/gui/src/display/vpDisplayX.cpp index f2a9d999b85d6823f0a16d69e564209aa9fdf8de..b8ea6364e79f86da9e2348802d9dc4a943fe46e1 100644 --- a/src/device/display/vpDisplayX.cpp +++ b/modules/gui/src/display/vpDisplayX.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayX.cpp 5214 2015-01-27 18:33:01Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Image display. * @@ -46,7 +42,7 @@ */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_X11 #include <stdio.h> @@ -56,15 +52,15 @@ #include <limits> // numeric_limits // Display stuff -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayX.h> //debug / exception -#include <visp/vpDebug.h> -#include <visp/vpDisplayException.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpDisplayException.h> // math -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> /*! @@ -81,8 +77,8 @@ vpDisplayX::vpDisplayX ( vpImage<unsigned char> &I, int y, const char *title ) : display(NULL), window(), Ximage(NULL), lut(), context(), - screen(0), planes(0), event(), pixmap(), x_color(NULL), - screen_depth(8), xcolor(), values(), size(0), ximage_data_init(false), + screen(0), event(), pixmap(), x_color(NULL), + screen_depth(8), xcolor(), values(), ximage_data_init(false), RMask(0), GMask(0), BMask(0), RShift(0), GShift(0), BShift(0) { init ( I, x, y, title ) ; @@ -103,8 +99,8 @@ vpDisplayX::vpDisplayX ( vpImage<vpRGBa> &I, int y, const char *title ) : display(NULL), window(), Ximage(NULL), lut(), context(), - screen(0), planes(0), event(), pixmap(), x_color(NULL), - screen_depth(8), xcolor(), values(), size(0), ximage_data_init(false), + screen(0), event(), pixmap(), x_color(NULL), + screen_depth(8), xcolor(), values(), ximage_data_init(false), RMask(0), GMask(0), BMask(0), RShift(0), GShift(0), BShift(0) { init ( I, x, y, title ) ; @@ -121,8 +117,8 @@ vpDisplayX::vpDisplayX ( vpImage<vpRGBa> &I, To initialize the display size, you need to call init(). \code -#include <visp/vpDisplayX.h> -#include <visp/vpImage.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpImage.h> int main() { @@ -134,8 +130,8 @@ int main() */ vpDisplayX::vpDisplayX ( int x, int y, const char *title ) : display(NULL), window(), Ximage(NULL), lut(), context(), - screen(0), planes(0), event(), pixmap(), x_color(NULL), - screen_depth(8), xcolor(), values(), size(0), ximage_data_init(false), + screen(0), event(), pixmap(), x_color(NULL), + screen_depth(8), xcolor(), values(), ximage_data_init(false), RMask(0), GMask(0), BMask(0), RShift(0), GShift(0), BShift(0) { windowXPosition = x ; @@ -155,8 +151,8 @@ vpDisplayX::vpDisplayX ( int x, int y, const char *title ) init(vpImage<vpRGBa> &, int, int, const char *). \code -#include <visp/vpDisplayX.h> -#include <visp/vpImage.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpImage.h> int main() { @@ -168,8 +164,8 @@ int main() */ vpDisplayX::vpDisplayX() : display(NULL), window(), Ximage(NULL), lut(), context(), - screen(0), planes(0), event(), pixmap(), x_color(NULL), - screen_depth(8), xcolor(), values(), size(0), ximage_data_init(false), + screen(0), event(), pixmap(), x_color(NULL), + screen_depth(8), xcolor(), values(), ximage_data_init(false), RMask(0), GMask(0), BMask(0), RShift(0), GShift(0), BShift(0) { } @@ -1114,6 +1110,10 @@ vpDisplayX::init ( vpImage<vpRGBa> &I, int x, int y, const char *title ) */ void vpDisplayX::init ( unsigned int w, unsigned int h, int x, int y, const char *title ) { + if (x_color == NULL) { + // id_unknown = number of predefined colors + x_color= new unsigned long [vpColor::id_unknown]; + } /* setup X11 ------------------------------------------------------------- */ this->width = w; this->height = h; @@ -3395,6 +3395,8 @@ int vpDisplayX::getMsb(unsigned int u32val) } return i; } - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpDisplayX.cpp.o) has no symbols +void dummy_vpDisplayX() {}; #endif diff --git a/src/device/display/windows/vpD3DRenderer.cpp b/modules/gui/src/display/windows/vpD3DRenderer.cpp old mode 100755 new mode 100644 similarity index 98% rename from src/device/display/windows/vpD3DRenderer.cpp rename to modules/gui/src/display/windows/vpD3DRenderer.cpp index 997c99c1ea84162855c4ff434e09408db6d8d336..43481ed75e1c9358e612410757c95373ba59e2c1 --- a/src/device/display/windows/vpD3DRenderer.cpp +++ b/modules/gui/src/display/windows/vpD3DRenderer.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpD3DRenderer.cpp 4733 2014-05-19 20:44:05Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * D3D renderer for windows 32 display * @@ -40,12 +36,12 @@ *****************************************************************************/ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(_WIN32) & defined(VISP_HAVE_D3D9) ) -#include <visp/vpD3DRenderer.h> -#include <visp/vpColor.h> -#include <visp/vpMath.h> +#include <visp3/gui/vpD3DRenderer.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpMath.h> /* Be careful, when using : @@ -1213,5 +1209,8 @@ void vpD3DRenderer::getImage(vpImage<vpRGBa> &I) } } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpD3DRenderer.cpp.o) has no symbols +void dummy_vpD3DRenderer() {}; #endif #endif diff --git a/src/device/display/windows/vpDisplayD3D.cpp b/modules/gui/src/display/windows/vpDisplayD3D.cpp old mode 100755 new mode 100644 similarity index 84% rename from src/device/display/windows/vpDisplayD3D.cpp rename to modules/gui/src/display/windows/vpDisplayD3D.cpp index 36d4f0c2ee85af3e1aa01486d7c6cac3772834e1..4f0f3146efef8a71c3b6cb5401d8122781789fd5 --- a/src/device/display/windows/vpDisplayD3D.cpp +++ b/modules/gui/src/display/windows/vpDisplayD3D.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayD3D.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * windows 32 display using D3D * @@ -44,11 +40,11 @@ \brief windows 32 display using D3D */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(_WIN32) & defined(VISP_HAVE_D3D9) ) -#include <visp/vpDisplayD3D.h> -#include <visp/vpD3DRenderer.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpD3DRenderer.h> /*! \brief Basic constructor. @@ -116,5 +112,8 @@ vpDisplayD3D::vpDisplayD3D(vpImage<unsigned char> &I, */ vpDisplayD3D::~vpDisplayD3D(){} +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpDisplayD3D.cpp.o) has no symbols +void dummy_vpDisplayD3D() {}; #endif diff --git a/src/device/display/windows/vpDisplayGDI.cpp b/modules/gui/src/display/windows/vpDisplayGDI.cpp old mode 100755 new mode 100644 similarity index 85% rename from src/device/display/windows/vpDisplayGDI.cpp rename to modules/gui/src/display/windows/vpDisplayGDI.cpp index 697211052bcba79ddf32e5ab63496f644479eb47..af5b9383f4e0450c12c8c2d5b7b1b4007953dcfb --- a/src/device/display/windows/vpDisplayGDI.cpp +++ b/modules/gui/src/display/windows/vpDisplayGDI.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayGDI.cpp 4642 2014-02-05 12:42:30Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * GDI based Display for windows 32. * @@ -43,11 +39,11 @@ \brief GDI based Display for windows 32. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_GDI) ) -#include <visp/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayGDI.h> //A vpDisplayGDI is just a vpDisplayWin32 which uses a vpGDIRenderer to do the drawing. @@ -117,5 +113,7 @@ vpDisplayGDI::vpDisplayGDI(vpImage<unsigned char> &I, */ vpDisplayGDI::~vpDisplayGDI(){} - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpDisplayGDI.cpp.o) has no symbols +void dummy_vpDisplayGDI() {}; #endif diff --git a/src/device/display/windows/vpDisplayWin32.cpp b/modules/gui/src/display/windows/vpDisplayWin32.cpp old mode 100755 new mode 100644 similarity index 95% rename from src/device/display/windows/vpDisplayWin32.cpp rename to modules/gui/src/display/windows/vpDisplayWin32.cpp index fdcbd93ba69608a536d98c08373e753d5c7974af..72106eb4a764a5079c91daac863526db30ee96f0 --- a/src/device/display/windows/vpDisplayWin32.cpp +++ b/modules/gui/src/display/windows/vpDisplayWin32.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDisplayWin32.cpp 4661 2014-02-10 19:34:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Windows 32 display base class * @@ -39,16 +35,13 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) ) -#define FLUSH_ROI -#include <visp/vpDisplayWin32.h> -#include <visp/vpDisplayException.h> +#include <visp3/gui/vpDisplayWin32.h> +#include <visp3/core/vpDisplayException.h> #include <string> - - const int vpDisplayWin32::MAX_INIT_DELAY = 5000; /*! @@ -685,39 +678,22 @@ void vpDisplayWin32::flushDisplayROI(const vpImagePoint &iP, const unsigned int { //waits if the window is not initialized waitForInit(); - /* Under windows, flushing an ROI takes more time than flushing the whole image. Therefore, we update the maximum area even when asked to update a region. */ -#ifdef FLUSH_ROI - typedef struct _half_rect_t{ - unsigned short left_top; - unsigned short right_bottom; - } half_rect_t; - - half_rect_t hr1; - half_rect_t hr2; - - hr1.left_top = (unsigned short)iP.get_u(); - hr1.right_bottom = (unsigned short)(iP.get_u()+width-1); + WORD left = (WORD)iP.get_u(); + WORD right = (WORD)(iP.get_u()+width-1); - hr2.left_top = (unsigned short)iP.get_v(); - hr2.right_bottom = (unsigned short)(iP.get_v()+height-1); + WORD top = (WORD)iP.get_v(); + WORD bottom = (WORD)(iP.get_v()+height-1); //sends a message to the window -# if 1 // new version FS - WPARAM wp = (WPARAM)(hr1.left_top << sizeof(unsigned short)) + hr1.right_bottom; - LPARAM lp = (hr2.left_top << sizeof(unsigned short)) + hr2.right_bottom; -# else // produce warnings with MinGW - WPARAM wp=*((WPARAM*)(&hr1)); - LPARAM lp=*((WPARAM*)(&hr2)); -# endif + WPARAM wp = MAKEWPARAM(left, right); + LPARAM lp = MAKELPARAM(top, bottom); + PostMessage(window.getHWnd(), vpWM_DISPLAY_ROI, wp,lp); -#else - PostMessage(window.getHWnd(), vpWM_DISPLAY, 0,0); -#endif } @@ -961,4 +937,7 @@ void vpDisplayWin32::getImage(vpImage<vpRGBa> &I) window.renderer->getImage(I); } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpDisplayWin32.cpp.o) has no symbols +void dummy_vpDisplayWin32() {}; #endif diff --git a/src/device/display/windows/vpGDIRenderer.cpp b/modules/gui/src/display/windows/vpGDIRenderer.cpp old mode 100755 new mode 100644 similarity index 97% rename from src/device/display/windows/vpGDIRenderer.cpp rename to modules/gui/src/display/windows/vpGDIRenderer.cpp index e67156db07dba5da0b09ab7e812f12e2da542c8b..9a1ad12fc85f2288f446c2c53e98027bc1754945 --- a/src/device/display/windows/vpGDIRenderer.cpp +++ b/modules/gui/src/display/windows/vpGDIRenderer.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpGDIRenderer.cpp 4733 2014-05-19 20:44:05Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * GDI renderer for windows 32 display * @@ -39,14 +35,14 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #define GDI_ROBUST #if ( defined(VISP_HAVE_GDI) ) #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpGDIRenderer.h> +#include <visp3/core/vpGDIRenderer.h> /*! Constructor. @@ -54,9 +50,10 @@ vpGDIRenderer::vpGDIRenderer() { //if the screen depth is not 32bpp, throw an exception - if( GetDeviceCaps(GetDC(NULL),BITSPIXEL) != 32 ) + int bpp = GetDeviceCaps(GetDC(NULL), BITSPIXEL); + if( bpp != 32 ) throw vpDisplayException(vpDisplayException::depthNotSupportedError, - "Only works in 32bits mode!"); + "vpGDIRenderer supports only 32bits depth: screen is %dbits depth!", bpp); InitializeCriticalSection(&CriticalSection); @@ -1160,4 +1157,7 @@ void vpGDIRenderer::getImage(vpImage<vpRGBa> &I) delete [] imBuffer; } #endif +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpGDIRenderer.cpp.o) has no symbols +void dummy_vpGDIRenderer() {}; #endif diff --git a/src/device/display/windows/vpWin32API.cpp b/modules/gui/src/display/windows/vpWin32API.cpp similarity index 88% rename from src/device/display/windows/vpWin32API.cpp rename to modules/gui/src/display/windows/vpWin32API.cpp index 6580fedffbfb38b9a4e2b0de73cbd3b10d23b461..517cb6c841117fa43d1dc18cc9e6ace0c47a6c29 100644 --- a/src/device/display/windows/vpWin32API.cpp +++ b/modules/gui/src/display/windows/vpWin32API.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpWin32API.cpp 5285 2015-02-09 14:32:54Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * GDI renderer for windows 32 display * @@ -39,12 +35,12 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpWin32API.h> -#include <visp/vpTime.h> +#include <visp3/core/vpConfig.h> #include <iostream> #if ( defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) ) +#include <visp3/gui/vpWin32API.h> +#include <visp3/core/vpTime.h> DWORD vpProcessErrors(const std::string &api_name){ LPVOID lpMsgBuf; DWORD err = GetLastError(); @@ -138,4 +134,7 @@ HBITMAP vpCreateBitmap(int nWidth, int nHeight, UINT cPlanes, UINT cBitsPerPel, return ret; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpWin32API.cpp.o) has no symbols +void dummy_vpWin32API() {}; #endif diff --git a/src/device/display/windows/vpWin32Window.cpp b/modules/gui/src/display/windows/vpWin32Window.cpp old mode 100755 new mode 100644 similarity index 90% rename from src/device/display/windows/vpWin32Window.cpp rename to modules/gui/src/display/windows/vpWin32Window.cpp index 700e088df1ed81177a0222117131cdbfc6504210..45332155f28594e726e079a72857677d00f48533 --- a/src/device/display/windows/vpWin32Window.cpp +++ b/modules/gui/src/display/windows/vpWin32Window.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpWin32Window.cpp 5285 2015-02-09 14:32:54Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Windows 32 display's window class * @@ -39,9 +35,9 @@ * Anthony Saunier * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <iostream> -#include <visp/vpWin32API.h> +#include <visp3/gui/vpWin32API.h> #if ( defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) ) @@ -49,7 +45,7 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpWin32Window.h> +#include <visp3/gui/vpWin32Window.h> //Should be already defined ... #ifndef GET_X_LPARAM @@ -83,7 +79,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) vpReleaseSemaphore(window->semaInit,1,NULL); } } - switch (message) { case vpWM_DISPLAY: @@ -95,22 +90,12 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case vpWM_DISPLAY_ROI: { RECT rect; - typedef struct _half_rect_t{ - unsigned short left_top; - unsigned short right_bottom; - } half_rect_t; - - half_rect_t hr1; - half_rect_t hr2; - - hr1 = *((half_rect_t*)(&wParam)); - hr2 = *((half_rect_t*)(&lParam)); - rect.left = hr1.left_top; - rect.right = hr1.right_bottom; + rect.left = LOWORD(wParam); + rect.right = HIWORD(wParam); - rect.top = hr2.left_top; - rect.bottom = hr2.right_bottom; + rect.top = LOWORD(lParam); + rect.bottom = HIWORD(lParam); InvalidateRect(window->getHWnd(), &rect, TRUE); UpdateWindow(window->getHWnd()); @@ -345,4 +330,7 @@ void vpWin32Window::initWindow(const char* title, int posx, int posy, unsigned i } #endif +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpWin32Window.cpp.o) has no symbols +void dummy_vpWin32Window() {}; #endif diff --git a/src/simulator/coin-simulator/vpProjectionDisplay.cpp b/modules/gui/src/forward-projection/vpProjectionDisplay.cpp similarity index 84% rename from src/simulator/coin-simulator/vpProjectionDisplay.cpp rename to modules/gui/src/forward-projection/vpProjectionDisplay.cpp index b4fe61b96964c4d51780bbf16c861b2f1fe76653..4153e126b70f4d427346251542b800f216e76514 100644 --- a/src/simulator/coin-simulator/vpProjectionDisplay.cpp +++ b/modules/gui/src/forward-projection/vpProjectionDisplay.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpProjectionDisplay.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface with the image for feature display. * @@ -45,24 +41,24 @@ \brief interface with the image for feature display */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if defined (VISP_HAVE_DISPLAY) // Meter/pixel conversion -#include <visp/vpCameraParameters.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpPoint.h> -#include <visp/vpMath.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMath.h> //Color / image / display -#include <visp/vpColor.h> -#include <visp/vpImage.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> -#include <visp/vpDisplay.h> +#include <visp3/core/vpDisplay.h> -#include <visp/vpProjectionDisplay.h> +#include <visp3/gui/vpProjectionDisplay.h> -#include <visp/vpBasicFeature.h> +//#include <visp3/visual_features/vpBasicFeature.h> void @@ -173,4 +169,7 @@ vpProjectionDisplay::displayCamera(vpImage<unsigned char> &I, vpDisplay::displayArrow(I, ipo, ipx, vpColor::red, 4+thickness, 2+thickness, thickness) ; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpProjectionDisplay.cpp.o) has no symbols +void dummy_vpProjectionDisplay() {}; #endif diff --git a/src/tools/plot/vpPlot.cpp b/modules/gui/src/plot/vpPlot.cpp similarity index 83% rename from src/tools/plot/vpPlot.cpp rename to modules/gui/src/plot/vpPlot.cpp index dcf216c49c38b95f5454bacc33c626aa95bba7c7..592c9fea6560249a6d66c7396be70c9f14a180f7 100644 --- a/src/tools/plot/vpPlot.cpp +++ b/modules/gui/src/plot/vpPlot.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPlot.cpp 5226 2015-01-29 17:05:35Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Plot curves. * @@ -41,19 +37,18 @@ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if defined(VISP_HAVE_DISPLAY) -#include <visp/vpPlot.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpMath.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpPose.h> +#include <visp3/gui/vpPlot.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpPixelMeterConversion.h> #include <fstream> #include <list> #include <vector> @@ -300,16 +295,90 @@ vpPlot::plot (const unsigned int graphNum, const unsigned int curveNum, const do \param x : The coordinate of the new points along the x axis and given in the user unit system. \param v_y : y coordinates vector. The coordinates of the new points along the y axis and given in the user unit system. */ -void vpPlot::plot(const unsigned int graphNum, - const double x, const vpColVector &v_y) +void vpPlot::plot(const unsigned int graphNum, + const double x, const vpColVector &v_y) { - if((graphList+graphNum)->curveNbr == v_y.getRows()) - { - for(unsigned int i = 0;i < v_y.getRows();++i) - this->plot(graphNum, i, x, v_y[i]); - } - else - vpTRACE("error in plot vector : not the right dimension"); + if((graphList+graphNum)->curveNbr == v_y.getRows()) + { + for(unsigned int i = 0;i < v_y.getRows();++i) + this->plot(graphNum, i, x, v_y[i]); + } + else + vpTRACE("error in plot vector : not the right dimension"); +} +/*! + This function enables you to add new points in all curves of a plot. These points are drawn with the parameters of the curves. + + \param graphNum : The index of the graph in the window. As the number of graphic in a window is less or equal to 4, this parameter is between 0 and 3. + \param x : The coordinate of the new points along the x axis and given in the user unit system. + \param v_y : y coordinates vector. The coordinates of the new points along the y axis and given in the user unit system. +*/ +void vpPlot::plot(const unsigned int graphNum, + const double x, const vpRowVector &v_y) +{ + if((graphList+graphNum)->curveNbr == v_y.getRows()) + { + for(unsigned int i = 0;i < v_y.getRows();++i) + this->plot(graphNum, i, x, v_y[i]); + } + else + vpTRACE("error in plot vector : not the right dimension"); +} + +/*! + This function enables you to add new points in all curves of a plot. These points are drawn with the parameters of the curves. + + \param graphNum : The index of the graph in the window. As the number of graphic in a window is less or equal to 4, this parameter is between 0 and 3. + \param x : The coordinate of the new points along the x axis and given in the user unit system. + \param v_y : y coordinates vector. The coordinates of the new points along the y axis and given in the user unit system. +*/ +void vpPlot::plot(const unsigned int graphNum, + const double x, const vpPoseVector &v_y) +{ + if((graphList+graphNum)->curveNbr == v_y.getRows()) + { + for(unsigned int i = 0;i < v_y.getRows();++i) + this->plot(graphNum, i, x, v_y[i]); + } + else + vpTRACE("error in plot vector : not the right dimension"); +} +/*! + This function enables you to add new points in all curves of a plot. These points are drawn with the parameters of the curves. + + \param graphNum : The index of the graph in the window. As the number of graphic in a window is less or equal to 4, this parameter is between 0 and 3. + \param x : The coordinate of the new points along the x axis and given in the user unit system. + \param v_y : y coordinates vector. The coordinates of the new points along the y axis and given in the user unit system. +*/ +void vpPlot::plot(const unsigned int graphNum, + const double x, const vpTranslationVector &v_y) +{ + if((graphList+graphNum)->curveNbr == v_y.getRows()) + { + for(unsigned int i = 0;i < v_y.getRows();++i) + this->plot(graphNum, i, x, v_y[i]); + } + else + vpTRACE("error in plot vector : not the right dimension"); +} + +/*! + This function enables you to add new points in all curves of a plot. These points are drawn with the parameters of the curves. + + \param graphNum : The index of the graph in the window. As the number of graphic in a window is less or equal to 4, this parameter is between 0 and 3. + \param x : The coordinate of the new points along the x axis and given in the user unit system. + \param v_y : y coordinates vector. The coordinates of the new points along the y axis and given in the user unit system. +*/ +void vpPlot::plot(const unsigned int graphNum, + const double x, const vpRotationVector &v_y) +{ + if((graphList+graphNum)->curveNbr == v_y.size()) + { + for(unsigned int i = 0;i < v_y.size();++i) + this->plot(graphNum, i, x, v_y[i]); + } + else + vpTRACE("error in plot vector : not the right dimension"); } @@ -634,4 +703,7 @@ void vpPlot::saveData(const unsigned int graphNum, const char* dataFile) fichier.close(); } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpPlot.cpp.o) has no symbols +void dummy_vpPlot() {}; #endif diff --git a/src/tools/plot/vpPlotCurve.cpp b/modules/gui/src/plot/vpPlotCurve.cpp similarity index 81% rename from src/tools/plot/vpPlotCurve.cpp rename to modules/gui/src/plot/vpPlotCurve.cpp index 245fb4078b83edb3d9534e703db3a5be589475d4..88a8419c9ce175129fd9a009b1920766ccffbab8 100644 --- a/src/tools/plot/vpPlotCurve.cpp +++ b/modules/gui/src/plot/vpPlotCurve.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPlotCurve.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Define a curve for the vpPlot class. * @@ -38,16 +34,16 @@ * Nicolas Melchior * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpPlotCurve.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayD3D.h> +#include <visp3/gui/vpPlotCurve.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayD3D.h> #if defined(VISP_HAVE_DISPLAY) vpPlotCurve::vpPlotCurve() : @@ -113,5 +109,8 @@ vpPlotCurve::plotList(const vpImage<unsigned char> &I, const double xorg, const } } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpPlotCurve.cpp.o) has no symbols +void dummy_vpPlotCurve() {}; #endif #endif diff --git a/src/tools/plot/vpPlotGraph.cpp b/modules/gui/src/plot/vpPlotGraph.cpp similarity index 96% rename from src/tools/plot/vpPlotGraph.cpp rename to modules/gui/src/plot/vpPlotGraph.cpp index 49c2fc023cb338ceb7c947fb6e68b6be8f795c8c..b5c9c6b2086ddeac683ec9360f7543a9cd0a93e2 100644 --- a/src/tools/plot/vpPlotGraph.cpp +++ b/modules/gui/src/plot/vpPlotGraph.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPlotGraph.cpp 5226 2015-01-29 17:05:35Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Define a graph for the vpPlot class. * @@ -40,23 +36,23 @@ *****************************************************************************/ #define FLUSH_ON_PLOT -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpPlotGraph.h> -#include <visp/vpMath.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpPose.h> +#include <visp3/gui/vpPlotGraph.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpPixelMeterConversion.h> +//#include <visp3/vision/vpPose.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayD3D.h> #include <cmath> // std::fabs -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> #include <limits> // numeric_limits #if defined(VISP_HAVE_DISPLAY) @@ -167,7 +163,7 @@ vpPlotGraph::initSize (vpImagePoint top_left, unsigned int w, unsigned int h, un cam.initPersProjWithoutDistortion(1000,1000,this->dWidth/2.0,this->dHeight/2.0); findPose(); - + cMf.buildFrom(0,0,cMo[2][3],0,0,0); } @@ -188,6 +184,8 @@ vpPlotGraph::findPose() iP[3].set_ij(dHeight-1,0); double x=0, y=0; +#if 0 + // Modified by FS to remove dependency with visp_vision (pose) module vpPose pose; pose.clearPoint(); @@ -201,6 +199,17 @@ vpPlotGraph::findPose() pose.computePose(vpPose::LAGRANGE, cMo) ; pose.computePose(vpPose::VIRTUAL_VS, cMo); + +#else + // Instead of pose computation we use an approximation + double Z = 0; + for(unsigned int i=0; i< 4; i++) { + vpPixelMeterConversion::convertPoint(cam, iP[i], x, y); + Z = vpMath::maximum(Z, point[i].get_oX() / x); + Z = vpMath::maximum(Z, point[i].get_oY() / y); + } + cMo[2][3] = Z; +#endif } void @@ -1408,5 +1417,8 @@ vpPlotGraph::navigation(const vpImage<unsigned char> &I, bool &changed, vpMouseB return mov; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpPlotGraph.cpp.o) has no symbols +void dummy_vpPlotGraph() {}; #endif #endif diff --git a/test/device/display/testClick.cpp b/modules/gui/test/display/testClick.cpp similarity index 94% rename from test/device/display/testClick.cpp rename to modules/gui/test/display/testClick.cpp index ed3d5c1e695db006282130372f2500bb149015fb..4fb1df93f1f70679ee3288b3e57eb2044fbcaba8 100644 --- a/test/device/display/testClick.cpp +++ b/modules/gui/test/display/testClick.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testClick.cpp 5230 2015-01-30 06:55:59Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for mouse click manipulations. * @@ -39,8 +35,8 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> #include <iostream> @@ -48,16 +44,16 @@ #if (defined (VISP_HAVE_GTK) || defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_OPENCV)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> /*! \example testClick.cpp diff --git a/test/device/display/testDisplayRoi.cpp b/modules/gui/test/display/testDisplayRoi.cpp similarity index 88% rename from test/device/display/testDisplayRoi.cpp rename to modules/gui/test/display/testDisplayRoi.cpp index 0e2ec1993a968d3365b7410557c4ca93f13a7e6a..1ed0e0ce46fdbe60125b4006ac36534419952eaf 100644 --- a/test/device/display/testDisplayRoi.cpp +++ b/modules/gui/test/display/testDisplayRoi.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: testDisplayRoi.cpp 4776 2014-07-11 10:11:02Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for image roi display. * @@ -48,14 +44,14 @@ #include <stdlib.h> -#include <visp/vpImage.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpParseArgv.h> -#include <visp/vpRect.h> +#include <visp3/core/vpImage.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpRect.h> // List of allowed command line options #define GETOPTARGS "cdh" @@ -195,7 +191,7 @@ int main(int argc, const char ** argv) C = vpRGBa(0,255,0,0); vpDisplay::displayROI(C, roi); - vpDisplay::flush(C); + vpDisplay::flushROI(C, roi); if (opt_click_allowed) { std::cout << "A click in the image to exit..." << std::endl; vpDisplay::getClick(C); diff --git a/test/device/display/testDisplays.cpp b/modules/gui/test/display/testDisplays.cpp similarity index 92% rename from test/device/display/testDisplays.cpp rename to modules/gui/test/display/testDisplays.cpp index 8d904cbba23c140f8c75a7c27c76033fdb077a27..4e53afdc2a3838c0acd0b6a15c530d52e807c3ce 100644 --- a/test/device/display/testDisplays.cpp +++ b/modules/gui/test/display/testDisplays.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testDisplays.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for image display. * @@ -39,8 +35,8 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> #include <iostream> @@ -48,17 +44,17 @@ #if (defined (VISP_HAVE_GTK) || defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_OPENCV)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> -#include <visp/vpRect.h> - -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpRect.h> + +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> /*! \example testDisplays.cpp diff --git a/test/device/display/testMouseEvent.cpp b/modules/gui/test/display/testMouseEvent.cpp similarity index 96% rename from test/device/display/testMouseEvent.cpp rename to modules/gui/test/display/testMouseEvent.cpp index 52c428268e14c4a7fdf36ac53b630adc9a903b89..9dda70cfff9b38820c375bdaddb2bd2b8f088529 100644 --- a/test/device/display/testMouseEvent.cpp +++ b/modules/gui/test/display/testMouseEvent.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testMouseEvent.cpp 5230 2015-01-30 06:55:59Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read an image sequence from the disk and display it. * @@ -49,10 +45,10 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> #include <stdlib.h> #include <stdio.h> @@ -61,16 +57,16 @@ #if (defined (VISP_HAVE_GTK) || defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpMouseButton.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/core/vpMouseButton.h> -#include <visp/vpTime.h> +#include <visp3/core/vpTime.h> /*! \example testMouseEvent.cpp diff --git a/test/device/display/testVideoDevice.cpp b/modules/gui/test/display/testVideoDevice.cpp similarity index 95% rename from test/device/display/testVideoDevice.cpp rename to modules/gui/test/display/testVideoDevice.cpp index badda35468321ffc499812606d15695bc5dbfb26..4a2a63c623081943f9236288c4e4b40462dff098 100644 --- a/test/device/display/testVideoDevice.cpp +++ b/modules/gui/test/display/testVideoDevice.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testVideoDevice.cpp 5023 2014-12-03 16:07:48Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for image display. * @@ -40,24 +36,24 @@ *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> #include <iostream> #include <string> #if (defined (VISP_HAVE_GTK) || defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_OPENCV)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> /*! \example testVideoDevice.cpp diff --git a/test/device/display/testVideoDeviceDual.cpp b/modules/gui/test/display/testVideoDeviceDual.cpp similarity index 93% rename from test/device/display/testVideoDeviceDual.cpp rename to modules/gui/test/display/testVideoDeviceDual.cpp index b0c765c722fe574826b407ad8fc5ce23c77074a2..24cab4e6c60512c58f991401d251fba300f41413 100644 --- a/test/device/display/testVideoDeviceDual.cpp +++ b/modules/gui/test/display/testVideoDeviceDual.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testVideoDeviceDual.cpp 5023 2014-12-03 16:07:48Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for image display. * @@ -40,15 +36,15 @@ *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/io/vpParseArgv.h> #include <stdlib.h> #include <iostream> #if (defined (VISP_HAVE_GTK) || defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_D3D9) || defined(VISP_HAVE_OPENCV)) diff --git a/modules/io/CMakeLists.txt b/modules/io/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..3b47ac68c452847129c83a63694263bee687bb5b --- /dev/null +++ b/modules/io/CMakeLists.txt @@ -0,0 +1,68 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +# Add optional 3rd parties +set(opt_incs "") +set(opt_libs "") + +# Image i/o: jpeg, png, OpenCV (already included by core) +if(USE_JPEG) + list(APPEND opt_incs ${JPEG_INCLUDE_DIR}) + list(APPEND opt_libs ${JPEG_LIBRARIES}) + # If Qt3 and libjpeg are used, we add here QT_CLEAN_NAMESPACE define to + # handle a compilation error "conflicting declaration 'typedef long int INT32' + if(VISP_HAVE_QT3_FOUND) + add_definitions("-DQT_CLEAN_NAMESPACE") + endif() +endif() +if(USE_PNG) + list(APPEND opt_incs ${PNG_INCLUDE_DIR}) + list(APPEND opt_libs ${PNG_LIBRARIES}) + add_definitions(${PNG_DEFINITIONS}) +endif() + +# videos: ffmpeg +if(USE_FFMPEG) + list(APPEND opt_incs ${FFMPEG_INCLUDE_DIRS}) + list(APPEND opt_libs ${FFMPEG_LIBRARIES}) +endif() + +vp_add_module(io visp_core) +vp_glob_module_sources() +vp_module_include_directories(${opt_incs}) +vp_create_module(${opt_libs}) +vp_add_tests(DEPENDS_ON visp_features) diff --git a/src/device/framegrabber/disk/vpDiskGrabber.h b/modules/io/include/visp3/io/vpDiskGrabber.h similarity index 88% rename from src/device/framegrabber/disk/vpDiskGrabber.h rename to modules/io/include/visp3/io/vpDiskGrabber.h index a85b70ca186eb5a51f894cf20ef80ea7eccc29a4..62faa10dba39c769e887c81eaa42245c9e91ece6 100644 --- a/src/device/framegrabber/disk/vpDiskGrabber.h +++ b/modules/io/include/visp3/io/vpDiskGrabber.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDiskGrabber.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Disk framegrabber. * @@ -47,15 +43,15 @@ #ifndef vpDiskGrabber_hh #define vpDiskGrabber_hh -#include <visp/vpImageIo.h> -#include <visp/vpFrameGrabber.h> -#include <visp/vpRGBa.h> -#include <visp/vpDebug.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpFrameGrabber.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/core/vpDebug.h> /*! \class vpDiskGrabber - \ingroup Framegrabber + \ingroup group_io_video \brief Class to grab (ie. read) images from the disk. @@ -69,8 +65,8 @@ from the first named "image.0001.pgm" by steps of 2. \code -#include <visp/vpImage.h> -#include <visp/vpDiskGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpDiskGrabber.h> int main(){ vpImage<unsigned char> I; // Grey level image diff --git a/src/video/vpFFMPEG.h b/modules/io/include/visp3/io/vpFFMPEG.h similarity index 93% rename from src/video/vpFFMPEG.h rename to modules/io/include/visp3/io/vpFFMPEG.h index 85b0986bbfc8b73aa42fd8b41fe6360791f9b6ce..f3a4aa1c2d46eae5190d9830547c6117e45974ff 100644 --- a/src/video/vpFFMPEG.h +++ b/modules/io/include/visp3/io/vpFFMPEG.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImagePoint.h 2359 2009-11-24 15:09:25Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Class that manages the FFMPEG library. * @@ -48,7 +44,7 @@ #ifndef vpFFMPEG_H #define vpFFMPEG_H -#include <visp/vpImageIo.h> +#include <visp3/io/vpImageIo.h> #include <stdlib.h> #include <stdio.h> #include <vector> @@ -100,13 +96,13 @@ struct SwsContext; /*! \class vpFFMPEG - \ingroup Video + \ingroup group_io_video \brief This class interfaces the FFmpeg library to enable video stream reading or writing. Here an example which explains how to use the class to read a video stream. \code -#include <visp/vpFFMPEG.h> +#include <visp3/io/vpFFMPEG.h> int main () { @@ -127,7 +123,7 @@ int main () If you want to open the video as a gray scaled video, you can use the following example. \code -#include <visp/vpFFMPEG.h> +#include <visp3/io/vpFFMPEG.h> int main () { diff --git a/src/image/vpImageIo.h b/modules/io/include/visp3/io/vpImageIo.h similarity index 88% rename from src/image/vpImageIo.h rename to modules/io/include/visp3/io/vpImageIo.h index f08f6d8f0098c6074b1e76285b58305d871cd923..77e7437678a9f58dfc5dc08bee3eb95a629134a4 100644 --- a/src/image/vpImageIo.h +++ b/modules/io/include/visp3/io/vpImageIo.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImageIo.h 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read/write images. * @@ -48,10 +44,10 @@ #ifndef vpIMAGEIO_H #define vpIMAGEIO_H -#include <visp/vpImage.h> -#include <visp/vpDebug.h> -#include <visp/vpRGBa.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/core/vpImageConvert.h> #include <stdio.h> #include <iostream> @@ -60,12 +56,12 @@ # include <windows.h> #endif -#if defined(VISP_HAVE_LIBJPEG) +#if defined(VISP_HAVE_JPEG) #include <jpeglib.h> #include <jerror.h> #endif -#if defined(VISP_HAVE_LIBPNG) +#if defined(VISP_HAVE_PNG) #include <png.h> #endif @@ -73,7 +69,7 @@ /*! \class vpImageIo - \ingroup ImageRW + \ingroup group_io_image \brief Read/write images with various image format. @@ -83,8 +79,8 @@ (".pgm" for PGM P5 and ".ppm" for PPM P6). \code -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> int main() { @@ -180,7 +176,7 @@ public: static void readPPM(vpImage<vpRGBa> &I, const std::string filename) ; -#if (defined(VISP_HAVE_LIBJPEG) || defined(VISP_HAVE_OPENCV)) +#if (defined(VISP_HAVE_JPEG) || defined(VISP_HAVE_OPENCV)) static void readJPEG(vpImage<unsigned char> &I, const char *filename) ; static @@ -191,7 +187,7 @@ public: void readJPEG(vpImage<vpRGBa> &I, const std::string filename) ; #endif -#if (defined(VISP_HAVE_LIBPNG) || defined(VISP_HAVE_OPENCV)) +#if (defined(VISP_HAVE_PNG) || defined(VISP_HAVE_OPENCV)) static void readPNG(vpImage<unsigned char> &I, const char *filename) ; static @@ -229,7 +225,7 @@ public: static void writePPM(const vpImage<vpRGBa> &I, const std::string filename) ; -#if (defined(VISP_HAVE_LIBJPEG) || defined(VISP_HAVE_OPENCV)) +#if (defined(VISP_HAVE_JPEG) || defined(VISP_HAVE_OPENCV)) static void writeJPEG(const vpImage<unsigned char> &I, const char *filename) ; static @@ -240,7 +236,7 @@ public: void writeJPEG(const vpImage<vpRGBa> &I, const std::string filename) ; #endif -#if (defined(VISP_HAVE_LIBPNG) || defined(VISP_HAVE_OPENCV)) +#if (defined(VISP_HAVE_PNG) || defined(VISP_HAVE_OPENCV)) static void writePNG(const vpImage<unsigned char> &I, const char *filename) ; static diff --git a/src/tools/io/vpKeyboard.h b/modules/io/include/visp3/io/vpKeyboard.h similarity index 77% rename from src/tools/io/vpKeyboard.h rename to modules/io/include/visp3/io/vpKeyboard.h index c1097ca4143a7f0d4af2621b038f99ee8f55f34e..dcbb798ffb953efe235106e7c32d8e435f5960be 100644 --- a/src/tools/io/vpKeyboard.h +++ b/modules/io/include/visp3/io/vpKeyboard.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpKeyboard.h 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Keybord management. * @@ -48,7 +44,7 @@ \brief Keybord management under unix. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) @@ -61,10 +57,11 @@ /*! \class vpKeyboard - \ingroup Keyboard - \brief Keybord management under unix. + \ingroup group_io_keyboard + \brief Keybord management under unix (Linux or OSX). This class is not available under windows. - Gets a key from the keyboard without waiting for the enter key. + Gets a key from the keyboard without waiting for the "Enter" key. + \warning The key that was pressed is only detected if the terminal where the binary was launched is active. \code vpKeyboard keyboard; // Turn on keyboard raw mode diff --git a/src/tools/io/vpParallelPort.h b/modules/io/include/visp3/io/vpParallelPort.h similarity index 79% rename from src/tools/io/vpParallelPort.h rename to modules/io/include/visp3/io/vpParallelPort.h index d778e40dbc4ccb88d33157614a5e8c64d923bdb7..aee9838c5a25c4cbe12b802626d5a1149fbc958c 100644 --- a/src/tools/io/vpParallelPort.h +++ b/modules/io/include/visp3/io/vpParallelPort.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpParallelPort.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Parallel port management. * @@ -48,7 +44,7 @@ \brief Parallel port management under unix. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_PARPORT @@ -58,18 +54,18 @@ # include <linux/parport.h> # include <linux/ppdev.h> -# include <visp/vpParallelPortException.h> +# include <visp3/io/vpParallelPortException.h> /*! \class vpParallelPort - \ingroup ParallelPort + \ingroup group_io_parallel_port \brief Parallel port management under unix. The code below shows how to send a data over the parallel port. \code -#include <visp/vpConfig.h> -#include <visp/vpParallelPort.h> +#include <visp3/core/vpConfig.h> +#include <visp3/io/vpParallelPort.h> int main() { diff --git a/src/tools/io/vpParallelPortException.h b/modules/io/include/visp3/io/vpParallelPortException.h similarity index 86% rename from src/tools/io/vpParallelPortException.h rename to modules/io/include/visp3/io/vpParallelPortException.h index c022185edbb5cbf2e0c6901e4bb573f71dfc1f88..3570060146eb0f26568c34d65d06e457d8aa24d7 100644 --- a/src/tools/io/vpParallelPortException.h +++ b/modules/io/include/visp3/io/vpParallelPortException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpParallelPortException.h 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exceptions that can be emited by the vpParallelPort class and its derivates. * @@ -60,7 +56,7 @@ /* Classes standards. */ -#include <visp/vpException.h> +#include <visp3/core/vpException.h> #include <iostream> /* Classe std::ostream. */ #include <string> /* Classe string. */ @@ -71,7 +67,6 @@ /*! \class vpParallelPortException - \ingroup Exception \brief Error that can be emited by the vpParallelPort class and its derivates. diff --git a/src/tools/io/vpParseArgv.h b/modules/io/include/visp3/io/vpParseArgv.h similarity index 96% rename from src/tools/io/vpParseArgv.h rename to modules/io/include/visp3/io/vpParseArgv.h index c466daaffe04ab19726d814deed1576a00d18b57..ac1c348eb524f1094d8076b5cf978df2ba05e856 100644 --- a/src/tools/io/vpParseArgv.h +++ b/modules/io/include/visp3/io/vpParseArgv.h @@ -1,6 +1,4 @@ /**************************************************************************** - * - * $Id: vpParseArgv.h 4473 2013-09-27 16:50:44Z fspindle $ * * Declarations for Tk-related things that are visible * outside of the Tk module itself. @@ -34,12 +32,12 @@ #define vpParseArgv_h -#include <visp/vpConfig.h> -#include <visp/vpException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> /*! \class vpParseArgv - \ingroup ArgumentParser + \ingroup module_io_cmd_parser \brief Command line argument parsing. The code below shows a first way to parse command line arguments @@ -48,7 +46,7 @@ \code #include <stdio.h> -#include <visp/vpParseArgv.h> +#include <visp3/io/vpParseArgv.h> // Usage : [-int <integer value>] [-float <float value>] [-double <double value>] [-h] int main(int argc, const char ** argv) @@ -89,7 +87,7 @@ int main(int argc, const char ** argv) \code #include <stdio.h> #include <stdlib.h> -#include <visp/vpParseArgv.h> +#include <visp3/io/vpParseArgv.h> // List of allowed command line options #define GETOPTARGS "d:f:i:h" // double point mean here that the preceding option request an argument diff --git a/src/video/vpVideoReader.h b/modules/io/include/visp3/io/vpVideoReader.h similarity index 84% rename from src/video/vpVideoReader.h rename to modules/io/include/visp3/io/vpVideoReader.h index 7bd511da7a072dfdaceebf8e3ce64d4ccf10ac5b..6e6b5493f97a6688ff9342ca1f06a7fde1b0ee46 100644 --- a/src/video/vpVideoReader.h +++ b/modules/io/include/visp3/io/vpVideoReader.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImagePoint.h 2359 2009-11-24 15:09:25Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read videos and sequences of images . * @@ -50,8 +46,8 @@ #include <string> -#include <visp/vpDiskGrabber.h> -#include <visp/vpFFMPEG.h> +#include <visp3/io/vpDiskGrabber.h> +#include <visp3/io/vpFFMPEG.h> #if VISP_HAVE_OPENCV_VERSION >= 0x020200 #include "opencv2/highgui/highgui.hpp" @@ -62,7 +58,7 @@ /*! \class vpVideoReader - \ingroup Video + \ingroup group_io_video \brief Class that enables to manipulate easily a video file or a sequence of images. As it inherits from the vpFrameGrabber Class, it can be used like an @@ -78,9 +74,9 @@ the getFrame() method to position the reader in the video and then use the acquire() method to get the following frames one by one. \code -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> -#include <visp/vpVideoReader.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/io/vpVideoReader.h> int main() { @@ -113,9 +109,9 @@ int main() match the first and image images of the sequence. \code -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> -#include <visp/vpVideoReader.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/io/vpVideoReader.h> int main() { @@ -138,9 +134,9 @@ int main() Note that it is also possible to access to a specific frame using getFrame(). \code -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> -#include <visp/vpVideoReader.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/io/vpVideoReader.h> int main() { @@ -217,6 +213,26 @@ class VISP_EXPORT vpVideoReader : public vpFrameGrabber bool firstFrameIndexIsSet; bool lastFrameIndexIsSet; +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpVideoReader(const vpVideoReader &) +// : vpFrameGrabber(), imSequence(NULL), +// #ifdef VISP_HAVE_FFMPEG +// ffmpeg(NULL), +// #elif VISP_HAVE_OPENCV_VERSION >= 0x020100 +// capture(), frame(), +// #endif +// formatType(FORMAT_UNKNOWN), initFileName(false), isOpen(false), frameCount(0), +// firstFrame(0), lastFrame(0), firstFrameIndexIsSet(false), lastFrameIndexIsSet(false) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpVideoReader &operator=(const vpVideoReader &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: vpVideoReader(); ~vpVideoReader(); diff --git a/src/video/vpVideoWriter.h b/modules/io/include/visp3/io/vpVideoWriter.h old mode 100755 new mode 100644 similarity index 93% rename from src/video/vpVideoWriter.h rename to modules/io/include/visp3/io/vpVideoWriter.h index bac0aa2de49dd2de29b0692e528b68f645847ae8..b48e0ec9bd5b8335f4c840f8f8201e88dd312ffe --- a/src/video/vpVideoWriter.h +++ b/modules/io/include/visp3/io/vpVideoWriter.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImagePoint.h 2359 2009-11-24 15:09:25Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Write videos and sequences of images. * @@ -49,8 +45,8 @@ #include <string> -#include <visp/vpImageIo.h> -#include <visp/vpFFMPEG.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpFFMPEG.h> #if VISP_HAVE_OPENCV_VERSION >= 0x020200 # include <opencv2/highgui/highgui.hpp> @@ -62,7 +58,7 @@ /*! \class vpVideoWriter - \ingroup Video + \ingroup group_io_video \brief Class that enables to write easily a video file or a sequence of images. @@ -74,8 +70,8 @@ The images are stored in the folder "./image" and are named "image0000.jpeg", "image0001.jpeg", "image0002.jpeg", ... \code - #include <visp/vpConfig.h> - #include <visp/vpVideoWriter.h> + #include <visp3/core/vpConfig.h> + #include <visp3/io/vpVideoWriter.h> int main() { @@ -105,7 +101,7 @@ The other following example explains how to use the class to write directly an mpeg file. \code -#include <visp/vpVideoWriter.h> +#include <visp3/io/vpVideoWriter.h> int main() { diff --git a/src/image/vpImageIo.cpp b/modules/io/src/image/vpImageIo.cpp similarity index 97% rename from src/image/vpImageIo.cpp rename to modules/io/src/image/vpImageIo.cpp index 69b470c79d379e1531ad7bb8ac9303b772fbd38b..7ee24a9549943c98489e0a0f38ae82e408b94ec1 100644 --- a/src/image/vpImageIo.cpp +++ b/modules/io/src/image/vpImageIo.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImageIo.cpp 5249 2015-02-03 13:04:27Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Read/write images. * @@ -44,10 +40,10 @@ \brief Read/write images */ -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> //image conversion -#include <visp/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> //image conversion +#include <visp3/core/vpIoTools.h> const int vpImageIo::vpMAX_LEN = 100; @@ -290,14 +286,14 @@ vpImageIo::read(vpImage<unsigned char> &I, const char *filename) case FORMAT_PPM : readPPM(I,filename); break; case FORMAT_JPEG : -#ifdef VISP_HAVE_LIBJPEG +#ifdef VISP_HAVE_JPEG readJPEG(I,filename); #else try_opencv_reader = true; #endif break; case FORMAT_PNG : -#if defined(VISP_HAVE_LIBPNG) +#if defined(VISP_HAVE_PNG) readPNG(I,filename); #else try_opencv_reader = true; @@ -391,14 +387,14 @@ vpImageIo::read(vpImage<vpRGBa> &I, const char *filename) case FORMAT_PPM : readPPM(I,filename); break; case FORMAT_JPEG : -#ifdef VISP_HAVE_LIBJPEG +#ifdef VISP_HAVE_JPEG readJPEG(I,filename); #else try_opencv_reader = true; #endif break; case FORMAT_PNG : -#if defined(VISP_HAVE_LIBPNG) +#if defined(VISP_HAVE_PNG) readPNG(I,filename); #else try_opencv_reader = true; @@ -483,14 +479,14 @@ vpImageIo::write(const vpImage<unsigned char> &I, const char *filename) case FORMAT_PPM : writePPM(I,filename); break; case FORMAT_JPEG : -#ifdef VISP_HAVE_LIBJPEG +#ifdef VISP_HAVE_JPEG writeJPEG(I,filename); #else try_opencv_writer = true; #endif break; case FORMAT_PNG : -#ifdef VISP_HAVE_LIBPNG +#ifdef VISP_HAVE_PNG writePNG(I,filename); #else try_opencv_writer = true; @@ -560,14 +556,14 @@ vpImageIo::write(const vpImage<vpRGBa> &I, const char *filename) case FORMAT_PPM : writePPM(I,filename); break; case FORMAT_JPEG : -#ifdef VISP_HAVE_LIBJPEG +#ifdef VISP_HAVE_JPEG writeJPEG(I,filename); #else try_opencv_writer = true; #endif break; case FORMAT_PNG : -#ifdef VISP_HAVE_LIBPNG +#ifdef VISP_HAVE_PNG writePNG(I,filename); #else try_opencv_writer = true; @@ -1747,7 +1743,7 @@ vpImageIo::writePPM(const vpImage<vpRGBa> &I, const std::string filename) // JPEG //-------------------------------------------------------------------------- -#if defined(VISP_HAVE_LIBJPEG) +#if defined(VISP_HAVE_JPEG) /*! Write the content of the image bitmap in the file which name is given by \e @@ -2366,7 +2362,7 @@ vpImageIo::readJPEG(vpImage<vpRGBa> &I, const std::string filename) // PNG //-------------------------------------------------------------------------- -#if defined(VISP_HAVE_LIBPNG) +#if defined(VISP_HAVE_PNG) /*! Write the content of the image bitmap in the file which name is given by \e @@ -2465,34 +2461,8 @@ vpImageIo::writePNG(const vpImage<unsigned char> &I, const char *filename) } } - if (setjmp (png_jmpbuf (png_ptr))) - { - fclose (file); - png_destroy_write_struct (&png_ptr, &info_ptr); - for(unsigned int j = 0; j < height; j++) - delete[] row_ptrs[j]; - - delete[] row_ptrs; - vpERROR_TRACE("Error during write image\n"); - throw (vpImageException(vpImageException::ioError, - "PNG write error")) ; - } - png_write_image(png_ptr, row_ptrs); - if (setjmp (png_jmpbuf (png_ptr))) - { - fclose (file); - png_destroy_write_struct (&png_ptr, &info_ptr); - for(unsigned int j = 0; j < height; j++) - delete[] row_ptrs[j]; - - delete[] row_ptrs; - vpERROR_TRACE("Error during write end\n"); - throw (vpImageException(vpImageException::ioError, - "PNG write error")) ; - } - png_write_end(png_ptr, NULL); for(unsigned int j = 0; j < height; j++) @@ -2619,34 +2589,8 @@ vpImageIo::writePNG(const vpImage<vpRGBa> &I, const char *filename) } } - if (setjmp (png_jmpbuf (png_ptr))) - { - fclose (file); - png_destroy_write_struct (&png_ptr, &info_ptr); - for(unsigned int j = 0; j < height; j++) - delete[] row_ptrs[j]; - - delete[] row_ptrs; - vpERROR_TRACE("Error during write image\n"); - throw (vpImageException(vpImageException::ioError, - "PNG write error")) ; - } - png_write_image(png_ptr, row_ptrs); - if (setjmp (png_jmpbuf (png_ptr))) - { - fclose (file); - png_destroy_write_struct (&png_ptr, &info_ptr); - for(unsigned int j = 0; j < height; j++) - delete[] row_ptrs[j]; - - delete[] row_ptrs; - vpERROR_TRACE("Error during write end\n"); - throw (vpImageException(vpImageException::ioError, - "PNG write error")) ; - } - png_write_end(png_ptr, NULL); for(unsigned int j = 0; j < height; j++) diff --git a/src/tools/io/vpParallelPort.cpp b/modules/io/src/parallel-port/vpParallelPort.cpp similarity index 89% rename from src/tools/io/vpParallelPort.cpp rename to modules/io/src/parallel-port/vpParallelPort.cpp index 2ff06281429f10fc2659d6b584c4bc8bd285c340..ddbf4ec00779e9b196f84f603b726e58a5f562da 100644 --- a/src/tools/io/vpParallelPort.cpp +++ b/modules/io/src/parallel-port/vpParallelPort.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpParallelPort.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Parallel port management. * @@ -40,7 +36,7 @@ *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_PARPORT @@ -50,7 +46,7 @@ # include <sys/ioctl.h> # include <unistd.h> -# include <visp/vpParallelPort.h> +# include <visp3/io/vpParallelPort.h> /*! \file vpParallelPort.cpp @@ -182,6 +178,8 @@ void vpParallelPort::close() } - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpParallelPort.cpp.o) has no symbols +void dummy_vpParallelPort() {}; #endif diff --git a/src/tools/io/vpKeyboard.cpp b/modules/io/src/tools/vpKeyboard.cpp similarity index 88% rename from src/tools/io/vpKeyboard.cpp rename to modules/io/src/tools/vpKeyboard.cpp index b18696ec2be10e26ca8e03ab9d3a9c7a07288a97..8d42f8c0f918a0e5263dd40c1696576a1030814c 100644 --- a/src/tools/io/vpKeyboard.cpp +++ b/modules/io/src/tools/vpKeyboard.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpKeyboard.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Keybord management. * @@ -43,7 +39,7 @@ #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) # include <stdio.h> -# include <visp/vpKeyboard.h> +# include <visp3/io/vpKeyboard.h> /*! \file vpKeyboard.cpp diff --git a/src/tools/io/vpParseArgv.cpp b/modules/io/src/tools/vpParseArgv.cpp similarity index 99% rename from src/tools/io/vpParseArgv.cpp rename to modules/io/src/tools/vpParseArgv.cpp index a6622263bcc259a503e3ea8ea09da3779fd38a14..0cca5603cefa85e0ea5615f57d8b9ff5f053dc53 100644 --- a/src/tools/io/vpParseArgv.cpp +++ b/modules/io/src/tools/vpParseArgv.cpp @@ -1,6 +1,4 @@ /**************************************************************************** - * - * $Id: vpParseArgv.cpp 5311 2015-02-11 17:42:01Z fspindle $ * * This file contains a procedure that handles table-based * argv-argc parsing. @@ -14,11 +12,9 @@ * software for any purpose. It is provided "as is" without * express or implied warranty. * - * * This file has been modified to not rely on tcl, tk or X11. * Based on tkArgv.c from tk2.3 : * - * * Modifications by Peter Neelin (November 27, 1992) * Modifications by Fabien Spindler (June 20, 2006) */ @@ -30,7 +26,7 @@ -#include <visp/vpParseArgv.h> +#include <visp3/io/vpParseArgv.h> #include <stdio.h> #include <stdlib.h> #include <stdint.h> @@ -173,8 +169,8 @@ vpParseArgv::parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, infoPtr = matchPtr; switch (infoPtr->type) { case ARGV_CONSTANT: - *((long long *) infoPtr->dst) = 1; - break; + *((int *) infoPtr->dst) = 1; + break; case ARGV_INT: nargs = (uintptr_t) infoPtr->src; if (nargs<1) nargs=1; diff --git a/src/device/framegrabber/disk/vpDiskGrabber.cpp b/modules/io/src/video/vpDiskGrabber.cpp similarity index 95% rename from src/device/framegrabber/disk/vpDiskGrabber.cpp rename to modules/io/src/video/vpDiskGrabber.cpp index d1c78cd73e45da48baf5b3bed851e0ef0333a93f..16c0c3b6fcef5757f938e1e8ed001c1444ad165c 100644 --- a/src/device/framegrabber/disk/vpDiskGrabber.cpp +++ b/modules/io/src/video/vpDiskGrabber.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDiskGrabber.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Disk framegrabber. * @@ -40,7 +36,7 @@ *****************************************************************************/ -#include <visp/vpDiskGrabber.h> +#include <visp3/io/vpDiskGrabber.h> /*! diff --git a/src/video/vpFFMPEG.cpp b/modules/io/src/video/vpFFMPEG.cpp similarity index 98% rename from src/video/vpFFMPEG.cpp rename to modules/io/src/video/vpFFMPEG.cpp index 238238a30d6293899225b253b0bf3e1db25e98cd..2d0ad4d90ef2333e9127182100ba748cd7ffda03 100644 --- a/src/video/vpFFMPEG.cpp +++ b/modules/io/src/video/vpFFMPEG.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImagePoint.h 2359 2009-11-24 15:09:25Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Class that manages the FFMPEG library. * @@ -47,10 +43,10 @@ #include <stdio.h> -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> -#include <visp/vpFFMPEG.h> -#include <visp/vpImageConvert.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/io/vpFFMPEG.h> +#include <visp3/core/vpImageConvert.h> #ifdef VISP_HAVE_FFMPEG @@ -932,4 +928,7 @@ void vpFFMPEG::writeBitmap(vpImage<unsigned char> &I) } } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_core.a(vpFFMPEG.cpp.o) has no symbols +void dummy_vpFFMPEG() {}; #endif diff --git a/src/video/vpVideoReader.cpp b/modules/io/src/video/vpVideoReader.cpp similarity index 87% rename from src/video/vpVideoReader.cpp rename to modules/io/src/video/vpVideoReader.cpp index 11aef7850b4a62e707e13e88f7fddfba116308e6..47631e5a06ba06f81c4e2c56e5e280fd9fad8ee1 100644 --- a/src/video/vpVideoReader.cpp +++ b/modules/io/src/video/vpVideoReader.cpp @@ -1,52 +1,48 @@ /**************************************************************************** -* -* $Id: vpImagePoint.h 2359 2009-11-24 15:09:25Z nmelchio $ -* -* This file is part of the ViSP software. -* Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -* -* This software is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* ("GPL") version 2 as published by the Free Software Foundation. -* See the file LICENSE.txt at the root directory of this source -* distribution for additional information about the GNU GPL. -* -* For using ViSP with software that can not be combined with the GNU -* GPL, please contact INRIA about acquiring a ViSP Professional -* Edition License. -* -* See http://www.irisa.fr/lagadic/visp/visp.html for more information. -* -* This software was developed at: -* INRIA Rennes - Bretagne Atlantique -* Campus Universitaire de Beaulieu -* 35042 Rennes Cedex -* France -* http://www.irisa.fr/lagadic -* -* If you have questions regarding the use of this file, please contact -* INRIA at visp@inria.fr -* -* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -* -* -* Description: -* Read videos and image sequences. -* -* Authors: -* Nicolas Melchior -* Fabien Spindler -* -*****************************************************************************/ + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Read videos and image sequences. + * + * Authors: + * Nicolas Melchior + * Fabien Spindler + * + *****************************************************************************/ /*! \file vpVideoReader.cpp \brief Read videos and image sequences */ -#include <visp/vpDebug.h> -#include <visp/vpVideoReader.h> +#include <visp3/core/vpDebug.h> +#include <visp3/io/vpVideoReader.h> #include <iostream> #include <fstream> @@ -56,7 +52,7 @@ Basic constructor. */ vpVideoReader::vpVideoReader() - : imSequence(NULL), + : vpFrameGrabber(), imSequence(NULL), #ifdef VISP_HAVE_FFMPEG ffmpeg(NULL), #elif VISP_HAVE_OPENCV_VERSION >= 0x020100 @@ -192,6 +188,7 @@ void vpVideoReader::open(vpImage< vpRGBa > &I) isOpen = true; findLastFrameIndex(); + frameCount = firstFrame; // open() should not increase the frame counter } @@ -255,6 +252,7 @@ void vpVideoReader::open(vpImage<unsigned char> &I) isOpen = true; findLastFrameIndex(); + frameCount = firstFrame; // open() should not increase the frame counter } @@ -392,8 +390,17 @@ bool vpVideoReader::getFrame(vpImage<vpRGBa> &I, long frame_index) capture >> frame; frameCount = (long) capture.get(cv::CAP_PROP_POS_FRAMES); // next index - if(frame.empty()) - setLastFrameIndex(frameCount-1); + if(frame.empty()) { + // New trial that makes things working with opencv 3.0.0 + capture >> frame; + if(frame.empty()) { + setLastFrameIndex(frameCount-1); + return false; + } + else { + vpImageConvert::convert(frame, I); + } + } else vpImageConvert::convert(frame, I); #elif defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) @@ -460,8 +467,17 @@ bool vpVideoReader::getFrame(vpImage<unsigned char> &I, long frame_index) } capture >> frame; frameCount = (long) capture.get(cv::CAP_PROP_POS_FRAMES); // next index - if(frame.empty()) - setLastFrameIndex(frameCount-1); + if(frame.empty()) { + // New trial that makes things working with opencv 3.0.0 + capture >> frame; + if(frame.empty()) { + setLastFrameIndex(frameCount-1); + return false; + } + else { + vpImageConvert::convert(frame, I); + } + } else vpImageConvert::convert(frame, I); #elif VISP_HAVE_OPENCV_VERSION >= 0x020100 @@ -600,43 +616,39 @@ std::string vpVideoReader::getExtension(const std::string &filename) /*! Get the last frame index (update the lastFrame attribute). */ -void - vpVideoReader::findLastFrameIndex() +void vpVideoReader::findLastFrameIndex() { - if (!isOpen) - { - vpERROR_TRACE("Use the open method before"); - throw (vpException(vpException::notInitialized,"file not yet opened")); - } - - if (imSequence != NULL) - { - if (! lastFrameIndexIsSet) { - char name[FILENAME_MAX]; - int image_number = firstFrame; - bool failed; - do - { - std::fstream file; - sprintf(name,fileName,image_number) ; - file.open(name, std::ios::in); - failed = file.fail(); + if (!isOpen) { + vpERROR_TRACE("Use the open method before"); + throw (vpException(vpException::notInitialized,"file not yet opened")); + } + + if (imSequence != NULL) { + if (! lastFrameIndexIsSet) { + char name[FILENAME_MAX]; + int image_number = firstFrame; + bool failed; + do { + std::fstream file; + sprintf(name,fileName,image_number) ; + file.open(name, std::ios::in); + failed = file.fail(); if (!failed) { file.close(); image_number++; } - }while(!failed); - - lastFrame = image_number; - } - } + } while(!failed); + + lastFrame = image_number -1; + } + } #ifdef VISP_HAVE_FFMPEG - else if (ffmpeg != NULL) { - if (! lastFrameIndexIsSet) { + else if (ffmpeg != NULL) { + if (! lastFrameIndexIsSet) { lastFrame = (long)(ffmpeg->getFrameNumber()); - } - } + } + } #elif VISP_HAVE_OPENCV_VERSION >= 0x030000 else if (! lastFrameIndexIsSet) { diff --git a/src/video/vpVideoWriter.cpp b/modules/io/src/video/vpVideoWriter.cpp old mode 100755 new mode 100644 similarity index 96% rename from src/video/vpVideoWriter.cpp rename to modules/io/src/video/vpVideoWriter.cpp index 82720a16c610923e90c3bcb6761468204f377268..95aba72ca8e33f9b19a6c330400acd3a642fafec --- a/src/video/vpVideoWriter.cpp +++ b/modules/io/src/video/vpVideoWriter.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImagePoint.h 2359 2009-11-24 15:09:25Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Write image sequences. * @@ -45,8 +41,8 @@ \brief Write image sequences. */ -#include <visp/vpDebug.h> -#include <visp/vpVideoWriter.h> +#include <visp3/core/vpDebug.h> +#include <visp3/io/vpVideoWriter.h> #if VISP_HAVE_OPENCV_VERSION >= 0x020200 # include <opencv2/imgproc/imgproc.hpp> diff --git a/modules/robot/CMakeLists.txt b/modules/robot/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..92a41582de29df791491ea71e1d388eddf151dbf --- /dev/null +++ b/modules/robot/CMakeLists.txt @@ -0,0 +1,102 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +# Add optional 3rd parties +set(opt_incs "") +set(opt_libs "") + +if(USE_AFMA4 OR USE_AFMA6 OR USE_VIPER650 OR USE_VIPER850) + list(APPEND opt_incs ${RAW1394_INCLUDE_DIRS}) + list(APPEND opt_incs ${CALINUX_INCLUDE_DIRS}) + list(APPEND opt_incs ${IRISA_INCLUDE_DIRS}) + list(APPEND opt_libs ${IRISA_LIBRARIES}) + list(APPEND opt_libs ${CALINUX_LIBRARIES}) + list(APPEND opt_libs ${RAW1394_LIBRARIES}) + list(APPEND opt_libs ${RT_LIBRARIES}) +endif() + +if(USE_BICLOPS) + list(APPEND opt_incs ${BICLOPS_INCLUDE_DIRS}) + list(APPEND opt_libs ${BICLOPS_LIBRARIES}) +endif() + +if(USE_PTU46) + list(APPEND opt_incs ${PTU46_INCLUDE_DIRS}) + list(APPEND opt_libs ${PTU46_LIBRARIES}) +endif() + +if(USE_ARIA AND UNIX AND USE_PTHREAD AND RT_FOUND AND DL_FOUND) + # Under Unix we need Aria, pthread, dl and rt libraries + list(APPEND opt_incs ${ARIA_INCLUDE_DIRS}) + list(APPEND opt_libs ${ARIA_LIBRARIES}) + list(APPEND opt_incs ${PTHREAD_INCLUDE_DIRS}) + list(APPEND opt_libs ${PTHREAD_LIBRARIES}) + list(APPEND opt_libs ${RT_LIBRARIES}) + list(APPEND opt_libs ${DL_LIBRARIES}) +elseif(USE_ARIA AND NOT UNIX) + list(APPEND opt_incs ${ARIA_INCLUDE_DIRS}) + list(APPEND opt_libs ${ARIA_LIBRARIES}) +endif() + +# for the wireframe simulator we can use optional opengl and coin +if(USE_COIN3D) + if(WIN32) + add_definitions("-DCOIN_DLL") + endif() + list(APPEND opt_incs ${COIN3D_INCLUDE_DIRS}) + # On OSX cmake 2.8 found OpenGL but OPENGL_INCLUDE_DIR was set to NOT_FOUND + # We add a test to be sure that the OPENGL vars exist. + if(OPENGL_INCLUDE_DIR) + list(APPEND opt_incs ${OPENGL_INCLUDE_DIR}) + endif() + if(OPENGL_LIBRARIES) + list(APPEND opt_libs ${OPENGL_LIBRARIES}) + endif() + list(APPEND opt_libs ${COIN3D_LIBRARIES}) +endif() + +vp_add_module(robot visp_core OPTIONAL visp_io visp_gui) +vp_glob_module_sources() + +# copy robot and wireframe simulator data +vp_glob_module_copy_data("src/robot-simulator/arms/*.bnd" data/robot-simulator) +vp_glob_module_copy_data("src/wireframe-simulator/scene/*.bnd" data/wireframe-simulator) +vp_glob_module_copy_data("src/wireframe-simulator/scene/*.sld" data/wireframe-simulator) + +vp_module_include_directories(${opt_incs}) +vp_create_module(${opt_libs}) +vp_add_tests(DEPENDS_ON visp_sensor visp_vision visp_blob visp_gui) diff --git a/src/robot/real-robot/afma4/vpAfma4.h b/modules/robot/include/visp3/robot/vpAfma4.h similarity index 88% rename from src/robot/real-robot/afma4/vpAfma4.h rename to modules/robot/include/visp3/robot/vpAfma4.h index 376314a65fddc8058939eae38ff3518a32f319bf..08012db5978fbaf68688a0e8ba0833e6b8ee2d48 100644 --- a/src/robot/real-robot/afma4/vpAfma4.h +++ b/modules/robot/include/visp3/robot/vpAfma4.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpAfma4.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Irisa's Afma4 robot. * @@ -54,7 +50,7 @@ \class vpAfma4 - \ingroup Afma4 + \ingroup group_robot_real_cylindrical \brief Modelisation of Irisa's cylindrical robot named Afma4. @@ -102,11 +98,11 @@ */ -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpVelocityTwistMatrix.h> class VISP_EXPORT vpAfma4 diff --git a/src/robot/real-robot/afma6/vpAfma6.h b/modules/robot/include/visp3/robot/vpAfma6.h similarity index 91% rename from src/robot/real-robot/afma6/vpAfma6.h rename to modules/robot/include/visp3/robot/vpAfma6.h index 0b5f173ee3cac44f41efdd6db9c63e843c447153..1519f43107882ec2b08c0ea7168a009d84e09207 100644 --- a/src/robot/real-robot/afma6/vpAfma6.h +++ b/modules/robot/include/visp3/robot/vpAfma6.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpAfma6.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Irisa's Afma6 robot. * @@ -54,17 +50,17 @@ \class vpAfma6 - \ingroup Afma6 + \ingroup group_robot_real_gantry group_robot_simu_gantry \brief Modelisation of Irisa's gantry robot named Afma6. */ -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpVelocityTwistMatrix.h> class VISP_EXPORT vpAfma6 { diff --git a/src/simulator/wireframe-simulator/core/vpArit.h b/modules/robot/include/visp3/robot/vpArit.h old mode 100755 new mode 100644 similarity index 93% rename from src/simulator/wireframe-simulator/core/vpArit.h rename to modules/robot/include/visp3/robot/vpArit.h index 6424b1cd32a016a3ed166937915be59ac5870a4c..0279f865653e1759a4b983146a926b934a37f73d --- a/src/simulator/wireframe-simulator/core/vpArit.h +++ b/modules/robot/include/visp3/robot/vpArit.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpArit.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Le module contient les procedures arithmetiques. * @@ -41,7 +37,7 @@ #ifndef vpArit_h #define vpArit_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <stdio.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/robot/real-robot/biclops/vpBiclops.h b/modules/robot/include/visp3/robot/vpBiclops.h similarity index 89% rename from src/robot/real-robot/biclops/vpBiclops.h rename to modules/robot/include/visp3/robot/vpBiclops.h index 2461b4d0583c24d98598a025bd909b31f8ac4dc2..a1ec61b6ec5986936fceedfebea0aedc9ab7f7f3 100644 --- a/src/robot/real-robot/biclops/vpBiclops.h +++ b/modules/robot/include/visp3/robot/vpBiclops.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpBiclops.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Biclops robot. * @@ -47,13 +43,13 @@ /* --------------------------------------------------------------------- */ /* --- ViSP --- */ -#include <visp/vpMatrix.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpPoseVector.h> -#include <visp/vpMath.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpPoseVector.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpVelocityTwistMatrix.h> /* --- GENERAL --- */ #include <iostream> @@ -62,7 +58,7 @@ \class vpBiclops - \ingroup Biclops + \ingroup group_robot_real_ptu \brief Jacobian, geometric model functionnalities... for biclops, pan, tilt head. diff --git a/src/simulator/wireframe-simulator/core/vpBound.h b/modules/robot/include/visp3/robot/vpBound.h old mode 100755 new mode 100644 similarity index 90% rename from src/simulator/wireframe-simulator/core/vpBound.h rename to modules/robot/include/visp3/robot/vpBound.h index d05b2a9b1035721b6282d4410713d9f094e79a1f..db6baa5dd8ef3c95a4026c513d93615b946b488e --- a/src/simulator/wireframe-simulator/core/vpBound.h +++ b/modules/robot/include/visp3/robot/vpBound.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpBound.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Le fichier "bound.h" contient les macros et le types * utilises par le modele geometrique surfacique polygonale 3D. @@ -43,8 +39,8 @@ #ifndef vpBound_H #define vpBound_H -#include <visp/vpConfig.h> -#include <visp/vpMy.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpMy.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/simulator/wireframe-simulator/core/vpCgiconstants.h b/modules/robot/include/visp3/robot/vpCgiconstants.h old mode 100755 new mode 100644 similarity index 91% rename from src/simulator/wireframe-simulator/core/vpCgiconstants.h rename to modules/robot/include/visp3/robot/vpCgiconstants.h index c4b9727ecea3a2462da99bca541520521aa3b991..e0ce04fe2ec925d47fe73f437eacc6695694a81f --- a/src/simulator/wireframe-simulator/core/vpCgiconstants.h +++ b/modules/robot/include/visp3/robot/vpCgiconstants.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpCgiconstants.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * * Authors: @@ -41,7 +37,7 @@ #ifndef vpCgiconstants_H #define vpCgiconstants_H -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -186,4 +182,4 @@ #endif -#endif \ No newline at end of file +#endif diff --git a/src/simulator/image-simulator/vpImageSimulator.h b/modules/robot/include/visp3/robot/vpImageSimulator.h similarity index 89% rename from src/simulator/image-simulator/vpImageSimulator.h rename to modules/robot/include/visp3/robot/vpImageSimulator.h index 054a519b5b94e76db03751033cda69d7bb2bcd29..f1d6b4cdeb850b047a352419f2c6c651280c93c9 100644 --- a/src/simulator/image-simulator/vpImageSimulator.h +++ b/modules/robot/include/visp3/robot/vpImageSimulator.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPose.h 2453 2010-01-07 10:01:10Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: Class which enables to project an image in the 3D space * and get the view of a virtual camera. * @@ -47,7 +43,7 @@ /*! \class vpImageSimulator - \ingroup ImageSimulator + \ingroup group_robot_image_simu \brief Class which enables to project an image in the 3D space and get the view of a virtual camera. @@ -64,8 +60,8 @@ The following example explain how to use the class. \code - #include <visp/vpImage.h> - #include <visp/vpImageSimulator.h> + #include <visp3/core/vpImage.h> + #include <visp3/robot/vpImageSimulator.h> int main() { @@ -123,16 +119,13 @@ \endcode */ -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpColVector.h> -#include <visp/vpTriangle.h> -#include <visp/vpRect.h> -#include <visp/vpImage.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpPoint.h> -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -# include <visp/vpList.h> -#endif +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpTriangle.h> +#include <visp3/core/vpRect.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpPoint.h> #include <vector> #include <list> @@ -216,10 +209,14 @@ class VISP_EXPORT vpImageSimulator //creation du plan a partir de ses coordonnees 3D ds repere objet et de son image texture void init(const vpImage<unsigned char> &I,vpColVector* X); void init(const vpImage<vpRGBa> &I,vpColVector* X); +#ifdef VISP_HAVE_MODULE_IO void init(const char* file_image,vpColVector* X); +#endif void init(const vpImage<unsigned char> &I, const std::vector<vpPoint>& X); void init(const vpImage<vpRGBa> &I, const std::vector<vpPoint>& X); +#ifdef VISP_HAVE_MODULE_IO void init(const char* file_image, const std::vector<vpPoint>& X); +#endif //projection du plan par cMo => creation des deux triangles definissant projection du plan sur plan image (coord en metre) void setCameraPosition(const vpHomogeneousMatrix &cMt); @@ -273,17 +270,6 @@ class VISP_EXPORT vpImageSimulator setBackgroundTexture = true; Ig = Iback; } - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated functions - */ - vp_deprecated static void getImage(vpImage<unsigned char> &I, - vpList<vpImageSimulator> &list, - const vpCameraParameters &cam); - vp_deprecated static void getImage(vpImage<vpRGBa> &I, vpList<vpImageSimulator> &list, - const vpCameraParameters &cam); -#endif private: void initPlan(vpColVector* X); diff --git a/src/simulator/wireframe-simulator/core/vpImstack.h b/modules/robot/include/visp3/robot/vpImstack.h old mode 100755 new mode 100644 similarity index 78% rename from src/simulator/wireframe-simulator/core/vpImstack.h rename to modules/robot/include/visp3/robot/vpImstack.h index 1fa1061f735ab18e97a4e701316baa79d9cdd944..96de22cdecefb74e0de94bd45d7987df1dd75864 --- a/src/simulator/wireframe-simulator/core/vpImstack.h +++ b/modules/robot/include/visp3/robot/vpImstack.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpImstack.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Le module "imstack.h" contient les macros, les types et * les specifications des procedures de gestion de la pile @@ -43,7 +39,7 @@ #ifndef vpImstack_H #define vpImstack_H -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/simulator/wireframe-simulator/core/vpKeyword.h b/modules/robot/include/visp3/robot/vpKeyword.h similarity index 75% rename from src/simulator/wireframe-simulator/core/vpKeyword.h rename to modules/robot/include/visp3/robot/vpKeyword.h index f75bf11d747f176fda2a694beafae9fc43065639..c64f1a164495b74ac47f48fab50e794121624e7d 100644 --- a/src/simulator/wireframe-simulator/core/vpKeyword.h +++ b/modules/robot/include/visp3/robot/vpKeyword.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpKeyword.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Le module "keyword.c" contient les procedures de gestion * des mots cles retournes par l'analyseur lexical "lex". @@ -43,8 +39,8 @@ #ifndef vpKeyword_H #define vpKeyword_H -#include <visp/vpConfig.h> -#include <visp/vpMy.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpMy.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/simulator/wireframe-simulator/core/vpLex.h b/modules/robot/include/visp3/robot/vpLex.h similarity index 79% rename from src/simulator/wireframe-simulator/core/vpLex.h rename to modules/robot/include/visp3/robot/vpLex.h index 859426df074cb8114dcf825eff3357449d708621..5982501f15b221f9f15de13f366040895e2b6182 100644 --- a/src/simulator/wireframe-simulator/core/vpLex.h +++ b/modules/robot/include/visp3/robot/vpLex.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpLex.h 5297 2015-02-10 11:19:24Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Le module "lex.c" contient les procedures de gestion * de l'analyse lexicale de l'analyseur lexicale "lex" @@ -45,7 +41,7 @@ #ifndef vpLex_h #define vpLex_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <stdio.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/simulator/wireframe-simulator/core/vpMy.h b/modules/robot/include/visp3/robot/vpMy.h old mode 100755 new mode 100644 similarity index 84% rename from src/simulator/wireframe-simulator/core/vpMy.h rename to modules/robot/include/visp3/robot/vpMy.h index ac303f78c32e5fb5e80b0066eb877290b45da2b7..65de18b6c50ebf15035b526028e1dd9b7443404d --- a/src/simulator/wireframe-simulator/core/vpMy.h +++ b/modules/robot/include/visp3/robot/vpMy.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMy.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Module de Macros et de Types de bases en langage "C". * @@ -41,7 +37,7 @@ #ifndef vpMy_H #define vpMy_H -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/robot/real-robot/pioneer/vpPioneer.h b/modules/robot/include/visp3/robot/vpPioneer.h similarity index 88% rename from src/robot/real-robot/pioneer/vpPioneer.h rename to modules/robot/include/visp3/robot/vpPioneer.h index 9dc27277328180f3afe22dcc9e6ec615698cb40f..cdae6cc2ffc0945df7c92d8a4edc3cf4b3274bdb 100644 --- a/src/robot/real-robot/pioneer/vpPioneer.h +++ b/modules/robot/include/visp3/robot/vpPioneer.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpPioneer.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Common features for Pioneer unicycle mobile robots. * @@ -41,16 +37,16 @@ #ifndef VPPIONEER_H #define VPPIONEER_H -#include <visp/vpRxyzVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpUnicycle.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/robot/vpUnicycle.h> /*! \class vpPioneer - \ingroup Pioneer + \ingroup group_robot_real_unicycle group_robot_simu_unicycle \brief Generic functions for Pioneer mobile robots. diff --git a/src/robot/real-robot/pioneer/vpPioneerPan.h b/modules/robot/include/visp3/robot/vpPioneerPan.h similarity index 91% rename from src/robot/real-robot/pioneer/vpPioneerPan.h rename to modules/robot/include/visp3/robot/vpPioneerPan.h index 5d1f6d986677bee43e60b26bc2ab2920e9dc4fae..2265985a74efa8cf4d663ce2fcae84f25025957f 100644 --- a/src/robot/real-robot/pioneer/vpPioneerPan.h +++ b/modules/robot/include/visp3/robot/vpPioneerPan.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpPioneerPan.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Common features for Pioneer unicycle mobile robots. * @@ -41,17 +37,17 @@ #ifndef VPPIONEERPAN_H #define VPPIONEERPAN_H -#include <visp/vpRxyzVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpUnicycle.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/robot/vpUnicycle.h> /*! \class vpPioneerPan - \ingroup Pioneer + \ingroup group_robot_real_unicycle group_robot_simu_unicycle \brief Generic functions for Pioneer mobile robots equiped with a pan head. diff --git a/src/robot/real-robot/ptu46/vpPtu46.h b/modules/robot/include/visp3/robot/vpPtu46.h similarity index 79% rename from src/robot/real-robot/ptu46/vpPtu46.h rename to modules/robot/include/visp3/robot/vpPtu46.h index 554fe89f840e55b79e2125eed06aeaf70428aba6..4d4ee3c219d3b0ee66d22ab4d77a32b327da5698 100644 --- a/src/robot/real-robot/ptu46/vpPtu46.h +++ b/modules/robot/include/visp3/robot/vpPtu46.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPtu46.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the ptu-46 robot. * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef __vpPtu46_H #define __vpPtu46_H @@ -53,21 +49,21 @@ #include <iostream> /* --- ViSP --- */ -#include <visp/vpConfig.h> -#include <visp/vpMatrix.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpPoseVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpPoseVector.h> -#include <visp/vpMath.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpVelocityTwistMatrix.h> /*! \class vpPtu46 - \ingroup Ptu46 + \ingroup group_robot_real_ptu \brief Jacobian, geometric model functionnalities... for ptu46, pan, tilt head from Directed Perception. diff --git a/src/simulator/wireframe-simulator/core/vpRfstack.h b/modules/robot/include/visp3/robot/vpRfstack.h old mode 100755 new mode 100644 similarity index 79% rename from src/simulator/wireframe-simulator/core/vpRfstack.h rename to modules/robot/include/visp3/robot/vpRfstack.h index 80d6610b139d3e16c274db7c4f3c85d5d2d2b4d7..388fcb5efe07647f5d65b6af934449307b90f0f0 --- a/src/simulator/wireframe-simulator/core/vpRfstack.h +++ b/modules/robot/include/visp3/robot/vpRfstack.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRfstack.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Le module "rfstack.h" contient les macros, les types et * les specifications des procedures de gestion de la pile @@ -43,7 +39,7 @@ #ifndef vpRfstack_h #define vpRfstack_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <stdio.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/device/light/vpRingLight.h b/modules/robot/include/visp3/robot/vpRingLight.h similarity index 76% rename from src/device/light/vpRingLight.h rename to modules/robot/include/visp3/robot/vpRingLight.h index b1784f401abdee3c68e60bd93037a0d701a62eb5..a20e6671e6e03b72d6054d690e3dae4ff86787fd 100644 --- a/src/device/light/vpRingLight.h +++ b/modules/robot/include/visp3/robot/vpRingLight.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRingLight.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Ring light management. * @@ -50,17 +46,18 @@ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#ifdef VISP_HAVE_PARPORT +#if defined(VISP_HAVE_MODULE_IO) && defined(VISP_HAVE_PARPORT) -# include <visp/vpRingLight.h> -# include <visp/vpParallelPort.h> #include <iostream> + +#include <visp3/robot/vpRingLight.h> +#include <visp3/io/vpParallelPort.h> /*! \class vpRingLight - \ingroup Afma6 + \ingroup group_robot_real_gantry \brief Ring light management under unix. \warning This class works only at Irisa with the Edixia's ring light system. @@ -69,14 +66,14 @@ the lighting system. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpRingLight.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/robot/vpRingLight.h> int main() { -#if defined(VISP_HAVE_PARPORT) && defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_PARPORT) && defined(VISP_HAVE_DC1394) vp1394TwoGrabber g; // Firewire framegrabber based on libdc1394-2.x third party lib vpImage<unsigned char> I; @@ -92,9 +89,9 @@ int main() Here is an example showing how to turn on the lighting during 10 seconds. \code -#include <visp/vpConfig.h> -#include <visp/vpRingLight.h> -#include <visp/vpTime.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRingLight.h> +#include <visp3/core/vpTime.h> int main() { diff --git a/src/robot/robot/vpRobot.h b/modules/robot/include/visp3/robot/vpRobot.h similarity index 90% rename from src/robot/robot/vpRobot.h rename to modules/robot/include/visp3/robot/vpRobot.h index 4987af7d9f530f3d67d4fd12a407f4ca1c93dcb6..b3eb07a3f6a76c86b565ec9e5d7615b9214c3333 100644 --- a/src/robot/robot/vpRobot.h +++ b/modules/robot/include/visp3/robot/vpRobot.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobot.h 5238 2015-01-30 13:52:25Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Generic virtual robot. * @@ -47,14 +43,16 @@ \brief class that defines a generic virtual robot */ -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> -#include <visp/vpPoseVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpPoseVector.h> /*! \class vpRobot + \ingroup group_robot_real_gantry group_robot_real_cylindrical group_robot_real_arm + \ingroup group_robot_real_ptu group_robot_real_unicycle group_robot_real_template \brief class that defines a generic virtual robot */ class VISP_EXPORT vpRobot diff --git a/src/robot/real-robot/afma4/vpRobotAfma4.h b/modules/robot/include/visp3/robot/vpRobotAfma4.h similarity index 94% rename from src/robot/real-robot/afma4/vpRobotAfma4.h rename to modules/robot/include/visp3/robot/vpRobotAfma4.h index b7d19e0f6a135b00e784f4eee894a60f91ba785b..80c028abf841ac76edeadd6d7aff36a69b67748d 100644 --- a/src/robot/real-robot/afma4/vpRobotAfma4.h +++ b/modules/robot/include/visp3/robot/vpRobotAfma4.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotAfma4.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Irisa's Afma4 robot. * @@ -42,17 +38,17 @@ #ifndef vpRobotAfma4_h #define vpRobotAfma4_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_AFMA4 #include <iostream> #include <stdio.h> -#include <visp/vpRobot.h> -#include <visp/vpColVector.h> -#include <visp/vpDebug.h> -#include <visp/vpAfma4.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpDebug.h> +#include <visp3/robot/vpAfma4.h> // low level controller api extern "C" { @@ -64,7 +60,7 @@ extern "C" { /*! \class vpRobotAfma4 - \ingroup Afma4 RobotDriver + \ingroup group_robot_real_cylindrical \brief Control of Irisa's cylindrical robot named Afma4. diff --git a/src/robot/real-robot/afma6/vpRobotAfma6.h b/modules/robot/include/visp3/robot/vpRobotAfma6.h similarity index 94% rename from src/robot/real-robot/afma6/vpRobotAfma6.h rename to modules/robot/include/visp3/robot/vpRobotAfma6.h index f7b48b0dd7a147b7d31e0a6f834b66e6c7ab68e4..0a35c83afb4e4bbc487f7d0c3f09d5511ee27d56 100644 --- a/src/robot/real-robot/afma6/vpRobotAfma6.h +++ b/modules/robot/include/visp3/robot/vpRobotAfma6.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotAfma6.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Irisa's Afma6 robot controlled by an Adept MotionBlox. * @@ -42,18 +38,18 @@ #ifndef vpRobotAfma6_h #define vpRobotAfma6_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_AFMA6 #include <iostream> #include <stdio.h> -#include <visp/vpRobot.h> -#include <visp/vpColVector.h> -#include <visp/vpPoseVector.h> -#include <visp/vpDebug.h> -#include <visp/vpAfma6.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpPoseVector.h> +#include <visp3/core/vpDebug.h> +#include <visp3/robot/vpAfma6.h> // low level controller api extern "C" { @@ -65,7 +61,7 @@ extern "C" { /*! \class vpRobotAfma6 - \ingroup Afma6 RobotDriver + \ingroup group_robot_real_gantry \brief Control of Irisa's gantry robot named Afma6. @@ -104,8 +100,8 @@ extern "C" { class by calling the default constructor: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotAfma6.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotAfma6.h> #ifdef VISP_HAVE_AFMA6 int main() diff --git a/src/robot/real-robot/biclops/vpRobotBiclops.h b/modules/robot/include/visp3/robot/vpRobotBiclops.h similarity index 81% rename from src/robot/real-robot/biclops/vpRobotBiclops.h rename to modules/robot/include/visp3/robot/vpRobotBiclops.h index cc749a4900a112617cb6aeccabaa71f545030af0..abca970160911722f0ec8c710a1c7a21b1fc6330 100644 --- a/src/robot/real-robot/biclops/vpRobotBiclops.h +++ b/modules/robot/include/visp3/robot/vpRobotBiclops.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotBiclops.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Biclops robot. * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_BICLOPS @@ -58,11 +54,11 @@ /* --- ViSP --- */ -#include <visp/vpRobot.h> -#include <visp/vpBiclops.h> -#include <visp/vpColVector.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpRobotBiclopsController.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/robot/vpBiclops.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/robot/vpRobotBiclopsController.h> /* ------------------------------------------------------------------------ */ @@ -72,11 +68,9 @@ /*! - - \class vpRobotBiclops - \ingroup Biclops RobotDriver + \ingroup group_robot_real_ptu \brief Interface for the biclops, pan, tilt head control. @@ -109,8 +103,6 @@ class VISP_EXPORT vpRobotBiclops private: - /*! \brief No copy constructor allowed. */ - vpRobotBiclops (const vpRobotBiclops & ass); void getCameraDisplacement(vpColVector &d); void getArticularDisplacement(vpColVector &d); @@ -126,6 +118,21 @@ private: vpColVector q_previous; bool controlThreadCreated; +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// /*! \brief No copy constructor allowed. */ +// vpRobotBiclops(const vpRobotBiclops &) +// : vpBiclops(), vpRobot(), control_thread(), controller(), +// positioningVelocity(0), q_previous(), controlThreadCreated(false) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpRobotBiclops &operator=(const vpRobotBiclops &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: static const double defaultPositioningVelocity; diff --git a/src/robot/real-robot/biclops/vpRobotBiclopsController.h b/modules/robot/include/visp3/robot/vpRobotBiclopsController.h similarity index 81% rename from src/robot/real-robot/biclops/vpRobotBiclopsController.h rename to modules/robot/include/visp3/robot/vpRobotBiclopsController.h index b615ccf804b69fa55d94de99b3ec5930da6c4f59..52fb1411ef01f0a0f0e540ca1d410583344b242f 100644 --- a/src/robot/real-robot/biclops/vpRobotBiclopsController.h +++ b/modules/robot/include/visp3/robot/vpRobotBiclopsController.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotBiclopsController.h 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Biclops robot. * @@ -39,8 +35,9 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> +#ifndef DOXYGEN_SHOULD_SKIP_THIS #ifdef VISP_HAVE_BICLOPS #ifndef __vpROBOT_BICLOPS_CONTROLLER_H @@ -56,7 +53,7 @@ #include <stdio.h> /* Classe std::ostream. */ #include <pthread.h> /* Classe std::ostream. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include "Biclops.h" // Contrib for Biclops robot #include "PMDUtils.h" // Contrib for Biclops robot @@ -73,7 +70,7 @@ class VISP_EXPORT Biclops; //needed for dll creation \class vpRobotBiclopsController - \ingroup Biclops + \ingroup group_robot_real_ptu \brief Interface to Biclops, pan, tilt, verge head for computer vision applications. @@ -104,6 +101,20 @@ public: } shmType; #endif /* DOXYGEN_SHOULD_SKIP_THIS */ +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpRobotBiclopsController(const vpRobotBiclopsController &) +// : biclops(), axisMask(0), panAxis(NULL), tiltAxis(NULL), vergeAxis(NULL), +// panProfile(), tiltProfile(), vergeProfile(), shm(), stopControllerThread_(false) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpRobotBiclopsController &operator=(const vpRobotBiclopsController &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: vpRobotBiclopsController(); virtual ~vpRobotBiclopsController(); @@ -147,14 +158,8 @@ private: }; - #endif /* #ifndef __vpROBOT_BICLOPS_CONTROLLER_H */ - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +#endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS #endif diff --git a/src/robot/simulator-robot/vpRobotCamera.h b/modules/robot/include/visp3/robot/vpRobotCamera.h similarity index 85% rename from src/robot/simulator-robot/vpRobotCamera.h rename to modules/robot/include/visp3/robot/vpRobotCamera.h index 4c34837cf37a33d0eff91b8a4405bc59f81e2934..abea253c9bacfc779ad36a019b80ba485ebd40ae 100644 --- a/src/robot/simulator-robot/vpRobotCamera.h +++ b/modules/robot/include/visp3/robot/vpRobotCamera.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotCamera.h 2456 2010-01-07 10:33:12Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Defines the simplest robot : a free flying camera. * @@ -48,17 +44,23 @@ \brief class that defines the simplest robot : a free flying camera */ -#include <visp/vpColVector.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMatrix.h> -#include <visp/vpRobotSimulator.h> +#include <visp3/core/vpConfig.h> + +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/robot/vpRobotSimulator.h> /*! \class vpRobotCamera + \ingroup group_robot_simu_camera - \ingroup RobotSimuWithoutVisu + \deprecated This class is deprecated since ViSP 3.0.0. - \brief Class that defines the simplest robot: a free flying camera. + \brief Class that defines the simplest robot: a free flying camera. We recommend to use + vpSimulatorCamera instead. This free flying camera has 6 dof; 3 in translation and 3 in rotation. It evolves as a gentry robot with respect to a world frame. This class @@ -68,8 +70,6 @@ than the one implemented in vpSimulatorCamera where the transformation from world to camera frame is considered; wMc. - \note We recommend to use vpSimulatorCamera rather than vpRobotCamera. - For this particular simulated robot, the end-effector and camera frame are confused. That means that the cMe transformation is equal to identity. @@ -78,7 +78,7 @@ The following code shows how to control this robot in position and velocity. \code -#include <visp/vpRobotCamera.h> +#include <visp3/robot/vpRobotCamera.h> int main() { @@ -135,8 +135,4 @@ private: } ; #endif -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +#endif diff --git a/src/robot/robot/vpRobotException.h b/modules/robot/include/visp3/robot/vpRobotException.h similarity index 90% rename from src/robot/robot/vpRobotException.h rename to modules/robot/include/visp3/robot/vpRobotException.h index 7fb9a36c72a5d697a442ea41d771e73f162c762f..7c9751f50a7ac9d47279ba2447e14b0b705ed808 100644 --- a/src/robot/robot/vpRobotException.h +++ b/modules/robot/include/visp3/robot/vpRobotException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotException.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exception that can be emited by the vpRobot class and its derivates. * @@ -55,7 +51,7 @@ */ /* Classes standards. */ -#include <visp/vpException.h> +#include <visp3/core/vpException.h> #include <iostream> /* Classe std::ostream. */ #include <string> /* Classe string. */ @@ -65,7 +61,7 @@ /* ------------------------------------------------------------------------- */ /*! - \ingroup Exception + \class vpRobotException \brief Error that can be emited by the vpRobot class and its derivates. */ class VISP_EXPORT vpRobotException : public vpException @@ -74,7 +70,7 @@ class VISP_EXPORT vpRobotException : public vpException /*! \brief Lists the possible error than can be emmited while calling vpRobot member - */ + */ enum errorRobotCodeEnum { diff --git a/src/robot/real-robot/pioneer/vpRobotPioneer.h b/modules/robot/include/visp3/robot/vpRobotPioneer.h similarity index 83% rename from src/robot/real-robot/pioneer/vpRobotPioneer.h rename to modules/robot/include/visp3/robot/vpRobotPioneer.h index a18e1982795ca6695bfe8397543398d000aade91..91553348c0c075728c05b3b2c0495929867de64e 100644 --- a/src/robot/real-robot/pioneer/vpRobotPioneer.h +++ b/modules/robot/include/visp3/robot/vpRobotPioneer.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpRobotPioneer.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for Pioneer mobile robots based on Aria 3rd party library. * @@ -41,19 +37,26 @@ #ifndef VPROBOTPIONEER_H #define VPROBOTPIONEER_H -#include <visp/vpConfig.h> -#include <visp/vpRobot.h> -#include <visp/vpPioneer.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_PIONEER #include <Aria.h> +// Warning: vpMath.h included from vpRobot.h or vpPioneer.h should be +// included after Aria.h to avoid the build issue: +// "/usr/include/Aria/ariaUtil.h:732:21: error: ‘isfinite’ was not declared +// in this scope" +// This error is due to cmath header included from vpMath.h that makes +// isfinite() ambiguous between ::isfinite() and std::isfinite() +#include <visp3/robot/vpRobot.h> +#include <visp3/robot/vpPioneer.h> + /*! \class vpRobotPioneer - \ingroup Pioneer RobotDriver + \ingroup group_robot_real_unicycle \brief Interface for Pioneer mobile robots based on Aria 3rd party library. diff --git a/src/robot/real-robot/ptu46/vpRobotPtu46.h b/modules/robot/include/visp3/robot/vpRobotPtu46.h similarity index 87% rename from src/robot/real-robot/ptu46/vpRobotPtu46.h rename to modules/robot/include/visp3/robot/vpRobotPtu46.h index a5702d0e1fab3dc7882ad79337312d3c76253d73..4a55b467a431ecadd18e2118b4bb0ac93857c0e0 100644 --- a/src/robot/real-robot/ptu46/vpRobotPtu46.h +++ b/modules/robot/include/visp3/robot/vpRobotPtu46.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotPtu46.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the ptu-46 robot. * @@ -40,7 +36,7 @@ *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_PTU46 @@ -58,11 +54,11 @@ /* --- ViSP --- */ -#include <visp/vpRobot.h> -#include <visp/vpPtu46.h> -#include <visp/vpColVector.h> -#include <visp/vpDebug.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/robot/vpPtu46.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpVelocityTwistMatrix.h> #include <ptu.h> // Contrib for Ptu-46 robot @@ -75,7 +71,7 @@ \class vpRobotPtu46 - \ingroup Ptu46 RobotDriver + \ingroup group_robot_real_ptu \brief Interface for the Directed Perception ptu-46 pan, tilt head . diff --git a/src/robot/simulator-robot/vpRobotSimulator.h b/modules/robot/include/visp3/robot/vpRobotSimulator.h similarity index 79% rename from src/robot/simulator-robot/vpRobotSimulator.h rename to modules/robot/include/visp3/robot/vpRobotSimulator.h index 7c193b90e36d06068557aae75fc04a6289cb098f..099b075f610cf91f385c19db2fabde4875c9db06 100644 --- a/src/robot/simulator-robot/vpRobotSimulator.h +++ b/modules/robot/include/visp3/robot/vpRobotSimulator.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotSimulator.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Basic class used to make robot simulators. * @@ -47,17 +43,18 @@ \brief Basic class used to make robot simulators. */ -#include <visp/vpConfig.h> -#include <visp/vpRobot.h> -#include <visp/vpTime.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/core/vpTime.h> +#include <visp3/core/vpVelocityTwistMatrix.h> /*! \class vpRobotSimulator - \ingroup RobotSimuWithVisu, RobotSimuWithoutVisu - + \ingroup group_robot_simu_gantry group_robot_simu_arm group_robot_simu_unicycle + \ingroup group_robot_simu_camera + \brief This class aims to be a basis used to create all the robot simulators. diff --git a/src/robot/robot/vpRobotTemplate.h b/modules/robot/include/visp3/robot/vpRobotTemplate.h similarity index 88% rename from src/robot/robot/vpRobotTemplate.h rename to modules/robot/include/visp3/robot/vpRobotTemplate.h index 8d527b8ae4388a901c378c77d424511ecb55f826..372bbf9ecb8c7c79fe79079655358feca029595f 100644 --- a/src/robot/robot/vpRobotTemplate.h +++ b/modules/robot/include/visp3/robot/vpRobotTemplate.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotTemplate.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Defines a robot just to show which function you must implement. * @@ -48,10 +44,11 @@ \brief class that defines a robot just to show which function you must implement */ -#include <visp/vpRobot.h> +#include <visp3/robot/vpRobot.h> /*! \class vpRobotTemplate + \ingroup group_robot_real_template \brief class that defines a robot just to show which function you must implement */ diff --git a/src/robot/real-robot/viper/vpRobotViper650.h b/modules/robot/include/visp3/robot/vpRobotViper650.h similarity index 88% rename from src/robot/real-robot/viper/vpRobotViper650.h rename to modules/robot/include/visp3/robot/vpRobotViper650.h index d9ad2bff8789ee9a1694c30635850c9bb97e440f..379f6f9e14ed40c1f7b0dcd9d5c85168596f67d7 100644 --- a/src/robot/real-robot/viper/vpRobotViper650.h +++ b/modules/robot/include/visp3/robot/vpRobotViper650.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotViper650.h 4793 2014-07-21 15:10:52Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Irisa's Viper S650 robot controlled by an Adept MotionBlox. * @@ -42,17 +38,17 @@ #ifndef vpRobotViper650_h #define vpRobotViper650_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_VIPER650 #include <iostream> #include <stdio.h> -#include <visp/vpRobot.h> -#include <visp/vpColVector.h> -#include <visp/vpDebug.h> -#include <visp/vpViper650.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpDebug.h> +#include <visp3/robot/vpViper650.h> // low level controller api extern "C" { @@ -64,7 +60,7 @@ extern "C" { /*! \class vpRobotViper650 - \ingroup Viper RobotDriver + \ingroup group_robot_real_arm \brief Control of Irisa's Viper S650 robot named Viper650. @@ -96,8 +92,8 @@ extern "C" { class by calling the default constructor: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> int main() { @@ -114,8 +110,8 @@ int main() distortion you need to initialize the robot with: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> int main() { @@ -134,15 +130,15 @@ int main() acquired by the camera attached to the robot, with: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpCameraParameters.h> int main() { -#if defined(VISP_HAVE_VIPER650) && defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_VIPER650) && defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vp1394TwoGrabber g; g.acquire(I); @@ -164,10 +160,10 @@ int main() frame like here in the joint space: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -198,10 +194,10 @@ int main() velocity used to reach the desired position. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -230,10 +226,10 @@ int main() space: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -387,6 +383,13 @@ public: /* Methode publiques */ void init (vpViper650::vpToolType tool, vpCameraParameters::vpCameraParametersProjType projModel = vpCameraParameters::perspectiveProjWithoutDistortion); + void init (vpViper650::vpToolType tool, + const std::string &filename); + void init (vpViper650::vpToolType tool, + const vpHomogeneousMatrix &eMc_); + + void set_eMc(const vpHomogeneousMatrix &eMc_); + void set_eMc(const vpTranslationVector &etc_, const vpRxyzVector &erc_); void move(const char *filename); diff --git a/src/robot/real-robot/viper/vpRobotViper850.h b/modules/robot/include/visp3/robot/vpRobotViper850.h similarity index 90% rename from src/robot/real-robot/viper/vpRobotViper850.h rename to modules/robot/include/visp3/robot/vpRobotViper850.h index 5d5d7d006fedcd9a31d15fdd8bc5e5e5b261051d..5345587cc854432c255ea0e88d60f5db0cf53a43 100644 --- a/src/robot/real-robot/viper/vpRobotViper850.h +++ b/modules/robot/include/visp3/robot/vpRobotViper850.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotViper850.h 4594 2014-01-20 15:08:07Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Irisa's Viper S850 robot controlled by an Adept MotionBlox. * @@ -42,17 +38,17 @@ #ifndef vpRobotViper850_h #define vpRobotViper850_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_VIPER850 #include <iostream> #include <stdio.h> -#include <visp/vpRobot.h> -#include <visp/vpColVector.h> -#include <visp/vpDebug.h> -#include <visp/vpViper850.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpDebug.h> +#include <visp3/robot/vpViper850.h> // low level controller api extern "C" { @@ -64,7 +60,7 @@ extern "C" { /*! \class vpRobotViper850 - \ingroup Viper RobotDriver + \ingroup group_robot_real_arm \brief Control of Irisa's Viper S850 robot named Viper850. @@ -96,8 +92,8 @@ extern "C" { class by calling the default constructor: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> int main() { @@ -114,8 +110,8 @@ int main() distortion you need to initialize the robot with: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> int main() { @@ -134,15 +130,15 @@ int main() acquired by the camera attached to the robot, with: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpCameraParameters.h> int main() { -#if defined(VISP_HAVE_VIPER850) && defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_VIPER850) && defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vp1394TwoGrabber g; g.acquire(I); @@ -164,10 +160,10 @@ int main() frame like here in the joint space: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -198,10 +194,10 @@ int main() velocity used to reach the desired position. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -230,10 +226,10 @@ int main() space: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { diff --git a/src/robot/simulator-robot/vpRobotWireFrameSimulator.h b/modules/robot/include/visp3/robot/vpRobotWireFrameSimulator.h similarity index 87% rename from src/robot/simulator-robot/vpRobotWireFrameSimulator.h rename to modules/robot/include/visp3/robot/vpRobotWireFrameSimulator.h index 7a4435ecc90fed61dabe41cc688938e2bf35ae55..2b62934e920d8f91af477726e63b5b38f9af7fdb 100644 --- a/src/robot/simulator-robot/vpRobotWireFrameSimulator.h +++ b/modules/robot/include/visp3/robot/vpRobotWireFrameSimulator.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotWireFrameSimulator.h 3530 2012-01-03 10:52:12Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Basic class used to make robot simulators. * @@ -47,11 +43,10 @@ \brief Basic class used to make robot simulators. */ -#include <visp/vpConfig.h> - +#include <visp3/core/vpConfig.h> +#if defined(VISP_HAVE_MODULE_GUI) && (defined(_WIN32) || defined(VISP_HAVE_PTHREAD)) -#if defined(_WIN32) || defined(VISP_HAVE_PTHREAD) #include <cmath> // std::fabs #include <limits> // numeric_limits #if defined(_WIN32) @@ -60,19 +55,19 @@ # include <pthread.h> #endif -#include <visp/vpWireFrameSimulator.h> -#include <visp/vpRobot.h> -#include <visp/vpRobotSimulator.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayD3D.h> +#include <visp3/robot/vpWireFrameSimulator.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/robot/vpRobotSimulator.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayD3D.h> /*! \class vpRobotWireFrameSimulator - \ingroup RobotSimuWithVisu + \ingroup group_robot_simu_gantry group_robot_simu_arm \brief This class aims to be a basis used to create all the simulators of robots. @@ -175,6 +170,32 @@ class VISP_EXPORT vpRobotWireFrameSimulator : protected vpWireFrameSimulator, pu bool verbose_; +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpRobotWireFrameSimulator(const vpRobotWireFrameSimulator &) +// : vpWireFrameSimulator(), vpRobotSimulator(), +// I(), tcur(0), tprev(0), robotArms(NULL), size_fMi(8), fMi(NULL), artCoord(), artVel(), velocity(), +// #if defined(_WIN32) +// #elif defined(VISP_HAVE_PTHREAD) +// thread(), attr(), +// #endif +// mutex_fMi(), mutex_artVel(), mutex_artCoord(), mutex_velocity(), mutex_display(), +// displayBusy(false), robotStop(false), jointLimit(false), jointLimitArt(false), singularityManagement(true), +// cameraParam(), +// #if defined(VISP_HAVE_DISPLAY) +// display(), +// #endif +// displayType(MODEL_3D), displayAllowed(true), constantSamplingTimeMode(false), +// setVelocityCalled(false), verbose_(false) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpRobotWireFrameSimulator &operator=(const vpRobotWireFrameSimulator &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: vpRobotWireFrameSimulator(); vpRobotWireFrameSimulator(bool display); @@ -296,13 +317,13 @@ class VISP_EXPORT vpRobotWireFrameSimulator : protected vpWireFrameSimulator, pu \param delta_t : Sampling time in second used to compute the robot displacement from the velocity applied to the robot during this time. - Since the wireframe simulator is threaded, the sampling time is set to vpTime::minTimeForUsleepCall / 1000 seconds. + Since the wireframe simulator is threaded, the sampling time is set to vpTime::getMinTimeForUsleepCall() / 1000 seconds. */ inline void setSamplingTime(const double &delta_t) { - if(delta_t < static_cast<float>(vpTime::minTimeForUsleepCall * 1e-3)){ - this->delta_t_ = static_cast<float>(vpTime::minTimeForUsleepCall * 1e-3); + if(delta_t < static_cast<float>(vpTime::getMinTimeForUsleepCall() * 1e-3)){ + this->delta_t_ = static_cast<float>(vpTime::getMinTimeForUsleepCall() * 1e-3); } else { this->delta_t_ = delta_t; } @@ -449,5 +470,4 @@ class VISP_EXPORT vpRobotWireFrameSimulator : protected vpWireFrameSimulator, pu }; #endif - #endif diff --git a/src/robot/real-robot/afma4/vpServolens.h b/modules/robot/include/visp3/robot/vpServolens.h similarity index 87% rename from src/robot/real-robot/afma4/vpServolens.h rename to modules/robot/include/visp3/robot/vpServolens.h index fcf4e64a2739255d62a2af30f29cddfc420c1d59..66aa1d5a3970c4d0c143850b7f17b4eb3abe93b4 100644 --- a/src/robot/real-robot/afma4/vpServolens.h +++ b/modules/robot/include/visp3/robot/vpServolens.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpServolens.h 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Servolens lens attached to the camera fixed on the * Afma4 robot. @@ -43,7 +39,7 @@ #ifndef __vpServolens_h #define __vpServolens_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) @@ -56,14 +52,14 @@ */ -#include <visp/vpCameraParameters.h> -#include <visp/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpImage.h> /*! \class vpServolens - \ingroup Afma4 RobotDriver + \ingroup group_robot_real_cylindrical \brief Interface for the Servolens lens attached to the camera fixed on the Afma4 robot. @@ -73,7 +69,7 @@ \code #include <iostream> -#include <visp/vpServolens.h> +#include <visp3/vs/vpServolens.h> int main() { diff --git a/src/robot/simulator-robot/vpSimulatorAfma6.h b/modules/robot/include/visp3/robot/vpSimulatorAfma6.h similarity index 92% rename from src/robot/simulator-robot/vpSimulatorAfma6.h rename to modules/robot/include/visp3/robot/vpSimulatorAfma6.h index c2e86813539d2f8938dff97e73d974f2f260ddee..8aaba8785b6141b6cd624d711619ebbc22f3858c 100644 --- a/src/robot/simulator-robot/vpSimulatorAfma6.h +++ b/modules/robot/include/visp3/robot/vpSimulatorAfma6.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulatorAfma6.h 2598 2010-06-02 09:20:22Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Class which provides a simulator for the robot Afma6. * @@ -47,18 +43,17 @@ \brief Class which provides a simulator for the robot Afma6. */ -#include <visp/vpRobotWireFrameSimulator.h> -#include <visp/vpAfma6.h> +#include <visp3/robot/vpRobotWireFrameSimulator.h> +#include <visp3/robot/vpAfma6.h> #include <string> -#if defined(_WIN32) || defined(VISP_HAVE_PTHREAD) +#if defined(VISP_HAVE_MODULE_GUI) && (defined(_WIN32) || defined(VISP_HAVE_PTHREAD)) /*! \class vpSimulatorAfma6 - \ingroup Afma6 RobotSimuWithVisu - + \ingroup group_robot_simu_gantry \brief Simulator of Irisa's gantry robot named Afma6. @@ -90,10 +85,10 @@ frame like here in the joint space: \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorAfma6.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorAfma6.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -127,10 +122,10 @@ int main() space: \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorAfma6.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorAfma6.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { diff --git a/src/robot/simulator-robot/vpSimulatorCamera.h b/modules/robot/include/visp3/robot/vpSimulatorCamera.h similarity index 87% rename from src/robot/simulator-robot/vpSimulatorCamera.h rename to modules/robot/include/visp3/robot/vpSimulatorCamera.h index 70f22cf6254fde534a0d37f79ad443e6635463f9..df55824e566ca3e7f7afd1277adf5db696cc9075 100644 --- a/src/robot/simulator-robot/vpSimulatorCamera.h +++ b/modules/robot/include/visp3/robot/vpSimulatorCamera.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulatorCamera.h 2456 2010-01-07 10:33:12Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Defines the simplest robot : a free flying camera. * @@ -48,16 +44,16 @@ \brief class that defines the simplest robot : a free flying camera */ -#include <visp/vpColVector.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMatrix.h> -#include <visp/vpRobot.h> -#include <visp/vpRobotSimulator.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/robot/vpRobotSimulator.h> /*! \class vpSimulatorCamera - \ingroup RobotSimuWithoutVisu + \ingroup group_robot_simu_Camera \brief Class that defines the simplest robot: a free flying camera. @@ -76,7 +72,7 @@ The following code shows how to control this robot in position and velocity. \code -#include <visp/vpSimulatorCamera.h> +#include <visp3/robot/vpSimulatorCamera.h> int main() { @@ -120,6 +116,7 @@ public: void get_cVe(vpVelocityTwistMatrix &cVe) const; void get_eJe(vpMatrix &eJe); + vpHomogeneousMatrix getPosition() const; void getPosition(vpHomogeneousMatrix &wMc) const; void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &q); void setPosition(const vpHomogeneousMatrix &wMc); diff --git a/src/robot/simulator-robot/vpSimulatorPioneer.h b/modules/robot/include/visp3/robot/vpSimulatorPioneer.h similarity index 85% rename from src/robot/simulator-robot/vpSimulatorPioneer.h rename to modules/robot/include/visp3/robot/vpSimulatorPioneer.h index 1357e2b72ec0ef148e537c1a5fdbc38ee8803370..ca231740eda90f3d36ec4535c9a99ffeeb650594 100644 --- a/src/robot/simulator-robot/vpSimulatorPioneer.h +++ b/modules/robot/include/visp3/robot/vpSimulatorPioneer.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulatorPioneer.h 2456 2010-01-07 10:33:12Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pioneer mobile robot simulator without display. * @@ -48,17 +44,17 @@ \brief class that defines the Pioneer mobile robot simulator equipped with a static camera. */ -#include <visp/vpColVector.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMatrix.h> -#include <visp/vpPioneer.h> -#include <visp/vpRobot.h> -#include <visp/vpRobotSimulator.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/robot/vpPioneer.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/robot/vpRobotSimulator.h> /*! \class vpSimulatorPioneer - \ingroup RobotSimuWithoutVisu + \ingroup group_robot_simu_unicycle \brief Class that defines the Pioneer mobile robot simulator equipped with a static camera. @@ -74,7 +70,7 @@ The following code shows how to control this robot in position and velocity. \code -#include <visp/vpSimulatorPioneer.h> +#include <visp3/robot/vpSimulatorPioneer.h> int main() { diff --git a/src/robot/simulator-robot/vpSimulatorPioneerPan.h b/modules/robot/include/visp3/robot/vpSimulatorPioneerPan.h similarity index 86% rename from src/robot/simulator-robot/vpSimulatorPioneerPan.h rename to modules/robot/include/visp3/robot/vpSimulatorPioneerPan.h index d01e5d591d86b577dfdfeff6a3d4b767f1f7a86e..d0f290fb53e51ac50ab8b46bf6b728792bba4d23 100644 --- a/src/robot/simulator-robot/vpSimulatorPioneerPan.h +++ b/modules/robot/include/visp3/robot/vpSimulatorPioneerPan.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulatorPioneerPan.h 2456 2010-01-07 10:33:12Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pioneer mobile robot equipped with a pan head simulator without display. * @@ -49,17 +45,17 @@ with a camera able to move in pan. */ -#include <visp/vpColVector.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMatrix.h> -#include <visp/vpPioneerPan.h> -#include <visp/vpRobot.h> -#include <visp/vpRobotSimulator.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/robot/vpPioneerPan.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/robot/vpRobotSimulator.h> /*! \class vpSimulatorPioneerPan - \ingroup RobotSimuWithoutVisu + \ingroup group_robot_simu_unicycle \brief Class that defines the Pioneer mobile robot simulator equipped with a camera able to move in pan. @@ -76,7 +72,7 @@ The following code shows how to control this robot in position and velocity. \code -#include <visp/vpSimulatorPioneerPan.h> +#include <visp3/robot/vpSimulatorPioneerPan.h> int main() { diff --git a/src/robot/simulator-robot/vpSimulatorViper850.h b/modules/robot/include/visp3/robot/vpSimulatorViper850.h similarity index 91% rename from src/robot/simulator-robot/vpSimulatorViper850.h rename to modules/robot/include/visp3/robot/vpSimulatorViper850.h index 6cccdcacb49564c9110c45b8833729d86a707d79..cda80e110f5e1efc53814cda992333880f5dddf0 100644 --- a/src/robot/simulator-robot/vpSimulatorViper850.h +++ b/modules/robot/include/visp3/robot/vpSimulatorViper850.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulatorViper850.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Class which provides a simulator for the robot Viper850. * @@ -47,17 +43,17 @@ \brief Class which provides a simulator for the robot Viper850.. */ +#include <visp3/robot/vpRobotWireFrameSimulator.h> +#if defined(VISP_HAVE_MODULE_GUI) && (defined(_WIN32) || defined(VISP_HAVE_PTHREAD)) - -#include <visp/vpRobotWireFrameSimulator.h> -#include <visp/vpViper850.h> #include <string> -#if defined(_WIN32) || defined(VISP_HAVE_PTHREAD) + +#include <visp3/robot/vpViper850.h> /*! \class vpSimulatorViper850 - \ingroup Viper RobotSimuWithVisu + \ingroup group_robot_simu_arm \brief Simulator of Irisa's Viper S850 robot named Viper850. @@ -88,10 +84,10 @@ frame like here in the joint space: \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorViper850.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorViper850.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -122,10 +118,10 @@ int main() velocity used to reach the desired position. \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorViper850.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorViper850.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -154,10 +150,10 @@ int main() space: \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorViper850.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorViper850.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { diff --git a/src/simulator/wireframe-simulator/core/vpSkipio.h b/modules/robot/include/visp3/robot/vpSkipio.h similarity index 77% rename from src/simulator/wireframe-simulator/core/vpSkipio.h rename to modules/robot/include/visp3/robot/vpSkipio.h index d4d4cc514ba52c4af946f6ef5ae1472b30ffd2e3..c505b13484ebe6b0e1222b3901726dc617e6e133 100644 --- a/src/simulator/wireframe-simulator/core/vpSkipio.h +++ b/modules/robot/include/visp3/robot/vpSkipio.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSkipio.h 5284 2015-02-09 14:24:10Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Le module "skipio.c" contient les procedures d'analyse * syntaxique du fichier "source" qui permettent de traiter @@ -44,7 +40,7 @@ #ifndef vpSkipio_h #define vpSkipio_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/simulator/wireframe-simulator/core/vpTmstack.h b/modules/robot/include/visp3/robot/vpTmstack.h old mode 100755 new mode 100644 similarity index 81% rename from src/simulator/wireframe-simulator/core/vpTmstack.h rename to modules/robot/include/visp3/robot/vpTmstack.h index af03b7293e8877e9fb7b59db3f8219be0d2670a5..251abf5cde00f56690d85d69030b70adc11b1836 --- a/src/simulator/wireframe-simulator/core/vpTmstack.h +++ b/modules/robot/include/visp3/robot/vpTmstack.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpTmstack.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Le module "tmstack.h" contient les macros, les types et * les specifications des procedures de gestion de la pile @@ -43,7 +39,7 @@ #ifndef vpTmstack_h #define vpTmstack_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/simulator/wireframe-simulator/core/vpToken.h b/modules/robot/include/visp3/robot/vpToken.h old mode 100755 new mode 100644 similarity index 84% rename from src/simulator/wireframe-simulator/core/vpToken.h rename to modules/robot/include/visp3/robot/vpToken.h index e7c251d94edbcbc2b9d87f1205a00f2007075a7a..1f8bf6d00677a6b96a901d4a259909ac7ee318ce --- a/src/simulator/wireframe-simulator/core/vpToken.h +++ b/modules/robot/include/visp3/robot/vpToken.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpToken.h 5284 2015-02-09 14:24:10Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Le module "token.h" contient les Macros et les Types * des jetons de l'analyseur lexicale . @@ -42,7 +38,7 @@ #ifndef vpToken_H #define vpToken_H -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/robot/real-robot/pioneer/vpUnicycle.h b/modules/robot/include/visp3/robot/vpUnicycle.h similarity index 87% rename from src/robot/real-robot/pioneer/vpUnicycle.h rename to modules/robot/include/visp3/robot/vpUnicycle.h index eb4328da9e7404a270150a7ac5e708a535fc009b..821dd5ae6502880a8c5d292c9caf7ac848c65f61 100644 --- a/src/robot/real-robot/pioneer/vpUnicycle.h +++ b/modules/robot/include/visp3/robot/vpUnicycle.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpUnicycle.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Common features for unicycle mobile robots. * @@ -41,16 +37,16 @@ #ifndef VPUNICYCLE_H #define VPUNICYCLE_H -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpVelocityTwistMatrix.h> /*! \class vpUnicycle - \ingroup Pioneer + \ingroup group_robot_simu_unicycle \brief Generic functions for unicycle mobile robots. diff --git a/src/simulator/wireframe-simulator/core/vpView.h b/modules/robot/include/visp3/robot/vpView.h old mode 100755 new mode 100644 similarity index 91% rename from src/simulator/wireframe-simulator/core/vpView.h rename to modules/robot/include/visp3/robot/vpView.h index 8f95d20e4943d5d44b1b8952a07df80b5922856a..7ef929830fad172befd148b6b3c00490418af2c6 --- a/src/simulator/wireframe-simulator/core/vpView.h +++ b/modules/robot/include/visp3/robot/vpView.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpView.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Le module "view.h" contient les Macros et les types * des parametres de visualisation et de transformation 3D. @@ -43,7 +39,7 @@ #ifndef vpView_H #define vpView_H -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/robot/real-robot/viper/vpViper.h b/modules/robot/include/visp3/robot/vpViper.h similarity index 87% rename from src/robot/real-robot/viper/vpViper.h rename to modules/robot/include/visp3/robot/vpViper.h index e67984c63f60b7f2c3017ed355cdd88a1cfb3a7a..465878332df45fa56016853ad71c42ec36ecb7f4 100644 --- a/src/robot/real-robot/viper/vpViper.h +++ b/modules/robot/include/visp3/robot/vpViper.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpViper.h 4620 2014-01-27 21:28:32Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for a generic ADEPT Viper (either 650 or 850) robot. * @@ -50,18 +46,18 @@ */ -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpRobotException.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/robot/vpRobotException.h> /*! \class vpViper - \ingroup Viper + \ingroup group_robot_real_arm group_robot_simu_arm \brief Modelisation of the ADEPT Viper robot @@ -130,6 +126,9 @@ class VISP_EXPORT vpViper void get_fJe(const vpColVector &q, vpMatrix &fJe) const; void get_eJe(const vpColVector &q, vpMatrix &eJe) const; + virtual void set_eMc(const vpHomogeneousMatrix &eMc_); + virtual void set_eMc(const vpTranslationVector &etc_, const vpRxyzVector &erc_); + friend VISP_EXPORT std::ostream & operator << (std::ostream & os, const vpViper & viper); vpColVector getJointMin() const; diff --git a/src/robot/real-robot/viper/vpViper650.h b/modules/robot/include/visp3/robot/vpViper650.h similarity index 87% rename from src/robot/real-robot/viper/vpViper650.h rename to modules/robot/include/visp3/robot/vpViper650.h index b19a7aaa439736f5b0cd994f2a11926afbdc1732..0d38a5ab6b73cae218209940c133694baa7b4804 100644 --- a/src/robot/real-robot/viper/vpViper650.h +++ b/modules/robot/include/visp3/robot/vpViper650.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpViper650.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the ADEPT Viper 650 robot. * @@ -54,13 +50,13 @@ \class vpViper650 - \ingroup Viper + \ingroup group_robot_real_arm \brief Modelisation of the ADEPT Viper 650 robot. */ -#include <visp/vpViper.h> +#include <visp3/robot/vpViper.h> class VISP_EXPORT vpViper650: public vpViper @@ -92,7 +88,8 @@ class VISP_EXPORT vpViper650: public vpViper TOOL_MARLIN_F033C_CAMERA, /*!< Marlin F033C camera. */ TOOL_PTGREY_FLEA2_CAMERA, /*!< Point Grey Flea 2 camera. */ TOOL_SCHUNK_GRIPPER_CAMERA, /*!< Camera attached to the Schunk gripper. */ - TOOL_GENERIC_CAMERA /*!< A generic camera. */ + TOOL_GENERIC_CAMERA, /*!< A generic camera. */ + TOOL_CUSTOM /*!< A user defined tool. */ } vpToolType; //! Default tool attached to the robot end effector @@ -108,6 +105,10 @@ class VISP_EXPORT vpViper650: public vpViper void init (vpViper650::vpToolType tool, vpCameraParameters::vpCameraParametersProjType projModel = vpCameraParameters::perspectiveProjWithoutDistortion); + void init (vpViper650::vpToolType tool, + const std::string &filename); + void init (vpViper650::vpToolType tool, + const vpHomogeneousMatrix &eMc_); //! Get the current camera model projection type @@ -127,9 +128,7 @@ class VISP_EXPORT vpViper650: public vpViper return tool_current; }; -#ifdef VISP_HAVE_ACCESS_TO_NAS void parseConfigFile (const char * filename); -#endif protected: //! Set the current tool type diff --git a/src/robot/real-robot/viper/vpViper850.h b/modules/robot/include/visp3/robot/vpViper850.h similarity index 91% rename from src/robot/real-robot/viper/vpViper850.h rename to modules/robot/include/visp3/robot/vpViper850.h index 8418cf0efa3239e1ec2a5e56e4ecf61b330f20e7..cd266c6ea4cc6b35621013341b452d4c166aae37 100644 --- a/src/robot/real-robot/viper/vpViper850.h +++ b/modules/robot/include/visp3/robot/vpViper850.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpViper850.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the ADEPT Viper 850 robot. * @@ -54,13 +50,13 @@ \class vpViper850 - \ingroup Viper + \ingroup group_robot_real_arm group_robot_simu_arm \brief Modelisation of the ADEPT Viper 850 robot. */ -#include <visp/vpViper.h> +#include <visp3/robot/vpViper.h> class VISP_EXPORT vpViper850: public vpViper diff --git a/src/simulator/wireframe-simulator/core/vpVwstack.h b/modules/robot/include/visp3/robot/vpVwstack.h old mode 100755 new mode 100644 similarity index 79% rename from src/simulator/wireframe-simulator/core/vpVwstack.h rename to modules/robot/include/visp3/robot/vpVwstack.h index 83f2f74d4c3676030384df1e59b3b8a1a35661a1..f08385b7f0f9aa43a70e6d98916db327ad2c7378 --- a/src/simulator/wireframe-simulator/core/vpVwstack.h +++ b/modules/robot/include/visp3/robot/vpVwstack.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpVwstack.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Le module "vwstack.h" contient les macros, les types et * les specifications des procedures de gestion de la pile @@ -44,7 +40,7 @@ #ifndef vpVwstack_H #define vpVwstack_H -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/simulator/wireframe-simulator/vpWireFrameSimulator.h b/modules/robot/include/visp3/robot/vpWireFrameSimulator.h similarity index 87% rename from src/simulator/wireframe-simulator/vpWireFrameSimulator.h rename to modules/robot/include/visp3/robot/vpWireFrameSimulator.h index 4c30224d5e8250fb67f737fdd0ca7afa36914a52..234430ae5f09a8415808f94e95597ef679fceb4e 100644 --- a/src/simulator/wireframe-simulator/vpWireFrameSimulator.h +++ b/modules/robot/include/visp3/robot/vpWireFrameSimulator.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpWireFrameSimulator.h 5297 2015-02-10 11:19:24Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Wire frame simulator * @@ -47,7 +43,7 @@ \file vpWireFrameSimulator.h \brief Implementation of a wire frame simulator. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <stdio.h> #include <iostream> #include <cmath> // std::fabs @@ -55,15 +51,15 @@ #include <list> #include <string> -#include <visp/vpMy.h> -#include <visp/vpArit.h> -#include <visp/vpBound.h> -#include <visp/vpView.h> -#include <visp/vpToken.h> -#include <visp/vpTmstack.h> -#include <visp/vpVwstack.h> -#include <visp/vpRfstack.h> -#include <visp/vpArit.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> +#include <visp3/robot/vpBound.h> +#include <visp3/robot/vpView.h> +#include <visp3/robot/vpToken.h> +#include <visp3/robot/vpTmstack.h> +#include <visp3/robot/vpVwstack.h> +#include <visp3/robot/vpRfstack.h> +#include <visp3/robot/vpArit.h> void open_display(); void close_display(); @@ -85,15 +81,15 @@ void set_Bound_face_display (Bound *bp, Byte b); void point_3D_2D (Point3f *p3, Index size, int xsize, int ysize, Point2i *p2); void wireframe_Face (Face *fp, Point2i *pp); -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpDisplay.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpDisplay.h> #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -# include <visp/vpList.h> +# include <visp3/core/vpList.h> #endif -#include <visp/vpImagePoint.h> -#include <visp/vpImageSimulator.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/robot/vpImageSimulator.h> void set_scene (const char*, Bound_scene *, float); void vp2jlc_matrix (const vpHomogeneousMatrix, Matrix&); @@ -102,8 +98,8 @@ void vp2jlc_matrix (const vpHomogeneousMatrix, Matrix&); /*! \class vpWireFrameSimulator - \ingroup RobotSimuWithViz - + \ingroup group_robot_simu_gantry group_robot_simu_arm + \brief Implementation of a wire frame simulator. Compared to the vpSimulator class, it does not require third party libraries to be used. @@ -140,8 +136,8 @@ void vp2jlc_matrix (const vpHomogeneousMatrix, Matrix&); \code - #include <visp/vpImage.h> - #include <visp/vpWireFrameSimulator.h> + #include <visp3/core/vpImage.h> + #include <visp3/robot/vpWireFrameSimulator.h> int main() { @@ -569,53 +565,6 @@ protected: vpImagePoint projectCameraTrajectory (const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpHomogeneousMatrix &fMo); vpImagePoint projectCameraTrajectory (const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, const vpHomogeneousMatrix &fMo, const vpHomogeneousMatrix &cMf); vpImagePoint projectCameraTrajectory (const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpHomogeneousMatrix &fMo, const vpHomogeneousMatrix &cMf); - -public: - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated functions - */ - - vp_deprecated void displayTrajectory(const vpImage<unsigned char> &I, vpList<vpHomogeneousMatrix> &list_cMo, vpList<vpHomogeneousMatrix> &list_fMo, vpHomogeneousMatrix camMf); - vp_deprecated void displayTrajectory(const vpImage<vpRGBa> &I, vpList<vpHomogeneousMatrix> &list_cMo, vpList<vpHomogeneousMatrix> &list_fMo, vpHomogeneousMatrix camMf); - - /*! - \deprecated This method is deprecated. You should use - get_cMo_History(std::list<vpHomogeneousMatrix> &) instead. \n \n - Get the homogeneous matrices cMo stored to display the camera trajectory. - - \return Returns the list of the homogeneous matrices cMo. - */ - vp_deprecated vpList<vpHomogeneousMatrix> get_cMo_History () { - vpList<vpHomogeneousMatrix> list_cMo; - vpHomogeneousMatrix tmp_; - for(std::list<vpHomogeneousMatrix>::const_iterator it=poseList.begin(); it!=poseList.end(); ++it){ - tmp_ = (rotz*(*it)); - list_cMo.addRight(tmp_); - } - return list_cMo;} - /*! - \deprecated This method is deprecated. You should use - get_fMo_History(std::list<vpHomogeneousMatrix> &) instead. \n \n - Get the homogeneous matrices fMo stored to display the camera trajectory. - - \return Returns the list of the homogeneous matrices fMo. - */ - vp_deprecated vpList<vpHomogeneousMatrix> get_fMo_History () { - vpList<vpHomogeneousMatrix> fMoHistory; - for(std::list<vpHomogeneousMatrix>::const_iterator iter = fMoList.begin(); iter != fMoList.end(); ++iter){ - fMoHistory.addRight(*iter); - } - return fMoHistory;} - - - vp_deprecated void initScene(vpSceneObject obj, vpSceneDesiredObject desiredObject, vpList<vpImageSimulator> &imObj); - vp_deprecated void initScene(const char* obj, const char* desiredObject, vpList<vpImageSimulator> &imObj); - vp_deprecated void initScene(vpSceneObject obj, vpList<vpImageSimulator> &imObj); - vp_deprecated void initScene(const char* obj, vpList<vpImageSimulator> &imObj); - -#endif }; #endif diff --git a/src/simulator/image-simulator/vpImageSimulator.cpp b/modules/robot/src/image-simulator/vpImageSimulator.cpp similarity index 78% rename from src/simulator/image-simulator/vpImageSimulator.cpp rename to modules/robot/src/image-simulator/vpImageSimulator.cpp index 462a2c7371dfad622beee8e76b79ef2ea30ffd83..56594cc276b3fab6bfad0571f6d734917c97c82a 100644 --- a/src/simulator/image-simulator/vpImageSimulator.cpp +++ b/modules/robot/src/image-simulator/vpImageSimulator.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPose.h 2453 2010-01-07 10:01:10Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,43 +10,43 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: Class which enables to project an image in the 3D space * and get the view of a virtual camera. * - * * Authors: * Amaury Dame * Nicolas Melchior * *****************************************************************************/ -#include <visp/vpImageSimulator.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpMatrixException.h> -#include <visp/vpMbtPolygon.h> +#include <visp3/robot/vpImageSimulator.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpMatrixException.h> +#include <visp3/core/vpPolygon3D.h> + +#ifdef VISP_HAVE_MODULE_IO +# include <visp3/io/vpImageIo.h> +#endif /*! Basic constructor. @@ -628,428 +626,6 @@ vpImageSimulator::getImage(vpImage<vpRGBa> &I, const vpCameraParameters &cam, } } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated, you should use: - vpImageSimulator::getImage(vpImage<unsigned char> &, - std::list<vpImageSimulator> &, - const vpCameraParameters &) instead. - - Get the view of the virtual camera. Be carefull, the image I is modified. The projected image is not added as an overlay! - - With this method, a list of image is projected into the image. Thus, you have to initialise a list of vpImageSimulator. Then you store them into a vpList. And finally with this method you project them into the image \f$ I \f$. The depth of the 3D scene is managed such as an image in foreground hides an image background. - - - The following example shows how to use the method: - - \code - #include <visp/vpImage.h> - #include <visp/vpImageSimulator.h> - - int main() - { - vpImage<vpRGBa> Icamera(480,640,0); - vpImage<vpRGBa> Iimage(60,60); - - // Initialise the image which will be projected into the image Icamera - vpRGBa colorb(0,0,255); - vpRGBa colorw(255,255,255); - vpRGBa colorr(255,0,0); - for(int i = 0; i < 60; i++) - { - for(int j = 0; j < 20; j++) - Iimage[i][j] = colorb; - for(int j = 20; j < 40; j++) - Iimage[i][j] = colorw; - for(int j = 40; j < 60; j++) - Iimage[i][j] = colorr; - } - - // Initialise the 3D coordinates of the Iimage corners - vpColVector X[4]; - for (int i = 0; i < 4; i++) X[i].resize(3); - // Top left corner - X[0][0] = -1; - X[0][1] = -1; - X[0][2] = 1; - - // Top right corner - X[1][0] = 1; - X[1][1] = -1; - X[1][2] = 1; - - // Bottom right corner - X[2][0] = 1; - X[2][1] = 1; - X[2][2] = 1; - - //Bottom left corner - X[3][0] = -1; - X[3][1] = 1; - X[3][2] = 1; - - vpImageSimulator sim; - sim.init(Iimage, X); - - // Top left corner - X[0][0] = -1; - X[0][1] = -1; - X[0][2] = 1; - - // Top right corner - X[1][0] = 1; - X[1][1] = -1; - X[1][2] = 1; - - // Bottom right corner - X[2][0] = 1; - X[2][1] = 1; - X[2][2] = 1; - - //Bottom left corner - X[3][0] = -1; - X[3][1] = 1; - X[3][2] = 1; - - vpImageSimulator sim2; - sim2.init(Iimage, X); - - sim.setCameraPosition(vpHomogeneousMatrix(0,0,5,vpMath::rad(0),vpMath::rad(30),0)); - sim2.setCameraPosition(vpHomogeneousMatrix(0,0,5,vpMath::rad(0),vpMath::rad(-30),0)); - - vpList<vpImageSimulator> listSim; - listSim.addRight(sim); - listSim.addRight(sim2); - - sim.setCameraPosition(vpHomogeneousMatrix(0,0,5,vpMath::rad(60),vpMath::rad(0),0)); - - vpCameraParameters cam(868.0, 869.0, 320, 240); - - vpImageSimulator::getImage(Icamera,listSim,cam); - - return 0; - } - \endcode - - \param I : The image used to store the result - \param list : List of vpImageSimulator to project - \param cam : The parameters of the virtual camera -*/ -void -vpImageSimulator::getImage(vpImage<unsigned char> &I, - vpList<vpImageSimulator> &list, - const vpCameraParameters &cam) -{ - - unsigned int width = I.getWidth(); - unsigned int height = I.getHeight(); - - unsigned int nbsimList = list.nbElements(); - - if (nbsimList < 1) - return; - - vpImageSimulator** simList = new vpImageSimulator* [nbsimList]; - - double topFinal = height+1;; - double bottomFinal = -1; - double leftFinal = width+1; - double rightFinal = -1; - - list.front(); - - unsigned int unvisible = 0; - for (unsigned int i = 0; i < nbsimList; i++) - { - vpImageSimulator* sim = &(list.value()); - list.next(); - if (sim->visible) - simList[i] = sim; - else - unvisible++; - } - nbsimList = nbsimList - unvisible; - - if (nbsimList < 1) - { - delete[] simList; - return; - } - - - for (unsigned int i = 0; i < nbsimList; i++) - { - if(!simList[i]->needClipping) - simList[i]->getRoi(width,height,cam,simList[i]->pt,simList[i]->rect); - else - simList[i]->getRoi(width,height,cam,simList[i]->ptClipped,simList[i]->rect); - - if (topFinal > simList[i]->rect.getTop()) topFinal = simList[i]->rect.getTop(); - if (bottomFinal < simList[i]->rect.getBottom()) bottomFinal = simList[i]->rect.getBottom(); - if (leftFinal > simList[i]->rect.getLeft()) leftFinal = simList[i]->rect.getLeft(); - if (rightFinal < simList[i]->rect.getRight()) rightFinal = simList[i]->rect.getRight(); - } - - double zmin = -1; - int indice = -1; - unsigned char *bitmap = I.bitmap; - vpImagePoint ip; - - for (unsigned int i = (unsigned int)topFinal; i < (unsigned int)bottomFinal; i++) - { - for (unsigned int j = (unsigned int)leftFinal; j < (unsigned int)rightFinal; j++) - { - zmin = -1; - double x=0,y=0; - ip.set_ij(i,j); - vpPixelMeterConversion::convertPoint(cam,ip, x,y); - ip.set_ij(y,x); - for (int k = 0; k < (int)nbsimList; k++) - { - double z = 0; - if(simList[k]->getPixelDepth(ip,z)) - { - if (z < zmin || zmin < 0) - { - zmin = z; - indice = k; - } - } - } - if (indice >= 0) - { - if (simList[indice]->colorI == GRAY_SCALED) - { - unsigned char Ipixelplan = 255; - simList[indice]->getPixel(ip,Ipixelplan); - *(bitmap+i*width+j)=Ipixelplan; - } - else if (simList[indice]->colorI == COLORED) - { - vpRGBa Ipixelplan(255,255,255); - simList[indice]->getPixel(ip,Ipixelplan); - unsigned char pixelgrey = (unsigned char)(0.2126 * Ipixelplan.R + 0.7152 * Ipixelplan.G + 0.0722 * Ipixelplan.B); - *(bitmap+i*width+j)=pixelgrey; - } - } - } - } - - delete[] simList; -} - - -/*! - \deprecated This method is deprecated, you should use: - vpImageSimulator::getImage(vpImage<vpRGBa> &, - std::list<vpImageSimulator> &, - const vpCameraParameters &) instead. - - Get the view of the virtual camera. Be carefull, the image I is modified. The projected image is not added as an overlay! - - With this method, a list of image is projected into the image. Thus, you have to initialise a list of vpImageSimulator. Then you store them into a vpList. And finally with this method you project them into the image \f$ I \f$. The depth of the 3D scene is managed such as an image in foreground hides an image background. - - The following example shows how to use the method: - - \code - #include <visp/vpImage.h> - #include <visp/vpImageSimulator.h> - - int main() - { - vpImage<vpRGBa> Icamera(480,640,0); - vpImage<vpRGBa> Iimage(60,60); - - // Initialise the image which will be projected into the image Icamera - vpRGBa colorb(0,0,255); - vpRGBa colorw(255,255,255); - vpRGBa colorr(255,0,0); - for(int i = 0; i < 60; i++) - { - for(int j = 0; j < 20; j++) - Iimage[i][j] = colorb; - for(int j = 20; j < 40; j++) - Iimage[i][j] = colorw; - for(int j = 40; j < 60; j++) - Iimage[i][j] = colorr; - } - - // Initialise the 3D coordinates of the Iimage corners - vpColVector X[4]; - for (int i = 0; i < 4; i++) X[i].resize(3); - // Top left corner - X[0][0] = -1; - X[0][1] = -1; - X[0][2] = 1; - - // Top right corner - X[1][0] = 1; - X[1][1] = -1; - X[1][2] = 1; - - // Bottom right corner - X[2][0] = 1; - X[2][1] = 1; - X[2][2] = 1; - - //Bottom left corner - X[3][0] = -1; - X[3][1] = 1; - X[3][2] = 1; - - vpImageSimulator sim; - sim.init(Iimage, X); - - // Top left corner - X[0][0] = -1; - X[0][1] = -1; - X[0][2] = 1; - - // Top right corner - X[1][0] = 1; - X[1][1] = -1; - X[1][2] = 1; - - // Bottom right corner - X[2][0] = 1; - X[2][1] = 1; - X[2][2] = 1; - - //Bottom left corner - X[3][0] = -1; - X[3][1] = 1; - X[3][2] = 1; - - vpImageSimulator sim2; - sim2.init(Iimage, X); - - sim.setCameraPosition(vpHomogeneousMatrix(0,0,5,vpMath::rad(0),vpMath::rad(30),0)); - sim2.setCameraPosition(vpHomogeneousMatrix(0,0,5,vpMath::rad(0),vpMath::rad(-30),0)); - - vpList<vpImageSimulator> listSim; - listSim.addRight(sim); - listSim.addRight(sim2); - - sim.setCameraPosition(vpHomogeneousMatrix(0,0,5,vpMath::rad(60),vpMath::rad(0),0)); - - vpCameraParameters cam(868.0, 869.0, 320, 240); - - vpImageSimulator::getImage(Icamera,listSim,cam); - - return 0; - } - \endcode - - \param I : The image used to store the result - \param list : List of vpImageSimulator to project - \param cam : The parameters of the virtual camera -*/ -void -vpImageSimulator::getImage(vpImage<vpRGBa> &I, vpList<vpImageSimulator> &list, - const vpCameraParameters &cam) -{ - - unsigned int width = I.getWidth(); - unsigned int height = I.getHeight(); - - unsigned int nbsimList = list.nbElements(); - - if (nbsimList < 1) - return; - - vpImageSimulator** simList = new vpImageSimulator* [nbsimList]; - - double topFinal = height+1;; - double bottomFinal = -1; - double leftFinal = width+1; - double rightFinal = -1; - - list.front(); - - unsigned int unvisible = 0; - for (unsigned int i = 0; i < nbsimList; i++) - { - vpImageSimulator* sim = &(list.value()); - list.next(); - if (sim->visible) - simList[i] = sim; - else - unvisible++; - } - nbsimList = nbsimList - unvisible; - - if (nbsimList < 1) - { - delete[] simList; - return; - } - - for (unsigned int i = 0; i < nbsimList; i++) - { - if(!simList[i]->needClipping) - simList[i]->getRoi(width,height,cam,simList[i]->pt,simList[i]->rect); - else - simList[i]->getRoi(width,height,cam,simList[i]->ptClipped,simList[i]->rect); - - if (topFinal > simList[i]->rect.getTop()) topFinal = simList[i]->rect.getTop(); - if (bottomFinal < simList[i]->rect.getBottom()) bottomFinal = simList[i]->rect.getBottom(); - if (leftFinal > simList[i]->rect.getLeft()) leftFinal = simList[i]->rect.getLeft(); - if (rightFinal < simList[i]->rect.getRight()) rightFinal = simList[i]->rect.getRight(); - } - - double zmin = -1; - int indice = -1; - vpRGBa *bitmap = I.bitmap; - vpImagePoint ip; - - for (unsigned int i = (unsigned int)topFinal; i < (unsigned int)bottomFinal; i++) - { - for (unsigned int j = (unsigned int)leftFinal; j < (unsigned int)rightFinal; j++) - { - zmin = -1; - double x=0,y=0; - ip.set_ij(i,j); - vpPixelMeterConversion::convertPoint(cam,ip, x,y); - ip.set_ij(y,x); - for (int k = 0; k < (int)nbsimList; k++) - { - double z = 0; - if(simList[k]->getPixelDepth(ip,z)) - { - if (z < zmin || zmin < 0) - { - zmin = z; - indice = k; - } - } - } - if (indice >= 0) - { - if (simList[indice]->colorI == GRAY_SCALED) - { - unsigned char Ipixelplan = 255; - simList[indice]->getPixel(ip,Ipixelplan); - vpRGBa pixelcolor; - pixelcolor.R = Ipixelplan; - pixelcolor.G = Ipixelplan; - pixelcolor.B = Ipixelplan; - *(bitmap+i*width+j) = pixelcolor; - } - else if (simList[indice]->colorI == COLORED) - { - vpRGBa Ipixelplan(255,255,255); - simList[indice]->getPixel(ip,Ipixelplan); - //unsigned char pixelgrey = 0.2126 * Ipixelplan.R + 0.7152 * Ipixelplan.G + 0.0722 * Ipixelplan.B; - *(bitmap+i*width+j)=Ipixelplan; - } - } - } - } - - delete[] simList; -} -#endif - /*! Get the view of the virtual camera. Be careful, the image I is modified. The projected image is not added as an overlay! With this method, a list of image is projected into the image. Thus, you have to initialise a list of vpImageSimulator. Then you store them into a vpList. And finally with this method you project them into the image \f$ I \f$. The depth of the 3D scene is managed such as an image in foreground hides an image background. @@ -1058,8 +634,8 @@ vpImageSimulator::getImage(vpImage<vpRGBa> &I, vpList<vpImageSimulator> &list, \code #include <list> - #include <visp/vpImage.h> - #include <visp/vpImageSimulator.h> + #include <visp3/core/vpImage.h> + #include <visp3/robot/vpImageSimulator.h> int main() { @@ -1260,8 +836,8 @@ vpImageSimulator::getImage(vpImage<unsigned char> &I, \code #include <list> - #include <visp/vpImage.h> - #include <visp/vpImageSimulator.h> + #include <visp3/core/vpImage.h> + #include <visp3/robot/vpImageSimulator.h> int main() { @@ -1531,7 +1107,7 @@ vpImageSimulator::setCameraPosition(const vpHomogeneousMatrix &cMt_) std::vector<vpPoint> *ptPtr = &pt; if(needClipping){ - vpMbtPolygon::getClippedPolygon(pt,ptClipped,cMt,vpMbtPolygon::NEAR_CLIPPING); + vpPolygon3D::getClippedPolygon(pt,ptClipped,cMt,vpPolygon3D::NEAR_CLIPPING); ptPtr = &ptClipped; } @@ -1611,6 +1187,7 @@ vpImageSimulator::init(const vpImage<vpRGBa> &I,vpColVector* X_) initPlan(X_); } +#ifdef VISP_HAVE_MODULE_IO /*! Initialise the image thanks to an image whose adress is given by \f$ file_image \f$ and a table of vector containing the 3D coordinates of the image's corners. @@ -1631,6 +1208,7 @@ vpImageSimulator::init(const char* file_image,vpColVector* X_) vpImageIo::read(Ic,file_image); initPlan(X_); } +#endif /*! Initialise the image thanks to an image \f$ I \f$ and a table of vector containing the 3D coordinates of the image's corners. @@ -1696,6 +1274,8 @@ vpImageSimulator::init(const vpImage<vpRGBa> &I, const std::vector<vpPoint>& X_) vpImageConvert::convert(I,Ig); initPlan(Xvec); } + +#ifdef VISP_HAVE_MODULE_IO /*! Initialise the image thanks to an image whose adress is given by \f$ file_image \f$ and a table of vector containing the 3D coordinates of the image's corners. @@ -1728,6 +1308,7 @@ vpImageSimulator::init(const char* file_image, const std::vector<vpPoint>& X_) vpImageIo::read(Ic,file_image); initPlan(Xvec); } +#endif bool vpImageSimulator::getPixel(const vpImagePoint &iP, unsigned char &Ipixelplan) diff --git a/src/device/light/vpRingLight.cpp b/modules/robot/src/light/vpRingLight.cpp similarity index 90% rename from src/device/light/vpRingLight.cpp rename to modules/robot/src/light/vpRingLight.cpp index 74a5924c7beea95d1d6d0aecaef7a73294d53e16..da99b928736f38fc353bab3652cea99c06d068c6 100644 --- a/src/device/light/vpRingLight.cpp +++ b/modules/robot/src/light/vpRingLight.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRingLight.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Ring light management. * @@ -40,9 +36,9 @@ *****************************************************************************/ -# include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#ifdef VISP_HAVE_PARPORT +#if defined(VISP_HAVE_MODULE_IO) && defined(VISP_HAVE_PARPORT) # include <sys/types.h> # include <sys/stat.h> @@ -51,9 +47,9 @@ # include <sys/time.h> # include <unistd.h> -# include <visp/vpRingLight.h> -# include <visp/vpDebug.h> -# include <visp/vpTime.h> +# include <visp3/robot/vpRingLight.h> +# include <visp3/core/vpDebug.h> +# include <visp3/core/vpTime.h> /*! \file vpRingLight.cpp @@ -226,4 +222,7 @@ void vpRingLight::off() parport.sendData(data); } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpRingLight.cpp.o) has no symbols +void dummy_vpRingLight() {}; #endif diff --git a/src/robot/real-robot/afma4/vpAfma4.cpp b/modules/robot/src/real-robot/afma4/vpAfma4.cpp similarity index 96% rename from src/robot/real-robot/afma4/vpAfma4.cpp rename to modules/robot/src/real-robot/afma4/vpAfma4.cpp index 32ee3c9d46e13d21a6e3a6c2f0189823b27cf06c..8555751cc8a01273906e57e6974a8c3f190f9e76 100644 --- a/src/robot/real-robot/afma4/vpAfma4.cpp +++ b/modules/robot/src/real-robot/afma4/vpAfma4.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpAfma4.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Irisa's Afma4 robot. * @@ -47,14 +43,14 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpRobotException.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpAfma4.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/robot/vpAfma4.h> /* ----------------------------------------------------------------------- */ diff --git a/src/robot/real-robot/afma4/vpRobotAfma4.cpp b/modules/robot/src/real-robot/afma4/vpRobotAfma4.cpp similarity index 98% rename from src/robot/real-robot/afma4/vpRobotAfma4.cpp rename to modules/robot/src/real-robot/afma4/vpRobotAfma4.cpp index 731a35792c5dbda2c03cdd05de36c6593c090dc1..35c7ac94f7e9712c6b88304bec50d4dbf64d0229 100644 --- a/src/robot/real-robot/afma4/vpRobotAfma4.cpp +++ b/modules/robot/src/real-robot/afma4/vpRobotAfma4.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotAfma4.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Irisa's Afma4 robot. * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_AFMA4 @@ -48,12 +44,12 @@ #include <sys/types.h> #include <unistd.h> -#include <visp/vpRobotException.h> -#include <visp/vpExponentialMap.h> -#include <visp/vpDebug.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpThetaUVector.h> -#include <visp/vpRobotAfma4.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpExponentialMap.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/core/vpThetaUVector.h> +#include <visp3/robot/vpRobotAfma4.h> /* ---------------------------------------------------------------------- */ /* --- STATIC ----------------------------------------------------------- */ @@ -1020,7 +1016,7 @@ double vpRobotAfma4::getTime() const - in reference frame, a 6 dimension vector, the first 3 values correspond to the translation tx, ty, tz in meters (like a vpTranslationVector), and the last 3 values to the rx, ry, rz rotation (like a vpRxyzVector). The code - below show how to convert this position into a vpHomogenousMatrix: + below show how to convert this position into a vpHomogeneousMatrix: \param timestamp : Time in second since last robot power on. @@ -1041,7 +1037,7 @@ double vpRobotAfma4::getTime() const // Create a rotation matrix from the Rxyz rotation angles vpRotationMatrix fRc(frc); // reference frame to camera frame rotation matrix - // Create the camera to fix frame pose in terms of a homogenous matrix + // Create the camera to fix frame pose in terms of a homogeneous matrix vpHomogeneousMatrix fMc(fRc, ftc); \endcode @@ -1857,12 +1853,8 @@ vpRobotAfma4::getDisplacement(vpRobot::vpControlFrameType frame, } } - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpRobotAfma4.cpp.o) has no symbols +void dummy_vpRobotAfma4() {}; #endif diff --git a/src/robot/real-robot/afma4/vpServolens.cpp b/modules/robot/src/real-robot/afma4/vpServolens.cpp similarity index 97% rename from src/robot/real-robot/afma4/vpServolens.cpp rename to modules/robot/src/real-robot/afma4/vpServolens.cpp index 1104be29907175fcfadbc2b30b6348d07de054a8..60ba5375173e2ecdd368042228b84907ef82f149 100644 --- a/src/robot/real-robot/afma4/vpServolens.cpp +++ b/modules/robot/src/real-robot/afma4/vpServolens.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpServolens.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Servolens lens attached to the camera fixed on the * Afma4 robot. @@ -60,10 +56,10 @@ #include <stdlib.h> #include <string.h> -#include <visp/vpServolens.h> -#include <visp/vpRobotException.h> -#include <visp/vpDebug.h> -#include <visp/vpTime.h> +#include <visp3/robot/vpServolens.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpTime.h> /*! Default constructor. Does nothing. @@ -627,7 +623,7 @@ vpServolens::getPosition(vpServoType servo, unsigned int &position) const servolens. \code - #include <visp/vpServolens.h> + #include <visp3/vs/vpServolens.h> int main() { diff --git a/src/robot/real-robot/afma6/vpAfma6.cpp b/modules/robot/src/real-robot/afma6/vpAfma6.cpp similarity index 96% rename from src/robot/real-robot/afma6/vpAfma6.cpp rename to modules/robot/src/real-robot/afma6/vpAfma6.cpp index 38008ff1b2f6198719d0abdd6790781cb8d969f1..02a142929c89801ab6b7cec5aa5eb3c0d2fc138d 100644 --- a/src/robot/real-robot/afma6/vpAfma6.cpp +++ b/modules/robot/src/real-robot/afma6/vpAfma6.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpAfma6.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Irisa's Afma6 robot. * @@ -48,15 +44,15 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpRobotException.h> -#include <visp/vpXmlParserCamera.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpAfma6.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpXmlParserCamera.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/robot/vpAfma6.h> /* ----------------------------------------------------------------------- */ /* --- STATIC ------------------------------------------------------------ */ @@ -169,7 +165,7 @@ vpAfma6::vpAfma6() // distance between join 5 and 6 this->_long_56 = -0.06924; // Camera extrinsic parameters: effector to camera frame - this->_eMc.setIdentity(); // Default values are initialized ... + this->_eMc.eye(); // Default values are initialized ... // ... in init (vpAfma6::vpAfma6ToolType tool, // vpCameraParameters::vpCameraParametersProjType projModel) // Maximal value of the joints @@ -515,10 +511,10 @@ vpAfma6::getForwardKinematics(const vpColVector & q) const The code below shows how to compute the inverse geometric model: \code -#include <visp/vpConfig.h> -#include <visp/vpColVector.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRobotAfma6.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/robot/vpRobotAfma6.h> int main() { @@ -1066,7 +1062,7 @@ vpAfma6::getLong56() const \param filename : File name containing the robot constant parameters, like max/min joint values, distance between 5 and 6 axis, - coupling factor between axis 5 and 6, and the hand-to-eye homogenous matrix. + coupling factor between axis 5 and 6, and the hand-to-eye homogeneous matrix. */ #ifdef VISP_HAVE_ACCESS_TO_NAS @@ -1187,12 +1183,12 @@ vpAfma6::parseConfigFile (const char * filename) \warning This method needs XML library to parse the file defined in vpAfma6::CONST_CAMERA_AFMA6_FILENAME and containing the camera parameters. If XML is detected by ViSP, VISP_HAVE_XML2 macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. \warning Thid method needs also an access to the file located on Inria's NAS server and containing the camera parameters in XML format. This access is available if VISP_HAVE_ACCESS_TO_NAS macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. - If VISP_HAVE_ACCESS_TO_NAS and VISP_HAVE_XML2 macros are defined, this method gets the camera parameters from @@ -1210,14 +1206,14 @@ vpAfma6::parseConfigFile (const char * filename) attached to the robot. \code -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpCameraParameters.h> int main() { -#if defined(VISP_HAVE_DC1394_2) && defined(VISP_HAVE_AFMA6) +#if defined(VISP_HAVE_DC1394) && defined(VISP_HAVE_AFMA6) vpImage<unsigned char> I; vp1394TwoGrabber g; @@ -1432,14 +1428,14 @@ vpAfma6::getCameraParameters (vpCameraParameters &cam, \param I : A B&W image send by the current camera in use. \code -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpCameraParameters.h> int main() { -#if defined(VISP_HAVE_DC1394_2) && defined(VISP_HAVE_AFMA6) +#if defined(VISP_HAVE_DC1394) && defined(VISP_HAVE_AFMA6) vpImage<unsigned char> I; vp1394TwoGrabber g; @@ -1479,15 +1475,15 @@ vpAfma6::getCameraParameters (vpCameraParameters &cam, \param I : A color image send by the current camera in use. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpCameraParameters.h> int main() { -#if defined(VISP_HAVE_DC1394_2) && defined(VISP_HAVE_AFMA6) +#if defined(VISP_HAVE_DC1394) && defined(VISP_HAVE_AFMA6) vpImage<vpRGBa> I; vp1394TwoGrabber g; diff --git a/src/robot/real-robot/afma6/vpRobotAfma6.cpp b/modules/robot/src/real-robot/afma6/vpRobotAfma6.cpp similarity index 97% rename from src/robot/real-robot/afma6/vpRobotAfma6.cpp rename to modules/robot/src/real-robot/afma6/vpRobotAfma6.cpp index ba60fa50602bf192216e9329ad849c04a2da0691..f47d8bc010f59eb47286f61e7faac5622cc618bf 100644 --- a/src/robot/real-robot/afma6/vpRobotAfma6.cpp +++ b/modules/robot/src/real-robot/afma6/vpRobotAfma6.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotAfma6.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Irisa's Afma6 robot. * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_AFMA6 @@ -48,13 +44,13 @@ #include <sys/types.h> #include <unistd.h> -#include <visp/vpRobotException.h> -#include <visp/vpExponentialMap.h> -#include <visp/vpDebug.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpThetaUVector.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpRotationMatrix.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpExponentialMap.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/core/vpThetaUVector.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpRotationMatrix.h> /* ---------------------------------------------------------------------- */ /* --- STATIC ----------------------------------------------------------- */ @@ -832,9 +828,9 @@ vpRobotAfma6::getPositioningVelocity (void) position is out of range. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpPoseVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpPoseVector.h> int main() { @@ -935,10 +931,10 @@ vpRobotAfma6::setPosition (const vpRobot::vpControlFrameType frame, position is out of range. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpColVector.h> -#include <visp/vpRobotException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpColVector.h> +#include <visp3/robot/vpRobotException.h> int main() { @@ -1146,8 +1142,8 @@ vpRobotAfma6::setPosition (const vpRobot::vpControlFrameType frame, position is out of range. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotAfma6.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotAfma6.h> int main() { @@ -1216,9 +1212,9 @@ void vpRobotAfma6::setPosition (const vpRobot::vpControlFrameType frame, This method has the same behavior than the sample code given below; \code -#include <visp/vpConfig.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1281,7 +1277,7 @@ void vpRobotAfma6::setPosition(const char *filename) - in reference frame, a 6 dimension vector, the first 3 values correspond to the translation tx, ty, tz in meters (like a vpTranslationVector), and the last 3 values to the rx, ry, rz rotation (like a vpRxyzVector). The code - below show how to convert this position into a vpHomogenousMatrix: + below show how to convert this position into a vpHomogeneousMatrix: \param timestamp : Time in second since last robot power on. @@ -1302,7 +1298,7 @@ void vpRobotAfma6::setPosition(const char *filename) // Create a rotation matrix from the Rxyz rotation angles vpRotationMatrix fRc(frc); // reference frame to camera frame rotation matrix - // Create the camera to fix frame pose in terms of a homogenous matrix + // Create the camera to fix frame pose in terms of a homogeneous matrix vpHomogeneousMatrix fMc(ftc, fRc); \endcode @@ -2236,10 +2232,9 @@ NULL)); return status; } -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ + +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpRobotAfma6.cpp.o) has no symbols +void dummy_vpRobotAfma6() {}; #endif diff --git a/src/robot/real-robot/biclops/vpBiclops.cpp b/modules/robot/src/real-robot/biclops/vpBiclops.cpp similarity index 95% rename from src/robot/real-robot/biclops/vpBiclops.cpp rename to modules/robot/src/real-robot/biclops/vpBiclops.cpp index 92a2baec474241fe7b2e6981374786fa8bc502a5..d8f327199dbdeba2a786597f992ef990b5b1c75b 100644 --- a/src/robot/real-robot/biclops/vpBiclops.cpp +++ b/modules/robot/src/real-robot/biclops/vpBiclops.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpBiclops.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Biclops robot. * @@ -45,10 +41,10 @@ -#include <visp/vpBiclops.h> -#include <visp/vpDebug.h> -#include <visp/vpRobotException.h> -#include <visp/vpMath.h> +#include <visp3/robot/vpBiclops.h> +#include <visp3/core/vpDebug.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpMath.h> #include <math.h> diff --git a/src/robot/real-robot/biclops/vpRobotBiclops.cpp b/modules/robot/src/real-robot/biclops/vpRobotBiclops.cpp similarity index 96% rename from src/robot/real-robot/biclops/vpRobotBiclops.cpp rename to modules/robot/src/real-robot/biclops/vpRobotBiclops.cpp index f1ef8fb5d46aac741c94dfac1a0f5c244df76bfa..48f4d3c65b5a21c4bc9594f239a376abece679e1 100644 --- a/src/robot/real-robot/biclops/vpRobotBiclops.cpp +++ b/modules/robot/src/real-robot/biclops/vpRobotBiclops.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotBiclops.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Biclops robot. * @@ -45,20 +41,20 @@ #include <cmath> // std::fabs #include <limits> // numeric_limits -#include <visp/vpTime.h> +#include <visp3/core/vpTime.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_BICLOPS -#include <visp/vpBiclops.h> -#include <visp/vpRobotBiclops.h> -#include <visp/vpRobotException.h> -#include <visp/vpExponentialMap.h> +#include <visp3/robot/vpBiclops.h> +#include <visp3/robot/vpRobotBiclops.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpExponentialMap.h> //#define VP_DEBUG // Activate the debug mode //#define VP_DEBUG_MODE 10 // Activate debug level 1 and 2 -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> /* ---------------------------------------------------------------------- */ /* --- STATIC ------------------------------------------------------------ */ @@ -87,8 +83,8 @@ static pthread_mutex_t vpMeasure_mutex; using init() function. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotBiclops.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotBiclops.h> int main() { @@ -114,13 +110,12 @@ int main() */ vpRobotBiclops::vpRobotBiclops () - : - vpRobot () + : vpBiclops(), vpRobot(), control_thread(), controller(), + positioningVelocity(defaultPositioningVelocity), q_previous(), controlThreadCreated(false) { vpDEBUG_TRACE (12, "Begin default constructor."); vpRobotBiclops::robotAlreadyCreated = false; - controlThreadCreated = false; setConfigFile("/usr/share/BiclopsDefault.cfg"); // Initialize the mutex dedicated to she shm protection @@ -128,7 +123,7 @@ vpRobotBiclops::vpRobotBiclops () pthread_mutex_init (&vpEndThread_mutex, NULL); pthread_mutex_init (&vpMeasure_mutex, NULL); - positioningVelocity = defaultPositioningVelocity ; + control_thread = 0; } /*! @@ -142,8 +137,8 @@ vpRobotBiclops::vpRobotBiclops () The following example shows how to use the constructor. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotBiclops.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotBiclops.h> int main() { @@ -165,13 +160,12 @@ int main() */ vpRobotBiclops::vpRobotBiclops (const char * filename) - : - vpRobot () + : vpBiclops(), vpRobot(), control_thread(), controller(), + positioningVelocity(defaultPositioningVelocity), q_previous(), controlThreadCreated(false) { vpDEBUG_TRACE (12, "Begin default constructor."); vpRobotBiclops::robotAlreadyCreated = false; - controlThreadCreated = false; setConfigFile(filename); // Initialize the mutex dedicated to she shm protection @@ -179,8 +173,6 @@ vpRobotBiclops::vpRobotBiclops (const char * filename) pthread_mutex_init (&vpEndThread_mutex, NULL); pthread_mutex_init (&vpMeasure_mutex, NULL); - positioningVelocity = defaultPositioningVelocity ; - init(); return ; @@ -701,19 +693,19 @@ vpRobotBiclops::get_cMe(vpHomogeneousMatrix &cMe) const \warning Re is not the embedded camera frame. It corresponds to the frame associated to the tilt axis (see also get_cMe). - \param eJe : Jacobian between end effector frame and end effector frame (on + \param _eJe : Jacobian between end effector frame and end effector frame (on tilt axis). */ void -vpRobotBiclops::get_eJe(vpMatrix &eJe) +vpRobotBiclops::get_eJe(vpMatrix &_eJe) { vpColVector q(2) ; getPosition(vpRobot::ARTICULAR_FRAME, q) ; try { - vpBiclops::get_eJe(q,eJe) ; + vpBiclops::get_eJe(q, _eJe) ; } catch(...) { @@ -725,19 +717,19 @@ vpRobotBiclops::get_eJe(vpMatrix &eJe) /*! Get the robot jacobian expressed in the robot reference frame - \param fJe : Jacobian between reference frame (or fix frame) and end effector + \param _fJe : Jacobian between reference frame (or fix frame) and end effector frame (on tilt axis). */ void -vpRobotBiclops::get_fJe(vpMatrix &fJe) +vpRobotBiclops::get_fJe(vpMatrix &_fJe) { vpColVector q(2) ; getPosition(vpRobot::ARTICULAR_FRAME, q) ; try { - vpBiclops::get_fJe(q,fJe) ; + vpBiclops::get_fJe(q,_fJe) ; } catch(...) { @@ -1424,13 +1416,8 @@ vpRobotBiclops::getDisplacement(vpRobot::vpControlFrameType frame, } - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpRobotBiclops.cpp.o) has no symbols +void dummy_vpRobotBiclops() {}; #endif diff --git a/src/robot/real-robot/biclops/vpRobotBiclopsController.cpp b/modules/robot/src/real-robot/biclops/vpRobotBiclopsController.cpp similarity index 93% rename from src/robot/real-robot/biclops/vpRobotBiclopsController.cpp rename to modules/robot/src/real-robot/biclops/vpRobotBiclopsController.cpp index 1be2483f3261223aa7ec352b96ad744e94030fb1..70e86fa305fba13443e32869f15f9a2e3e202749 100644 --- a/src/robot/real-robot/biclops/vpRobotBiclopsController.cpp +++ b/modules/robot/src/real-robot/biclops/vpRobotBiclopsController.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotBiclopsController.cpp 4604 2014-01-21 14:15:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Biclops robot. * @@ -44,19 +40,20 @@ #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX # include <unistd.h> #endif -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> +#ifndef DOXYGEN_SHOULD_SKIP_THIS #ifdef VISP_HAVE_BICLOPS /* Headers */ -#include <visp/vpRobotBiclops.h> -#include <visp/vpRobotBiclopsController.h> -#include <visp/vpRobotException.h> +#include <visp3/robot/vpRobotBiclops.h> +#include <visp3/robot/vpRobotBiclopsController.h> +#include <visp3/robot/vpRobotException.h> //#define VP_DEBUG // Activate the debug mode //#define VP_DEBUG_MODE 20 // Activate debug level 1 and 2 -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> @@ -68,15 +65,13 @@ Default constructor. */ vpRobotBiclopsController::vpRobotBiclopsController() + : biclops(), axisMask(0), panAxis(NULL), tiltAxis(NULL), vergeAxis(NULL), + panProfile(), tiltProfile(), vergeProfile(), shm(), stopControllerThread_(false) { - stopControllerThread_ = false; axisMask = Biclops::PanMask + Biclops::TiltMask /*+ Biclops::VergeMask*/; // add this if you want verge. - panAxis = NULL; - tiltAxis = NULL; - vergeAxis = NULL; // Set Debug level depending on how much info you want to see about // the inner workings of the API. Level 2 is highest with 0 being @@ -91,7 +86,6 @@ vpRobotBiclopsController::vpRobotBiclopsController() shm.jointLimit[i] = false; shm.status[i] = STOP; } - } /*! @@ -227,7 +221,7 @@ vpRobotBiclopsController::setPosition(const vpColVector & q, #ifdef VISP_HAVE_BICLOPS_AND_GET_HOMED_STATE_FUNCTION // new API // Get the currently defined (default) motion profiles. - PMDAxisControl::Profile panProfile,tiltProfile; + //PMDAxisControl::Profile panProfile,tiltProfile; panAxis->GetProfile(panProfile); tiltAxis->GetProfile(tiltProfile); @@ -308,7 +302,7 @@ vpRobotBiclopsController::setVelocity(const vpColVector & q_dot) #ifdef VISP_HAVE_BICLOPS_AND_GET_HOMED_STATE_FUNCTION // new API // Get the currently defined (default) motion profiles. - PMDAxisControl::Profile panProfile, tiltProfile; + //PMDAxisControl::Profile panProfile, tiltProfile; panAxis->GetProfile(panProfile); tiltAxis->GetProfile(tiltProfile); @@ -484,11 +478,10 @@ vpRobotBiclopsController::readShm() return tmp_shm; } -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpRobotBiclopsController.cpp.o) has no symbols +void dummy_vpRobotBiclopsController() {}; #endif +#endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS + diff --git a/src/robot/real-robot/pioneer/vpRobotPioneer.cpp b/modules/robot/src/real-robot/pioneer/vpRobotPioneer.cpp similarity index 89% rename from src/robot/real-robot/pioneer/vpRobotPioneer.cpp rename to modules/robot/src/real-robot/pioneer/vpRobotPioneer.cpp index bd72577e67a19cab2670b729ea202b28de4953ae..4ecc94966afee368c032aa45b3cd1232c5650a67 100644 --- a/src/robot/real-robot/pioneer/vpRobotPioneer.cpp +++ b/modules/robot/src/real-robot/pioneer/vpRobotPioneer.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpRobotPioneer.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for Pioneer robots based on Aria 3rd party library. * @@ -39,10 +35,15 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpMath.h> -#include <visp/vpRobotException.h> -#include <visp/vpRobotPioneer.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/robot/vpRobotPioneer.h> +// Warning: vpMath.h should be included after Aria.h to avoid the build issue: +// "/usr/include/Aria/ariaUtil.h:732:21: error: ‘isfinite’ was not declared +// in this scope" +// This error is due to cmath header included from vpMath.h that makes +// isfinite() ambiguous between ::isfinite() and std::isfinite() +#include <visp3/core/vpMath.h> #ifdef VISP_HAVE_PIONEER @@ -232,5 +233,7 @@ vpColVector vpRobotPioneer::getVelocity (const vpRobot::vpControlFrameType frame return velocity; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpRobotPioneer.cpp.o) has no symbols +void dummy_vpRobotPioneer() {}; #endif - diff --git a/src/robot/real-robot/ptu46/vpPtu46.cpp b/modules/robot/src/real-robot/ptu46/vpPtu46.cpp similarity index 94% rename from src/robot/real-robot/ptu46/vpPtu46.cpp rename to modules/robot/src/real-robot/ptu46/vpPtu46.cpp index 2fea9f60eb6cb32e6448bb2f33192c0c06846184..76c4eb587176e2e44722e2ac936fddc9f3874c35 100644 --- a/src/robot/real-robot/ptu46/vpPtu46.cpp +++ b/modules/robot/src/real-robot/ptu46/vpPtu46.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPtu46.cpp 4620 2014-01-27 21:28:32Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the ptu-46 robot. * @@ -46,14 +42,14 @@ /* ----------------------------------------------------------------------- */ -#include <visp/vpPtu46.h> -#include <visp/vpDebug.h> -#include <visp/vpRobotException.h> +#include <visp3/robot/vpPtu46.h> +#include <visp3/core/vpDebug.h> +#include <visp3/robot/vpRobotException.h> /* Inclusion des fichiers standards. */ #include <math.h> -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> /* ------------------------------------------------------------------------ */ /* --- COMPUTE ------------------------------------------------------------ */ diff --git a/src/robot/real-robot/ptu46/vpRobotPtu46.cpp b/modules/robot/src/real-robot/ptu46/vpRobotPtu46.cpp similarity index 97% rename from src/robot/real-robot/ptu46/vpRobotPtu46.cpp rename to modules/robot/src/real-robot/ptu46/vpRobotPtu46.cpp index 0edcb335cb8afc2284451ab2aef26673f03aa328..dc4afbe076f378a33c6f0d1e42c1b92cf8644d6d 100644 --- a/src/robot/real-robot/ptu46/vpRobotPtu46.cpp +++ b/modules/robot/src/real-robot/ptu46/vpRobotPtu46.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotPtu46.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the ptu-46 robot. * @@ -42,14 +38,14 @@ #include <signal.h> #include <string.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_PTU46 /* Headers des fonctions implementees. */ -#include <visp/vpPtu46.h> -#include <visp/vpRobotPtu46.h> -#include <visp/vpRobotException.h> -#include <visp/vpDebug.h> +#include <visp3/robot/vpPtu46.h> +#include <visp3/robot/vpRobotPtu46.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpDebug.h> /* ---------------------------------------------------------------------- */ /* --- STATIC ------------------------------------------------------------ */ @@ -927,11 +923,8 @@ vpRobotPtu46::getDisplacement(vpRobot::vpControlFrameType frame, } } -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpRobotPtu46.cpp.o) has no symbols +void dummy_vpRobotPtu46() {}; #endif diff --git a/src/robot/real-robot/viper/vpRobotViper650.cpp b/modules/robot/src/real-robot/viper/vpRobotViper650.cpp similarity index 87% rename from src/robot/real-robot/viper/vpRobotViper650.cpp rename to modules/robot/src/real-robot/viper/vpRobotViper650.cpp index bf2780b25c61f115eaa11a582527cdf6b52d5b19..c91d46793bc75a570fdde0264968a4922fa9550a 100644 --- a/src/robot/real-robot/viper/vpRobotViper650.cpp +++ b/modules/robot/src/real-robot/viper/vpRobotViper650.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotViper650.cpp 4793 2014-07-21 15:10:52Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Irisa's Viper S650 robot. * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_VIPER650 @@ -48,13 +44,13 @@ #include <sys/types.h> #include <unistd.h> -#include <visp/vpRobotException.h> -#include <visp/vpExponentialMap.h> -#include <visp/vpDebug.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpThetaUVector.h> -#include <visp/vpRobot.h> -#include <visp/vpRobotViper650.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpExponentialMap.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/core/vpThetaUVector.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/robot/vpRobotViper650.h> /* ---------------------------------------------------------------------- */ /* --- STATIC ----------------------------------------------------------- */ @@ -134,11 +130,11 @@ void emergencyStopViper650(int signo) including the distorsion, use the code below: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpCameraParameters.h> int main() { @@ -158,7 +154,7 @@ int main() vpImage<unsigned char> I(480, 640); // Get an image from the camera attached to the robot -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 vp1394TwoGrabber g; g.acquire(I); #endif @@ -170,7 +166,7 @@ int main() } \endcode - \sa vpCameraParameters, init(vpViper650::vpViper650CameraRobotType, + \sa vpCameraParameters, init(vpViper650::vpToolType, vpCameraParameters::vpCameraParametersProjType) */ @@ -243,11 +239,15 @@ vpRobotViper650::vpRobotViper650 (bool verbose) init(vpViper650::defaultCameraRobot). If you want to set the extrinsic camera parameters to those obtained with a camera perspective model including the distorsion you have to call the - init(vpViper650::vpViper650CameraRobotType, + init(vpViper650::vpToolType, vpCameraParameters::vpCameraParametersProjType) method. + If you want to set custom extrinsic camera parameters you have to call + the init(vpViper650::vpToolType, const vpHomogeneousMatrix&) method. - \sa vpCameraParameters, init(vpViper650::vpViper650CameraRobotType, - vpCameraParameters::vpCameraParametersProjType) + \sa vpCameraParameters, init(vpViper650::vpToolType, + vpCameraParameters::vpCameraParametersProjType), + init(vpViper650::vpToolType, const vpHomogeneousMatrix&), + init(vpViper650::vpToolType, const std::string&) */ void vpRobotViper650::init (void) @@ -363,16 +363,16 @@ void \param projModel : Projection model associated to the camera. - To set the extrinsic camera parameters related to the \f$^e{\bf + To set the extrinsic camera parameters related to the \f$^e{\bf M}_c\f$ matrix obtained with a camera perspective projection model including the distorsion, use the code below: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpCameraParameters.h> int main() { @@ -392,7 +392,7 @@ int main() vpImage<unsigned char> I(480, 640); // Get an image from the camera attached to the robot -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 vp1394TwoGrabber g; g.acquire(I); #endif @@ -404,29 +404,19 @@ int main() } \endcode - \sa vpCameraParameters, init() + \sa vpCameraParameters, + init(vpViper650::vpToolType, const vpHomogeneousMatrix&), + init(vpViper650::vpToolType, const std::string&) */ void vpRobotViper650::init (vpViper650::vpToolType tool, vpCameraParameters::vpCameraParametersProjType projModel) { - - InitTry; - // Read the robot constants from files - // - joint [min,max], coupl_56, long_56 - // - camera extrinsic parameters relative to eMc vpViper650::init(tool, projModel); - // Set the camera constant (eMc pose) in the MotionBlox - double eMc_pose[6]; - for (unsigned int i=0; i < 3; i ++) { - eMc_pose[i] = etc[i]; // translation in meters - eMc_pose[i+3] = erc[i]; // rotation in rad - } - // Update the eMc pose in the low level controller - Try( PrimitiveCONST_Viper650(eMc_pose) ); + InitTry; - // get real joint min/max from the MotionBlox + // Get real joint min/max from the MotionBlox Try( PrimitiveJOINT_MINMAX_Viper650(joint_min.data, joint_max.data) ); // Convert units from degrees to radians joint_min.deg2rad(); @@ -436,12 +426,207 @@ void // printf("axis %d: joint min %lf, max %lf\n", i, joint_min[i], joint_max[i]); // } - setToolType(tool); - CatchPrint(); return ; } +/*! + + Initialize the robot kinematics (set the eMc homogeneous + parameters in the low level controller) from a file and + also get the joint limits from the low-level controller. + + \param tool : Tool to use. + + \param filename : Path of the configuration file containing the + transformation between the end-effector frame and the tool frame. + + To set the transformation parameters related to the \f$^e{\bf + M}_c\f$ matrix, use the code below: + + \code +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> + +int main() +{ +#ifdef VISP_HAVE_VIPER650 + vpRobotViper650 robot; + + // Set the transformation between the end-effector frame + // and the tool frame from a file + std::string filename("./EffectorToolTransformation.cnf"); + + robot.init(vpViper650::TOOL_CUSTOM, filename); +#endif +} + \endcode + + The configuration file should have the form below: + + \code +# Start with any number of consecutive lines +# beginning with the symbol '#' +# +# The 3 following lines contain the name of the camera, +# the rotation parameters of the geometric transformation +# using the Euler angles in degrees with convention XYZ and +# the translation parameters expressed in meters +CAMERA CameraName +eMc_ROT_XYZ 10.0 -90.0 20.0 +eMc_TRANS_XYZ 0.05 0.01 0.06 + \endcode + + \sa vpCameraParameters, init(), init(vpViper650::vpToolType, + vpCameraParameters::vpCameraParametersProjType), + init(vpViper650::vpToolType, const vpHomogeneousMatrix&) +*/ +void +vpRobotViper650::init (vpViper650::vpToolType tool, + const std::string &filename) +{ + vpViper650::init(tool, filename); + + InitTry; + + // Get real joint min/max from the MotionBlox + Try( PrimitiveJOINT_MINMAX_Viper650(joint_min.data, joint_max.data) ); + // Convert units from degrees to radians + joint_min.deg2rad(); + joint_max.deg2rad(); + + // for (unsigned int i=0; i < njoint; i++) { + // printf("axis %d: joint min %lf, max %lf\n", i, joint_min[i], joint_max[i]); + // } + + CatchPrint(); + return ; +} + +/*! + + Initialize the robot kinematics with user defined parameters + (set the eMc homogeneous parameters in the low level controller) + and also get the joint limits from the low-level controller. + + \param tool : Tool to use. + + \param eMc_ : Transformation between the end-effector frame + and the tool frame. + + To set the transformation parameters related to the \f$^e{\bf + M}_c\f$ matrix, use the code below: + + \code +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/robot/vpRobotViper650.h> + +int main() +{ +#ifdef VISP_HAVE_VIPER650 + vpRobotViper650 robot; + + // Set the transformation between the end-effector frame + // and the tool frame. + vpHomogeneousMatrix eMc(0.001, 0.0, 0.1, 0.0, 0.0, M_PI/2); + + robot.init(vpViper650::TOOL_CUSTOM, eMc); +#endif +} + \endcode + + \sa vpCameraParameters, init(), init(vpViper650::vpToolType, + vpCameraParameters::vpCameraParametersProjType), + init(vpViper650::vpToolType, const std::string&) +*/ +void +vpRobotViper650::init (vpViper650::vpToolType tool, + const vpHomogeneousMatrix &eMc_) +{ + vpViper650::init(tool, eMc_); + + InitTry; + + // Get real joint min/max from the MotionBlox + Try( PrimitiveJOINT_MINMAX_Viper650(joint_min.data, joint_max.data) ); + // Convert units from degrees to radians + joint_min.deg2rad(); + joint_max.deg2rad(); + + // for (unsigned int i=0; i < njoint; i++) { + // printf("axis %d: joint min %lf, max %lf\n", i, joint_min[i], joint_max[i]); + // } + + CatchPrint(); + return ; +} + +/*! + + Set the geometric transformation between the end-effector frame and + the tool frame in the low level controller. + + \warning This function overwrite the transformation parameters that were + potentially set using one of the init functions + + \param eMc_ : Transformation between the end-effector frame + and the tool frame. +*/ +void +vpRobotViper650::set_eMc(const vpHomogeneousMatrix &eMc_) +{ + this->vpViper650::set_eMc(eMc_); + + InitTry; + + // Set the camera constant (eMc pose) in the MotionBlox + double eMc_pose[6]; + for (unsigned int i=0; i < 3; i ++) { + eMc_pose[i] = etc[i]; // translation in meters + eMc_pose[i+3] = erc[i]; // rotation in rad + } + // Update the eMc pose in the low level controller + Try( PrimitiveCONST_Viper650(eMc_pose) ); + + CatchPrint(); + + return ; +} + +/*! + + Set the geometric transformation between the end-effector frame and + the tool frame in the low level controller. + + \warning This function overwrite the transformation parameters that were + potentially set using one of the init functions. + + \param etc_ : Translation between the end-effector frame and the tool frame. + \param erc_ : Rotation between the end-effector frame and the tool frame + using the Euler angles in radians with the XYZ convention. +*/ +void +vpRobotViper650::set_eMc(const vpTranslationVector &etc_, const vpRxyzVector &erc_) +{ + this->vpViper650::set_eMc(etc_,erc_); + + InitTry; + + // Set the camera constant (eMc pose) in the MotionBlox + double eMc_pose[6]; + for (unsigned int i=0; i < 3; i ++) { + eMc_pose[i] = etc[i]; // translation in meters + eMc_pose[i+3] = erc[i]; // rotation in rad + } + // Update the eMc pose in the low level controller + Try( PrimitiveCONST_Viper650(eMc_pose) ); + + CatchPrint(); + + return ; +} + /* ------------------------------------------------------------------------ */ /* --- DESTRUCTOR --------------------------------------------------------- */ /* ------------------------------------------------------------------------ */ @@ -826,9 +1011,9 @@ void be in ]0:100]. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpColVector.h> int main() { @@ -904,9 +1089,9 @@ double position is out of range. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpColVector.h> int main() { @@ -997,7 +1182,7 @@ void // convert rad to deg requested for the low level controller destination.rad2deg(); Try( PrimitiveMOVE_J_Viper650(destination.data, positioningVelocity) ); - Try( WaitState_Viper650(ETAT_ATTENTE_AFMA6, 1000) ); + Try( WaitState_Viper650(ETAT_ATTENTE_VIPER650, 1000) ); } else { // Cartesian position is out of range @@ -1013,7 +1198,7 @@ void //std::cout << "Joint destination (deg): " << destination.t() << std::endl; Try( PrimitiveMOVE_J_Viper650(destination.data, positioningVelocity) ); - Try( WaitState_Viper650(ETAT_ATTENTE_AFMA6, 1000) ); + Try( WaitState_Viper650(ETAT_ATTENTE_VIPER650, 1000) ); break ; } @@ -1032,7 +1217,7 @@ void //std::cout << "Base frame destination Rzyz (deg): " << destination.t() << std::endl; Try( PrimitiveMOVE_C_Viper650(destination.data, configuration, positioningVelocity) ); - Try( WaitState_Viper650(ETAT_ATTENTE_AFMA6, 1000) ); + Try( WaitState_Viper650(ETAT_ATTENTE_VIPER650, 1000) ); break ; } @@ -1106,8 +1291,8 @@ void position is out of range. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> int main() { @@ -1174,9 +1359,9 @@ void vpRobotViper650::setPosition (const vpRobot::vpControlFrameType frame, This method has the same behavior than the sample code given below; \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1236,18 +1421,18 @@ void vpRobotViper650::setPosition(const char *filename) - in reference frame, a 6 dimension vector, the first 3 values correspond to the translation tx, ty, tz in meters (like a vpTranslationVector), and the last 3 values to the rx, ry, rz rotation (like a vpRxyzVector). The code - below show how to convert this position into a vpHomogenousMatrix: + below show how to convert this position into a vpHomogeneousMatrix: \param timestamp : Time in second since last robot power on. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpColVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> int main() { @@ -1271,7 +1456,7 @@ int main() vpRotationMatrix fRc(frc); // reference frame to camera frame rotation matrix // Create the camera to fix frame transformation in terms of a - // homogenous matrix + // homogeneous matrix vpHomogeneousMatrix fMc(ftc, fRc); #endif } @@ -1458,10 +1643,10 @@ double vpRobotViper650::getTime() const setMaxTranslationVelocity() and setMaxRotationVelocity(). \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -1632,9 +1817,9 @@ void first call is used to intialise the velocity computation for the next call. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1795,9 +1980,9 @@ void vpRobotViper650::getVelocity(const vpRobot::vpControlFrameType frame, and rotations in rad/s. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1892,9 +2077,9 @@ an error occurs. The code below shows how to read a position from a file and move the robot to this position. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpColVector.h> int main() { @@ -2203,10 +2388,10 @@ void The code below shows how to get the force/torque measures after a sensor bias. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper650.h> -#include <visp/vpColVector.h> -#include <visp/vpTime.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper650.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpTime.h> int main() { @@ -2344,5 +2529,7 @@ vpRobotViper650::getMaxRotationVelocityJoint6() const return maxRotationVelocity_joint6; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpRobotViper650.cpp.o) has no symbols +void dummy_vpRobotViper650() {}; #endif - diff --git a/src/robot/real-robot/viper/vpRobotViper850.cpp b/modules/robot/src/real-robot/viper/vpRobotViper850.cpp similarity index 96% rename from src/robot/real-robot/viper/vpRobotViper850.cpp rename to modules/robot/src/real-robot/viper/vpRobotViper850.cpp index f68efb584ba1a48a38f718efe63609d36de74a07..71b433cea8e9903d0e3ae79a0f304ce422dc521e 100644 --- a/src/robot/real-robot/viper/vpRobotViper850.cpp +++ b/modules/robot/src/real-robot/viper/vpRobotViper850.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotViper850.cpp 4594 2014-01-20 15:08:07Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the Irisa's Viper S850 robot. * @@ -39,7 +35,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_VIPER850 @@ -48,13 +44,13 @@ #include <sys/types.h> #include <unistd.h> -#include <visp/vpRobotException.h> -#include <visp/vpExponentialMap.h> -#include <visp/vpDebug.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpThetaUVector.h> -#include <visp/vpRobot.h> -#include <visp/vpRobotViper850.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpExponentialMap.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/core/vpThetaUVector.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/robot/vpRobotViper850.h> /* ---------------------------------------------------------------------- */ /* --- STATIC ----------------------------------------------------------- */ @@ -134,11 +130,11 @@ void emergencyStopViper850(int signo) including the distorsion, use the code below: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpCameraParameters.h> int main() { @@ -158,7 +154,7 @@ int main() vpImage<unsigned char> I(480, 640); // Get an image from the camera attached to the robot -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 vp1394TwoGrabber g; g.acquire(I); #endif @@ -369,11 +365,11 @@ void including the distorsion, use the code below: \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpCameraParameters.h> int main() { @@ -393,7 +389,7 @@ int main() vpImage<unsigned char> I(480, 640); // Get an image from the camera attached to the robot -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 vp1394TwoGrabber g; g.acquire(I); #endif @@ -827,9 +823,9 @@ void be in ]0:100]. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> int main() { @@ -905,9 +901,9 @@ double position is out of range. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1106,8 +1102,8 @@ void position is out of range. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> int main() { @@ -1174,9 +1170,9 @@ void vpRobotViper850::setPosition (const vpRobot::vpControlFrameType frame, This method has the same behavior than the sample code given below; \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1236,18 +1232,18 @@ void vpRobotViper850::setPosition(const char *filename) - in reference frame, a 6 dimension vector, the first 3 values correspond to the translation tx, ty, tz in meters (like a vpTranslationVector), and the last 3 values to the rx, ry, rz rotation (like a vpRxyzVector). The code - below show how to convert this position into a vpHomogenousMatrix: + below show how to convert this position into a vpHomogeneousMatrix: \param timestamp : Time in second since last robot power on. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> int main() { @@ -1271,7 +1267,7 @@ int main() vpRotationMatrix fRc(frc); // reference frame to camera frame rotation matrix // Create the camera to fix frame transformation in terms of a - // homogenous matrix + // homogeneous matrix vpHomogeneousMatrix fMc(ftc, fRc); #endif } @@ -1470,10 +1466,10 @@ void vpRobotViper850::getPosition(const vpRobot::vpControlFrameType frame, setMaxTranslationVelocity() and setMaxRotationVelocity(). \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -1642,9 +1638,9 @@ void vpRobotViper850::setVelocity(const vpRobot::vpControlFrameType frame, first call is used to intialise the velocity computation for the next call. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1807,9 +1803,9 @@ void vpRobotViper850::getVelocity(const vpRobot::vpControlFrameType frame, and rotations in rad/s. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1904,9 +1900,9 @@ an error occurs. The code below shows how to read a position from a file and move the robot to this position. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> int main() { @@ -2216,10 +2212,10 @@ void The code below shows how to get the force/torque measures after a sensor bias. \code -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpColVector.h> -#include <visp/vpTime.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpTime.h> int main() { @@ -2396,5 +2392,8 @@ vpRobotViper850::getMaxRotationVelocityJoint6() const return maxRotationVelocity_joint6; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpRobotViper850.cpp.o) has no symbols +void dummy_vpRobotViper850() {}; #endif diff --git a/src/robot/real-robot/viper/vpViper.cpp b/modules/robot/src/real-robot/viper/vpViper.cpp similarity index 95% rename from src/robot/real-robot/viper/vpViper.cpp rename to modules/robot/src/real-robot/viper/vpViper.cpp index 250410c89fefbfccf30aefab94862f30689c9617..76e212d7184cceec387efdcac0cae9526bac758d 100644 --- a/src/robot/real-robot/viper/vpViper.cpp +++ b/modules/robot/src/real-robot/viper/vpViper.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpViper.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for a generic ADEPT Viper (either 650 or 850) robot. * @@ -49,14 +45,14 @@ -#include <visp/vpDebug.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpRobotException.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpViper.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/robot/vpViper.h> #include <cmath> // std::fabs #include <limits> // numeric_limits @@ -98,7 +94,7 @@ vpViper::vpViper() joint_max[5] = vpMath::rad(360); // End effector to camera transformation - eMc.setIdentity(); + eMc.eye(); } @@ -706,7 +702,7 @@ vpViper::get_fMc(const vpColVector & q, vpHomogeneousMatrix & fMc) const frame \f${^f}{\bf M}_e = {^f}{\bf M}_w *{^w}{\bf M}_e\f$. \code -#include <visp/vpViper.h> +#include <visp3/robot/vpViper.h> int main() { @@ -893,7 +889,7 @@ void vpViper::get_wMe(vpHomogeneousMatrix & wMe) const { // Set the rotation as identity - wMe.setIdentity(); + wMe.eye(); // Set the translation wMe[2][3] = d6; @@ -1250,6 +1246,42 @@ vpViper::getCoupl56() const return c56; } +/*! + + Set the geometric transformation between the end-effector frame and + the tool frame (commonly a camera). + + \param eMc_ : Transformation between the end-effector frame + and the tool frame. +*/ +void +vpViper::set_eMc(const vpHomogeneousMatrix &eMc_) +{ + this->eMc = eMc_; + this->eMc.extract(etc); + vpRotationMatrix R(this->eMc); + this->erc.buildFrom(R); +} + +/*! + + Set the geometric transformation between the end-effector frame and + the tool frame (commonly a camera frame). + + \param etc_ : Translation between the end-effector frame + and the tool frame. + \param erc_ : Rotation between the end-effector frame and the tool + frame using the Euler angles in radians with the XYZ convention. +*/ +void +vpViper::set_eMc(const vpTranslationVector &etc_, const vpRxyzVector &erc_) +{ + this->etc = etc_; + this->erc = erc_; + vpRotationMatrix eRc(erc); + this->eMc.buildFrom(etc,eRc); +} + /*! Print on the output stream \e os the robot parameters (joint diff --git a/src/robot/real-robot/viper/vpViper650.cpp b/modules/robot/src/real-robot/viper/vpViper650.cpp similarity index 81% rename from src/robot/real-robot/viper/vpViper650.cpp rename to modules/robot/src/real-robot/viper/vpViper650.cpp index 0e8c2df6ca48fcf0cf4b131d0acb428e6c038338..a10d82f7f01618e020a2268c2bc36cf1b9e65642 100644 --- a/src/robot/real-robot/viper/vpViper650.cpp +++ b/modules/robot/src/real-robot/viper/vpViper650.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpViper650.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the ADEPT Viper 650 robot. * @@ -47,15 +43,15 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpViper650.h> -#include <visp/vpMath.h> -#include <visp/vpXmlParserCamera.h> +#include <visp3/core/vpDebug.h> +#include <visp3/robot/vpViper650.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpXmlParserCamera.h> -#ifdef VISP_HAVE_ACCESS_TO_NAS static const char *opt_viper650[] = {"CAMERA", "eMc_ROT_XYZ","eMc_TRANS_XYZ", NULL}; +#ifdef VISP_HAVE_ACCESS_TO_NAS const char * const vpViper650::CONST_EMC_MARLIN_F033C_WITHOUT_DISTORTION_FILENAME #if defined(_WIN32) = "Z:/robot/Viper650/current/include/const_eMc_MarlinF033C_without_distortion_Viper650.cnf"; @@ -181,10 +177,7 @@ vpViper650::init (void) /*! Read files containing the constant parameters related to the robot - tools in order to set the end-effector to camera transformation. - - \warning This function is only available if the macro - VISP_HAVE_ACCESS_TO_NAS is defined in vpConfig.h. + tools in order to set the end-effector to tool transformation. \param camera_extrinsic_parameters : Filename containing the camera extrinsic parameters. @@ -206,12 +199,21 @@ vpViper650::init (const char *camera_extrinsic_parameters) Set the constant parameters related to the robot kinematics and to the end-effector to camera transformation (\f$^e{\bf M}c\f$) corresponding to the camera extrinsic parameters. These last - parameters depend on the camera and projection model in use. + parameters depend on the camera and projection model in use and are + loaded from predefined files or parameters. + + \warning If the macro VISP_HAVE_ACCESS_TO_NAS is defined in vpConfig.h + this function reads the camera extrinsic parameters from the file + corresponding to the specified camera type and projection type. + Otherwise corresponding default parameters are loaded. \param tool : Camera in use. \param proj_model : Projection model of the camera. + \sa init(vpViper650::vpToolType, const std::string&), + init(vpViper650::vpToolType, const vpHomogeneousMatrix&) + */ void vpViper650::init (vpViper650::vpToolType tool, @@ -316,6 +318,13 @@ vpViper650::init (vpViper650::vpToolType tool, } break; } + case vpViper650::TOOL_CUSTOM: { + vpERROR_TRACE ("No predefined file available for a custom tool" + "You should use init(vpViper650::vpToolType, const std::string&) or" + "init(vpViper650::vpToolType, const vpHomogeneousMatrix&) instead"); + throw vpRobotException (vpRobotException::badValue, "No predefined file available for a custom tool"); + break; + } default: { vpERROR_TRACE ("This error should not occur!"); // vpERROR_TRACE ("Si elle survient malgre tout, c'est sans doute " @@ -394,6 +403,13 @@ vpViper650::init (vpViper650::vpToolType tool, } break; } + case vpViper650::TOOL_CUSTOM: { + vpERROR_TRACE ("No predefined parameters available for a custom tool" + "You should use init(vpViper650::vpToolType, const std::string&) or" + "init(vpViper650::vpToolType, const vpHomogeneousMatrix&) instead"); + throw vpRobotException (vpRobotException::badValue, "No predefined parameters available for a custom tool"); + break; + } } vpRotationMatrix eRc(erc); this->eMc.buildFrom(etc, eRc); @@ -405,16 +421,73 @@ vpViper650::init (vpViper650::vpToolType tool, /*! - This function gets the robot constant parameters from a file. + Set the type of tool attached to the robot and transformation + between the end-effector and the tool (\f$^e{\bf M}c\f$). + This last parameter is loaded from a file. + + \param tool : Type of tool in use. + + \param filename : Path of the configuration file containing the + transformation between the end-effector frame and the tool frame. + + The configuration file should have the form below: + + \code +# Start with any number of consecutive lines +# beginning with the symbol '#' +# +# The 3 following lines contain the name of the camera, +# the rotation parameters of the geometric transformation +# using the Euler angles in degrees with convention XYZ and +# the translation parameters expressed in meters +CAMERA CameraName +eMc_ROT_XYZ 10.0 -90.0 20.0 +eMc_TRANS_XYZ 0.05 0.01 0.06 + \endcode + + \sa init(vpViper650::vpToolType, + vpCameraParameters::vpCameraParametersProjType), + init(vpViper650::vpToolType, const vpHomogeneousMatrix&) +*/ +void +vpViper650::init (vpViper650::vpToolType tool, + const std::string &filename) +{ + this->setToolType(tool); + this->parseConfigFile(filename.c_str()); +} + +/*! + + Set the type of tool attached to the robot and the transformation + between the end-effector and the tool (\f$^e{\bf M}c\f$). + + \param tool : Type of tool in use. - \warning This function is only available if the macro - VISP_HAVE_ACCESS_TO_NAS is defined in vpConfig.h. + \param eMc_ : Homogeneous matrix representation of the transformation + between the end-effector frame and the tool frame. + + \sa init(vpViper650::vpToolType, + vpCameraParameters::vpCameraParametersProjType), + init(vpViper650::vpToolType, const std::string&) + +*/ +void +vpViper650::init (vpViper650::vpToolType tool, + const vpHomogeneousMatrix &eMc_) +{ + this->setToolType(tool); + this->set_eMc(eMc_); +} + +/*! + + This function gets the robot constant parameters from a file. \param filename : File name containing the robot constant parameters, like the hand-to-eye transformation. */ -#ifdef VISP_HAVE_ACCESS_TO_NAS void vpViper650::parseConfigFile (const char * filename) { @@ -424,8 +497,8 @@ vpViper650::parseConfigFile (const char * filename) char namoption[100]; FILE * fdtask; int numLn = 0; - double rot_eMc[3]; // rotation - double trans_eMc[3]; // translation + vpRxyzVector rot_eMc; // rotation + vpTranslationVector trans_eMc; // translation bool get_rot_eMc = false; bool get_trans_eMc = false; @@ -441,7 +514,12 @@ vpViper650::parseConfigFile (const char * filename) while (fgets(Ligne, FILENAME_MAX, fdtask) != NULL) { numLn ++; if ('#' == Ligne[0]) { continue; } - sscanf(Ligne, "%s", namoption); + if (sscanf(Ligne, "%s", namoption) != 1) { + fclose (fdtask); + throw(vpException(vpException::badValue, + "Cannot parse configuration file %s to retrieve option name")); + } + dim = strlen(namoption); for (code = 0; @@ -459,10 +537,12 @@ vpViper650::parseConfigFile (const char * filename) break; // Nothing to do: camera name case 1: - sscanf(Ligne, "%s %lf %lf %lf", namoption, - &rot_eMc[0], - &rot_eMc[1], - &rot_eMc[2]); + if (sscanf(Ligne, "%s %lf %lf %lf", namoption, + &rot_eMc[0], &rot_eMc[1], &rot_eMc[2]) != 4) { + fclose (fdtask); + throw(vpException(vpException::badValue, + "Cannot parse configuration file %s to retrieve translation")); + } // Convert rotation from degrees to radians rot_eMc[0] *= M_PI / 180.0; @@ -472,10 +552,12 @@ vpViper650::parseConfigFile (const char * filename) break; case 2: - sscanf(Ligne, "%s %lf %lf %lf", namoption, - &trans_eMc[0], - &trans_eMc[1], - &trans_eMc[2]); + if (sscanf(Ligne, "%s %lf %lf %lf", namoption, + &trans_eMc[0], &trans_eMc[1], &trans_eMc[2]) != 4) { + fclose (fdtask); + throw(vpException(vpException::badValue, + "Cannot parse configuration file %s to retrieve rotation")); + } get_trans_eMc = true; break; @@ -489,18 +571,17 @@ vpViper650::parseConfigFile (const char * filename) // Compute the eMc matrix from the translations and rotations if (get_rot_eMc && get_trans_eMc) { - for (unsigned int i=0; i < 3; i ++) { - erc[i] = rot_eMc[i]; - etc[i] = trans_eMc[i]; - } - - vpRotationMatrix eRc(erc); - this->eMc.buildFrom(etc, eRc); + this->set_eMc(trans_eMc,rot_eMc); + } + else { + vpERROR_TRACE ("Could not read translation and rotation parameters from config file %s.", + filename); + throw vpRobotException (vpRobotException::readingParametersError, + "Could not read translation and rotation parameters from config file "); } return; } -#endif /*! @@ -509,12 +590,12 @@ vpViper650::parseConfigFile (const char * filename) \warning This method needs XML library to parse the file defined in vpViper650::CONST_CAMERA_FILENAME and containing the camera parameters. If XML is detected by ViSP, VISP_HAVE_XML2 macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. \warning Thid method needs also an access to the file located on Inria's NAS server and containing the camera parameters in XML format. This access is available if VISP_HAVE_ACCESS_TO_NAS macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. - If VISP_HAVE_ACCESS_TO_NAS and VISP_HAVE_XML2 macros are defined, this method gets the camera parameters from @@ -532,17 +613,17 @@ vpViper650::parseConfigFile (const char * filename) attached to the robot. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpViper650.h> -#include <visp/vpRobotViper650.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/robot/vpViper650.h> +#include <visp3/robot/vpRobotViper650.h> int main() { vpImage<unsigned char> I(480, 640); -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 vp1394TwoGrabber g; // Acquire an image to update image structure @@ -643,6 +724,11 @@ vpViper650::getCameraParameters (vpCameraParameters &cam, } break; } + case vpViper650::TOOL_CUSTOM: { + vpERROR_TRACE ("No intrinsic parameters available for a custom tool"); + throw vpRobotException (vpRobotException::badValue, "No intrinsic parameters available for a custom tool"); + break; + } default: { vpERROR_TRACE ("This error should not occur!"); // vpERROR_TRACE ("Si elle survient malgre tout, c'est sans doute " @@ -725,6 +811,11 @@ vpViper650::getCameraParameters (vpCameraParameters &cam, } break; } + case vpViper650::TOOL_CUSTOM: { + vpERROR_TRACE ("No intrinsic parameters available for a custom tool"); + throw vpRobotException (vpRobotException::badValue, "No intrinsic parameters available for a custom tool"); + break; + } default: vpERROR_TRACE ("This error should not occur!"); throw vpRobotException (vpRobotException::readingParametersError, @@ -741,12 +832,12 @@ vpViper650::getCameraParameters (vpCameraParameters &cam, \warning This method needs XML library to parse the file defined in vpViper650::CONST_CAMERA_FILENAME and containing the camera parameters. If XML is detected by ViSP, VISP_HAVE_XML2 macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. \warning Thid method needs also an access to the file located on Inria's NAS server and containing the camera parameters in XML format. This access is available if VISP_HAVE_ACCESS_TO_NAS macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. - If VISP_HAVE_ACCESS_TO_NAS and VISP_HAVE_XML2 macros are defined, this method gets the camera parameters from @@ -760,17 +851,17 @@ vpViper650::getCameraParameters (vpCameraParameters &cam, \param I : A B&W image send by the current camera in use. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpViper650.h> -#include <visp/vpRobotViper650.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/robot/vpViper650.h> +#include <visp3/robot/vpRobotViper650.h> int main() { vpImage<unsigned char> I(480, 640); -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 vp1394TwoGrabber g; // Acquire an image to update image structure @@ -810,12 +901,12 @@ vpViper650::getCameraParameters (vpCameraParameters &cam, \warning This method needs XML library to parse the file defined in vpViper650::CONST_CAMERA_FILENAME and containing the camera parameters. If XML is detected by ViSP, VISP_HAVE_XML2 macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. \warning Thid method needs also an access to the file located on Inria's NAS server and containing the camera parameters in XML format. This access is available if VISP_HAVE_ACCESS_TO_NAS macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. - If VISP_HAVE_ACCESS_TO_NAS and VISP_HAVE_XML2 macros are defined, this method gets the camera parameters from @@ -829,17 +920,17 @@ vpViper650::getCameraParameters (vpCameraParameters &cam, \param I : A color image send by the current camera in use. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpViper650.h> -#include <visp/vpRobotViper650.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/robot/vpViper650.h> +#include <visp3/robot/vpRobotViper650.h> int main() { vpImage<vpRGBa> I(480, 640); -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 vp1394TwoGrabber g; // Acquire an image to update image structure diff --git a/src/robot/real-robot/viper/vpViper850.cpp b/modules/robot/src/real-robot/viper/vpViper850.cpp similarity index 93% rename from src/robot/real-robot/viper/vpViper850.cpp rename to modules/robot/src/real-robot/viper/vpViper850.cpp index 3a29dc4cac44825cd0f0fce58fc1ad6cfc1f6d2a..d62315d60980480cb2750a0a83635b9257e2074e 100644 --- a/src/robot/real-robot/viper/vpViper850.cpp +++ b/modules/robot/src/real-robot/viper/vpViper850.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpViper850.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface for the ADEPT Viper 850 robot. * @@ -47,10 +43,10 @@ */ -#include <visp/vpDebug.h> -#include <visp/vpViper850.h> -#include <visp/vpMath.h> -#include <visp/vpXmlParserCamera.h> +#include <visp3/core/vpDebug.h> +#include <visp3/robot/vpViper850.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpXmlParserCamera.h> #ifdef VISP_HAVE_ACCESS_TO_NAS static const char *opt_viper850[] = {"CAMERA", "eMc_ROT_XYZ","eMc_TRANS_XYZ", @@ -442,7 +438,11 @@ vpViper850::parseConfigFile (const char * filename) while (fgets(Ligne, FILENAME_MAX, fdtask) != NULL) { numLn ++; if ('#' == Ligne[0]) { continue; } - sscanf(Ligne, "%s", namoption); + if (sscanf(Ligne, "%s", namoption) != 1) { + fclose (fdtask); + throw(vpException(vpException::badValue, + "Cannot parse configuration file %s to retrieve option name")); + } dim = strlen(namoption); for (code = 0; @@ -460,10 +460,12 @@ vpViper850::parseConfigFile (const char * filename) break; // Nothing to do: camera name case 1: - sscanf(Ligne, "%s %lf %lf %lf", namoption, - &rot_eMc[0], - &rot_eMc[1], - &rot_eMc[2]); + if (sscanf(Ligne, "%s %lf %lf %lf", namoption, + &rot_eMc[0], &rot_eMc[1], &rot_eMc[2]) != 4) { + fclose (fdtask); + throw(vpException(vpException::badValue, + "Cannot parse configuration file %s to retrieve translation")); + } // Convert rotation from degrees to radians rot_eMc[0] *= M_PI / 180.0; @@ -473,10 +475,12 @@ vpViper850::parseConfigFile (const char * filename) break; case 2: - sscanf(Ligne, "%s %lf %lf %lf", namoption, - &trans_eMc[0], - &trans_eMc[1], - &trans_eMc[2]); + if (sscanf(Ligne, "%s %lf %lf %lf", namoption, + &trans_eMc[0], &trans_eMc[1], &trans_eMc[2]) != 4) { + fclose (fdtask); + throw(vpException(vpException::badValue, + "Cannot parse configuration file %s to retrieve rotation")); + } get_trans_eMc = true; break; @@ -510,12 +514,12 @@ vpViper850::parseConfigFile (const char * filename) \warning This method needs XML library to parse the file defined in vpViper850::CONST_CAMERA_FILENAME and containing the camera parameters. If XML is detected by ViSP, VISP_HAVE_XML2 macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. \warning Thid method needs also an access to the file located on Inria's NAS server and containing the camera parameters in XML format. This access is available if VISP_HAVE_ACCESS_TO_NAS macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. - If VISP_HAVE_ACCESS_TO_NAS and VISP_HAVE_XML2 macros are defined, this method gets the camera parameters from @@ -533,17 +537,17 @@ vpViper850::parseConfigFile (const char * filename) attached to the robot. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpViper850.h> -#include <visp/vpRobotViper850.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/robot/vpViper850.h> +#include <visp3/robot/vpRobotViper850.h> int main() { vpImage<unsigned char> I(480, 640); -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 vp1394TwoGrabber g; // Acquire an image to update image structure @@ -742,12 +746,12 @@ vpViper850::getCameraParameters (vpCameraParameters &cam, \warning This method needs XML library to parse the file defined in vpViper850::CONST_CAMERA_FILENAME and containing the camera parameters. If XML is detected by ViSP, VISP_HAVE_XML2 macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. \warning Thid method needs also an access to the file located on Inria's NAS server and containing the camera parameters in XML format. This access is available if VISP_HAVE_ACCESS_TO_NAS macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. - If VISP_HAVE_ACCESS_TO_NAS and VISP_HAVE_XML2 macros are defined, this method gets the camera parameters from @@ -761,17 +765,17 @@ vpViper850::getCameraParameters (vpCameraParameters &cam, \param I : A B&W image send by the current camera in use. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpViper850.h> -#include <visp/vpRobotViper850.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/robot/vpViper850.h> +#include <visp3/robot/vpRobotViper850.h> int main() { vpImage<unsigned char> I(480, 640); -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 vp1394TwoGrabber g; // Acquire an image to update image structure @@ -811,12 +815,12 @@ vpViper850::getCameraParameters (vpCameraParameters &cam, \warning This method needs XML library to parse the file defined in vpViper850::CONST_CAMERA_FILENAME and containing the camera parameters. If XML is detected by ViSP, VISP_HAVE_XML2 macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. \warning Thid method needs also an access to the file located on Inria's NAS server and containing the camera parameters in XML format. This access is available if VISP_HAVE_ACCESS_TO_NAS macro is - defined in include/visp/vpConfig.h file. + defined in include/visp3/core/vpConfig.h file. - If VISP_HAVE_ACCESS_TO_NAS and VISP_HAVE_XML2 macros are defined, this method gets the camera parameters from @@ -830,17 +834,17 @@ vpViper850::getCameraParameters (vpCameraParameters &cam, \param I : A color image send by the current camera in use. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpViper850.h> -#include <visp/vpRobotViper850.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/robot/vpViper850.h> +#include <visp3/robot/vpRobotViper850.h> int main() { vpImage<vpRGBa> I(480, 640); -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 vp1394TwoGrabber g; // Acquire an image to update image structure diff --git a/src/robot/simulator-robot/arms/afma6_arm1.bnd b/modules/robot/src/robot-simulator/arms/afma6_arm1.bnd similarity index 100% rename from src/robot/simulator-robot/arms/afma6_arm1.bnd rename to modules/robot/src/robot-simulator/arms/afma6_arm1.bnd diff --git a/src/robot/simulator-robot/arms/afma6_arm2.bnd b/modules/robot/src/robot-simulator/arms/afma6_arm2.bnd similarity index 100% rename from src/robot/simulator-robot/arms/afma6_arm2.bnd rename to modules/robot/src/robot-simulator/arms/afma6_arm2.bnd diff --git a/src/robot/simulator-robot/arms/afma6_arm3.bnd b/modules/robot/src/robot-simulator/arms/afma6_arm3.bnd similarity index 100% rename from src/robot/simulator-robot/arms/afma6_arm3.bnd rename to modules/robot/src/robot-simulator/arms/afma6_arm3.bnd diff --git a/src/robot/simulator-robot/arms/afma6_arm4.bnd b/modules/robot/src/robot-simulator/arms/afma6_arm4.bnd similarity index 100% rename from src/robot/simulator-robot/arms/afma6_arm4.bnd rename to modules/robot/src/robot-simulator/arms/afma6_arm4.bnd diff --git a/src/robot/simulator-robot/arms/afma6_gate.bnd b/modules/robot/src/robot-simulator/arms/afma6_gate.bnd similarity index 100% rename from src/robot/simulator-robot/arms/afma6_gate.bnd rename to modules/robot/src/robot-simulator/arms/afma6_gate.bnd diff --git a/src/robot/simulator-robot/arms/afma6_tool_ccmop.bnd b/modules/robot/src/robot-simulator/arms/afma6_tool_ccmop.bnd similarity index 100% rename from src/robot/simulator-robot/arms/afma6_tool_ccmop.bnd rename to modules/robot/src/robot-simulator/arms/afma6_tool_ccmop.bnd diff --git a/src/robot/simulator-robot/arms/afma6_tool_gripper.bnd b/modules/robot/src/robot-simulator/arms/afma6_tool_gripper.bnd similarity index 100% rename from src/robot/simulator-robot/arms/afma6_tool_gripper.bnd rename to modules/robot/src/robot-simulator/arms/afma6_tool_gripper.bnd diff --git a/src/robot/simulator-robot/arms/afma6_tool_vacuum.bnd b/modules/robot/src/robot-simulator/arms/afma6_tool_vacuum.bnd similarity index 100% rename from src/robot/simulator-robot/arms/afma6_tool_vacuum.bnd rename to modules/robot/src/robot-simulator/arms/afma6_tool_vacuum.bnd diff --git a/src/robot/simulator-robot/arms/viper850_arm1.bnd b/modules/robot/src/robot-simulator/arms/viper850_arm1.bnd similarity index 100% rename from src/robot/simulator-robot/arms/viper850_arm1.bnd rename to modules/robot/src/robot-simulator/arms/viper850_arm1.bnd diff --git a/src/robot/simulator-robot/arms/viper850_arm2.bnd b/modules/robot/src/robot-simulator/arms/viper850_arm2.bnd similarity index 100% rename from src/robot/simulator-robot/arms/viper850_arm2.bnd rename to modules/robot/src/robot-simulator/arms/viper850_arm2.bnd diff --git a/src/robot/simulator-robot/arms/viper850_arm3.bnd b/modules/robot/src/robot-simulator/arms/viper850_arm3.bnd similarity index 100% rename from src/robot/simulator-robot/arms/viper850_arm3.bnd rename to modules/robot/src/robot-simulator/arms/viper850_arm3.bnd diff --git a/src/robot/simulator-robot/arms/viper850_arm4.bnd b/modules/robot/src/robot-simulator/arms/viper850_arm4.bnd similarity index 100% rename from src/robot/simulator-robot/arms/viper850_arm4.bnd rename to modules/robot/src/robot-simulator/arms/viper850_arm4.bnd diff --git a/src/robot/simulator-robot/arms/viper850_arm5.bnd b/modules/robot/src/robot-simulator/arms/viper850_arm5.bnd similarity index 100% rename from src/robot/simulator-robot/arms/viper850_arm5.bnd rename to modules/robot/src/robot-simulator/arms/viper850_arm5.bnd diff --git a/src/robot/simulator-robot/arms/viper850_arm6.bnd b/modules/robot/src/robot-simulator/arms/viper850_arm6.bnd similarity index 100% rename from src/robot/simulator-robot/arms/viper850_arm6.bnd rename to modules/robot/src/robot-simulator/arms/viper850_arm6.bnd diff --git a/src/robot/simulator-robot/vpRobotCamera.cpp b/modules/robot/src/robot-simulator/vpRobotCamera.cpp similarity index 92% rename from src/robot/simulator-robot/vpRobotCamera.cpp rename to modules/robot/src/robot-simulator/vpRobotCamera.cpp index b9b206f93ed8fe38f3191999d1f3c0659d4482d9..a5fa825f11c2901d074e4a50da3cdad2309df527 100644 --- a/src/robot/simulator-robot/vpRobotCamera.cpp +++ b/modules/robot/src/robot-simulator/vpRobotCamera.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotCamera.cpp 2456 2010-01-07 10:33:12Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Defines the simplest robot : a free flying camera. * @@ -45,12 +41,14 @@ \brief class that defines the simplest robot : a free flying camera */ -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpRobotException.h> -#include <visp/vpDebug.h> -#include <visp/vpExponentialMap.h> +#include <visp3/robot/vpRobotCamera.h> + +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpExponentialMap.h> /*! Constructor. @@ -87,8 +85,7 @@ vpRobotCamera::vpRobotCamera() void vpRobotCamera::init() { nDof = 6; - eJe.resize(6,6) ; - eJe.setIdentity() ; + eJe.eye(6,6) ; eJeAvailable = true; fJeAvailable = false; areJointLimitsAvailable = false; @@ -281,3 +278,7 @@ vpRobotCamera::setPosition(const vpHomogeneousMatrix &cMw) this->cMw_ = cMw ; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpRobotCamera.cpp.o) has no symbols +void dummy_vpRobotCamera() {}; +#endif diff --git a/src/robot/simulator-robot/vpRobotSimulator.cpp b/modules/robot/src/robot-simulator/vpRobotSimulator.cpp similarity index 73% rename from src/robot/simulator-robot/vpRobotSimulator.cpp rename to modules/robot/src/robot-simulator/vpRobotSimulator.cpp index 92cf1ec747b80cf6f6d51ec18a94d024bc89fc9d..e80da79d85e7bf2d4e2caf05166db9850cfe1a59 100644 --- a/src/robot/simulator-robot/vpRobotSimulator.cpp +++ b/modules/robot/src/robot-simulator/vpRobotSimulator.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotSimulator.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Basic class used to make robot simulators. * @@ -39,9 +35,9 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#include <visp/vpRobotSimulator.h> +#include <visp3/robot/vpRobotSimulator.h> /*! Basic constructor that sets the sampling time by default to 40ms. diff --git a/src/robot/simulator-robot/vpRobotWireFrameSimulator.cpp b/modules/robot/src/robot-simulator/vpRobotWireFrameSimulator.cpp similarity index 94% rename from src/robot/simulator-robot/vpRobotWireFrameSimulator.cpp rename to modules/robot/src/robot-simulator/vpRobotWireFrameSimulator.cpp index e69b9bfb6c18c8bccb27b12da04ea86e47817dd1..91df555b8aeebae630e7a7e9058f1f3fb7ce6e9c 100644 --- a/src/robot/simulator-robot/vpRobotWireFrameSimulator.cpp +++ b/modules/robot/src/robot-simulator/vpRobotWireFrameSimulator.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotWireFrameSimulator.cpp 3530 2012-01-03 10:52:12Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Basic class used to make robot simulators. * @@ -39,13 +35,11 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> - - +#include <visp3/core/vpConfig.h> -#if defined(_WIN32) || defined(VISP_HAVE_PTHREAD) -#include <visp/vpRobotWireFrameSimulator.h> -#include <visp/vpSimulatorViper850.h> +#if defined(VISP_HAVE_MODULE_GUI) && (defined(_WIN32) || defined(VISP_HAVE_PTHREAD)) +#include <visp3/robot/vpRobotWireFrameSimulator.h> +#include <visp3/robot/vpSimulatorViper850.h> /*! Basic constructor @@ -372,4 +366,7 @@ vpRobotWireFrameSimulator::get_cMo() return cMoTemp; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpRobotWireFrameSimulator.cpp.o) has no symbols +void dummy_vpRobotWireFrameSimulator() {}; #endif diff --git a/src/robot/simulator-robot/vpSimulatorAfma6.cpp b/modules/robot/src/robot-simulator/vpSimulatorAfma6.cpp similarity index 95% rename from src/robot/simulator-robot/vpSimulatorAfma6.cpp rename to modules/robot/src/robot-simulator/vpSimulatorAfma6.cpp index 2a380134e58ea183f76f85b2f380885b2cb8a09a..a75ec2311c9da1e94892cb969971deeeda00389a 100644 --- a/src/robot/simulator-robot/vpSimulatorAfma6.cpp +++ b/modules/robot/src/robot-simulator/vpSimulatorAfma6.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulatorAfma6.cpp 2595 2010-06-02 08:50:59Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Class which provides a simulator for the robot Afma6. * @@ -41,15 +37,15 @@ -#include <visp/vpConfig.h> -#if defined(_WIN32) || defined(VISP_HAVE_PTHREAD) -#include <visp/vpSimulatorAfma6.h> -#include <visp/vpTime.h> -#include <visp/vpImagePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpRobotException.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpConfig.h> +#if defined(VISP_HAVE_MODULE_GUI) && (defined(_WIN32) || defined(VISP_HAVE_PTHREAD)) +#include <visp3/robot/vpSimulatorAfma6.h> +#include <visp3/core/vpTime.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpIoTools.h> #include <cmath> // std::fabs #include <limits> // numeric_limits #include <string> @@ -196,9 +192,16 @@ void vpSimulatorAfma6::init() { // set arm_dir from #define VISP_ROBOT_ARMS_DIR if it exists - if (vpIoTools::checkDirectory(VISP_ROBOT_ARMS_DIR) == true) // directory exists - arm_dir = VISP_ROBOT_ARMS_DIR; - else { + // VISP_ROBOT_ARMS_DIR may contain multiple locations separated by ";" + std::vector<std::string> arm_dirs = vpIoTools::splitChain(std::string(VISP_ROBOT_ARMS_DIR), std::string(";")); + bool armDirExists = false; + for(size_t i=0; i < arm_dirs.size(); i++) + if (vpIoTools::checkDirectory(arm_dirs[i]) == true) { // directory exists + arm_dir = arm_dirs[i]; + armDirExists = true; + break; + } + if (! armDirExists) { try { arm_dir = vpIoTools::getenv("VISP_ROBOT_ARMS_DIR"); std::cout << "The simulator uses data from VISP_ROBOT_ARMS_DIR=" << arm_dir << std::endl; @@ -581,8 +584,7 @@ vpSimulatorAfma6::updateArticularPosition() //vpDisplay::displayFrame(I,getExternalCameraPosition ()*fMi[6],cameraParam,0.2,vpColor::none); vpImagePoint iP, iP_1; - vpPoint pt; - pt.setWorldCoordinates (0,0,0); + vpPoint pt(0,0,0); pt.track(getExternalCameraPosition ()); vpMeterPixelConversion::convertPoint (cameraParam, pt.get_x(), pt.get_y(), iP_1); @@ -608,7 +610,7 @@ vpSimulatorAfma6::updateArticularPosition() vpTime::wait( tcur, 1000*getSamplingTime() ); tcur_1 = tcur; }else{ - vpTime::wait(tcur, vpTime::minTimeForUsleepCall); + vpTime::wait(tcur, vpTime::getMinTimeForUsleepCall()); } } } @@ -831,10 +833,10 @@ vpSimulatorAfma6::setRobotState(vpRobot::vpRobotStateType newState) setMaxTranslationVelocity() and setMaxRotationVelocity(). \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorAfma6.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorAfma6.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -1068,9 +1070,9 @@ vpSimulatorAfma6::computeArticularVelocity() z, \dot {\theta U}_x, \dot {\theta U}_y, \dot {\theta U}_z]\f$. \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorAfma6.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorAfma6.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1176,9 +1178,9 @@ vpSimulatorAfma6::getVelocity (const vpRobot::vpControlFrameType frame, vpColVec and rotations in rad/s. \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorAfma6.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorAfma6.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1289,9 +1291,9 @@ vpSimulatorAfma6::findHighestPositioningSpeed(vpColVector &q) position is out of range. \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorAfma6.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorAfma6.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1509,8 +1511,8 @@ vpSimulatorAfma6::setPosition(const vpRobot::vpControlFrameType frame,const vpCo position is out of range. \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorAfma6.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorAfma6.h> int main() { @@ -1574,9 +1576,9 @@ void vpSimulatorAfma6::setPosition (const vpRobot::vpControlFrameType frame, This method has the same behavior than the sample code given below; \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorAfma6.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorAfma6.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1632,16 +1634,16 @@ void vpSimulatorAfma6::setPosition(const char *filename) - in reference frame, a 6 dimension vector, the first 3 values correspond to the translation tx, ty, tz in meters (like a vpTranslationVector), and the last 3 values to the rx, ry, rz rotation (like a vpRxyzVector). The code - below show how to convert this position into a vpHomogenousMatrix: + below show how to convert this position into a vpHomogeneousMatrix: \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorAfma6.h> -#include <visp/vpColVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorAfma6.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> int main() { @@ -1663,7 +1665,7 @@ int main() vpRotationMatrix fRc(frc); // reference frame to camera frame rotation matrix // Create the camera to fix frame transformation in terms of a - // homogenous matrix + // homogeneous matrix vpHomogeneousMatrix fMc(fRc, ftc); } \endcode @@ -1742,7 +1744,7 @@ vpSimulatorAfma6::getPosition(const vpRobot::vpControlFrameType frame, vpColVect - in reference frame, a 6 dimension vector, the first 3 values correspond to the translation tx, ty, tz in meters (like a vpTranslationVector), and the last 3 values to the rx, ry, rz rotation (like a vpRxyzVector). The code - below show how to convert this position into a vpHomogenousMatrix: + below show how to convert this position into a vpHomogeneousMatrix: \param timestamp : Unix time in second since January 1st 1970. @@ -1774,7 +1776,7 @@ vpSimulatorAfma6::getPosition (const vpRobot::vpControlFrameType frame, vpPoseVe this->getPosition(frame,posRxyz); //recupere le vecteur thetaU correspondant - vpThetaUVector RtuVect(posRxyz[3],posRxyz[4],posRxyz[5]); + vpThetaUVector RtuVect(vpRxyzVector(posRxyz[3],posRxyz[4],posRxyz[5])); //remplit le vpPoseVector avec translation et rotation ThetaU for(unsigned int j=0;j<3;j++) @@ -2298,10 +2300,17 @@ void vpSimulatorAfma6::initArms() { // set scene_dir from #define VISP_SCENE_DIR if it exists + // VISP_SCENES_DIR may contain multiple locations separated by ";" std::string scene_dir_; - if (vpIoTools::checkDirectory(VISP_SCENES_DIR) == true) // directory exists - scene_dir_ = VISP_SCENES_DIR; - else { + std::vector<std::string> scene_dirs = vpIoTools::splitChain(std::string(VISP_SCENES_DIR), std::string(";")); + bool sceneDirExists = false; + for(size_t i=0; i < scene_dirs.size(); i++) + if (vpIoTools::checkDirectory(scene_dirs[i]) == true) { // directory exists + scene_dir_ = scene_dirs[i]; + sceneDirExists = true; + break; + } + if (! sceneDirExists) { try { scene_dir_ = vpIoTools::getenv("VISP_SCENES_DIR"); std::cout << "The simulator uses data from VISP_SCENES_DIR=" << scene_dir_ << std::endl; @@ -2311,6 +2320,7 @@ vpSimulatorAfma6::initArms() } } + unsigned int name_length = 30; // the size of this kind of string "/afma6_arm2.bnd" if (scene_dir_.size() > FILENAME_MAX) throw vpException (vpException::dimensionError, "Cannot initialize Afma6 simulator"); @@ -2333,6 +2343,7 @@ vpSimulatorAfma6::initArms() char *name_arm = new char [full_length]; strcpy(name_arm, arm_dir.c_str()); strcat(name_arm,"/afma6_gate.bnd"); + std::cout <<"name arm: " << name_arm << std::endl; set_scene(name_arm, robotArms, 1.0); strcpy(name_arm, arm_dir.c_str()); strcat(name_arm,"/afma6_arm1.bnd"); @@ -2577,14 +2588,14 @@ vpSimulatorAfma6::setPosition(const vpHomogeneousMatrix &cdMo_, vpImage<unsigned } // update pose error - cdMc = cdMo_*get_cMo().inverse(); + cdMc = cdMo_*get_cMo().inverse(); cdMc.extract(cdRc); cdMc.extract(cdTc); cdTUc.buildFrom(cdRc); // compute v,w and velocity - v = -lambda*cdRc.t()*cdTc; - w = -lambda*cdTUc; + v = -lambda*cdRc.t()*cdTc; + w = -lambda*cdTUc; for(i=0;i<3;++i) { vel[i] = v[i]; @@ -2609,4 +2620,7 @@ vpSimulatorAfma6::setPosition(const vpHomogeneousMatrix &cdMo_, vpImage<unsigned return(err.euclideanNorm()<= errMax); } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpSimulatorAfma6.cpp.o) has no symbols +void dummy_vpSimulatorAfma6() {}; #endif diff --git a/src/robot/simulator-robot/vpSimulatorCamera.cpp b/modules/robot/src/robot-simulator/vpSimulatorCamera.cpp similarity index 91% rename from src/robot/simulator-robot/vpSimulatorCamera.cpp rename to modules/robot/src/robot-simulator/vpSimulatorCamera.cpp index f88eda38bdf6005445906c2c37a8b9a57c3c4fcd..572139c01162e46ef56c45dd423d04c6c26c1fae 100644 --- a/src/robot/simulator-robot/vpSimulatorCamera.cpp +++ b/modules/robot/src/robot-simulator/vpSimulatorCamera.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulatorCamera.cpp 2456 2010-01-07 10:33:12Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Defines the simplest robot : a free flying camera. * @@ -45,11 +41,11 @@ \brief class that defines the simplest robot : a free flying camera */ -#include <visp/vpDebug.h> -#include <visp/vpExponentialMap.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRobotException.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpExponentialMap.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/robot/vpSimulatorCamera.h> /*! @@ -72,8 +68,7 @@ vpSimulatorCamera::vpSimulatorCamera() : wMc_() void vpSimulatorCamera::init() { nDof = 6; - eJe.resize(6,6) ; - eJe.setIdentity() ; + eJe.eye(6,6) ; eJeAvailable = true; fJeAvailable = false; areJointLimitsAvailable = false; @@ -124,7 +119,7 @@ vpSimulatorCamera::get_eJe(vpMatrix &eJe_) } /*! - Get the robot position in the world frame. + Get the camera position in the world frame. */ void @@ -132,9 +127,18 @@ vpSimulatorCamera::getPosition(vpHomogeneousMatrix &wMc) const { wMc = this->wMc_ ; } +/*! + Return the camera position in the world frame. + +*/ +vpHomogeneousMatrix +vpSimulatorCamera::getPosition() const +{ + return(this->wMc_); +} /* - Get the current position of the robot. + Get the current position of the camera. \param frame : Control frame type in which to get the position, either : - in the camera cartesien frame, diff --git a/src/robot/simulator-robot/vpSimulatorPioneer.cpp b/modules/robot/src/robot-simulator/vpSimulatorPioneer.cpp similarity index 92% rename from src/robot/simulator-robot/vpSimulatorPioneer.cpp rename to modules/robot/src/robot-simulator/vpSimulatorPioneer.cpp index eb664593fbcc1813b66c7c14c1124aa948ba559f..43c46e03c5aa37bda1f7232957078e63936fd3e8 100644 --- a/src/robot/simulator-robot/vpSimulatorPioneer.cpp +++ b/modules/robot/src/robot-simulator/vpSimulatorPioneer.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulatorPioneer.cpp 2456 2010-01-07 10:33:12Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pioneer mobile robot simulator without display. * @@ -46,11 +42,11 @@ */ -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpSimulatorPioneer.h> -#include <visp/vpRobotException.h> -#include <visp/vpDebug.h> -#include <visp/vpExponentialMap.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/robot/vpSimulatorPioneer.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpExponentialMap.h> /*! diff --git a/src/robot/simulator-robot/vpSimulatorPioneerPan.cpp b/modules/robot/src/robot-simulator/vpSimulatorPioneerPan.cpp similarity index 92% rename from src/robot/simulator-robot/vpSimulatorPioneerPan.cpp rename to modules/robot/src/robot-simulator/vpSimulatorPioneerPan.cpp index 25c82817dc4163674d6e5455da46ab7ae34b3576..480e0a0ba903197e52bdc674be3c85718ae852fa 100644 --- a/src/robot/simulator-robot/vpSimulatorPioneerPan.cpp +++ b/modules/robot/src/robot-simulator/vpSimulatorPioneerPan.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulatorPioneerPan.cpp 2456 2010-01-07 10:33:12Z nmelchio $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pioneer mobile robot equipped with a pan head simulator without display. * @@ -46,11 +42,11 @@ with a camera able to move in pan. */ -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpSimulatorPioneerPan.h> -#include <visp/vpRobotException.h> -#include <visp/vpDebug.h> -#include <visp/vpExponentialMap.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/robot/vpSimulatorPioneerPan.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpExponentialMap.h> /*! diff --git a/src/robot/simulator-robot/vpSimulatorViper850.cpp b/modules/robot/src/robot-simulator/vpSimulatorViper850.cpp similarity index 95% rename from src/robot/simulator-robot/vpSimulatorViper850.cpp rename to modules/robot/src/robot-simulator/vpSimulatorViper850.cpp index 9286b2a3ba374640d04ecad06b8f22258ecf93bc..28bf91505b535b7d1162004a380b0eb3acbd3251 100644 --- a/src/robot/simulator-robot/vpSimulatorViper850.cpp +++ b/modules/robot/src/robot-simulator/vpSimulatorViper850.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSimulatorViper850.cpp 5171 2015-01-15 15:11:54Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Class which provides a simulator for the robot Viper850. * @@ -41,16 +37,18 @@ -#include <visp/vpSimulatorViper850.h> -#include <visp/vpTime.h> -#include <visp/vpImagePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpIoTools.h> +#include <visp3/robot/vpSimulatorViper850.h> + +#if defined(VISP_HAVE_MODULE_GUI) && (defined(_WIN32) || defined(VISP_HAVE_PTHREAD)) + +#include <visp3/core/vpTime.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpIoTools.h> #include <cmath> // std::fabs #include <limits> // numeric_limits #include <string> -#if defined(_WIN32) || defined(VISP_HAVE_PTHREAD) const double vpSimulatorViper850::defaultPositioningVelocity = 25.0; @@ -195,9 +193,16 @@ void vpSimulatorViper850::init() { // set arm_dir from #define VISP_ROBOT_ARMS_DIR if it exists - if (vpIoTools::checkDirectory(VISP_ROBOT_ARMS_DIR) == true) // directory exists - arm_dir = VISP_ROBOT_ARMS_DIR; - else { + // VISP_ROBOT_ARMS_DIR may contain multiple locations separated by ";" + std::vector<std::string> arm_dirs = vpIoTools::splitChain(std::string(VISP_ROBOT_ARMS_DIR), std::string(";")); + bool armDirExists = false; + for(size_t i=0; i < arm_dirs.size(); i++) + if (vpIoTools::checkDirectory(arm_dirs[i]) == true) { // directory exists + arm_dir = arm_dirs[i]; + armDirExists = true; + break; + } + if (! armDirExists) { try { arm_dir = vpIoTools::getenv("VISP_ROBOT_ARMS_DIR"); std::cout << "The simulator uses data from VISP_ROBOT_ARMS_DIR=" << arm_dir << std::endl; @@ -523,8 +528,7 @@ vpSimulatorViper850::updateArticularPosition() //vpDisplay::displayFrame(I,getExternalCameraPosition ()*fMi[6],cameraParam,0.2,vpColor::none); vpImagePoint iP, iP_1; - vpPoint pt; - pt.setWorldCoordinates (0,0,0); + vpPoint pt(0,0,0); pt.track(getExternalCameraPosition ()); vpMeterPixelConversion::convertPoint (cameraParam, pt.get_x(), pt.get_y(), iP_1); @@ -549,7 +553,7 @@ vpSimulatorViper850::updateArticularPosition() vpTime::wait( tcur, 1000 * getSamplingTime() ); tcur_1 = tcur; }else{ - vpTime::wait(tcur, vpTime::minTimeForUsleepCall); + vpTime::wait(tcur, vpTime::getMinTimeForUsleepCall()); } } } @@ -786,10 +790,10 @@ vpSimulatorViper850::setRobotState(vpRobot::vpRobotStateType newState) setMaxTranslationVelocity() and setMaxRotationVelocity(). \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorViper850.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorViper850.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> int main() { @@ -1023,9 +1027,9 @@ vpSimulatorViper850::computeArticularVelocity() z, \dot {\theta U}_x, \dot {\theta U}_y, \dot {\theta U}_z]\f$. \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorViper850.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorViper850.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1131,9 +1135,9 @@ vpSimulatorViper850::getVelocity (const vpRobot::vpControlFrameType frame, vpCol and rotations in rad/s. \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorViper850.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorViper850.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1244,9 +1248,9 @@ vpSimulatorViper850::findHighestPositioningSpeed(vpColVector &q) position is out of range. \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorViper850.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorViper850.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1464,8 +1468,8 @@ vpSimulatorViper850::setPosition(const vpRobot::vpControlFrameType frame,const v position is out of range. \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorViper850.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorViper850.h> int main() { @@ -1529,9 +1533,9 @@ void vpSimulatorViper850::setPosition (const vpRobot::vpControlFrameType frame, This method has the same behavior than the sample code given below; \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorViper850.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorViper850.h> +#include <visp3/core/vpColVector.h> int main() { @@ -1587,16 +1591,16 @@ void vpSimulatorViper850::setPosition(const char *filename) - in reference frame, a 6 dimension vector, the first 3 values correspond to the translation tx, ty, tz in meters (like a vpTranslationVector), and the last 3 values to the rx, ry, rz rotation (like a vpRxyzVector). The code - below show how to convert this position into a vpHomogenousMatrix: + below show how to convert this position into a vpHomogeneousMatrix: \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorViper850.h> -#include <visp/vpColVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorViper850.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> int main() { @@ -1618,7 +1622,7 @@ int main() vpRotationMatrix fRc(frc); // reference frame to camera frame rotation matrix // Create the camera to fix frame transformation in terms of a - // homogenous matrix + // homogeneous matrix vpHomogeneousMatrix fMc(fRc, ftc); } \endcode @@ -1697,7 +1701,7 @@ vpSimulatorViper850::getPosition(const vpRobot::vpControlFrameType frame, vpColV - in reference frame, a 6 dimension vector, the first 3 values correspond to the translation tx, ty, tz in meters (like a vpTranslationVector), and the last 3 values to the rx, ry, rz rotation (like a vpRxyzVector). The code - below show how to convert this position into a vpHomogenousMatrix: + below show how to convert this position into a vpHomogeneousMatrix: \param timestamp : Unix time in second since January 1st 1970. @@ -1730,7 +1734,7 @@ vpSimulatorViper850::getPosition (const vpRobot::vpControlFrameType frame, this->getPosition(frame,posRxyz); //recupere le vecteur thetaU correspondant - vpThetaUVector RtuVect(posRxyz[3],posRxyz[4],posRxyz[5]); + vpThetaUVector RtuVect(vpRxyzVector(posRxyz[3],posRxyz[4],posRxyz[5])); //remplit le vpPoseVector avec translation et rotation ThetaU for(unsigned int j=0;j<3;j++) @@ -2024,9 +2028,9 @@ an error occurs. The code below shows how to read a position from a file and move the robot to this position. \code -#include <visp/vpConfig.h> -#include <visp/vpSimulatorViper850.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpSimulatorViper850.h> +#include <visp3/core/vpColVector.h> int main() { @@ -2290,10 +2294,17 @@ void vpSimulatorViper850::initArms() { // set scene_dir from #define VISP_SCENE_DIR if it exists + // VISP_SCENES_DIR may contain multiple locations separated by ";" std::string scene_dir_; - if (vpIoTools::checkDirectory(VISP_SCENES_DIR) == true) // directory exists - scene_dir_ = VISP_SCENES_DIR; - else { + std::vector<std::string> scene_dirs = vpIoTools::splitChain(std::string(VISP_SCENES_DIR), std::string(";")); + bool sceneDirExists = false; + for(size_t i=0; i < scene_dirs.size(); i++) + if (vpIoTools::checkDirectory(scene_dirs[i]) == true) { // directory exists + scene_dir_ = scene_dirs[i]; + sceneDirExists = true; + break; + } + if (! sceneDirExists) { try { scene_dir_ = vpIoTools::getenv("VISP_SCENES_DIR"); std::cout << "The simulator uses data from VISP_SCENES_DIR=" << scene_dir_ << std::endl; @@ -2513,4 +2524,7 @@ vpSimulatorViper850::initialiseObjectRelativeToCamera(const vpHomogeneousMatrix fMo = fMit[7] * cMo_; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_robot.a(vpSimulatorViper850.cpp.o) has no symbols +void dummy_vpSimulatorViper850() {}; #endif diff --git a/src/robot/robot/vpRobot.cpp b/modules/robot/src/vpRobot.cpp similarity index 93% rename from src/robot/robot/vpRobot.cpp rename to modules/robot/src/vpRobot.cpp index e8addbcd7fadae892c19287865054a3dbef1f529..ab60f958e0d69557e0a7d23d201eddf11974e180 100644 --- a/src/robot/robot/vpRobot.cpp +++ b/modules/robot/src/vpRobot.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobot.cpp 5238 2015-01-30 13:52:25Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Generic virtual robot. * @@ -39,9 +35,9 @@ * *****************************************************************************/ -#include <visp/vpRobot.h> -#include <visp/vpRobotException.h> -#include <visp/vpDebug.h> +#include <visp3/robot/vpRobot.h> +#include <visp3/robot/vpRobotException.h> +#include <visp3/core/vpDebug.h> const double vpRobot::maxTranslationVelocityDefault = 0.2; @@ -132,7 +128,7 @@ vpRobot & vpRobot::operator=(const vpRobot &robot) \code #include <iostream> -#include <visp/vpRobot.h> +#include <visp3/robot/vpRobot.h> int main() { diff --git a/src/robot/robot/vpRobotTemplate.cpp b/modules/robot/src/vpRobotTemplate.cpp similarity index 90% rename from src/robot/robot/vpRobotTemplate.cpp rename to modules/robot/src/vpRobotTemplate.cpp index 441da2247258033f61b216d75b81edcd90cd64f4..26dd6454e2c002fca499252a567a2254d621eca5 100644 --- a/src/robot/robot/vpRobotTemplate.cpp +++ b/modules/robot/src/vpRobotTemplate.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpRobotTemplate.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Defines a robot just to show which function you must implement. * @@ -45,9 +41,9 @@ \brief class that defines a robot just to show which function you must implement */ -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRobotTemplate.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/robot/vpRobotTemplate.h> +#include <visp3/core/vpDebug.h> //! basic initialization void vpRobotTemplate::init() diff --git a/src/simulator/wireframe-simulator/core/vpArit.cpp b/modules/robot/src/wireframe-simulator/core/vpArit.cpp old mode 100755 new mode 100644 similarity index 96% rename from src/simulator/wireframe-simulator/core/vpArit.cpp rename to modules/robot/src/wireframe-simulator/core/vpArit.cpp index d4ca6a5ced84f7d73de20a3d0c36698e2727955c..8c2a0044c93ded5c1a582f544d1bbca6e4d7740f --- a/src/simulator/wireframe-simulator/core/vpArit.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpArit.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpArit.cpp 5284 2015-02-09 14:24:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -38,26 +35,12 @@ * *****************************************************************************/ - - - - -#include <visp/vpMy.h> -#include <visp/vpArit.h> -#include <stdio.h> -#include <math.h> -#include <string.h> - -#if defined(VISP_USE_MSVC) -# ifndef M_PI -# define M_PI 3.14159265358979323846 -# endif -# ifndef M_PI_2 -# define M_PI_2 M_PI / 2 -# endif -#endif - - +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> +#include <visp3/core/vpMath.h> +#include <stdio.h> +#include <math.h> +#include <string.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS /* diff --git a/src/simulator/wireframe-simulator/core/vpAritio.cpp b/modules/robot/src/wireframe-simulator/core/vpAritio.cpp old mode 100755 new mode 100644 similarity index 87% rename from src/simulator/wireframe-simulator/core/vpAritio.cpp rename to modules/robot/src/wireframe-simulator/core/vpAritio.cpp index 716db6ea61ce1326673413a1eb7e5f32fd240d8d..5ecbb39b73d2cac920ba3f9116886dff520c0f65 --- a/src/simulator/wireframe-simulator/core/vpAritio.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpAritio.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpAritio.cpp 5284 2015-02-09 14:24:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -44,13 +41,13 @@ -#include "visp/vpConfig.h" +#include "visp3/core/vpConfig.h" #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpMy.h> -#include <visp/vpArit.h> -#include <visp/vpToken.h> -#include <visp/vpLex.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> +#include <visp3/robot/vpToken.h> +#include <visp3/robot/vpLex.h> #include <stdio.h> /* diff --git a/src/simulator/wireframe-simulator/core/vpBound.cpp b/modules/robot/src/wireframe-simulator/core/vpBound.cpp old mode 100755 new mode 100644 similarity index 91% rename from src/simulator/wireframe-simulator/core/vpBound.cpp rename to modules/robot/src/wireframe-simulator/core/vpBound.cpp index 1a875159a37c35c80114771462f57d25b917b67e..39fb314b4d9e476878debaa9cb94db3d23dd6e74 --- a/src/simulator/wireframe-simulator/core/vpBound.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpBound.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpBound.cpp 5284 2015-02-09 14:24:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -41,12 +38,12 @@ -#include "visp/vpConfig.h" +#include "visp3/core/vpConfig.h" #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpMy.h> -#include <visp/vpArit.h> -#include <visp/vpBound.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> +#include <visp3/robot/vpBound.h> #include <errno.h> #include <math.h> #include <stdio.h> @@ -163,7 +160,7 @@ void malloc_Bound (Bound *bp, Type type, int polygonal, Index fn, Index pn) bp->type = type; bp->is_display = TRUE; - bp->is_polygonal = polygonal; + bp->is_polygonal = (unsigned)polygonal; } /* diff --git a/src/simulator/wireframe-simulator/core/vpBoundio.cpp b/modules/robot/src/wireframe-simulator/core/vpBoundio.cpp old mode 100755 new mode 100644 similarity index 86% rename from src/simulator/wireframe-simulator/core/vpBoundio.cpp rename to modules/robot/src/wireframe-simulator/core/vpBoundio.cpp index fe971a0ac15ecde7ebb09d1909dd805608ed24be..f90495e989f501a16ec2febb476469cbec3bc400 --- a/src/simulator/wireframe-simulator/core/vpBoundio.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpBoundio.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpBoundio.cpp 5284 2015-02-09 14:24:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -43,16 +40,16 @@ *****************************************************************************/ -#include "visp/vpConfig.h" +#include "visp3/core/vpConfig.h" #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpMy.h> -#include <visp/vpArit.h> -#include <visp/vpBound.h> -#include <visp/vpToken.h> -#include <visp/vpSkipio.h> -#include <visp/vpLex.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> +#include <visp3/robot/vpBound.h> +#include <visp3/robot/vpToken.h> +#include <visp3/robot/vpSkipio.h> +#include <visp3/robot/vpLex.h> #include <errno.h> #include <stdio.h> @@ -123,7 +120,7 @@ void fscanf_Face_list (Face_list *lp) fp = lp->ptr; fend = fp + lp->nbr; for (; fp < fend; fp++) { - Vertex_list *lp = &fp->vertex; + Vertex_list *vlp = &fp->vertex; Index *vp; /* sommet courant */ Index *vend; /* borne de "vp" */ @@ -137,13 +134,13 @@ void fscanf_Face_list (Face_list *lp) if (lex () != T_INT) lexerr ("start", "integer expected (number of vertices)", NULL); - lp->nbr = (Index) myint; + vlp->nbr = (Index) myint; /* Allocation dynamique du polygone de la face. */ - if (lp->nbr <= DEFAULT_VSIZE) - lp->ptr = lp->tbl; - else if ((lp->ptr = (Index *) malloc (lp->nbr * sizeof (Index))) + if (vlp->nbr <= DEFAULT_VSIZE) + vlp->ptr = vlp->tbl; + else if ((vlp->ptr = (Index *) malloc (vlp->nbr * sizeof (Index))) == NULL) { perror (proc_name); exit (1); @@ -151,8 +148,8 @@ void fscanf_Face_list (Face_list *lp) /* Lecture des sommets de la face un a un. */ - vp = lp->ptr; - vend = vp + lp->nbr; + vp = vlp->ptr; + vend = vp + vlp->nbr; for (; vp < vend; *vp++ = (Index) myint) if (lex () != T_INT) lexerr ("start", "integer expected (index of points 3D)", NULL); diff --git a/src/simulator/wireframe-simulator/core/vpClipping.cpp b/modules/robot/src/wireframe-simulator/core/vpClipping.cpp old mode 100755 new mode 100644 similarity index 96% rename from src/simulator/wireframe-simulator/core/vpClipping.cpp rename to modules/robot/src/wireframe-simulator/core/vpClipping.cpp index 63c34136e4007d5eecc73a3429522b3ee5bd77af..61234b9bf0732f93d3d7832fb37e1b73ffb89039 --- a/src/simulator/wireframe-simulator/core/vpClipping.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpClipping.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpClipping.cpp 5285 2015-02-09 14:32:54Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -49,13 +46,13 @@ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpMy.h> -#include <visp/vpArit.h> -#include <visp/vpBound.h> -#include <visp/vpView.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> +#include <visp3/robot/vpBound.h> +#include <visp3/robot/vpView.h> #include <stdio.h> #include <stdlib.h> #include <limits> diff --git a/src/simulator/wireframe-simulator/core/vpCoreDisplay.cpp b/modules/robot/src/wireframe-simulator/core/vpCoreDisplay.cpp old mode 100755 new mode 100644 similarity index 90% rename from src/simulator/wireframe-simulator/core/vpCoreDisplay.cpp rename to modules/robot/src/wireframe-simulator/core/vpCoreDisplay.cpp index 6cc784b043f255def543a13867e77d17c455cc18..ae00a709d3523907df92c1ec5c8c57c8afeeb37b --- a/src/simulator/wireframe-simulator/core/vpCoreDisplay.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpCoreDisplay.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpCoreDisplay.cpp 5294 2015-02-10 09:41:38Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -42,7 +39,7 @@ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS #include <stdio.h> @@ -54,15 +51,15 @@ #include "cgidefs.h" #endif /* suncgi */ -#include <visp/vpMy.h> -#include <visp/vpArit.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> //#include "graph.h" -#include <visp/vpBound.h> -#include <visp/vpView.h> -#include <visp/vpImstack.h> -#include <visp/vpRfstack.h> -#include <visp/vpVwstack.h> +#include <visp3/robot/vpBound.h> +#include <visp3/robot/vpView.h> +#include <visp3/robot/vpImstack.h> +#include <visp3/robot/vpRfstack.h> +#include <visp3/robot/vpVwstack.h> /* diff --git a/src/simulator/wireframe-simulator/core/vpKeyword.cpp b/modules/robot/src/wireframe-simulator/core/vpKeyword.cpp old mode 100755 new mode 100644 similarity index 90% rename from src/simulator/wireframe-simulator/core/vpKeyword.cpp rename to modules/robot/src/wireframe-simulator/core/vpKeyword.cpp index d89143ab201744d41f7151febf499cb790c5d9d0..0c5a3272cf52290f6891268363dcba8223d24d93 --- a/src/simulator/wireframe-simulator/core/vpKeyword.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpKeyword.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpKeyword.cpp 5310 2015-02-11 11:57:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -42,8 +39,8 @@ -#include <visp/vpMy.h> -#include <visp/vpToken.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpToken.h> #include <stdio.h> #include <stdlib.h> @@ -157,13 +154,13 @@ hashpjw (const char *str) unsigned g; for (; *str != '\0'; str++) { - h = (h << 4) + *str; - if ((g = h & ~0xfffffff) != 0) { + h = (h << 4) + (unsigned)(*str); + if ((g = h & ~0xfffffff) != 0) { h ^= g >> 24; h ^= g; } } - return (h % PRIME); + return ((int)(h % PRIME)); } @@ -221,8 +218,8 @@ Index get_symbol (char *ident, int length) unsigned g; for (; len != 0; idn++, len--) { - h = (h << 4) + *idn; - if ((g = h & ~0xfffffff) != 0) { + h = (h << 4) + (unsigned)(*idn); + if ((g = h & ~0xfffffff) != 0) { h ^= g >> 24; h ^= g; } diff --git a/src/simulator/wireframe-simulator/core/vpLex.cpp b/modules/robot/src/wireframe-simulator/core/vpLex.cpp old mode 100755 new mode 100644 similarity index 95% rename from src/simulator/wireframe-simulator/core/vpLex.cpp rename to modules/robot/src/wireframe-simulator/core/vpLex.cpp index 108ac694dd050ad53fb54fcf3227b452588ae97d..a7ca1db85c59abe1a0523d604456abc313cc0b92 --- a/src/simulator/wireframe-simulator/core/vpLex.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpLex.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpLex.cpp 5310 2015-02-11 11:57:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -44,9 +41,9 @@ -#include <visp/vpMy.h> -#include <visp/vpToken.h> -#include <visp/vpKeyword.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpToken.h> +#include <visp3/robot/vpKeyword.h> #include <ctype.h> #include <math.h> @@ -150,7 +147,7 @@ const char *lex_errtbl[] = { /* table des messages d'erreur */ char *mytext = NULL; int mylength = 0; int mylineno = 1; -int mycolumno = 0; +unsigned int mycolumno = 0; float myfloat = 0.0; int myint = 0; @@ -511,7 +508,7 @@ comment : for (; isidnt((int)CURC); mysptr++) {}; mylength = (int)(mysptr - mytext); if (token != get_symbol (mytext, mylength)) - fwrite (mytext, mylength, 1, f); + fwrite (mytext, (size_t)mylength, 1, f); return (get_symbol (mytext, mylength)); break; case INTT : @@ -526,7 +523,7 @@ float_part : for (; isintt((int)CURC); mysptr++) {}; if (CURC != 'E' && CURC != 'e') { if (token != T_FLOAT) - fwrite (mytext, mysptr - mytext, 1, f); + fwrite (mytext, (size_t)(mysptr - mytext), 1, f); return (T_FLOAT); } break; @@ -538,17 +535,17 @@ float_part : else { mysptr--; if (token != T_FLOAT) - fwrite (mytext, mysptr - mytext, 1, f); + fwrite (mytext, (size_t)(mysptr - mytext), 1, f); return (T_FLOAT); } for (; isintt((int)CURC); mysptr++) {}; if (token != T_FLOAT) - fwrite (mytext, mysptr - mytext, 1, f); + fwrite (mytext, (size_t)(mysptr - mytext), 1, f); return (T_FLOAT); break; default : if (token != T_INT) - fwrite (mytext, mysptr - mytext, 1, f); + fwrite (mytext, (size_t)(mysptr - mytext), 1, f); return (T_INT); break; } @@ -732,7 +729,7 @@ static void count (void) mycolumno = 0; for (str = myline; str <= mytext; str++) { - (*str == '\t') ? mycolumno += 8 - (mycolumno % 8u) : mycolumno++; + (*str == '\t') ? mycolumno += 8 - (mycolumno % 8) : mycolumno++; } } diff --git a/src/simulator/wireframe-simulator/core/vpMyio.cpp b/modules/robot/src/wireframe-simulator/core/vpMyio.cpp old mode 100755 new mode 100644 similarity index 80% rename from src/simulator/wireframe-simulator/core/vpMyio.cpp rename to modules/robot/src/wireframe-simulator/core/vpMyio.cpp index 3eca168a6dc36ad04d99ad294f9fd6418e7c269e..0bfc687a9da2335f28f290c808b6509f53c8d6a3 --- a/src/simulator/wireframe-simulator/core/vpMyio.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpMyio.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpMyio.cpp 5284 2015-02-09 14:24:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -45,9 +42,9 @@ -#include <visp/vpMy.h> -#include <visp/vpToken.h> -#include <visp/vpLex.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpToken.h> +#include <visp3/robot/vpLex.h> #include <stdio.h> #include <stdlib.h> @@ -106,16 +103,16 @@ void fscanf_string (char **str) if (lex () != T_STRING) lexerr ("start", "string expected", NULL); if (*str == NULL) - *str = (char *) malloc ((mylength + 1) * sizeof (char)); + *str = (char *) malloc ((size_t)(mylength + 1) * sizeof (char)); else - *str = (char *) realloc (*str, (mylength + 1) * sizeof (char)); + *str = (char *) realloc (*str, (size_t)(mylength + 1) * sizeof (char)); if (*str == NULL) { printf("Unable to read the string: bad memory allocation"); return; } - strncpy (*str, mytext, mylength); + strncpy (*str, mytext, (size_t)mylength); } /* diff --git a/src/simulator/wireframe-simulator/core/vpParser.cpp b/modules/robot/src/wireframe-simulator/core/vpParser.cpp old mode 100755 new mode 100644 similarity index 79% rename from src/simulator/wireframe-simulator/core/vpParser.cpp rename to modules/robot/src/wireframe-simulator/core/vpParser.cpp index e5092b64ddc83632ad78f68eb86c1ce185c86f5d..8f43d30b89028def7fd5250de2e4f79061b7c76c --- a/src/simulator/wireframe-simulator/core/vpParser.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpParser.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpParser.cpp 5284 2015-02-09 14:24:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -43,13 +40,13 @@ -#include <visp/vpMy.h> -#include <visp/vpArit.h> -#include <visp/vpView.h> -#include <visp/vpBound.h> -#include <visp/vpToken.h> -#include <visp/vpLex.h> -#include <visp/vpSkipio.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> +#include <visp3/robot/vpView.h> +#include <visp3/robot/vpBound.h> +#include <visp3/robot/vpToken.h> +#include <visp3/robot/vpLex.h> +#include <visp3/robot/vpSkipio.h> #include <stdio.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/simulator/wireframe-simulator/core/vpProjection.cpp b/modules/robot/src/wireframe-simulator/core/vpProjection.cpp old mode 100755 new mode 100644 similarity index 92% rename from src/simulator/wireframe-simulator/core/vpProjection.cpp rename to modules/robot/src/wireframe-simulator/core/vpProjection.cpp index f0f2acacfc0a8e32ce7ddfda502c09989c33cc76..287ccc6bb3129f7a4de8e999d88aed27807596a7 --- a/src/simulator/wireframe-simulator/core/vpProjection.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpProjection.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpProjection.cpp 5284 2015-02-09 14:24:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -44,12 +41,12 @@ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpMy.h> -#include <visp/vpArit.h> -#include <visp/vpView.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> +#include <visp3/robot/vpView.h> #include <stdio.h> #include <math.h> void set_parallel (View_parameters*, Matrix); diff --git a/src/simulator/wireframe-simulator/core/vpRfstack.cpp b/modules/robot/src/wireframe-simulator/core/vpRfstack.cpp old mode 100755 new mode 100644 similarity index 87% rename from src/simulator/wireframe-simulator/core/vpRfstack.cpp rename to modules/robot/src/wireframe-simulator/core/vpRfstack.cpp index c784b7d3b92a072f01a949b8877d73b1b79b4eb0..63bc09c0a869874f3263c2b82f54ca69706def39 --- a/src/simulator/wireframe-simulator/core/vpRfstack.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpRfstack.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpRfstack.cpp 5284 2015-02-09 14:24:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -44,13 +41,13 @@ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpMy.h> -#include <visp/vpArit.h> -#include <visp/vpView.h> -#include <visp/vpRfstack.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> +#include <visp3/robot/vpView.h> +#include <visp3/robot/vpRfstack.h> #include <stdio.h> #include <string.h> #define STACKSIZE 32 @@ -78,7 +75,7 @@ fprintf_rfstack (FILE *fp) } fprintf (fp, "("); if (*sp & IS_ABOVE) { - if (flg) fprintf (fp, " "); + //if (flg) fprintf (fp, " "); Removed since if (flg) cannot be true flg ++; fprintf (fp, "above"); } diff --git a/src/simulator/wireframe-simulator/core/vpSkipio.cpp b/modules/robot/src/wireframe-simulator/core/vpSkipio.cpp old mode 100755 new mode 100644 similarity index 79% rename from src/simulator/wireframe-simulator/core/vpSkipio.cpp rename to modules/robot/src/wireframe-simulator/core/vpSkipio.cpp index 24ee2741e4975f9fdf94be23acd5637212a63c61..9a7c978bb63d2352b90335ee1582a8237930acd7 --- a/src/simulator/wireframe-simulator/core/vpSkipio.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpSkipio.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpSkipio.cpp 5310 2015-02-11 11:57:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -45,13 +42,13 @@ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpMy.h> -#include <visp/vpToken.h> -#include <visp/vpLex.h> -#include <visp/vpSkipio.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpToken.h> +#include <visp3/robot/vpLex.h> +#include <visp3/robot/vpSkipio.h> #include <stdio.h> /* * La procedure "skip_cmd" saute les structures d'une commande @@ -64,7 +61,7 @@ void skip_cmd (void) int token; fprintf (stderr, "\n$ "); - fwrite (mytext, mylength, 1, stderr); + fwrite (mytext, (size_t)mylength, 1, stderr); while ((token = lexecho (stderr, '$')) != T_EOF && token != '$') {}; unlex (); } diff --git a/src/simulator/wireframe-simulator/core/vpTmstack.cpp b/modules/robot/src/wireframe-simulator/core/vpTmstack.cpp old mode 100755 new mode 100644 similarity index 91% rename from src/simulator/wireframe-simulator/core/vpTmstack.cpp rename to modules/robot/src/wireframe-simulator/core/vpTmstack.cpp index 61e4461cfae4d27249c832f79c6ba94ad8adc2ed..a5225822fea6c521d4a7c02b421d5fa5509dc31a --- a/src/simulator/wireframe-simulator/core/vpTmstack.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpTmstack.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpTmstack.cpp 5284 2015-02-09 14:24:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -43,13 +40,13 @@ -#include <visp/vpMy.h> -#include <visp/vpArit.h> -#include <visp/vpTmstack.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> +#include <visp3/robot/vpTmstack.h> #include <math.h> #include <stdio.h> #include <string.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/simulator/wireframe-simulator/core/vpToken.cpp b/modules/robot/src/wireframe-simulator/core/vpToken.cpp old mode 100755 new mode 100644 similarity index 78% rename from src/simulator/wireframe-simulator/core/vpToken.cpp rename to modules/robot/src/wireframe-simulator/core/vpToken.cpp index 989f94206049ec89affabbf4573979ed67176e40..cf7bd9b7e56e01238df3fe2d83c9ebc95689ca63 --- a/src/simulator/wireframe-simulator/core/vpToken.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpToken.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpToken.cpp 5284 2015-02-09 14:24:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -40,10 +37,10 @@ *****************************************************************************/ -#include <visp/vpMy.h> -#include <visp/vpToken.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpToken.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/simulator/wireframe-simulator/core/vpViewio.cpp b/modules/robot/src/wireframe-simulator/core/vpViewio.cpp old mode 100755 new mode 100644 similarity index 86% rename from src/simulator/wireframe-simulator/core/vpViewio.cpp rename to modules/robot/src/wireframe-simulator/core/vpViewio.cpp index 6c19df08874ccab6e94b80aa91ed72a8ff0d54ff..ca4dd6781bf6418a22a1f6cccde71545d513866d --- a/src/simulator/wireframe-simulator/core/vpViewio.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpViewio.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpViewio.cpp 5284 2015-02-09 14:24:10Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -42,18 +39,18 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS #include <stdio.h> -#include <visp/vpMy.h> -#include <visp/vpArit.h> -#include <visp/vpView.h> -#include <visp/vpToken.h> -#include <visp/vpLex.h> -#include <visp/vpSkipio.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> +#include <visp3/robot/vpView.h> +#include <visp3/robot/vpToken.h> +#include <visp3/robot/vpLex.h> +#include <visp3/robot/vpSkipio.h> /* diff --git a/src/simulator/wireframe-simulator/core/vpVwstack.cpp b/modules/robot/src/wireframe-simulator/core/vpVwstack.cpp similarity index 92% rename from src/simulator/wireframe-simulator/core/vpVwstack.cpp rename to modules/robot/src/wireframe-simulator/core/vpVwstack.cpp index e0dfbc101b56f59a23833954a668648bcd31cfd8..c2f676863d429114f358f8bf8c69a96664b4d057 100644 --- a/src/simulator/wireframe-simulator/core/vpVwstack.cpp +++ b/modules/robot/src/wireframe-simulator/core/vpVwstack.cpp @@ -1,10 +1,8 @@ /**************************************************************************** * - * $Id: vpVwstack.cpp 5285 2015-02-09 14:32:54Z fspindle $ + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * -* This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -39,7 +36,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -51,10 +48,10 @@ // #include <varargs.h> /* modif Fedora #include <stdarg.h> -#include <visp/vpMy.h> -#include <visp/vpArit.h> -#include <visp/vpView.h> -#include <visp/vpVwstack.h> +#include <visp3/robot/vpMy.h> +#include <visp3/robot/vpArit.h> +#include <visp3/robot/vpView.h> +#include <visp3/robot/vpVwstack.h> #define STACKSIZE 4 diff --git a/src/simulator/wireframe-simulator/scene/3pts.bnd b/modules/robot/src/wireframe-simulator/scene/3pts.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/3pts.bnd rename to modules/robot/src/wireframe-simulator/scene/3pts.bnd diff --git a/src/simulator/wireframe-simulator/scene/3pts.sld b/modules/robot/src/wireframe-simulator/scene/3pts.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/3pts.sld rename to modules/robot/src/wireframe-simulator/scene/3pts.sld diff --git a/src/simulator/wireframe-simulator/scene/camera.bnd b/modules/robot/src/wireframe-simulator/scene/camera.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/camera.bnd rename to modules/robot/src/wireframe-simulator/scene/camera.bnd diff --git a/src/simulator/wireframe-simulator/scene/camera.sld b/modules/robot/src/wireframe-simulator/scene/camera.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/camera.sld rename to modules/robot/src/wireframe-simulator/scene/camera.sld diff --git a/src/simulator/wireframe-simulator/scene/circle.bnd b/modules/robot/src/wireframe-simulator/scene/circle.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/circle.bnd rename to modules/robot/src/wireframe-simulator/scene/circle.bnd diff --git a/src/simulator/wireframe-simulator/scene/circle.sld b/modules/robot/src/wireframe-simulator/scene/circle.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/circle.sld rename to modules/robot/src/wireframe-simulator/scene/circle.sld diff --git a/src/simulator/wireframe-simulator/scene/circle_sq2.bnd b/modules/robot/src/wireframe-simulator/scene/circle_sq2.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/circle_sq2.bnd rename to modules/robot/src/wireframe-simulator/scene/circle_sq2.bnd diff --git a/src/simulator/wireframe-simulator/scene/circle_sq2.sld b/modules/robot/src/wireframe-simulator/scene/circle_sq2.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/circle_sq2.sld rename to modules/robot/src/wireframe-simulator/scene/circle_sq2.sld diff --git a/src/simulator/wireframe-simulator/scene/circles2.bnd b/modules/robot/src/wireframe-simulator/scene/circles2.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/circles2.bnd rename to modules/robot/src/wireframe-simulator/scene/circles2.bnd diff --git a/src/simulator/wireframe-simulator/scene/circles2.sld b/modules/robot/src/wireframe-simulator/scene/circles2.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/circles2.sld rename to modules/robot/src/wireframe-simulator/scene/circles2.sld diff --git a/src/simulator/wireframe-simulator/scene/cube.bnd b/modules/robot/src/wireframe-simulator/scene/cube.bnd similarity index 100% rename from src/simulator/wireframe-simulator/scene/cube.bnd rename to modules/robot/src/wireframe-simulator/scene/cube.bnd diff --git a/src/simulator/wireframe-simulator/scene/cube.sld b/modules/robot/src/wireframe-simulator/scene/cube.sld similarity index 100% rename from src/simulator/wireframe-simulator/scene/cube.sld rename to modules/robot/src/wireframe-simulator/scene/cube.sld diff --git a/src/simulator/wireframe-simulator/scene/cylinder.bnd b/modules/robot/src/wireframe-simulator/scene/cylinder.bnd similarity index 100% rename from src/simulator/wireframe-simulator/scene/cylinder.bnd rename to modules/robot/src/wireframe-simulator/scene/cylinder.bnd diff --git a/src/simulator/wireframe-simulator/scene/cylinder.sld b/modules/robot/src/wireframe-simulator/scene/cylinder.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/cylinder.sld rename to modules/robot/src/wireframe-simulator/scene/cylinder.sld diff --git a/src/simulator/wireframe-simulator/scene/diamond.bnd b/modules/robot/src/wireframe-simulator/scene/diamond.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/diamond.bnd rename to modules/robot/src/wireframe-simulator/scene/diamond.bnd diff --git a/src/simulator/wireframe-simulator/scene/diamond.sld b/modules/robot/src/wireframe-simulator/scene/diamond.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/diamond.sld rename to modules/robot/src/wireframe-simulator/scene/diamond.sld diff --git a/src/simulator/wireframe-simulator/scene/line.bnd b/modules/robot/src/wireframe-simulator/scene/line.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/line.bnd rename to modules/robot/src/wireframe-simulator/scene/line.bnd diff --git a/src/simulator/wireframe-simulator/scene/line.sld b/modules/robot/src/wireframe-simulator/scene/line.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/line.sld rename to modules/robot/src/wireframe-simulator/scene/line.sld diff --git a/src/simulator/wireframe-simulator/scene/pipe.bnd b/modules/robot/src/wireframe-simulator/scene/pipe.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/pipe.bnd rename to modules/robot/src/wireframe-simulator/scene/pipe.bnd diff --git a/src/simulator/wireframe-simulator/scene/pipe.sld b/modules/robot/src/wireframe-simulator/scene/pipe.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/pipe.sld rename to modules/robot/src/wireframe-simulator/scene/pipe.sld diff --git a/src/simulator/wireframe-simulator/scene/plan.bnd b/modules/robot/src/wireframe-simulator/scene/plan.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/plan.bnd rename to modules/robot/src/wireframe-simulator/scene/plan.bnd diff --git a/src/simulator/wireframe-simulator/scene/plan.sld b/modules/robot/src/wireframe-simulator/scene/plan.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/plan.sld rename to modules/robot/src/wireframe-simulator/scene/plan.sld diff --git a/src/simulator/wireframe-simulator/scene/plate.bnd b/modules/robot/src/wireframe-simulator/scene/plate.bnd similarity index 100% rename from src/simulator/wireframe-simulator/scene/plate.bnd rename to modules/robot/src/wireframe-simulator/scene/plate.bnd diff --git a/src/simulator/wireframe-simulator/scene/plate.sld b/modules/robot/src/wireframe-simulator/scene/plate.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/plate.sld rename to modules/robot/src/wireframe-simulator/scene/plate.sld diff --git a/src/simulator/wireframe-simulator/scene/plate_6cm.bnd b/modules/robot/src/wireframe-simulator/scene/plate_6cm.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/plate_6cm.bnd rename to modules/robot/src/wireframe-simulator/scene/plate_6cm.bnd diff --git a/src/simulator/wireframe-simulator/scene/plate_6cm.sld b/modules/robot/src/wireframe-simulator/scene/plate_6cm.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/plate_6cm.sld rename to modules/robot/src/wireframe-simulator/scene/plate_6cm.sld diff --git a/src/simulator/wireframe-simulator/scene/plate_8cm.bnd b/modules/robot/src/wireframe-simulator/scene/plate_8cm.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/plate_8cm.bnd rename to modules/robot/src/wireframe-simulator/scene/plate_8cm.bnd diff --git a/src/simulator/wireframe-simulator/scene/plate_8cm.sld b/modules/robot/src/wireframe-simulator/scene/plate_8cm.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/plate_8cm.sld rename to modules/robot/src/wireframe-simulator/scene/plate_8cm.sld diff --git a/src/simulator/wireframe-simulator/scene/point.bnd b/modules/robot/src/wireframe-simulator/scene/point.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/point.bnd rename to modules/robot/src/wireframe-simulator/scene/point.bnd diff --git a/src/simulator/wireframe-simulator/scene/point.sld b/modules/robot/src/wireframe-simulator/scene/point.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/point.sld rename to modules/robot/src/wireframe-simulator/scene/point.sld diff --git a/src/simulator/wireframe-simulator/scene/point_cloud.bnd b/modules/robot/src/wireframe-simulator/scene/point_cloud.bnd similarity index 100% rename from src/simulator/wireframe-simulator/scene/point_cloud.bnd rename to modules/robot/src/wireframe-simulator/scene/point_cloud.bnd diff --git a/src/simulator/wireframe-simulator/scene/point_cloud.sld b/modules/robot/src/wireframe-simulator/scene/point_cloud.sld similarity index 100% rename from src/simulator/wireframe-simulator/scene/point_cloud.sld rename to modules/robot/src/wireframe-simulator/scene/point_cloud.sld diff --git a/src/simulator/wireframe-simulator/scene/rectangle.bnd b/modules/robot/src/wireframe-simulator/scene/rectangle.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/rectangle.bnd rename to modules/robot/src/wireframe-simulator/scene/rectangle.bnd diff --git a/src/simulator/wireframe-simulator/scene/rectangle.sld b/modules/robot/src/wireframe-simulator/scene/rectangle.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/rectangle.sld rename to modules/robot/src/wireframe-simulator/scene/rectangle.sld diff --git a/src/simulator/wireframe-simulator/scene/road.bnd b/modules/robot/src/wireframe-simulator/scene/road.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/road.bnd rename to modules/robot/src/wireframe-simulator/scene/road.bnd diff --git a/src/simulator/wireframe-simulator/scene/road.sld b/modules/robot/src/wireframe-simulator/scene/road.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/road.sld rename to modules/robot/src/wireframe-simulator/scene/road.sld diff --git a/src/simulator/wireframe-simulator/scene/sphere.bnd b/modules/robot/src/wireframe-simulator/scene/sphere.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/sphere.bnd rename to modules/robot/src/wireframe-simulator/scene/sphere.bnd diff --git a/src/simulator/wireframe-simulator/scene/sphere.sld b/modules/robot/src/wireframe-simulator/scene/sphere.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/sphere.sld rename to modules/robot/src/wireframe-simulator/scene/sphere.sld diff --git a/src/simulator/wireframe-simulator/scene/square10cm.bnd b/modules/robot/src/wireframe-simulator/scene/square10cm.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/square10cm.bnd rename to modules/robot/src/wireframe-simulator/scene/square10cm.bnd diff --git a/src/simulator/wireframe-simulator/scene/square10cm.sld b/modules/robot/src/wireframe-simulator/scene/square10cm.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/square10cm.sld rename to modules/robot/src/wireframe-simulator/scene/square10cm.sld diff --git a/src/simulator/wireframe-simulator/scene/tool.bnd b/modules/robot/src/wireframe-simulator/scene/tool.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/tool.bnd rename to modules/robot/src/wireframe-simulator/scene/tool.bnd diff --git a/src/simulator/wireframe-simulator/scene/tool.sld b/modules/robot/src/wireframe-simulator/scene/tool.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/tool.sld rename to modules/robot/src/wireframe-simulator/scene/tool.sld diff --git a/src/simulator/wireframe-simulator/scene/trapezoid.bnd b/modules/robot/src/wireframe-simulator/scene/trapezoid.bnd old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/trapezoid.bnd rename to modules/robot/src/wireframe-simulator/scene/trapezoid.bnd diff --git a/src/simulator/wireframe-simulator/scene/trapezoid.sld b/modules/robot/src/wireframe-simulator/scene/trapezoid.sld old mode 100755 new mode 100644 similarity index 100% rename from src/simulator/wireframe-simulator/scene/trapezoid.sld rename to modules/robot/src/wireframe-simulator/scene/trapezoid.sld diff --git a/src/simulator/wireframe-simulator/vpWireFrameSimulator.cpp b/modules/robot/src/wireframe-simulator/vpWireFrameSimulator.cpp similarity index 85% rename from src/simulator/wireframe-simulator/vpWireFrameSimulator.cpp rename to modules/robot/src/wireframe-simulator/vpWireFrameSimulator.cpp index e5e38ddfbf38e96abeb3c4f0e07b9be74290237a..4481f7a6913697eabcde5616c3fd4c4e154fa047 100644 --- a/src/simulator/wireframe-simulator/vpWireFrameSimulator.cpp +++ b/modules/robot/src/wireframe-simulator/vpWireFrameSimulator.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpWireFrameSimulator.cpp 5297 2015-02-10 11:19:24Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Wire frame simulator * @@ -44,21 +40,21 @@ \brief Implementation of a wire frame simulator. */ -#include <visp/vpWireFrameSimulator.h> +#include <visp3/robot/vpWireFrameSimulator.h> #include <fcntl.h> #include <string.h> #include <stdio.h> #include <vector> -#include <visp/vpSimulatorException.h> -#include <visp/vpPoint.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpPoint.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpIoTools.h> //Inventor includes -#if defined(VISP_HAVE_COIN) +#if defined(VISP_HAVE_COIN3D) #include <Inventor/nodes/SoSeparator.h> #include <Inventor/VRMLnodes/SoVRMLIndexedFaceSet.h> #include <Inventor/VRMLnodes/SoVRMLIndexedLineSet.h> @@ -105,7 +101,7 @@ getExtension(const char* file) return BND_MODEL; else if ((wrl>0 && wrl<size) || ( WRL>0 && WRL<size)) { -#if defined(VISP_HAVE_COIN) +#if defined(VISP_HAVE_COIN3D) return WRL_MODEL; #else std::cout << "Coin not installed, cannot read VRML files" << std::endl; @@ -127,7 +123,7 @@ void set_scene (const char* str, Bound_scene *sc, float factor) { std::string error = "The file " + std::string(str) + " can not be opened"; - throw(vpException(vpSimulatorException::ioError, error.c_str())) ; + throw(vpException(vpException::ioError, error.c_str())) ; } open_keyword (keyword_tbl); open_lex (); @@ -155,7 +151,7 @@ void set_scene (const char* str, Bound_scene *sc, float factor) fclose(fd); } -#if defined(VISP_HAVE_COIN) +#if defined(VISP_HAVE_COIN3D) #ifndef DOXYGEN_SHOULD_SKIP_THIS typedef struct indexFaceSet @@ -283,8 +279,7 @@ extractFaces(SoVRMLIndexedFaceSet* face_set, indexFaceSet *ifs) point[0]=coord->point[i].getValue()[0]; point[1]=coord->point[i].getValue()[1]; point[2]=coord->point[i].getValue()[2]; - vpPoint pt; - pt.setWorldCoordinates(point[0],point[1],point[2]); + vpPoint pt(point[0],point[1],point[2]); ifs->pt.push_back(pt); } @@ -428,7 +423,7 @@ vpWireFrameSimulator::display_scene(Matrix mat, Bound_scene &sc, const vpImage<v set_Bound_face_display (clip, b); //regarde si is_visible - point_3D_2D (clip->point.ptr, clip->point.nbr,I.getWidth(),I.getHeight(),point2i); + point_3D_2D (clip->point.ptr, clip->point.nbr,(int)I.getWidth(),(int)I.getHeight(),point2i); for (; fp < fend; fp++) { if (fp->is_visible) @@ -478,7 +473,7 @@ vpWireFrameSimulator::display_scene(Matrix mat, Bound_scene &sc, const vpImage<u set_Bound_face_display (clip, b); //regarde si is_visible - point_3D_2D (clip->point.ptr, clip->point.nbr,I.getWidth(),I.getHeight(),point2i); + point_3D_2D (clip->point.ptr, clip->point.nbr,(int)I.getWidth(),(int)I.getHeight(),point2i); for (; fp < fend; fp++) { if (fp->is_visible) @@ -522,9 +517,16 @@ vpWireFrameSimulator::vpWireFrameSimulator() cameraFactor(1.), camTrajType(CT_LINE), extCamChanged(false), rotz(), thickness_(1), scene_dir() { // set scene_dir from #define VISP_SCENE_DIR if it exists - if (vpIoTools::checkDirectory(VISP_SCENES_DIR) == true) // directory exists - scene_dir = VISP_SCENES_DIR; - else { + // VISP_SCENES_DIR may contain multiple locations separated by ";" + std::vector<std::string> scene_dirs = vpIoTools::splitChain(std::string(VISP_SCENES_DIR), std::string(";")); + bool sceneDirExists = false; + for(size_t i=0; i < scene_dirs.size(); i++) + if (vpIoTools::checkDirectory(scene_dirs[i]) == true) { // directory exists + scene_dir = scene_dirs[i]; + sceneDirExists = true; + break; + } + if (! sceneDirExists) { try { scene_dir = vpIoTools::getenv("VISP_SCENES_DIR"); std::cout << "The simulator uses data from VISP_SCENES_DIR=" << scene_dir << std::endl; @@ -674,35 +676,6 @@ vpWireFrameSimulator::initScene(const vpSceneObject &obj, const vpSceneDesiredOb displayImageSimulator = true; } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated. You should use - initScene(vpSceneObject, vpSceneDesiredObject, const std::list<vpImageSimulator> &) - instead. - - Initialize the simulator. It enables to choose the type of scene which will be used to display the object - at the current position and at the desired position. - - It exists several default scenes you can use. Use the vpSceneObject and the vpSceneDesiredObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory. - - It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame. - - \param obj : Type of scene used to display the object at the current position. - \param desired_object : Type of scene used to display the object at the desired pose (in the internal view). - \param imObj : A list of vpImageSimulator instances. -*/ -void -vpWireFrameSimulator::initScene(vpSceneObject obj, vpSceneDesiredObject desired_object, vpList<vpImageSimulator> &imObj) -{ - initScene(obj, desired_object); - objectImage.clear(); - for(imObj.front(); !imObj.outside(); imObj.next()){ - objectImage.push_back(imObj.value()); - } - displayImageSimulator = true; -} -#endif - /*! Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position. @@ -797,34 +770,6 @@ vpWireFrameSimulator::initScene(const char* obj, const char* desired_object) displayCamera = true; } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated. You should use - initScene(const char*, const char*, const std::list<vpImageSimulator> &) instead. - - Initialize the simulator. It enables to choose the type of scene which will be used to display the object - at the current position and at the desired position. - - Here you can use the scene you want. You have to set the path to a .bnd or a .wrl file which is a 3D model file. - - It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame. - - \param obj : Path to the scene file you want to use. - \param desired_object : Path to the scene file you want to use. - \param imObj : A list of vpImageSimulator instances. -*/ -void -vpWireFrameSimulator::initScene(const char* obj, const char* desired_object, vpList<vpImageSimulator> &imObj) -{ - initScene(obj, desired_object); - objectImage.clear(); - for(imObj.front(); !imObj.outside(); imObj.next()){ - objectImage.push_back(imObj.value()); - } - displayImageSimulator = true; -} -#endif - /*! Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position. @@ -909,33 +854,6 @@ vpWireFrameSimulator::initScene(const vpSceneObject &obj) displayImageSimulator = false; } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated. You should use - initScene(vpSceneObject, const std::list<vpImageSimulator> &) instead. - - Initialize the simulator. It enables to choose the type of object which will be used to display the object - at the current position. The object at the desired position is not displayed. - - It exists several default scenes you can use. Use the vpSceneObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory. - - It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame. - - \param obj : Type of scene used to display the object at the current position. - \param imObj : A list of vpImageSimulator instances. -*/ -void -vpWireFrameSimulator::initScene(vpSceneObject obj, vpList<vpImageSimulator> &imObj) -{ - initScene(obj); - objectImage.clear(); - for(imObj.front(); !imObj.outside(); imObj.next()){ - objectImage.push_back(imObj.value()); - } - displayImageSimulator = true; -} -#endif - /*! Initialize the simulator. It enables to choose the type of object which will be used to display the object at the current position. The object at the desired position is not displayed. @@ -1009,33 +927,6 @@ vpWireFrameSimulator::initScene(const char* obj) displayCamera = true; } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated. You should use - initScene(const char*, const std::list<vpImageSimulator> &) instead. - - Initialize the simulator. It enables to choose the type of scene which will be used to display the object - at the current position. The object at the desired position is not displayed. - - Here you can use the scene you want. You have to set the path to a .bnd or a .wrl file which is a 3D model file. - - It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame. - - \param obj : Path to the scene file you want to use. - \param imObj : A list of vpImageSimulator instances. -*/ -void -vpWireFrameSimulator::initScene(const char* obj, vpList<vpImageSimulator> &imObj) -{ - initScene(obj); - objectImage.clear(); - for(imObj.front(); !imObj.outside(); imObj.next()){ - objectImage.push_back(imObj.value()); - } - displayImageSimulator = true; -} -#endif - /*! Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position. The object at the desired position is not displayed. @@ -1066,7 +957,7 @@ void vpWireFrameSimulator::getInternalImage(vpImage<vpRGBa> &I) { if (!sceneInitialized) - throw(vpException(vpSimulatorException::notInitializedError,"The scene has to be initialized")) ; + throw(vpException(vpException::notInitialized,"The scene has to be initialized")) ; double u; double v; @@ -1351,7 +1242,7 @@ void vpWireFrameSimulator::getInternalImage(vpImage<unsigned char> &I) { if (!sceneInitialized) - throw(vpException(vpSimulatorException::notInitializedError,"The scene has to be initialized")) ; + throw(vpException(vpException::notInitialized,"The scene has to be initialized")) ; double u; double v; @@ -1620,93 +1511,6 @@ vpWireFrameSimulator::getExternalImage(vpImage<unsigned char> &I, const vpHomoge display_scene(w44c,camera, I, camColor); } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated. You should use - displayTrajectory(vpImage<unsigned char> &, const std::list<vpHomogeneousMatrix> &, const std::list<vpHomogeneousMatrix> &, const vpHomogeneousMatrix &); - instead. - - Display a trajectory thanks to a list of homogeneous matrices which give the position of the camera relative to the object and the position of the object relative to the world reference frame. The trajectory is projected into the view of an external camera whose position is given in parameter. - - The two lists must have the same size of homogeneous matrices must have the same size. - - \param I : The image where the trajectory is displayed. - \param list_cMo : The homogeneous matrices list containing the position of the camera relative to the object. - \param list_fMo : The homogeneous matrices list containing the position of the object relative to the world reference frame. - \param cMf : A homogeneous matrix which gives the position of the external camera (used to project the trajectory) relative to the world reference frame. -*/ -void -vpWireFrameSimulator::displayTrajectory (const vpImage<unsigned char> &I, vpList<vpHomogeneousMatrix> &list_cMo, vpList<vpHomogeneousMatrix> &list_fMo, vpHomogeneousMatrix cMf) -{ - if (list_cMo.nbElements() != list_fMo.nbElements()) - throw(vpException(vpException::dimensionError ,"The two lists must have the same size")) ; - - list_cMo.front(); - list_fMo.front(); - vpImagePoint iP; - vpImagePoint iP_1; - int iter = 0; - - while (!list_cMo.outside() && !list_fMo.outside()) - { - iP = projectCameraTrajectory(I, rotz * list_cMo.value(), list_fMo.value(), rotz * cMf); - if (camTrajType == CT_LINE) - { - if (iter != 0) vpDisplay::displayLine(I,iP_1,iP,camTrajColor, thickness_); - } - else if (camTrajType == CT_POINT) - vpDisplay::displayPoint(I,iP,camTrajColor); - list_cMo.next(); - list_fMo.next(); - iter++; - iP_1 = iP; - } -} - -/*! - \deprecated This method is deprecated. You should use - displayTrajectory (vpImage<vpRGBa> &, const std::list<vpHomogeneousMatrix> &, const std::list<vpHomogeneousMatrix> &, const vpHomogeneousMatrix &); - instead. - - Display a trajectory thanks to a list of homogeneous matrices which give the position of the camera relative to the object and the position of the object relative to the world reference frame. The trajectory is projected into the view of an external camera whose position is given in parameter. - - The two lists must have the same size of homogeneous matrices must have the same size. - - \param I : The image where the trajectory is displayed. - \param list_cMo : The homogeneous matrices list containing the position of the camera relative to the object. - \param list_fMo : The homogeneous matrices list containing the position of the object relative to the world reference frame. - \param cMf : A homogeneous matrix which gives the position of the external camera (used to project the trajectory) relative to the world reference frame. -*/ -void -vpWireFrameSimulator::displayTrajectory (const vpImage<vpRGBa> &I, vpList<vpHomogeneousMatrix> &list_cMo, vpList<vpHomogeneousMatrix> &list_fMo, vpHomogeneousMatrix cMf) -{ - if (list_cMo.nbElements() != list_fMo.nbElements()) - throw(vpException(vpException::dimensionError ,"The two lists must have the same size")) ; - - list_cMo.front(); - list_fMo.front(); - vpImagePoint iP; - vpImagePoint iP_1; - int iter = 0; - - while (!list_cMo.outside() && !list_fMo.outside()) - { - iP = projectCameraTrajectory(I, rotz * list_cMo.value(), list_fMo.value(), rotz * cMf); - if (camTrajType == CT_LINE) - { - if (iter != 0) vpDisplay::displayLine(I,iP_1,iP,camTrajColor,thickness_); - } - else if (camTrajType == CT_POINT) - vpDisplay::displayPoint(I,iP,camTrajColor); - list_cMo.next(); - list_fMo.next(); - iter++; - iP_1 = iP; - } -} -#endif - - /*! Display a trajectory thanks to a list of homogeneous matrices which give the position of the camera relative to the object and the position of the object relative to the world reference frame. The trajectory is projected into the view of an external camera whose position is given in parameter. diff --git a/test/servo-afma4/testAfma4.cpp b/modules/robot/test/servo-afma4/testAfma4.cpp similarity index 75% rename from test/servo-afma4/testAfma4.cpp rename to modules/robot/test/servo-afma4/testAfma4.cpp index 03583ed57f7368725e91d9de5618e533dcf72fc4..f59b45f1b983143bb437d613c5f062507130b935 100644 --- a/test/servo-afma4/testAfma4.cpp +++ b/modules/robot/test/servo-afma4/testAfma4.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testAfma4.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for Afma 6 dof robot. * @@ -47,10 +43,10 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpAfma4.h> -#include <visp/vpDebug.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpAfma4.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpCameraParameters.h> #include <iostream> diff --git a/test/servo-afma4/testRobotAfma4.cpp b/modules/robot/test/servo-afma4/testRobotAfma4.cpp similarity index 77% rename from test/servo-afma4/testRobotAfma4.cpp rename to modules/robot/test/servo-afma4/testRobotAfma4.cpp index 96a26fffff9d52de60366c60d2785173e7148583..b081fedf8e3839c951831d95d3a6b4d763b28329 100644 --- a/test/servo-afma4/testRobotAfma4.cpp +++ b/modules/robot/test/servo-afma4/testRobotAfma4.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testRobotAfma4.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for Afma 4 dof robot. * @@ -46,9 +42,9 @@ degrees of freedom). */ -#include <visp/vpRobotAfma4.h> -#include <visp/vpDebug.h> -#include <visp/vpCameraParameters.h> +#include <visp3/robot/vpRobotAfma4.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpCameraParameters.h> #include <iostream> diff --git a/test/servo-afma6/testAfma6.cpp b/modules/robot/test/servo-afma6/testAfma6.cpp similarity index 85% rename from test/servo-afma6/testAfma6.cpp rename to modules/robot/test/servo-afma6/testAfma6.cpp index 06657867cf707ae478dd3f80d33db897e90f337f..ab17da53127eed81f9bd347e13b6f9ca9318ff7a 100644 --- a/test/servo-afma6/testAfma6.cpp +++ b/modules/robot/test/servo-afma6/testAfma6.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testAfma6.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for Afma 6 dof robot. * @@ -47,10 +43,10 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpAfma6.h> -#include <visp/vpDebug.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpAfma6.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpCameraParameters.h> #include <iostream> diff --git a/test/servo-afma6/testRobotAfma6.cpp b/modules/robot/test/servo-afma6/testRobotAfma6.cpp similarity index 86% rename from test/servo-afma6/testRobotAfma6.cpp rename to modules/robot/test/servo-afma6/testRobotAfma6.cpp index 9ac60a2789e63f20ee803377281fc41d91524b84..964be6d454440b6eeb856e782ca4e5b8b1905ad6 100644 --- a/test/servo-afma6/testRobotAfma6.cpp +++ b/modules/robot/test/servo-afma6/testRobotAfma6.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testRobotAfma6.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for Afma 6 dof robot. * @@ -46,9 +42,9 @@ degrees of freedom). */ -#include <visp/vpRobotAfma6.h> -#include <visp/vpDebug.h> -#include <visp/vpCameraParameters.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpCameraParameters.h> #include <iostream> diff --git a/test/servo-afma6/testRobotAfma6Pose.cpp b/modules/robot/test/servo-afma6/testRobotAfma6Pose.cpp similarity index 89% rename from test/servo-afma6/testRobotAfma6Pose.cpp rename to modules/robot/test/servo-afma6/testRobotAfma6Pose.cpp index 038212ae7ad1d753340cb0d499b6c9c11fabd6da..986e26ba71ed1b50b5f6c966692f9bfa15543a56 100644 --- a/test/servo-afma6/testRobotAfma6Pose.cpp +++ b/modules/robot/test/servo-afma6/testRobotAfma6Pose.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testRobotAfma6Pose.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for Afma 6 dof robot. * @@ -51,20 +47,20 @@ -#include <visp/vpImage.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpRobotAfma6.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpPoint.h> -#include <visp/vpDot.h> -#include <visp/vpPose.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpImage.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/robot/vpRobotAfma6.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpPoint.h> +#include <visp3/blob/vpDot.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpDebug.h> #include <iostream> -#if defined(VISP_HAVE_AFMA6) && defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_AFMA6) && defined(VISP_HAVE_DC1394) int main() { diff --git a/test/servo-viper/testRobotViper850.cpp b/modules/robot/test/servo-viper/testRobotViper850.cpp similarity index 86% rename from test/servo-viper/testRobotViper850.cpp rename to modules/robot/test/servo-viper/testRobotViper850.cpp index cad8251d1683a6ffd1cc858cbb5786ccd1cfb381..ca55c0a5ef64274c909966b4e91127f259b1bc7a 100644 --- a/test/servo-viper/testRobotViper850.cpp +++ b/modules/robot/test/servo-viper/testRobotViper850.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testRobotViper850.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for Afma 6 dof robot. * @@ -49,10 +45,10 @@ -#include <visp/vpConfig.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpDebug.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpCameraParameters.h> #include <iostream> #ifdef VISP_HAVE_VIPER850 diff --git a/test/servo-viper/testRobotViper850Pose.cpp b/modules/robot/test/servo-viper/testRobotViper850Pose.cpp similarity index 89% rename from test/servo-viper/testRobotViper850Pose.cpp rename to modules/robot/test/servo-viper/testRobotViper850Pose.cpp index 9748bb893907b3eb52cc140baecc54c1beba511b..8eed9c6cab4fd4f74422d7402913e68eaf0c8d3e 100644 --- a/test/servo-viper/testRobotViper850Pose.cpp +++ b/modules/robot/test/servo-viper/testRobotViper850Pose.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testRobotViper850Pose.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for Afma 6 dof robot. * @@ -52,21 +48,21 @@ -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpRobotViper850.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpPoint.h> -#include <visp/vpDot.h> -#include <visp/vpPose.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/robot/vpRobotViper850.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpPoint.h> +#include <visp3/blob/vpDot.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpDebug.h> #include <iostream> -#if defined(VISP_HAVE_VIPER850) && defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_VIPER850) && defined(VISP_HAVE_DC1394) int main() { diff --git a/test/servo-viper/testViper850.cpp b/modules/robot/test/servo-viper/testViper850.cpp similarity index 88% rename from test/servo-viper/testViper850.cpp rename to modules/robot/test/servo-viper/testViper850.cpp index 20c35abbe37ed5fb5ad9f28021af295ddb7938ee..4bd69f9bb30ad328bb07dbc61369270307993d39 100644 --- a/test/servo-viper/testViper850.cpp +++ b/modules/robot/test/servo-viper/testViper850.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testViper850.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test for Viper850 6 dof robot. * @@ -48,9 +44,9 @@ -#include <visp/vpConfig.h> -#include <visp/vpViper850.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/robot/vpViper850.h> +#include <visp3/core/vpDebug.h> #include <iostream> diff --git a/modules/sensor/CMakeLists.txt b/modules/sensor/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..9a3ca103730bd5c8cbc17c8d0cd81a35795bad16 --- /dev/null +++ b/modules/sensor/CMakeLists.txt @@ -0,0 +1,74 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +#vp_define_module(sensor) + +# Add optional 3rd parties +set(opt_incs "") +set(opt_libs "") + +# camera devices: v4l, dc1394, cmu1394, directshow ?, freenect +if(USE_V4L2) + list(APPEND opt_incs ${V4L2_INCLUDE_DIRS}) + list(APPEND opt_libs ${V4L2_LIBRARIES}) +endif() +if(USE_DC1394) + list(APPEND opt_incs ${DC1394_INCLUDE_DIRS}) + list(APPEND opt_libs ${DC1394_LIBRARY}) +endif() +if(USE_CMU1394) + list(APPEND opt_incs ${CMU1394_INCLUDE_DIRS}) + list(APPEND opt_libs ${CMU1394_LIBRARIES}) +endif() +if(USE_DIRECTSHOW) + list(APPEND opt_incs ${DIRECTSHOW_INCLUDE_DIRS}) + list(APPEND opt_libs ${DIRECTSHOW_LIBRARIES}) +endif() +if(USE_LIBFREENECT) + list(APPEND opt_incs ${LIBFREENECT_INCLUDE_DIRS}) + list(APPEND opt_libs ${LIBFREENECT_LIBRARIES}) +endif() +if(USE_LIBUSB_1) + list(APPEND opt_incs ${LIBUSB_1_INCLUDE_DIRS}) + list(APPEND opt_libs ${LIBUSB_1_LIBRARIES}) +endif() + +vp_add_module(sensor visp_core) +vp_glob_module_sources() +vp_module_include_directories(${opt_incs}) +vp_create_module(${opt_libs}) +vp_add_tests(CTEST_EXCLUDE_PATH framegrabber DEPENDS_ON visp_io) diff --git a/src/device/framegrabber/1394/vp1394CMUGrabber.h b/modules/sensor/include/visp3/sensor/vp1394CMUGrabber.h similarity index 92% rename from src/device/framegrabber/1394/vp1394CMUGrabber.h rename to modules/sensor/include/visp3/sensor/vp1394CMUGrabber.h index c34a837f81ee0c7347832b8e9f3ed2588c8e4b28..e5009ebce050dfcc00cbb02ed171e8b7567880ad 100644 --- a/src/device/framegrabber/1394/vp1394CMUGrabber.h +++ b/modules/sensor/include/visp3/sensor/vp1394CMUGrabber.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vp1394CMUGrabber.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Firewire cameras video capture based on CMU 1394 Digital Camera SDK. * @@ -44,17 +40,17 @@ #ifndef vp1394CMUGrabber_h #define vp1394CMUGrabber_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_CMU1394 #include <windows.h> #include <1394Camera.h> // CMU library -#include <visp/vpImage.h> -#include <visp/vpFrameGrabber.h> -#include <visp/vpFrameGrabberException.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpFrameGrabber.h> +#include <visp3/core/vpFrameGrabberException.h> +#include <visp3/core/vpRGBa.h> /*! @@ -65,7 +61,7 @@ /*! \class vp1394CMUGrabber - \ingroup Framegrabber CameraDriver + \ingroup group_sensor_camera \brief Firewire cameras video capture based on CMU 1394 Digital Camera SDK. @@ -91,9 +87,9 @@ \code #include <iostream> -#include <visp/vpImage.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vp1394CMUGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/sensor/vp1394CMUGrabber.h> int main() { diff --git a/src/device/framegrabber/1394/vp1394TwoGrabber.h b/modules/sensor/include/visp3/sensor/vp1394TwoGrabber.h similarity index 90% rename from src/device/framegrabber/1394/vp1394TwoGrabber.h rename to modules/sensor/include/visp3/sensor/vp1394TwoGrabber.h index 4422023f0ed21837e20be61c3e3f7a74cf3412f7..007e709a8f50955faf21801b1a59f0dd254f6e39 100644 --- a/src/device/framegrabber/1394/vp1394TwoGrabber.h +++ b/modules/sensor/include/visp3/sensor/vp1394TwoGrabber.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vp1394TwoGrabber.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Firewire cameras video capture. * @@ -60,17 +56,17 @@ #ifndef vp1394TwoGrabber_h #define vp1394TwoGrabber_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <list> -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) /*! \class vp1394TwoGrabber - \ingroup Framegrabber CameraDriver + \ingroup group_sensor_camera \brief Class for firewire ieee1394 video devices using libdc1394-2.x api. @@ -94,14 +90,14 @@ - If more than one camera is connected, it is also possible to select a specific camera by its GUID: \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; // Create a gray level image container bool reset = false; // Disable bus reset during construction vp1394TwoGrabber g(reset); // Create a grabber based on libdc1394-2.x third party lib @@ -133,14 +129,14 @@ int main() - Here an example of multi camera capture. An other example is available in setCamera(): \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) bool reset = false; // Disable bus reset during construction vp1394TwoGrabber g(reset); // Creation of a grabber instance based on libdc1394-2.x third party lib. unsigned int ncameras; // Number of cameras on the bus @@ -183,12 +179,9 @@ int main() #include <dc1394/utils.h> #include <dc1394/vendor/avt.h> -#include <visp/vpImage.h> -#include <visp/vpFrameGrabber.h> -#include <visp/vpRGBa.h> -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -# include <visp/vpList.h> -#endif +#include <visp3/core/vpImage.h> +#include <visp3/core/vpFrameGrabber.h> +#include <visp3/core/vpRGBa.h> class VISP_EXPORT vp1394TwoGrabber : public vpFrameGrabber @@ -344,8 +337,26 @@ class VISP_EXPORT vp1394TwoGrabber : public vpFrameGrabber // uint32_t captureQuality ; } vpDc1394TwoCameraParametersData; - - public: +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vp1394TwoGrabber(const vp1394TwoGrabber &) +// : camera(NULL), cameras(NULL), num_cameras(0), camera_id(0), verbose(false), camIsOpen(NULL), +// num_buffers(4), // ring buffer size +// isDataModified(NULL), initialShutterMode(NULL), dataCam(NULL) +// #ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 +// , d(NULL), +// list(NULL) +// #endif +// { +// throw vpException(vpException::functionNotImplementedError,"Not implemented!"); +// } +// vp1394TwoGrabber &operator=(const vp1394TwoGrabber &){ +// throw vpException(vpException::functionNotImplementedError,"Not implemented!"); +// return *this; +// } +//#endif + +public: vp1394TwoGrabber(bool reset=true); virtual ~vp1394TwoGrabber(); @@ -427,18 +438,6 @@ class VISP_EXPORT vp1394TwoGrabber : public vpFrameGrabber static std::string videoMode2string(vp1394TwoVideoModeType videomode); -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated functions - */ - vp_deprecated uint32_t getColorCodingSupported(vp1394TwoVideoModeType videomode, - vpList<vp1394TwoColorCodingType> & codings); - vp_deprecated uint32_t getFramerateSupported(vp1394TwoVideoModeType videomode, - vpList<vp1394TwoFramerateType> & fps); - vp_deprecated uint32_t getVideoModeSupported(vpList<vp1394TwoVideoModeType> & videomodes); - -#endif - private: void open(); void initialize(bool reset); @@ -461,7 +460,7 @@ class VISP_EXPORT vp1394TwoGrabber : public vpFrameGrabber dc1394feature_mode_t* initialShutterMode; vpDc1394TwoCameraParametersData* dataCam; -#ifdef VISP_HAVE_DC1394_2_CAMERA_ENUMERATE +#ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE dc1394_t * d; dc1394camera_list_t * list; #endif diff --git a/src/device/framegrabber/directshow/vpDirectShowDevice.h b/modules/sensor/include/visp3/sensor/vpDirectShowDevice.h similarity index 83% rename from src/device/framegrabber/directshow/vpDirectShowDevice.h rename to modules/sensor/include/visp3/sensor/vpDirectShowDevice.h index 6f35fe237253e532f0191130c3ed10fabad53e02..96576b3aa5ca6249ab0bdb71661f5aa41516d5e9 100644 --- a/src/device/framegrabber/directshow/vpDirectShowDevice.h +++ b/modules/sensor/include/visp3/sensor/vpDirectShowDevice.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDirectShowDevice.h 4620 2014-01-27 21:28:32Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * DirectShow device description. * @@ -44,7 +40,7 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_DIRECTSHOW) ) #include <atlbase.h> @@ -52,8 +48,6 @@ #include <string> #include <dshow.h> - - class VISP_EXPORT vpDirectShowDevice { diff --git a/src/device/framegrabber/directshow/vpDirectShowGrabber.h b/modules/sensor/include/visp3/sensor/vpDirectShowGrabber.h similarity index 83% rename from src/device/framegrabber/directshow/vpDirectShowGrabber.h rename to modules/sensor/include/visp3/sensor/vpDirectShowGrabber.h index d360e26bde1913692d35b5314c074f7ed69a0d2f..6893e26e949973ad2ed05a82d3f644f8ba7141dd 100644 --- a/src/device/framegrabber/directshow/vpDirectShowGrabber.h +++ b/modules/sensor/include/visp3/sensor/vpDirectShowGrabber.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDirectShowGrabber.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * DirectShow framegrabber. * @@ -44,12 +40,12 @@ #ifndef vpDirectShowGrabber_hh #define vpDirectShowGrabber_hh -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_DIRECTSHOW) ) -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> -#include <visp/vpFrameGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/core/vpFrameGrabber.h> class vpDirectShowGrabberImpl; @@ -61,7 +57,7 @@ class vpDirectShowGrabberImpl; from the rest of the application. This is necessary to avoid conflicts between dshow's Qedit.h and Direct3D's includes. - \ingroup Framegrabber CameraDriver + \ingroup group_sensor_camera */ class VISP_EXPORT vpDirectShowGrabber : public vpFrameGrabber diff --git a/src/device/framegrabber/directshow/vpDirectShowGrabberImpl.h b/modules/sensor/include/visp3/sensor/vpDirectShowGrabberImpl.h old mode 100755 new mode 100644 similarity index 91% rename from src/device/framegrabber/directshow/vpDirectShowGrabberImpl.h rename to modules/sensor/include/visp3/sensor/vpDirectShowGrabberImpl.h index 6f07bde788f09f9107b66f211e9188bc1680856d..60979d572336f57030d617e0855a0e95a6fe2c0a --- a/src/device/framegrabber/directshow/vpDirectShowGrabberImpl.h +++ b/modules/sensor/include/visp3/sensor/vpDirectShowGrabberImpl.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDirectShowGrabberImpl.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * DirectShow framegrabber Implementation. * @@ -45,25 +41,23 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_DIRECTSHOW) ) #include <atlbase.h> #include <qedit.h> #include <dshow.h> -#include <visp/vpFrameGrabber.h> -#include <visp/vpFrameGrabberException.h> +#include <visp3/core/vpFrameGrabber.h> +#include <visp3/core/vpFrameGrabberException.h> -#include <visp/vpDirectShowSampleGrabberI.h> -#include <visp/vpDirectShowDevice.h> -#include <visp/vpDebug.h> +#include <visp3/sensor/vpDirectShowSampleGrabberI.h> +#include <visp3/sensor/vpDirectShowDevice.h> +#include <visp3/core/vpDebug.h> /*! \class vpDirectShowGrabberImpl \brief class for windows direct show devices - implementation - \ingroup libdevice - This class uses CComPtr which is the best way to be sure that all the interfaces are released sooner or later. diff --git a/src/device/framegrabber/directshow/vpDirectShowSampleGrabberI.h b/modules/sensor/include/visp3/sensor/vpDirectShowSampleGrabberI.h similarity index 84% rename from src/device/framegrabber/directshow/vpDirectShowSampleGrabberI.h rename to modules/sensor/include/visp3/sensor/vpDirectShowSampleGrabberI.h index f233f3c1144abe119d4e4bda422fd369725c104e..b29579f83b24d3f46db9c2ae25ef71da312db8f5 100644 --- a/src/device/framegrabber/directshow/vpDirectShowSampleGrabberI.h +++ b/modules/sensor/include/visp3/sensor/vpDirectShowSampleGrabberI.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDirectShowSampleGrabberI.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * DirectShow framegrabber callback. * @@ -44,15 +40,15 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_DIRECTSHOW) ) #include <qedit.h> #include <stdio.h> #include <dshow.h> -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> /*! This class is needed in order to implement a callback function diff --git a/src/device/kinect/vpKinect.h b/modules/sensor/include/visp3/sensor/vpKinect.h similarity index 82% rename from src/device/kinect/vpKinect.h rename to modules/sensor/include/visp3/sensor/vpKinect.h index d4b2d99b8968d20f0959d17eb9ca588642834d8f..cd822dc269adc561041b32bd518ed014ef5ae30a 100644 --- a/src/device/kinect/vpKinect.h +++ b/modules/sensor/include/visp3/sensor/vpKinect.h @@ -1,10 +1,7 @@ /**************************************************************************** - * - * $Id: vpKinect.h 4574 2014-01-09 08:48:51Z fspindle $ - * * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * API for using a Microsoft Kinect device * Requires libfreenect as a third party library @@ -45,25 +40,25 @@ #ifndef __VP_KINECT__ #define __VP_KINECT__ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> // Note that libfreenect needs libusb-1.0 and libpthread #if defined(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES) #include <iostream> #include <libfreenect.hpp> -#include <visp/vpMutex.h> // need pthread -#include <visp/vpImage.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpMeterPixelConversion.h> +#include <visp3/core/vpMutex.h> // need pthread +#include <visp3/core/vpImage.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/core/vpMeterPixelConversion.h> /*! \class vpKinect - \ingroup KinectDriver + \ingroup group_sensor_rgbd \brief Driver for the Kinect device. @@ -71,9 +66,9 @@ (depth map and color image) from a Kinect. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpKinect.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vpKinect.h> int main() { #ifdef VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES @@ -111,7 +106,16 @@ int main() { */ class VISP_EXPORT vpKinect : public Freenect::FreenectDevice { - public: +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpKinect(const vpKinect &); // Not implemented! +// vpKinect &operator=(const vpKinect &){ +// throw vpException(vpException::functionNotImplementedError,"Not implemented!"); +// return *this; +// } +//#endif + +public: /*! Depth map resolution. */ @@ -123,13 +127,6 @@ class VISP_EXPORT vpKinect : public Freenect::FreenectDevice vpKinect(freenect_context *ctx, int index); virtual ~vpKinect(); -#ifndef DOXYGEN_SHOULD_SKIP_THIS - vpKinect(const vpKinect &); // Not implemented! - void operator=(const vpKinect &){ - throw vpException(vpException::functionNotImplementedError,"Not implemented!"); - } -#endif - void start(vpKinect::vpDMResolution res = DMAP_LOW_RES); void stop(); diff --git a/src/device/laserscanner/vpLaserScan.h b/modules/sensor/include/visp3/sensor/vpLaserScan.h similarity index 91% rename from src/device/laserscanner/vpLaserScan.h rename to modules/sensor/include/visp3/sensor/vpLaserScan.h index b2e57ae59ad5a367fcf385f793eb76364095c609..877e2630937a5cb94a1cd904e4ebfe4356392615 100644 --- a/src/device/laserscanner/vpLaserScan.h +++ b/modules/sensor/include/visp3/sensor/vpLaserScan.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpLaserScan.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Laser scan data structure. * @@ -48,13 +44,14 @@ */ -#include "visp/vpScanPoint.h" +#include "visp3/sensor/vpScanPoint.h" #include <vector> /*! \class vpLaserScan + \ingroup group_sensor_laserscanner \brief Implements a laser scan data structure that contains especially the list of scanned points that have been recorded for diff --git a/src/device/laserscanner/vpLaserScanner.h b/modules/sensor/include/visp3/sensor/vpLaserScanner.h similarity index 83% rename from src/device/laserscanner/vpLaserScanner.h rename to modules/sensor/include/visp3/sensor/vpLaserScanner.h index bc30f0d71a49ea30085c50b5534559b757e6f195..7c9cb7290dc8d7be50bbf72b8c4d39f5a3f8f56f 100644 --- a/src/device/laserscanner/vpLaserScanner.h +++ b/modules/sensor/include/visp3/sensor/vpLaserScanner.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpLaserScanner.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Generic laser scanner. * @@ -42,7 +38,7 @@ #define vpLaserScanner_h -#include "visp/vpConfig.h" +#include "visp3/core/vpConfig.h" /*! @@ -54,6 +50,7 @@ /*! \class vpLaserScanner + \ingroup group_sensor_laserscanner \brief Class that defines a generic laser scanner. */ diff --git a/src/device/framegrabber/OpenCV/vpOpenCVGrabber.h b/modules/sensor/include/visp3/sensor/vpOpenCVGrabber.h similarity index 86% rename from src/device/framegrabber/OpenCV/vpOpenCVGrabber.h rename to modules/sensor/include/visp3/sensor/vpOpenCVGrabber.h index 1587a92b3ec912e82aca25793bc3da850ab1fa5c..397b0aebcc57700940b2d86930197be15da91704 100644 --- a/src/device/framegrabber/OpenCV/vpOpenCVGrabber.h +++ b/modules/sensor/include/visp3/sensor/vpOpenCVGrabber.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpOpenCVGrabber.h 5023 2014-12-03 16:07:48Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Cameras video capture using OpenCV library. * @@ -47,7 +43,7 @@ #ifndef vpOpenCVGrabber_h #define vpOpenCVGrabber_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION < 0x020408)) @@ -57,9 +53,9 @@ # include <highgui.h> #endif -#include <visp/vpImage.h> -#include <visp/vpFrameGrabber.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpFrameGrabber.h> +#include <visp3/core/vpRGBa.h> /*! \class vpOpenCVGrabber diff --git a/src/device/laserscanner/vpScanPoint.h b/modules/sensor/include/visp3/sensor/vpScanPoint.h similarity index 94% rename from src/device/laserscanner/vpScanPoint.h rename to modules/sensor/include/visp3/sensor/vpScanPoint.h index cd8533e3437a3176c68fdbc77a2f608e1aa2450f..52357c0cb66361de29b123c6c9af09c38e3587ad 100644 --- a/src/device/laserscanner/vpScanPoint.h +++ b/modules/sensor/include/visp3/sensor/vpScanPoint.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpScanPoint.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Single laser scanner point. * @@ -41,7 +37,7 @@ #ifndef vpScanPoint_h #define vpScanPoint_h -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> #include <ostream> #include <sstream> @@ -58,6 +54,7 @@ /*! \class vpScanPoint + \ingroup group_sensor_laserscanner \brief Class that defines a single laser scanner point. @@ -228,7 +225,7 @@ class /* VISP_EXPORT */ vpScanPoint // Note that here VISP_EXPORT should not be \code #include <iostream> -#include <visp/vpScanPoint.h> +#include <visp3/sensor/vpScanPoint.h> int main() { diff --git a/src/device/laserscanner/sick/vpSickLDMRS.h b/modules/sensor/include/visp3/sensor/vpSickLDMRS.h similarity index 86% rename from src/device/laserscanner/sick/vpSickLDMRS.h rename to modules/sensor/include/visp3/sensor/vpSickLDMRS.h index 062517c5536ec4fddd8403ba6dd7a5b26978de39..0f6f1b8a1f91f7faade051ddf4a70cadafc8ef03 100644 --- a/src/device/laserscanner/sick/vpSickLDMRS.h +++ b/modules/sensor/include/visp3/sensor/vpSickLDMRS.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSickLDMRS.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Sick LD-MRS laser driver. * @@ -41,7 +37,7 @@ #ifndef vpSickLDMRS_h #define vpSickLDMRS_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) @@ -50,11 +46,11 @@ #include <vector> #include <string.h> -#include <visp/vpScanPoint.h> -#include <visp/vpLaserScan.h> -#include <visp/vpLaserScanner.h> -#include <visp/vpColVector.h> -#include <visp/vpException.h> +#include <visp3/sensor/vpScanPoint.h> +#include <visp3/sensor/vpLaserScan.h> +#include <visp3/sensor/vpLaserScanner.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpException.h> /*! @@ -67,7 +63,7 @@ \class vpSickLDMRS - \ingroup LaserDriver + \ingroup group_sensor_laserscanner \brief Driver for the Sick LD-MRS laser scanner. @@ -77,7 +73,7 @@ LD-MRS could be acquired. \code -#include "visp/vpSickLDMRS.h" +#include "visp3/sensor/vpSickLDMRS.h" int main() { diff --git a/src/device/framegrabber/v4l2/vpV4l2Grabber.h b/modules/sensor/include/visp3/sensor/vpV4l2Grabber.h similarity index 87% rename from src/device/framegrabber/v4l2/vpV4l2Grabber.h rename to modules/sensor/include/visp3/sensor/vpV4l2Grabber.h index 08d4ad225087b9a6f88f959c5c8b908c6bd6d709..88f0638b8c70be47efb4b9e1a0a8e4dca12c1411 100644 --- a/src/device/framegrabber/v4l2/vpV4l2Grabber.h +++ b/modules/sensor/include/visp3/sensor/vpV4l2Grabber.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpV4l2Grabber.h 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Video for linux two framegrabber. * @@ -49,7 +45,7 @@ #ifndef vpV4l2Grabber_hh #define vpV4l2Grabber_hh -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_V4L2 @@ -58,17 +54,14 @@ #include <linux/videodev2.h> // Video For Linux Two interface #include <libv4l2.h> // Video For Linux Two interface -#include <visp/vpImage.h> -#include <visp/vpFrameGrabber.h> -#include <visp/vpRGBa.h> - - - +#include <visp3/core/vpImage.h> +#include <visp3/core/vpFrameGrabber.h> +#include <visp3/core/vpRGBa.h> /*! \class vpV4l2Grabber - \ingroup Framegrabber CameraDriver + \ingroup group_sensor_camera \brief Class for the Video4Linux2 video device. @@ -107,10 +100,10 @@ This other example shows how to use this grabber with an analogic camera attached to a bttv PCI card. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpV4l2Grabber.h> -#include <visp/vpImageIo.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#include <visp3/io/vpImageIo.h> int main() { @@ -195,6 +188,25 @@ public: }; #endif +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpV4l2Grabber(const vpV4l2Grabber &) +// : fd(-1), device(), cap(), streamparm(), inp(NULL), std(NULL), fmt(NULL), ctl(NULL), +// fps(0), fmt_v4l2(), fmt_me(), reqbufs(), buf_v4l2(NULL), buf_me(NULL), queue(0), +// waiton_cpt(0), index_buffer(0), m_verbose(false), m_nbuffers(3), field(0), streaming(false), +// m_input(vpV4l2Grabber::DEFAULT_INPUT), +// m_framerate(vpV4l2Grabber::framerate_25fps), +// m_frameformat(vpV4l2Grabber::V4L2_FRAME_FORMAT), +// m_pixelformat(vpV4l2Grabber::V4L2_YUYV_FORMAT) +// { +// throw vpException(vpException::functionNotImplementedError,"Not implemented!"); +// } +// vpV4l2Grabber &operator=(const vpV4l2Grabber &){ +// throw vpException(vpException::functionNotImplementedError,"Not implemented!"); +// return *this; +// } +//#endif + public: vpV4l2Grabber(); vpV4l2Grabber(bool verbose); diff --git a/src/device/framegrabber/1394/vp1394CMUGrabber.cpp b/modules/sensor/src/framegrabber/1394/vp1394CMUGrabber.cpp similarity index 94% rename from src/device/framegrabber/1394/vp1394CMUGrabber.cpp rename to modules/sensor/src/framegrabber/1394/vp1394CMUGrabber.cpp index 0e7dac0a86d55748fea32982ffea58dca336f504..786026d77f7d76cdc648601d674196cddf3588ba 100644 --- a/src/device/framegrabber/1394/vp1394CMUGrabber.cpp +++ b/modules/sensor/src/framegrabber/1394/vp1394CMUGrabber.cpp @@ -1,379 +1,374 @@ -/**************************************************************************** - * - * $Id: vp1394CMUGrabber.cpp 4574 2014-01-09 08:48:51Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Firewire cameras video capture based on CMU 1394 Digital Camera SDK. - * - * Authors: - * Lucas Lopes Lemos FEMTO-ST, AS2M departement, Besancon - * Guillaume Laurent FEMTO-ST, AS2M departement, Besancon - * Fabien Spindler - * - *****************************************************************************/ - -#include <visp/vpConfig.h> - -#ifdef VISP_HAVE_CMU1394 - -#include <iostream> - -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> -#include <visp/vp1394CMUGrabber.h> - -/*! - Basic constructor. - */ -vp1394CMUGrabber::vp1394CMUGrabber() -{ - // public members - init = false; - - // protected members - width = height = -1; - - // private members - camera = new C1394Camera; - index = 0; // If a camera was not selected the first one (index = 0) will be used - _format = _mode = _fps = -1; - _modeauto=true; -} - -/*! - Destructor. - */ -vp1394CMUGrabber::~vp1394CMUGrabber( ) -{ - close(); - // delete camera instance - if (camera) { - delete camera; - camera = NULL; - } -} - -/*! - Select the camera on the bus from its index. The first camera found on the bus has index 0. - \param cam_id : Camera index. -*/ -void -vp1394CMUGrabber::selectCamera(int cam_id) -{ - int camerror; - - index = cam_id ; - - camerror = camera->SelectCamera(index); - if ( camerror!= CAM_SUCCESS) - { - switch (camerror) - { - case CAM_ERROR_PARAM_OUT_OF_RANGE: - vpERROR_TRACE("vp1394CMUGrabber error: Found no camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"The required camera is not present") ); - break; - case CAM_ERROR_BUSY: - vpERROR_TRACE("vp1394CMUGrabber error: The camera %i is busy",index); - throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"The required camera is in use by other application") ); - break; - case CAM_ERROR: - vpERROR_TRACE("vp1394CMUGrabber error: General I/O error when selecting camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"Resolve camera can not be used") ); - break; - } - close(); - } -} // end camera select - -/*! - Init the selected camera. - */ -void -vp1394CMUGrabber::initCamera() -{ - if (init == false) - { - int camerror; - - if (camera->CheckLink() != CAM_SUCCESS) - { - vpERROR_TRACE("C1394Camera error: Found no cameras on the 1394 bus"); - throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"The is no detected camera") ); - } - - camerror = camera->InitCamera(); - if ( camerror != CAM_SUCCESS ) - { - switch (camerror) - { - case CAM_ERROR_NOT_INITIALIZED: - vpERROR_TRACE("vp1394CMUGrabber error: No camera selected",index); - throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"The is no selected camera") ); - break; - case CAM_ERROR_BUSY: - vpERROR_TRACE("vp1394CMUGrabber error: The camera %i is busy",index); - throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"The required camera is in use by other application") ); - break; - case CAM_ERROR: - vpERROR_TRACE("vp1394CMUGrabber error: General I/O error when selecting camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"Resolve camera can not be used") ); - break; - } - close(); - } - - if (camera->Has1394b()) - camera->Set1394b(TRUE); - - // Get the current settings - _format = camera->GetVideoFormat(); - _mode = camera->GetVideoMode(); - _color = getVideoColorCoding(); - //std::cout << "format: " << _format << std::endl; - //std::cout << "mode: " << _mode << std::endl; - //std::cout << "color coding: " << _color << std::endl; - - // Set trigger off - camera->GetCameraControlTrigger()->SetOnOff(false); - - unsigned long w, h; - camera->GetVideoFrameDimensions(&w, &h); - this->width = w; - this->height = h; - - // start acquisition - if (camera->StartImageAcquisition() != CAM_SUCCESS) - { - close(); - vpERROR_TRACE("vp1394CMUGrabber error: Can't start image acquisition from IEEE 1394 camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::otherError, - "Error while starting image acquisition") ); - } - - init = true; - } - -} // end camera init - - -/*! - Initialization of the grabber using a greyscale image. - \param I : gray level image. - */ -void -vp1394CMUGrabber::open(vpImage<unsigned char> &I) -{ - initCamera(); - I.resize(this->height, this->width); -} - -/*! - Initialization of the grabber using a color image. - \param I : color image. - */ -void -vp1394CMUGrabber::open(vpImage<vpRGBa> &I) -{ - initCamera(); - I.resize(this->height, this->width); -} - -/*! - Grabs a grayscale image from the selected camera. If the camera color - coding differs from vp1394CMUGrabber::MONO8, the acquired image is - converted in a gray level image to match the requested format. - - \param I : Acquired gray level image. - */ -void -vp1394CMUGrabber::acquire(vpImage<unsigned char> &I) -{ - // get image data - unsigned long length; - unsigned char *rawdata = NULL ; - int dropped; - unsigned int size; - - open(I); - - camera->AcquireImageEx(TRUE,&dropped); - rawdata = camera->GetRawData(&length); - - size = I.getSize(); - switch(_color) { - case vp1394CMUGrabber::MONO8: - memcpy(I.bitmap, (unsigned char *) rawdata, size); - break; - case vp1394CMUGrabber::MONO16: - vpImageConvert::MONO16ToGrey(rawdata, I.bitmap, size); - break; - - case vp1394CMUGrabber::YUV411: - vpImageConvert::YUV411ToGrey(rawdata, I.bitmap, size); - break; - - case vp1394CMUGrabber::YUV422: - vpImageConvert::YUV422ToGrey(rawdata, I.bitmap, size); - break; - - case vp1394CMUGrabber::YUV444: - vpImageConvert::YUV444ToGrey(rawdata, I.bitmap, size); - break; - - case vp1394CMUGrabber::RGB8: - vpImageConvert::RGBToGrey(rawdata, I.bitmap, size); - break; - - default: - close(); - vpERROR_TRACE("Format conversion not implemented. Acquisition failed."); - throw (vpFrameGrabberException(vpFrameGrabberException::otherError, - "Format conversion not implemented. " - "Acquisition failed.") ); - break; - }; - - //unsigned short depth = 0; - //camera->GetVideoDataDepth(&depth); - //std::cout << "depth: " << depth << " computed: " << (float)(length/(I.getHeight() * I.getWidth())) << std::endl; - - - //memcpy(I.bitmap,rawdata,length); - -} - -/*! - Grabs a color image from the selected camera. Since the cameras - are not able to grab RGBa color coding format, the acquired image is - converted in a RGBa to match the requested format. This transformation - could be time consuming. - - \param I : Acquired color image in RGBa format. - */ -void -vp1394CMUGrabber::acquire(vpImage<vpRGBa> &I) -{ - // get image data - unsigned long length; - unsigned char *rawdata = NULL; - int dropped; - unsigned int size; - - open(I); - - camera->AcquireImageEx(TRUE,&dropped); - rawdata = camera->GetRawData(&length); - size = I.getWidth() * I.getHeight(); - - switch (_color) { - case vp1394CMUGrabber::MONO8: - vpImageConvert::GreyToRGBa(rawdata, (unsigned char *)I.bitmap, size); - break; - - case vp1394CMUGrabber::MONO16: - vpImageConvert::MONO16ToRGBa(rawdata, (unsigned char *)I.bitmap, size); - break; - - case vp1394CMUGrabber::YUV411: - vpImageConvert::YUV411ToRGBa(rawdata, (unsigned char *)I.bitmap, size); - break; - - case vp1394CMUGrabber::YUV422: - vpImageConvert::YUV422ToRGBa(rawdata, (unsigned char *)I.bitmap, size); - break; - - case vp1394CMUGrabber::YUV444: - vpImageConvert::YUV444ToRGBa(rawdata, (unsigned char *)I.bitmap, size); - break; - - case vp1394CMUGrabber::RGB8: - size = length / 3; - vpImageConvert::RGBToRGBa(rawdata, (unsigned char *)I.bitmap, size); - break; - - default: - close(); - vpERROR_TRACE("Format conversion not implemented. Acquisition failed."); - throw (vpFrameGrabberException(vpFrameGrabberException::otherError, - "Format conversion not implemented. " - "Acquisition failed.") ); - break; - }; -} - -/*! - Stop the acquisition of images and free the camera. - */ -void -vp1394CMUGrabber::close() -{ - // stop acquisition - if (camera->IsAcquiring()) { - // stop acquisition - if (camera->StopImageAcquisition() != CAM_SUCCESS) - { - close(); - vpERROR_TRACE("vp1394CMUGrabber error: Can't stop image acquisition from IEEE 1394 camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::otherError, - "Error while stopping image acquisition") ); - } - } - - init = false; -} - -/*! - Set the gain and the shutter values. - \sa setGain(), setShutter() - */ -void -vp1394CMUGrabber::setControl(unsigned short gain, unsigned short shutter) -{ - setShutter(shutter); - setGain(gain); -} - -/*! - Get the number of connected cameras. - */ -int -vp1394CMUGrabber::getNumberOfConnectedCameras() const -{ - int n_cam = camera->RefreshCameraList(); - - return n_cam; -} - +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Firewire cameras video capture based on CMU 1394 Digital Camera SDK. + * + * Authors: + * Lucas Lopes Lemos FEMTO-ST, AS2M departement, Besancon + * Guillaume Laurent FEMTO-ST, AS2M departement, Besancon + * Fabien Spindler + * + *****************************************************************************/ + +#include <visp3/core/vpConfig.h> + +#ifdef VISP_HAVE_CMU1394 + +#include <iostream> + +#include <visp3/core/vpImageConvert.h> +#include <visp3/sensor/vp1394CMUGrabber.h> + +/*! + Basic constructor. + */ +vp1394CMUGrabber::vp1394CMUGrabber() +{ + // public members + init = false; + + // protected members + width = height = -1; + + // private members + camera = new C1394Camera; + index = 0; // If a camera was not selected the first one (index = 0) will be used + _format = _mode = _fps = -1; + _modeauto=true; +} + +/*! + Destructor. + */ +vp1394CMUGrabber::~vp1394CMUGrabber( ) +{ + close(); + // delete camera instance + if (camera) { + delete camera; + camera = NULL; + } +} + +/*! + Select the camera on the bus from its index. The first camera found on the bus has index 0. + \param cam_id : Camera index. +*/ +void +vp1394CMUGrabber::selectCamera(int cam_id) +{ + int camerror; + + index = cam_id ; + + camerror = camera->SelectCamera(index); + if ( camerror!= CAM_SUCCESS) + { + switch (camerror) + { + case CAM_ERROR_PARAM_OUT_OF_RANGE: + vpERROR_TRACE("vp1394CMUGrabber error: Found no camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"The required camera is not present") ); + break; + case CAM_ERROR_BUSY: + vpERROR_TRACE("vp1394CMUGrabber error: The camera %i is busy",index); + throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"The required camera is in use by other application") ); + break; + case CAM_ERROR: + vpERROR_TRACE("vp1394CMUGrabber error: General I/O error when selecting camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"Resolve camera can not be used") ); + break; + } + close(); + } +} // end camera select + +/*! + Init the selected camera. + */ +void +vp1394CMUGrabber::initCamera() +{ + if (init == false) + { + int camerror; + + if (camera->CheckLink() != CAM_SUCCESS) + { + vpERROR_TRACE("C1394Camera error: Found no cameras on the 1394 bus"); + throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"The is no detected camera") ); + } + + camerror = camera->InitCamera(); + if ( camerror != CAM_SUCCESS ) + { + switch (camerror) + { + case CAM_ERROR_NOT_INITIALIZED: + vpERROR_TRACE("vp1394CMUGrabber error: No camera selected",index); + throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"The is no selected camera") ); + break; + case CAM_ERROR_BUSY: + vpERROR_TRACE("vp1394CMUGrabber error: The camera %i is busy",index); + throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"The required camera is in use by other application") ); + break; + case CAM_ERROR: + vpERROR_TRACE("vp1394CMUGrabber error: General I/O error when selecting camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::initializationError,"Resolve camera can not be used") ); + break; + } + close(); + } + + if (camera->Has1394b()) + camera->Set1394b(TRUE); + + // Get the current settings + _format = camera->GetVideoFormat(); + _mode = camera->GetVideoMode(); + _color = getVideoColorCoding(); + //std::cout << "format: " << _format << std::endl; + //std::cout << "mode: " << _mode << std::endl; + //std::cout << "color coding: " << _color << std::endl; + + // Set trigger off + camera->GetCameraControlTrigger()->SetOnOff(false); + + unsigned long w, h; + camera->GetVideoFrameDimensions(&w, &h); + this->width = w; + this->height = h; + + // start acquisition + if (camera->StartImageAcquisition() != CAM_SUCCESS) + { + close(); + vpERROR_TRACE("vp1394CMUGrabber error: Can't start image acquisition from IEEE 1394 camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::otherError, + "Error while starting image acquisition") ); + } + + init = true; + } + +} // end camera init + + +/*! + Initialization of the grabber using a greyscale image. + \param I : gray level image. + */ +void +vp1394CMUGrabber::open(vpImage<unsigned char> &I) +{ + initCamera(); + I.resize(this->height, this->width); +} + +/*! + Initialization of the grabber using a color image. + \param I : color image. + */ +void +vp1394CMUGrabber::open(vpImage<vpRGBa> &I) +{ + initCamera(); + I.resize(this->height, this->width); +} + +/*! + Grabs a grayscale image from the selected camera. If the camera color + coding differs from vp1394CMUGrabber::MONO8, the acquired image is + converted in a gray level image to match the requested format. + + \param I : Acquired gray level image. + */ +void +vp1394CMUGrabber::acquire(vpImage<unsigned char> &I) +{ + // get image data + unsigned long length; + unsigned char *rawdata = NULL ; + int dropped; + unsigned int size; + + open(I); + + camera->AcquireImageEx(TRUE,&dropped); + rawdata = camera->GetRawData(&length); + + size = I.getSize(); + switch(_color) { + case vp1394CMUGrabber::MONO8: + memcpy(I.bitmap, (unsigned char *) rawdata, size); + break; + case vp1394CMUGrabber::MONO16: + vpImageConvert::MONO16ToGrey(rawdata, I.bitmap, size); + break; + + case vp1394CMUGrabber::YUV411: + vpImageConvert::YUV411ToGrey(rawdata, I.bitmap, size); + break; + + case vp1394CMUGrabber::YUV422: + vpImageConvert::YUV422ToGrey(rawdata, I.bitmap, size); + break; + + case vp1394CMUGrabber::YUV444: + vpImageConvert::YUV444ToGrey(rawdata, I.bitmap, size); + break; + + case vp1394CMUGrabber::RGB8: + vpImageConvert::RGBToGrey(rawdata, I.bitmap, size); + break; + + default: + close(); + vpERROR_TRACE("Format conversion not implemented. Acquisition failed."); + throw (vpFrameGrabberException(vpFrameGrabberException::otherError, + "Format conversion not implemented. " + "Acquisition failed.") ); + break; + }; + + //unsigned short depth = 0; + //camera->GetVideoDataDepth(&depth); + //std::cout << "depth: " << depth << " computed: " << (float)(length/(I.getHeight() * I.getWidth())) << std::endl; + + + //memcpy(I.bitmap,rawdata,length); + +} + +/*! + Grabs a color image from the selected camera. Since the cameras + are not able to grab RGBa color coding format, the acquired image is + converted in a RGBa to match the requested format. This transformation + could be time consuming. + + \param I : Acquired color image in RGBa format. + */ +void +vp1394CMUGrabber::acquire(vpImage<vpRGBa> &I) +{ + // get image data + unsigned long length; + unsigned char *rawdata = NULL; + int dropped; + unsigned int size; + + open(I); + + camera->AcquireImageEx(TRUE,&dropped); + rawdata = camera->GetRawData(&length); + size = I.getWidth() * I.getHeight(); + + switch (_color) { + case vp1394CMUGrabber::MONO8: + vpImageConvert::GreyToRGBa(rawdata, (unsigned char *)I.bitmap, size); + break; + + case vp1394CMUGrabber::MONO16: + vpImageConvert::MONO16ToRGBa(rawdata, (unsigned char *)I.bitmap, size); + break; + + case vp1394CMUGrabber::YUV411: + vpImageConvert::YUV411ToRGBa(rawdata, (unsigned char *)I.bitmap, size); + break; + + case vp1394CMUGrabber::YUV422: + vpImageConvert::YUV422ToRGBa(rawdata, (unsigned char *)I.bitmap, size); + break; + + case vp1394CMUGrabber::YUV444: + vpImageConvert::YUV444ToRGBa(rawdata, (unsigned char *)I.bitmap, size); + break; + + case vp1394CMUGrabber::RGB8: + size = length / 3; + vpImageConvert::RGBToRGBa(rawdata, (unsigned char *)I.bitmap, size); + break; + + default: + close(); + vpERROR_TRACE("Format conversion not implemented. Acquisition failed."); + throw (vpFrameGrabberException(vpFrameGrabberException::otherError, + "Format conversion not implemented. " + "Acquisition failed.") ); + break; + }; +} + +/*! + Stop the acquisition of images and free the camera. + */ +void +vp1394CMUGrabber::close() +{ + // stop acquisition + if (camera->IsAcquiring()) { + // stop acquisition + if (camera->StopImageAcquisition() != CAM_SUCCESS) + { + close(); + vpERROR_TRACE("vp1394CMUGrabber error: Can't stop image acquisition from IEEE 1394 camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::otherError, + "Error while stopping image acquisition") ); + } + } + + init = false; +} + +/*! + Set the gain and the shutter values. + \sa setGain(), setShutter() + */ +void +vp1394CMUGrabber::setControl(unsigned short gain, unsigned short shutter) +{ + setShutter(shutter); + setGain(gain); +} + +/*! + Get the number of connected cameras. + */ +int +vp1394CMUGrabber::getNumberOfConnectedCameras() const +{ + int n_cam = camera->RefreshCameraList(); + + return n_cam; +} + /*! Get the gain min and max values. @@ -383,9 +378,9 @@ void vp1394CMUGrabber::getGainMinMax(unsigned short &min, unsigned short &max) { initCamera(); - C1394CameraControl *Control; - Control = camera->GetCameraControl(FEATURE_GAIN); - Control->Inquire(); + C1394CameraControl *Control; + Control = camera->GetCameraControl(FEATURE_GAIN); + Control->Inquire(); Control->GetRange(&min, &max); } /*! @@ -407,29 +402,29 @@ void vp1394CMUGrabber::setGain(unsigned short gain) { initCamera(); _gain = gain; - - unsigned short min,max; - C1394CameraControl *Control; - - Control = camera->GetCameraControl(FEATURE_GAIN); - Control->Inquire(); - Control->GetRange(&min,&max); - - if (_gain < min) - { - _gain = min; - std::cout << "vp1394CMUGrabber warning: Desired gain register value of IEEE 1394 camera number " << index << " can't be less than " << _gain << std::endl; - } - else if (_gain > max) - { - _gain = max; - std::cout << "vp1394CMUGrabber warning: Desired gain register value of IEEE 1394 camera number " << index << " can't be greater than " << _gain << std::endl; - } - - Control->SetAutoMode(false); - if(Control->SetValue(_gain) != CAM_SUCCESS) - { - std::cout << "vp1394CMUGrabber warning: Can't set gain register value of IEEE 1394 camera number " << index << std::endl; + + unsigned short min,max; + C1394CameraControl *Control; + + Control = camera->GetCameraControl(FEATURE_GAIN); + Control->Inquire(); + Control->GetRange(&min,&max); + + if (_gain < min) + { + _gain = min; + std::cout << "vp1394CMUGrabber warning: Desired gain register value of IEEE 1394 camera number " << index << " can't be less than " << _gain << std::endl; + } + else if (_gain > max) + { + _gain = max; + std::cout << "vp1394CMUGrabber warning: Desired gain register value of IEEE 1394 camera number " << index << " can't be greater than " << _gain << std::endl; + } + + Control->SetAutoMode(false); + if(Control->SetValue(_gain) != CAM_SUCCESS) + { + std::cout << "vp1394CMUGrabber warning: Can't set gain register value of IEEE 1394 camera number " << index << std::endl; } } @@ -442,12 +437,12 @@ void vp1394CMUGrabber::getShutterMinMax(unsigned short &min, unsigned short &max { initCamera(); - C1394CameraControl *Control; - Control = camera->GetCameraControl(FEATURE_SHUTTER); - Control->Inquire(); + C1394CameraControl *Control; + Control = camera->GetCameraControl(FEATURE_SHUTTER); + Control->Inquire(); Control->GetRange(&min, &max); } - + /*! Enable auto shutter. @@ -457,7 +452,7 @@ void vp1394CMUGrabber::setAutoShutter() { initCamera(); camera->GetCameraControl(FEATURE_SHUTTER)->SetAutoMode(true); -} +} /*! Disable auto shutter and set the shutter to the requested value. @@ -469,266 +464,269 @@ void vp1394CMUGrabber::setShutter(unsigned short shutter) _shutter = shutter; - unsigned short min,max; - C1394CameraControl *Control; - - Control = camera->GetCameraControl(FEATURE_SHUTTER); - Control->Inquire(); - Control->GetRange(&min,&max); - - if (_shutter < min) - { - _shutter = min; - std::cout << "vp1394CMUGrabber warning: Desired exposure time register value of IEEE 1394 camera number " << index << " can't be less than " << _shutter << std::endl; - } - else if (_shutter > max) - { - _shutter = max; - std::cout << "vp1394CMUGrabber warning: Desired exposure time register value of IEEE 1394 camera number " << index << " can't be greater than " << _shutter << std::endl; - } - Control->SetAutoMode(false); - if(Control->SetValue(_shutter) != CAM_SUCCESS) - { - std::cout << "vp1394CMUGrabber warning: Can't set exposure time register value of IEEE 1394 camera number " << index << std::endl; + unsigned short min,max; + C1394CameraControl *Control; + + Control = camera->GetCameraControl(FEATURE_SHUTTER); + Control->Inquire(); + Control->GetRange(&min,&max); + + if (_shutter < min) + { + _shutter = min; + std::cout << "vp1394CMUGrabber warning: Desired exposure time register value of IEEE 1394 camera number " << index << " can't be less than " << _shutter << std::endl; + } + else if (_shutter > max) + { + _shutter = max; + std::cout << "vp1394CMUGrabber warning: Desired exposure time register value of IEEE 1394 camera number " << index << " can't be greater than " << _shutter << std::endl; + } + Control->SetAutoMode(false); + if(Control->SetValue(_shutter) != CAM_SUCCESS) + { + std::cout << "vp1394CMUGrabber warning: Can't set exposure time register value of IEEE 1394 camera number " << index << std::endl; + } +} + +/*! + Display information about the camera on the standard output. + */ +void +vp1394CMUGrabber::displayCameraDescription(int cam_id) +{ + char buf[512]; + + if( camera->GetNumberCameras() > cam_id ) + { + camera->GetNodeDescription(cam_id,buf,512); + std::cout << "Camera " << cam_id << ": " << buf << std::endl ; + + } + else { + std::cout << "Camera " << cam_id << ": camera not found" << std::endl ; + } +} + + +/*! + Display camera model on the standard output. Call it after open the grabber. + */ +void +vp1394CMUGrabber::displayCameraModel() +{ + char vendor[256] , model[256] , buf[256]; + LARGE_INTEGER ID; + + camera->GetCameraName(model,sizeof(model)); + camera->GetCameraVendor(vendor,sizeof(vendor)); + camera->GetCameraUniqueID(&ID); + + std::cout << "Vendor: " << vendor << std::endl; + std::cout << "Model: " << model << std::endl; + + sprintf(buf,"%08X%08X",ID.HighPart,ID.LowPart); + std::cout << "UniqueID: " << buf << std::endl; + +} + + +/*! + Set the camera format and video mode. + This method has to be called before open(). + + \param format : Camera video format. + \param mode : Camera video mode. + + See the following table for the correspondances between the input + format and mode and the resulting video color coding. + + <TABLE BORDER="1"> + <TR><TH> Format </TH><TH> Mode </TH><TH> (H) x (W) </TH><TH> Color </TH></TR> + <TR><TD> 0 </TD><TD> 0 </TD><TD> 160 x 120 </TD><TD> YUV444 </TD></TR> + <TR><TD> 0 </TD><TD> 1 </TD><TD> 320 x 240 </TD><TD> YUV422 </TD></TR> + <TR><TD> 0 </TD><TD> 2 </TD><TD> 640 x 480 </TD><TD> YUV411 </TD></TR> + <TR><TD> 0 </TD><TD> 3 </TD><TD> 640 x 480 </TD><TD> YUV422 </TD></TR> + <TR><TD> 0 </TD><TD> 4 </TD><TD> 640 x 480 </TD><TD> RGB8 </TD></TR> + <TR><TD> 0 </TD><TD> 5 </TD><TD> 640 x 480 </TD><TD> MONO8 </TD></TR> + <TR><TD> 0 </TD><TD> 6 </TD><TD> 640 x 480 </TD><TD> MONO16 </TD></TR> + <TR><TD> 1 </TD><TD> 0 </TD><TD> 800 x 600 </TD><TD> YUV422 </TD></TR> + <TR><TD> 1 </TD><TD> 1 </TD><TD> 800 x 600 </TD><TD> RGB8 </TD></TR> + <TR><TD> 1 </TD><TD> 2 </TD><TD> 800 x 600 </TD><TD> MONO8 </TD></TR> + <TR><TD> 1 </TD><TD> 3 </TD><TD>1024 x 768 </TD><TD> YUV422 </TD></TR> + <TR><TD> 1 </TD><TD> 4 </TD><TD>1024 x 768 </TD><TD> RGB8 </TD></TR> + <TR><TD> 1 </TD><TD> 5 </TD><TD>1024 x 768 </TD><TD> MONO8 </TD></TR> + <TR><TD> 1 </TD><TD> 6 </TD><TD> 800 x 600 </TD><TD> MONO16 </TD></TR> + <TR><TD> 1 </TD><TD> 7 </TD><TD>1024 x 768 </TD><TD> MONO16 </TD></TR> + <TR><TD> 2 </TD><TD> 0 </TD><TD>1280 x 960 </TD><TD> YUV422 </TD></TR> + <TR><TD> 2 </TD><TD> 1 </TD><TD>1280 x 960 </TD><TD> RGB8 </TD></TR> + <TR><TD> 2 </TD><TD> 2 </TD><TD>1280 x 960 </TD><TD> MONO8 </TD></TR> + <TR><TD> 2 </TD><TD> 3 </TD><TD>1600 x 1200</TD><TD> YUV422 </TD></TR> + <TR><TD> 2 </TD><TD> 4 </TD><TD>1600 x 1200</TD><TD> RGB8 </TD></TR> + <TR><TD> 2 </TD><TD> 5 </TD><TD>1600 x 1200</TD><TD> MONO8 </TD></TR> + <TR><TD> 2 </TD><TD> 6 </TD><TD>1280 x 960 </TD><TD> MONO16 </TD></TR> + <TR><TD> 2 </TD><TD> 7 </TD><TD>1600 x 1200</TD><TD> MONO16 </TD></TR> + </TABLE> + + */ +void +vp1394CMUGrabber::setVideoMode( unsigned long format, unsigned long mode ) +{ + initCamera(); + + _format = format ; + _mode = mode ; + + // Set format and mode + if ((_format != -1) && (_mode != -1)) + { + if (!camera->HasVideoMode(_format, _mode)) + { + close(); + vpERROR_TRACE("vp1394CMUGrabber error: The image format is not supported by the IEEE 1394 camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::settingError,"Video mode not supported") ); + } + + if (camera->IsAcquiring()) { + // stop acquisition + if (camera->StopImageAcquisition() != CAM_SUCCESS) + { + close(); + vpERROR_TRACE("vp1394CMUGrabber error: Can't stop image acquisition from IEEE 1394 camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::otherError, + "Error while stopping image acquisition") ); + } + } + + if (camera->SetVideoFormat(_format) != CAM_SUCCESS) + { + close(); + vpERROR_TRACE("vp1394CMUGrabber error: Can't set video format of IEEE 1394 camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::settingError,"Can't set video format") ); + } + + if (camera->SetVideoMode(_mode) != CAM_SUCCESS) + { + close(); + vpERROR_TRACE("vp1394CMUGrabber error: Can't set video mode of IEEE 1394 camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::settingError,"Can't set video mode") ); + } + + // start acquisition + if (camera->StartImageAcquisition() != CAM_SUCCESS) + { + close(); + vpERROR_TRACE("vp1394CMUGrabber error: Can't start image acquisition from IEEE 1394 camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::otherError, + "Error while starting image acquisition") ); + } + + // Update Image dimension + unsigned long w, h; + camera->GetVideoFrameDimensions(&w, &h); + this->width = w; + this->height = h; + + // Update the color coding + _color = getVideoColorCoding(); } } - -/*! - Display information about the camera on the standard output. - */ -void -vp1394CMUGrabber::displayCameraDescription(int cam_id) -{ - char buf[512]; - - if( camera->GetNumberCameras() > cam_id ) - { - camera->GetNodeDescription(cam_id,buf,512); - std::cout << "Camera " << cam_id << ": " << buf << std::endl ; - - } - else { - std::cout << "Camera " << cam_id << ": camera not found" << std::endl ; - } -} - - -/*! - Display camera model on the standard output. Call it after open the grabber. - */ -void -vp1394CMUGrabber::displayCameraModel() -{ - char vendor[256] , model[256] , buf[256]; - LARGE_INTEGER ID; - - camera->GetCameraName(model,sizeof(model)); - camera->GetCameraVendor(vendor,sizeof(vendor)); - camera->GetCameraUniqueID(&ID); - - std::cout << "Vendor: " << vendor << std::endl; - std::cout << "Model: " << model << std::endl; - - sprintf(buf,"%08X%08X",ID.HighPart,ID.LowPart); - std::cout << "UniqueID: " << buf << std::endl; - -} - - -/*! - Set the camera format and video mode. - This method has to be called before open(). - - \param format : Camera video format. - \param mode : Camera video mode. - - See the following table for the correspondances between the input - format and mode and the resulting video color coding. - - <TABLE BORDER="1"> - <TR><TH> Format </TH><TH> Mode </TH><TH> (H) x (W) </TH><TH> Color </TH></TR> - <TR><TD> 0 </TD><TD> 0 </TD><TD> 160 x 120 </TD><TD> YUV444 </TD></TR> - <TR><TD> 0 </TD><TD> 1 </TD><TD> 320 x 240 </TD><TD> YUV422 </TD></TR> - <TR><TD> 0 </TD><TD> 2 </TD><TD> 640 x 480 </TD><TD> YUV411 </TD></TR> - <TR><TD> 0 </TD><TD> 3 </TD><TD> 640 x 480 </TD><TD> YUV422 </TD></TR> - <TR><TD> 0 </TD><TD> 4 </TD><TD> 640 x 480 </TD><TD> RGB8 </TD></TR> - <TR><TD> 0 </TD><TD> 5 </TD><TD> 640 x 480 </TD><TD> MONO8 </TD></TR> - <TR><TD> 0 </TD><TD> 6 </TD><TD> 640 x 480 </TD><TD> MONO16 </TD></TR> - <TR><TD> 1 </TD><TD> 0 </TD><TD> 800 x 600 </TD><TD> YUV422 </TD></TR> - <TR><TD> 1 </TD><TD> 1 </TD><TD> 800 x 600 </TD><TD> RGB8 </TD></TR> - <TR><TD> 1 </TD><TD> 2 </TD><TD> 800 x 600 </TD><TD> MONO8 </TD></TR> - <TR><TD> 1 </TD><TD> 3 </TD><TD>1024 x 768 </TD><TD> YUV422 </TD></TR> - <TR><TD> 1 </TD><TD> 4 </TD><TD>1024 x 768 </TD><TD> RGB8 </TD></TR> - <TR><TD> 1 </TD><TD> 5 </TD><TD>1024 x 768 </TD><TD> MONO8 </TD></TR> - <TR><TD> 1 </TD><TD> 6 </TD><TD> 800 x 600 </TD><TD> MONO16 </TD></TR> - <TR><TD> 1 </TD><TD> 7 </TD><TD>1024 x 768 </TD><TD> MONO16 </TD></TR> - <TR><TD> 2 </TD><TD> 0 </TD><TD>1280 x 960 </TD><TD> YUV422 </TD></TR> - <TR><TD> 2 </TD><TD> 1 </TD><TD>1280 x 960 </TD><TD> RGB8 </TD></TR> - <TR><TD> 2 </TD><TD> 2 </TD><TD>1280 x 960 </TD><TD> MONO8 </TD></TR> - <TR><TD> 2 </TD><TD> 3 </TD><TD>1600 x 1200</TD><TD> YUV422 </TD></TR> - <TR><TD> 2 </TD><TD> 4 </TD><TD>1600 x 1200</TD><TD> RGB8 </TD></TR> - <TR><TD> 2 </TD><TD> 5 </TD><TD>1600 x 1200</TD><TD> MONO8 </TD></TR> - <TR><TD> 2 </TD><TD> 6 </TD><TD>1280 x 960 </TD><TD> MONO16 </TD></TR> - <TR><TD> 2 </TD><TD> 7 </TD><TD>1600 x 1200</TD><TD> MONO16 </TD></TR> - </TABLE> - - */ -void -vp1394CMUGrabber::setVideoMode( unsigned long format, unsigned long mode ) -{ - initCamera(); - - _format = format ; - _mode = mode ; - - // Set format and mode - if ((_format != -1) && (_mode != -1)) - { - if (!camera->HasVideoMode(_format, _mode)) - { - close(); - vpERROR_TRACE("vp1394CMUGrabber error: The image format is not supported by the IEEE 1394 camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::settingError,"Video mode not supported") ); - } - - if (camera->IsAcquiring()) { - // stop acquisition - if (camera->StopImageAcquisition() != CAM_SUCCESS) - { - close(); - vpERROR_TRACE("vp1394CMUGrabber error: Can't stop image acquisition from IEEE 1394 camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::otherError, - "Error while stopping image acquisition") ); - } - } - - if (camera->SetVideoFormat(_format) != CAM_SUCCESS) - { - close(); - vpERROR_TRACE("vp1394CMUGrabber error: Can't set video format of IEEE 1394 camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::settingError,"Can't set video format") ); - } - - if (camera->SetVideoMode(_mode) != CAM_SUCCESS) - { - close(); - vpERROR_TRACE("vp1394CMUGrabber error: Can't set video mode of IEEE 1394 camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::settingError,"Can't set video mode") ); - } - - // start acquisition - if (camera->StartImageAcquisition() != CAM_SUCCESS) - { - close(); - vpERROR_TRACE("vp1394CMUGrabber error: Can't start image acquisition from IEEE 1394 camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::otherError, - "Error while starting image acquisition") ); - } - - // Update Image dimension - unsigned long w, h; - camera->GetVideoFrameDimensions(&w, &h); - this->width = w; - this->height = h; - - // Update the color coding - _color = getVideoColorCoding(); - } -} - -/*! - Set camera framerate rate. This method has to be called before open(). - - \param fps : Value between 0 to 7 used to select a specific camera framerate. - See the following table for the correspondances between the input - value and the framerate. - - <TABLE BORDER="1"> - <TR><TH> Value </TH> <TH> Frame rate </TH></TR> - <TR><TD> 0 </TD> <TD> 1.875 fps </TD></TR> - <TR><TD> 1 </TD> <TD> 3.75 fps </TD></TR> - <TR><TD> 2 </TD> <TD> 7.5 fps </TD></TR> - <TR><TD> 3 </TD> <TD> 15 fps </TD></TR> - <TR><TD> 4 </TD> <TD> 30 fps </TD></TR> - <TR><TD> 5 </TD> <TD> 60 fps </TD></TR> - <TR><TD> 6 </TD> <TD> 120 fps </TD></TR> - <TR><TD> 7 </TD> <TD> 240 fps </TD></TR> - </TABLE> - - \sa getFramerate() - */ -void -vp1394CMUGrabber::setFramerate(unsigned long fps) -{ - initCamera(); - - _fps = fps; - - // Set fps - if (_fps!=-1) - { - if (!camera->HasVideoFrameRate(_format,_mode,_fps)) - { - close(); - vpERROR_TRACE("vp1394CMUGrabber error: The frame rate is not supported by the IEEE 1394 camera number %i for the selected image format",index); - throw (vpFrameGrabberException(vpFrameGrabberException::settingError,"The frame rate is not supported") ); - } - - if (camera->IsAcquiring()) { - // stop acquisition - if (camera->StopImageAcquisition() != CAM_SUCCESS) - { - close(); - vpERROR_TRACE("vp1394CMUGrabber error: Can't stop image acquisition from IEEE 1394 camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::otherError, - "Error while stopping image acquisition") ); - } - } - if (camera->SetVideoFrameRate(_fps) != CAM_SUCCESS) - { - close(); - vpERROR_TRACE("vp1394CMUGrabber error: Can't set video frame rate of IEEE 1394 camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::settingError,"Can't set video frame rate") ); - } - // start acquisition - if (camera->StartImageAcquisition() != CAM_SUCCESS) - { - close(); - vpERROR_TRACE("vp1394CMUGrabber error: Can't start image acquisition from IEEE 1394 camera number %i",index); - throw (vpFrameGrabberException(vpFrameGrabberException::otherError, - "Error while starting image acquisition") ); - } - - } -} -/*! - Get the video framerate. - - \return Value between 0 to 7 corresponding to a specific camera framerate. - See the following table for the correspondances between the returned - value and the framerate. - - <TABLE BORDER="1"> - <TR><TH> Value </TH> <TH> Frame rate </TH></TR> - <TR><TD> 0 </TD> <TD> 1.875 fps </TD></TR> - <TR><TD> 1 </TD> <TD> 3.75 fps </TD></TR> - <TR><TD> 2 </TD> <TD> 7.5 fps </TD></TR> - <TR><TD> 3 </TD> <TD> 15 fps </TD></TR> - <TR><TD> 4 </TD> <TD> 30 fps </TD></TR> - <TR><TD> 5 </TD> <TD> 60 fps </TD></TR> - <TR><TD> 6 </TD> <TD> 120 fps </TD></TR> - <TR><TD> 7 </TD> <TD> 240 fps </TD></TR> - </TABLE> - - \sa setFramerate() -*/ -int -vp1394CMUGrabber::getFramerate() -{ - initCamera(); - int fps = camera->GetVideoFrameRate(); - return fps; -} - -#endif - + +/*! + Set camera framerate rate. This method has to be called before open(). + + \param fps : Value between 0 to 7 used to select a specific camera framerate. + See the following table for the correspondances between the input + value and the framerate. + + <TABLE BORDER="1"> + <TR><TH> Value </TH> <TH> Frame rate </TH></TR> + <TR><TD> 0 </TD> <TD> 1.875 fps </TD></TR> + <TR><TD> 1 </TD> <TD> 3.75 fps </TD></TR> + <TR><TD> 2 </TD> <TD> 7.5 fps </TD></TR> + <TR><TD> 3 </TD> <TD> 15 fps </TD></TR> + <TR><TD> 4 </TD> <TD> 30 fps </TD></TR> + <TR><TD> 5 </TD> <TD> 60 fps </TD></TR> + <TR><TD> 6 </TD> <TD> 120 fps </TD></TR> + <TR><TD> 7 </TD> <TD> 240 fps </TD></TR> + </TABLE> + + \sa getFramerate() + */ +void +vp1394CMUGrabber::setFramerate(unsigned long fps) +{ + initCamera(); + + _fps = fps; + + // Set fps + if (_fps!=-1) + { + if (!camera->HasVideoFrameRate(_format,_mode,_fps)) + { + close(); + vpERROR_TRACE("vp1394CMUGrabber error: The frame rate is not supported by the IEEE 1394 camera number %i for the selected image format",index); + throw (vpFrameGrabberException(vpFrameGrabberException::settingError,"The frame rate is not supported") ); + } + + if (camera->IsAcquiring()) { + // stop acquisition + if (camera->StopImageAcquisition() != CAM_SUCCESS) + { + close(); + vpERROR_TRACE("vp1394CMUGrabber error: Can't stop image acquisition from IEEE 1394 camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::otherError, + "Error while stopping image acquisition") ); + } + } + if (camera->SetVideoFrameRate(_fps) != CAM_SUCCESS) + { + close(); + vpERROR_TRACE("vp1394CMUGrabber error: Can't set video frame rate of IEEE 1394 camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::settingError,"Can't set video frame rate") ); + } + // start acquisition + if (camera->StartImageAcquisition() != CAM_SUCCESS) + { + close(); + vpERROR_TRACE("vp1394CMUGrabber error: Can't start image acquisition from IEEE 1394 camera number %i",index); + throw (vpFrameGrabberException(vpFrameGrabberException::otherError, + "Error while starting image acquisition") ); + } + + } +} +/*! + Get the video framerate. + + \return Value between 0 to 7 corresponding to a specific camera framerate. + See the following table for the correspondances between the returned + value and the framerate. + + <TABLE BORDER="1"> + <TR><TH> Value </TH> <TH> Frame rate </TH></TR> + <TR><TD> 0 </TD> <TD> 1.875 fps </TD></TR> + <TR><TD> 1 </TD> <TD> 3.75 fps </TD></TR> + <TR><TD> 2 </TD> <TD> 7.5 fps </TD></TR> + <TR><TD> 3 </TD> <TD> 15 fps </TD></TR> + <TR><TD> 4 </TD> <TD> 30 fps </TD></TR> + <TR><TD> 5 </TD> <TD> 60 fps </TD></TR> + <TR><TD> 6 </TD> <TD> 120 fps </TD></TR> + <TR><TD> 7 </TD> <TD> 240 fps </TD></TR> + </TABLE> + + \sa setFramerate() +*/ +int +vp1394CMUGrabber::getFramerate() +{ + initCamera(); + int fps = camera->GetVideoFrameRate(); + return fps; +} + +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_sensor.a(vp1394CMUGrabber.cpp.o) has no symbols +void dummy_vp1394CMUGrabber() {}; +#endif + diff --git a/src/device/framegrabber/1394/vp1394TwoGrabber.cpp b/modules/sensor/src/framegrabber/1394/vp1394TwoGrabber.cpp similarity index 90% rename from src/device/framegrabber/1394/vp1394TwoGrabber.cpp rename to modules/sensor/src/framegrabber/1394/vp1394TwoGrabber.cpp index 77848539eaff469d19906f06390c5ae61bae3ac4..6c63364e0fd28fcf5b5bb94ae150456f7c6bb71e 100644 --- a/src/device/framegrabber/1394/vp1394TwoGrabber.cpp +++ b/modules/sensor/src/framegrabber/1394/vp1394TwoGrabber.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vp1394TwoGrabber.cpp 4728 2014-04-23 12:26:44Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Firewire cameras video capture. * @@ -47,19 +43,18 @@ */ #include <iostream> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> /* * Interface with libdc1394 2.x */ -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) #include <unistd.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpFrameGrabberException.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> -#include <visp/vpTime.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpFrameGrabberException.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpTime.h> const char * vp1394TwoGrabber::strVideoMode[DC1394_VIDEO_MODE_NUM]= { "MODE_160x120_YUV444", @@ -145,13 +140,13 @@ const char * vp1394TwoGrabber::strColorCoding[DC1394_COLOR_CODING_NUM]= { Format7 with a transmission speed set to 800Mbps in 1394b mode. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vp1394TwoGrabber g(false); // Don't reset the bus g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_0 ); @@ -171,7 +166,7 @@ vp1394TwoGrabber::vp1394TwoGrabber(bool reset) : camera(NULL), cameras(NULL), num_cameras(0), camera_id(0), verbose(false), camIsOpen(NULL), num_buffers(4), // ring buffer size isDataModified(NULL), initialShutterMode(NULL), dataCam(NULL) - #ifdef VISP_HAVE_DC1394_2_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 + #ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 , d(NULL), list(NULL) #endif @@ -225,13 +220,13 @@ vp1394TwoGrabber::~vp1394TwoGrabber() Here an example of single capture from the last camera found on the bus: \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) unsigned int ncameras; // Number of cameras on the bus vpImage<unsigned char> I; @@ -251,14 +246,14 @@ int main() If more than one camera is connected, it is also possible to select a specific camera by its GUID: \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; // Create a gray level image container bool reset = false; // Disable bus reset during construction vp1394TwoGrabber g(reset); // Create a grabber based on libdc1394-2.x third party lib @@ -291,13 +286,13 @@ int main() Here an example of multi camera capture: \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) unsigned int ncameras; // Number of cameras on the bus vp1394TwoGrabber g; ncameras = g.getNumCameras(); @@ -480,13 +475,13 @@ vp1394TwoGrabber::getNumCameras() const Format7 with a transmission speed set to 800Mbps in 1394b mode. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vp1394TwoGrabber g(false); // Don't reset the bus g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_0 ); @@ -1034,13 +1029,13 @@ vp1394TwoGrabber::isFramerateSupported(vp1394TwoVideoModeType mode, Format7 with a transmission speed set to 800Mbps in 1394b mode. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vp1394TwoGrabber g(false); // Don't reset the bus g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_0 ); @@ -1476,7 +1471,7 @@ vp1394TwoGrabber::initialize(bool reset) { if (init == false){ // Find cameras -#ifdef VISP_HAVE_DC1394_2_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 +#ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 if (d != NULL) dc1394_free (d); @@ -1526,7 +1521,7 @@ vp1394TwoGrabber::initialize(bool reset) dc1394_camera_free_list (list); list = NULL; -#elif defined VISP_HAVE_DC1394_2_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 +#elif defined VISP_HAVE_DC1394_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 if (cameras != NULL) free(cameras); cameras = NULL; @@ -1598,7 +1593,7 @@ vp1394TwoGrabber::open() if (camIsOpen[camera_id] == false){ dc1394switch_t status = DC1394_OFF; - //#ifdef VISP_HAVE_DC1394_2_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 + //#ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 dc1394_video_get_transmission(cameras[camera_id], &status); if (status != DC1394_OFF){ //#endif @@ -1612,12 +1607,12 @@ vp1394TwoGrabber::open() if (status==DC1394_ON) { vpTRACE("ISO transmission refuses to stop"); } -#ifdef VISP_HAVE_DC1394_2_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 +#ifdef VISP_HAVE_DC1394_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 // No yet in the new API cameras[camera_id]->is_iso_on=status; #endif } - //#ifdef VISP_HAVE_DC1394_2_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 + //#ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 } //#endif } @@ -1673,9 +1668,9 @@ vp1394TwoGrabber::close() if (dc1394_camera_set_power(camera, DC1394_OFF) != DC1394_SUCCESS) std::cout << "Unable to turn camera off" << std::endl; } -#ifdef VISP_HAVE_DC1394_2_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 +#ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 dc1394_camera_free(cameras[i]); -#elif defined VISP_HAVE_DC1394_2_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 +#elif defined VISP_HAVE_DC1394_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 dc1394_free_camera(cameras[i]); #endif } @@ -1685,7 +1680,7 @@ vp1394TwoGrabber::close() camIsOpen = NULL; } -#ifdef VISP_HAVE_DC1394_2_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 +#ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 if (cameras != NULL) { delete [] cameras; cameras = NULL; @@ -1695,7 +1690,7 @@ vp1394TwoGrabber::close() d = NULL; } -#elif defined VISP_HAVE_DC1394_2_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 +#elif defined VISP_HAVE_DC1394_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 if (cameras != NULL) { free(cameras); cameras = NULL; @@ -1783,13 +1778,13 @@ vp1394TwoGrabber::getRingBufferSize() const Format7 with a transmission speed set to 800Mbps in 1394b mode. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vp1394TwoGrabber g(false); // Don't reset the bus g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_0 ); @@ -1859,13 +1854,13 @@ vp1394TwoGrabber::setAutoShutter(bool enable) Format7 with a transmission speed set to 800Mbps in 1394b mode. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vp1394TwoGrabber g(false); // Don't reset the bus g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_0 ); @@ -1943,13 +1938,13 @@ vp1394TwoGrabber::getAutoShutter(unsigned int &minvalue, unsigned int &maxvalue) Format7 with a transmission speed set to 800Mbps in 1394b mode. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vp1394TwoGrabber g(false); // Don't reset the bus g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_0 ); @@ -2019,13 +2014,13 @@ vp1394TwoGrabber::setAutoGain(bool enable) Format7 with a transmission speed set to 800Mbps in 1394b mode. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vp1394TwoGrabber g(false); // Don't reset the bus g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_0 ); @@ -2218,13 +2213,13 @@ vp1394TwoGrabber::setTransmission(dc1394switch_t _switch) Below you will find an example that shows how to grab images in Format7 with a transmission speed set to 800Mbps in 1394b mode. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vp1394TwoGrabber g(false); // Don't reset the bus g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_0 ); @@ -2360,13 +2355,13 @@ vp1394TwoGrabber::open(vpImage<vpRGBa> &I) the ring buffer to be sure that the next image is the last one. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vp1394TwoGrabber g; dc1394video_frame_t *frame; g.setVideoMode(vp1394TwoGrabber::vpVIDEO_MODE_640x480_MONO8); @@ -2421,13 +2416,13 @@ vp1394TwoGrabber::dequeue() the ring buffer to be sure that the next image is the last one. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vp1394TwoGrabber g; dc1394video_frame_t *frame; @@ -2480,13 +2475,13 @@ vp1394TwoGrabber::dequeue(vpImage<unsigned char> &I) the ring buffer to be sure that the next image is the last one. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; vp1394TwoGrabber g; dc1394video_frame_t *frame; @@ -2590,13 +2585,13 @@ vp1394TwoGrabber::dequeue(vpImage<unsigned char> &I, dequeue() ensure to get the last image, while the enqueue() frees the ring buffer to be sure that the next image is the last one. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<vpRGBa> I; vp1394TwoGrabber g; dc1394video_frame_t *frame; @@ -2649,13 +2644,13 @@ vp1394TwoGrabber::dequeue(vpImage<vpRGBa> &I) the ring buffer to be sure that the next image is the last one. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<vpRGBa> I; vp1394TwoGrabber g; dc1394video_frame_t *frame; @@ -3060,16 +3055,16 @@ vp1394TwoGrabber::printCameraInfo() << " -----" << std::endl << "----------------------------------------------------------" << std::endl; -#ifdef VISP_HAVE_DC1394_2_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 +#ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 dc1394_camera_print_info( camera, stdout); -#elif defined VISP_HAVE_DC1394_2_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 +#elif defined VISP_HAVE_DC1394_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 dc1394_print_camera_info( camera); #endif dc1394featureset_t features; -#ifdef VISP_HAVE_DC1394_2_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 +#ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 if (dc1394_feature_get_all(camera, &features) != DC1394_SUCCESS) -#elif defined VISP_HAVE_DC1394_2_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 +#elif defined VISP_HAVE_DC1394_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 if (dc1394_get_camera_feature_set(camera, &features) != DC1394_SUCCESS) #endif { @@ -3079,9 +3074,9 @@ vp1394TwoGrabber::printCameraInfo() "Cannot get camera features") ); } else { -#ifdef VISP_HAVE_DC1394_2_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 +#ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 dc1394_feature_print_all(&features, stdout); -#elif defined VISP_HAVE_DC1394_2_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 +#elif defined VISP_HAVE_DC1394_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 dc1394_print_feature_set(&features); #endif } @@ -3291,13 +3286,13 @@ vp1394TwoGrabber::string2colorCoding(std::string colorcoding) camera found. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vp1394TwoGrabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) unsigned int ncameras; // Number of cameras on the bus vp1394TwoGrabber g; ncameras = g.getNumCameras(); @@ -3320,7 +3315,7 @@ void vp1394TwoGrabber::resetBus() setCapture(DC1394_OFF); } } -#ifdef VISP_HAVE_DC1394_2_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 +#ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE // new API > libdc1394-2.0.0-rc7 setCamera(camera_id); // free the other cameras for (unsigned int i=0;i<num_cameras;i++){ @@ -3336,7 +3331,7 @@ void vp1394TwoGrabber::resetBus() //if (cameras != NULL) delete [] cameras; cameras = NULL ; -#elif defined VISP_HAVE_DC1394_2_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 +#elif defined VISP_HAVE_DC1394_FIND_CAMERAS // old API <= libdc1394-2.0.0-rc7 setCamera(camera_id); // free the other cameras @@ -3438,7 +3433,32 @@ unsigned int vp1394TwoGrabber::getParameterValue(vp1394TwoParametersType param) } uint32_t value; - dc1394feature_t feature = (dc1394feature_t)param; + dc1394feature_t feature = DC1394_FEATURE_BRIGHTNESS;// = (dc1394feature_t)param; + switch(param) { + case vpFEATURE_BRIGHTNESS: feature = DC1394_FEATURE_BRIGHTNESS; break; + case vpFEATURE_EXPOSURE: feature = DC1394_FEATURE_EXPOSURE; break; + case vpFEATURE_SHARPNESS: feature = DC1394_FEATURE_SHARPNESS; break; +// vpFEATURE_WHITE_BALANCE = DC1394_FEATURE_WHITE_BALANCE, + case vpFEATURE_HUE: feature = DC1394_FEATURE_HUE; break; + case vpFEATURE_SATURATION: feature = DC1394_FEATURE_SATURATION; break; + case vpFEATURE_GAMMA: feature = DC1394_FEATURE_GAMMA; break; + case vpFEATURE_SHUTTER: feature = DC1394_FEATURE_SHUTTER; break; + case vpFEATURE_GAIN: feature = DC1394_FEATURE_GAIN; break; + case vpFEATURE_IRIS: feature = DC1394_FEATURE_IRIS; break; +// vpFEATURE_FOCUS = DC1394_FEATURE_FOCUS, +// vpFEATURE_TEMPERATURE = DC1394_FEATURE_TEMPERATURE, +// vpFEATURE_TRIGGER = DC1394_FEATURE_TRIGGER, +// vpFEATURE_TRIGGER_DELAY = DC1394_FEATURE_TRIGGER_DELAY, +// vpFEATURE_WHITE_SHADING = DC1394_FEATURE_WHITE_SHADING, +// vpFEATURE_FRAME_RATE = DC1394_FEATURE_FRAME_RATE, +// vpFEATURE_ZOOM = DC1394_FEATURE_ZOOM, +// vpFEATURE_PAN = DC1394_FEATURE_PAN, +// vpFEATURE_TILT = DC1394_FEATURE_TILT, +// vpFEATURE_OPTICAL_FILTER = DC1394_FEATURE_OPTICAL_FILTER, +// vpFEATURE_CAPTURE_SIZE = DC1394_FEATURE_CAPTURE_SIZE, +// vpFEATURE_CAPTURE_QUALITY = DC1394_FEATURE_CAPTURE_QUALITY + } + dc1394error_t err; err = dc1394_feature_get_value(camera, feature, &value); if (err != DC1394_SUCCESS) { @@ -3481,7 +3501,32 @@ void vp1394TwoGrabber::setParameterValue(vp1394TwoParametersType param, "No camera found") ); } uint32_t value = (uint32_t)val; - dc1394feature_t feature = (dc1394feature_t)param; + dc1394feature_t feature = DC1394_FEATURE_BRIGHTNESS;// = (dc1394feature_t)param; + switch(param) { + case vpFEATURE_BRIGHTNESS: feature = DC1394_FEATURE_BRIGHTNESS; break; + case vpFEATURE_EXPOSURE: feature = DC1394_FEATURE_EXPOSURE; break; + case vpFEATURE_SHARPNESS: feature = DC1394_FEATURE_SHARPNESS; break; +// vpFEATURE_WHITE_BALANCE = DC1394_FEATURE_WHITE_BALANCE, + case vpFEATURE_HUE: feature = DC1394_FEATURE_HUE; break; + case vpFEATURE_SATURATION: feature = DC1394_FEATURE_SATURATION; break; + case vpFEATURE_GAMMA: feature = DC1394_FEATURE_GAMMA; break; + case vpFEATURE_SHUTTER: feature = DC1394_FEATURE_SHUTTER; break; + case vpFEATURE_GAIN: feature = DC1394_FEATURE_GAIN; break; + case vpFEATURE_IRIS: feature = DC1394_FEATURE_IRIS; break; +// vpFEATURE_FOCUS = DC1394_FEATURE_FOCUS, +// vpFEATURE_TEMPERATURE = DC1394_FEATURE_TEMPERATURE, +// vpFEATURE_TRIGGER = DC1394_FEATURE_TRIGGER, +// vpFEATURE_TRIGGER_DELAY = DC1394_FEATURE_TRIGGER_DELAY, +// vpFEATURE_WHITE_SHADING = DC1394_FEATURE_WHITE_SHADING, +// vpFEATURE_FRAME_RATE = DC1394_FEATURE_FRAME_RATE, +// vpFEATURE_ZOOM = DC1394_FEATURE_ZOOM, +// vpFEATURE_PAN = DC1394_FEATURE_PAN, +// vpFEATURE_TILT = DC1394_FEATURE_TILT, +// vpFEATURE_OPTICAL_FILTER = DC1394_FEATURE_OPTICAL_FILTER, +// vpFEATURE_CAPTURE_SIZE = DC1394_FEATURE_CAPTURE_SIZE, +// vpFEATURE_CAPTURE_QUALITY = DC1394_FEATURE_CAPTURE_QUALITY + } + dc1394error_t err; dc1394bool_t hasManualMode = DC1394_FALSE; dc1394feature_modes_t modesAvailable; @@ -3615,222 +3660,8 @@ vp1394TwoGrabber::updateDataStructToCam() setParameterValue(vpFEATURE_IRIS, dataCam[camera_id].iris); } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - - \deprecated This method is deprecated. You should use getVideoModeSupported(std::list<vp1394TwoVideoModeType> &) instead. - - Query the available active camera video modes. - - \param videomodes : The list of supported camera video modes. - - \return The number of supported camera modes, 0 if an error occurs. - - \exception vpFrameGrabberException::initializationError : If no - camera found on the bus. - - \exception vpFrameGrabberException::settingError : If we can't get - video modes. - - \sa setVideoMode(), getVideoMode(), getCamera() -*/ -uint32_t -vp1394TwoGrabber::getVideoModeSupported(vpList<vp1394TwoVideoModeType> & videomodes) -{ - // Refresh the list of supported modes - videomodes.kill(); - - if (! num_cameras) { - close(); - vpERROR_TRACE("No camera found"); - throw (vpFrameGrabberException(vpFrameGrabberException::initializationError, - "No camera found") ); - } - dc1394video_modes_t _videomodes; - - // get video modes: - if (dc1394_video_get_supported_modes(camera, &_videomodes)!=DC1394_SUCCESS) { - - close(); - vpERROR_TRACE("Can't get video modes"); - throw (vpFrameGrabberException(vpFrameGrabberException::settingError, - "Can't get video modes") ); - } - - // parse the video modes to add in the list - for (unsigned i=0; i < _videomodes.num; i++) { - vp1394TwoVideoModeType _mode = (vp1394TwoVideoModeType) _videomodes.modes[i]; - videomodes.addRight( _mode ); - } - - // return the number of available video modes - return _videomodes.num; -} - -/*! - \deprecated This method is deprecated. You should use getFramerateSupported(vp1394TwoVideoModeType, std::list<vp1394TwoFramerateType> &) instead. - - Query the available framerates for the given camera video mode (see - file dc1394/control.h). No framerate is associated to the following - camera modes : - - - vp1394TwoGrabber::vpVIDEO_MODE_EXIF (format 6), - - vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_0 (format 7): - - vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_1 (format 7) - - vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_2 (format 7) - - vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_3 (format 7) - - vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_4 (format 7) - - vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_5 (format 7) - - vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_6 (format 7) - - vp1394TwoGrabber::vpVIDEO_MODE_FORMAT7_7 (format 7) - - \param mode : Camera video mode. - - \param fps : The list of supported camera framerates for the given camera - video mode. - - \return The number of supported framerates, 0 if no framerate is available. - - \exception vpFrameGrabberException::initializationError : If no - camera found on the bus. - - \exception vpFrameGrabberException::settingError : If we can't get - the supported framerates. - - \sa setFramerate(), getFramerate(), setCamera() -*/ -uint32_t -vp1394TwoGrabber::getFramerateSupported(vp1394TwoVideoModeType mode, - vpList<vp1394TwoFramerateType> & fps) -{ - if (! num_cameras) { - close(); - vpERROR_TRACE("No camera found"); - throw (vpFrameGrabberException(vpFrameGrabberException::initializationError, - "No camera found") ); - } - - // Refresh the list of supported framerates - fps.kill(); - - switch (mode) { - // Framerate not available for: - // - vpVIDEO_MODE_EXIF ie Format_6 - // - vpVIDEO_MODE_FORMAT7... ie the Format_7 - case vpVIDEO_MODE_EXIF: - case vpVIDEO_MODE_FORMAT7_0: - case vpVIDEO_MODE_FORMAT7_1: - case vpVIDEO_MODE_FORMAT7_2: - case vpVIDEO_MODE_FORMAT7_3: - case vpVIDEO_MODE_FORMAT7_4: - case vpVIDEO_MODE_FORMAT7_5: - case vpVIDEO_MODE_FORMAT7_6: - case vpVIDEO_MODE_FORMAT7_7: - return 0; - break; - default: - { - dc1394framerates_t _fps; - if (dc1394_video_get_supported_framerates(camera, - (dc1394video_mode_t)mode, - &_fps) != DC1394_SUCCESS) { - close(); - vpERROR_TRACE("Could not query supported frametates for mode %d\n", - mode); - throw (vpFrameGrabberException(vpFrameGrabberException::settingError, - "Could not query supported framerates") ); - } - if (_fps.num == 0) - return 0; - - for (unsigned int i = 0; i < _fps.num; i ++) - fps.addRight((vp1394TwoFramerateType)_fps.framerates[i]); - - return _fps.num; - } - break; - } -} - -/*! - - \deprecated This method is deprecated. You should use - getColorCodingSupported(vp1394TwoVideoModeType, std::list<vp1394TwoColorCodingType> &) instead. - - Query the available color codings for the given camera video mode (see - file dc1394/control.h). - - \param mode : Camera video mode. - - \param codings : The list of supported color codings for the given camera - video mode. - - \return The number of supported color codings, 0 if no color codings - is available. - - \exception vpFrameGrabberException::initializationError : If no - camera found on the bus. - - \exception vpFrameGrabberException::settingError : If we can't get - the color codingss. - - \sa setColorCoding(), getColorCoding(), setCamera() -*/ -uint32_t -vp1394TwoGrabber::getColorCodingSupported(vp1394TwoVideoModeType mode, - vpList<vp1394TwoColorCodingType> & codings) -{ - if (! num_cameras) { - close(); - vpERROR_TRACE("No camera found"); - throw (vpFrameGrabberException(vpFrameGrabberException::initializationError, - "No camera found") ); - } - - // Refresh the list of supported framerates - codings.kill(); - - if (dc1394_is_video_mode_scalable((dc1394video_mode_t)mode)) { - // Format 7 video mode - dc1394color_codings_t _codings; - if (dc1394_format7_get_color_codings(camera, - (dc1394video_mode_t)mode, - &_codings) != DC1394_SUCCESS) { - close(); - vpERROR_TRACE("Could not query supported color codings for mode %d\n", - mode); - throw (vpFrameGrabberException(vpFrameGrabberException::settingError, - "Could not query supported color codings") ); - } - if (_codings.num == 0) - return 0; - - for (unsigned int i = 0; i < _codings.num; i ++) - codings.addRight((vp1394TwoColorCodingType)_codings.codings[i]); - - return _codings.num; - } - else if (dc1394_is_video_mode_still_image((dc1394video_mode_t)mode)) { - // Format 6 video mode - return 0; - } - else { - // Not Format 7 and not Format 6 video modes - dc1394color_coding_t _coding; - if (dc1394_get_color_coding_from_video_mode(camera, - (dc1394video_mode_t)mode, - &_coding) != DC1394_SUCCESS) { - close(); - vpERROR_TRACE("Could not query supported color coding for mode %d\n", - mode); - throw (vpFrameGrabberException(vpFrameGrabberException::settingError, - "Could not query supported color coding") ); - } - codings.addRight((vp1394TwoColorCodingType)_coding); - return 1; - } -} -#endif - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_sensor.a(vp1394TwoGrabber.cpp.o) has no symbols +void dummy_vp1394TwoGrabber() {}; #endif diff --git a/src/device/framegrabber/OpenCV/vpOpenCVGrabber.cpp b/modules/sensor/src/framegrabber/OpenCV/vpOpenCVGrabber.cpp similarity index 92% rename from src/device/framegrabber/OpenCV/vpOpenCVGrabber.cpp rename to modules/sensor/src/framegrabber/OpenCV/vpOpenCVGrabber.cpp index 55a576592ee913bf13fefe53162cf7d43d9fa53a..305129895e5bcab3df14d0a8848c37f48ef8f399 100644 --- a/src/device/framegrabber/OpenCV/vpOpenCVGrabber.cpp +++ b/modules/sensor/src/framegrabber/OpenCV/vpOpenCVGrabber.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpOpenCVGrabber.cpp 5023 2014-12-03 16:07:48Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Cameras video capture using OpenCV library. * @@ -44,12 +40,12 @@ \brief class for cameras video capture using OpenCV library. */ -#include <visp/vpOpenCVGrabber.h> +#include <visp3/sensor/vpOpenCVGrabber.h> #if ( defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION < 0x020408)) -#include <visp/vpImageConvert.h> -#include <visp/vpFrameGrabberException.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpFrameGrabberException.h> #include <iostream> #include <math.h> @@ -320,4 +316,8 @@ void vpOpenCVGrabber::setFlip(bool flipType) { flip = flipType; } + +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_sensor.a(vpOpenCVGrabber.cpp.o) has no symbols +void dummy_vpOpenCVGrabber() {}; #endif diff --git a/src/device/framegrabber/directshow/vpDirectShowDevice.cpp b/modules/sensor/src/framegrabber/directshow/vpDirectShowDevice.cpp similarity index 84% rename from src/device/framegrabber/directshow/vpDirectShowDevice.cpp rename to modules/sensor/src/framegrabber/directshow/vpDirectShowDevice.cpp index 21de5903cde648bff141176b4004c59f767e0a27..d1f3ee7d2b0231c587d9aad9be98c57b4860cec6 100644 --- a/src/device/framegrabber/directshow/vpDirectShowDevice.cpp +++ b/modules/sensor/src/framegrabber/directshow/vpDirectShowDevice.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDirectShowDevice.cpp 4620 2014-01-27 21:28:32Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * DirectShow device description. * @@ -42,10 +38,10 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS #include <stdio.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_DIRECTSHOW) ) -#include <visp/vpDirectShowDevice.h> +#include <visp3/sensor/vpDirectShowDevice.h> /*! @@ -125,5 +121,8 @@ VISP_EXPORT std::ostream& operator<<(std::ostream& os, vpDirectShowDevice& dev) return os<<dev.name<<std::endl<<dev.desc<<std::endl<<dev.devPath; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_sensor.a(vpDirectShowDevice.cpp.o) has no symbols +void dummy_vpDirectShowDevice() {}; #endif #endif diff --git a/src/device/framegrabber/directshow/vpDirectShowGrabber.cpp b/modules/sensor/src/framegrabber/directshow/vpDirectShowGrabber.cpp similarity index 90% rename from src/device/framegrabber/directshow/vpDirectShowGrabber.cpp rename to modules/sensor/src/framegrabber/directshow/vpDirectShowGrabber.cpp index 22355688b6c790f3b03f04d9d95e27468c2aa7d8..bd194e2c8bd4f878dc56a737ca1583890cbb3753 100644 --- a/src/device/framegrabber/directshow/vpDirectShowGrabber.cpp +++ b/modules/sensor/src/framegrabber/directshow/vpDirectShowGrabber.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDirectShowGrabber.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * DirectShow framegrabber. * @@ -41,11 +37,11 @@ *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_DIRECTSHOW) ) -#include <visp/vpDirectShowGrabber.h> -#include <visp/vpDirectShowGrabberImpl.h> +#include <visp3/sensor/vpDirectShowGrabber.h> +#include <visp3/sensor/vpDirectShowGrabberImpl.h> /*! Returns the number of rows in the grabbed image @@ -236,6 +232,7 @@ int vpDirectShowGrabber::getMediaType() return grabber->getMediaType(); } - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_sensor.a(vpDirectShowGrabber.cpp.o) has no symbols +void dummy_vpDirectShowGrabber() {}; #endif - diff --git a/src/device/framegrabber/directshow/vpDirectShowGrabberImpl.cpp b/modules/sensor/src/framegrabber/directshow/vpDirectShowGrabberImpl.cpp old mode 100755 new mode 100644 similarity index 98% rename from src/device/framegrabber/directshow/vpDirectShowGrabberImpl.cpp rename to modules/sensor/src/framegrabber/directshow/vpDirectShowGrabberImpl.cpp index c2c489336217588b511f9bd7465781a69496884b..bd8b08cb92b766389c49b8e9086b8f4d96d7d3cb --- a/src/device/framegrabber/directshow/vpDirectShowGrabberImpl.cpp +++ b/modules/sensor/src/framegrabber/directshow/vpDirectShowGrabberImpl.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDirectShowGrabberImpl.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * DirectShow framegrabber implementation. * @@ -42,12 +38,10 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_DIRECTSHOW) ) -#include <visp/vpDirectShowGrabberImpl.h> - -#ifndef DOXYGEN_SHOULD_SKIP_THIS +#include <visp3/sensor/vpDirectShowGrabberImpl.h> vpDirectShowDevice * vpDirectShowGrabberImpl::deviceList = NULL; unsigned int vpDirectShowGrabberImpl::nbDevices ; @@ -1237,6 +1231,8 @@ void vpDirectShowGrabberImpl::MyFreeMediaType(AM_MEDIA_TYPE& mt) } } -#endif +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_sensor.a(vpDirectShowGrabberImpl.cpp.o) has no symbols +void dummy_vpDirectShowGrabberImpl() {}; #endif #endif diff --git a/src/device/framegrabber/directshow/vpDirectShowSampleGrabberI.cpp b/modules/sensor/src/framegrabber/directshow/vpDirectShowSampleGrabberI.cpp similarity index 85% rename from src/device/framegrabber/directshow/vpDirectShowSampleGrabberI.cpp rename to modules/sensor/src/framegrabber/directshow/vpDirectShowSampleGrabberI.cpp index 57f753b3366f5319c6cd335063a9407bbdf3da4b..56df83a01aa4cdf6d0ff4730d92f67f67aa3e177 100644 --- a/src/device/framegrabber/directshow/vpDirectShowSampleGrabberI.cpp +++ b/modules/sensor/src/framegrabber/directshow/vpDirectShowSampleGrabberI.cpp @@ -1,9 +1,46 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * DirectShow framegrabber. + * + * Authors: + * Bruno Renier + * Anthony Saunier + * + *****************************************************************************/ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpDirectShowSampleGrabberI.h> -#include <visp/vpImageConvert.h> +#include <visp3/sensor/vpDirectShowSampleGrabberI.h> +#include <visp3/core/vpImageConvert.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if ( defined(VISP_HAVE_DIRECTSHOW) ) @@ -284,6 +321,10 @@ STDMETHODIMP vpDirectShowSampleGrabberI::BufferCB(double Time, BYTE *pBuffer, lo } return S_OK; } + +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_sensor.a(vpDirectShowSampleGrabberI.cpp.o) has no symbols +void dummy_vpDirectShowSampleGrabberI() {}; #endif #endif diff --git a/src/device/framegrabber/v4l2/vpV4l2Grabber.cpp b/modules/sensor/src/framegrabber/v4l2/vpV4l2Grabber.cpp similarity index 98% rename from src/device/framegrabber/v4l2/vpV4l2Grabber.cpp rename to modules/sensor/src/framegrabber/v4l2/vpV4l2Grabber.cpp index 57ec4c776914ee9492586265a4d6fccfc7b72146..1b511ab7ec9931fdff5cc1bb496b40bb3b366096 100644 --- a/src/device/framegrabber/v4l2/vpV4l2Grabber.cpp +++ b/modules/sensor/src/framegrabber/v4l2/vpV4l2Grabber.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpV4l2Grabber.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Framegrabber based on Video4Linux2 driver. * @@ -45,7 +41,7 @@ \ingroup libdevice */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_V4L2 @@ -62,9 +58,10 @@ #include <errno.h> #include <iostream> -#include <visp/vpV4l2Grabber.h> -#include <visp/vpFrameGrabberException.h> -#include <visp/vpImageIo.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#include <visp3/core/vpFrameGrabberException.h> +//#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> const unsigned int vpV4l2Grabber::DEFAULT_INPUT = 2; const unsigned int vpV4l2Grabber::DEFAULT_SCALE = 2; @@ -1363,4 +1360,8 @@ vpV4l2Grabber::printBufInfo(struct v4l2_buffer buf) buf.length, buf.length, buf.bytesused); } + +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_sensor.a(vpV4l2Grabber.cpp.o) has no symbols +void dummy_vpV4l2Grabber() {}; #endif diff --git a/src/device/kinect/vpKinect.cpp b/modules/sensor/src/kinect/vpKinect.cpp similarity index 94% rename from src/device/kinect/vpKinect.cpp rename to modules/sensor/src/kinect/vpKinect.cpp index 1f032d0e570cf2578f299f504ce9586bd490c8f5..e902523adcd8a79899e2a4f5e6afc1959c369e4d 100644 --- a/src/device/kinect/vpKinect.cpp +++ b/modules/sensor/src/kinect/vpKinect.cpp @@ -1,10 +1,7 @@ /**************************************************************************** - * - * $Id: vpKinect.cpp 5126 2015-01-05 22:07:11Z fspindle $ - * * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * API for using a Microsoft Kinect device * Requires libfreenect as a third party library @@ -41,15 +36,15 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> // Note that libfreenect needs libusb-1.0 and libpthread #if defined(VISP_HAVE_LIBFREENECT_AND_DEPENDENCIES) #include <limits> // numeric_limits -#include <visp/vpKinect.h> -#include <visp/vpXmlParserCamera.h> +#include <visp3/sensor/vpKinect.h> +#include <visp3/core/vpXmlParserCamera.h> /*! Default constructor. @@ -311,8 +306,7 @@ void vpKinect::warpRGBFrame(const vpImage<vpRGBa> & Irgb, const vpImage<float> & } } - - - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_sensor.a(vpKinect.cpp.o) has no symbols +void dummy_vpKinect() {}; #endif // VISP_HAVE_LIBFREENECT - diff --git a/src/device/laserscanner/sick/vpSickLDMRS.cpp b/modules/sensor/src/laserscanner/sick/vpSickLDMRS.cpp similarity index 94% rename from src/device/laserscanner/sick/vpSickLDMRS.cpp rename to modules/sensor/src/laserscanner/sick/vpSickLDMRS.cpp index 78fdf6b098baea67b6f16de989df667301d45445..aca8eecab652f50f5e18a8d9aebd9983d0ebef94 100644 --- a/src/device/laserscanner/sick/vpSickLDMRS.cpp +++ b/modules/sensor/src/laserscanner/sick/vpSickLDMRS.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpSickLDMRS.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Sick LD-MRS laser driver on UNIX platform. * @@ -41,10 +37,10 @@ #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) -#include <visp/vpSickLDMRS.h> -#include <visp/vpMath.h> -#include <visp/vpDebug.h> -#include <visp/vpTime.h> +#include <visp3/sensor/vpSickLDMRS.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpTime.h> #include <sys/socket.h> #include <sys/select.h> #include <netinet/in.h> diff --git a/test/device/framegrabber/test1394TwoGrabber.cpp b/modules/sensor/test/framegrabber/test1394TwoGrabber.cpp similarity index 85% rename from test/device/framegrabber/test1394TwoGrabber.cpp rename to modules/sensor/test/framegrabber/test1394TwoGrabber.cpp index 77ef541b3124e953aee931222ac8d8ead257dff0..60a2fa87a52bccc77e05fc8453f9383dd820a8d4 100644 --- a/test/device/framegrabber/test1394TwoGrabber.cpp +++ b/modules/sensor/test/framegrabber/test1394TwoGrabber.cpp @@ -1,11 +1,8 @@ - /**************************************************************************** - * - * $Id: test1394TwoGrabber.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -13,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Firewire cameras video capture. * @@ -49,17 +44,17 @@ */ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #include <iostream> #include <string> -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> /*! \example test1394TwoGrabber.cpp diff --git a/test/device/framegrabber/test1394TwoResetBus.cpp b/modules/sensor/test/framegrabber/test1394TwoResetBus.cpp similarity index 81% rename from test/device/framegrabber/test1394TwoResetBus.cpp rename to modules/sensor/test/framegrabber/test1394TwoResetBus.cpp index 14839c0f62c8743b369ae03e238947ac4b10cf28..2c062d001b7002325d3104979e3b783672d5aa7a 100644 --- a/test/device/framegrabber/test1394TwoResetBus.cpp +++ b/modules/sensor/test/framegrabber/test1394TwoResetBus.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: test1394TwoResetBus.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Firewire cameras video capture. * @@ -49,16 +45,16 @@ -#include <visp/vpConfig.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpDebug.h> #include <iostream> -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> /*! diff --git a/modules/tracker/blob/CMakeLists.txt b/modules/tracker/blob/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..941dec0325eb73db1286d134777df8629f67dabb --- /dev/null +++ b/modules/tracker/blob/CMakeLists.txt @@ -0,0 +1,42 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +vp_add_module(blob visp_core) +vp_glob_module_sources() +vp_module_include_directories() +vp_create_module() +vp_add_tests(DEPENDS_ON visp_features) diff --git a/src/tracking/dots/vpDot.h b/modules/tracker/blob/include/visp3/blob/vpDot.h similarity index 94% rename from src/tracking/dots/vpDot.h rename to modules/tracker/blob/include/visp3/blob/vpDot.h index 558deeeb6b745ea3b7521c721b531520c7b05a93..4ae57e634229c183e45bff44d88022bb1ea82035 100644 --- a/src/tracking/dots/vpDot.h +++ b/modules/tracker/blob/include/visp3/blob/vpDot.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDot.h 4943 2014-11-03 13:51:09Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Track a white dot. * @@ -48,12 +44,12 @@ #ifndef vpDot_hh #define vpDot_hh -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpTracker.h> -#include <visp/vpRect.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpTracker.h> +#include <visp3/core/vpRect.h> +#include <visp3/core/vpImagePoint.h> #include <math.h> #include <fstream> @@ -67,7 +63,7 @@ /*! \class vpDot - \ingroup TrackingImageBasic + \ingroup module_blob \brief This tracker is meant to track a dot (connected pixels with same gray level) on a vpImage. @@ -80,15 +76,15 @@ track a blob and display the tracking results. \code -#include <visp/vpConfig.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDot.h> -#include <visp/vpImage.h> +#include <visp3/core/vpConfig.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/blob/vpDot.h> +#include <visp3/core/vpImage.h> int main() { -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vpImage<unsigned char> I; // Create a gray level image container vp1394TwoGrabber g(false); // Create a grabber based on libdc1394-2.x third party lib g.acquire(I); // Acquire an image diff --git a/src/tracking/dots/vpDot2.h b/modules/tracker/blob/include/visp3/blob/vpDot2.h similarity index 91% rename from src/tracking/dots/vpDot2.h rename to modules/tracker/blob/include/visp3/blob/vpDot2.h index 15a0d304c9945cb276b03c2f9a790cad20209adf..537d73476c77fd96a6dff0c519434036e4f80142 100644 --- a/src/tracking/dots/vpDot2.h +++ b/modules/tracker/blob/include/visp3/blob/vpDot2.h @@ -1,42 +1,39 @@ /**************************************************************************** - * - * $Id: vpDot2.h 2135 2009-04-29 13:51:31Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Description: - * Track a white dot. - * - * Authors: - * Fabien Spindler - * - *****************************************************************************/ + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Track a white dot. + * + * Authors: + * Fabien Spindler + * + *****************************************************************************/ /* @@ -47,11 +44,11 @@ #ifndef vpDot2_hh #define vpDot2_hh -#include <visp/vpImage.h> -#include <visp/vpRect.h> -#include <visp/vpTracker.h> -#include <visp/vpColor.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRect.h> +#include <visp3/core/vpTracker.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImagePoint.h> #include <vector> #include <list> @@ -59,7 +56,7 @@ /*! \class vpDot2 - \ingroup TrackingImageBasic + \ingroup module_blob \brief This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage. @@ -362,14 +359,6 @@ public: static void trackAndDisplay(vpDot2 dot[], const unsigned int &n, vpImage<unsigned char> &I, std::vector<vpImagePoint> &cogs, vpImagePoint* cogStar = NULL); -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated functions - */ - vp_deprecated double getSurface() const; - vp_deprecated void setSurface( const double & surface ); -#endif - public: double m00; /*!< Considering the general distribution moments for \f$ N \f$ points defined by the relation \f$ m_{ij} = \sum_{h=0}^{N} diff --git a/src/tracking/dots/vpDot.cpp b/modules/tracker/blob/src/dots/vpDot.cpp similarity index 98% rename from src/tracking/dots/vpDot.cpp rename to modules/tracker/blob/src/dots/vpDot.cpp index 2a926ff9fd93a1791c7735e500d8ec733e4a9b61..f974e3d35789ed3f84eccb9a9f4cd5b053971864 100644 --- a/src/tracking/dots/vpDot.cpp +++ b/modules/tracker/blob/src/dots/vpDot.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDot.cpp 4943 2014-11-03 13:51:09Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Track a white dot. * @@ -46,10 +42,10 @@ \brief Track a white dot */ -#include <visp/vpDot.h> -#include <visp/vpDisplay.h> -#include <visp/vpColor.h> -#include <visp/vpTrackingException.h> +#include <visp3/blob/vpDot.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpTrackingException.h> #include <vector> diff --git a/src/tracking/dots/vpDot2.cpp b/modules/tracker/blob/src/dots/vpDot2.cpp similarity index 98% rename from src/tracking/dots/vpDot2.cpp rename to modules/tracker/blob/src/dots/vpDot2.cpp index 5edc64a4ae963a184bce2d7fe0350f0479a67643..012e2b3c4b3456bf7766b2cf57424edd9c352a76 100644 --- a/src/tracking/dots/vpDot2.cpp +++ b/modules/tracker/blob/src/dots/vpDot2.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpDot2.cpp 2135 2009-04-29 13:51:31Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Track a white dot. * @@ -48,14 +44,14 @@ //#define DEBUG -#include <visp/vpDisplay.h> +#include <visp3/core/vpDisplay.h> // exception handling -#include <visp/vpTrackingException.h> -#include <visp/vpMath.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpTrackingException.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpIoTools.h> -#include <visp/vpDot2.h> +#include <visp3/blob/vpDot2.h> #include <math.h> #include <iostream> #include <cmath> // std::fabs @@ -2419,7 +2415,6 @@ void vpDot2::computeMeanGrayLevel(const vpImage<unsigned char>& I) } } - /*! Define a number of dots from a file. If the file does not exist, define it by clicking an image, the dots are then saved into the file. @@ -2530,7 +2525,7 @@ vpMatrix vpDot2::defineDots(vpDot2 dot[], const unsigned int &n, const std::stri for(i=0;i<n;++i) dot[i].setGraphics(false); - return Cogs; + return Cogs; } /*! @@ -2628,37 +2623,4 @@ void vpDot2::display(const vpImage<vpRGBa>& I,const vpImagePoint &cog, */ VISP_EXPORT std::ostream& operator<< (std::ostream& os, vpDot2& d) { return (os << "(" << d.getCog() << ")" ) ; -} ; - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated Return the area of the dot. - - This function is deprecated since it is mis named. Surface means here area. - You should rather use getArea(). - - The area of the dot is also given by \f$|m00|\f$. - - \sa getArea() -*/ -double vpDot2::getSurface() const -{ - return fabs(surface); } - -/*! - - \deprecated Set the surface of the dot. This is meant to be used to search a dot in a region of interest. - - This function is deprecated since it is mis named. You should rather use setArea() - - \param s : Here surface means area. Area of a dot to search in a region of interest. - - \sa setWidth(), setHeight(), setArea(), setSizePrecision() - -*/ -void vpDot2::setSurface( const double & s ) -{ - this->surface = s; -} -#endif diff --git a/test/tracking/testTrackDot.cpp b/modules/tracker/blob/test/tracking/testTrackDot.cpp similarity index 88% rename from test/tracking/testTrackDot.cpp rename to modules/tracker/blob/test/tracking/testTrackDot.cpp index 2af158619368349b08f8754777c0e74fef237975..fd52bf1de5b3c6abafb7d91d64094fdbec5e8b1b 100644 --- a/test/tracking/testTrackDot.cpp +++ b/modules/tracker/blob/test/tracking/testTrackDot.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testTrackDot.cpp 4814 2014-07-31 11:38:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test auto detection of dots. * @@ -42,25 +38,27 @@ -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpConfig.h> #include <stdlib.h> #include <stdio.h> #include <sstream> #include <iomanip> #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI)) -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDot2.h> -#include <visp/vpFeatureEllipse.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/blob/vpDot2.h> +#ifdef VISP_HAVE_MODULE_FEATURES +# include <visp3/visual_features/vpFeatureEllipse.h> +# include <visp3/visual_features/vpFeatureBuilder.h> +#endif /*! \example testTrackDot.cpp @@ -275,28 +273,32 @@ main(int argc, const char ** argv) } vpDot2 dot ; - std::cout << "debut 1\n"; - //dot.setMaxDotSize(0.50); // dot max size = 50% of the image size + std::cout << "debut 1\n"; + //dot.setMaxDotSize(0.50); // dot max size = 50% of the image size vpImagePoint ip; ip.set_i( 140 ); ip.set_j( 140 ); - dot.initTracking(I, ip); + dot.initTracking(I, ip); if (opt_display) { dot.setGraphics(true) ; } else { dot.setGraphics(false) ; } - dot.setComputeMoments(true); + dot.setComputeMoments(true); dot.track(I) ; - vpFeatureEllipse e ; + vpCameraParameters cam; - vpCameraParameters cam ; - vpFeatureBuilder::create(e,cam,dot) ; +#ifdef VISP_HAVE_MODULE_FEATURES + vpFeatureEllipse e; + vpFeatureBuilder::create(e,cam,dot); +#endif if (opt_display) { +#ifdef VISP_HAVE_MODULE_FEATURES e.display(cam, I, vpColor::red) ; - vpDisplay::flush(I); +#endif + vpDisplay::flush(I); if (opt_click_allowed) { std::cout << "A click to exit..." << std::endl; vpDisplay::getClick(I) ; diff --git a/modules/tracker/klt/CMakeLists.txt b/modules/tracker/klt/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..23e2acc08866dd3cfbeaa02c3cb2da72e0e6b329 --- /dev/null +++ b/modules/tracker/klt/CMakeLists.txt @@ -0,0 +1,42 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +vp_add_module(klt visp_core) +vp_glob_module_sources() +vp_module_include_directories() +vp_create_module() +vp_add_tests() diff --git a/src/tracking/klt/vpKltOpencv.h b/modules/tracker/klt/include/visp3/klt/vpKltOpencv.h similarity index 94% rename from src/tracking/klt/vpKltOpencv.h rename to modules/tracker/klt/include/visp3/klt/vpKltOpencv.h index 12fc28390004c1330b517b916fd16962421619f9..1e03b390d406cf669a12f5c2ae501f6ded85f206 100644 --- a/src/tracking/klt/vpKltOpencv.h +++ b/modules/tracker/klt/include/visp3/klt/vpKltOpencv.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpKltOpencv.h 5148 2015-01-12 14:31:30Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented * with opencv. @@ -51,9 +47,9 @@ #ifndef vpKltOpencv_h #define vpKltOpencv_h -#include <visp/vpConfig.h> -#include <visp/vpColor.h> -#include <visp/vpImage.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> #if (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020408)) @@ -64,7 +60,7 @@ /*! \class vpKltOpencv - \ingroup TrackingImagePoint + \ingroup module_klt \brief Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented in OpenCV. @@ -143,6 +139,7 @@ public: void setBlockSize(const int blockSize); void setHarrisFreeParameter(double harris_k); void setInitialGuess(const std::vector<cv::Point2f> &guess_pts); + void setInitialGuess(const std::vector<cv::Point2f> &init_pts, const std::vector<cv::Point2f> &guess_pts, const std::vector<long> &fid); void setMaxFeatures(const int maxCount); void setMinDistance(double minDistance); void setMinEigThreshold(double minEigThreshold); @@ -192,13 +189,12 @@ protected: # endif #endif -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplay.h> -#include <visp/vpDebug.h> -#include <visp/vpException.h> -#include <visp/vpTrackingException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpTrackingException.h> typedef int (*funccheck)(int,double,double); typedef void (*funcinfo)(int,int,int,double,double); @@ -207,7 +203,7 @@ typedef void (*funcevent)(int); /*! \class vpKltOpencv - \ingroup TrackingImagePoint + \ingroup module_klt \brief Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented in OpenCV. @@ -227,8 +223,6 @@ private: int maxFeatures; //Maximum number of features to track (Default 50) int globalcountFeatures; //Keep over time for ID - - int win_size; //Size of search window for tracker (default 10) double quality; //Multiplier for the maxmin eigenvalue; specifies minimal accepted quality of image corners (default 0.01) double min_distance; //Limit, specifying minimum possible distance between returned corners; Euclidian distance is used. (default 10) @@ -346,6 +340,7 @@ public: */ void setHarrisFreeParameter(double input) {initialized = 0; harris_free_parameter=input;} void setInitialGuess(CvPoint2D32f **guess_pts); + void setInitialGuess(CvPoint2D32f **init_pts, CvPoint2D32f **guess_pts, long *fid, int size); /*! Is a feature valid (e.g. : test if not too close to borders) -> event(id_tracker, x, y) */ diff --git a/src/tracking/klt/vpKltOpencv.cpp b/modules/tracker/klt/src/vpKltOpencv.cpp similarity index 92% rename from src/tracking/klt/vpKltOpencv.cpp rename to modules/tracker/klt/src/vpKltOpencv.cpp index 787c8437aa791f085a964af0c248be4e1880a5d1..bb5aa64da81cb7f91a3245207c76bb4776116a07 100644 --- a/src/tracking/klt/vpKltOpencv.cpp +++ b/modules/tracker/klt/src/vpKltOpencv.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpKltOpencv.cpp 5189 2015-01-21 16:42:18Z ayol $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Wrapper for the KLT (Kanade-Lucas-Tomasi) feature tracker implemented * with opencv. @@ -48,15 +44,15 @@ implemented with opencv. */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020408) #include <string> -#include <visp/vpDisplay.h> -#include <visp/vpKltOpencv.h> -#include <visp/vpTrackingException.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/klt/vpKltOpencv.h> +#include <visp3/core/vpTrackingException.h> /*! Default constructor. @@ -458,6 +454,34 @@ vpKltOpencv::setInitialGuess(const std::vector<cv::Point2f> &guess_pts) m_initial_guess = true; } +/*! + Set the points that will be used as initial guess during the next call to track(). + A typical usage of this function is to predict the position of the features before the + next call to track(). + + \param init_pts : Initial points (could be obtained from getPrevFeatures() or getFeatures()). + \param guess_pts : Prediction of the new position of the initial points. The size of this vector must be the same as the size of the vector of initial points. + \param fid : Identifiers of the initial points. + + \sa getPrevFeatures(),getPrevFeaturesId + \sa getFeatures(), getFeaturesId + \sa initTracking() +*/ +void +vpKltOpencv::setInitialGuess(const std::vector<cv::Point2f> &init_pts, const std::vector<cv::Point2f> &guess_pts, const std::vector<long> &fid) +{ + if(guess_pts.size() != init_pts.size()){ + throw(vpException(vpException::badValue, + "Cannot set initial guess: size init vector [%d] and guess vector [%d] doesn't match", + init_pts.size(), guess_pts.size())); + } + + m_points[0] = init_pts; + m_points[1] = guess_pts; + m_points_id = fid; + m_initial_guess = true; +} + /*! Set the points that will be used as initialization during the next call to track(). @@ -518,8 +542,9 @@ void vpKltOpencv::addFeature(const float &x, const float &y) /*! - \deprecated Add a keypoint at the end of the feature list. - This function is deprecated since it doesn't ensure that the id of the feature is unique. + Add a keypoint at the end of the feature list. + + \warning This function doesn't ensure that the id of the feature is unique. You should rather use addFeature(const float &, const float &) or addFeature(const cv::Point2f &). \param id : Feature id. Should be unique @@ -566,7 +591,7 @@ void vpKltOpencv::suppressFeature(const int &index) #include <string> -#include <visp/vpKltOpencv.h> +#include <visp3/klt/vpKltOpencv.h> void vpKltOpencv::clean() { @@ -1107,6 +1132,44 @@ vpKltOpencv::setInitialGuess(CvPoint2D32f **guess_pts) initial_guess = true; } +/*! + Set the points that will be used as initial guess during the next call to track(). + A typical usage of this function is to predict the position of the features before the + next call to track(). + + \param init_pts : Initial points (could be obtained from getPrevFeatures() or getFeatures()). + \param guess_pts : Prediction of the new position of the initial points. The size of this vector must be the same as the size of the vector of initial points. + \param fid : Identifiers of the initial points. + \param size : size of the vectors. + + \sa getPrevFeatures(),getPrevFeaturesId + \sa getFeatures(), getFeaturesId + \sa initTracking() +*/ +void +vpKltOpencv::setInitialGuess(CvPoint2D32f **init_pts, CvPoint2D32f **guess_pts, long *fid, int size) +{ + countPrevFeatures = size; + countFeatures = size; + for (int boucle=0; boucle<size;boucle++) { + prev_featuresid[boucle] = fid[boucle]; + featuresid[boucle] = fid[boucle]; + } + + CvPoint2D32f *swap_features = NULL; + CvPoint2D32f *swap_features2 = NULL; + CV_SWAP(prev_features, *init_pts, swap_features); + +// if(swap_features) cvFree(&swap_features); +// swap_features = NULL; + + CV_SWAP(features, *guess_pts, swap_features2); + + flags |= CV_LKFLOW_INITIAL_GUESSES; + + initial_guess = true; +} + /*! Get the 'index'th previous feature image coordinates. Beware that @@ -1286,4 +1349,7 @@ void vpKltOpencv::display(const vpImage<vpRGBa>& I,const CvPoint2D32f* features_ } } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_vision.a(vpKltOpencv.cpp.o) has no symbols +void dummy_vpKltOpencv() {}; #endif diff --git a/modules/tracker/mbt/CMakeLists.txt b/modules/tracker/mbt/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..13cb8daeb99e33665bc7dee8be8015fe4b4006f4 --- /dev/null +++ b/modules/tracker/mbt/CMakeLists.txt @@ -0,0 +1,115 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +# Add optional 3rd parties +set(opt_incs "") +set(opt_libs "") + +# If +if(USE_COIN3D AND NOT HAVE_visp_ar) + if(WIN32) + add_definitions("-DCOIN_DLL") + endif() + list(APPEND opt_incs ${COIN3D_INCLUDE_DIRS}) + # On OSX cmake 2.8 found OpenGL but OPENGL_INCLUDE_DIR was set to NOT_FOUND + # We add a test to be sure that the OPENGL vars exist. + if(OPENGL_INCLUDE_DIR) + list(APPEND opt_incs ${OPENGL_INCLUDE_DIR}) + endif() + if(OPENGL_LIBRARIES) + list(APPEND opt_libs ${OPENGL_LIBRARIES}) + endif() + + list(APPEND opt_libs ${COIN3D_LIBRARIES}) + if(USE_SOWIN) + add_definitions("-DSOWIN_DLL") + list(APPEND opt_incs ${SOWIN_INCLUDE_DIRS}) + list(APPEND opt_libs ${SOWIN_LIBRARIES}) + endif() + + if(USE_SOQT AND USE_QT) + list(APPEND opt_incs ${SOQT_INCLUDE_DIRS}) + list(APPEND opt_incs ${QT_INCLUDE_DIR}) + list(APPEND opt_incs ${QT_INCLUDES}) + list(APPEND opt_libs ${SOQT_LIBRARIES}) + if(WIN32) + add_definitions("-DSOQT_DLL") + endif() + + # We manage QT libraries + if(DESIRED_QT_VERSION MATCHES 3) + #Add Qt3 libraries + set(VISP_HAVE_QT3_FOUND "yes") # for ViSP-third-party.txt + #message("QT_QT_LIBRARY ${QT_QT_LIBRARY}") + list(APPEND opt_libs ${QT_QT_LIBRARY}) + elseif(DESIRED_QT_VERSION MATCHES 4) + #Add Qt4 libraries + set(VISP_HAVE_QT4_FOUND "yes") # for ViSP-third-party.txt + #message("QT_QTGUI_LIBRARY ${QT_QTGUI_LIBRARY}") + #message("QT_QTGUI_LIBRARY_RELEASE ${QT_QTGUI_LIBRARY_RELEASE}") + #message("QT_QTGUI_LIBRARY_DEBUG ${QT_QTGUI_LIBRARY_DEBUG}") + if(QT_QTGUI_LIBRARY_RELEASE AND QT_QTCORE_LIBRARY_RELEASE AND QT_QTGUI_LIBRARY_DEBUG AND QT_QTCORE_LIBRARY_DEBUG) + list(APPEND opt_libs optimized ${QT_QTGUI_LIBRARY_RELEASE}) + list(APPEND opt_libs optimized ${QT_QTCORE_LIBRARY_RELEASE}) + list(APPEND opt_libs debug ${QT_QTGUI_LIBRARY_DEBUG}) + list(APPEND opt_libs debug ${QT_QTCORE_LIBRARY_DEBUG}) + elseif(QT_QTGUI_LIBRARY_RELEASE AND QT_QTCORE_LIBRARY_RELEASE) + list(APPEND opt_libs ${QT_QTGUI_LIBRARY_RELEASE}) + list(APPEND opt_libs ${QT_QTCORE_LIBRARY_RELEASE}) + elseif(QT_QTGUI_LIBRARY_DEBUG AND QT_QTCORE_LIBRARY_DEBUG) + list(APPEND opt_libs ${QT_QTGUI_LIBRARY_DEBUG}) + list(APPEND opt_libs ${QT_QTCORE_LIBRARY_DEBUG}) + endif() + endif() + + # Because in QT_DEFINITIONS defs are separated by ";", parse the + # QT_DEFINITIONS in order to build a space separated string + vp_list_remove_separator(QT_DEFINITIONS) + add_definitions(${QT_DEFINITIONS}) + add_definitions("-DQT_DLL") + endif(USE_SOQT AND USE_QT) + + if(USE_SOXT) + # OpenGL and SoXt are found + list(APPEND opt_libs ${SOXT_LIBRARIES}) + endif() +endif() + +vp_add_module(mbt visp_vision visp_core visp_me visp_visual_features OPTIONAL visp_ar visp_klt visp_gui) +vp_glob_module_sources() +vp_module_include_directories(${opt_incs}) +vp_create_module(${opt_libs}) diff --git a/src/tracking/mbt/hybrid/vpMbEdgeKltTracker.h b/modules/tracker/mbt/include/visp3/mbt/vpMbEdgeKltTracker.h similarity index 89% rename from src/tracking/mbt/hybrid/vpMbEdgeKltTracker.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbEdgeKltTracker.h index 8d694dacca84c27e7adc161828977f26c300e561..6181ed780019ef72cc7d8f68b11ff20bc2df3d50 100644 --- a/src/tracking/mbt/hybrid/vpMbEdgeKltTracker.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbEdgeKltTracker.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMbEdgeKltTracker.h 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -47,24 +44,24 @@ #ifndef vpMbEdgeKltTracker_HH #define vpMbEdgeKltTracker_HH -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#if (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) +#if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) -#include <visp/vpRobust.h> -#include <visp/vpSubMatrix.h> -#include <visp/vpSubColVector.h> -#include <visp/vpExponentialMap.h> -#include <visp/vpMbTracker.h> -#include <visp/vpKltOpencv.h> -#include <visp/vpMbEdgeTracker.h> -#include <visp/vpPoseVector.h> -#include <visp/vpMbtEdgeKltXmlParser.h> -#include <visp/vpMbKltTracker.h> +#include <visp3/core/vpRobust.h> +#include <visp3/core/vpSubMatrix.h> +#include <visp3/core/vpSubColVector.h> +#include <visp3/core/vpExponentialMap.h> +#include <visp3/mbt/vpMbTracker.h> +#include <visp3/klt/vpKltOpencv.h> +#include <visp3/mbt/vpMbEdgeTracker.h> +#include <visp3/core/vpPoseVector.h> +#include <visp3/mbt/vpMbtEdgeKltXmlParser.h> +#include <visp3/mbt/vpMbKltTracker.h> /*! \class vpMbEdgeKltTracker - \ingroup ModelBasedTracking + \ingroup group_mbt_trackers \warning This class is only available if OpenCV is installed, and used. \brief Hybrid tracker based on moving-edges and keypoints tracked using KLT @@ -330,7 +327,26 @@ public: #endif } + /*! + Use Scanline algorithm for visibility tests + + \param v : True to use it, False otherwise + */ + virtual void setScanLineVisibilityTest(const bool &v){ + vpMbEdgeTracker::setScanLineVisibilityTest(v); + vpMbKltTracker::setScanLineVisibilityTest(v); + } + virtual void setPose(const vpImage<unsigned char> &I, const vpHomogeneousMatrix& cdMo); + /*! + Set if the projection error criteria has to be computed. + + \param flag : True if the projection error criteria has to be computed, false otherwise + */ + virtual void setProjectionErrorComputation(const bool &flag) { + vpMbEdgeTracker::setProjectionErrorComputation(flag); + } + virtual void testTracking(){}; virtual void track(const vpImage<unsigned char>& I); diff --git a/src/tracking/mbt/edge/vpMbEdgeTracker.h b/modules/tracker/mbt/include/visp3/mbt/vpMbEdgeTracker.h similarity index 87% rename from src/tracking/mbt/edge/vpMbEdgeTracker.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbEdgeTracker.h index e497e6e4b8012b2249d2835b1a7804ad7b91871d..0f96a86c7097839d3a98a6683432385ad904aa26 100644 --- a/src/tracking/mbt/edge/vpMbEdgeTracker.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbEdgeTracker.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbEdgeTracker.h 5217 2015-01-28 09:40:02Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Make the complete tracking of an object by using its CAD model * @@ -49,21 +45,21 @@ #ifndef vpMbEdgeTracker_HH #define vpMbEdgeTracker_HH -#include <visp/vpPoint.h> -#include <visp/vpMbTracker.h> -#include <visp/vpMe.h> -#include <visp/vpMbtMeLine.h> -#include <visp/vpMbtDistanceLine.h> -#include <visp/vpMbtDistanceCircle.h> -#include <visp/vpMbtDistanceCylinder.h> -#include <visp/vpXmlParser.h> +#include <visp3/core/vpPoint.h> +#include <visp3/mbt/vpMbTracker.h> +#include <visp3/me/vpMe.h> +#include <visp3/mbt/vpMbtMeLine.h> +#include <visp3/mbt/vpMbtDistanceLine.h> +#include <visp3/mbt/vpMbtDistanceCircle.h> +#include <visp3/mbt/vpMbtDistanceCylinder.h> +#include <visp3/core/vpXmlParser.h> #include <iostream> #include <fstream> #include <vector> #include <list> -#if defined(VISP_HAVE_COIN) +#if defined(VISP_HAVE_COIN3D) //Inventor includes #include <Inventor/nodes/SoSeparator.h> #include <Inventor/VRMLnodes/SoVRMLIndexedFaceSet.h> @@ -91,7 +87,7 @@ /*! \class vpMbEdgeTracker - \ingroup ModelBasedTracking + \ingroup group_mbt_trackers \brief Make the complete tracking of an object by using its CAD model. This class allows to track an object or a scene given its 3D model. A @@ -413,6 +409,23 @@ public: #endif } + /*! + Use Scanline algorithm for visibility tests + + \param v : True to use it, False otherwise + */ + virtual void setScanLineVisibilityTest(const bool &v){ + vpMbTracker::setScanLineVisibilityTest(v); + + for (unsigned int i = 0; i < scales.size(); i += 1){ + if(scales[i]){ + for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[i].begin(); it!=lines[i].end(); ++it){ + (*it)->useScanLine = v; + } + } + } + } + /*! Set the threshold value between 0 and 1 over good moving edges ratio. It allows to decide if the tracker has enough valid moving edges to compute a pose. 1 means that all @@ -440,6 +453,8 @@ public: void setScales(const std::vector<bool>& _scales); + void setUseEdgeTracking(const std::string &name, const bool &useEdgeTracking); + void track(const vpImage<unsigned char> &I); protected: @@ -449,6 +464,7 @@ protected: void addLine(vpPoint &p1, vpPoint &p2, int polygon = -1, std::string name = ""); void addPolygon(vpMbtPolygon &p) ; void cleanPyramid(std::vector<const vpImage<unsigned char>* >& _pyramid); + void computeProjectionError(const vpImage<unsigned char>& _I); void computeVVS(const vpImage<unsigned char>& _I); void downScale(const unsigned int _scale); void init(const vpImage<unsigned char>& I); @@ -465,53 +481,12 @@ protected: void removeCircle(const std::string& name); void removeCylinder(const std::string& name); void removeLine(const std::string& name); + void resetMovingEdge(); void testTracking(); void trackMovingEdge(const vpImage<unsigned char> &I) ; void updateMovingEdge(const vpImage<unsigned char> &I) ; void upScale(const unsigned int _scale); void visibleFace(const vpImage<unsigned char> &_I, const vpHomogeneousMatrix &_cMo, bool &newvisibleline) ; - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated functions - */ - vp_deprecated void visibleFace(const vpHomogeneousMatrix &_cMo, bool &newvisibleline); - -public: - /*! - \deprecated Since this function name is not explicit, use rather getGoodMovingEdgesRatioThreshold() - that does the same. - - \return The threshold value between 0 and 1 that allows to decide if the tracker - has enough valid moving edges to compute a pose. - */ - vp_deprecated inline double getFirstThreshold() const { return percentageGdPt;} - /*! - \deprecated Use vpMbTracker::setDisplayFeatures() instead. - Enable to display the points along the line with a color corresponding to their state. - - - If green : The vpMeSite is a good point. - - If blue : The point is removed because of the vpMeSite tracking phase (contrast problem). - - If purple : The point is removed because of the vpMeSite tracking phase (threshold problem). - - If red : The point is removed because of the robust method in the virtual visual servoing. - - \param displayMe : set it to true to display the points. - */ - vp_deprecated void setDisplayMovingEdges(const bool displayMe) {displayFeatures = displayMe;} - /*! - \deprecated Since this function name is not explicit, use rather setGoodMovingEdgesRatioThreshold() - that does the same. - Set the first threshold used to check if the tracking failed. It corresponds to the percentage - of good point which is necessary. - - The condition which has to be be satisfied is the following : \f$ nbGoodPoint > threshold1 \times (nbGoodPoint + nbBadPoint)\f$. - - The threshold is ideally between 0 and 1. - - \param threshold1 : The new value of the threshold. - */ - vp_deprecated void setFirstThreshold(const double threshold1) {percentageGdPt = threshold1;} - #endif }; #endif diff --git a/src/tracking/mbt/vpMbHiddenFaces.h b/modules/tracker/mbt/include/visp3/mbt/vpMbHiddenFaces.h similarity index 66% rename from src/tracking/mbt/vpMbHiddenFaces.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbHiddenFaces.h index 9bd1356db4f81289af4669507bdfde86fe0fd35c..653c5fbf562d2fc300257110ac49d8fe7696a913 100644 --- a/src/tracking/mbt/vpMbHiddenFaces.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbHiddenFaces.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbTracker.h 4004 2012-11-23 17:34:44Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -44,13 +41,14 @@ #ifndef vpMbHiddenFaces_HH #define vpMbHiddenFaces_HH -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpMbtPolygon.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/mbt/vpMbtPolygon.h> +#include <visp3/mbt/vpMbScanLine.h> #ifdef VISP_HAVE_OGRE - #include <visp/vpAROgre.h> + #include <visp3/ar/vpAROgre.h> #endif #include <vector> @@ -61,7 +59,7 @@ \brief Implementation of the polygons management for the model-based trackers. - \ingroup ModelBasedTracking + \ingroup group_mbt_faces */ template<class PolygonType = vpMbtPolygon> @@ -72,12 +70,16 @@ class vpMbHiddenFaces std::vector<PolygonType *> Lpol ; //! Number of visible polygon unsigned int nbVisiblePolygon; + vpMbScanLine scanlineRender; #ifdef VISP_HAVE_OGRE vpImage<unsigned char> ogreBackground; bool ogreInitialised; + unsigned int nbRayAttempts; + double ratioVisibleRay; vpAROgre *ogre; std::vector< Ogre::ManualObject* > lOgrePolygons; + bool ogreShowConfigDialog; #endif unsigned int setVisiblePrivate(const vpHomogeneousMatrix &cMo, const double &angleAppears, const double &angleDisappears, @@ -99,6 +101,16 @@ class vpMbHiddenFaces const vpCameraParameters &cam, const vpTranslationVector &cameraPos, unsigned int index); + + void computeClippedPolygons(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam); + + void computeScanLineRender(const vpCameraParameters &cam, const unsigned int &w, const unsigned int &h); + + void computeScanLineQuery(const vpPoint &a, const vpPoint &b, + std::vector<std::pair<vpPoint, vpPoint> > &lines, const bool &displayResults = false); + + vpMbScanLine& getMbScanLineRenderer() { return scanlineRender; } + #ifdef VISP_HAVE_OGRE void displayOgre(const vpHomogeneousMatrix &cMo); #endif @@ -122,12 +134,31 @@ class vpMbHiddenFaces unsigned int getNbVisiblePolygon() const {return nbVisiblePolygon;} #ifdef VISP_HAVE_OGRE + /*! + Get the number of rays that will be sent toward each polygon for visibility test. + Each ray will go from the optic center of the camera to a random point inside the considered polygon. + + \sa getGoodNbRayCastingAttemptsRatio() + + \return Number of rays sent. + */ + unsigned int getNbRayCastingAttemptsForVisibility() { return nbRayAttempts; } + /*! Get the Ogre3D Context. \return A pointer on a vpAROgre instance. */ vpAROgre* getOgreContext(){return ogre;} + + /*! + Get the ratio of visibility attempts that has to be successful to consider a polygon as visible. + + \sa getNbRayCastingAttemptsForVisibility() + + \return Ratio of succesful attempts that has to be considered. Value will be between 0.0 (0%) and 1.0 (100%). + */ + double getGoodNbRayCastingAttemptsRatio(){ return ratioVisibleRay; } #endif bool isAppearing(const unsigned int i){ return Lpol[i]->isAppearing(); } @@ -173,6 +204,38 @@ class vpMbHiddenFaces \param w : Width of the background */ void setBackgroundSizeOgre(const unsigned int &h, const unsigned int &w) { ogreBackground = vpImage<unsigned char>(h, w, 0); } + + /*! + Set the number of rays that will be sent toward each polygon for visibility test. + Each ray will go from the optic center of the camera to a random point inside the considered polygon. + + \sa setGoodNbRayCastingAttemptsRatio(const double &) + + \param attempts Number of rays to be sent. + */ + void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts) { nbRayAttempts = attempts; } + + /*! + Set the ratio of visibility attempts that has to be successful to consider a polygon as visible. + + \sa setNbRayCastingAttemptsForVisibility(const unsigned int &) + + \param ratio : Ratio of succesful attempts that has to be considered. Value has to be between 0.0 (0%) and 1.0 (100%). + */ + void setGoodNbRayCastingAttemptsRatio(const double &ratio) {ratioVisibleRay = ratio; if(ratioVisibleRay > 1.0) ratioVisibleRay = 1.0; if(ratioVisibleRay < 0.0) ratioVisibleRay = 0.0;} + /*! + Enable/Disable the appearance of Ogre config dialog on startup. + + \warning This method has only effect when Ogre is used and Ogre visibility test is + enabled using setOgreVisibilityTest() with true parameter. + + \param showConfigDialog : if true, shows Ogre dialog window (used to set Ogre + rendering options) when Ogre visibility is enabled. By default, this functionality + is turned off. + */ + inline void setOgreShowConfigDialog(const bool showConfigDialog){ + ogreShowConfigDialog = showConfigDialog; + } #endif unsigned int setVisible(const vpImage<unsigned char>& I, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, const double &angle, bool &changed) ; @@ -189,32 +252,6 @@ class vpMbHiddenFaces \return Size of the list. */ inline unsigned int size() const { return (unsigned int)Lpol.size(); } - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - //! Boolean specifying if a polygon has to be entirely in front of the camera or not. - bool depthTest; - - /*! - @name Deprecated functions - */ - /*! - \deprecated This method is deprecated since it is no more used since ViSP 2.7.2. \n - - Get the depthTest value. - - \return true if all the points of a polygon has to be in front of the camera, false otherwise. - */ - vp_deprecated bool getDepthTest(){return depthTest;} - /*! - \deprecated This method is deprecated since it is no more used since ViSP 2.7.2. \n - - Set the depthTest value. - - \param d : New value. - */ - vp_deprecated void setDepthTest(const bool &d){depthTest = d;} - unsigned int setVisible(const vpHomogeneousMatrix &cMo) ; -#endif } ; /*! @@ -222,16 +259,14 @@ class vpMbHiddenFaces */ template<class PolygonType> vpMbHiddenFaces<PolygonType>::vpMbHiddenFaces() - : Lpol(), nbVisiblePolygon(0) -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - , depthTest(false) -#endif - + : Lpol(), nbVisiblePolygon(0), scanlineRender() { #ifdef VISP_HAVE_OGRE ogreInitialised = false; + nbRayAttempts = 1; + ratioVisibleRay = 1.0; + ogreShowConfigDialog = false; ogre = new vpAROgre(); - ogre->setShowConfigDialog(false); ogreBackground = vpImage<unsigned char>(480, 640, 0); #endif } @@ -285,6 +320,7 @@ vpMbHiddenFaces<PolygonType>::addPolygon(PolygonType *p) p_new->minLineLengthThresh = p->minLineLengthThresh; p_new->minPolygonAreaThresh = p->minPolygonAreaThresh; p_new->setName(p->name); + p_new->hasOrientation = p->hasOrientation; for(unsigned int i = 0; i < p->nbpt; i++) p_new->p[i]= p->p[i]; @@ -324,12 +360,85 @@ vpMbHiddenFaces<PolygonType>::reset() lOgrePolygons.resize(0); ogreInitialised = false; + nbRayAttempts = 1; + ratioVisibleRay = 1.0; ogre = new vpAROgre(); - ogre->setShowConfigDialog(false); ogreBackground = vpImage<unsigned char>(480, 640); #endif } +/*! + Compute the clipped points of the polygons that have been added via addPolygon(). + + \param cMo : Pose that will be used to clip the polygons. + \param cam : Camera parameters that will be used to clip the polygons. +*/ +template<class PolygonType> +void +vpMbHiddenFaces<PolygonType>::computeClippedPolygons(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam) +{ + for (unsigned int i = 0; i < Lpol.size(); i++){ + // For fast result we could just clip visible polygons. + // However clipping all of them gives us the possibility to return more information in the scanline visibility results +// if(Lpol[i]->isVisible()) + { + Lpol[i]->changeFrame(cMo); + Lpol[i]->computePolygonClipped(cam); + } + } +} + +/*! + Render the scene in order to perform, later via computeScanLineQuery(), visibility tests. + + \param cam : Camera parameters that will be used to render the scene. + \param w : Width of the render window. + \param h : Height of the render window. +*/ +template<class PolygonType> +void +vpMbHiddenFaces<PolygonType>::computeScanLineRender(const vpCameraParameters &cam, const unsigned int &w, const unsigned int &h){ + std::vector<std::vector<std::pair<vpPoint, unsigned int> > > polyClipped(Lpol.size()); + std::vector<std::vector<std::pair<vpPoint, unsigned int> > * > listPolyClipped; + std::vector<int> listPolyIndices; + + for (unsigned int i = 0; i < Lpol.size(); i++){ + // For fast result we could just use visible polygons. + // However using all of them gives us the possibility to return more information in the scanline visibility results +// if(Lpol[i]->isVisible()) + { + polyClipped[i].clear(); + Lpol[i]->getPolygonClipped(polyClipped[i]); + if(polyClipped[i].size() != 0) + { + listPolyClipped.push_back(&polyClipped[i]); + listPolyIndices.push_back(Lpol[i]->getIndex()); + } + } + } + + scanlineRender.drawScene(listPolyClipped, listPolyIndices, cam, w, h); +} + +/*! + Compute Scanline visibility results for a line. + + \warning computeScanLineRender() function has to be called before + + \param a : First point of the line. + \param b : Second point of the line. + \param lines : Result of the scanline visibility. List of the visible parts of the line. + \param displayResults : True if the results have to be displayed. False otherwise +*/ +template<class PolygonType> +void +vpMbHiddenFaces<PolygonType>::computeScanLineQuery(const vpPoint &a, const vpPoint &b, + std::vector<std::pair<vpPoint, vpPoint> > &lines, + const bool &displayResults) +{ + scanlineRender.queryLineVisibility(a,b,lines,displayResults); +} + /*! Compute the number of visible polygons. @@ -367,6 +476,7 @@ vpMbHiddenFaces<PolygonType>::setVisiblePrivate(const vpHomogeneousMatrix &cMo, } for (unsigned int i = 0; i < Lpol.size(); i++){ + //std::cout << "Calling poly: " << i << std::endl; if (computeVisibility(cMo, angleAppears, angleDisappears, changed, useOgre, testRoi, I, cam, cameraPos, i)) nbVisiblePolygon ++; } @@ -550,11 +660,12 @@ vpMbHiddenFaces<PolygonType>::initOgre(const vpCameraParameters &cam) { ogreInitialised = true; ogre->setCameraParameters(cam); + ogre->setShowConfigDialog(ogreShowConfigDialog); ogre->init(ogreBackground, false, true); - + for(unsigned int n = 0 ; n < Lpol.size(); n++){ Ogre::ManualObject* manual = ogre->getSceneManager()->createManualObject(Ogre::StringConverter::toString(n)); - + manual->begin("BaseWhiteNoLighting", Ogre::RenderOperation::OT_LINE_STRIP); for(unsigned int i = 0; i < Lpol[n]->nbpt; i++){ manual->position( (Ogre::Real)Lpol[n]->p[i].get_oX(), (Ogre::Real)Lpol[n]->p[i].get_oY(), (Ogre::Real)Lpol[n]->p[i].get_oZ()); @@ -564,7 +675,7 @@ vpMbHiddenFaces<PolygonType>::initOgre(const vpCameraParameters &cam) manual->index(0); manual->end(); - + ogre->getSceneManager()->getRootSceneNode()->createChildSceneNode()->attachObject(manual); lOgrePolygons.push_back(manual); @@ -639,69 +750,131 @@ vpMbHiddenFaces<PolygonType>::setVisibleOgre(const vpHomogeneousMatrix &cMo, con template<class PolygonType> bool vpMbHiddenFaces<PolygonType>::isVisibleOgre(const vpTranslationVector &cameraPos, const unsigned int &index) -{ -// std::cout << "visible" << std::endl; - // A line is always visible - if(Lpol[index]->getNbPoint() <= 2){ - lOgrePolygons[index]->setVisible(true); - Lpol[index]->isvisible = true; - return true; - } - +{ Ogre::Vector3 camera((Ogre::Real)cameraPos[0],(Ogre::Real)cameraPos[1],(Ogre::Real)cameraPos[2]); if(!ogre->getCamera()->isVisible(lOgrePolygons[index]->getBoundingBox())){ lOgrePolygons[index]->setVisible(false); Lpol[index]->isvisible = false; - return false; - } - - //Get the center of gravity - Ogre::Vector3 origin(0,0,0); - for(unsigned int j = 0 ; j < Lpol[index]->getNbPoint() ; j++){ - Ogre::Vector3 tmp((Ogre::Real)Lpol[index]->getPoint(j).get_oX(), (Ogre::Real)Lpol[index]->getPoint(j).get_oY(), (Ogre::Real)Lpol[index]->getPoint(j).get_oZ()); - origin += tmp; + return false; } - origin /= (Ogre::Real)Lpol[index]->getNbPoint(); - Ogre::Vector3 direction = origin - camera; - - Ogre::RaySceneQuery *mRaySceneQuery = ogre->getSceneManager()->createRayQuery(Ogre::Ray(camera, direction)); - mRaySceneQuery->setSortByDistance(true); - - Ogre::RaySceneQueryResult &result = mRaySceneQuery->execute(); - Ogre::RaySceneQueryResult::iterator it = result.begin(); - + + //Get the center of gravity bool visible = false; - double distance, distancePrev; - if(it != result.end()){ - if(it->movable->getName().find("SimpleRenderable") != Ogre::String::npos) //Test if the ogreBackground is intersect in first - it++; - - if(it != result.end()){ - distance = it->distance; - distancePrev = distance; - if(it->movable->getName() == Ogre::StringConverter::toString(index)){ - visible = true; - } - else{ + unsigned int nbVisible = 0; + + for(unsigned int i = 0; i < nbRayAttempts; i++) + { + Ogre::Vector3 origin(0,0,0); + Ogre::Real totalFactor = 0.0f; + + for(unsigned int j = 0 ; j < Lpol[index]->getNbPoint() ; j++) + { + Ogre::Real factor = 1.0f; + + if(nbRayAttempts > 1){ + int r = rand() % 101; + + if(r != 0) + factor = ((Ogre::Real)r)/100.0f; + } + + Ogre::Vector3 tmp((Ogre::Real)Lpol[index]->getPoint(j).get_oX(), (Ogre::Real)Lpol[index]->getPoint(j).get_oY(), (Ogre::Real)Lpol[index]->getPoint(j).get_oZ()); + tmp *= factor; + origin += tmp; + totalFactor += factor; + } + + origin /= totalFactor; + + Ogre::Vector3 direction = origin - camera; + Ogre::Real distanceCollision = direction.length(); + + direction.normalise(); + Ogre::RaySceneQuery *mRaySceneQuery = ogre->getSceneManager()->createRayQuery(Ogre::Ray(camera, direction)); + mRaySceneQuery->setSortByDistance(true); + + Ogre::RaySceneQueryResult &result = mRaySceneQuery->execute(); + Ogre::RaySceneQueryResult::iterator it = result.begin(); + +// while(it != result.end()){ +// std::cout << it->movable->getName() << "(" << it->distance<< ") : " << std::flush; +// it++; +// } +// std::cout << std::endl; +// it = result.begin(); + + if(it != result.end()) + if(it->movable->getName().find("SimpleRenderable") != Ogre::String::npos) //Test if the ogreBackground is intersect in first it++; - while(!visible && it != result.end()){ + + double distance, distancePrev; + // In a case of a two-axis aligned segment, ray collision is not always working. + if(Lpol[index]->getNbPoint() == 2 && + (((std::fabs(Lpol[index]->getPoint(0).get_oX() - Lpol[index]->getPoint(1).get_oX()) < std::numeric_limits<double>::epsilon()) + + (std::fabs(Lpol[index]->getPoint(0).get_oY() - Lpol[index]->getPoint(1).get_oY()) < std::numeric_limits<double>::epsilon()) + + (std::fabs(Lpol[index]->getPoint(0).get_oZ() - Lpol[index]->getPoint(1).get_oZ()) < std::numeric_limits<double>::epsilon())) >= 2 )) + { + if(it != result.end()) + { + if(it->movable->getName() == Ogre::StringConverter::toString(index)){ + nbVisible++; + } + else + { distance = it->distance; - //if(distance == distancePrev){ - if(std::fabs(distance - distancePrev) < distance * std::numeric_limits<double>::epsilon()){ - if(it->movable->getName() == Ogre::StringConverter::toString(index)){ - visible = true; - break; + // Cannot use epsilon for comparison as ray lenght is slightly different from the collision distance returned by Ogre::RaySceneQueryResult. + if(distance > distanceCollision || std::fabs(distance - distanceCollision) < 1e-6 /*std::fabs(distance) * std::numeric_limits<double>::epsilon()*/) + nbVisible++; + } + } + else + nbVisible++; // Collision not detected but present. + } + else + { + if(it != result.end()) + { + distance = it->distance; + distancePrev = distance; + + //std::cout << "For " << Ogre::StringConverter::toString(index) << ": " << it->movable->getName() << " / " << std::flush; + + if(it->movable->getName() == Ogre::StringConverter::toString(index)){ + nbVisible++; + } + else + { + it++; + while(it != result.end()) + { + distance = it->distance; + + if(std::fabs(distance - distancePrev) < 1e-6 /*std::fabs(distance) * std::numeric_limits<double>::epsilon()*/){ + //std::cout << it->movable->getName() << " / " << std::flush; + if(it->movable->getName() == Ogre::StringConverter::toString(index)){ + nbVisible++; + break; + } + it++; + distancePrev = distance; } - it++; - distancePrev = distance; + else + break; } - else - break; } } } + + ogre->getSceneManager()->destroyQuery(mRaySceneQuery); + } + if(((double)nbVisible)/((double)nbRayAttempts) > ratioVisibleRay || + std::fabs(((double)nbVisible)/((double)nbRayAttempts) - ratioVisibleRay) < ratioVisibleRay * std::numeric_limits<double>::epsilon()) + visible = true; + else + visible = false; + if(visible){ lOgrePolygons[index]->setVisible(true); Lpol[index]->isvisible = true; @@ -710,37 +883,10 @@ vpMbHiddenFaces<PolygonType>::isVisibleOgre(const vpTranslationVector &cameraPos lOgrePolygons[index]->setVisible(false); Lpol[index]->isvisible = false; } - - ogre->getSceneManager()->destroyQuery(mRaySceneQuery); - + return Lpol[index]->isvisible; } #endif //VISP_HAVE_OGRE -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated since it is no more used since ViSP 2.7.2. \n - - Compute the number of visible polygons. - - \param cMo : The pose of the camera - - \return Return the number of visible polygons -*/ -template<class PolygonType> -unsigned int -vpMbHiddenFaces<PolygonType>::setVisible(const vpHomogeneousMatrix &cMo) -{ - nbVisiblePolygon = 0 ; - - for(unsigned int i = 0 ; i < Lpol.size() ; i++){ - if (Lpol[i]->isVisible(cMo, depthTest)){ - nbVisiblePolygon++; - } - } - return nbVisiblePolygon ; -} -#endif //VISP_BUILD_DEPRECATED_FUNCTIONS - #endif // vpMbHiddenFaces diff --git a/src/tracking/mbt/klt/vpMbKltTracker.h b/modules/tracker/mbt/include/visp3/mbt/vpMbKltTracker.h similarity index 85% rename from src/tracking/mbt/klt/vpMbKltTracker.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbKltTracker.h index 4fdaa2b1344440c7afa99931886f2d26cff42cb5..fbaf680114bb994656f019aa68e7a450d208fde0 100644 --- a/src/tracking/mbt/klt/vpMbKltTracker.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbKltTracker.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMbKltTracker.h 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -46,29 +43,27 @@ #ifndef vpMbKltTracker_h #define vpMbKltTracker_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#if (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) +#if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) -#include <visp/vpMbTracker.h> -#include <visp/vpKltOpencv.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpDisplayX.h> -#include <visp/vpMbtKltXmlParser.h> -#include <visp/vpHomography.h> -#include <visp/vpRobust.h> -#include <visp/vpSubColVector.h> -#include <visp/vpSubMatrix.h> -#include <visp/vpExponentialMap.h> -//#include <visp/vpMbtKltPolygon.h> -#include <visp/vpMbtDistanceKltPoints.h> -#include <visp/vpMbtDistanceCircle.h> -#include <visp/vpMbtDistanceCylinder.h> +#include <visp3/mbt/vpMbTracker.h> +#include <visp3/klt/vpKltOpencv.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/mbt/vpMbtKltXmlParser.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpRobust.h> +#include <visp3/core/vpSubColVector.h> +#include <visp3/core/vpSubMatrix.h> +#include <visp3/core/vpExponentialMap.h> +#include <visp3/mbt/vpMbtDistanceKltPoints.h> +#include <visp3/mbt/vpMbtDistanceCircle.h> +#include <visp3/mbt/vpMbtDistanceKltCylinder.h> /*! \class vpMbKltTracker - \ingroup ModelBasedTracking + \ingroup group_mbt_trackers \warning This class is only available if OpenCV is installed, and used. \brief Model based tracker using only KLT @@ -255,12 +250,10 @@ protected: vpHomogeneousMatrix ctTc0; //! Points tracker. vpKltOpencv tracker; - //! First track() called - bool firstTrack; - //! Vector of the cylinders used here only to display the full model. + //! std::list<vpMbtDistanceKltPoints*> kltPolygons; - //! Vector of the cylinders used here only to display the full model. - std::list<vpMbtDistanceCylinder*> cylinders_disp; + //! + std::list<vpMbtDistanceKltCylinder*> kltCylinders; //! Vector of the circles used here only to display the full model. std::list<vpMbtDistanceCircle*> circles_disp; @@ -269,7 +262,6 @@ public: virtual ~vpMbKltTracker(); void addCircle(const vpPoint &P1, const vpPoint &P2, const vpPoint &P3, const double r, const std::string &name=""); - void addCylinder(const vpPoint &P1, const vpPoint &P2, const double r, const std::string &name=""); virtual void display(const vpImage<unsigned char>& I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor& col, const unsigned int thickness=1, const bool displayFullModel = false); @@ -284,7 +276,7 @@ public: /*! Return the address of the circle feature list. */ std::list<vpMbtDistanceCircle*> &getFeaturesCircle() { return circles_disp; } /*! Return the address of the cylinder feature list. */ - std::list<vpMbtDistanceCylinder*> &getFeaturesCylinder() { return cylinders_disp; } + std::list<vpMbtDistanceKltCylinder*> &getFeaturesKltCylinder() { return kltCylinders; } /*! Return the address of the Klt feature list. */ std::list<vpMbtDistanceKltPoints*> &getFeaturesKlt() { return kltPolygons; } virtual void loadConfigFile(const std::string& configFile); @@ -369,7 +361,12 @@ public: \param e : The desired erosion. */ - inline void setMaskBorder(const unsigned int &e){ maskBorder = e; } + inline void setMaskBorder(const unsigned int &e) + { + maskBorder = e; + //if(useScanLine) + faces.getMbScanLineRenderer().setMaskBorder(maskBorder); + } /*! Set the maximum iteration of the virtual visual servoing stage. @@ -390,16 +387,39 @@ public: #ifdef VISP_HAVE_OGRE faces.getOgreContext()->setWindowName("MBT Klt"); #endif + } + + /*! + Use Scanline algorithm for visibility tests + + \param v : True to use it, False otherwise + */ + virtual void setScanLineVisibilityTest(const bool &v){ + vpMbTracker::setScanLineVisibilityTest(v); + + for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it) + (*it)->useScanLine = v; } virtual void setPose(const vpImage<unsigned char> &I, const vpHomogeneousMatrix& cdMo); + + /*! + Set if the projection error criteria has to be computed. + + \param flag : True if the projection error criteria has to be computed, false otherwise + */ + virtual void setProjectionErrorComputation(const bool &flag) { + if(flag) + vpCTRACE << "This option is not yet implemented in vpMbKltTracker, projection error computation set to false." << std::endl ; } /*! Set the threshold for the acceptation of a point. \param th : Threshold for the weight below which a point is rejected. */ - inline void setThresholdAcceptation(const double th) {threshold_outlier = th;} + inline void setThresholdAcceptation(const double th) {threshold_outlier = th;} + + void setUseKltTracking(const std::string &name, const bool &useKltTracking); virtual void testTracking(); virtual void track(const vpImage<unsigned char>& I); diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbScanLine.h b/modules/tracker/mbt/include/visp3/mbt/vpMbScanLine.h new file mode 100644 index 0000000000000000000000000000000000000000..3551e3a60fc3a90be209b2afebf85f39b2b4f96c --- /dev/null +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbScanLine.h @@ -0,0 +1,214 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Compute the visibility of 3D polygons already transformed in the camera frame + * + * Authors: + * Aurelien Yol + * + *****************************************************************************/ + +#ifndef vpMbScanLine_HH +#define vpMbScanLine_HH + +#include <vector> +#include <list> +#include <deque> +#include <set> +#include <map> +#include <limits> // numeric_limits + +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImageConvert.h> + +//#define DEBUG_DISP // Uncomment to get visibility debug display + +#if defined(DEBUG_DISP) +#include <visp3/core/vpDisplay.h> +#endif + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +/*! + \class vpMbScanLine + + \ingroup group_mbt_faces + + */ +class vpMbScanLine +{ +public: + //! Structure to define if a scanline intersection is a starting or an ending point of a polygon, or just a single line intersection. + typedef enum + { + START = 1, + END = 0, + POINT = 2 + } vpMbScanLineType ; + + //! Structure to define a scanline edge (basically a pair of (X,Y,Z) vectors). + typedef std::pair<vpColVector, vpColVector> vpMbScanLineEdge; + + //! Structure to define a scanline intersection. + struct vpMbScanLineSegment + { + vpMbScanLineSegment() : type(START), edge(), p(0), P1(0), P2(0), Z1(0), Z2(0), ID(0), b_sample_Y(false) {}; + vpMbScanLineType type; + vpMbScanLineEdge edge; + double p; // This value can be either x or y-coordinate value depending if the structure is used in X or Y-axis scanlines computation. + double P1, P2; // Same comment as previous value. + double Z1, Z2; + int ID; + bool b_sample_Y; + }; + + //! vpMbScanLineEdge Comparator. + struct vpMbScanLineEdgeComparator + { + inline bool operator()(const vpMbScanLineEdge &l0, const vpMbScanLineEdge &l1) const + { + for(unsigned int i = 0 ; i < 3 ; ++i) + if (l0.first[i] < l1.first[i]) + return true; + else if(l0.first[i] > l1.first[i]) + return false; + for(unsigned int i = 0 ; i < 3 ; ++i) + if (l0.second[i] < l1.second[i]) + return true; + else if(l0.second[i] > l1.second[i]) + return false; + return false; + } + }; + + //! vpMbScanLineSegment Comparators. + struct vpMbScanLineSegmentComparator + { + inline bool operator()(const vpMbScanLineSegment &a, const vpMbScanLineSegment &b) const + { + //return a.p == b.p ? a.type < b.type : a.p < b.p; + return (std::fabs(a.p - b.p) <= std::numeric_limits<double>::epsilon()) ? a.type < b.type : a.p < b.p; + } + + inline bool operator()(const std::pair<double,vpMbScanLineSegment> &a, const std::pair<double, vpMbScanLineSegment> &b) const + { + return a.first < b.first; + } + }; + +private: + unsigned int w, h; + vpCameraParameters K; + unsigned int maskBorder; + vpImage<unsigned char> mask; + vpImage<int> primitive_ids; + std::map<vpMbScanLineEdge, std::set<int>, vpMbScanLineEdgeComparator> visibility_samples; + double depthTreshold; + +public: +#if defined(DEBUG_DISP) + vpDisplay *dispMaskDebug; + vpDisplay *dispLineDebug; + vpImage<unsigned char> linedebugImg; +#endif + + vpMbScanLine(); + ~vpMbScanLine(); + + void drawScene(const std::vector<std::vector<std::pair<vpPoint, unsigned int> > * > &polygons, + std::vector<int> listPolyIndices, + const vpCameraParameters &K, unsigned int w, unsigned int h); + + /*! + If there is one polygon behind another, + this threshold defines the minimum distance between both polygons to still consider the one behind as visible. + + \return Current Threshold. + */ + double getDepthTreshold() { return depthTreshold; } + unsigned int getMaskBorder() { return maskBorder; } + const vpImage<unsigned char>& getMask() const { return mask; } + const vpImage<int>& getPrimitiveIDs() const { return primitive_ids; } + + void queryLineVisibility(const vpPoint &a, const vpPoint &b, + std::vector<std::pair<vpPoint, vpPoint> > &lines, + const bool &displayResults = false); + + /*! + If there is one polygon behind another, + this threshold defines the minimum distance between both polygons to still consider the one behind as visible. + + \param treshold : New Threshold. + */ + void setDepthTreshold(const double &treshold) { depthTreshold = treshold; } + void setMaskBorder(const unsigned int &mb){ maskBorder = mb; } + + +private: + void createScanLinesFromLocals(std::vector<std::vector<vpMbScanLineSegment> > &scanlines, + std::vector<std::vector<vpMbScanLineSegment> > &localScanlines, + const unsigned int &size); + + void drawLineY(const vpColVector &a, + const vpColVector &b, + const vpMbScanLineEdge &line_ID, + const int ID, + std::vector<std::vector<vpMbScanLineSegment> > &scanlines); + + void drawLineX(const vpColVector &a, + const vpColVector &b, + const vpMbScanLineEdge &line_ID, + const int ID, + std::vector<std::vector<vpMbScanLineSegment> > &scanlines); + + void drawPolygonY(const std::vector<std::pair<vpPoint, unsigned int> > &polygon, + const int ID, + std::vector<std::vector<vpMbScanLineSegment> > &scanlines); + + void drawPolygonX(const std::vector<std::pair<vpPoint, unsigned int> > &polygon, + const int ID, + std::vector<std::vector<vpMbScanLineSegment> > &scanlines); + + // Static functions + static vpMbScanLineEdge makeMbScanLineEdge(const vpPoint &a, const vpPoint &b); + static void createVectorFromPoint(const vpPoint &p, vpColVector &v, const vpCameraParameters &K); + static double getAlpha(double x, double X0, double Z0, double X1, double Z1); + static double mix(double a, double b, double alpha); + static vpPoint mix(const vpPoint &a, const vpPoint &b, double alpha); + static double norm(const vpPoint &a, const vpPoint &b); +}; + +#endif // doxygen should skip this + +#endif diff --git a/src/tracking/mbt/vpMbTracker.h b/modules/tracker/mbt/include/visp3/mbt/vpMbTracker.h old mode 100755 new mode 100644 similarity index 81% rename from src/tracking/mbt/vpMbTracker.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbTracker.h index 8c35e4763b60f80945e87df8bf8c322b28fff7b0..e09eae077c562631286117f3bd90bcfde6a35e04 --- a/src/tracking/mbt/vpMbTracker.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbTracker.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbTracker.h 5162 2015-01-14 19:09:23Z strinh $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,21 +10,20 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * @@ -58,19 +55,19 @@ #include <functional> // std::not1 -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpColVector.h> -#include <visp/vpMatrix.h> -#include <visp/vpRGBa.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpPoint.h> -#include <visp/vpMbtPolygon.h> -#include <visp/vpMbHiddenFaces.h> -#include <visp/vpPolygon.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpPoint.h> +#include <visp3/mbt/vpMbtPolygon.h> +#include <visp3/mbt/vpMbHiddenFaces.h> +#include <visp3/core/vpPolygon.h> -#ifdef VISP_HAVE_COIN +#ifdef VISP_HAVE_COIN3D //Work around to avoid type redefinition int8_t with Coin // #if defined(_WIN32) && defined(VISP_HAVE_OGRE) && (_MSC_VER >= 1600) // Visual Studio 2010 // #define HAVE_INT8_T 1 @@ -84,7 +81,7 @@ /*! \class vpMbTracker - \ingroup ModelBasedTracking + \ingroup group_mbt_trackers \brief Main methods for a model-based tracker. This class provides the main methods for a model based tracker. This pure @@ -105,6 +102,12 @@ */ class VISP_EXPORT vpMbTracker { +public: + typedef enum { + GAUSS_NEWTON_OPT = 0, + LEVENBERG_MARQUARDT_OPT = 1 + } vpMbtOptimizationMethod; + protected: //! The camera parameters. vpCameraParameters cam; @@ -124,12 +127,18 @@ protected: bool computeCovariance; //! Covariance matrix vpMatrix covarianceMatrix; + //! Flag used to specify if the gradient error criteria has to be computed or not. + bool computeProjError; + //! Error angle between the gradient direction of the model features projected at the resulting pose and their normal. + double projectionError; //! If true, the features are displayed. bool displayFeatures; //! Weights used in the robust scheme vpColVector m_w; //! Error s-s* vpColVector m_error; + //! Optimization method used + vpMbtOptimizationMethod m_optimizationMethod; //! Set of faces describing the object. vpMbHiddenFaces<vpMbtPolygon> faces; @@ -145,6 +154,9 @@ protected: unsigned int clippingFlag; //! Use Ogre3d for visibility tests bool useOgre; + bool ogreShowConfigDialog; + //! Use Scanline for visibility tests + bool useScanLine; //! Number of points in CAO model unsigned int nbPoints; //! Number of lines in CAO model @@ -213,7 +225,7 @@ public: virtual void getCameraParameters(vpCameraParameters& camera) const { camera = this->cam;} /*! - Get the clipping used and defined in vpMbtPolygon::vpMbtPolygonClippingType. + Get the clipping used and defined in vpPolygon3D::vpMbtPolygonClippingType. \return Clipping flags. */ @@ -229,6 +241,13 @@ public: return covarianceMatrix; } + /*! + Get the error angle between the gradient direction of the model features projected at the resulting pose and their normal. + + \return the value for the error. + */ + virtual double getProjectionError() const { return projectionError; } + virtual vpColVector getEstimatedDoF(); /*! @@ -298,6 +317,15 @@ public: */ virtual inline double getNearClippingDistance() const { return distNearClip; } + /*! + Get the optimization method used during the tracking. + 0 = Gauss-Newton approach. + 1 = Levenberg-Marquardt approach. + + \return Optimization method. + */ + virtual inline vpMbtOptimizationMethod getOptimizationMethod() const { return m_optimizationMethod; } + /*! Return the polygon (face) "index". @@ -347,9 +375,11 @@ public: // Intializer +#ifdef VISP_HAVE_MODULE_GUI virtual void initClick( const vpImage<unsigned char>& I, const std::string& initFile, const bool displayHelp = false ); virtual void initClick( const vpImage<unsigned char>& I, const std::vector<vpPoint> &points3D_list, const std::string &displayFile = "" ); +#endif virtual void initFromPoints( const vpImage<unsigned char>& I, const std::string& initFile ); virtual void initFromPoints( const vpImage<unsigned char>& I, const std::vector<vpImagePoint> &points2D_list, const std::vector<vpPoint> &points3D_list ); @@ -415,8 +445,6 @@ public: */ virtual void setCovarianceComputation(const bool& flag) { computeCovariance = flag; } - virtual void setEstimatedDoF(const vpColVector& v); - /*! Enable to display the features. By features, we meant the moving edges (ME) and the klt points if used. @@ -430,6 +458,8 @@ public: */ void setDisplayFeatures(const bool displayF) {displayFeatures = displayF;} + virtual void setEstimatedDoF(const vpColVector& v); + virtual void setFarClippingDistance(const double &dist); virtual void setLod(const bool useLod, const std::string &name=""); @@ -439,6 +469,13 @@ public: virtual void setMinPolygonAreaThresh(const double minPolygonAreaThresh, const std::string &name=""); virtual void setNearClippingDistance(const double &dist); + + /*! + Set the optimization method used during the tracking. + + \param opt : Optimization method to use. + */ + virtual inline void setOptimizationMethod(const vpMbtOptimizationMethod &opt) { m_optimizationMethod = opt; } /*! Set the pose to be used in entry of the next call to the track() function. @@ -464,8 +501,52 @@ public: poseSavingFilename = filename; } + /*! + Set if the projection error criteria has to be computed. + + \param flag : True if the projection error criteria has to be computed, false otherwise + */ + virtual void setProjectionErrorComputation(const bool &flag) { computeProjError = flag; } + + virtual void setScanLineVisibilityTest(const bool &v){ useScanLine = v; } + + /*! + Enable/Disable the appearance of Ogre config dialog on startup. + + \warning This method has only effect when Ogre is used and Ogre visibility test is + enabled using setOgreVisibilityTest() with true parameter. + + \param showConfigDialog : if true, shows Ogre dialog window (used to set Ogre + rendering options) when Ogre visibility is enabled. By default, this functionality + is turned off. + */ + inline void setOgreShowConfigDialog(const bool showConfigDialog){ + ogreShowConfigDialog = showConfigDialog; + } + virtual void setOgreVisibilityTest(const bool &v); +#ifdef VISP_HAVE_OGRE + /*! + Set the number of rays that will be sent toward each polygon for visibility test. + Each ray will go from the optic center of the camera to a random point inside the considered polygon. + + \sa setGoodNbRayCastingAttemptsRatio(const unsigned int &) + + \param attempts Number of rays to be sent. + */ + void setNbRayCastingAttemptsForVisibility(const unsigned int &attempts) { faces.setNbRayCastingAttemptsForVisibility(attempts); } + + /*! + Set the ratio of visibility attempts that has to be successful to consider a polygon as visible. + + \sa setNbRayCastingAttemptsForVisibility(const unsigned int &) + + \param ratio : Ratio of succesful attempts that has to be considered. Value has to be between 0.0 (0%) and 1.0 (100%). + */ + void setGoodNbRayCastingAttemptsRatio(const double &ratio){ faces.setGoodNbRayCastingAttemptsRatio(ratio); } +#endif + /*! Test the quality of the tracking. @@ -487,15 +568,18 @@ protected: const std::string &polygonName="", const bool useLod=false, const double minPolygonAreaThreshold=2500.0); void addPolygon(const vpPoint& p1, const vpPoint &p2, const int idFace=-1, const std::string &polygonName="", const bool useLod=false, const double minLineLengthThreshold=50); + void addPolygon(const std::vector<std::vector<vpPoint> > &listFaces, const int idFace=-1, const std::string &polygonName="", + const bool useLod=false, const double minLineLengthThreshold=50); + + void createCylinderBBox(const vpPoint& p1, const vpPoint &p2, const double &radius, std::vector<std::vector<vpPoint> > &listFaces); - void computeCovarianceMatrix(const vpHomogeneousMatrix &cMoPrev, const vpColVector &deltaS, const vpMatrix &Ls, const vpMatrix &W); - void computeJTR(const vpMatrix& J, const vpColVector& R, vpMatrix& JTR); + void computeJTR(const vpMatrix& J, const vpColVector& R, vpColVector& JTR); -#ifdef VISP_HAVE_COIN +#ifdef VISP_HAVE_COIN3D virtual void extractGroup(SoVRMLGroup *sceneGraphVRML2, vpHomogeneousMatrix &transform, int &idFace); - virtual void extractFaces(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatrix &transform, int &idFace); - virtual void extractLines(SoVRMLIndexedLineSet* line_set, int &idFace); - virtual void extractCylinders(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatrix &transform, int &idFace); + virtual void extractFaces(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatrix &transform, int &idFace, const std::string &polygonName=""); + virtual void extractLines(SoVRMLIndexedLineSet* line_set, int &idFace, const std::string &polygonName=""); + virtual void extractCylinders(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatrix &transform, int &idFace, const std::string &polygonName=""); #endif vpPoint getGravityCenter(const std::vector<vpPoint>& _pts); diff --git a/src/tracking/mbt/vpMbXmlParser.h b/modules/tracker/mbt/include/visp3/mbt/vpMbXmlParser.h similarity index 76% rename from src/tracking/mbt/vpMbXmlParser.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbXmlParser.h index 198d70b2d13c1735b9ff609ebd81c0fc3dde279c..5e9bd29696c43e502e4d51d520cb2434bbda523c 100644 --- a/src/tracking/mbt/vpMbXmlParser.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbXmlParser.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbXmlParser.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Load XML Parameter for Model Based Tracker. * @@ -47,19 +43,19 @@ #ifndef vpMbXmlParser_HH #define vpMbXmlParser_HH -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */ -#include <visp/vpXmlParser.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpXmlParser.h> +#include <visp3/core/vpCameraParameters.h> /*! \class vpMbXmlParser \brief Parse an Xml file to extract configuration parameters of a mbtConfig object. - \ingroup ModelBasedTracking + \ingroup group_mbt_xml_parser Data parser for the model based tracker. @@ -83,6 +79,12 @@ protected: double farClipping; //! Fov Clipping bool fovClipping; + //! If true, the LOD is enabled, otherwise it is not + bool useLod; + //! Minimum line length to track a segment when LOD is enabled + double minLineLengthThreshold; + //! Minimum polygon area to track a face when LOD is enabled + double minPolygonAreaThreshold; typedef enum{ conf, @@ -99,6 +101,10 @@ protected: v0, px, py, + lod, + use_lod, + min_line_length_threshold, + min_polygon_area_threshold, last } dataToParseMb; @@ -137,7 +143,34 @@ public: \return True if yes, False otherwise. */ inline bool getFovClipping() const {return fovClipping;} + + /*! + Get the state of LOD setting. + + \return True if LOD is enabled, false otherwise. + */ + inline bool getLodState() const { + return useLod; + } + /*! + Get the minimum line length to track a segment when LOD is enabled. + + \return The minimum line length. + */ + inline double getMinLineLengthThreshold() const { + return minLineLengthThreshold; + } + + /*! + Get the minimum polygon area to track a face when LOD is enabled. + + \return The minimum polygon area. + */ + inline double getMinPolygonAreaThreshold() const { + return minPolygonAreaThreshold; + } + /*! Get the near clipping distance. @@ -164,6 +197,7 @@ public: virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node); void read_camera (xmlDocPtr doc, xmlNodePtr node); void read_face(xmlDocPtr doc, xmlNodePtr node); + void read_lod (xmlDocPtr doc, xmlNodePtr node); /*! Set the angle to determine if a face appeared. diff --git a/src/tracking/mbt/edge/vpMbtDistanceCircle.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceCircle.h similarity index 78% rename from src/tracking/mbt/edge/vpMbtDistanceCircle.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceCircle.h index 07aa075e9200d008d104a7324503901c2e8365e9..a6b760ae57d2a54371ea11a6aa81203f68294583 100644 --- a/src/tracking/mbt/edge/vpMbtDistanceCircle.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceCircle.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMbtDistanceCircle.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -46,19 +43,19 @@ #ifndef vpMbtDistanceCircle_HH #define vpMbtDistanceCircle_HH -#include <visp/vpPoint.h> -#include <visp/vpMbtMeEllipse.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeatureEllipse.h> -#include <visp/vpCircle.h> -#include <visp/vpMbHiddenFaces.h> +#include <visp3/core/vpPoint.h> +#include <visp3/mbt/vpMbtMeEllipse.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeatureEllipse.h> +#include <visp3/core/vpCircle.h> +#include <visp3/mbt/vpMbHiddenFaces.h> /*! \class vpMbtDistanceCircle \brief Manage a circle used in the model-based tracker. - \ingroup ModelBasedTracking + \ingroup group_mbt_features */ class VISP_EXPORT vpMbtDistanceCircle { @@ -72,6 +69,7 @@ class VISP_EXPORT vpMbtDistanceCircle vpFeatureEllipse featureEllipse ; //! Polygon describing the circle bbox // vpMbtPolygon poly; + bool isTrackedCircle; public: //! The moving edge containers @@ -105,6 +103,23 @@ class VISP_EXPORT vpMbtDistanceCircle //! Indicates if the circle is visible or not bool isvisible; +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpMbtDistanceCircle(const vpMbtDistanceCircle &) +// : name(), index(0), cam(), me(NULL), wmean(1), +// featureEllipse(), isTrackedCircle(true), meEllipse(NULL), +// circle(NULL), radius(0.), p1(NULL), p2(NULL), p3(NULL), +// L(), error(), nbFeature(0), Reinit(false), +// hiddenface(NULL), index_polygon(-1), isvisible(false) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpMbtDistanceCircle &operator=(const vpMbtDistanceCircle &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: vpMbtDistanceCircle() ; ~vpMbtDistanceCircle() ; @@ -156,6 +171,12 @@ class VISP_EXPORT vpMbtDistanceCircle void initInteractionMatrixError(); bool initMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo); + /*! + Return if the circle is used for tracking. + + \return True if it is used, False otherwise. + */ + inline bool isTracked() const {return isTrackedCircle;} /*! Check if the circle is visible in the image or not. @@ -171,6 +192,13 @@ class VISP_EXPORT vpMbtDistanceCircle \param camera : The camera parameters. */ inline void setCameraParameters(const vpCameraParameters& camera) {this->cam = camera;} + + /*! + Set if the circle has to considered during tracking phase. + + \param track : True if the circle has to be tracked, False otherwise. + */ + inline void setTracked(const bool& track) {this->isTrackedCircle = track;} /*! Set the index of the circle. diff --git a/src/tracking/mbt/edge/vpMbtDistanceCylinder.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceCylinder.h old mode 100755 new mode 100644 similarity index 79% rename from src/tracking/mbt/edge/vpMbtDistanceCylinder.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceCylinder.h index 0c272b9ce5090aeeb5374df7cbe754e89ca1fefe..90ab15bd2aefa0ad2600908030b9e53d4e93b39e --- a/src/tracking/mbt/edge/vpMbtDistanceCylinder.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceCylinder.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMbtDistanceCylinder.h 4914 2014-10-02 13:25:47Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -49,21 +46,21 @@ #ifndef vpMbtDistanceCylinder_HH #define vpMbtDistanceCylinder_HH -#include <visp/vpPoint.h> -#include <visp/vpMbtMeLine.h> -#include <visp/vpLine.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpCylinder.h> -#include <visp/vpCircle.h> -#include <visp/vpMbHiddenFaces.h> +#include <visp3/core/vpPoint.h> +#include <visp3/mbt/vpMbtMeLine.h> +#include <visp3/core/vpLine.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/core/vpCylinder.h> +#include <visp3/core/vpCircle.h> +#include <visp3/mbt/vpMbHiddenFaces.h> /*! \class vpMbtDistanceCylinder \brief Manage a cylinder used in the model-based tracker. - \ingroup ModelBasedTracking + \ingroup group_mbt_features */ class VISP_EXPORT vpMbtDistanceCylinder { @@ -72,11 +69,11 @@ class VISP_EXPORT vpMbtDistanceCylinder unsigned int index; vpCameraParameters cam; vpMe *me; - double alpha; double wmean1; double wmean2; vpFeatureLine featureline1 ; vpFeatureLine featureline2 ; + bool isTrackedCylinder; public: //! The moving edge containers (first line of the cylinder) @@ -119,6 +116,23 @@ class VISP_EXPORT vpMbtDistanceCylinder //! Indicates if the cylinder is visible or not bool isvisible; +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpMbtDistanceCylinder(const vpMbtDistanceCylinder &) +// : name(), index(0), cam(), me(NULL), wmean1(1), wmean2(1), +// featureline1(), featureline2(), isTrackedCylinder(true), meline1(NULL), meline2(NULL), +// cercle1(NULL), cercle2(NULL), radius(0), p1(NULL), p2(NULL), L(), +// error(), nbFeature(0), nbFeaturel1(0), nbFeaturel2(0), Reinit(false), +// c(NULL), hiddenface(NULL), index_polygon(-1), isvisible(false) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpMbtDistanceCylinder &operator=(const vpMbtDistanceCylinder &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: vpMbtDistanceCylinder() ; ~vpMbtDistanceCylinder() ; @@ -171,6 +185,13 @@ class VISP_EXPORT vpMbtDistanceCylinder void initInteractionMatrixError(); bool initMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo); + + /*! + Return if the cylinder is used for tracking. + + \return True if it is used, False otherwise. + */ + inline bool isTracked() const {return isTrackedCylinder;} /*! Check if the cylinder is visible in the image or not. @@ -186,6 +207,13 @@ class VISP_EXPORT vpMbtDistanceCylinder \param camera : The camera parameters. */ inline void setCameraParameters(const vpCameraParameters& camera) {this->cam = camera;} + + /*! + Set if the cylinder has to considered during tracking phase. + + \param track : True if the cylinder has to be tracked, False otherwise. + */ + inline void setTracked(const bool& track) {this->isTrackedCylinder = track;} /*! Set the index of the cylinder. @@ -236,7 +264,6 @@ class VISP_EXPORT vpMbtDistanceCylinder void updateMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo); private: - void getCylinderLineExtremity(double &i, double &j,double rho, double theta, vpCircle *circle); void project(const vpHomogeneousMatrix &cMo); } ; diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceKltCylinder.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceKltCylinder.h new file mode 100644 index 0000000000000000000000000000000000000000..b30e3ec70c775c2ee3c659ddfea29e5f5d75ba1c --- /dev/null +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceKltCylinder.h @@ -0,0 +1,212 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Klt cylinder, containing points of interest. + * + * Authors: + * Aurelien Yol + * + *****************************************************************************/ + +#ifndef vpMbtDistanceKltCylinder_h +#define vpMbtDistanceKltCylinder_h + +#include <visp3/core/vpConfig.h> + +#if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) + +#include <map> + +#include <visp3/core/vpPolygon3D.h> +#include <visp3/klt/vpKltOpencv.h> +#include <visp3/core/vpPlane.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpGEMM.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/mbt/vpMbHiddenFaces.h> +#include <visp3/core/vpCylinder.h> +#include <visp3/core/vpCircle.h> + +/*! + \class vpMbtDistanceKltCylinder + + \brief Implementation of a polygon of the model containing points of interest. It is used by the model-based tracker KLT, and hybrid. + + \warning This class is only available if OpenCV is installed, and used. + + \ingroup group_mbt_features +*/ +class VISP_EXPORT vpMbtDistanceKltCylinder +{ +private: + //! Pose at initialisation + vpHomogeneousMatrix c0Mo; + //! First extremity of the cylinder (used for display) + vpPoint p1Ext; + //! Second extremity of the cylinder (used for display) + vpPoint p2Ext; + //! Cylinder + vpCylinder cylinder; + //! The upper circle limiting the cylinder (used for display) + vpCircle circle1; + //! The lower circle limiting the cylinder (used for display) + vpCircle circle2; + //! Initial points and their ID + std::map<int, vpImagePoint> initPoints; + //! Initial points and their ID + std::map<int, vpPoint> initPoints3D; + //! Current points and their ID + std::map<int, vpImagePoint> curPoints; + //! Current points ID and their indexes + std::map<int, int> curPointsInd; + //! number of points detected + unsigned int nbPointsCur; + //! initial number of points + unsigned int nbPointsInit; + //! Minimal number of points to be tracked + unsigned int minNbPoint; + //! Boolean to know if there is enough point to be tracked + bool enoughPoints; + //! Camera parameters + vpCameraParameters cam; + //! Boolean to specify if the klt points have to be tracked or not + bool isTrackedKltCylinder; + +public: + //! Pointer to the polygon that define a face + std::vector<int> listIndicesCylinderBBox; + //! Pointer to the list of faces + vpMbHiddenFaces<vpMbtPolygon> *hiddenface; + //! Use scanline rendering + bool useScanLine; + +private: + double computeZ(const double &x, const double &y); + bool isTrackedFeature(const int id); + +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpMbtDistanceKltCylinder(const vpMbtDistanceKltCylinder &) +// : c0Mo(), p1Ext(), p2Ext(), cylinder(), circle1(), circle2(), +// initPoints(), initPoints3D(), curPoints(), curPointsInd(), +// nbPointsCur(0), nbPointsInit(0), minNbPoint(4), enoughPoints(false), +// cam(), isTrackedKltCylinder(true), listIndicesCylinderBBox(), hiddenface(NULL), useScanLine(false) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpMbtDistanceKltCylinder &operator=(const vpMbtDistanceKltCylinder &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + +public: + vpMbtDistanceKltCylinder(); + virtual ~vpMbtDistanceKltCylinder(); + + void buildFrom(const vpPoint &p1, const vpPoint &p2, const double &r); + + unsigned int computeNbDetectedCurrent(const vpKltOpencv& _tracker); + void computeInteractionMatrixAndResidu(const vpHomogeneousMatrix &cMc0, vpColVector& _R, vpMatrix& _J); + + void display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor col, const unsigned int thickness = 1, const bool displayFullModel = false); + void display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor col, const unsigned int thickness = 1, const bool displayFullModel = false); + + void displayPrimitive(const vpImage<unsigned char>& _I); + void displayPrimitive(const vpImage<vpRGBa>& _I); + + /*! + Get the camera parameters of the face. + + \return cam : the camera parameters of the face. + */ + inline vpCameraParameters& getCameraParameters(){ return cam; } + + inline std::map<int, vpImagePoint>& getCurrentPoints() {return curPoints; } + + inline std::map<int, int>& getCurrentPointsInd() {return curPointsInd; } + + /*! + Get the number of point that was belonging to the face at the initialisation + + \return the number of initial point. + + \sa getCurrentNumberPoints() + */ + inline unsigned int getInitialNumberPoint() const { return nbPointsInit;} + /*! + Get the number of points detected in the last image. + + \warning To have the real number of points, the function computeNbDetectedCurrent() + must be called first. + + \return the number of points detected in the current image. + + \sa getInitialNumberPoint() + */ + inline unsigned int getCurrentNumberPoints() const {return nbPointsCur;} + + inline bool hasEnoughPoints() const {return enoughPoints;} + + /*! + Return if the klt cylinder is used for tracking. + + \return True if it is used, False otherwise. + */ + inline bool isTracked() const {return isTrackedKltCylinder;} + + void init(const vpKltOpencv& _tracker, const vpHomogeneousMatrix &cMo); + + void removeOutliers(const vpColVector& weight, const double &threshold_outlier); + + /*! + Set the camera parameters + + \param _cam : the new camera parameters + */ + virtual inline void setCameraParameters(const vpCameraParameters& _cam){ cam = _cam; } + + /*! + Set if the klt cylinder has to be considered during tracking phase. + + \param track : True if is has to be tracked, False otherwise. + */ + inline void setTracked(const bool& track) {this->isTrackedKltCylinder = track;} + +#if (VISP_HAVE_OPENCV_VERSION >= 0x020408) + void updateMask(cv::Mat &mask, unsigned char _nb = 255, unsigned int _shiftBorder = 0); +#else + void updateMask(IplImage* mask, unsigned char _nb = 255, unsigned int _shiftBorder = 0); +#endif +}; + +#endif + +#endif // VISP_HAVE_OPENCV diff --git a/src/tracking/mbt/klt/vpMbtDistanceKltPoints.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceKltPoints.h similarity index 67% rename from src/tracking/mbt/klt/vpMbtDistanceKltPoints.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceKltPoints.h index 5bcf43dfd3f7cb9352234c98a783c41fd90ae2b2..4bb687a240b46d511bb3ede7f18c884bbda3cb75 100644 --- a/src/tracking/mbt/klt/vpMbtDistanceKltPoints.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceKltPoints.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMbtDistanceKltPoints.h 4661 2014-02-10 19:34:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -42,20 +39,19 @@ #ifndef vpMbtDistanceKltPoints_h #define vpMbtDistanceKltPoints_h -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> -#if (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) +#if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) #include <map> -#include <visp/vpMbtPolygon.h> -#include <visp/vpKltOpencv.h> -#include <visp/vpPlane.h> -#include <visp/vpDisplay.h> -#include <visp/vpGEMM.h> -#include <visp/vpHomography.h> -#include <visp/vpPlot.h> -#include <visp/vpMbHiddenFaces.h> +#include <visp3/core/vpPolygon3D.h> +#include <visp3/klt/vpKltOpencv.h> +#include <visp3/core/vpPlane.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpGEMM.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/mbt/vpMbHiddenFaces.h> /*! \class vpMbtDistanceKltPoints @@ -64,7 +60,7 @@ \warning This class is only available if OpenCV is installed, and used. - \ingroup ModelBasedTracking + \ingroup group_mbt_features */ class VISP_EXPORT vpMbtDistanceKltPoints { @@ -99,10 +95,16 @@ private: double d0; //! Camera parameters vpCameraParameters cam; + //! Boolean to specify if the klt points have to be tracked or not + bool isTrackedKltPoints; public: //! Pointer to the polygon that define a face vpMbtPolygon *polygon; + //! Pointer to the list of faces + vpMbHiddenFaces<vpMbtPolygon> *hiddenface; + //! Use scanline rendering + bool useScanLine; private: @@ -110,6 +112,21 @@ private: void computeP_mu_t(const double x_in, const double y_in, double& x_out, double& y_out, const vpMatrix& cHc0); bool isTrackedFeature(const int id); +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpMbtDistanceKltPoints(const vpMbtDistanceKltPoints &) +// : H(), N(), N_cur(), invd0(1.), cRc0_0n(), initPoints(), curPoints(), curPointsInd(), +// nbPointsCur(0), nbPointsInit(0), minNbPoint(4), enoughPoints(false), dt(1.), d0(1.), +// cam(), isTrackedKltPoints(true), polygon(NULL), hiddenface(NULL), useScanLine(false) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpMbtDistanceKltPoints &operator=(const vpMbtDistanceKltPoints &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: vpMbtDistanceKltPoints(); virtual ~vpMbtDistanceKltPoints(); @@ -118,6 +135,9 @@ public: void computeHomography(const vpHomogeneousMatrix& _cTc0, vpHomography& cHc0); void computeInteractionMatrixAndResidu(vpColVector& _R, vpMatrix& _J); + void display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor col, const unsigned int thickness = 1, const bool displayFullModel = false); + void display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor col, const unsigned int thickness = 1, const bool displayFullModel = false); + void displayPrimitive(const vpImage<unsigned char>& _I); void displayPrimitive(const vpImage<vpRGBa>& _I); @@ -158,6 +178,13 @@ public: void init(const vpKltOpencv& _tracker); + /*! + Return if the klt points are used for tracking. + + \return True if it is used, False otherwise. + */ + inline bool isTracked() const {return isTrackedKltPoints;} + void removeOutliers(const vpColVector& weight, const double &threshold_outlier); /*! @@ -167,36 +194,18 @@ public: */ virtual inline void setCameraParameters(const vpCameraParameters& _cam){ cam = _cam; } + /*! + Set if the klt points have to considered during tracking phase. + + \param track : True if they have to be tracked, False otherwise. + */ + inline void setTracked(const bool& track) {this->isTrackedKltPoints = track;} + #if (VISP_HAVE_OPENCV_VERSION >= 0x020408) void updateMask(cv::Mat &mask, unsigned char _nb = 255, unsigned int _shiftBorder = 0); #else void updateMask(IplImage* mask, unsigned char _nb = 255, unsigned int _shiftBorder = 0); #endif - - //################### - // Deprecated Functions - //################### -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -public: - /*! - \deprecated Use rather getCurrentNumberPoints() that does the same. - - Get the number of points detected in the last image. - - \warning to have the real number of points, the function computeNbDetectedCurrent() - must be called first. - - \return the number of points detected in the current image - */ - vp_deprecated inline unsigned int getNbPointsCur() const {return nbPointsCur;} -#endif - - //################### - // Static Functions - //################### -private: - static bool isInside(const std::vector<vpImagePoint>& roi, const double i, const double j); - static bool intersect(const vpImagePoint& p1, const vpImagePoint& p2, const double i, const double j, const double i_test, const double j_test); }; #endif diff --git a/src/tracking/mbt/edge/vpMbtDistanceLine.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceLine.h similarity index 73% rename from src/tracking/mbt/edge/vpMbtDistanceLine.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceLine.h index 336e27d52ff9fce713cbbdf7688ca8a8a75f6b8e..9324ed8d8af558fdd6818514d70b558d1902d5a3 100644 --- a/src/tracking/mbt/edge/vpMbtDistanceLine.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtDistanceLine.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbtDistanceLine.h 4802 2014-07-24 09:24:43Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Manage the line of a polygon used in the model-based tracker. * @@ -49,12 +45,12 @@ #ifndef vpMbtDistanceLine_HH #define vpMbtDistanceLine_HH -#include <visp/vpPoint.h> -#include <visp/vpMbtMeLine.h> -#include <visp/vpLine.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpMbHiddenFaces.h> +#include <visp3/core/vpPoint.h> +#include <visp3/mbt/vpMbtMeLine.h> +#include <visp3/core/vpLine.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/mbt/vpMbHiddenFaces.h> #include <list> @@ -63,7 +59,7 @@ \brief Manage the line of a polygon used in the model-based tracker. - \ingroup ModelBasedTracking + \ingroup group_mbt_features */ class VISP_EXPORT vpMbtDistanceLine @@ -73,15 +69,19 @@ class VISP_EXPORT vpMbtDistanceLine unsigned int index; vpCameraParameters cam; vpMe *me; - double alpha; + bool isTrackedLine; + bool isTrackedLineWithVisibility; double wmean; vpFeatureLine featureline ; //! Polygon describing the line vpMbtPolygon poly; public: + //! Use scanline rendering + bool useScanLine; //! The moving edge container - vpMbtMeLine *meline; + //vpMbtMeLine *meline; + std::vector<vpMbtMeLine*> meline; //! The 3D line vpLine *line; //! The first extremity @@ -93,20 +93,43 @@ class VISP_EXPORT vpMbtDistanceLine //! The error vector vpColVector error; //! The number of moving edges - unsigned int nbFeature; + //unsigned int nbFeature; + std::vector<unsigned int> nbFeature; + //! The number of moving edges + unsigned int nbFeatureTotal; //! Indicates if the line has to be reinitialized bool Reinit; //! Pointer to the list of faces vpMbHiddenFaces<vpMbtPolygon> *hiddenface; //! Index of the faces which contain the line std::list<int> Lindex_polygon; + //! Vector of bool associated with Lindex_polygon to know if Lindex_polygon[i] is tracked + std::vector<bool> Lindex_polygon_tracked; //! Indicates if the line is visible or not bool isvisible; +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpMbtDistanceLine(const vpMbtDistanceLine &) +// : name(), index(0), cam(), me(NULL), isTrackedLine(true), isTrackedLineWithVisibility(true), +// wmean(1), featureline(), poly(), useScanLine(false), meline(), line(NULL), p1(NULL), p2(NULL), L(), +// error(), nbFeature(), nbFeatureTotal(0), Reinit(false), hiddenface(NULL), Lindex_polygon(), +// Lindex_polygon_tracked(), isvisible(false) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpMbtDistanceLine &operator=(const vpMbtDistanceLine &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: vpMbtDistanceLine() ; ~vpMbtDistanceLine() ; + void addPolygon(const int &index); + void buildFrom(vpPoint &_p1, vpPoint &_p2); bool closeToImageBorder(const vpImage<unsigned char>& I, const unsigned int threshold); @@ -155,6 +178,13 @@ class VISP_EXPORT vpMbtDistanceLine void initInteractionMatrixError(); bool initMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo); + + /*! + Return if the line is used for tracking. + + \return True if it is used, False otherwise. + */ + inline bool isTracked() const {return isTrackedLineWithVisibility;} /*! Check if the line is visible in the image or not. @@ -201,17 +231,21 @@ class VISP_EXPORT vpMbtDistanceLine */ inline void setName(const char* line_name) {this->name = std::string(line_name);} + void setTracked(const std::string &name, const bool &track); + /*! Set a boolean parameter to indicates if the line is visible in the image or not. \param _isvisible : Set to true if the line is visible */ - inline void setVisible(bool _isvisible) {isvisible = _isvisible ;} + void setVisible(bool _isvisible) {isvisible = _isvisible ; } void trackMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo); void updateMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo); + void updateTracked(); + private: void project(const vpHomogeneousMatrix &cMo); } ; diff --git a/src/tracking/mbt/hybrid/vpMbtEdgeKltXmlParser.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtEdgeKltXmlParser.h similarity index 80% rename from src/tracking/mbt/hybrid/vpMbtEdgeKltXmlParser.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbtEdgeKltXmlParser.h index 06208bebd1ac4347522f080044dd45e36aa9d0cc..ef1760f028b285dcf6a1217fa127c00fc9006730 100644 --- a/src/tracking/mbt/hybrid/vpMbtEdgeKltXmlParser.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtEdgeKltXmlParser.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbtEdgeKltXmlParser.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Load XML parameters of the Model based tracker (using edges and point features). * @@ -47,19 +43,19 @@ #ifndef vpMbtEdgeKltXmlParser_HH #define vpMbtEdgeKltXmlParser_HH -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */ -#include <visp/vpMbtXmlParser.h> -#include <visp/vpMbtKltXmlParser.h> +#include <visp3/mbt/vpMbtXmlParser.h> +#include <visp3/mbt/vpMbtKltXmlParser.h> /*! \class vpMbtEdgeKltXmlParser \brief Parse an Xml file to extract configuration parameters of a mbtConfig object. - \ingroup ModelBasedTracking + \ingroup group_mbt_xml_parser Data parser for the model based tracker. @@ -72,7 +68,7 @@ protected: face, klt, ecm, - sample + lod } dataToParseMbtEdgeKlt; public: diff --git a/src/tracking/mbt/klt/vpMbtKltXmlParser.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtKltXmlParser.h similarity index 91% rename from src/tracking/mbt/klt/vpMbtKltXmlParser.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbtKltXmlParser.h index 0de55c7eb220e1f34365c6ba394c1a5bf387f61e..fcbe33511976e104f6fe2e545ba66cd09e4f63d7 100644 --- a/src/tracking/mbt/klt/vpMbtKltXmlParser.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtKltXmlParser.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbtKltXmlParser.h 4582 2014-01-14 14:02:46Z ayol $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Load XML parameters of the Model based tracker (using point features). * @@ -46,18 +42,18 @@ #ifndef vpMbtKltXmlParser_HH #define vpMbtKltXmlParser_HH -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */ -#include <visp/vpMbXmlParser.h> +#include <visp3/mbt/vpMbXmlParser.h> /*! \class vpMbtKltXmlParser \brief Parse an Xml file to extract configuration parameters of a Mbt Klt object. - \ingroup ModelBasedTracking + \ingroup group_mbt_xml_parser Data parser for the KLT model based tracker. diff --git a/src/tracking/mbt/edge/vpMbtMeEllipse.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtMeEllipse.h similarity index 89% rename from src/tracking/mbt/edge/vpMbtMeEllipse.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbtMeEllipse.h index 87f11b72388be7a99387b0c700b146b558ff144a..f2ccd255342bb82ccc452025ab5dcd941fd83788 100644 --- a/src/tracking/mbt/edge/vpMbtMeEllipse.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtMeEllipse.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbtMeEllipse.h 4705 2014-03-27 16:24:35Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -47,15 +43,15 @@ #ifndef vpMbtMeEllipse_HH #define vpMbtMeEllipse_HH -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpColVector.h> -#include <visp/vpMeTracker.h> -#include <visp/vpMeSite.h> -#include <visp/vpImagePoint.h> +#include <visp3/me/vpMeTracker.h> +#include <visp3/me/vpMeSite.h> +#include <visp3/core/vpImagePoint.h> -#include <visp/vpImage.h> -#include <visp/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpColor.h> #include <math.h> #include <list> @@ -64,7 +60,7 @@ /*! \class vpMbtMeEllipse - \ingroup TrackingImageME + \ingroup group_mbt_features \brief Class that tracks an ellipse moving edges. @@ -101,10 +97,10 @@ /* The code below shows how to use this class. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpMbtMeEllipse.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/mbt/vpMbtMeEllipse.h> +#include <visp3/core/vpImagePoint.h> int main() { @@ -148,6 +144,7 @@ public: vpMbtMeEllipse(const vpMbtMeEllipse &meellipse) ; virtual ~vpMbtMeEllipse() ; + void computeProjectionError(const vpImage<unsigned char>& _I, double &_sumErrorRad, unsigned int &_nbFeatures); void display(const vpImage<unsigned char>&I, vpColor col) ; void display(const vpImage<unsigned char>& I) {vpMeTracker::display(I);} //Shouldn't be here since it's already in vpMeTracker diff --git a/src/tracking/mbt/edge/vpMbtMeLine.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtMeLine.h similarity index 88% rename from src/tracking/mbt/edge/vpMbtMeLine.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbtMeLine.h index dac7d9f6c48a5e7ae8e2282583c973c8c7ee0c8d..d19c0f1c8c206226df94ed969a845ce47f9d79ca 100644 --- a/src/tracking/mbt/edge/vpMbtMeLine.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtMeLine.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbtMeLine.h 4740 2014-05-26 07:15:44Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation of a line used by the model-based tracker. * @@ -49,16 +45,16 @@ #ifndef vpMbtMeLine_HH #define vpMbtMeLine_HH -#include <visp/vpPoint.h> -#include <visp/vpMe.h> -#include <visp/vpMeTracker.h> +#include <visp3/core/vpPoint.h> +#include <visp3/me/vpMe.h> +#include <visp3/me/vpMeTracker.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS /*! \class vpMbtMeLine \brief Implementation of a line used by the model-based tracker. - \ingroup ModelBasedTracking + \ingroup group_mbt_features */ class VISP_EXPORT vpMbtMeLine : public vpMeTracker @@ -78,6 +74,8 @@ class VISP_EXPORT vpMbtMeLine : public vpMeTracker public: vpMbtMeLine(); ~vpMbtMeLine(); + + void computeProjectionError(const vpImage<unsigned char>& _I, double &_sumErrorRad, unsigned int &_nbFeatures); void display(const vpImage<unsigned char>& /*I*/, vpColor /*col*/) {;} void display(const vpImage<unsigned char>& I) {vpMeTracker::display(I);} //Shouldn't be here since it's already in vpMeTracker diff --git a/modules/tracker/mbt/include/visp3/mbt/vpMbtPolygon.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtPolygon.h new file mode 100644 index 0000000000000000000000000000000000000000..a68ea6f1abcf1d45fb6fc93a48a11c104439380c --- /dev/null +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtPolygon.h @@ -0,0 +1,167 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Implements a polygon of the model used by the model-based tracker. + * + * Authors: + * Nicolas Melchior + * Romain Tallonneau + * Eric Marchand + * Aurelien Yol + * + *****************************************************************************/ + +/*! + \file vpMbtPolygon.h + \brief Implements a polygon of the model used by the model-based tracker. +*/ + +#ifndef vpMbtPolygon_HH +#define vpMbtPolygon_HH + +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/core/vpPolygon3D.h> + +#include <vector> + +/*! + \class vpMbtPolygon + + \brief Implementation of a polygon of the model used by the model-based tracker. + + \ingroup group_mbt_faces + + */ +class VISP_EXPORT vpMbtPolygon : public vpPolygon3D +{ +public: + //! Index of the polygon. Cannot be unsigned int because default value is -1. + int index; + //! flag to specify whether the face is visible or not + bool isvisible; + //! flag to specify whether the face is appearing or not + bool isappearing; + //! Flag to specify if the visibility of the polygon depends also of the current level of detail (LOD) + bool useLod; + //! Threshold for minimum line length in pixel to consider if the line is visible or not in LOD case + double minLineLengthThresh; + //! Threshold for minimum polygon area in pixel to consider if the polygon is visible or not in LOD case + double minPolygonAreaThresh; + //! Name of the polygon + std::string name; + //! Boolean that specify if the polygon has an orientation or not (mainly used for cylinders) + bool hasOrientation; + +public: + vpMbtPolygon() ; + vpMbtPolygon(const vpMbtPolygon& mbtp) ; + virtual ~vpMbtPolygon() ; + + /*! + Get the index of the face. + + \return index : the index of the face. + */ + inline int getIndex() const {return index ;} + + /*! + Get the name of the face. + + \return Name of the face. + */ + inline std::string getName() const {return name;} + + inline bool isAppearing() const {return isappearing;} + inline bool isPolygonOriented() { return hasOrientation; } + virtual bool isVisible(const vpHomogeneousMatrix &cMo, const double alpha, const bool &modulo = false, + const vpCameraParameters &cam = vpCameraParameters(), const vpImage<unsigned char> &I = vpImage<unsigned char>()); + bool isVisible() const {return isvisible;} + + vpMbtPolygon& operator=(const vpMbtPolygon& mbtp) ; + + /*! + Set the index of the face. + + \param i : the new index of the face. + */ + virtual inline void setIndex(const int i ) { index = i ; } + + // Due to a doxygen warning include the sample code in the doc, we remove the inline and put the doc in the *.cpp file + void setLod(const bool use_lod); + /*! + Set the threshold for the minimum line length to be considered as visible in the LOD + (level of detail) case. This threshold is only used when setLoD() is turned on. + + \param min_line_length : threshold for the minimum line length in pixel. When a single line that doesn't + belong to a face is considered by the tracker, this line is tracked only if its lenght in pixel is + greater than \e min_line_length. + + \sa setLoD() + */ + inline void setMinLineLengthThresh(const double min_line_length) { + this->minLineLengthThresh = min_line_length; + } + /*! + Set the minimum polygon area to be considered as visible in the LOD (level of detail) + case. This threshold is only used when setLoD() is turned on. + + \param min_polygon_area : threshold for the minimum polygon area in pixel. When a face + is considered by the tracker, this face is tracked only if its area in pixel is + greater than \e min_polygon_area. + + \sa setLoD() + */ + inline void setMinPolygonAreaThresh(const double min_polygon_area) { + this->minPolygonAreaThresh = min_polygon_area; + } + + /*! + Set the name of the face. + + \param face_name : name of the face. + */ + inline void setName(const std::string &face_name) { + this->name = face_name; + } + + /*! + Set if the polygon is oriented or not. + + \param oriented : True if the polygon is oriented, false otherwise. + */ + inline void setIsPolygonOriented(const bool &oriented) { + this->hasOrientation = oriented; + } +}; + +#endif + diff --git a/src/tracking/mbt/edge/vpMbtXmlParser.h b/modules/tracker/mbt/include/visp3/mbt/vpMbtXmlParser.h similarity index 63% rename from src/tracking/mbt/edge/vpMbtXmlParser.h rename to modules/tracker/mbt/include/visp3/mbt/vpMbtXmlParser.h index 75e3dd8db1344c1c2001a6020033e4b6fc3d684f..7d2810d24d77177963ea73e7def8585a9b390b52 100644 --- a/src/tracking/mbt/edge/vpMbtXmlParser.h +++ b/modules/tracker/mbt/include/visp3/mbt/vpMbtXmlParser.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbtXmlParser.h 5054 2014-12-11 17:50:44Z strinh $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Load XML parameters of the Model based tracker (using edges). * @@ -50,19 +46,19 @@ #ifndef vpMbtXmlParser_HH #define vpMbtXmlParser_HH -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */ -#include <visp/vpMbXmlParser.h> -#include <visp/vpMe.h> +#include <visp3/mbt/vpMbXmlParser.h> +#include <visp3/me/vpMe.h> /*! \class vpMbtXmlParser \brief Parse an Xml file to extract configuration parameters of a mbtConfig object. - \ingroup ModelBasedTracking + \ingroup group_mbt_xml_parser Data parser for the model based tracker. @@ -83,22 +79,11 @@ protected: mu2, sample, step, - nb_sample, - lod, - use_lod, - min_line_length_threshold, - min_polygon_area_threshold, last } dataToParseMb; //! Moving edges parameters. vpMe m_ecm; - //! If true, the LOD is enabled, otherwise it is not - bool useLod; - //! Minimum line length to track a segment when LOD is enabled - double minLineLengthThreshold; - //! Minimum polygon area to track a face when LOD is enabled - double minPolygonAreaThreshold; public: @@ -106,44 +91,17 @@ public: vpMbtXmlParser(); virtual ~vpMbtXmlParser(); - /*! - Get the state of LOD setting. - - \return True if LOD is enabled, false otherwise. - */ - inline bool getLodState() const { - return useLod; - } - void getMe(vpMe& _ecm) const { _ecm = this->m_ecm;} - - /*! - Get the minimum line length to track a segment when LOD is enabled. - - \return The minimum line length. - */ - inline double getMinLineLengthThreshold() const { - return minLineLengthThreshold; - } - - /*! - Get the minimum polygon area to track a face when LOD is enabled. - - \return The minimum polygon area. - */ - inline double getMinPolygonAreaThreshold() const { - return minPolygonAreaThreshold; - } void parse(const char * filename); virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node); void read_ecm (xmlDocPtr doc, xmlNodePtr node); void read_sample (xmlDocPtr doc, xmlNodePtr node); + void read_sample_deprecated (xmlDocPtr doc, xmlNodePtr node); void read_mask (xmlDocPtr doc, xmlNodePtr node); void read_range (xmlDocPtr doc, xmlNodePtr node); void read_contrast (xmlDocPtr doc, xmlNodePtr node); - void read_lod (xmlDocPtr doc, xmlNodePtr node); void setMovingEdge(const vpMe &_ecm){ m_ecm = _ecm; } diff --git a/src/tracking/mbt/edge/vpMbEdgeTracker.cpp b/modules/tracker/mbt/src/edge/vpMbEdgeTracker.cpp similarity index 67% rename from src/tracking/mbt/edge/vpMbEdgeTracker.cpp rename to modules/tracker/mbt/src/edge/vpMbEdgeTracker.cpp index 259a0c1409fcd24c9b14e7d935873b8981323cd8..0696a03661da5da18f0775df5f166f72eb4da73e 100644 --- a/src/tracking/mbt/edge/vpMbEdgeTracker.cpp +++ b/modules/tracker/mbt/src/edge/vpMbEdgeTracker.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbEdgeTracker.cpp 5285 2015-02-09 14:32:54Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Make the complete tracking of an object by using its CAD model * @@ -46,24 +42,20 @@ \brief Make the complete tracking of an object by using its CAD model. */ -#include <visp/vpDebug.h> -#include <visp/vpPose.h> -#include <visp/vpExponentialMap.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpImageIo.h> -#include <visp/vpRobust.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpMatrixException.h> -#include <visp/vpMath.h> -#include <visp/vpException.h> -#include <visp/vpTrackingException.h> -#include <visp/vpMbEdgeTracker.h> -#include <visp/vpMbtDistanceLine.h> -#include <visp/vpMbtXmlParser.h> -#include <visp/vpMbtPolygon.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/core/vpDebug.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpExponentialMap.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/core/vpRobust.h> +#include <visp3/core/vpMatrixException.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpTrackingException.h> +#include <visp3/mbt/vpMbEdgeTracker.h> +#include <visp3/mbt/vpMbtDistanceLine.h> +#include <visp3/mbt/vpMbtXmlParser.h> +#include <visp3/core/vpPolygon3D.h> +#include <visp3/core/vpVelocityTwistMatrix.h> #include <limits> #include <string> @@ -100,7 +92,7 @@ vpMbEdgeTracker::~vpMbEdgeTracker() vpMbtDistanceCylinder *cy; vpMbtDistanceCircle *ci; - for (unsigned int i = 0; i < lines.size(); i += 1){ + for (unsigned int i = 0; i < scales.size(); i += 1){ if(scales[i]){ for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[i].begin(); it!=lines[i].end(); ++it){ l = *it; @@ -202,24 +194,37 @@ vpMbEdgeTracker::computeVVS(const vpImage<unsigned char>& _I) unsigned int nberrors_circles = 0; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ + l = *it; - nbrow += l->nbFeature; - nberrors_lines+=l->nbFeature; - l->initInteractionMatrixError(); + + if(l->isVisible() && l->isTracked()) + { + nbrow += l->nbFeatureTotal; + nberrors_lines+=l->nbFeatureTotal; + l->initInteractionMatrixError(); + } } for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ cy = *it; - nbrow += cy->nbFeature ; - nberrors_cylinders += cy->nbFeature ; - cy->initInteractionMatrixError() ; + + if(cy->isVisible() && cy->isTracked()) + { + nbrow += cy->nbFeature ; + nberrors_cylinders += cy->nbFeature ; + cy->initInteractionMatrixError() ; + } } for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ ci = *it; - nbrow += ci->nbFeature ; - nberrors_circles += ci->nbFeature ; - ci->initInteractionMatrixError() ; + + if(ci->isVisible() && ci->isTracked()) + { + nbrow += ci->nbFeature ; + nberrors_circles += ci->nbFeature ; + ci->initInteractionMatrixError() ; + } } if (nbrow==0){ @@ -242,6 +247,8 @@ vpMbEdgeTracker::computeVVS(const vpImage<unsigned char>& _I) double count = 0; bool isoJoIdentity_ = isoJoIdentity; // Backup since it can be modified if L is not full rank + if (isoJoIdentity_) + oJo.eye(); /*** First phase ***/ @@ -261,267 +268,282 @@ vpMbEdgeTracker::computeVVS(const vpImage<unsigned char>& _I) unsigned int n = 0; reloop = false; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ - l = *it; - l->computeInteractionMatrixError(cMo); - - double fac = 1; - if (iter == 0) + if((*it)->isTracked()) { - for(std::list<int>::const_iterator itindex = l->Lindex_polygon.begin(); itindex!=l->Lindex_polygon.end(); ++itindex){ - int index = *itindex; - if (l->hiddenface->isAppearing((unsigned int)index)) - { - fac = 0.2; - break; - } - if(l->closeToImageBorder(_I, 10)) - { - fac = 0.1; - break; - } - } - } - - std::list<vpMeSite>::const_iterator itListLine; - if (iter == 0 && l->meline != NULL) - itListLine = l->meline->getMeList().begin(); - - for (unsigned int i=0 ; i < l->nbFeature ; i++) - { - for (unsigned int j=0; j < 6 ; j++) + l = *it; + l->computeInteractionMatrixError(cMo); + + double fac = 1; + if (iter == 0) { - L[n+i][j] = l->L[i][j]; //On remplit la matrice d'interaction globale + for(std::list<int>::const_iterator itindex = l->Lindex_polygon.begin(); itindex!=l->Lindex_polygon.end(); ++itindex){ + int index = *itindex; + if (l->hiddenface->isAppearing((unsigned int)index)) + { + fac = 0.2; + break; + } + if(l->closeToImageBorder(_I, 10)) + { + fac = 0.1; + break; + } + } } - m_error[n+i] = l->error[i]; //On remplit la matrice d'erreur - if (m_error[n+i] <= limite) count = count+1.0; //Si erreur proche de 0 on incremente cur + std::list<vpMeSite>::const_iterator itListLine; - m_w[n+i] = 0; + unsigned int indexFeature = 0; - if (iter == 0) + for(unsigned int a = 0 ; a < l->meline.size() ; a++) { - factor[n+i] = fac; - vpMeSite site = *itListLine; - if (site.getState() != vpMeSite::NO_SUPPRESSION) factor[n+i] = 0.2; - ++itListLine; - } + if (iter == 0 && l->meline[a] != NULL) + itListLine = l->meline[a]->getMeList().begin(); - //If pour la premiere extremite des moving edges - if (i == 0) - { - e_cur = l->error[0]; - if (l->nbFeature > 1) + for (unsigned int i=0 ; i < l->nbFeature[a] ; i++) { - e_next = l->error[1]; - if ( fabs(e_cur - e_next) < limite && vpMath::sign(e_cur) == vpMath::sign(e_next) ) + for (unsigned int j=0; j < 6 ; j++) { - m_w[n+i] = 1/*0.5*/; + L[n+i][j] = l->L[indexFeature][j]; //On remplit la matrice d'interaction globale } - e_prev = e_cur; - } - else m_w[n+i] = 1; - } + m_error[n+i] = l->error[indexFeature]; //On remplit la matrice d'erreur - //If pour la derniere extremite des moving edges - else if(i == l->nbFeature-1) - { - e_cur = l->error[i]; - if ( fabs(e_cur - e_prev) < limite && vpMath::sign(e_cur) == vpMath::sign(e_prev) ) - { - m_w[n+i] += 1/*0.5*/; - } - } + if (m_error[n+i] <= limite) count = count+1.0; //Si erreur proche de 0 on incremente cur - else - { - e_cur = l->error[i]; - e_next = l->error[i+1]; - if ( fabs(e_cur - e_prev) < limite ) - { - m_w[n+i] += 0.5; - } - if ( fabs(e_cur - e_next) < limite ) - { - m_w[n+i] += 0.5; + m_w[n+i] = 0; + + if (iter == 0) + { + factor[n+i] = fac; + vpMeSite site = *itListLine; + if (site.getState() != vpMeSite::NO_SUPPRESSION) factor[n+i] = 0.2; + ++itListLine; + } + + //If pour la premiere extremite des moving edges + if (indexFeature == 0) + { + e_cur = l->error[0]; + if (l->nbFeature[a] > 1) + { + e_next = l->error[1]; + if ( fabs(e_cur - e_next) < limite && vpMath::sign(e_cur) == vpMath::sign(e_next) ) + { + m_w[n+i] = 1/*0.5*/; + } + e_prev = e_cur; + } + else m_w[n+i] = 1; + } + + //If pour la derniere extremite des moving edges + else if(indexFeature == l->nbFeatureTotal-1) + { + e_cur = l->error[indexFeature]; + if ( fabs(e_cur - e_prev) < limite && vpMath::sign(e_cur) == vpMath::sign(e_prev) ) + { + m_w[n+i] += 1/*0.5*/; + } + } + + else + { + e_cur = l->error[indexFeature]; + e_next = l->error[indexFeature+1]; + if ( fabs(e_cur - e_prev) < limite ) + { + m_w[n+i] += 0.5; + } + if ( fabs(e_cur - e_next) < limite ) + { + m_w[n+i] += 0.5; + } + e_prev = e_cur; + } + indexFeature++; } - e_prev = e_cur; + n += l->nbFeature[a] ; } } - - n+= l->nbFeature ; } for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ - cy = *it; - cy->computeInteractionMatrixError(cMo, _I); - double fac = 1.0; - - std::list<vpMeSite>::const_iterator itCyl1; - std::list<vpMeSite>::const_iterator itCyl2; - if (iter == 0 && (cy->meline1 != NULL || cy->meline2 != NULL)){ - itCyl1 = cy->meline1->getMeList().begin(); - itCyl2 = cy->meline2->getMeList().begin(); - } - - for(unsigned int i=0 ; i < cy->nbFeature ; i++){ - for(unsigned int j=0; j < 6 ; j++){ - L[n+i][j] = cy->L[i][j]; //On remplit la matrice d'interaction globale + if((*it)->isTracked()) + { + cy = *it; + cy->computeInteractionMatrixError(cMo, _I); + double fac = 1.0; + + std::list<vpMeSite>::const_iterator itCyl1; + std::list<vpMeSite>::const_iterator itCyl2; + if (iter == 0 && (cy->meline1 != NULL || cy->meline2 != NULL)){ + itCyl1 = cy->meline1->getMeList().begin(); + itCyl2 = cy->meline2->getMeList().begin(); } - m_error[n+i] = cy->error[i]; //On remplit la matrice d'erreur - if (m_error[n+i] <= limite) count = count+1.0; //Si erreur proche de 0 on incremente cur + for(unsigned int i=0 ; i < cy->nbFeature ; i++){ + for(unsigned int j=0; j < 6 ; j++){ + L[n+i][j] = cy->L[i][j]; //On remplit la matrice d'interaction globale + } + m_error[n+i] = cy->error[i]; //On remplit la matrice d'erreur - m_w[n+i] = 0; + if (m_error[n+i] <= limite) count = count+1.0; //Si erreur proche de 0 on incremente cur - if (iter == 0) - { - factor[n+i] = fac; - vpMeSite site; - if(i<cy->nbFeaturel1) { - site= *itCyl1; - ++itCyl1; - } - else{ - site= *itCyl2; - ++itCyl2; + m_w[n+i] = 0; + + if (iter == 0) + { + factor[n+i] = fac; + vpMeSite site; + if(i<cy->nbFeaturel1) { + site= *itCyl1; + ++itCyl1; + } + else{ + site= *itCyl2; + ++itCyl2; + } + if (site.getState() != vpMeSite::NO_SUPPRESSION) factor[n+i] = 0.2; } - if (site.getState() != vpMeSite::NO_SUPPRESSION) factor[n+i] = 0.2; - } - //If pour la premiere extremite des moving edges - if (i == 0) - { - e_cur = cy->error[0]; - if (cy->nbFeature > 1) + //If pour la premiere extremite des moving edges + if (i == 0) { - e_next = cy->error[1]; - if ( fabs(e_cur - e_next) < limite && vpMath::sign(e_cur) == vpMath::sign(e_next) ) + e_cur = cy->error[0]; + if (cy->nbFeature > 1) { - m_w[n+i] = 1/*0.5*/; + e_next = cy->error[1]; + if ( fabs(e_cur - e_next) < limite && vpMath::sign(e_cur) == vpMath::sign(e_next) ) + { + m_w[n+i] = 1/*0.5*/; + } + e_prev = e_cur; } - e_prev = e_cur; + else m_w[n+i] = 1; } - else m_w[n+i] = 1; - } - if (i == cy->nbFeaturel1) - { - e_cur = cy->error[i]; - if (cy->nbFeaturel2 > 1) + if (i == cy->nbFeaturel1) { - e_next = cy->error[i+1]; - if ( fabs(e_cur - e_next) < limite && vpMath::sign(e_cur) == vpMath::sign(e_next) ) + e_cur = cy->error[i]; + if (cy->nbFeaturel2 > 1) { - m_w[n+i] = 1/*0.5*/; + e_next = cy->error[i+1]; + if ( fabs(e_cur - e_next) < limite && vpMath::sign(e_cur) == vpMath::sign(e_next) ) + { + m_w[n+i] = 1/*0.5*/; + } + e_prev = e_cur; } - e_prev = e_cur; + else m_w[n+i] = 1; } - else m_w[n+i] = 1; - } - //If pour la derniere extremite des moving edges - else if(i == cy->nbFeaturel1-1) - { - e_cur = cy->error[i]; - if ( fabs(e_cur - e_prev) < limite && vpMath::sign(e_cur) == vpMath::sign(e_prev) ) + //If pour la derniere extremite des moving edges + else if(i == cy->nbFeaturel1-1) { - m_w[n+i] += 1/*0.5*/; + e_cur = cy->error[i]; + if ( fabs(e_cur - e_prev) < limite && vpMath::sign(e_cur) == vpMath::sign(e_prev) ) + { + m_w[n+i] += 1/*0.5*/; + } } - } - //If pour la derniere extremite des moving edges - else if(i == cy->nbFeature-1) - { - e_cur = cy->error[i]; - if ( fabs(e_cur - e_prev) < limite && vpMath::sign(e_cur) == vpMath::sign(e_prev) ) + //If pour la derniere extremite des moving edges + else if(i == cy->nbFeature-1) { - m_w[n+i] += 1/*0.5*/; + e_cur = cy->error[i]; + if ( fabs(e_cur - e_prev) < limite && vpMath::sign(e_cur) == vpMath::sign(e_prev) ) + { + m_w[n+i] += 1/*0.5*/; + } } - } - else - { - e_cur = cy->error[i]; - e_next = cy->error[i+1]; - if ( fabs(e_cur - e_prev) < limite ){ - m_w[n+i] += 0.5; - } - if ( fabs(e_cur - e_next) < limite ){ - m_w[n+i] += 0.5; + else + { + e_cur = cy->error[i]; + e_next = cy->error[i+1]; + if ( fabs(e_cur - e_prev) < limite ){ + m_w[n+i] += 0.5; + } + if ( fabs(e_cur - e_next) < limite ){ + m_w[n+i] += 0.5; + } + e_prev = e_cur; } - e_prev = e_cur; } - } - n+= cy->nbFeature ; + n+= cy->nbFeature ; + } } for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ - ci = *it; - ci->computeInteractionMatrixError(cMo); - double fac = 1.0; - - std::list<vpMeSite>::const_iterator itCir; - if (iter == 0 && (ci->meEllipse != NULL)) { - itCir = ci->meEllipse->getMeList().begin(); - } + if((*it)->isTracked()) + { + ci = *it; + ci->computeInteractionMatrixError(cMo); + double fac = 1.0; - for(unsigned int i=0 ; i < ci->nbFeature ; i++){ - for(unsigned int j=0; j < 6 ; j++){ - L[n+i][j] = ci->L[i][j]; //On remplit la matrice d'interaction globale + std::list<vpMeSite>::const_iterator itCir; + if (iter == 0 && (ci->meEllipse != NULL)) { + itCir = ci->meEllipse->getMeList().begin(); } - m_error[n+i] = ci->error[i]; //On remplit la matrice d'erreur - if (m_error[n+i] <= limite) count = count+1.0; //Si erreur proche de 0 on incremente cur + for(unsigned int i=0 ; i < ci->nbFeature ; i++){ + for(unsigned int j=0; j < 6 ; j++){ + L[n+i][j] = ci->L[i][j]; //On remplit la matrice d'interaction globale + } + m_error[n+i] = ci->error[i]; //On remplit la matrice d'erreur - m_w[n+i] = 0; + if (m_error[n+i] <= limite) count = count+1.0; //Si erreur proche de 0 on incremente cur - if (iter == 0) - { - factor[n+i] = fac; - vpMeSite site = *itCir; - if (site.getState() != vpMeSite::NO_SUPPRESSION) factor[n+i] = 0.2; - ++itCir; - } + m_w[n+i] = 0; - //If pour la premiere extremite des moving edges - if (i == 0) - { - e_cur = ci->error[0]; - if (ci->nbFeature > 1) + if (iter == 0) { - e_next = ci->error[1]; - if ( fabs(e_cur - e_next) < limite && vpMath::sign(e_cur) == vpMath::sign(e_next) ) + factor[n+i] = fac; + vpMeSite site = *itCir; + if (site.getState() != vpMeSite::NO_SUPPRESSION) factor[n+i] = 0.2; + ++itCir; + } + + //If pour la premiere extremite des moving edges + if (i == 0) + { + e_cur = ci->error[0]; + if (ci->nbFeature > 1) { - m_w[n+i] = 1/*0.5*/; + e_next = ci->error[1]; + if ( fabs(e_cur - e_next) < limite && vpMath::sign(e_cur) == vpMath::sign(e_next) ) + { + m_w[n+i] = 1/*0.5*/; + } + e_prev = e_cur; } - e_prev = e_cur; + else m_w[n+i] = 1; } - else m_w[n+i] = 1; - } - //If pour la derniere extremite des moving edges - else if(i == ci->nbFeature-1) - { - e_cur = ci->error[i]; - if ( fabs(e_cur - e_prev) < limite && vpMath::sign(e_cur) == vpMath::sign(e_prev) ) + //If pour la derniere extremite des moving edges + else if(i == ci->nbFeature-1) { - m_w[n+i] += 1/*0.5*/; + e_cur = ci->error[i]; + if ( fabs(e_cur - e_prev) < limite && vpMath::sign(e_cur) == vpMath::sign(e_prev) ) + { + m_w[n+i] += 1/*0.5*/; + } } - } - else - { - e_cur = ci->error[i]; - e_next = ci->error[i+1]; - if ( fabs(e_cur - e_prev) < limite ){ - m_w[n+i] += 0.5; - } - if ( fabs(e_cur - e_next) < limite ){ - m_w[n+i] += 0.5; + else + { + e_cur = ci->error[i]; + e_next = ci->error[i+1]; + if ( fabs(e_cur - e_prev) < limite ){ + m_w[n+i] += 0.5; + } + if ( fabs(e_cur - e_next) < limite ){ + m_w[n+i] += 0.5; + } + e_prev = e_cur; } - e_prev = e_cur; } - } - n+= ci->nbFeature ; + n+= ci->nbFeature ; + } } count = count / (double)nbrow; @@ -579,7 +601,7 @@ vpMbEdgeTracker::computeVVS(const vpImage<unsigned char>& _I) cVo.buildFrom(cMo); vpMatrix LVJ = (L*cVo*oJo); vpMatrix LVJTLVJ = (LVJ).AtA(); - vpMatrix LVJTR; + vpColVector LVJTR; computeJTR(LVJ, weighted_error, LVJTR); v = -0.7*LVJTLVJ.pseudoInverse(LVJTLVJ.getRows()*std::numeric_limits<double>::epsilon())*LVJTR; v = cVo * v; @@ -613,6 +635,10 @@ vpMbEdgeTracker::computeVVS(const vpImage<unsigned char>& _I) vpColVector W_true; vpMatrix L_true; vpMatrix LVJ_true; + + double mu = 0.01; + vpColVector m_error_prev(nbrow); + vpColVector m_w_prev(nbrow); while ( ((int)((residu_1 - r)*1e8) !=0 ) && (iter<30)) { @@ -621,153 +647,218 @@ vpMbEdgeTracker::computeVVS(const vpImage<unsigned char>& _I) unsigned int ncylinders = 0; unsigned int ncircles = 0; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ - l = *it; - l->computeInteractionMatrixError(cMo) ; - for (unsigned int i=0 ; i < l->nbFeature ; i++){ - for (unsigned int j=0; j < 6 ; j++){ - L[n+i][j] = l->L[i][j]; - m_error[n+i] = l->error[i]; - error_lines[nlines+i] = m_error[n+i]; + if((*it)->isTracked()){ + l = *it; + l->computeInteractionMatrixError(cMo) ; + for (unsigned int i=0 ; i < l->nbFeatureTotal ; i++){ + for (unsigned int j=0; j < 6 ; j++){ + L[n+i][j] = l->L[i][j]; + m_error[n+i] = l->error[i]; + error_lines[nlines+i] = m_error[n+i]; + } } + n+= l->nbFeatureTotal; + nlines+= l->nbFeatureTotal; } - n+= l->nbFeature; - nlines+= l->nbFeature; } for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ - cy = *it; - cy->computeInteractionMatrixError(cMo, _I) ; - for(unsigned int i=0 ; i < cy->nbFeature ; i++){ - for(unsigned int j=0; j < 6 ; j++){ - L[n+i][j] = cy->L[i][j]; - m_error[n+i] = cy->error[i]; - error_cylinders[ncylinders+i] = m_error[n+i]; + if((*it)->isTracked()){ + cy = *it; + cy->computeInteractionMatrixError(cMo, _I) ; + for(unsigned int i=0 ; i < cy->nbFeature ; i++){ + for(unsigned int j=0; j < 6 ; j++){ + L[n+i][j] = cy->L[i][j]; + m_error[n+i] = cy->error[i]; + error_cylinders[ncylinders+i] = m_error[n+i]; + } } - } - n+= cy->nbFeature ; - ncylinders+= cy->nbFeature ; + n+= cy->nbFeature ; + ncylinders+= cy->nbFeature ; + } } for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ - ci = *it; - ci->computeInteractionMatrixError(cMo) ; - for(unsigned int i=0 ; i < ci->nbFeature ; i++){ - for(unsigned int j=0; j < 6 ; j++){ - L[n+i][j] = ci->L[i][j]; - m_error[n+i] = ci->error[i]; - error_circles[ncircles+i] = m_error[n+i]; + if((*it)->isTracked()){ + ci = *it; + ci->computeInteractionMatrixError(cMo) ; + for(unsigned int i=0 ; i < ci->nbFeature ; i++){ + for(unsigned int j=0; j < 6 ; j++){ + L[n+i][j] = ci->L[i][j]; + m_error[n+i] = ci->error[i]; + error_circles[ncircles+i] = m_error[n+i]; + } } - } - n+= ci->nbFeature ; - ncircles+= ci->nbFeature ; + n+= ci->nbFeature ; + ncircles+= ci->nbFeature ; + } } - if(iter==0) - { - weighted_error.resize(nerror); - m_w.resize(nerror); - m_w = 1; - w_lines.resize(nberrors_lines); - w_lines = 1; - w_cylinders.resize(nberrors_cylinders); - w_cylinders = 1; - w_circles.resize(nberrors_circles); - w_circles = 1; - - robust_lines.setThreshold(2/cam.get_px()); - robust_cylinders.setThreshold(2/cam.get_px()); - robust_circles.setThreshold(vpMath::sqr(2/cam.get_px())); - if(nberrors_lines > 0) - robust_lines.MEstimator(vpRobust::TUKEY, error_lines,w_lines); - if(nberrors_cylinders > 0) - robust_cylinders.MEstimator(vpRobust::TUKEY, error_cylinders,w_cylinders); - if(nberrors_circles > 0) - robust_circles.MEstimator(vpRobust::TUKEY, error_circles,w_circles); - } - else - { - robust_lines.setIteration(iter); - robust_cylinders.setIteration(iter); - robust_circles.setIteration(iter); - if(nberrors_lines > 0) - robust_lines.MEstimator(vpRobust::TUKEY, error_lines, w_lines); - if(nberrors_cylinders > 0) - robust_cylinders.MEstimator(vpRobust::TUKEY, error_cylinders,w_cylinders); - if(nberrors_circles > 0) - robust_circles.MEstimator(vpRobust::TUKEY, error_circles,w_circles); - } + bool reStartFromLastIncrement = false; + if(iter != 0 && m_optimizationMethod == vpMbTracker::LEVENBERG_MARQUARDT_OPT){ + if(m_error.sumSquare()/(double)nbrow > m_error_prev.sumSquare()/(double)nbrow){ + mu *= 10.0; - unsigned int cpt = 0; - while(cpt<nbrow){ - if(cpt<nberrors_lines){ - m_w[cpt] = w_lines[cpt]; + if(mu > 1.0) + throw vpTrackingException(vpTrackingException::fatalError, "Optimization diverged"); + + cMo = cMoPrev; + m_error = m_error_prev; + m_w = m_w_prev; + reStartFromLastIncrement = true; } - else if (cpt<nberrors_lines+nberrors_cylinders){ - m_w[cpt] = w_cylinders[cpt-nberrors_lines]; + } + + if(!reStartFromLastIncrement){ + if(iter==0) + { + weighted_error.resize(nerror); + m_w.resize(nerror); + m_w = 1; + w_lines.resize(nberrors_lines); + w_lines = 1; + w_cylinders.resize(nberrors_cylinders); + w_cylinders = 1; + w_circles.resize(nberrors_circles); + w_circles = 1; + + robust_lines.setThreshold(2/cam.get_px()); + robust_cylinders.setThreshold(2/cam.get_px()); + robust_circles.setThreshold(vpMath::sqr(2/cam.get_px())); + if(nberrors_lines > 0) + robust_lines.MEstimator(vpRobust::TUKEY, error_lines,w_lines); + if(nberrors_cylinders > 0) + robust_cylinders.MEstimator(vpRobust::TUKEY, error_cylinders,w_cylinders); + if(nberrors_circles > 0) + robust_circles.MEstimator(vpRobust::TUKEY, error_circles,w_circles); } - else { - m_w[cpt] = w_circles[cpt-nberrors_lines-nberrors_cylinders]; + else + { + robust_lines.setIteration(iter); + robust_cylinders.setIteration(iter); + robust_circles.setIteration(iter); + if(nberrors_lines > 0) + robust_lines.MEstimator(vpRobust::TUKEY, error_lines, w_lines); + if(nberrors_cylinders > 0) + robust_cylinders.MEstimator(vpRobust::TUKEY, error_cylinders,w_cylinders); + if(nberrors_circles > 0) + robust_circles.MEstimator(vpRobust::TUKEY, error_circles,w_circles); + } + + unsigned int cpt = 0; + while(cpt<nbrow){ + if(cpt<nberrors_lines){ + m_w[cpt] = w_lines[cpt]; + } + else if (cpt<nberrors_lines+nberrors_cylinders){ + m_w[cpt] = w_cylinders[cpt-nberrors_lines]; + } + else { + m_w[cpt] = w_circles[cpt-nberrors_lines-nberrors_cylinders]; + } + cpt++; } - cpt++; - } - residu_1 = r; + double num=0; + double den=0; + double wi; + double eri; - double num=0; - double den=0; - double wi; - double eri; - - L_true = L; - W_true = vpColVector(nerror); + L_true = L; + W_true = vpColVector(nerror); - if(computeCovariance){ - L_true = L; - if(!isoJoIdentity_){ - cVo.buildFrom(cMo); - LVJ_true = (L*cVo*oJo); - } - } - - for(unsigned int i=0; i<nerror; i++){ - wi = m_w[i]*factor[i]; - W_true[i] = wi; - eri = m_error[i]; - num += wi*vpMath::sqr(eri); - den += wi; + if(computeCovariance){ + L_true = L; + if(!isoJoIdentity_){ + cVo.buildFrom(cMo); + LVJ_true = (L*cVo*oJo); + } + } - weighted_error[i] = wi*eri ; - } - - r = sqrt(num/den); //Le critere d'arret prend en compte le poids + for(unsigned int i=0; i<nerror; i++){ + wi = m_w[i]*factor[i]; + W_true[i] = wi; + eri = m_error[i]; + num += wi*vpMath::sqr(eri); + den += wi; - if((iter==0)|| compute_interaction){ - for (unsigned int i=0 ; i < nerror ; i++){ - for (unsigned int j=0 ; j < 6 ; j++){ - L[i][j] = m_w[i]*factor[i]*L[i][j]; + weighted_error[i] = wi*eri ; + } + + if((iter==0)|| compute_interaction){ + for (unsigned int i=0 ; i < nerror ; i++){ + for (unsigned int j=0 ; j < 6 ; j++){ + L[i][j] = m_w[i]*factor[i]*L[i][j]; + } } } - } - if(isoJoIdentity_){ + if(isoJoIdentity_){ LTL = L.AtA(); computeJTR(L, weighted_error, LTR); - v = -lambda*LTL.pseudoInverse(LTL.getRows()*std::numeric_limits<double>::epsilon())*LTR; - } - else{ + + switch(m_optimizationMethod){ + case vpMbTracker::LEVENBERG_MARQUARDT_OPT: + { + vpMatrix LMA(LTL.getRows(), LTL.getCols()); + LMA.eye(); + vpMatrix LTLmuI = LTL + (LMA*mu); + v = -lambda*LTLmuI.pseudoInverse(LTLmuI.getRows()*std::numeric_limits<double>::epsilon())*LTR; + + if(iter != 0) + mu /= 10.0; + + m_error_prev = m_error; + m_w_prev = m_w; + break; + } + case vpMbTracker::GAUSS_NEWTON_OPT: + default: + v = -lambda*LTL.pseudoInverse(LTL.getRows()*std::numeric_limits<double>::epsilon())*LTR; + } + } + else{ cVo.buildFrom(cMo); vpMatrix LVJ = (L*cVo*oJo); vpMatrix LVJTLVJ = (LVJ).AtA(); - vpMatrix LVJTR; + vpColVector LVJTR; computeJTR(LVJ, weighted_error, LVJTR); - v = -lambda*LVJTLVJ.pseudoInverse(LVJTLVJ.getRows()*std::numeric_limits<double>::epsilon())*LVJTR; - v = cVo * v; - } - cMoPrev = cMo; - cMo = vpExponentialMap::direct(v).inverse() * cMo; + switch(m_optimizationMethod){ + case vpMbTracker::LEVENBERG_MARQUARDT_OPT: + { + vpMatrix LMA(LVJTLVJ.getRows(), LVJTLVJ.getCols()); + LMA.eye(); + vpMatrix LTLmuI = LVJTLVJ + (LMA*mu); + v = -lambda*LTLmuI.pseudoInverse(LTLmuI.getRows()*std::numeric_limits<double>::epsilon())*LVJTR; + v = cVo * v; + + if(iter != 0) + mu /= 10.0; + + m_error_prev = m_error; + m_w_prev = m_w; + break; + } + case vpMbTracker::GAUSS_NEWTON_OPT: + default: + { + v = -lambda*LVJTLVJ.pseudoInverse(LVJTLVJ.getRows()*std::numeric_limits<double>::epsilon())*LVJTR; + v = cVo * v; + break; + } + } + } + + residu_1 = r; + r = sqrt(num/den); //Le critere d'arret prend en compte le poids + + cMoPrev = cMo; + cMo = vpExponentialMap::direct(v).inverse() * cMo; + + } // endif(!restartFromLast) iter++; } @@ -779,39 +870,44 @@ vpMbEdgeTracker::computeVVS(const vpImage<unsigned char>& _I) // Note that here the covariance is computed on cMoPrev for time computation efficiency if(isoJoIdentity_){ - computeCovarianceMatrix(cMoPrev,m_error,L_true,D); + covarianceMatrix = vpMatrix::computeCovarianceMatrixVVS(cMoPrev,m_error,L_true,D); } else{ - computeCovarianceMatrix(cMoPrev,m_error,LVJ_true,D); + covarianceMatrix = vpMatrix::computeCovarianceMatrixVVS(cMoPrev,m_error,LVJ_true,D); } } unsigned int n =0 ; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ - l = *it; - { + if((*it)->isTracked()){ + l = *it; + unsigned int indexLine = 0; double wmean = 0 ; - std::list<vpMeSite>::iterator itListLine; - if (l->nbFeature > 0) itListLine = l->meline->getMeList().begin(); - - for (unsigned int i=0 ; i < l->nbFeature ; i++){ - wmean += m_w[n+i] ; - vpMeSite p = *itListLine; - if (m_w[n+i] < 0.5){ - p.setState(vpMeSite::M_ESTIMATOR); - - *itListLine = p; - } + for(unsigned int a = 0 ; a < l->meline.size() ; a++) + { + std::list<vpMeSite>::iterator itListLine; + if (l->nbFeature[a] > 0) itListLine = l->meline[a]->getMeList().begin(); + + for (unsigned int i=0 ; i < l->nbFeature[a] ; i++){ + wmean += m_w[n+indexLine] ; + vpMeSite p = *itListLine; + if (m_w[n+indexLine] < 0.5){ + p.setState(vpMeSite::M_ESTIMATOR); + + *itListLine = p; + } - ++itListLine; + ++itListLine; + indexLine++; + } } - n+= l->nbFeature ; - - if (l->nbFeature!=0) - wmean /= l->nbFeature ; + n+= l->nbFeatureTotal ; + + if (l->nbFeatureTotal!=0) + wmean /= l->nbFeatureTotal ; else wmean = 1; - + l->setMeanWeight(wmean); if (wmean < 0.8) @@ -821,103 +917,181 @@ vpMbEdgeTracker::computeVVS(const vpImage<unsigned char>& _I) // Same thing with cylinders as with lines for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ - cy = *it; - double wmean = 0 ; - std::list<vpMeSite>::iterator itListCyl1; - std::list<vpMeSite>::iterator itListCyl2; + if((*it)->isTracked()){ + cy = *it; + double wmean = 0 ; + std::list<vpMeSite>::iterator itListCyl1; + std::list<vpMeSite>::iterator itListCyl2; - if (cy->nbFeature > 0){ - itListCyl1 = cy->meline1->getMeList().begin(); - itListCyl2 = cy->meline2->getMeList().begin(); - } + if (cy->nbFeature > 0){ + itListCyl1 = cy->meline1->getMeList().begin(); + itListCyl2 = cy->meline2->getMeList().begin(); + } - wmean = 0; - for(unsigned int i=0 ; i < cy->nbFeaturel1 ; i++){ - wmean += m_w[n+i] ; - vpMeSite p = *itListCyl1; - if (m_w[n+i] < 0.5){ - p.setState(vpMeSite::M_ESTIMATOR); - - *itListCyl1 = p; + wmean = 0; + for(unsigned int i=0 ; i < cy->nbFeaturel1 ; i++){ + wmean += m_w[n+i] ; + vpMeSite p = *itListCyl1; + if (m_w[n+i] < 0.5){ + p.setState(vpMeSite::M_ESTIMATOR); + + *itListCyl1 = p; + } + + ++itListCyl1; } - ++itListCyl1; - } + if (cy->nbFeaturel1!=0) + wmean /= cy->nbFeaturel1 ; + else + wmean = 1; - if (cy->nbFeaturel1!=0) - wmean /= cy->nbFeaturel1 ; - else - wmean = 1; + cy->setMeanWeight1(wmean); - cy->setMeanWeight1(wmean); + if (wmean < 0.8){ + cy->Reinit = true; + } - if (wmean < 0.8){ - cy->Reinit = true; - } + wmean = 0; + for(unsigned int i=cy->nbFeaturel1 ; i < cy->nbFeature ; i++){ + wmean += m_w[n+i] ; + vpMeSite p = *itListCyl2; + if (m_w[n+i] < 0.5){ + p.setState(vpMeSite::M_ESTIMATOR); - wmean = 0; - for(unsigned int i=cy->nbFeaturel1 ; i < cy->nbFeature ; i++){ - wmean += m_w[n+i] ; - vpMeSite p = *itListCyl2; - if (m_w[n+i] < 0.5){ - p.setState(vpMeSite::M_ESTIMATOR); - - *itListCyl2 = p; + *itListCyl2 = p; + } + + ++itListCyl2; } - ++itListCyl2; - } + if (cy->nbFeaturel2!=0) + wmean /= cy->nbFeaturel2 ; + else + wmean = 1; - if (cy->nbFeaturel2!=0) - wmean /= cy->nbFeaturel2 ; - else - wmean = 1; + cy->setMeanWeight2(wmean); - cy->setMeanWeight2(wmean); + if (wmean < 0.8){ + cy->Reinit = true; + } - if (wmean < 0.8){ - cy->Reinit = true; + n+= cy->nbFeature ; } - - n+= cy->nbFeature ; } // Same thing with circles as with lines for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ - ci = *it; - double wmean = 0 ; - std::list<vpMeSite>::iterator itListCir; + if((*it)->isTracked()){ + ci = *it; + double wmean = 0 ; + std::list<vpMeSite>::iterator itListCir; - if (ci->nbFeature > 0){ - itListCir = ci->meEllipse->getMeList().begin(); - } + if (ci->nbFeature > 0){ + itListCir = ci->meEllipse->getMeList().begin(); + } - wmean = 0; - for(unsigned int i=0 ; i < ci->nbFeature ; i++){ - wmean += m_w[n+i] ; - vpMeSite p = *itListCir; - if (m_w[n+i] < 0.5){ - p.setState(vpMeSite::M_ESTIMATOR); + wmean = 0; + for(unsigned int i=0 ; i < ci->nbFeature ; i++){ + wmean += m_w[n+i] ; + vpMeSite p = *itListCir; + if (m_w[n+i] < 0.5){ + p.setState(vpMeSite::M_ESTIMATOR); + + *itListCir = p; + } - *itListCir = p; + ++itListCir; } - ++itListCir; + if (ci->nbFeature!=0) + wmean /= ci->nbFeature ; + else + wmean = 1; + + ci->setMeanWeight(wmean); + + if (wmean < 0.8){ + ci->Reinit = true; + } + + n+= ci->nbFeature ; } + } +} - if (ci->nbFeature!=0) - wmean /= ci->nbFeature ; - else - wmean = 1; +/*! + Compute the projection error of the model. + This approach compares the gradient direction around samples of each lines of the model with their direction. + Error is expressed in degrees between 0 and 90; + + \param _I : Image in which the model appears. +*/ +void +vpMbEdgeTracker::computeProjectionError(const vpImage<unsigned char>& _I) +{ + vpMbtDistanceLine *l ; + projectionError = 0.0; + unsigned int nbFeatures = 0; + for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ + l = *it; + if (l->isVisible() && l->isTracked()) + { + for(unsigned int a = 0 ; a < l->meline.size() ; a++){ + if(l->meline[a] != NULL){ + double lineNormGradient; + unsigned int lineNbFeatures; + l->meline[a]->computeProjectionError(_I, lineNormGradient, lineNbFeatures); + projectionError += lineNormGradient; + nbFeatures += lineNbFeatures; + } + } + } + } - ci->setMeanWeight(wmean); + vpMbtDistanceCylinder *cy; + for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ + cy = *it; + if (cy->isVisible() && cy->isTracked()) + { + if(cy->meline1 != NULL) + { + double cylinderNormGradient = 0; + unsigned int cylinderNbFeatures = 0; + cy->meline1->computeProjectionError(_I, cylinderNormGradient, cylinderNbFeatures); + projectionError += cylinderNormGradient; + nbFeatures += cylinderNbFeatures; + } - if (wmean < 0.8){ - ci->Reinit = true; + if(cy->meline2 != NULL) + { + double cylinderNormGradient = 0; + unsigned int cylinderNbFeatures = 0; + cy->meline2->computeProjectionError(_I, cylinderNormGradient, cylinderNbFeatures); + projectionError += cylinderNormGradient; + nbFeatures += cylinderNbFeatures; + } } + } - n+= ci->nbFeature ; + vpMbtDistanceCircle *c; + for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ + c = *it; + if (c->isVisible() && c->isTracked() && c->meEllipse != NULL) + { + double circleNormGradient = 0; + unsigned int circleNbFeatures = 0; + c->meEllipse->computeProjectionError(_I, circleNormGradient, circleNbFeatures); + projectionError += circleNormGradient; + nbFeatures += circleNbFeatures; + } } + + if(nbFeatures > 0) + projectionError = vpMath::deg(projectionError/(double)nbFeatures); + else + projectionError = 90.0; +// std::cout << "Norm Gradient = " << errorGradient << std::endl; } /*! @@ -935,21 +1109,25 @@ vpMbEdgeTracker::testTracking() vpMbtDistanceLine *l ; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ l = *it; - if (l->isVisible() && l->meline != NULL) + if (l->isVisible() && l->isTracked()) { - nbExpectedPoint += (int)l->meline->expecteddensity; - for(std::list<vpMeSite>::const_iterator itme=l->meline->getMeList().begin(); itme!=l->meline->getMeList().end(); ++itme){ - vpMeSite pix = *itme; - if (pix.getState() == vpMeSite::NO_SUPPRESSION) nbGoodPoint++; - else nbBadPoint++; + for(unsigned int a = 0 ; a < l->meline.size() ; a++){ + if(l->meline[a] != NULL){ + nbExpectedPoint += (int)l->meline[a]->expecteddensity; + for(std::list<vpMeSite>::const_iterator itme=l->meline[a]->getMeList().begin(); itme!=l->meline[a]->getMeList().end(); ++itme){ + vpMeSite pix = *itme; + if (pix.getState() == vpMeSite::NO_SUPPRESSION) nbGoodPoint++; + else nbBadPoint++; + } + } } } - } + } vpMbtDistanceCylinder *cy ; for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ cy = *it; - if ((cy->meline1 !=NULL && cy->meline2 != NULL) && cy->isVisible()) + if ((cy->meline1 !=NULL && cy->meline2 != NULL) && cy->isVisible() && cy->isTracked()) { nbExpectedPoint += (int)cy->meline1->expecteddensity; for(std::list<vpMeSite>::const_iterator itme1=cy->meline1->getMeList().begin(); itme1!=cy->meline1->getMeList().end(); ++itme1){ @@ -969,7 +1147,7 @@ vpMbEdgeTracker::testTracking() vpMbtDistanceCircle *ci ; for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ ci = *it; - if (ci->isVisible() && ci->meEllipse !=NULL) + if (ci->isVisible() && ci->isTracked() && ci->meEllipse !=NULL) { nbExpectedPoint += ci->meEllipse->getExpectedDensity(); for(std::list<vpMeSite>::const_iterator itme=ci->meEllipse->getMeList().begin(); itme!=ci->meEllipse->getMeList().end(); ++itme){ @@ -1013,6 +1191,9 @@ vpMbEdgeTracker::track(const vpImage<unsigned char> &I) unsigned int lvl = (unsigned int)scales.size(); do{ lvl--; + + projectionError = 90.0; + if(scales[lvl]){ vpHomogeneousMatrix cMo_1 = cMo; try @@ -1029,9 +1210,13 @@ vpMbEdgeTracker::track(const vpImage<unsigned char> &I) throw ; } + vpMbtDistanceLine *l ; + vpMbtDistanceCylinder *cy ; + vpMbtDistanceCircle *ci ; // initialize the vector that contains the error and the matrix that contains // the interaction matrix - vpMbtDistanceLine *l ; + // AY: Useless as it is done in coputeVVS() + /* for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[lvl].begin(); it!=lines[lvl].end(); ++it){ l = *it; if (l->isVisible()){ @@ -1039,7 +1224,6 @@ vpMbEdgeTracker::track(const vpImage<unsigned char> &I) } } - vpMbtDistanceCylinder *cy ; for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[lvl].begin(); it!=cylinders[lvl].end(); ++it){ cy = *it; if(cy->isVisible()) { @@ -1047,13 +1231,13 @@ vpMbEdgeTracker::track(const vpImage<unsigned char> &I) } } - vpMbtDistanceCircle *ci ; for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[lvl].begin(); it!=circles[lvl].end(); ++it){ ci = *it; if (ci->isVisible()){ ci->initInteractionMatrixError(); } } + */ try { @@ -1079,27 +1263,37 @@ vpMbEdgeTracker::track(const vpImage<unsigned char> &I) if(lvl == 0){ for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[lvl].begin(); it!=lines[lvl].end(); ++it){ l = *it; - if (l->isVisible()){ + if (l->isVisible() && l->isTracked()){ l->displayMovingEdges(I); } } for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[lvl].begin(); it!=cylinders[lvl].end(); ++it){ cy = *it; - if(cy->isVisible()) { + if(cy->isVisible() && cy->isTracked()) { cy->displayMovingEdges(I); } } for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[lvl].begin(); it!=circles[lvl].end(); ++it){ ci = *it; - if (ci->isVisible()){ + if (ci->isVisible() && ci->isTracked()){ ci->displayMovingEdges(I); } } } } + // Looking for new visible face + bool newvisibleface = false ; + visibleFace(I, cMo, newvisibleface) ; + + //cam.computeFov(I.getWidth(), I.getHeight()); + if(useScanLine){ + faces.computeClippedPolygons(cMo,cam); + faces.computeScanLineRender(cam, I.getWidth(), I.getHeight()); + } + try { updateMovingEdge(I); @@ -1109,13 +1303,13 @@ vpMbEdgeTracker::track(const vpImage<unsigned char> &I) throw e; } - // Looking for new visible face - bool newvisibleface = false ; - visibleFace(I, cMo, newvisibleface) ; initMovingEdge(I,cMo) ; - // Reinit the moving edge for the lines which need it. reinitMovingEdge(I,cMo); + + if(computeProjError) + computeProjectionError(I); + upScale(lvl); } catch(vpException &e) @@ -1153,7 +1347,12 @@ void vpMbEdgeTracker::init(const vpImage<unsigned char>& I) if(useOgre){ if(!faces.isOgreInitialised()){ faces.setBackgroundSizeOgre(I.getHeight(), I.getWidth()); + faces.setOgreShowConfigDialog(ogreShowConfigDialog); faces.initOgre(cam); + // Turn off Ogre config dialog display for the next call to this function + // since settings are saved in the ogre.cfg file and used during the next + // call + ogreShowConfigDialog = false; } } #endif @@ -1162,7 +1361,15 @@ void vpMbEdgeTracker::init(const vpImage<unsigned char>& I) initPyramid(I, Ipyramid); visibleFace(I, cMo, a); unsigned int i = (unsigned int)scales.size(); - + + resetMovingEdge(); + + if(useScanLine){ + cam.computeFov(I.getWidth(), I.getHeight()); + faces.computeClippedPolygons(cMo,cam); + faces.computeScanLineRender(cam, I.getWidth(), I.getHeight()); + } + do { i--; if(scales[i]){ @@ -1179,8 +1386,6 @@ void vpMbEdgeTracker::init(const vpImage<unsigned char>& I) Set the pose to be used in entry of the next call to the track() function. This pose will be just used once. - \warning This function has to be called after the initialization of the tracker. - \param I : image corresponding to the desired pose. \param cdMo : Pose to affect. */ @@ -1188,40 +1393,6 @@ void vpMbEdgeTracker::setPose( const vpImage<unsigned char> &I, const vpHomogeneousMatrix& cdMo) { cMo = cdMo; - - if (! lines[scaleLevel].empty()) { - lines[scaleLevel].front() ; - for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ - if((*it)->meline != NULL){ - delete (*it)->meline; - (*it)->meline = NULL; - } - } - } - - if (! cylinders[scaleLevel].empty()) { - cylinders[scaleLevel].front() ; - for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ - if((*it)->meline1 != NULL){ - delete (*it)->meline1; - (*it)->meline1 = NULL; - } - if((*it)->meline2 != NULL){ - delete (*it)->meline2; - (*it)->meline2 = NULL; - } - } - } - - if (! circles[scaleLevel].empty()) { - circles[scaleLevel].front() ; - for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ - if((*it)->meEllipse != NULL){ - delete (*it)->meEllipse; - (*it)->meEllipse = NULL; - } - } - } init(I); } @@ -1272,11 +1443,10 @@ vpMbEdgeTracker::loadConfigFile(const std::string& configFile) <mu1>0.5</mu1> <mu2>0.5</mu2> </contrast> + <sample> + <step>4</step> + </sample> </ecm> - <sample> - <step>4</step> - <nb_sample>250</nb_sample> - </sample> <face> <near_clipping>0.01</near_clipping> <far_clipping>0.90</far_clipping> @@ -1329,7 +1499,7 @@ vpMbEdgeTracker::loadConfigFile(const char* configFile) setFarClippingDistance(xmlp.getFarClippingDistance()); if(xmlp.getFovClipping()) - setClipping(clippingFlag | vpMbtPolygon::FOV_CLIPPING); + setClipping(clippingFlag | vpPolygon3D::FOV_CLIPPING); useLodGeneral = xmlp.getLodState(); minLineLengthThresholdGeneral = xmlp.getMinLineLengthThreshold(); @@ -1363,7 +1533,7 @@ void vpMbEdgeTracker::display(const vpImage<unsigned char>& I, const vpHomogeneousMatrix &cMo_, const vpCameraParameters &camera, const vpColor& col, const unsigned int thickness, const bool displayFullModel) -{ +{ for (unsigned int i = 0; i < scales.size(); i += 1){ if(scales[i]){ for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ @@ -1381,7 +1551,7 @@ vpMbEdgeTracker::display(const vpImage<unsigned char>& I, const vpHomogeneousMat break ; //displaying model on one scale only } } - + #ifdef VISP_HAVE_OGRE if(useOgre) faces.displayOgre(cMo_); @@ -1419,7 +1589,7 @@ vpMbEdgeTracker::display(const vpImage<vpRGBa>& I, const vpHomogeneousMatrix &cM break ; //displaying model on one scale only } } - + #ifdef VISP_HAVE_OGRE if(useOgre) faces.displayOgre(cMo_); @@ -1439,7 +1609,6 @@ vpMbEdgeTracker::initMovingEdge(const vpImage<unsigned char> &I, const vpHomogen { vpMbtDistanceLine *l ; - lines[scaleLevel].front() ; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ l = *it; bool isvisible = false ; @@ -1459,19 +1628,21 @@ vpMbEdgeTracker::initMovingEdge(const vpImage<unsigned char> &I, const vpHomogen if (isvisible) { l->setVisible(true) ; - if (l->meline==NULL) - { -// std::cout << "init me line "<< l->getIndex() << std::endl ; - l->initMovingEdge(I, _cMo) ; - } + l->updateTracked(); + if (l->meline.size() == 0 && l->isTracked()) + l->initMovingEdge(I, _cMo) ; } else { l->setVisible(false) ; - if (l->meline!=NULL) delete l->meline; - l->meline=NULL; + for(unsigned int a = 0 ; a < l->meline.size() ; a++){ + if (l->meline[a] != NULL) delete l->meline[a] ; + l->nbFeature[a] = 0; + } + l->nbFeatureTotal = 0; + l->meline.clear(); } - } + } vpMbtDistanceCylinder *cy ; for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ @@ -1483,7 +1654,11 @@ vpMbEdgeTracker::initMovingEdge(const vpImage<unsigned char> &I, const vpHomogen if (index ==-1) isvisible =true ; else { - if (cy->hiddenface->isVisible((unsigned int)index)) isvisible = true ; + if (cy->hiddenface->isVisible((unsigned int)index +1 ) || + cy->hiddenface->isVisible((unsigned int)index +2 ) || + cy->hiddenface->isVisible((unsigned int)index +3 ) || + cy->hiddenface->isVisible((unsigned int)index +4 )) + isvisible = true ; } // vpTRACE("cyl with index %d is visible: %d", index, isvisible); @@ -1491,7 +1666,8 @@ vpMbEdgeTracker::initMovingEdge(const vpImage<unsigned char> &I, const vpHomogen { cy->setVisible(true) ; if (cy->meline1==NULL || cy->meline2==NULL){ - cy->initMovingEdge(I, _cMo) ; + if(cy->isTracked()) + cy->initMovingEdge(I, _cMo) ; } } else @@ -1501,6 +1677,9 @@ vpMbEdgeTracker::initMovingEdge(const vpImage<unsigned char> &I, const vpHomogen if (cy->meline2!=NULL) delete cy->meline2; cy->meline1=NULL; cy->meline2=NULL; + cy->nbFeature = 0; + cy->nbFeaturel1 = 0; + cy->nbFeaturel2= 0; } } @@ -1521,7 +1700,8 @@ vpMbEdgeTracker::initMovingEdge(const vpImage<unsigned char> &I, const vpHomogen ci->setVisible(true) ; if (ci->meEllipse==NULL) { - ci->initMovingEdge(I, _cMo) ; + if(ci->isTracked()) + ci->initMovingEdge(I, _cMo) ; } } else @@ -1529,6 +1709,7 @@ vpMbEdgeTracker::initMovingEdge(const vpImage<unsigned char> &I, const vpHomogen ci->setVisible(false) ; if (ci->meEllipse!=NULL) delete ci->meEllipse; ci->meEllipse=NULL; + ci->nbFeature = 0; } } } @@ -1545,8 +1726,8 @@ vpMbEdgeTracker::trackMovingEdge(const vpImage<unsigned char> &I) vpMbtDistanceLine *l ; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ l = *it; - if(l->isVisible() == true){ - if(l->meline == NULL){ + if(l->isVisible() && l->isTracked()){ + if(l->meline.size() == 0){ l->initMovingEdge(I, cMo); } l->trackMovingEdge(I, cMo) ; @@ -1556,7 +1737,7 @@ vpMbEdgeTracker::trackMovingEdge(const vpImage<unsigned char> &I) vpMbtDistanceCylinder *cy; for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ cy = *it; - if(cy->isVisible()) { + if(cy->isVisible() && cy->isTracked()) { if(cy->meline1 == NULL || cy->meline2 == NULL){ cy->initMovingEdge(I, cMo); } @@ -1567,7 +1748,7 @@ vpMbEdgeTracker::trackMovingEdge(const vpImage<unsigned char> &I) vpMbtDistanceCircle *ci; for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ ci = *it; - if(ci->isVisible() == true){ + if(ci->isVisible() && ci->isTracked()){ if(ci->meEllipse == NULL){ ci->initMovingEdge(I, cMo); } @@ -1587,28 +1768,34 @@ vpMbEdgeTracker::updateMovingEdge(const vpImage<unsigned char> &I) { vpMbtDistanceLine *l ; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ - l = *it; - l->updateMovingEdge(I, cMo) ; - if (l->nbFeature == 0 && l->isVisible()){ - l->Reinit = true; + if((*it)->isTracked()){ + l = *it; + l->updateMovingEdge(I, cMo) ; + if (l->nbFeatureTotal == 0 && l->isVisible()){ + l->Reinit = true; + } } } vpMbtDistanceCylinder *cy ; for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ - cy = *it; - cy->updateMovingEdge(I, cMo) ; - if((cy->nbFeaturel1 == 0 || cy->nbFeaturel2 == 0) && cy->isVisible()){ - cy->Reinit = true; + if((*it)->isTracked()){ + cy = *it; + cy->updateMovingEdge(I, cMo) ; + if((cy->nbFeaturel1 == 0 || cy->nbFeaturel2 == 0) && cy->isVisible()){ + cy->Reinit = true; + } } } vpMbtDistanceCircle *ci ; for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ - ci = *it; - ci->updateMovingEdge(I, cMo) ; - if(ci->nbFeature == 0 && ci->isVisible()){ - ci->Reinit = true; + if((*it)->isTracked()){ + ci = *it; + ci->updateMovingEdge(I, cMo) ; + if(ci->nbFeature == 0 && ci->isVisible()){ + ci->Reinit = true; + } } } } @@ -1625,28 +1812,75 @@ vpMbEdgeTracker::updateMovingEdge(const vpImage<unsigned char> &I) void vpMbEdgeTracker::reinitMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &_cMo) { - vpMbtDistanceLine *l ; + vpMbtDistanceLine *l ; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ - l = *it; - if (l->Reinit && l->isVisible()) - l->reinitMovingEdge(I, _cMo); + if((*it)->isTracked()){ + l = *it; + if (l->Reinit && l->isVisible()) + l->reinitMovingEdge(I, _cMo); + } } vpMbtDistanceCylinder*cy; for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ - cy = *it; - if (cy->Reinit && cy->isVisible()) - cy->reinitMovingEdge(I, _cMo); + if((*it)->isTracked()){ + cy = *it; + if (cy->Reinit && cy->isVisible()) + cy->reinitMovingEdge(I, _cMo); + } } vpMbtDistanceCircle*ci; for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ - ci = *it; - if (ci->Reinit && ci->isVisible()) - ci->reinitMovingEdge(I, _cMo); + if((*it)->isTracked()){ + ci = *it; + if (ci->Reinit && ci->isVisible()) + ci->reinitMovingEdge(I, _cMo); + } } } +void +vpMbEdgeTracker::resetMovingEdge(){ + for (unsigned int i = 0; i < scales.size(); i += 1){ + if (scales[i]) { + for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[i].begin(); it!=lines[i].end(); ++it){ + for(unsigned int a = 0 ; a < (*it)->meline.size() ; a++){ + if((*it)->meline[a] != NULL){ + delete (*it)->meline[a]; + (*it)->meline[a] = NULL; + } + (*it)->meline.clear(); + (*it)->nbFeature.clear(); + (*it)->nbFeatureTotal = 0; + } + } + + for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[i].begin(); it!=cylinders[i].end(); ++it){ + if((*it)->meline1 != NULL){ + delete (*it)->meline1; + (*it)->meline1 = NULL; + } + if((*it)->meline2 != NULL){ + delete (*it)->meline2; + (*it)->meline2 = NULL; + } + + (*it)->nbFeature = 0; + (*it)->nbFeaturel1 = 0; + (*it)->nbFeaturel2 = 0; + } + + for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[i].begin(); it!=circles[i].end(); ++it){ + if((*it)->meEllipse != NULL){ + delete (*it)->meEllipse; + (*it)->meEllipse = NULL; + } + (*it)->nbFeature = 0; + } + } + } +} /*! Check if two vpPoints are similar. @@ -1695,7 +1929,7 @@ vpMbEdgeTracker::addLine(vpPoint &P1, vpPoint &P2, int polygon, std::string name if((samePoint(*(l->p1),P1) && samePoint(*(l->p2),P2)) || (samePoint(*(l->p1),P2) && samePoint(*(l->p2),P1)) ){ already_here = true ; - l->Lindex_polygon.push_back(polygon); + l->addPolygon(polygon); l->hiddenface = &faces ; } } @@ -1705,20 +1939,21 @@ vpMbEdgeTracker::addLine(vpPoint &P1, vpPoint &P2, int polygon, std::string name l->setCameraParameters(cam) ; l->buildFrom(P1,P2) ; - l->Lindex_polygon.push_back(polygon); + l->addPolygon(polygon); l->setMovingEdge(&me) ; l->hiddenface = &faces ; + l->useScanLine = useScanLine; l->setIndex(nline) ; l->setName(name); - if(clippingFlag != vpMbtPolygon::NO_CLIPPING) + if(clippingFlag != vpPolygon3D::NO_CLIPPING) l->getPolygon().setClipping(clippingFlag); - if((clippingFlag & vpMbtPolygon::NEAR_CLIPPING) == vpMbtPolygon::NEAR_CLIPPING) + if((clippingFlag & vpPolygon3D::NEAR_CLIPPING) == vpPolygon3D::NEAR_CLIPPING) l->getPolygon().setNearClippingDistance(distNearClip); - if((clippingFlag & vpMbtPolygon::FAR_CLIPPING) == vpMbtPolygon::FAR_CLIPPING) + if((clippingFlag & vpPolygon3D::FAR_CLIPPING) == vpPolygon3D::FAR_CLIPPING) l->getPolygon().setFarClippingDistance(distFarClip); nline +=1 ; @@ -1790,13 +2025,13 @@ vpMbEdgeTracker::addCircle(const vpPoint &P1, const vpPoint &P2, const vpPoint & ci->index_polygon = idFace; ci->hiddenface = &faces ; -// if(clippingFlag != vpMbtPolygon::NO_CLIPPING) +// if(clippingFlag != vpPolygon3D::NO_CLIPPING) // ci->getPolygon().setClipping(clippingFlag); -// if((clippingFlag & vpMbtPolygon::NEAR_CLIPPING) == vpMbtPolygon::NEAR_CLIPPING) +// if((clippingFlag & vpPolygon3D::NEAR_CLIPPING) == vpPolygon3D::NEAR_CLIPPING) // ci->getPolygon().setNearClippingDistance(distNearClip); -// if((clippingFlag & vpMbtPolygon::FAR_CLIPPING) == vpMbtPolygon::FAR_CLIPPING) +// if((clippingFlag & vpPolygon3D::FAR_CLIPPING) == vpPolygon3D::FAR_CLIPPING) // ci->getPolygon().setFarClippingDistance(distFarClip); ncircle +=1; @@ -1913,48 +2148,6 @@ vpMbEdgeTracker::addPolygon(vpMbtPolygon &p) } } - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated since it is no more used since ViSP 2.7.0. \n - - Detect the visible faces in the image and says if a new one appeared. - - \warning If in one iteration one face appears and one disappears, then the - function will not detect the new face. - - \param _cMo : The pose of the camera used to project the 3D model into the image. - \param newvisibleline : This parameter is set to true if a new face appeared. -*/ -void -vpMbEdgeTracker::visibleFace(const vpHomogeneousMatrix &_cMo, bool &newvisibleline) -{ - unsigned int n ; - - if(!useOgre) - n = faces.setVisible(_cMo) ; - else{ -#ifdef VISP_HAVE_OGRE - bool changed = false; - n = faces.setVisibleOgre(_cMo, vpMath::rad(70), vpMath::rad(70), changed); -#else - n = faces.setVisible(_cMo) ; -#endif - } - -// cout << "visible face " << n << endl ; - if (n > nbvisiblepolygone) - { - //cout << "une nouvelle face est visible " << endl ; - newvisibleline = true ; - } - else - newvisibleline = false ; - - nbvisiblepolygone= n ; -} -#endif //VISP_BUILD_DEPRECATED_FUNCTIONS - /*! Detect the visible faces in the image and says if a new one appeared. @@ -2082,7 +2275,7 @@ vpMbEdgeTracker::initCylinder(const vpPoint& p1, const vpPoint &p2, const double void vpMbEdgeTracker::resetTracker() { - this->cMo.setIdentity(); + this->cMo.eye(); vpMbtDistanceLine *l; vpMbtDistanceCylinder *cy; vpMbtDistanceCircle *ci; @@ -2114,6 +2307,8 @@ vpMbEdgeTracker::resetTracker() faces.reset(); + useScanLine = false; + #ifdef VISP_HAVE_OGRE useOgre = false; #endif @@ -2127,7 +2322,9 @@ vpMbEdgeTracker::resetTracker() angleAppears = vpMath::rad(89); angleDisappears = vpMath::rad(89); - clippingFlag = vpMbtPolygon::NO_CLIPPING; + clippingFlag = vpPolygon3D::NO_CLIPPING; + + m_optimizationMethod = vpMbTracker::GAUSS_NEWTON_OPT; // reinitialization of the scales. this->setScales(scales); @@ -2162,7 +2359,7 @@ void vpMbEdgeTracker::reInitModel(const vpImage<unsigned char>& I, const char* cad_name, const vpHomogeneousMatrix& cMo_, const bool verbose) { - this->cMo.setIdentity(); + this->cMo.eye(); vpMbtDistanceLine *l; vpMbtDistanceCylinder *cy; vpMbtDistanceCircle *ci; @@ -2208,8 +2405,8 @@ vpMbEdgeTracker::reInitModel(const vpImage<unsigned char>& I, const char* cad_na /*! Return the number of good points (vpMeSite) tracked. A good point is a - vpMeSite with its flag "suppress" equal to 0. Only these points are used - during the virtual visual servoing stage. + vpMeSite with its flag "state" equal to 0. Only these points are used + during the virtual visual servoing stage. \exception vpException::dimensionError if level does not represent a used level. @@ -2227,10 +2424,13 @@ vpMbEdgeTracker::getNbPoints(const unsigned int level) const vpMbtDistanceLine *l ; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[level].begin(); it!=lines[level].end(); ++it){ l = *it; - if (l->isVisible() && l->meline != NULL) + if (l->isVisible() && l->isTracked()) { - for(std::list<vpMeSite>::const_iterator itme=l->meline->getMeList().begin(); itme!=l->meline->getMeList().end(); ++itme){ - if (itme->getState() == vpMeSite::NO_SUPPRESSION) nbGoodPoints++; + for(unsigned int a = 0 ; a < l->meline.size() ; a++){ + if(l->nbFeature[a] != 0) + for(std::list<vpMeSite>::const_iterator itme=l->meline[a]->getMeList().begin(); itme!=l->meline[a]->getMeList().end(); ++itme){ + if (itme->getState() == vpMeSite::NO_SUPPRESSION) nbGoodPoints++; + } } } } @@ -2238,7 +2438,7 @@ vpMbEdgeTracker::getNbPoints(const unsigned int level) const vpMbtDistanceCylinder *cy ; for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[level].begin(); it!=cylinders[level].end(); ++it){ cy = *it; - if (cy->isVisible() && (cy->meline1 != NULL || cy->meline2 != NULL)) + if (cy->isVisible() && cy->isTracked() && (cy->meline1 != NULL || cy->meline2 != NULL)) { for(std::list<vpMeSite>::const_iterator itme1=cy->meline1->getMeList().begin(); itme1!=cy->meline1->getMeList().end(); ++itme1){ if (itme1->getState() == vpMeSite::NO_SUPPRESSION) nbGoodPoints++; @@ -2252,7 +2452,7 @@ vpMbEdgeTracker::getNbPoints(const unsigned int level) const vpMbtDistanceCircle *ci ; for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[level].begin(); it!=circles[level].end(); ++it){ ci = *it; - if (ci->isVisible() && ci->meEllipse != NULL) + if (ci->isVisible() && ci->isTracked() && ci->meEllipse != NULL) { for(std::list<vpMeSite>::const_iterator itme=ci->meEllipse->getMeList().begin(); itme!=ci->meEllipse->getMeList().end(); ++itme){ if (itme->getState() == vpMeSite::NO_SUPPRESSION) nbGoodPoints++; @@ -2320,7 +2520,7 @@ vpMbEdgeTracker::setScales(const std::vector<bool>& scale) void vpMbEdgeTracker::setFarClippingDistance(const double &dist) { - if( (clippingFlag & vpMbtPolygon::NEAR_CLIPPING) == vpMbtPolygon::NEAR_CLIPPING && dist <= distNearClip) + if( (clippingFlag & vpPolygon3D::NEAR_CLIPPING) == vpPolygon3D::NEAR_CLIPPING && dist <= distNearClip) vpTRACE("Far clipping value cannot be inferior than near clipping value. Far clipping won't be considered."); else if ( dist < 0 ) vpTRACE("Far clipping value cannot be inferior than 0. Far clipping won't be considered."); @@ -2347,7 +2547,7 @@ vpMbEdgeTracker::setFarClippingDistance(const double &dist) void vpMbEdgeTracker::setNearClippingDistance(const double &dist) { - if( (clippingFlag & vpMbtPolygon::FAR_CLIPPING) == vpMbtPolygon::FAR_CLIPPING && dist >= distFarClip) + if( (clippingFlag & vpPolygon3D::FAR_CLIPPING) == vpPolygon3D::FAR_CLIPPING && dist >= distFarClip) vpTRACE("Near clipping value cannot be superior than far clipping value. Near clipping won't be considered."); else if ( dist < 0 ) vpTRACE("Near clipping value cannot be inferior than 0. Near clipping won't be considered."); @@ -2596,20 +2796,26 @@ vpMbEdgeTracker::reInitLevel(const unsigned int _lvl) vpMbtDistanceLine *l; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ - l = *it; - l->reinitMovingEdge(*Ipyramid[_lvl], cMo); + if((*it)->isTracked()){ + l = *it; + l->reinitMovingEdge(*Ipyramid[_lvl], cMo); + } } vpMbtDistanceCylinder *cy; for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ - cy = *it; - cy->reinitMovingEdge(*Ipyramid[_lvl], cMo); + if((*it)->isTracked()){ + cy = *it; + cy->reinitMovingEdge(*Ipyramid[_lvl], cMo); + } } vpMbtDistanceCircle *ci; for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ - ci = *it; - ci->reinitMovingEdge(*Ipyramid[_lvl], cMo); + if((*it)->isTracked()){ + ci = *it; + ci->reinitMovingEdge(*Ipyramid[_lvl], cMo); + } } trackMovingEdge(*Ipyramid[_lvl]); @@ -2617,3 +2823,40 @@ vpMbEdgeTracker::reInitLevel(const unsigned int _lvl) scaleLevel = scaleLevel_1; } +/*! + Set if the polygons that have the given name have to be considered during the tracking phase. + + \param name : name of the polygon(s). + \param useEdgeTracking : True if it has to be considered, False otherwise. +*/ +void +vpMbEdgeTracker::setUseEdgeTracking(const std::string &name, const bool &useEdgeTracking) +{ + for (unsigned int i = 0; i < scales.size(); i += 1){ + if(scales[i]){ + for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[i].begin(); it!=lines[i].end(); ++it){ + /*(*it)->setTracked(useEdgeTracking); + for(std::list<int>::const_iterator itpoly=(*it)->Lindex_polygon.begin(); itpoly!=(*it)->Lindex_polygon.end(); ++itpoly){ + if(faces[(*itpoly)]->getName() != name){ + (*it)->setTracked(true); + break; + } + }*/ + + (*it)->setTracked(name,useEdgeTracking); + } + + for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[i].begin(); it!=cylinders[i].end(); ++it){ + if(faces[(unsigned)(*it)->index_polygon]->getName() == name){ + (*it)->setTracked(useEdgeTracking); + } + } + + for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[i].begin(); it!=circles[i].end(); ++it){ + if(faces[(unsigned)(*it)->index_polygon]->getName() == name){ + (*it)->setTracked(useEdgeTracking); + } + } + } + } +} diff --git a/src/tracking/mbt/edge/vpMbtDistanceCircle.cpp b/modules/tracker/mbt/src/edge/vpMbtDistanceCircle.cpp similarity index 94% rename from src/tracking/mbt/edge/vpMbtDistanceCircle.cpp rename to modules/tracker/mbt/src/edge/vpMbtDistanceCircle.cpp index 60fd7ed9729663369310e61ee49d43c8a611799c..2fa8564d0ed07a40b8434e6b709148ba71468c95 100644 --- a/src/tracking/mbt/edge/vpMbtDistanceCircle.cpp +++ b/modules/tracker/mbt/src/edge/vpMbtDistanceCircle.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMbtDistanceCircle.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,7 +36,7 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> /*! \file vpMbtDistanceCircle.cpp @@ -49,20 +46,20 @@ #include <stdlib.h> #include <algorithm> -#include <visp/vpMbtDistanceCircle.h> -#include <visp/vpPlane.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureEllipse.h> -#include <visp/vpPose.h> +#include <visp3/mbt/vpMbtDistanceCircle.h> +#include <visp3/core/vpPlane.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureEllipse.h> +#include <visp3/vision/vpPose.h> /*! Basic constructor */ vpMbtDistanceCircle::vpMbtDistanceCircle() : name(), index(0), cam(), me(NULL), wmean(1), - featureEllipse(), meEllipse(NULL), + featureEllipse(), isTrackedCircle(true), meEllipse(NULL), circle(NULL), radius(0.), p1(NULL), p2(NULL), p3(NULL), L(), error(), nbFeature(0), Reinit(false), hiddenface(NULL), index_polygon(-1), isvisible(false) diff --git a/src/tracking/mbt/edge/vpMbtDistanceCylinder.cpp b/modules/tracker/mbt/src/edge/vpMbtDistanceCylinder.cpp old mode 100755 new mode 100644 similarity index 84% rename from src/tracking/mbt/edge/vpMbtDistanceCylinder.cpp rename to modules/tracker/mbt/src/edge/vpMbtDistanceCylinder.cpp index f664e31b773c3a512d344ae33c7037a920abb532..477aa49fd3d1b4939068fac4275e056ec5379115 --- a/src/tracking/mbt/edge/vpMbtDistanceCylinder.cpp +++ b/modules/tracker/mbt/src/edge/vpMbtDistanceCylinder.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMbtDistanceCylinder.cpp 4914 2014-10-02 13:25:47Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -42,30 +39,30 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> /*! \file vpMbtDistanceCylinder.cpp \brief Make the complete tracking of an object by using its CAD model. */ -#include <visp/vpMbtDistanceCylinder.h> -#include <visp/vpPlane.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureEllipse.h> +#include <visp3/mbt/vpMbtDistanceCylinder.h> +#include <visp3/core/vpPlane.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureEllipse.h> #include <stdlib.h> #include <algorithm> -#include <visp/vpPose.h> +#include <visp3/vision/vpPose.h> /*! Basic constructor */ vpMbtDistanceCylinder::vpMbtDistanceCylinder() - : name(), index(0), cam(), me(NULL), alpha(0), wmean1(1), wmean2(1), - featureline1(), featureline2(), meline1(NULL), meline2(NULL), + : name(), index(0), cam(), me(NULL), wmean1(1), wmean2(1), + featureline1(), featureline2(), isTrackedCylinder(true), meline1(NULL), meline2(NULL), cercle1(NULL), cercle2(NULL), radius(0), p1(NULL), p2(NULL), L(), error(), nbFeature(0), nbFeaturel1(0), nbFeaturel2(0), Reinit(false), c(NULL), hiddenface(NULL), index_polygon(-1), isvisible(false) @@ -169,59 +166,6 @@ vpMbtDistanceCylinder::setMovingEdge(vpMe *_me) } } -/*! - Computes the coordinates of the point corresponding to the intersection - between a circle and a line from a cylinder's limbo plane. - - \param i : A reference to the i coordinate of the point. - \param j : A reference to the j coordinate of the point. - \param rho : The rho parameter resulting from the projection of the limbo line considered. - \param theta : The theta parameter resulting from the projection of the limbo line considered. - \param circle : A pointer to the circle we consider. -*/ -void -vpMbtDistanceCylinder::getCylinderLineExtremity(double &i, double &j,double rho, double theta, - vpCircle *circle) -{ -// This was taken from the code of art-v1. (from the artCylinder class) - double px = cam.get_px() ; - double py = cam.get_py() ; - double u0 = cam.get_u0() ; - double v0 = cam.get_v0() ; - - double mu11 = circle->p[3]; - double mu02 = circle->p[4]; - double mu20 = circle->p[2]; - double Xg = u0 + circle->p[0]*px; - double Yg = v0 + circle->p[1]*py; - - // Find Intersection between line and ellipse in the image. - - // Optimised calculation for X - double stheta = sin(theta); - double ctheta = cos(theta); - double sctheta = stheta*ctheta; - double m11yg = mu11*Yg; - double ctheta2 = vpMath::sqr(ctheta); - double m02xg = mu02*Xg; - double m11stheta = mu11*stheta; - j = ((mu11*Xg*sctheta-mu20*Yg*sctheta+mu20*rho*ctheta - -m11yg+m11yg*ctheta2+m02xg-m02xg*ctheta2+ - m11stheta*rho)/(mu20*ctheta2+2.0*m11stheta*ctheta - +mu02-mu02*ctheta2)); - //Optimised calculation for Y - double rhom02 = rho*mu02; - double sctheta2 = stheta*ctheta2; - double ctheta3 = ctheta2*ctheta; - i = (-(-rho*mu11*stheta*ctheta-rhom02+rhom02*ctheta2 - +mu11*Xg*sctheta2-mu20*Yg*sctheta2-ctheta*mu11*Yg - +ctheta3*mu11*Yg+ctheta*mu02*Xg-ctheta3*mu02*Xg)/ - (mu20*ctheta2+2.0*mu11*stheta*ctheta+mu02- - mu02*ctheta2)/stheta); - -} - - /*! Initialize the moving edge thanks to a given pose of the camera. The 3D model is projected into the image to create moving edges along the lines. @@ -278,10 +222,10 @@ vpMbtDistanceCylinder::initMovingEdge(const vpImage<unsigned char> &I, const vpH // Determine intersections between circles and limbos double i11,i12,i21,i22,j11,j12,j21,j22; - getCylinderLineExtremity(i11, j11, rho1, theta1, cercle1); - getCylinderLineExtremity(i12, j12, rho1, theta1, cercle2); - getCylinderLineExtremity(i21, j21, rho2, theta2, cercle1); - getCylinderLineExtremity(i22, j22, rho2, theta2, cercle2); + vpCircle::computeIntersectionPoint(*cercle1, cam, rho1, theta1, i11, j11); + vpCircle::computeIntersectionPoint(*cercle2, cam, rho1, theta1, i12, j12); + vpCircle::computeIntersectionPoint(*cercle1, cam, rho2, theta2, i21, j21); + vpCircle::computeIntersectionPoint(*cercle2, cam, rho2, theta2, i22, j22); // Create the image points vpImagePoint ip11,ip12,ip21,ip22; @@ -414,11 +358,11 @@ vpMbtDistanceCylinder::updateMovingEdge(const vpImage<unsigned char> &I, const v // Determine intersections between circles and limbos double i11,i12,i21,i22,j11,j12,j21,j22; - getCylinderLineExtremity(i11, j11, rho1, theta1, cercle1); - getCylinderLineExtremity(i12, j12, rho1, theta1, cercle2); + vpCircle::computeIntersectionPoint(*cercle1, cam, rho1, theta1, i11, j11); + vpCircle::computeIntersectionPoint(*cercle2, cam, rho1, theta1, i12, j12); - getCylinderLineExtremity(i21, j21, rho2, theta2, cercle1); - getCylinderLineExtremity(i22, j22, rho2, theta2, cercle2); + vpCircle::computeIntersectionPoint(*cercle1, cam, rho2, theta2, i21, j21); + vpCircle::computeIntersectionPoint(*cercle2, cam, rho2, theta2, i22, j22); // Create the image points vpImagePoint ip11,ip12,ip21,ip22; @@ -546,11 +490,11 @@ vpMbtDistanceCylinder::display(const vpImage<unsigned char>&I, const vpHomogeneo // Determine intersections between circles and limbos double i11,i12,i21,i22,j11,j12,j21,j22; - getCylinderLineExtremity(i11, j11, rho1, theta1, cercle1); - getCylinderLineExtremity(i12, j12, rho1, theta1, cercle2); + vpCircle::computeIntersectionPoint(*cercle1, cam, rho1, theta1, i11, j11); + vpCircle::computeIntersectionPoint(*cercle2, cam, rho1, theta1, i12, j12); - getCylinderLineExtremity(i21, j21, rho2, theta2, cercle1); - getCylinderLineExtremity(i22, j22, rho2, theta2, cercle2); + vpCircle::computeIntersectionPoint(*cercle1, cam, rho2, theta2, i21, j21); + vpCircle::computeIntersectionPoint(*cercle2, cam, rho2, theta2, i22, j22); // Create the image points vpImagePoint ip11,ip12,ip21,ip22; @@ -610,11 +554,11 @@ vpMbtDistanceCylinder::display(const vpImage<vpRGBa> &I, const vpHomogeneousMatr // Determine intersections between circles and limbos double i11,i12,i21,i22,j11,j12,j21,j22; - getCylinderLineExtremity(i11, j11, rho1, theta1, cercle1); - getCylinderLineExtremity(i12, j12, rho1, theta1, cercle2); + vpCircle::computeIntersectionPoint(*cercle1, cam, rho1, theta1, i11, j11); + vpCircle::computeIntersectionPoint(*cercle2, cam, rho1, theta1, i12, j12); - getCylinderLineExtremity(i21, j21, rho2, theta2, cercle1); - getCylinderLineExtremity(i22, j22, rho2, theta2, cercle2); + vpCircle::computeIntersectionPoint(*cercle1, cam, rho2, theta2, i21, j21); + vpCircle::computeIntersectionPoint(*cercle2, cam, rho2, theta2, i22, j22); // Create the image points vpImagePoint ip11,ip12,ip21,ip22; diff --git a/modules/tracker/mbt/src/edge/vpMbtDistanceLine.cpp b/modules/tracker/mbt/src/edge/vpMbtDistanceLine.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c2f5c7c6ad2f118dd664040b7bcda565621b2c24 --- /dev/null +++ b/modules/tracker/mbt/src/edge/vpMbtDistanceLine.cpp @@ -0,0 +1,849 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Make the complete tracking of an object by using its CAD model + * + * Authors: + * Nicolas Melchior + * Romain Tallonneau + * Eric Marchand + * + *****************************************************************************/ +#include <visp3/core/vpConfig.h> + +/*! + \file vpMbtDistanceLine.cpp + \brief Make the complete tracking of an object by using its CAD model. +*/ + +#include <visp3/mbt/vpMbtDistanceLine.h> +#include <visp3/core/vpPlane.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <stdlib.h> + +void buildPlane(vpPoint &P, vpPoint &Q, vpPoint &R, vpPlane &plane); +void buildLine(vpPoint &P1, vpPoint &P2, vpPoint &P3, vpPoint &P4, vpLine &L); + +/*! + Basic constructor +*/ +vpMbtDistanceLine::vpMbtDistanceLine() + : name(), index(0), cam(), me(NULL), isTrackedLine(true), isTrackedLineWithVisibility(true), + wmean(1), featureline(), poly(), useScanLine(false), meline(), line(NULL), p1(NULL), p2(NULL), L(), + error(), nbFeature(), nbFeatureTotal(0), Reinit(false), hiddenface(NULL), Lindex_polygon(), + Lindex_polygon_tracked(), isvisible(false) +{ +} + +/*! + Basic destructor useful to deallocate the memory. +*/ +vpMbtDistanceLine::~vpMbtDistanceLine() +{ +// cout << "Deleting line " << index << endl ; + if (line != NULL) delete line ; + + for(unsigned int i = 0 ; i < meline.size() ; i++) + if (meline[i] != NULL) delete meline[i] ; + + meline.clear(); +} + +/*! + Project the line and the two points corresponding to its extremities into the image. + + \param cMo : The pose of the camera used to project the line into the image. +*/ +void +vpMbtDistanceLine::project(const vpHomogeneousMatrix &cMo) +{ + line->project(cMo) ; + p1->project(cMo) ; + p2->project(cMo) ; +} + +/*! + Build a 3D plane thanks to 3 points and stores it in \f$ plane \f$. + + \param P : The first point to define the plane + \param Q : The second point to define the plane + \param R : The third point to define the plane + \param plane : The vpPlane instance used to store the computed plane equation. +*/ +void +buildPlane(vpPoint &P, vpPoint &Q, vpPoint &R, vpPlane &plane) +{ + vpColVector a(3); + vpColVector b(3); + vpColVector n(3); + //Calculate vector corresponding to PQ + a[0]=P.get_oX()-Q.get_oX(); + a[1]=P.get_oY()-Q.get_oY(); + a[2]=P.get_oZ()-Q.get_oZ(); + + //Calculate vector corresponding to PR + b[0]=P.get_oX()-R.get_oX(); + b[1]=P.get_oY()-R.get_oY(); + b[2]=P.get_oZ()-R.get_oZ(); + + //Calculate normal vector to plane PQ x PR + n=vpColVector::cross(a,b); + + //Equation of the plane is given by: + double A = n[0]; + double B = n[1]; + double C = n[2]; + double D=-(A*P.get_oX()+B*P.get_oY()+C*P.get_oZ()); + + double norm = sqrt(A*A+B*B+C*C) ; + plane.setA(A/norm) ; + plane.setB(B/norm) ; + plane.setC(C/norm) ; + plane.setD(D/norm) ; +} + + +/*! + Build a line thanks to 4 points. + + The method is the following : Two plane are computed thanks to (P1,P2,P3) and (P1,P2,P4) (see the buildPlane method). Then the line equation is computed thanks to the intersection between the two planes. + + \param P1 : The first point to compute the line. + \param P2 : The second point to compute the line. + \param P3 : The third point to compute the line. + \param P4 : The fourth point to compute the line. + \param L : The instance of vpLine to store the computed line equation. +*/ +void +buildLine(vpPoint &P1, vpPoint &P2, vpPoint &P3, vpPoint &P4, vpLine &L) +{ + vpPlane plane1; + vpPlane plane2 ; + buildPlane(P1,P2,P3,plane1) ; + buildPlane(P1,P2,P4,plane2) ; + + L.setWorldCoordinates(plane1.getA(),plane1.getB(), plane1.getC(),plane1.getD(), + plane2.getA(),plane2.getB(), plane2.getC(),plane2.getD()) ; +} + + +/*! + Build a vpMbtDistanceLine thanks to two points corresponding to the extremities. + + \param _p1 : The first extremity. + \param _p2 : The second extremity. +*/ +void +vpMbtDistanceLine::buildFrom(vpPoint &_p1, vpPoint &_p2) +{ + line = new vpLine ; + poly.setNbPoint(2); + poly.addPoint(0, _p1); + poly.addPoint(1, _p2); + + p1 = &poly.p[0]; + p2 = &poly.p[1]; + + vpColVector V1(3); + vpColVector V2(3); + vpColVector V3(3); + vpColVector V4(3); + + V1[0] = p1->get_oX(); + V1[1] = p1->get_oY(); + V1[2] = p1->get_oZ(); + V2[0] = p2->get_oX(); + V2[1] = p2->get_oY(); + V2[2] = p2->get_oZ(); + + //if((V1-V2).sumSquare()!=0) + if(std::fabs((V1-V2).sumSquare()) > std::numeric_limits<double>::epsilon()) + { + { + V3[0]=double(rand()%1000)/100; + V3[1]=double(rand()%1000)/100; + V3[2]=double(rand()%1000)/100; + + + vpColVector v_tmp1,v_tmp2; + v_tmp1 = V2-V1; + v_tmp2 = V3-V1; + V4=vpColVector::cross(v_tmp1,v_tmp2); + } + + vpPoint P3(V3[0],V3[1],V3[2]); + vpPoint P4(V4[0],V4[1],V4[2]); + buildLine(*p1,*p2, P3,P4, *line) ; + } + else + { + vpPoint P3(V1[0],V1[1],V1[2]); + vpPoint P4(V2[0],V2[1],V2[2]); + buildLine(*p1,*p2,P3,P4,*line) ; + } +} + +/*! + Add a polygon to the list of polygons the line belongs to. + + \param idx : Index of the polygon +*/ +void +vpMbtDistanceLine::addPolygon(const int &idx) +{ + Lindex_polygon.push_back(idx); + Lindex_polygon_tracked.push_back(true); +} + +/*! + Set if the line has to considered during tracking phase. + Line won't be considered if all of its polygons are desactivated. + + \param polyname : name of the polygons that have to be modified. + \param track : True if the polygon has to be tracked, False otherwise. +*/ +void +vpMbtDistanceLine::setTracked(const std::string &polyname, const bool &track) +{ + unsigned int ind = 0; + for(std::list<int>::const_iterator itpoly=Lindex_polygon.begin(); itpoly!=Lindex_polygon.end(); ++itpoly){ + if((*hiddenface)[(unsigned)(*itpoly)]->getName() == polyname){ + Lindex_polygon_tracked[ind] = track; + } + ind++; + } + + isTrackedLine = false; + for(unsigned int i = 0 ; i < Lindex_polygon_tracked.size() ; i++) + if(Lindex_polygon_tracked[i]) + { + isTrackedLine = true; + break; + } + + if(!isTrackedLine){ + isTrackedLineWithVisibility = false; + return; + } + + updateTracked(); +} + +/*! + Update the boolean specifying if the line has to be tracked. + It takes into account the desactivated polygons and the visibility of the others. +*/ +void +vpMbtDistanceLine::updateTracked() +{ + if(!isTrackedLine){ + isTrackedLineWithVisibility = false; + return; + } + + unsigned int ind = 0; + isTrackedLineWithVisibility = false; + for(std::list<int>::const_iterator itpoly=Lindex_polygon.begin(); itpoly!=Lindex_polygon.end(); ++itpoly){ + if((*hiddenface)[(unsigned)(*itpoly)]->isVisible() && Lindex_polygon_tracked[ind]){ + isTrackedLineWithVisibility = true; + break; + } + ind++; + } +} + +/*! + Set the moving edge parameters. + + \param _me : an instance of vpMe containing all the desired parameters +*/ +void +vpMbtDistanceLine::setMovingEdge(vpMe *_me) +{ + me = _me ; + + for(unsigned int i = 0 ; i < meline.size() ; i++) + if (meline[i] != NULL) + { +// nbFeature[i] = 0; + meline[i]->reset(); + meline[i]->setMe(me) ; + } + +// nbFeatureTotal = 0; +} + + +/*! + Initialize the moving edge thanks to a given pose of the camera. + The 3D model is projected into the image to create moving edges along the line. + + \param I : The image. + \param cMo : The pose of the camera used to initialize the moving edges. + \return false if an error occur, true otherwise. +*/ +bool +vpMbtDistanceLine::initMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo) +{ + for(unsigned int i = 0 ; i < meline.size() ; i++){ + if (meline[i] != NULL) delete meline[i] ; + } + + meline.clear(); + nbFeature.clear(); + nbFeatureTotal = 0; + + if(isvisible) + { + p1->changeFrame(cMo); + p2->changeFrame(cMo); + + if(poly.getClipping() > 3) // Contains at least one FOV constraint + cam.computeFov(I.getWidth(), I.getHeight()); + + poly.computePolygonClipped(cam); + + if(poly.polyClipped.size() == 2){ //Les points sont visibles. + + std::vector<std::pair<vpPoint, vpPoint> > linesLst; + + if(useScanLine){ + hiddenface->computeScanLineQuery(poly.polyClipped[0].first,poly.polyClipped[1].first,linesLst); + } + else{ + linesLst.push_back(std::make_pair(poly.polyClipped[0].first,poly.polyClipped[1].first)); + } + + if(linesLst.size() == 0){ +// isvisible = false; + return false; + } + + // To have the exact same pose values as the old version (angle or ogre visibility test only), points should be reorganised when using scanline algorithm. +// if(sqrt(vpMath::sqr(poly.polyClipped[0].first.get_X() - linesLst[0].first.get_X())) > sqrt(vpMath::sqr(poly.polyClipped[0].first.get_X() - linesLst[0].second.get_X()))) +// { +// std::vector<std::pair<vpPoint, vpPoint> > linesLstTmp; +// for(int i = linesLst.size()-1 ; i >= 0 ; i--) +// linesLstTmp.push_back(std::make_pair(linesLst[i].second,linesLst[i].first)); +// linesLst = linesLstTmp; +// } + + line->changeFrame(cMo); + line->projection(); + double rho,theta; + //rho theta uv + vpMeterPixelConversion::convertLine(cam,line->getRho(),line->getTheta(),rho,theta); + + while (theta > M_PI) { theta -= M_PI ; } + while (theta < -M_PI) { theta += M_PI ; } + + if (theta < -M_PI/2.0) theta = -theta - 3*M_PI/2.0; + else theta = M_PI/2.0 - theta; + + + for(unsigned int i = 0 ; i < linesLst.size() ; i++){ + vpImagePoint ip1, ip2; + + linesLst[i].first.project(); + linesLst[i].second.project(); + + vpMeterPixelConversion::convertPoint(cam,linesLst[i].first.get_x(),linesLst[i].first.get_y(),ip1); + vpMeterPixelConversion::convertPoint(cam,linesLst[i].second.get_x(),linesLst[i].second.get_y(),ip2); + + vpMbtMeLine *melinePt = new vpMbtMeLine ; + melinePt->setMe(me) ; + + // meline[i]->setDisplay(vpMeSite::RANGE_RESULT) ; + melinePt->setInitRange(0); + + int marge = /*10*/5; //ou 5 normalement + if (ip1.get_j()<ip2.get_j()) { melinePt->jmin = (int)ip1.get_j()-marge ; melinePt->jmax = (int)ip2.get_j()+marge ; } else{ melinePt->jmin = (int)ip2.get_j()-marge ; melinePt->jmax = (int)ip1.get_j()+marge ; } + if (ip1.get_i()<ip2.get_i()) { melinePt->imin = (int)ip1.get_i()-marge ; melinePt->imax = (int)ip2.get_i()+marge ; } else{ melinePt->imin = (int)ip2.get_i()-marge ; melinePt->imax = (int)ip1.get_i()+marge ; } + + try + { + melinePt->initTracking(I,ip1,ip2,rho,theta); + meline.push_back(melinePt); + // nbFeature.push_back((unsigned int) melinePt->getMeList().size()); + // nbFeatureTotal += nbFeature.back(); + } + catch(...) + { + //vpTRACE("the line can't be initialized"); + // if (melinePt!=NULL) delete melinePt; + // melinePt=NULL; + // isvisible = false; + return false; + } + } + } + else{ + isvisible = false; +// return false; + } + } + +// trackMovingEdge(I,cMo) ; + return true; +} + + + +/*! + Track the moving edges in the image. + + \param I : the image. + \param cMo : The pose of the camera. +*/ +void +vpMbtDistanceLine::trackMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix & /*cMo*/) +{ + + if (isvisible) + { +// p1->changeFrame(cMo) ; +// p2->changeFrame(cMo) ; +// +// p1->projection() ; +// p2->projection() ; +// +// vpImagePoint ip1, ip2; +// +// vpMeterPixelConversion::convertPoint(*cam,p1->get_x(),p1->get_y(),ip1) ; +// vpMeterPixelConversion::convertPoint(*cam,p2->get_x(),p2->get_y(),ip2) ; +// +// int marge = /*10*/5; //ou 5 normalement +// if (ip1.get_j()<ip2.get_j()) { meline->jmin = ip1.get_j()-marge ; meline->jmax = ip2.get_j()+marge ; } +// else{ meline->jmin = ip2.get_j()-marge ; meline->jmax = ip1.get_j()+marge ; } +// if (ip1.get_i()<ip2.get_i()) { meline->imin = ip1.get_i()-marge ; meline->imax = ip2.get_i()+marge ; } +// else{ meline->imin = ip2.get_i()-marge ; meline->imax = ip1.get_i()+marge ; } + + try + { + nbFeatureTotal = 0; + for(unsigned int i = 0 ; i < meline.size() ; i++){ + meline[i]->track(I) ; + nbFeature.push_back((unsigned int) meline[i]->getMeList().size()); + nbFeatureTotal += (unsigned int) meline[i]->getMeList().size(); + } + } + catch(...) + { + for(unsigned int i = 0 ; i < meline.size() ; i++){ + if (meline[i] != NULL) delete meline[i] ; + } + + nbFeature.clear(); + meline.clear(); + nbFeatureTotal = 0; + Reinit = true; + isvisible = false; + } + } +} + + +/*! + Update the moving edges internal parameters. + + \param I : the image. + \param cMo : The pose of the camera. +*/ +void +vpMbtDistanceLine::updateMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo) +{ + if(isvisible){ + p1->changeFrame(cMo); + p2->changeFrame(cMo); + + if(poly.getClipping() > 3) // Contains at least one FOV constraint + cam.computeFov(I.getWidth(), I.getHeight()); + + poly.computePolygonClipped(cam); + + if(poly.polyClipped.size() == 2){ //Les points sont visibles. + + std::vector<std::pair<vpPoint, vpPoint> > linesLst; + + if(useScanLine){ + hiddenface->computeScanLineQuery(poly.polyClipped[0].first,poly.polyClipped[1].first,linesLst); + } + else{ + linesLst.push_back(std::make_pair(poly.polyClipped[0].first,poly.polyClipped[1].first)); + } + + if(linesLst.size() != meline.size() || linesLst.size() == 0){ + for(unsigned int i = 0 ; i < meline.size() ; i++){ + if (meline[i] != NULL) delete meline[i] ; + } + + meline.clear(); + nbFeature.clear(); + nbFeatureTotal = 0; + isvisible = false; + Reinit = true; + } + else{ + + // To have the exact same pose values as the old version (angle or ogre visibility test only), points should be reorganised when using scanline algorithm. +// if(sqrt(vpMath::sqr(poly.polyClipped[0].first.get_X() - linesLst[0].first.get_X())) > sqrt(vpMath::sqr(poly.polyClipped[0].first.get_X() - linesLst[0].second.get_X()))) +// { +// std::vector<std::pair<vpPoint, vpPoint> > linesLstTmp; +// for(int i = linesLst.size()-1 ; i >= 0 ; i--) +// linesLstTmp.push_back(std::make_pair(linesLst[i].second,linesLst[i].first)); +// linesLst = linesLstTmp; +// } + + line->changeFrame(cMo); + line->projection(); + double rho,theta; + //rho theta uv + vpMeterPixelConversion::convertLine(cam,line->getRho(),line->getTheta(),rho,theta); + + while (theta > M_PI) { theta -= M_PI ; } + while (theta < -M_PI) { theta += M_PI ; } + + if (theta < -M_PI/2.0) theta = -theta - 3*M_PI/2.0; + else theta = M_PI/2.0 - theta; + + + try + { + for(unsigned int i = 0 ; i < linesLst.size() ; i++){ + vpImagePoint ip1, ip2; + + linesLst[i].first.project(); + linesLst[i].second.project(); + + vpMeterPixelConversion::convertPoint(cam,linesLst[i].first.get_x(),linesLst[i].first.get_y(),ip1); + vpMeterPixelConversion::convertPoint(cam,linesLst[i].second.get_x(),linesLst[i].second.get_y(),ip2); + + int marge = /*10*/5; //ou 5 normalement + if (ip1.get_j()<ip2.get_j()) { meline[i]->jmin = (int)ip1.get_j()-marge ; meline[i]->jmax = (int)ip2.get_j()+marge ; } else{ meline[i]->jmin = (int)ip2.get_j()-marge ; meline[i]->jmax = (int)ip1.get_j()+marge ; } + if (ip1.get_i()<ip2.get_i()) { meline[i]->imin = (int)ip1.get_i()-marge ; meline[i]->imax = (int)ip2.get_i()+marge ; } else{ meline[i]->imin = (int)ip2.get_i()-marge ; meline[i]->imax = (int)ip1.get_i()+marge ; } + + meline[i]->updateParameters(I,ip1,ip2,rho,theta) ; + nbFeature[i] = (unsigned int)meline[i]->getMeList().size(); + nbFeatureTotal += nbFeature[i]; + } + } + catch(...) + { + for(unsigned int j = 0 ; j < meline.size() ; j++){ + if (meline[j] != NULL) delete meline[j] ; + } + + meline.clear(); + nbFeature.clear(); + nbFeatureTotal = 0; + isvisible = false; + Reinit = true; + } + } + } + else{ + for(unsigned int i = 0 ; i < meline.size() ; i++){ + if (meline[i] != NULL) delete meline[i] ; + } + nbFeature.clear(); + meline.clear(); + nbFeatureTotal = 0; + isvisible = false; + } + } +} + + +/*! + Reinitialize the line if it is required. + + A line is reinitialized if the 2D line do not match enough with the projected 3D line. + + \param I : the image. + \param cMo : The pose of the camera. +*/ +void +vpMbtDistanceLine::reinitMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo) +{ + for(unsigned int i = 0 ; i < meline.size() ; i++){ + if (meline[i] != NULL) delete meline[i] ; + } + + nbFeature.clear(); + meline.clear(); + nbFeatureTotal = 0; + + if (initMovingEdge(I,cMo) == false) + Reinit = true; + + Reinit = false; +} + + +/*! + Display the line. The 3D line is projected into the image. + + \param I : The image. + \param cMo : Pose used to project the 3D model into the image. + \param camera : The camera parameters. + \param col : The desired color. + \param thickness : The thickness of the line. + \param displayFullModel : If true, the line is displayed even if it is not visible. +*/ +void +vpMbtDistanceLine::display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, + const vpCameraParameters &camera, const vpColor col, const unsigned int thickness, const bool displayFullModel) +{ + if(isvisible || displayFullModel){ + p1->changeFrame(cMo); + p2->changeFrame(cMo); + + vpImagePoint ip1, ip2; + vpCameraParameters c = camera; + if(poly.getClipping() > 3) // Contains at least one FOV constraint + c.computeFov(I.getWidth(), I.getHeight()); + + poly.computePolygonClipped(c); + + if( poly.polyClipped.size() == 2 && + ((poly.polyClipped[1].second & poly.polyClipped[0].second & vpPolygon3D::NEAR_CLIPPING) == 0) && + ((poly.polyClipped[1].second & poly.polyClipped[0].second & vpPolygon3D::FAR_CLIPPING) == 0) && + ((poly.polyClipped[1].second & poly.polyClipped[0].second & vpPolygon3D::DOWN_CLIPPING) == 0) && + ((poly.polyClipped[1].second & poly.polyClipped[0].second & vpPolygon3D::UP_CLIPPING) == 0) && + ((poly.polyClipped[1].second & poly.polyClipped[0].second & vpPolygon3D::LEFT_CLIPPING) == 0) && + ((poly.polyClipped[1].second & poly.polyClipped[0].second & vpPolygon3D::RIGHT_CLIPPING) == 0)){ + + std::vector<std::pair<vpPoint, vpPoint> > linesLst; + if(useScanLine && !displayFullModel){ + hiddenface->computeScanLineQuery(poly.polyClipped[0].first,poly.polyClipped[1].first,linesLst,true); + } + else{ + linesLst.push_back(std::make_pair(poly.polyClipped[0].first,poly.polyClipped[1].first)); + } + + for(unsigned int i = 0 ; i < linesLst.size() ; i++){ + linesLst[i].first.project(); + linesLst[i].second.project(); + + vpMeterPixelConversion::convertPoint(camera,linesLst[i].first.get_x(),linesLst[i].first.get_y(),ip1); + vpMeterPixelConversion::convertPoint(camera,linesLst[i].second.get_x(),linesLst[i].second.get_y(),ip2); + + vpDisplay::displayLine(I,ip1,ip2,col, thickness); + } + } + } +} + + +/*! + Display the line. The 3D line is projected into the image. + + \param I : The image. + \param cMo : Pose used to project the 3D model into the image. + \param camera : The camera parameters. + \param col : The desired color. + \param thickness : The thickness of the line. + \param displayFullModel : If true, the line is displayed even if it is not visible. +*/ +void +vpMbtDistanceLine::display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, + const vpCameraParameters &camera, const vpColor col, + const unsigned int thickness, const bool displayFullModel) +{ + if(isvisible || displayFullModel){ + p1->changeFrame(cMo); + p2->changeFrame(cMo); + + vpImagePoint ip1, ip2; + vpCameraParameters c = camera; + if(poly.getClipping() > 3) // Contains at least one FOV constraint + c.computeFov(I.getWidth(), I.getHeight()); + + poly.computePolygonClipped(c); + + if( poly.polyClipped.size() == 2 && + ((poly.polyClipped[1].second & poly.polyClipped[0].second & vpPolygon3D::NEAR_CLIPPING) == 0) && + ((poly.polyClipped[1].second & poly.polyClipped[0].second & vpPolygon3D::FAR_CLIPPING) == 0) && + ((poly.polyClipped[1].second & poly.polyClipped[0].second & vpPolygon3D::DOWN_CLIPPING) == 0) && + ((poly.polyClipped[1].second & poly.polyClipped[0].second & vpPolygon3D::UP_CLIPPING) == 0) && + ((poly.polyClipped[1].second & poly.polyClipped[0].second & vpPolygon3D::LEFT_CLIPPING) == 0) && + ((poly.polyClipped[1].second & poly.polyClipped[0].second & vpPolygon3D::RIGHT_CLIPPING) == 0)){ + + std::vector<std::pair<vpPoint, vpPoint> > linesLst; + if(useScanLine && !displayFullModel){ + hiddenface->computeScanLineQuery(poly.polyClipped[0].first,poly.polyClipped[1].first,linesLst,true); + } + else{ + linesLst.push_back(std::make_pair(poly.polyClipped[0].first,poly.polyClipped[1].first)); + } + + for(unsigned int i = 0 ; i < linesLst.size() ; i++){ + linesLst[i].first.project(); + linesLst[i].second.project(); + + vpMeterPixelConversion::convertPoint(camera,linesLst[i].first.get_x(),linesLst[i].first.get_y(),ip1); + vpMeterPixelConversion::convertPoint(camera,linesLst[i].second.get_x(),linesLst[i].second.get_y(),ip2); + + vpDisplay::displayLine(I,ip1,ip2,col, thickness); + } + } + } +} + + +/*! + Enable to display the points along the line with a color corresponding to their state. + + - If green : The vpMeSite is a good point. + - If blue : The point is removed because of the vpMeSite tracking phase (constrast problem). + - If purple : The point is removed because of the vpMeSite tracking phase (threshold problem). + - If blue : The point is removed because of the robust method in the virtual visual servoing. + + \param I : The image. +*/ +void +vpMbtDistanceLine::displayMovingEdges(const vpImage<unsigned char> &I) +{ + for(unsigned int i = 0 ; i < meline.size() ; i++) + if (meline[i] != NULL) + { + meline[i]->display(I); + } +} + +/*! + Initialize the size of the interaction matrix and the error vector. +*/ +void +vpMbtDistanceLine::initInteractionMatrixError() +{ + if (isvisible == true) + { + L.resize(nbFeatureTotal,6) ; + error.resize(nbFeatureTotal) ; + } + else{ + for(unsigned int i = 0 ; i < meline.size() ; i++) + nbFeature[i] = 0; + nbFeatureTotal = 0 ; + } +} + +/*! + Compute the interaction matrix and the error vector corresponding to the line. +*/ +void +vpMbtDistanceLine::computeInteractionMatrixError(const vpHomogeneousMatrix &cMo) +{ + if (isvisible) + { + // feature projection + line->changeFrame(cMo) ; + line->projection() ; + + vpFeatureBuilder::create(featureline,*line) ; + + double rho = featureline.getRho() ; + double theta = featureline.getTheta() ; + + double co = cos(theta); + double si = sin(theta); + + double mx = 1.0/cam.get_px() ; + double my = 1.0/cam.get_py() ; + double xc = cam.get_u0() ; + double yc = cam.get_v0() ; + + double alpha_ ; + vpMatrix H ; + H = featureline.interaction() ; + + double x,y ; + vpMeSite p ; + unsigned int j =0 ; + + for(unsigned int i = 0 ; i < meline.size() ; i++){ + for(std::list<vpMeSite>::const_iterator it=meline[i]->getMeList().begin(); it!=meline[i]->getMeList().end(); ++it){ + x = (double)it->j ; + y = (double)it->i ; + + x = (x-xc)*mx ; + y = (y-yc)*my ; + + alpha_ = x*si - y*co; + + double *Lrho = H[0] ; + double *Ltheta = H[1] ; + // Calculate interaction matrix for a distance + for (unsigned int k=0 ; k < 6 ; k++) + { + L[j][k] = (Lrho[k] + alpha_*Ltheta[k]); + } + error[j] = rho - ( x*co + y*si) ; + j++; + } + } + } +} + +/*! + Test wether the line is close to the border of the image (at a given threshold) + + \param I : the input image (to know its size) + \param threshold : the threshold in pixel + \return true if the line is near the border of the image +*/ +bool +vpMbtDistanceLine::closeToImageBorder(const vpImage<unsigned char>& I, const unsigned int threshold) +{ + if(threshold > I.getWidth() || threshold > I.getHeight()){ + return true; + } + if (isvisible){ + + for(unsigned int i = 0 ; i < meline.size() ; i++){ + for(std::list<vpMeSite>::const_iterator it=meline[i]->getMeList().begin(); it!=meline[i]->getMeList().end(); ++it){ + int i_ = it->i ; + int j_ = it->j ; + + if(i_ < 0 || j_ < 0){ //out of image. + return true; + } + + if( ((unsigned int)i_ > (I.getHeight()- threshold) ) || (unsigned int)i_ < threshold || + ((unsigned int)j_ > (I.getWidth ()- threshold) ) || (unsigned int)j_ < threshold ) { + return true; + } + } + } + } + return false; +} diff --git a/src/tracking/mbt/edge/vpMbtMeEllipse.cpp b/modules/tracker/mbt/src/edge/vpMbtMeEllipse.cpp similarity index 61% rename from src/tracking/mbt/edge/vpMbtMeEllipse.cpp rename to modules/tracker/mbt/src/edge/vpMbtMeEllipse.cpp index 2fe646b268b1ff05f37fdbedcdcfd810cdad62cf..9bd80418fa386159b0d39eaad150f4fdfd21a441 100644 --- a/src/tracking/mbt/edge/vpMbtMeEllipse.cpp +++ b/modules/tracker/mbt/src/edge/vpMbtMeEllipse.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbtMeEllipse.cpp 4706 2014-03-28 07:52:00Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -41,16 +37,17 @@ #ifndef DOXYGEN_SHOULD_SKIP_THIS -#include <visp/vpMbtMeEllipse.h> +#include <visp3/mbt/vpMbtMeEllipse.h> -#include <visp/vpMe.h> -#include <visp/vpRobust.h> -#include <visp/vpTrackingException.h> -#include <visp/vpDebug.h> -#include <visp/vpImagePoint.h> +#include <visp3/me/vpMe.h> +#include <visp3/core/vpRobust.h> +#include <visp3/core/vpTrackingException.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpImagePoint.h> #include <cmath> // std::fabs #include <limits> // numeric_limits +#include <algorithm> // std::min /*! @@ -92,6 +89,195 @@ vpMbtMeEllipse::~vpMbtMeEllipse() list.clear(); } +/*! + Compute the projection error of the ellipse. + Compare the gradient direction around samples of the ellipse to the normal of the tangent of the considered sample. + Error is expressed in radians between 0 and M_PI/2.0; + + \param _I : Image in which the line appears. + \param _sumErrorRad : sum of the error per feature. + \param _nbFeatures : Number of features used to compute _sumErrorRad. +*/ +void +vpMbtMeEllipse::computeProjectionError(const vpImage<unsigned char>& _I, double &_sumErrorRad, unsigned int &_nbFeatures) +{ + _sumErrorRad = 0; + _nbFeatures = 0; + +// vpMatrix filterX(3,3); +// filterX[0][0] = -1; +// filterX[1][0] = -2; +// filterX[2][0] = -1; + +// filterX[0][1] = 0; +// filterX[1][1] = 0; +// filterX[2][1] = 0; + +// filterX[0][2] = 1; +// filterX[1][2] = 2; +// filterX[2][2] = 1; + +// vpMatrix filterY(3,3); +// filterY[0][0] = -1; +// filterY[0][1] = -2; +// filterY[0][2] = -1; + +// filterY[1][0] = 0; +// filterY[1][1] = 0; +// filterY[1][2] = 0; + +// filterY[2][0] = 1; +// filterY[2][1] = 2; +// filterY[2][2] = 1; + + vpMatrix filterX(5,5); + filterX[0][0] = -1; + filterX[1][0] = -4; + filterX[2][0] = -6; + filterX[3][0] = -4; + filterX[4][0] = -1; + + filterX[0][1] = -2; + filterX[1][1] = -8; + filterX[2][1] = -12; + filterX[3][1] = -8; + filterX[4][1] = -2; + + filterX[0][2] = 0; + filterX[1][2] = 0; + filterX[2][2] = 0; + filterX[3][2] = 0; + filterX[4][2] = 0; + + filterX[0][3] = 2; + filterX[1][3] = 8; + filterX[2][3] = 12; + filterX[3][3] = 8; + filterX[4][3] = 2; + + filterX[0][4] = 1; + filterX[1][4] = 4; + filterX[2][4] = 6; + filterX[3][4] = 4; + filterX[4][4] = 1; + + vpMatrix filterY(5,5); + filterY[0][0] = -1; + filterY[0][1] = -4; + filterY[0][2] = -6; + filterY[0][3] = -4; + filterY[0][4] = -1; + + filterY[1][0] = -2; + filterY[1][1] = -8; + filterY[1][2] = -12; + filterY[1][3] = -8; + filterY[1][4] = -2; + + filterY[2][0] = 0; + filterY[2][1] = 0; + filterY[2][2] = 0; + filterY[2][3] = 0; + filterY[2][4] = 0; + + filterY[3][0] = 2; + filterY[3][1] = 8; + filterY[3][2] = 12; + filterY[3][3] = 8; + filterY[3][4] = 2; + + filterY[4][0] = 1; + filterY[4][1] = 4; + filterY[4][2] = 6; + filterY[4][3] = 4; + filterY[4][4] = 1; + + double offset = std::floor(filterX.getRows() / 2.0f); +// std::cout << "offset=" << offset << std::endl; + int height = (int) _I.getHeight() ; + int width = (int) _I.getWidth() ; + + for(std::list<vpMeSite>::iterator it=list.begin(); it!=list.end(); ++it){ + double iSite = it->ifloat; + double jSite = it->jfloat; + + if(!outOfImage(vpMath::round(iSite), vpMath::round(jSite), 0, height, width)) { // Check if necessary + // The tangent angle to the ellipse at a site + double theta = atan( (-mu02*jSite + mu02*iPc.get_j() + mu11*iSite - mu11*iPc.get_i()) + / (mu20*iSite - mu11*jSite + mu11*iPc.get_j() - mu20*iPc.get_i())) + - M_PI/2; + + double deltaNormalized = theta; + while (deltaNormalized<0) deltaNormalized += M_PI; + while (deltaNormalized>M_PI) deltaNormalized -= M_PI; + + vpColVector vecSite(2); + vecSite[0] = cos(deltaNormalized); + vecSite[1] = sin(deltaNormalized); + vecSite.normalize(); + + double gradientX = 0; + double gradientY = 0; + + for(unsigned int i = 0; i<filterX.getRows() ; i++){ + double iImg = iSite + (i - offset); + for (unsigned int j = 0; j< filterX.getCols(); j++){ + double jImg = jSite + (j-offset); + + if(iImg < 0) iImg = 0.0; + if(jImg < 0) jImg = 0.0; + + if(iImg > _I.getHeight()-1) iImg = _I.getHeight()-1; + if(jImg > _I.getWidth()-1) jImg = _I.getWidth()-1; + + gradientX += filterX[i][j] * _I((unsigned int)iImg, (unsigned int)jImg); + } + } + + for(unsigned int i = 0; i<filterY.getRows() ; i++){ + double iImg = iSite + (i - offset); + for (unsigned int j = 0; j< filterY.getCols(); j++){ + double jImg = jSite + (j-offset); + + if(iImg < 0) iImg = 0.0; + if(jImg < 0) jImg = 0.0; + + if(iImg > _I.getHeight()-1) iImg = _I.getHeight()-1; + if(jImg > _I.getWidth()-1) jImg = _I.getWidth()-1; + + gradientY += filterY[i][j] * _I((unsigned int)iImg, (unsigned int)jImg); + } + } + + double angle = atan2(gradientY,gradientX); + while (angle<0) angle += M_PI; + while (angle>M_PI) angle -= M_PI; + +// if(std::fabs(deltaNormalized-angle) > M_PI / 2) +// { +// sumErrorRad += sqrt(vpMath::sqr(deltaNormalized-angle)) - M_PI / 2; +// } else { +// sumErrorRad += sqrt(vpMath::sqr(deltaNormalized-angle)); +// } + +// double angle1 = sqrt(vpMath::sqr(deltaNormalized-angle)); +// double angle2 = sqrt(vpMath::sqr(deltaNormalized- (angle-M_PI))); + + vpColVector vecGrad(2); + vecGrad[0] = cos(angle); + vecGrad[1] = sin(angle); + vecGrad.normalize(); + + double angle1 = acos(vecSite * vecGrad); + double angle2 = acos(vecSite * (-vecGrad)); + + _sumErrorRad += std::min(angle1,angle2); + + _nbFeatures++; + } + } +} + /*! Construct a list of vpMeSite moving edges at a particular sampling step between the two extremities. The two extremities are defined by diff --git a/src/tracking/mbt/edge/vpMbtMeLine.cpp b/modules/tracker/mbt/src/edge/vpMbtMeLine.cpp similarity index 77% rename from src/tracking/mbt/edge/vpMbtMeLine.cpp rename to modules/tracker/mbt/src/edge/vpMbtMeLine.cpp index 6a9c96fd6294fd9386e43838c6e25185ef6a0798..ec5fd1eee9158c2958359605582834616c961785 100644 --- a/src/tracking/mbt/edge/vpMbtMeLine.cpp +++ b/modules/tracker/mbt/src/edge/vpMbtMeLine.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbtMeLine.cpp 5216 2015-01-28 08:03:09Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Make the complete tracking of an object by using its CAD model * @@ -40,7 +36,7 @@ * Eric Marchand * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS /*! @@ -49,10 +45,11 @@ */ #include <cmath> // std::fabs #include <limits> // numeric_limits +#include <algorithm> // std::min -#include <visp/vpMbtMeLine.h> -#include <visp/vpTrackingException.h> -#include <visp/vpRobust.h> +#include <visp3/mbt/vpMbtMeLine.h> +#include <visp3/core/vpTrackingException.h> +#include <visp3/core/vpRobust.h> //! Normalize an angle between -Pi and Pi static void @@ -356,6 +353,189 @@ vpMbtMeLine::seekExtremities(const vpImage<unsigned char> &I) vpCDEBUG(1) << n_sample << " point inserted in the list " << std::endl ; } + +/*! + Compute the projection error of the line. Compare the gradient direction around samples of the line to its direction. + Error is expressed in radians between 0 and M_PI/2.0; + + \param _I : Image in which the line appears. + \param _sumErrorRad : sum of the error per feature. + \param _nbFeatures : Number of features used to compute _sumErrorRad. +*/ +void +vpMbtMeLine::computeProjectionError(const vpImage<unsigned char>& _I, double &_sumErrorRad, unsigned int &_nbFeatures) +{ + _sumErrorRad = 0; + _nbFeatures = 0; + double deltaNormalized = theta; + unsigned int iter = 0; + + while (deltaNormalized<0) deltaNormalized += M_PI; + while (deltaNormalized>M_PI) deltaNormalized -= M_PI; + + vpColVector vecLine(2); + vecLine[0] = cos(deltaNormalized); + vecLine[1] = sin(deltaNormalized); + vecLine.normalize(); + +// vpMatrix filterX(3,3); +// filterX[0][0] = -1; +// filterX[1][0] = -2; +// filterX[2][0] = -1; + +// filterX[0][1] = 0; +// filterX[1][1] = 0; +// filterX[2][1] = 0; + +// filterX[0][2] = 1; +// filterX[1][2] = 2; +// filterX[2][2] = 1; + +// vpMatrix filterY(3,3); +// filterY[0][0] = -1; +// filterY[0][1] = -2; +// filterY[0][2] = -1; + +// filterY[1][0] = 0; +// filterY[1][1] = 0; +// filterY[1][2] = 0; + +// filterY[2][0] = 1; +// filterY[2][1] = 2; +// filterY[2][2] = 1; + + vpMatrix filterX(5,5); + filterX[0][0] = -1; + filterX[1][0] = -4; + filterX[2][0] = -6; + filterX[3][0] = -4; + filterX[4][0] = -1; + + filterX[0][1] = -2; + filterX[1][1] = -8; + filterX[2][1] = -12; + filterX[3][1] = -8; + filterX[4][1] = -2; + + filterX[0][2] = 0; + filterX[1][2] = 0; + filterX[2][2] = 0; + filterX[3][2] = 0; + filterX[4][2] = 0; + + filterX[0][3] = 2; + filterX[1][3] = 8; + filterX[2][3] = 12; + filterX[3][3] = 8; + filterX[4][3] = 2; + + filterX[0][4] = 1; + filterX[1][4] = 4; + filterX[2][4] = 6; + filterX[3][4] = 4; + filterX[4][4] = 1; + + vpMatrix filterY(5,5); + filterY[0][0] = -1; + filterY[0][1] = -4; + filterY[0][2] = -6; + filterY[0][3] = -4; + filterY[0][4] = -1; + + filterY[1][0] = -2; + filterY[1][1] = -8; + filterY[1][2] = -12; + filterY[1][3] = -8; + filterY[1][4] = -2; + + filterY[2][0] = 0; + filterY[2][1] = 0; + filterY[2][2] = 0; + filterY[2][3] = 0; + filterY[2][4] = 0; + + filterY[3][0] = 2; + filterY[3][1] = 8; + filterY[3][2] = 12; + filterY[3][3] = 8; + filterY[3][4] = 2; + + filterY[4][0] = 1; + filterY[4][1] = 4; + filterY[4][2] = 6; + filterY[4][3] = 4; + filterY[4][4] = 1; + + double offset = std::floor(filterX.getRows() / 2.0f); + + for(std::list<vpMeSite>::iterator it=list.begin(); it!=list.end(); ++it){ + if(iter != 0 && iter+1 != list.size()){ + double gradientX = 0; + double gradientY = 0; + + double iSite = it->ifloat; + double jSite = it->jfloat; + + for(unsigned int i = 0; i<filterX.getRows() ; i++){ + double iImg = iSite + (i - offset); + for (unsigned int j = 0; j< filterX.getCols(); j++){ + double jImg = jSite + (j-offset); + + if(iImg < 0) iImg = 0.0; + if(jImg < 0) jImg = 0.0; + + if(iImg > _I.getHeight()-1) iImg = _I.getHeight()-1; + if(jImg > _I.getWidth()-1) jImg = _I.getWidth()-1; + + gradientX += filterX[i][j] * _I((unsigned int)iImg, (unsigned int)jImg); + } + } + + for(unsigned int i = 0; i<filterY.getRows() ; i++){ + double iImg = iSite + (i - offset); + for (unsigned int j = 0; j< filterY.getCols(); j++){ + double jImg = jSite + (j-offset); + + if(iImg < 0) iImg = 0.0; + if(jImg < 0) jImg = 0.0; + + if(iImg > _I.getHeight()-1) iImg = _I.getHeight()-1; + if(jImg > _I.getWidth()-1) jImg = _I.getWidth()-1; + + gradientY += filterY[i][j] * _I((unsigned int)iImg, (unsigned int)jImg); + } + } + + double angle = atan2(gradientX,gradientY); + while (angle<0) angle += M_PI; + while (angle>M_PI) angle -= M_PI; + + vpColVector vecGrad(2); + vecGrad[0] = cos(angle); + vecGrad[1] = sin(angle); + vecGrad.normalize(); + + double angle1 = acos(vecLine * vecGrad); + double angle2 = acos(vecLine * (-vecGrad)); + +// double angle1 = sqrt(vpMath::sqr(deltaNormalized-angle)); +// double angle2 = sqrt(vpMath::sqr(deltaNormalized- (angle-M_PI))); + + _sumErrorRad += std::min(angle1,angle2); + +// if(std::fabs(deltaNormalized-angle) > M_PI / 2) +// { +// sumErrorRad += sqrt(vpMath::sqr(deltaNormalized-angle)) - M_PI / 2; +// } else { +// sumErrorRad += sqrt(vpMath::sqr(deltaNormalized-angle)); +// } + + _nbFeatures++; + } + iter++; + } +} + /*! Resample the line if the number of sample is less than 50% of the expected value. diff --git a/src/tracking/mbt/edge/vpMbtXmlParser.cpp b/modules/tracker/mbt/src/edge/vpMbtXmlParser.cpp similarity index 81% rename from src/tracking/mbt/edge/vpMbtXmlParser.cpp rename to modules/tracker/mbt/src/edge/vpMbtXmlParser.cpp index fef84274535e58a7ee217fee8773972e7015e8ca..8af522d395993afe6ac07dc44046c63aef06fda7 100644 --- a/src/tracking/mbt/edge/vpMbtXmlParser.cpp +++ b/modules/tracker/mbt/src/edge/vpMbtXmlParser.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbtXmlParser.cpp 5238 2015-01-30 13:52:25Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Load XML parameters of the Model based tracker (using edges). * @@ -41,7 +37,7 @@ * Aurelien Yol * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 @@ -51,14 +47,14 @@ #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */ -#include <visp/vpMbtXmlParser.h> +#include <visp3/mbt/vpMbtXmlParser.h> /*! Default constructor. */ -vpMbtXmlParser::vpMbtXmlParser() : m_ecm(), useLod(false), minLineLengthThreshold(50.0), minPolygonAreaThreshold(2500.0) +vpMbtXmlParser::vpMbtXmlParser() : m_ecm() { init(); } @@ -90,11 +86,6 @@ vpMbtXmlParser::init() nodeMap["mu2"] = mu2; nodeMap["sample"] = sample; nodeMap["step"] = step; - nodeMap["nb_sample"] = nb_sample; - nodeMap["lod"] = lod; - nodeMap["use_lod"] = use_lod; - nodeMap["min_line_length_threshold"] = min_line_length_threshold; - nodeMap["min_polygon_area_threshold"] = min_polygon_area_threshold; } /*! @@ -134,7 +125,6 @@ vpMbtXmlParser::readMainClass(xmlDocPtr doc, xmlNodePtr node) bool camera_node = false; bool face_node = false; bool ecm_node = false; - bool sample_node = false; bool lod_node = false; for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) { @@ -155,8 +145,7 @@ vpMbtXmlParser::readMainClass(xmlDocPtr doc, xmlNodePtr node) ecm_node = true; }break; case sample:{ - this->read_sample (doc, dataNode); - sample_node = true; + this->read_sample_deprecated (doc, dataNode); }break; case lod:{ this->read_lod(doc, dataNode); @@ -189,11 +178,7 @@ vpMbtXmlParser::readMainClass(xmlDocPtr doc, xmlNodePtr node) std::cout <<"ecm : contrast : threshold : " << this->m_ecm.getThreshold()<<" (default)" <<std::endl; std::cout <<"ecm : contrast : mu1 : " << this->m_ecm.getMu1()<<" (default)" <<std::endl; std::cout <<"ecm : contrast : mu2 : " << this->m_ecm.getMu2()<<" (default)" <<std::endl; - } - - if(!sample_node) { - std::cout <<"sample : sample_step : "<< this->m_ecm.getSampleStep()<< " (default)" << std::endl; - std::cout <<"sample : n_total_sample : "<< this->m_ecm.getNbTotalSample()<< " (default)"<<std::endl; + std::cout <<"ecm : sample : sample_step : "<< this->m_ecm.getSampleStep()<< " (default)" << std::endl; } if(!lod_node) { @@ -218,6 +203,7 @@ vpMbtXmlParser::read_ecm (xmlDocPtr doc, xmlNodePtr node) bool mask_node = false; bool range_node = false; bool contrast_node = false; + bool sample_node = false; for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) { if(dataNode->type == XML_ELEMENT_NODE){ @@ -236,6 +222,10 @@ vpMbtXmlParser::read_ecm (xmlDocPtr doc, xmlNodePtr node) this->read_contrast (doc, dataNode); contrast_node = true; }break; + case sample:{ + this->read_sample (doc, dataNode); + sample_node = true; + }break; default:{ // vpTRACE("unknown tag in read_ecm : %d, %s", iter_data->second, (iter_data->first).c_str()); }break; @@ -258,6 +248,10 @@ vpMbtXmlParser::read_ecm (xmlDocPtr doc, xmlNodePtr node) std::cout <<"ecm : contrast : mu1 " << this->m_ecm.getMu1()<<" (default)" <<std::endl; std::cout <<"ecm : contrast : mu2 " << this->m_ecm.getMu2()<<" (default)" <<std::endl; } + + if(!sample_node) { + std::cout <<"ecm : sample : sample_step : "<< this->m_ecm.getSampleStep()<< " (default)" << std::endl; + } } /*! @@ -272,11 +266,9 @@ void vpMbtXmlParser::read_sample (xmlDocPtr doc, xmlNodePtr node) { bool step_node = false; - bool nb_sample_node = false; - // current data values. - double d_stp = this->m_ecm.getSampleStep(); - int d_nb_sample = this->m_ecm.getNbTotalSample(); + // current data values. + double d_stp = this->m_ecm.getSampleStep(); for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) { if(dataNode->type == XML_ELEMENT_NODE){ @@ -287,10 +279,6 @@ vpMbtXmlParser::read_sample (xmlDocPtr doc, xmlNodePtr node) d_stp = xmlReadIntChild(doc, dataNode); step_node = true; }break; - case nb_sample:{ - d_nb_sample = xmlReadIntChild(doc, dataNode); - nb_sample_node = true; - }break; default:{ // vpTRACE("unknown tag in read_sample : %d, %s", iter_data->second, (iter_data->first).c_str()); }break; @@ -300,17 +288,68 @@ vpMbtXmlParser::read_sample (xmlDocPtr doc, xmlNodePtr node) } this->m_ecm.setSampleStep(d_stp); - this->m_ecm.setNbTotalSample(d_nb_sample); +// this->m_ecm.setNbTotalSample(d_nb_sample); if(!step_node) - std::cout <<"sample : sample_step : "<< this->m_ecm.getSampleStep()<< " (default)" << std::endl; + std::cout <<"ecm : sample : sample_step : "<< this->m_ecm.getSampleStep()<< " (default)" << std::endl; else - std::cout <<"sample : sample_step : "<< this->m_ecm.getSampleStep()<<std::endl; - - if(!nb_sample_node) - std::cout <<"sample : n_total_sample : "<< this->m_ecm.getNbTotalSample()<< " (default)"<<std::endl; + std::cout <<"ecm : sample : sample_step : "<< this->m_ecm.getSampleStep()<<std::endl; +} + +/*! + Read sample information. + + \throw vpException::fatalError if there was an unexpected number of data. + + \param doc : Pointer to the document. + \param node : Pointer to the node of the sample information. +*/ +void +vpMbtXmlParser::read_sample_deprecated (xmlDocPtr doc, xmlNodePtr node) +{ + bool step_node = false; + //bool nb_sample_node = false; + + // current data values. + double d_stp = this->m_ecm.getSampleStep(); +// int d_nb_sample = this->m_ecm.getNbTotalSample(); + + for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) { + if(dataNode->type == XML_ELEMENT_NODE){ + std::map<std::string, int>::iterator iter_data= this->nodeMap.find((char*)dataNode->name); + if(iter_data != nodeMap.end()){ + switch (iter_data->second){ + case step:{ + d_stp = xmlReadIntChild(doc, dataNode); + step_node = true; + }break; +// case nb_sample:{ +// d_nb_sample = xmlReadIntChild(doc, dataNode); +// nb_sample_node = true; +// }break; + default:{ +// vpTRACE("unknown tag in read_sample : %d, %s", iter_data->second, (iter_data->first).c_str()); + }break; + } + } + } + } + + this->m_ecm.setSampleStep(d_stp); +// this->m_ecm.setNbTotalSample(d_nb_sample); + + if(!step_node) + std::cout <<"[DEPRECATED] sample : sample_step : "<< this->m_ecm.getSampleStep()<< " (default)" << std::endl; else - std::cout <<"sample : n_total_sample : "<< this->m_ecm.getNbTotalSample()<<std::endl; + std::cout <<"[DEPRECATED] sample : sample_step : "<< this->m_ecm.getSampleStep()<<std::endl; + +// if(!nb_sample_node) +// std::cout <<"sample : n_total_sample : "<< this->m_ecm.getNbTotalSample()<< " (default)"<<std::endl; +// else +// std::cout <<"sample : n_total_sample : "<< this->m_ecm.getNbTotalSample()<<std::endl; + + std::cout <<" WARNING : This node (sample) is deprecated." << std::endl; + std::cout << " It should be moved in the ecm node (ecm : sample)." << std::endl; } /*! @@ -476,53 +515,8 @@ vpMbtXmlParser::read_contrast (xmlDocPtr doc, xmlNodePtr node) std::cout <<"ecm : contrast : mu2 " << this->m_ecm.getMu2()<<std::endl; } -void -vpMbtXmlParser::read_lod (xmlDocPtr doc, xmlNodePtr node) { - bool use_lod_node = false; - bool min_line_length_threshold_node = false; - bool min_polygon_area_threshold_node = false; - - - for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) { - if(dataNode->type == XML_ELEMENT_NODE){ - std::map<std::string, int>::iterator iter_data= this->nodeMap.find((char*)dataNode->name); - if(iter_data != nodeMap.end()){ - switch (iter_data->second){ - case use_lod: - useLod = (xmlReadIntChild(doc, dataNode) != 0); - use_lod_node = true; - break; - case min_line_length_threshold: - minLineLengthThreshold = xmlReadDoubleChild(doc, dataNode); - min_line_length_threshold_node = true; - break; - case min_polygon_area_threshold: - minPolygonAreaThreshold = xmlReadDoubleChild(doc, dataNode); - min_polygon_area_threshold_node = true; - break; - default:{ -// vpTRACE("unknown tag in read_contrast : %d, %s", iter_data->second, (iter_data->first).c_str()); - }break; - } - } - } - } - - if(!use_lod_node) - std::cout << "lod : use lod : " << useLod << " (default)" <<std::endl; - else - std::cout << "lod : use lod : " << useLod << std::endl; - - if(!min_line_length_threshold_node) - std::cout <<"lod : min line length threshold : " << minLineLengthThreshold <<" (default)" <<std::endl; - else - std::cout <<"lod : min line length threshold : " << minLineLengthThreshold <<std::endl; - - if(!min_polygon_area_threshold_node) - std::cout <<"lod : min polygon area threshold : " << minPolygonAreaThreshold <<" (default)" <<std::endl; - else - std::cout <<"lod : min polygon area threshold : " << minPolygonAreaThreshold <<std::endl; -} - +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_mbt.a(vpMbtXmlParser.cpp.o) has no symbols +void dummy_vpMbtXmlParser() {}; #endif diff --git a/src/tracking/mbt/hybrid/vpMbEdgeKltTracker.cpp b/modules/tracker/mbt/src/hybrid/vpMbEdgeKltTracker.cpp similarity index 57% rename from src/tracking/mbt/hybrid/vpMbEdgeKltTracker.cpp rename to modules/tracker/mbt/src/hybrid/vpMbEdgeKltTracker.cpp index 3799fc3af79647c948da85a3654effee45a1f402..b3c03edbc1944a6eaff297b8d4bd044288b72426 100644 --- a/src/tracking/mbt/hybrid/vpMbEdgeKltTracker.cpp +++ b/modules/tracker/mbt/src/hybrid/vpMbEdgeKltTracker.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMbEdgeKltTracker.cpp 5189 2015-01-21 16:42:18Z ayol $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -41,12 +38,12 @@ //#define VP_DEBUG_MODE 1 // Activate debug level 1 -#include <visp/vpDebug.h> -#include <visp/vpMbEdgeKltTracker.h> -#include <visp/vpTrackingException.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/core/vpDebug.h> +#include <visp3/mbt/vpMbEdgeKltTracker.h> +#include <visp3/core/vpTrackingException.h> +#include <visp3/core/vpVelocityTwistMatrix.h> -#if (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) +#if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) vpMbEdgeKltTracker::vpMbEdgeKltTracker() : compute_interaction(true), lambda(0.8), thresholdKLT(2.), thresholdMBT(2.), maxIter(200) @@ -84,6 +81,8 @@ vpMbEdgeKltTracker::init(const vpImage<unsigned char>& I) initPyramid(I, Ipyramid); + vpMbEdgeTracker::resetMovingEdge(); + unsigned int i = (unsigned int)scales.size(); do { i--; @@ -98,11 +97,11 @@ vpMbEdgeKltTracker::init(const vpImage<unsigned char>& I) } /*! - Set the pose to be used in entry of the next call to the track() function. + Set the pose to be used in entry (as guess) of the next call to the track() function. This pose will be just used once. - - \warning This function has to be called after the initialization of the tracker. - + + \warning This functionnality is not available when tracking cylinders. + \param I : image corresponding to the desired pose. \param cdMo : Pose to affect. */ @@ -110,39 +109,13 @@ void vpMbEdgeKltTracker::setPose( const vpImage<unsigned char> &I, const vpHomogeneousMatrix& cdMo) { vpMbKltTracker::setPose(I, cdMo); - - if (! lines[scaleLevel].empty()) { - lines[scaleLevel].front() ; - for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ - if((*it)->meline != NULL){ - delete (*it)->meline; - (*it)->meline = NULL; - } - } - } - - if (! cylinders[scaleLevel].empty()) { - cylinders[scaleLevel].front() ; - for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[scaleLevel].begin(); it!=cylinders[scaleLevel].end(); ++it){ - if((*it)->meline1 != NULL){ - delete (*it)->meline1; - (*it)->meline1 = NULL; - } - if((*it)->meline2 != NULL){ - delete (*it)->meline2; - (*it)->meline2 = NULL; - } - } - } - if (! circles[scaleLevel].empty()) { - circles[scaleLevel].front() ; - for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ - if((*it)->meEllipse != NULL){ - delete (*it)->meEllipse; - (*it)->meEllipse = NULL; - } - } + resetMovingEdge(); + + if(useScanLine){ + cam.computeFov(I.getWidth(), I.getHeight()); + faces.computeClippedPolygons(cMo,cam); + faces.computeScanLineRender(cam, I.getWidth(), I.getHeight()); } initPyramid(I, Ipyramid); @@ -185,20 +158,29 @@ vpMbEdgeKltTracker::initMbtTracking(const unsigned int lvl) unsigned int nbrow = 0; for(std::list<vpMbtDistanceLine*>::iterator it=lines[lvl].begin(); it!=lines[lvl].end(); ++it){ l = *it; - nbrow += l->nbFeature ; - l->initInteractionMatrixError() ; + + if(l->isVisible() && l->isTracked()){ + nbrow += l->nbFeatureTotal ; + l->initInteractionMatrixError() ; + } } for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[lvl].begin(); it!=cylinders[lvl].end(); ++it){ cy = *it; - nbrow += cy->nbFeature ; - cy->initInteractionMatrixError() ; + + if(cy->isVisible() && cy->isTracked()){ + nbrow += cy->nbFeature ; + cy->initInteractionMatrixError() ; + } } for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[lvl].begin(); it!=circles[lvl].end(); ++it){ ci = *it; - nbrow += ci->nbFeature ; - ci->initInteractionMatrixError() ; + + if(ci->isVisible() && ci ->isTracked()){ + nbrow += ci->nbFeature ; + ci->initInteractionMatrixError() ; + } } return nbrow; @@ -250,11 +232,10 @@ vpMbEdgeKltTracker::loadConfigFile(const std::string& configFile) <mu1>0.5</mu1> <mu2>0.5</mu2> </contrast> + <sample> + <step>4</step> + </sample> </ecm> - <sample> - <step>4</step> - <nb_sample>250</nb_sample> - </sample> <camera> <width>640</width> <height>480</height> @@ -329,7 +310,19 @@ vpMbEdgeKltTracker::loadConfigFile(const char* configFile) setFarClippingDistance(xmlp.getFarClippingDistance()); if(xmlp.getFovClipping()){ - setClipping(vpMbEdgeTracker::clippingFlag | vpMbtPolygon::FOV_CLIPPING); + setClipping(vpMbEdgeTracker::clippingFlag | vpPolygon3D::FOV_CLIPPING); + } + + useLodGeneral = xmlp.getLodState(); + minLineLengthThresholdGeneral = xmlp.getMinLineLengthThreshold(); + minPolygonAreaThresholdGeneral = xmlp.getMinPolygonAreaThreshold(); + + applyLodSettingInConfig = false; + if(this->getNbPolygon() > 0) { + applyLodSettingInConfig = true; + setLod(useLodGeneral); + setMinLineLengthThresh(minLineLengthThresholdGeneral); + setMinPolygonAreaThresh(minPolygonAreaThresholdGeneral); } vpMe meParser; @@ -344,6 +337,10 @@ vpMbEdgeKltTracker::loadConfigFile(const char* configFile) tracker.setBlockSize((int)xmlp.getBlockSize()); tracker.setPyramidLevels((int)xmlp.getPyramidLevels()); maskBorder = xmlp.getMaskBorder(); + + //if(useScanLine) + faces.getMbScanLineRenderer().setMaskBorder(maskBorder); + #else vpTRACE("You need the libXML2 to read the config file %s", configFile); #endif @@ -356,7 +353,6 @@ bool vpMbEdgeKltTracker::postTracking(const vpImage<unsigned char>& I, vpColVector &w_mbt, vpColVector &w_klt, const unsigned int lvl) { - bool reInit = vpMbKltTracker::postTracking(I, w_klt); postTrackingMbt(w_mbt,lvl); @@ -366,7 +362,7 @@ vpMbEdgeKltTracker::postTracking(const vpImage<unsigned char>& I, vpColVector &w vpMbtDistanceLine* l; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[lvl].begin(); it!=lines[lvl].end(); ++it){ l = *it; - if (l->isVisible()){ + if (l->isVisible() && l->isTracked()){ l->displayMovingEdges(I); } } @@ -374,27 +370,39 @@ vpMbEdgeKltTracker::postTracking(const vpImage<unsigned char>& I, vpColVector &w vpMbtDistanceCylinder *cy ; for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[lvl].begin(); it!=cylinders[lvl].end(); ++it){ cy = *it; - // A cylinder is always visible - cy->displayMovingEdges(I); + // A cylinder is always visible: #FIXME AY: Still valid? + if(cy->isTracked()) + cy->displayMovingEdges(I); } vpMbtDistanceCircle *ci ; for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[lvl].begin(); it!=circles[lvl].end(); ++it){ ci = *it; - if (ci->isVisible()){ + if (ci->isVisible() && ci->isTracked()){ ci->displayMovingEdges(I); } } } } - - if(reInit) - return true; - + + bool reInit = vpMbKltTracker::postTracking(I, w_klt); + + if(useScanLine){ + cam.computeFov(I.getWidth(), I.getHeight()); + faces.computeClippedPolygons(cMo,cam); + faces.computeScanLineRender(cam, I.getWidth(), I.getHeight()); + } + vpMbEdgeTracker::updateMovingEdge(I); vpMbEdgeTracker::initMovingEdge(I, cMo) ; vpMbEdgeTracker::reinitMovingEdge(I, cMo); + + if(computeProjError) + vpMbEdgeTracker::computeProjectionError(I); + + if(reInit) + return true; return false; } @@ -415,33 +423,40 @@ vpMbEdgeKltTracker::postTrackingMbt(vpColVector &w, const unsigned int lvl) if(lvl >= scales.size() || !scales[lvl]){ throw vpException(vpException::dimensionError, "_lvl not used."); } + unsigned int n =0 ; vpMbtDistanceLine* l; - for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[lvl].begin(); it!=lines[lvl].end(); ++it){ - l = *it; - { + for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ + if((*it)->isTracked()){ + l = *it; + unsigned int indexLine = 0; double wmean = 0 ; - std::list<vpMeSite>::iterator itListLine; - if (l->nbFeature > 0) itListLine = l->meline->getMeList().begin(); - - for (unsigned int i=0 ; i < l->nbFeature ; i++){ - wmean += w[n+i] ; - vpMeSite p = *itListLine; - if (w[n+i] < 0.5){ - p.setState(vpMeSite::M_ESTIMATOR); - - *itListLine = p; - } - ++itListLine; + for(unsigned int a = 0 ; a < l->meline.size() ; a++) + { + std::list<vpMeSite>::iterator itListLine; + if (l->nbFeature[a] > 0) itListLine = l->meline[a]->getMeList().begin(); + + for (unsigned int i=0 ; i < l->nbFeature[a] ; i++){ + wmean += w[n+indexLine] ; + vpMeSite p = *itListLine; + if (w[n+indexLine] < 0.5){ + p.setState(vpMeSite::M_ESTIMATOR); + *itListLine = p; + } + + ++itListLine; + indexLine++; + } } - n+= l->nbFeature ; - - if (l->nbFeature!=0) - wmean /= l->nbFeature ; + + n+= l->nbFeatureTotal ; + + if (l->nbFeatureTotal!=0) + wmean /= l->nbFeatureTotal ; else wmean = 1; - + l->setMeanWeight(wmean); if (wmean < 0.8) @@ -452,102 +467,106 @@ vpMbEdgeKltTracker::postTrackingMbt(vpColVector &w, const unsigned int lvl) // Same thing with cylinders as with lines vpMbtDistanceCylinder *cy ; for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[lvl].begin(); it!=cylinders[lvl].end(); ++it){ - cy = *it; - double wmean = 0 ; - std::list<vpMeSite>::iterator itListCyl1; - std::list<vpMeSite>::iterator itListCyl2; - if (cy->nbFeature > 0){ - itListCyl1 = cy->meline1->getMeList().begin(); - itListCyl2 = cy->meline2->getMeList().begin(); - } + if((*it)->isTracked()){ + cy = *it; + double wmean = 0 ; + std::list<vpMeSite>::iterator itListCyl1; + std::list<vpMeSite>::iterator itListCyl2; + if (cy->nbFeature > 0){ + itListCyl1 = cy->meline1->getMeList().begin(); + itListCyl2 = cy->meline2->getMeList().begin(); + } + + wmean = 0; + for(unsigned int i=0 ; i < cy->nbFeaturel1 ; i++){ + wmean += w[n+i] ; + vpMeSite p = *itListCyl1; + if (w[n+i] < 0.5){ + p.setState(vpMeSite::M_ESTIMATOR); - wmean = 0; - for(unsigned int i=0 ; i < cy->nbFeaturel1 ; i++){ - wmean += w[n+i] ; - vpMeSite p = *itListCyl1; - if (w[n+i] < 0.5){ - p.setState(vpMeSite::M_ESTIMATOR); - - *itListCyl1 = p; + *itListCyl1 = p; + } + + ++itListCyl1; } - ++itListCyl1; - } + if (cy->nbFeaturel1!=0) + wmean /= cy->nbFeaturel1 ; + else + wmean = 1; - if (cy->nbFeaturel1!=0) - wmean /= cy->nbFeaturel1 ; - else - wmean = 1; + cy->setMeanWeight1(wmean); - cy->setMeanWeight1(wmean); + if (wmean < 0.8){ + cy->Reinit = true; + } - if (wmean < 0.8){ - cy->Reinit = true; - } + wmean = 0; + for(unsigned int i=cy->nbFeaturel1 ; i < cy->nbFeature ; i++){ + wmean += w[n+i] ; + vpMeSite p = *itListCyl2; + if (w[n+i] < 0.5){ + p.setState(vpMeSite::M_ESTIMATOR); + + *itListCyl2 = p; + } - wmean = 0; - for(unsigned int i=cy->nbFeaturel1 ; i < cy->nbFeature ; i++){ - wmean += w[n+i] ; - vpMeSite p = *itListCyl2; - if (w[n+i] < 0.5){ - p.setState(vpMeSite::M_ESTIMATOR); - - *itListCyl2 = p; + ++itListCyl2; } - ++itListCyl2; - } + if (cy->nbFeaturel2!=0) + wmean /= cy->nbFeaturel2 ; + else + wmean = 1; - if (cy->nbFeaturel2!=0) - wmean /= cy->nbFeaturel2 ; - else - wmean = 1; + cy->setMeanWeight2(wmean); - cy->setMeanWeight2(wmean); + if (wmean < 0.8){ + cy->Reinit = true; + } - if (wmean < 0.8){ - cy->Reinit = true; + n+= cy->nbFeature ; } - - n+= cy->nbFeature ; } // Same thing with circles as with lines vpMbtDistanceCircle *ci; for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ - ci = *it; - double wmean = 0 ; - std::list<vpMeSite>::iterator itListCir; + if((*it)->isTracked()){ + ci = *it; + double wmean = 0 ; + std::list<vpMeSite>::iterator itListCir; - if (ci->nbFeature > 0){ - itListCir = ci->meEllipse->getMeList().begin(); - } + if (ci->nbFeature > 0){ + itListCir = ci->meEllipse->getMeList().begin(); + } - wmean = 0; - for(unsigned int i=0 ; i < ci->nbFeature ; i++){ - wmean += w[n+i] ; - vpMeSite p = *itListCir; - if (w[n+i] < 0.5){ - p.setState(vpMeSite::M_ESTIMATOR); + wmean = 0; + for(unsigned int i=0 ; i < ci->nbFeature ; i++){ + wmean += w[n+i] ; + vpMeSite p = *itListCir; + if (w[n+i] < 0.5){ + p.setState(vpMeSite::M_ESTIMATOR); + + *itListCir = p; + } - *itListCir = p; + ++itListCir; } - ++itListCir; - } + if (ci->nbFeature!=0) + wmean /= ci->nbFeature ; + else + wmean = 1; - if (ci->nbFeature!=0) - wmean /= ci->nbFeature ; - else - wmean = 1; + ci->setMeanWeight(wmean); - ci->setMeanWeight(wmean); + if (wmean < 0.8){ + ci->Reinit = true; + } - if (wmean < 0.8){ - ci->Reinit = true; + n+= ci->nbFeature ; } - - n+= ci->nbFeature ; } } @@ -601,7 +620,8 @@ vpMbEdgeKltTracker::computeVVS(const vpImage<unsigned char>& I, const unsigned i vpRobust robust_mbt(0), robust_klt(0); vpHomography H; - vpMatrix LTL, LTR; + vpMatrix LTL; + vpColVector LTR; double factorMBT = 1.0; double factorKLT = 1.0; @@ -621,6 +641,10 @@ vpMbEdgeKltTracker::computeVVS(const vpImage<unsigned char>& I, const unsigned i double residuKLT = 0; vpHomogeneousMatrix cMoPrev; + vpHomogeneousMatrix ctTc0_Prev; + vpColVector m_error_prev(2*nbInfos + nbrow); + vpColVector m_w_prev(2*nbInfos + nbrow); + double mu = 0.01; while( ((int)((residu - residu_1)*1e8) !=0 ) && (iter<maxIter) ){ L = new vpMatrix(); @@ -635,7 +659,7 @@ vpMbEdgeKltTracker::computeVVS(const vpImage<unsigned char>& I, const unsigned i // for (unsigned int i = 0; i < faces.size(); i += 1){ for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=vpMbKltTracker::kltPolygons.begin(); it!=vpMbKltTracker::kltPolygons.end(); ++it){ kltpoly = *it; - if(kltpoly->polygon->isVisible() && kltpoly->hasEnoughPoints()){ + if(kltpoly->polygon->isVisible() && kltpoly->isTracked() && kltpoly->hasEnoughPoints()){ vpSubColVector subR(R_klt, shift, 2*kltpoly->getCurrentNumberPoints()); vpSubMatrix subL(L_klt, shift, 0, 2*kltpoly->getCurrentNumberPoints(), 6); kltpoly->computeHomography(ctTc0, H); @@ -643,113 +667,192 @@ vpMbEdgeKltTracker::computeVVS(const vpImage<unsigned char>& I, const unsigned i shift += 2*kltpoly->getCurrentNumberPoints(); } } + + vpMbtDistanceKltCylinder *kltPolyCylinder; + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + + if(kltPolyCylinder->isTracked() && kltPolyCylinder->hasEnoughPoints()) + { + vpSubColVector subR(R_klt, shift, 2*kltPolyCylinder->getCurrentNumberPoints()); + vpSubMatrix subL(L_klt, shift, 0, 2*kltPolyCylinder->getCurrentNumberPoints(), 6); + try{ + kltPolyCylinder->computeInteractionMatrixAndResidu(ctTc0,subR, subL); + }catch(...){ + throw vpTrackingException(vpTrackingException::fatalError, "Cannot compute interaction matrix"); + } + + shift += 2*kltPolyCylinder->getCurrentNumberPoints(); + } + } } - - if(iter == 0){ - m_w.resize(nbrow + 2*nbInfos); - m_w=1; - - if(nbrow != 0){ - w_mbt.resize(nbrow); - w_mbt = 1; - robust_mbt.resize(nbrow); + + bool reStartFromLastIncrement = false; + if(iter != 0 && m_optimizationMethod == vpMbTracker::LEVENBERG_MARQUARDT_OPT){ + if(m_error.sumSquare()/(double)(2*nbInfos + nbrow) > m_error_prev.sumSquare()/(double)(2*nbInfos + nbrow)){ + mu *= 10.0; + + if(mu > 1.0) + throw vpTrackingException(vpTrackingException::fatalError, "Optimization diverged"); + + cMo = cMoPrev; + m_error = m_error_prev; + m_w = m_w_prev; + ctTc0 = ctTc0_Prev; + reStartFromLastIncrement = true; } + } + + if(!reStartFromLastIncrement){ + if(iter == 0){ + m_w.resize(nbrow + 2*nbInfos); + m_w=1; + + if(nbrow != 0){ + w_mbt.resize(nbrow); + w_mbt = 1; + robust_mbt.resize(nbrow); + } - if(nbInfos != 0){ - w_klt.resize(2*nbInfos); - w_klt = 1; - robust_klt.resize(2*nbInfos); + if(nbInfos != 0){ + w_klt.resize(2*nbInfos); + w_klt = 1; + robust_klt.resize(2*nbInfos); + } + + w_true.resize(nbrow + 2*nbInfos); } - w_true.resize(nbrow + 2*nbInfos); - } + /* robust */ + if(nbrow > 3){ + residuMBT = 0; + for(unsigned int i = 0; i < R_mbt.getRows(); i++) + residuMBT += fabs(R_mbt[i]); + residuMBT /= R_mbt.getRows(); + + robust_mbt.setIteration(iter); + robust_mbt.setThreshold(thresholdMBT/cam.get_px()); + robust_mbt.MEstimator( vpRobust::TUKEY, R_mbt, w_mbt); + L->stack(L_mbt); + R->stack(R_mbt); + } - /* robust */ - if(nbrow > 3){ - residuMBT = 0; - for(unsigned int i = 0; i < R_mbt.getRows(); i++) - residuMBT += fabs(R_mbt[i]); - residuMBT /= R_mbt.getRows(); - - robust_mbt.setIteration(iter); - robust_mbt.setThreshold(thresholdMBT/cam.get_px()); - robust_mbt.MEstimator( vpRobust::TUKEY, R_mbt, w_mbt); - L->stackMatrices(L_mbt); - R->stackMatrices(R_mbt); - } - - if(nbInfos > 3){ - residuKLT = 0; - for(unsigned int i = 0; i < R_klt.getRows(); i++) - residuKLT += fabs(R_klt[i]); - residuKLT /= R_klt.getRows(); - - robust_klt.setIteration(iter); - robust_klt.setThreshold(thresholdKLT/cam.get_px()); - robust_klt.MEstimator( vpRobust::TUKEY, R_klt, w_klt); - - L->stackMatrices(L_klt); - R->stackMatrices(R_klt); - } + if(nbInfos > 3){ + residuKLT = 0; + for(unsigned int i = 0; i < R_klt.getRows(); i++) + residuKLT += fabs(R_klt[i]); + residuKLT /= R_klt.getRows(); - unsigned int cpt = 0; - while(cpt< (nbrow+2*nbInfos)){ - if(cpt<(unsigned)nbrow){ - m_w[cpt] = ((w_mbt[cpt] * factor[cpt]) * factorMBT) ; + robust_klt.setIteration(iter); + robust_klt.setThreshold(thresholdKLT/cam.get_px()); + robust_klt.MEstimator( vpRobust::TUKEY, R_klt, w_klt); + + L->stack(L_klt); + R->stack(R_klt); } - else - m_w[cpt] = (w_klt[cpt-nbrow] * factorKLT); - cpt++; - } - - m_error = (*R); - if(computeCovariance){ - L_true = (*L); - if(!isoJoIdentity){ - vpVelocityTwistMatrix cVo; - cVo.buildFrom(cMo); - LVJ_true = ((*L)*cVo*oJo); + + unsigned int cpt = 0; + while(cpt< (nbrow+2*nbInfos)){ + if(cpt<(unsigned)nbrow){ + m_w[cpt] = ((w_mbt[cpt] * factor[cpt]) * factorMBT) ; + } + else + m_w[cpt] = (w_klt[cpt-nbrow] * factorKLT); + cpt++; } - } - residu_1 = residu; - residu = 0; - double num = 0; - double den = 0; - for (unsigned int i = 0; i < static_cast<unsigned int>(R->getRows()); i++){ - num += m_w[i]*vpMath::sqr((*R)[i]); - den += m_w[i]; - - w_true[i] = m_w[i]; - (*R)[i] *= m_w[i]; - if(compute_interaction){ - for (unsigned int j = 0; j < 6; j += 1){ - (*L)[i][j] *= m_w[i]; + m_error = (*R); + if(computeCovariance){ + L_true = (*L); + if(!isoJoIdentity){ + vpVelocityTwistMatrix cVo; + cVo.buildFrom(cMo); + LVJ_true = ((*L)*cVo*oJo); } } - } - residu = sqrt(num/den); + residu_1 = residu; + residu = 0; + double num = 0; + double den = 0; + for (unsigned int i = 0; i < static_cast<unsigned int>(R->getRows()); i++){ + num += m_w[i]*vpMath::sqr((*R)[i]); + den += m_w[i]; + + w_true[i] = m_w[i]; + (*R)[i] *= m_w[i]; + if(compute_interaction){ + for (unsigned int j = 0; j < 6; j += 1){ + (*L)[i][j] *= m_w[i]; + } + } + } - if(isoJoIdentity){ - LTL = L->AtA(); - computeJTR(*L, *R, LTR); - v = -lambda * LTL.pseudoInverse() * LTR; - } - else{ - vpVelocityTwistMatrix cVo; - cVo.buildFrom(cMo); - vpMatrix LVJ = ((*L)*cVo*oJo); - vpMatrix LVJTLVJ = (LVJ).AtA(); - vpMatrix LVJTR; - computeJTR(LVJ, *R, LVJTR); - v = -lambda*LVJTLVJ.pseudoInverse(1e-16)*LVJTR; - v = cVo * v; - } + residu = sqrt(num/den); + + if(isoJoIdentity){ + LTL = L->AtA(); + computeJTR(*L, *R, LTR); + + switch(m_optimizationMethod){ + case vpMbTracker::LEVENBERG_MARQUARDT_OPT: + { + vpMatrix LMA(LTL.getRows(), LTL.getCols()); + LMA.eye(); + vpMatrix LTLmuI = LTL + (LMA*mu); + v = -lambda*LTLmuI.pseudoInverse(LTLmuI.getRows()*std::numeric_limits<double>::epsilon())*LTR; + + if(iter != 0) + mu /= 10.0; + + m_error_prev = m_error; + m_w_prev = m_w; + break; + } + case vpMbTracker::GAUSS_NEWTON_OPT: + default: + v = -lambda * LTL.pseudoInverse(LTL.getRows()*std::numeric_limits<double>::epsilon()) * LTR; + } + } + else{ + vpVelocityTwistMatrix cVo; + cVo.buildFrom(cMo); + vpMatrix LVJ = ((*L)*cVo*oJo); + vpMatrix LVJTLVJ = (LVJ).AtA(); + vpColVector LVJTR; + computeJTR(LVJ, *R, LVJTR); + + switch(m_optimizationMethod){ + case vpMbTracker::LEVENBERG_MARQUARDT_OPT: + { + vpMatrix LMA(LVJTLVJ.getRows(), LVJTLVJ.getCols()); + LMA.eye(); + vpMatrix LTLmuI = LVJTLVJ + (LMA*mu); + v = -lambda*LTLmuI.pseudoInverse(LTLmuI.getRows()*std::numeric_limits<double>::epsilon())*LVJTR; + v = cVo * v; + + if(iter != 0) + mu /= 10.0; + + m_error_prev = m_error; + m_w_prev = m_w; + break; + } + case vpMbTracker::GAUSS_NEWTON_OPT: + default: + { + v = -lambda*LVJTLVJ.pseudoInverse(LVJTLVJ.getRows()*std::numeric_limits<double>::epsilon())*LVJTR; + v = cVo * v; + break; + } + } + } - cMoPrev = cMo; - cMo = vpExponentialMap::direct(v).inverse() * cMo; - ctTc0 = vpExponentialMap::direct(v).inverse() * ctTc0; + cMoPrev = cMo; + ctTc0_Prev = ctTc0; + ctTc0 = vpExponentialMap::direct(v).inverse() * ctTc0; + cMo = ctTc0 * c0Mo; + } iter++; @@ -763,10 +866,10 @@ vpMbEdgeKltTracker::computeVVS(const vpImage<unsigned char>& I, const unsigned i // Note that here the covariance is computed on cMoPrev for time computation efficiency if(isoJoIdentity){ - computeCovarianceMatrix(cMoPrev,m_error,L_true,D); + covarianceMatrix = vpMatrix::computeCovarianceMatrixVVS(cMoPrev,m_error,L_true,D); } else{ - computeCovarianceMatrix(cMoPrev,m_error,LVJ_true,D); + covarianceMatrix = vpMatrix::computeCovarianceMatrixVVS(cMoPrev,m_error,LVJ_true,D); } } } @@ -805,19 +908,21 @@ vpMbEdgeKltTracker::track(const vpImage<unsigned char>& I) if(postTracking(I, w_mbt, w_klt)){ vpMbKltTracker::reinit(I); - initPyramid(I, Ipyramid); + // AY : Removed as edge tracked, if necessary, is reinitialized in postTracking() + +// initPyramid(I, Ipyramid); - unsigned int i = (unsigned int)scales.size(); - do { - i--; - if(scales[i]){ - downScale(i); - initMovingEdge(*Ipyramid[i], cMo); - upScale(i); - } - } while(i != 0); +// unsigned int i = (unsigned int)scales.size(); +// do { +// i--; +// if(scales[i]){ +// downScale(i); +// initMovingEdge(*Ipyramid[i], cMo); +// upScale(i); +// } +// } while(i != 0); - cleanPyramid(Ipyramid); +// cleanPyramid(Ipyramid); } } @@ -845,82 +950,94 @@ vpMbEdgeKltTracker::trackFirstLoop(const vpImage<unsigned char>& I, vpColVector unsigned int n = 0; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[lvl].begin(); it!=lines[lvl].end(); ++it){ - l = *it; - l->computeInteractionMatrixError(cMo); - - double fac = 1; - for(std::list<int>::const_iterator itindex = l->Lindex_polygon.begin(); itindex!=l->Lindex_polygon.end(); ++itindex){ - int index = *itindex; - if (l->hiddenface->isAppearing((unsigned int)index)) { - fac = 0.2; - break; + if((*it)->isTracked()){ + l = *it; + l->computeInteractionMatrixError(cMo); + + double fac = 1; + for(std::list<int>::const_iterator itindex = l->Lindex_polygon.begin(); itindex!=l->Lindex_polygon.end(); ++itindex){ + int index = *itindex; + if (l->hiddenface->isAppearing((unsigned int)index)) { + fac = 0.2; + break; + } + if(l->closeToImageBorder(I, 10)){ + fac = 0.1; + break; + } } - if(l->closeToImageBorder(I, 10)){ - fac = 0.1; - break; + + unsigned int indexFeature = 0; + for(unsigned int a = 0 ; a < l->meline.size(); a++){ + std::list<vpMeSite>::const_iterator itListLine; + if (l->meline[a] != NULL) + { + itListLine = l->meline[a]->getMeList().begin(); + + for (unsigned int i=0 ; i < l->nbFeature[a] ; i++){ + factor[n+i] = fac; + vpMeSite site = *itListLine; + if (site.getState() != vpMeSite::NO_SUPPRESSION) factor[n+i] = 0.2; + ++itListLine; + indexFeature++; + } + n+= l->nbFeature[a] ; + } } } - - std::list<vpMeSite>::const_iterator itListLine; - if (l->meline != NULL) - itListLine = l->meline->getMeList().begin(); - - for (unsigned int i=0 ; i < l->nbFeature ; i++){ - factor[n+i] = fac; - vpMeSite site = *itListLine; - if (site.getState() != vpMeSite::NO_SUPPRESSION) factor[n+i] = 0.2; - ++itListLine; - } - n+= l->nbFeature ; } for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[lvl].begin(); it!=cylinders[lvl].end(); ++it){ - cy = *it; - cy->computeInteractionMatrixError(cMo, I); - double fac = 1.0; - - std::list<vpMeSite>::const_iterator itCyl1; - std::list<vpMeSite>::const_iterator itCyl2; - if ((cy->meline1 != NULL || cy->meline2 != NULL)){ - itCyl1 = cy->meline1->getMeList().begin(); - itCyl2 = cy->meline2->getMeList().begin(); - } - - for(unsigned int i=0 ; i < cy->nbFeature ; i++){ - factor[n+i] = fac; - vpMeSite site; - if(i<cy->nbFeaturel1) { - site= *itCyl1; - ++itCyl1; + if((*it)->isTracked()){ + cy = *it; + cy->computeInteractionMatrixError(cMo, I); + double fac = 1.0; + + std::list<vpMeSite>::const_iterator itCyl1; + std::list<vpMeSite>::const_iterator itCyl2; + if ((cy->meline1 != NULL || cy->meline2 != NULL)){ + itCyl1 = cy->meline1->getMeList().begin(); + itCyl2 = cy->meline2->getMeList().begin(); } - else{ - site= *itCyl2; - ++itCyl2; + + for(unsigned int i=0 ; i < cy->nbFeature ; i++){ + factor[n+i] = fac; + vpMeSite site; + if(i<cy->nbFeaturel1) { + site= *itCyl1; + ++itCyl1; + } + else{ + site= *itCyl2; + ++itCyl2; + } + if (site.getState() != vpMeSite::NO_SUPPRESSION) factor[n+i] = 0.2; } - if (site.getState() != vpMeSite::NO_SUPPRESSION) factor[n+i] = 0.2; - } - n+= cy->nbFeature ; + n+= cy->nbFeature ; + } } for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ - ci = *it; - ci->computeInteractionMatrixError(cMo); - double fac = 1.0; + if((*it)->isTracked()){ + ci = *it; + ci->computeInteractionMatrixError(cMo); + double fac = 1.0; + + std::list<vpMeSite>::const_iterator itCir; + if (ci->meEllipse != NULL) { + itCir = ci->meEllipse->getMeList().begin(); + } - std::list<vpMeSite>::const_iterator itCir; - if (ci->meEllipse != NULL) { - itCir = ci->meEllipse->getMeList().begin(); - } + for(unsigned int i=0 ; i < ci->nbFeature ; i++){ + factor[n+i] = fac; + vpMeSite site = *itCir; + if (site.getState() != vpMeSite::NO_SUPPRESSION) factor[n+i] = 0.2; + ++itCir; + } - for(unsigned int i=0 ; i < ci->nbFeature ; i++){ - factor[n+i] = fac; - vpMeSite site = *itCir; - if (site.getState() != vpMeSite::NO_SUPPRESSION) factor[n+i] = 0.2; - ++itCir; + n+= ci->nbFeature ; } - - n+= ci->nbFeature ; } return nbrow; @@ -936,39 +1053,45 @@ vpMbEdgeKltTracker::trackSecondLoop(const vpImage<unsigned char>& I, vpMatrix & unsigned int n = 0 ; for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[lvl].begin(); it!=lines[lvl].end(); ++it){ - l = *it; - l->computeInteractionMatrixError(cMo_) ; - for (unsigned int i=0 ; i < l->nbFeature ; i++){ - for (unsigned int j=0; j < 6 ; j++){ - L[n+i][j] = l->L[i][j]; - error[n+i] = l->error[i]; + if((*it)->isTracked()){ + l = *it; + l->computeInteractionMatrixError(cMo_) ; + for (unsigned int i=0 ; i < l->nbFeatureTotal ; i++){ + for (unsigned int j=0; j < 6 ; j++){ + L[n+i][j] = l->L[i][j]; + error[n+i] = l->error[i]; + } } + n+= l->nbFeatureTotal; } - n+= l->nbFeature; } for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[lvl].begin(); it!=cylinders[lvl].end(); ++it){ - cy = *it; - cy->computeInteractionMatrixError(cMo_, I) ; - for(unsigned int i=0 ; i < cy->nbFeature ; i++){ - for(unsigned int j=0; j < 6 ; j++){ - L[n+i][j] = cy->L[i][j]; - error[n+i] = cy->error[i]; + if((*it)->isTracked()){ + cy = *it; + cy->computeInteractionMatrixError(cMo_, I) ; + for(unsigned int i=0 ; i < cy->nbFeature ; i++){ + for(unsigned int j=0; j < 6 ; j++){ + L[n+i][j] = cy->L[i][j]; + error[n+i] = cy->error[i]; + } } + n+= cy->nbFeature ; } - n+= cy->nbFeature ; } for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[scaleLevel].begin(); it!=circles[scaleLevel].end(); ++it){ - ci = *it; - ci->computeInteractionMatrixError(cMo) ; - for(unsigned int i=0 ; i < ci->nbFeature ; i++){ - for(unsigned int j=0; j < 6 ; j++){ - L[n+i][j] = ci->L[i][j]; - error[n+i] = ci->error[i]; + if((*it)->isTracked()){ + ci = *it; + ci->computeInteractionMatrixError(cMo) ; + for(unsigned int i=0 ; i < ci->nbFeature ; i++){ + for(unsigned int j=0; j < 6 ; j++){ + L[n+i][j] = ci->L[i][j]; + error[n+i] = ci->error[i]; + } } - } - n+= ci->nbFeature ; + n+= ci->nbFeature ; + } } } @@ -1042,6 +1165,7 @@ vpMbEdgeKltTracker::initCylinder(const vpPoint& p1, const vpPoint &p2, const dou const std::string &name) { vpMbEdgeTracker::initCylinder(p1, p2, radius, idFace, name); + vpMbKltTracker::initCylinder(p1, p2, radius, idFace, name); } /*! @@ -1057,7 +1181,7 @@ vpMbEdgeKltTracker::initCylinder(const vpPoint& p1, const vpPoint &p2, const dou void vpMbEdgeKltTracker::display(const vpImage<unsigned char>& I, const vpHomogeneousMatrix &cMo_, const vpCameraParameters &camera, const vpColor& col, const unsigned int thickness, const bool displayFullModel) -{ +{ for (unsigned int i = 0; i < scales.size(); i += 1){ if(scales[i]){ for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ @@ -1075,15 +1199,22 @@ vpMbEdgeKltTracker::display(const vpImage<unsigned char>& I, const vpHomogeneous break ; //displaying model on one scale only } } - + vpMbtDistanceKltPoints *kltpoly; for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ kltpoly = *it; - if(displayFeatures && kltpoly->hasEnoughPoints() && kltpoly->polygon->isVisible()) { + if(displayFeatures && kltpoly->hasEnoughPoints() && kltpoly->isTracked() && kltpoly->polygon->isVisible()) { kltpoly->displayPrimitive(I); } } - + + vpMbtDistanceKltCylinder *kltPolyCylinder; + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + if(displayFeatures && kltPolyCylinder->isTracked() && kltPolyCylinder->hasEnoughPoints()) + kltPolyCylinder->displayPrimitive(I); + } + #ifdef VISP_HAVE_OGRE if(useOgre) faces.displayOgre(cMo_); @@ -1103,7 +1234,7 @@ vpMbEdgeKltTracker::display(const vpImage<unsigned char>& I, const vpHomogeneous void vpMbEdgeKltTracker::display(const vpImage<vpRGBa>& I, const vpHomogeneousMatrix &cMo_, const vpCameraParameters &camera, const vpColor& col , const unsigned int thickness, const bool displayFullModel) -{ +{ for (unsigned int i = 0; i < scales.size(); i += 1){ if(scales[i]){ for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[scaleLevel].begin(); it!=lines[scaleLevel].end(); ++it){ @@ -1121,15 +1252,22 @@ vpMbEdgeKltTracker::display(const vpImage<vpRGBa>& I, const vpHomogeneousMatrix break ; //displaying model on one scale only } } - + vpMbtDistanceKltPoints *kltpoly; for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ kltpoly = *it; - if(displayFeatures && kltpoly->hasEnoughPoints() && kltpoly->polygon->isVisible()) { + if(displayFeatures && kltpoly->hasEnoughPoints() && kltpoly->isTracked() && kltpoly->polygon->isVisible()) { kltpoly->displayPrimitive(I); } } - + + vpMbtDistanceKltCylinder *kltPolyCylinder; + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + if(displayFeatures && kltPolyCylinder->isTracked() && kltPolyCylinder->hasEnoughPoints()) + kltPolyCylinder->displayPrimitive(I); + } + #ifdef VISP_HAVE_OGRE if(useOgre) faces.displayOgre(cMo_); @@ -1165,8 +1303,96 @@ void vpMbEdgeKltTracker::reInitModel(const vpImage<unsigned char>& I, const char* cad_name, const vpHomogeneousMatrix& cMo_, const bool verbose) { - vpMbKltTracker::reInitModel(I, cad_name, cMo_, verbose); - vpMbEdgeTracker::reInitModel(I, cad_name, cMo_, verbose); + // Reinit klt +#if (VISP_HAVE_OPENCV_VERSION < 0x020408) + if(cur != NULL){ + cvReleaseImage(&cur); + cur = NULL; + } +#endif + + // delete the Klt Polygon features + vpMbtDistanceKltPoints *kltpoly; + for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ + kltpoly = *it; + if (kltpoly!=NULL){ + delete kltpoly ; + } + kltpoly = NULL ; + } + kltPolygons.clear(); + + vpMbtDistanceKltCylinder *kltPolyCylinder; + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + if (kltPolyCylinder!=NULL){ + delete kltPolyCylinder ; + } + kltPolyCylinder = NULL ; + } + kltCylinders.clear(); + + // delete the structures used to display circles + vpMbtDistanceCircle *ci; + for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles_disp.begin(); it!=circles_disp.end(); ++it){ + ci = *it; + if (ci!=NULL){ + delete ci ; + } + ci = NULL ; + } + + circles_disp.clear(); + + firstInitialisation = true; + + // Reinit edge + vpMbtDistanceLine *l; + vpMbtDistanceCylinder *cy; + + for (unsigned int i = 0; i < scales.size(); i += 1){ + if(scales[i]){ + for(std::list<vpMbtDistanceLine*>::const_iterator it=lines[i].begin(); it!=lines[i].end(); ++it){ + l = *it; + if (l!=NULL) delete l ; + l = NULL ; + } + + for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders[i].begin(); it!=cylinders[i].end(); ++it){ + cy = *it; + if (cy!=NULL) delete cy; + cy = NULL; + } + + for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles[i].begin(); it!=circles[i].end(); ++it){ + ci = *it; + if (ci!=NULL) delete ci; + ci = NULL; + } + + lines[i].clear(); + cylinders[i].clear(); + circles[i].clear(); + } + } + + //compute_interaction=1; + nline = 0; + ncylinder = 0; + ncircle = 0; + //lambda = 1; + nbvisiblepolygone = 0; + + // Reinit common parts + faces.reset(); + + loadModel(cad_name, verbose); + + this->cMo = cMo_; + init(I); } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_mbt.a(vpMbEdgeKltTracker.cpp.o) has no symbols +void dummy_vpMbEdgeKltTracker() {}; #endif //VISP_HAVE_OPENCV diff --git a/src/tracking/mbt/hybrid/vpMbtEdgeKltXmlParser.cpp b/modules/tracker/mbt/src/hybrid/vpMbtEdgeKltXmlParser.cpp similarity index 82% rename from src/tracking/mbt/hybrid/vpMbtEdgeKltXmlParser.cpp rename to modules/tracker/mbt/src/hybrid/vpMbtEdgeKltXmlParser.cpp index a61e627c233427cf522eb705f54f840955f45496..9d2ce7d63a533bc7656ab3560221e8e28edeb646 100644 --- a/src/tracking/mbt/hybrid/vpMbtEdgeKltXmlParser.cpp +++ b/modules/tracker/mbt/src/hybrid/vpMbtEdgeKltXmlParser.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbtEdgeKltXmlParser.cpp 4577 2014-01-10 16:19:41Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Load XML parameters of the Model based tracker (using edges and point features). * @@ -38,7 +34,7 @@ * Aurelien Yol * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 @@ -48,7 +44,7 @@ #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */ -#include <visp/vpMbtEdgeKltXmlParser.h> +#include <visp3/mbt/vpMbtEdgeKltXmlParser.h> /*! @@ -80,7 +76,7 @@ vpMbtEdgeKltXmlParser::init() nodeMap["face"] = vpMbtEdgeKltXmlParser::face; nodeMap["klt"] = vpMbtEdgeKltXmlParser::klt; nodeMap["ecm"] = vpMbtEdgeKltXmlParser::ecm; - nodeMap["sample"] = vpMbtEdgeKltXmlParser::sample; + nodeMap["lod"] = vpMbtEdgeKltXmlParser::lod; } /*! @@ -120,8 +116,8 @@ vpMbtEdgeKltXmlParser::readMainClass(xmlDocPtr doc, xmlNodePtr node) bool camera_node = false; bool face_node = false; bool ecm_node = false; - bool sample_node = false; bool klt_node = false; + bool lod_node = false; for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) { if(dataNode->type == XML_ELEMENT_NODE){ @@ -144,9 +140,12 @@ vpMbtEdgeKltXmlParser::readMainClass(xmlDocPtr doc, xmlNodePtr node) this->read_ecm (doc, dataNode); ecm_node = true; }break; - case vpMbtEdgeKltXmlParser::sample:{ - this->read_sample (doc, dataNode); - sample_node = true; + case sample:{ + this->read_sample_deprecated (doc, dataNode); + }break; + case vpMbtEdgeKltXmlParser::lod:{ + this->read_lod(doc, dataNode); + lod_node = true; }break; default:{ // vpTRACE("unknown tag in read_sample : %d, %s", iter_data->second, (iter_data->first).c_str()); @@ -186,13 +185,18 @@ vpMbtEdgeKltXmlParser::readMainClass(xmlDocPtr doc, xmlNodePtr node) std::cout <<"ecm : contrast : threshold : " << this->m_ecm.getThreshold()<<" (default)" <<std::endl; std::cout <<"ecm : contrast : mu1 : " << this->m_ecm.getMu1()<<" (default)" <<std::endl; std::cout <<"ecm : contrast : mu2 : " << this->m_ecm.getMu2()<<" (default)" <<std::endl; + std::cout <<"ecm : sample : sample_step : "<< this->m_ecm.getSampleStep()<< " (default)" << std::endl; } - if(!sample_node) { - std::cout <<"sample : sample_step : "<< this->m_ecm.getSampleStep()<< " (default)" << std::endl; - std::cout <<"sample : n_total_sample : "<< this->m_ecm.getNbTotalSample()<< " (default)"<<std::endl; + if(!lod_node) { + std::cout << "lod : use lod : " << useLod << " (default)" << std::endl; + std::cout << "lod : min line length threshold : " << minLineLengthThreshold << " (default)" << std::endl; + std::cout << "lod : min polygon area threshold : " << minPolygonAreaThreshold << " (default)" << std::endl; } } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_mbt.a(vpMbtEdgeKltXmlParser.cpp.o) has no symbols +void dummy_vpMbtEdgeKltXmlParser() {}; #endif diff --git a/src/tracking/mbt/klt/vpMbKltTracker.cpp b/modules/tracker/mbt/src/klt/vpMbKltTracker.cpp similarity index 58% rename from src/tracking/mbt/klt/vpMbKltTracker.cpp rename to modules/tracker/mbt/src/klt/vpMbKltTracker.cpp index 10eb319430b6e9ff74319835deaeea5465e90845..ac83e75d33e85c089bb09db1d2263173e2d919ca 100644 --- a/src/tracking/mbt/klt/vpMbKltTracker.cpp +++ b/modules/tracker/mbt/src/klt/vpMbKltTracker.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMbKltTracker.cpp 5189 2015-01-21 16:42:18Z ayol $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,12 +36,12 @@ * *****************************************************************************/ -#include <visp/vpImageConvert.h> -#include <visp/vpMbKltTracker.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpTrackingException.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/mbt/vpMbKltTracker.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/core/vpTrackingException.h> -#if (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) +#if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) vpMbKltTracker::vpMbKltTracker() : @@ -55,7 +52,7 @@ vpMbKltTracker::vpMbKltTracker() #endif c0Mo(), compute_interaction(true), firstInitialisation(true), maskBorder(5), lambda(0.8), maxIter(200), threshold_outlier(0.5), - percentGood(0.6), ctTc0(), tracker(), firstTrack(false), kltPolygons(), cylinders_disp(), circles_disp() + percentGood(0.6), ctTc0(), tracker(), kltPolygons(), kltCylinders(), circles_disp() { tracker.setTrackerId(1); tracker.setUseHarris(1); @@ -99,17 +96,18 @@ vpMbKltTracker::~vpMbKltTracker() } kltPolygons.clear(); - // delete the structures used to display cylinders and circles - vpMbtDistanceCylinder *cy; - vpMbtDistanceCircle *ci; - for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders_disp.begin(); it!=cylinders_disp.end(); ++it){ - cy = *it; - if (cy!=NULL){ - delete cy ; + vpMbtDistanceKltCylinder *kltPolyCylinder; + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + if (kltPolyCylinder!=NULL){ + delete kltPolyCylinder ; } - cy = NULL ; + kltPolyCylinder = NULL ; } + kltCylinders.clear(); + // delete the structures used to display circles + vpMbtDistanceCircle *ci; for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles_disp.begin(); it!=circles_disp.end(); ++it){ ci = *it; if (ci!=NULL){ @@ -118,7 +116,6 @@ vpMbKltTracker::~vpMbKltTracker() ci = NULL ; } - cylinders_disp.clear(); circles_disp.clear(); } @@ -136,7 +133,12 @@ vpMbKltTracker::init(const vpImage<unsigned char>& I) #ifdef VISP_HAVE_OGRE if(!faces.isOgreInitialised()){ faces.setBackgroundSizeOgre(I.getHeight(), I.getWidth()); + faces.setOgreShowConfigDialog(ogreShowConfigDialog); faces.initOgre(cam); + // Turn off Ogre config dialog display for the next call to this function + // since settings are saved in the ogre.cfg file and used during the next + // call + ogreShowConfigDialog = false; } faces.setVisibleOgre(I, cam, cMo, angleAppears, angleDisappears, reInitialisation); @@ -152,12 +154,16 @@ void vpMbKltTracker::reinit(const vpImage<unsigned char>& I) { c0Mo = cMo; - ctTc0.setIdentity(); - firstTrack = false; + ctTc0.eye(); vpImageConvert::convert(I, cur); cam.computeFov(I.getWidth(), I.getHeight()); + + if(useScanLine){ + faces.computeClippedPolygons(cMo,cam); + faces.computeScanLineRender(cam, I.getWidth(), I.getHeight()); + } // mask #if (VISP_HAVE_OPENCV_VERSION >= 0x020408) @@ -166,14 +172,37 @@ vpMbKltTracker::reinit(const vpImage<unsigned char>& I) IplImage* mask = cvCreateImage(cvSize((int)I.getWidth(), (int)I.getHeight()), IPL_DEPTH_8U, 1); cvZero(mask); #endif - unsigned char val = 255/* - i*15*/; vpMbtDistanceKltPoints *kltpoly; - for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ - kltpoly = *it; - if(kltpoly->polygon->isVisible() && kltpoly->polygon->getNbPoint() > 2){ - kltpoly->polygon->computeRoiClipped(cam); - kltpoly->updateMask(mask, val, maskBorder); + vpMbtDistanceKltCylinder *kltPolyCylinder; + if(useScanLine){ + vpImageConvert::convert(faces.getMbScanLineRenderer().getMask(), mask); + } + else{ + unsigned char val = 255/* - i*15*/; + for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ + kltpoly = *it; + if(kltpoly->polygon->isVisible() && kltpoly->isTracked() && kltpoly->polygon->getNbPoint() > 2){ + kltpoly->polygon->computePolygonClipped(cam); // Might not be necessary when scanline is activated + kltpoly->updateMask(mask, val, maskBorder); + } + } + + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + + if(kltPolyCylinder->isTracked()) + { + for(unsigned int k = 0 ; k < kltPolyCylinder->listIndicesCylinderBBox.size() ; k++) + { + int indCylBBox = kltPolyCylinder->listIndicesCylinderBBox[k]; + if(faces[indCylBBox]->isVisible() && faces[indCylBBox]->getNbPoint() > 2){ + faces[indCylBBox]->computePolygonClipped(cam); // Might not be necessary when scanline is activated + } + } + + kltPolyCylinder->updateMask(mask, val, maskBorder); + } } } @@ -183,10 +212,18 @@ vpMbKltTracker::reinit(const vpImage<unsigned char>& I) for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ kltpoly = *it; - if(kltpoly->polygon->isVisible() && kltpoly->polygon->getNbPoint() > 2){ + if(kltpoly->polygon->isVisible() && kltpoly->isTracked() && kltpoly->polygon->getNbPoint() > 2){ kltpoly->init(tracker); } } + + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + + if(kltPolyCylinder->isTracked()) + kltPolyCylinder->init(tracker, cMo); + } + #if (VISP_HAVE_OPENCV_VERSION < 0x020408) cvReleaseImage(&mask); #endif @@ -199,7 +236,7 @@ vpMbKltTracker::reinit(const vpImage<unsigned char>& I) void vpMbKltTracker::resetTracker() { - cMo.setIdentity(); + cMo.eye(); #if (VISP_HAVE_OPENCV_VERSION < 0x020408) if(cur != NULL){ @@ -219,17 +256,18 @@ vpMbKltTracker::resetTracker() } kltPolygons.clear(); - // delete the structures used to display cylinders and circles - vpMbtDistanceCylinder *cy; - vpMbtDistanceCircle *ci; - for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders_disp.begin(); it!=cylinders_disp.end(); ++it){ - cy = *it; - if (cy!=NULL){ - delete cy ; + vpMbtDistanceKltCylinder *kltPolyCylinder; + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + if (kltPolyCylinder!=NULL){ + delete kltPolyCylinder ; } - cy = NULL ; + kltPolyCylinder = NULL ; } + kltCylinders.clear(); + // delete the structures used to display circles + vpMbtDistanceCircle *ci; for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles_disp.begin(); it!=circles_disp.end(); ++it){ ci = *it; if (ci!=NULL){ @@ -238,13 +276,11 @@ vpMbKltTracker::resetTracker() ci = NULL ; } - cylinders_disp.clear(); circles_disp.clear(); compute_interaction = true; firstInitialisation = true; computeCovariance = false; - firstTrack = false; tracker.setTrackerId(1); tracker.setUseHarris(1); @@ -260,7 +296,7 @@ vpMbKltTracker::resetTracker() angleAppears = vpMath::rad(65); angleDisappears = vpMath::rad(75); - clippingFlag = vpMbtPolygon::NO_CLIPPING; + clippingFlag = vpPolygon3D::NO_CLIPPING; maskBorder = 5; threshold_outlier = 0.5; @@ -270,6 +306,10 @@ vpMbKltTracker::resetTracker() maxIter = 200; faces.reset(); + + m_optimizationMethod = vpMbTracker::GAUSS_NEWTON_OPT; + + useScanLine = false; #ifdef VISP_HAVE_OGRE useOgre = false; @@ -352,151 +392,179 @@ vpMbKltTracker::setCameraParameters(const vpCameraParameters& camera) kltpoly->setCameraParameters(camera); } + vpMbtDistanceKltCylinder *kltPolyCylinder; + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + kltPolyCylinder->setCameraParameters(camera); + } + this->cam = camera; } /*! - Set the pose to be used in entry of the next call to the track() function. + Set the pose to be used in entry (as guess) of the next call to the track() function. This pose will be just used once. - - \warning This function has to be called after the initialization of the tracker. - + + \warning This functionnality is not available when tracking cylinders. + \param I : image corresponding to the desired pose. \param cdMo : Pose to affect. */ -void +void vpMbKltTracker::setPose(const vpImage<unsigned char> &I, const vpHomogeneousMatrix& cdMo) { - if(firstTrack) + if((int)(kltCylinders.size()) != 0) { - bool reInitialisation = false; - if(!useOgre) - faces.setVisible(I, cam, cdMo, angleAppears, angleDisappears, reInitialisation); - else{ -#ifdef VISP_HAVE_OGRE - faces.setVisibleOgre(I, cam, cdMo, angleAppears, angleDisappears, reInitialisation); -#else - faces.setVisible(I, cam, cdMo, angleAppears, angleDisappears, reInitialisation); -#endif - } - if(reInitialisation){ - std::cout << "WARNING: Visibility changed, must reinitialize to update pose" << std::endl; - cMo = cdMo; - reinit(I); - } - else{ - vpMbtDistanceKltPoints *kltpoly; + std::cout << "WARNING: Cannot set pose when model contains cylinder(s). This feature is not implemented yet." << std::endl; + std::cout << "Tracker will be reinitialized with the given pose." << std::endl; + cMo = cdMo; + init(I); + } + else + { + vpMbtDistanceKltPoints *kltpoly; #if (VISP_HAVE_OPENCV_VERSION >= 0x020408) - std::vector<cv::Point2f> initial_pts; - std::vector<long> initial_ids; + std::vector<cv::Point2f> init_pts; + std::vector<long> init_ids; + std::vector<cv::Point2f> guess_pts; #else - unsigned int nbp = 0; - for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it) { - kltpoly = *it; - if(kltpoly->polygon->isVisible() && kltpoly->polygon->getNbPoint() > 2 && kltpoly->hasEnoughPoints() ) - nbp += (*it)->getCurrentNumberPoints(); - } + unsigned int nbp = 0; + for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it) { + kltpoly = *it; + if(kltpoly->polygon->isVisible() && kltpoly->polygon->getNbPoint() > 2) + nbp += (*it)->getCurrentNumberPoints(); + } - CvPoint2D32f* initial_pts = NULL; - initial_pts = (CvPoint2D32f*)cvAlloc(nbp*sizeof(initial_pts[0])); - long *initial_ids = new long [nbp]; - unsigned int iter_points = 0; + CvPoint2D32f* init_pts = NULL; + init_pts = (CvPoint2D32f*)cvAlloc(tracker.getMaxFeatures()*sizeof(init_pts[0])); + long *init_ids = (long*)cvAlloc((unsigned int)tracker.getMaxFeatures()*sizeof(long)); + unsigned int iter_pts = 0; + + CvPoint2D32f* guess_pts = NULL; + guess_pts = (CvPoint2D32f*)cvAlloc(tracker.getMaxFeatures()*sizeof(guess_pts[0])); #endif - vpHomogeneousMatrix cdMc = cdMo * cMo.inverse(); - vpHomogeneousMatrix cMcd = cdMc.inverse(); - vpRotationMatrix cdRc; - vpTranslationVector cdtc; + vpHomogeneousMatrix cdMc = cdMo * cMo.inverse(); + vpHomogeneousMatrix cMcd = cdMc.inverse(); - cdMc.extract(cdRc); - cdMc.extract(cdtc); + vpRotationMatrix cdRc; + vpTranslationVector cdtc; - unsigned int nbCur = 0; + cdMc.extract(cdRc); + cdMc.extract(cdtc); - for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it) { - kltpoly = *it; + unsigned int nbCur = 0; - if(kltpoly->polygon->isVisible() && kltpoly->polygon->getNbPoint() > 2 && kltpoly->hasEnoughPoints() ) { + for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it) { + kltpoly = *it; - //Get the normal to the face at the current state cMo - vpPlane plan(kltpoly->polygon->p[0], kltpoly->polygon->p[1], kltpoly->polygon->p[2]); - plan.changeFrame(cMcd); + if(kltpoly->polygon->isVisible() && kltpoly->polygon->getNbPoint() > 2) { + kltpoly->polygon->changeFrame(cdMo); - vpColVector Nc = plan.getNormal(); - Nc.normalize(); + //Get the normal to the face at the current state cMo + vpPlane plan(kltpoly->polygon->p[0], kltpoly->polygon->p[1], kltpoly->polygon->p[2]); + plan.changeFrame(cMcd); - double invDc = 1.0 / plan.getD(); + vpColVector Nc = plan.getNormal(); + Nc.normalize(); - //Create the homography - vpMatrix cdHc; - vpGEMM(cdtc, Nc, -invDc, cdRc, 1.0, cdHc, VP_GEMM_B_T); - cdHc /= cdHc[2][2]; + double invDc = 1.0 / plan.getD(); - //Create the 2D homography - vpMatrix cdGc = cam.get_K() * cdHc * cam.get_K_inverse(); + //Create the homography + vpMatrix cdHc; + vpGEMM(cdtc, Nc, -invDc, cdRc, 1.0, cdHc, VP_GEMM_B_T); + cdHc /= cdHc[2][2]; - //Points displacement - std::map<int, vpImagePoint>::const_iterator iter = kltpoly->getCurrentPoints().begin(); - nbCur+= (unsigned int)kltpoly->getCurrentPoints().size(); - for( ; iter != kltpoly->getCurrentPoints().end(); iter++){ - vpColVector cdp(3); - cdp[0] = iter->second.get_j(); cdp[1] = iter->second.get_i(); cdp[2] = 1.0; + //Create the 2D homography + vpMatrix cdGc = cam.get_K() * cdHc * cam.get_K_inverse(); - double p_mu_t_2 = cdp[0] * cdGc[2][0] + cdp[1] * cdGc[2][1] + cdGc[2][2]; + //Points displacement + std::map<int, vpImagePoint>::const_iterator iter = kltpoly->getCurrentPoints().begin(); + nbCur+= (unsigned int)kltpoly->getCurrentPoints().size(); + for( ; iter != kltpoly->getCurrentPoints().end(); iter++){ + vpColVector cdp(3); + cdp[0] = iter->second.get_j(); cdp[1] = iter->second.get_i(); cdp[2] = 1.0; - if( fabs(p_mu_t_2) < std::numeric_limits<double>::epsilon()){ - cdp[0] = 0.0; - cdp[1] = 0.0; - throw vpException(vpException::divideByZeroError, "the depth of the point is calculated to zero"); - } +#if (VISP_HAVE_OPENCV_VERSION >= 0x020408) + cv::Point2f p((float)cdp[0], (float)cdp[1]); + init_pts.push_back(p); + init_ids.push_back((size_t)(kltpoly->getCurrentPointsInd())[(size_t)iter->first]); +#else + init_pts[iter_pts].x = (float)cdp[0]; + init_pts[iter_pts].y = (float)cdp[1]; + init_ids[iter_pts] = (kltpoly->getCurrentPointsInd())[(size_t)iter->first]; +#endif - cdp[0] = (cdp[0] * cdGc[0][0] + cdp[1] * cdGc[0][1] + cdGc[0][2]) / p_mu_t_2; - cdp[1] = (cdp[0] * cdGc[1][0] + cdp[1] * cdGc[1][1] + cdGc[1][2]) / p_mu_t_2; + double p_mu_t_2 = cdp[0] * cdGc[2][0] + cdp[1] * cdGc[2][1] + cdGc[2][2]; - //Set value to the KLT tracker + if( fabs(p_mu_t_2) < std::numeric_limits<double>::epsilon()){ + cdp[0] = 0.0; + cdp[1] = 0.0; + throw vpException(vpException::divideByZeroError, "the depth of the point is calculated to zero"); + } + + cdp[0] = (cdp[0] * cdGc[0][0] + cdp[1] * cdGc[0][1] + cdGc[0][2]) / p_mu_t_2; + cdp[1] = (cdp[0] * cdGc[1][0] + cdp[1] * cdGc[1][1] + cdGc[1][2]) / p_mu_t_2; + + //Set value to the KLT tracker #if (VISP_HAVE_OPENCV_VERSION >= 0x020408) - cv::Point2f p((float)cdp[0], (float)cdp[1]); - initial_pts.push_back(p); - initial_ids.push_back((size_t)(kltpoly->getCurrentPointsInd())[(size_t)iter->first]); + cv::Point2f p_guess((float)cdp[0], (float)cdp[1]); + guess_pts.push_back(p_guess); #else - initial_pts[iter_points].x = (float)cdp[0]; - initial_pts[iter_points].y = (float)cdp[1]; - initial_ids[iter_points++] = (kltpoly->getCurrentPointsInd())[(size_t)iter->first]; + guess_pts[iter_pts].x = (float)cdp[0]; + guess_pts[iter_pts++].y = (float)cdp[1]; #endif - } } } + } - vpImageConvert::convert(I, cur); + vpImageConvert::convert(I, cur); #if (VISP_HAVE_OPENCV_VERSION >= 0x020408) - tracker.initTracking(cur,initial_pts,initial_ids); // false to keep the id of the points + tracker.setInitialGuess(init_pts, guess_pts, init_ids); #else - tracker.initTracking(cur, initial_pts, initial_ids, iter_points); + tracker.setInitialGuess(&init_pts, &guess_pts, init_ids, iter_pts); + + if(init_pts) cvFree(&init_pts); + init_pts = NULL; - if(initial_pts) cvFree(&initial_pts); - initial_pts = NULL; - delete [] initial_ids; + if(guess_pts) cvFree(&guess_pts); + guess_pts = NULL; + + if(init_ids)cvFree(&init_ids); + init_ids = NULL; #endif - for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ - kltpoly = *it; - if(kltpoly->polygon->isVisible() && kltpoly->polygon->getNbPoint() > 2){ - kltpoly->polygon->computeRoiClipped(cam); - kltpoly->init(tracker); - } - } + bool reInitialisation = false; + if(!useOgre) + faces.setVisible(I, cam, cdMo, angleAppears, angleDisappears, reInitialisation); + else{ +#ifdef VISP_HAVE_OGRE + faces.setVisibleOgre(I, cam, cdMo, angleAppears, angleDisappears, reInitialisation); +#else + faces.setVisible(I, cam, cdMo, angleAppears, angleDisappears, reInitialisation); +#endif + } - cMo = cdMo; - c0Mo = cMo; - ctTc0.setIdentity(); - firstTrack = false; + cam.computeFov(I.getWidth(), I.getHeight()); + + if(useScanLine){ + faces.computeClippedPolygons(cdMo,cam); + faces.computeScanLineRender(cam, I.getWidth(), I.getHeight()); } - } - else{ + + for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ + kltpoly = *it; + if(kltpoly->polygon->isVisible() && kltpoly->polygon->getNbPoint() > 2){ + kltpoly->polygon->computePolygonClipped(cam); + kltpoly->init(tracker); + } + } + cMo = cdMo; - init(I); + c0Mo = cMo; + ctTc0.eye(); } } @@ -511,6 +579,8 @@ vpMbKltTracker::initFaceFromCorners(vpMbtPolygon &polygon) vpMbtDistanceKltPoints *kltPoly = new vpMbtDistanceKltPoints(); kltPoly->setCameraParameters(cam) ; kltPoly->polygon = &polygon; + kltPoly->hiddenface = &faces ; + kltPoly->useScanLine = useScanLine; kltPolygons.push_back(kltPoly); } /*! @@ -524,6 +594,8 @@ vpMbKltTracker::initFaceFromLines(vpMbtPolygon &polygon) vpMbtDistanceKltPoints *kltPoly = new vpMbtDistanceKltPoints(); kltPoly->setCameraParameters(cam) ; kltPoly->polygon = &polygon; + kltPoly->hiddenface = &faces ; + kltPoly->useScanLine = useScanLine; kltPolygons.push_back(kltPoly); } @@ -539,9 +611,6 @@ vpMbKltTracker::preTracking(const vpImage<unsigned char>& I, unsigned int &nbInf { vpImageConvert::convert(I, cur); tracker.track(cur); - - if(!firstTrack) - firstTrack = true; nbInfos = 0; nbFaceUsed = 0; @@ -549,7 +618,7 @@ vpMbKltTracker::preTracking(const vpImage<unsigned char>& I, unsigned int &nbInf // for (unsigned int i = 0; i < faces.size(); i += 1){ for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ kltpoly = *it; - if(kltpoly->polygon->isVisible() && kltpoly->polygon->getNbPoint() > 2){ + if(kltpoly->polygon->isVisible() && kltpoly->isTracked() && kltpoly->polygon->getNbPoint() > 2){ kltpoly->computeNbDetectedCurrent(tracker); // faces[i]->ransac(); if(kltpoly->hasEnoughPoints()){ @@ -558,6 +627,20 @@ vpMbKltTracker::preTracking(const vpImage<unsigned char>& I, unsigned int &nbInf } } } + + vpMbtDistanceKltCylinder *kltPolyCylinder; + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + + if(kltPolyCylinder->isTracked()) + { + kltPolyCylinder->computeNbDetectedCurrent(tracker); + if(kltPolyCylinder->hasEnoughPoints()){ + nbInfos += kltPolyCylinder->getCurrentNumberPoints(); + nbFaceUsed++; + } + } + } } /*! @@ -577,12 +660,12 @@ vpMbKltTracker::postTracking(const vpImage<unsigned char>& I, vpColVector &w) // for (unsigned int i = 0; i < faces.size(); i += 1){ for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ kltpoly = *it; - if(kltpoly->polygon->isVisible() && kltpoly->polygon->getNbPoint() > 2){ + if(kltpoly->polygon->isVisible() && kltpoly->isTracked() && kltpoly->polygon->getNbPoint() > 2){ initialNumber += kltpoly->getInitialNumberPoint(); if(kltpoly->hasEnoughPoints()){ vpSubColVector sub_w(w, shift, 2*kltpoly->getCurrentNumberPoints()); - kltpoly->removeOutliers(sub_w, threshold_outlier); shift += 2*kltpoly->getCurrentNumberPoints(); + kltpoly->removeOutliers(sub_w, threshold_outlier); currentNumber += kltpoly->getCurrentNumberPoints(); } @@ -592,6 +675,23 @@ vpMbKltTracker::postTracking(const vpImage<unsigned char>& I, vpColVector &w) // } } } + + vpMbtDistanceKltCylinder *kltPolyCylinder; + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + + if(kltPolyCylinder->isTracked()) + { + initialNumber += kltPolyCylinder->getInitialNumberPoint(); + if(kltPolyCylinder->hasEnoughPoints()){ + vpSubColVector sub_w(w, shift, 2*kltPolyCylinder->getCurrentNumberPoints()); + shift += 2*kltPolyCylinder->getCurrentNumberPoints(); + kltPolyCylinder->removeOutliers(sub_w, threshold_outlier); + + currentNumber += kltPolyCylinder->getCurrentNumberPoints(); + } + } + } // if(!reInitialisation){ double value = percentGood * (double)initialNumber; @@ -637,8 +737,12 @@ vpMbKltTracker::computeVVS(const unsigned int &nbInfos, vpColVector &w) vpColVector w_true; vpRobust robust(2*nbInfos); - vpMatrix LTL, LTR; + vpMatrix LTL; + vpColVector LTR; vpHomogeneousMatrix cMoPrev; + vpHomogeneousMatrix ctTc0_Prev; + vpColVector m_error_prev(2*nbInfos); + double mu = 0.01; double normRes = 0; double normRes_1 = -1; @@ -646,7 +750,7 @@ vpMbKltTracker::computeVVS(const unsigned int &nbInfos, vpColVector &w) R.resize(2*nbInfos); L.resize(2*nbInfos, 6, 0); - + while( ((int)((normRes - normRes_1)*1e8) != 0 ) && (iter<maxIter) ){ unsigned int shift = 0; @@ -654,7 +758,7 @@ vpMbKltTracker::computeVVS(const unsigned int &nbInfos, vpColVector &w) // for (unsigned int i = 0; i < faces.size(); i += 1){ for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ kltpoly = *it; - if(kltpoly->polygon->isVisible() && kltpoly->polygon->getNbPoint() > 2 && + if(kltpoly->polygon->isVisible() && kltpoly->isTracked() && kltpoly->polygon->getNbPoint() > 2 && kltpoly->hasEnoughPoints()){ vpSubColVector subR(R, shift, 2*kltpoly->getCurrentNumberPoints()); vpSubMatrix subL(L, shift, 0, 2*kltpoly->getCurrentNumberPoints(), 6); @@ -669,62 +773,137 @@ vpMbKltTracker::computeVVS(const unsigned int &nbInfos, vpColVector &w) } } - /* robust */ - if(iter == 0){ - w_true.resize(2*nbInfos); - w.resize(2*nbInfos); - w = 1; - w_true = 1; - } - robust.setIteration(iter); - robust.setThreshold(2/cam.get_px()); - robust.MEstimator( vpRobust::TUKEY, R, w); - - m_error = R; - if(computeCovariance){ - L_true = L; - if(!isoJoIdentity){ - vpVelocityTwistMatrix cVo; - cVo.buildFrom(cMo); - LVJ_true = (L*cVo*oJo); + vpMbtDistanceKltCylinder *kltPolyCylinder; + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + + if(kltPolyCylinder->isTracked() && kltPolyCylinder->hasEnoughPoints()) + { + vpSubColVector subR(R, shift, 2*kltPolyCylinder->getCurrentNumberPoints()); + vpSubMatrix subL(L, shift, 0, 2*kltPolyCylinder->getCurrentNumberPoints(), 6); + try{ + kltPolyCylinder->computeInteractionMatrixAndResidu(ctTc0,subR, subL); + }catch(...){ + throw vpTrackingException(vpTrackingException::fatalError, "Cannot compute interaction matrix"); + } + + shift += 2*kltPolyCylinder->getCurrentNumberPoints(); } } - normRes_1 = normRes; - normRes = 0; - for (unsigned int i = 0; i < static_cast<unsigned int>(R.getRows()); i += 1){ - w_true[i] = w[i]; - R[i] = R[i] * w[i]; - normRes += R[i]; + bool reStartFromLastIncrement = false; + if(iter != 0 && m_optimizationMethod == vpMbTracker::LEVENBERG_MARQUARDT_OPT){ + if(m_error.sumSquare()/(double)(2*nbInfos) > m_error_prev.sumSquare()/(double)(2*nbInfos)){ + mu *= 10.0; + + if(mu > 1.0) + throw vpTrackingException(vpTrackingException::fatalError, "Optimization diverged"); + + cMo = cMoPrev; + m_error = m_error_prev; + ctTc0 = ctTc0_Prev; + reStartFromLastIncrement = true; + } } - if((iter == 0) || compute_interaction){ - for(unsigned int i=0; i<static_cast<unsigned int>(R.getRows()); i++){ - for(unsigned int j=0; j<6; j++){ - L[i][j] *= w[i]; + if(!reStartFromLastIncrement){ + if(iter == 0){ + w_true.resize(2*nbInfos); + w.resize(2*nbInfos); + w = 1; + w_true = 1; + } + robust.setIteration(iter); + robust.setThreshold(2/cam.get_px()); + robust.MEstimator( vpRobust::TUKEY, R, w); + + m_error = R; + if(computeCovariance){ + L_true = L; + if(!isoJoIdentity){ + vpVelocityTwistMatrix cVo; + cVo.buildFrom(cMo); + LVJ_true = (L*cVo*oJo); } } - } - if(isoJoIdentity){ - LTL = L.AtA(); - computeJTR(L, R, LTR); - v = -lambda * LTL.pseudoInverse(1e-16) * LTR; - } - else{ - vpVelocityTwistMatrix cVo; - cVo.buildFrom(cMo); - vpMatrix LVJ = (L*cVo*oJo); - vpMatrix LVJTLVJ = (LVJ).AtA(); - vpMatrix LVJTR; - computeJTR(LVJ, R, LVJTR); - v = -lambda*LVJTLVJ.pseudoInverse(1e-16)*LVJTR; - v = cVo * v; - } + normRes_1 = normRes; + normRes = 0; + for (unsigned int i = 0; i < static_cast<unsigned int>(R.getRows()); i += 1){ + w_true[i] = w[i]; + R[i] = R[i] * w[i]; + normRes += R[i]; + } + + if((iter == 0) || compute_interaction){ + for(unsigned int i=0; i<static_cast<unsigned int>(R.getRows()); i++){ + for(unsigned int j=0; j<6; j++){ + L[i][j] *= w[i]; + } + } + } - ctTc0 = vpExponentialMap::direct(v).inverse() * ctTc0; - cMoPrev = cMo; - cMo = ctTc0 * c0Mo; + if(isoJoIdentity){ + LTL = L.AtA(); + computeJTR(L, R, LTR); + + switch(m_optimizationMethod){ + case vpMbTracker::LEVENBERG_MARQUARDT_OPT: + { + vpMatrix LMA(LTL.getRows(), LTL.getCols()); + LMA.eye(); + vpMatrix LTLmuI = LTL + (LMA*mu); + v = -lambda*LTLmuI.pseudoInverse(LTLmuI.getRows()*std::numeric_limits<double>::epsilon())*LTR; + + if(iter != 0) + mu /= 10.0; + + m_error_prev = m_error; + break; + } + case vpMbTracker::GAUSS_NEWTON_OPT: + default: + v = -lambda * LTL.pseudoInverse(LTL.getRows()*std::numeric_limits<double>::epsilon()) * LTR; + } + } + else{ + vpVelocityTwistMatrix cVo; + cVo.buildFrom(cMo); + vpMatrix LVJ = (L*cVo*oJo); + vpMatrix LVJTLVJ = (LVJ).AtA(); + vpColVector LVJTR; + computeJTR(LVJ, R, LVJTR); + + switch(m_optimizationMethod){ + case vpMbTracker::LEVENBERG_MARQUARDT_OPT: + { + vpMatrix LMA(LVJTLVJ.getRows(), LVJTLVJ.getCols()); + LMA.eye(); + vpMatrix LTLmuI = LVJTLVJ + (LMA*mu); + v = -lambda*LTLmuI.pseudoInverse(LTLmuI.getRows()*std::numeric_limits<double>::epsilon())*LVJTR; + v = cVo * v; + + if(iter != 0) + mu /= 10.0; + + m_error_prev = m_error; + break; + } + case vpMbTracker::GAUSS_NEWTON_OPT: + default: + { + v = -lambda*LVJTLVJ.pseudoInverse(LVJTLVJ.getRows()*std::numeric_limits<double>::epsilon())*LVJTR; + v = cVo * v; + break; + } + } + } + + cMoPrev = cMo; + ctTc0_Prev = ctTc0; + ctTc0 = vpExponentialMap::direct(v).inverse() * ctTc0; + cMo = ctTc0 * c0Mo; + } // endif(!restartFromLast) iter++; } @@ -735,10 +914,10 @@ vpMbKltTracker::computeVVS(const unsigned int &nbInfos, vpColVector &w) // Note that here the covariance is computed on cMoPrev for time computation efficiency if(isoJoIdentity){ - computeCovarianceMatrix(cMoPrev,m_error,L_true,D); + covarianceMatrix = vpMatrix::computeCovarianceMatrixVVS(cMoPrev,m_error,L_true,D); } else{ - computeCovarianceMatrix(cMoPrev,m_error,LVJ_true,D); + covarianceMatrix = vpMatrix::computeCovarianceMatrixVVS(cMoPrev,m_error,LVJ_true,D); } } } @@ -878,6 +1057,9 @@ vpMbKltTracker::loadConfigFile(const char* configFile) maskBorder = xmlp.getMaskBorder(); angleAppears = vpMath::rad(xmlp.getAngleAppear()); angleDisappears = vpMath::rad(xmlp.getAngleDisappear()); + + //if(useScanLine) + faces.getMbScanLineRenderer().setMaskBorder(maskBorder); if(xmlp.hasNearClippingDistance()) setNearClippingDistance(xmlp.getNearClippingDistance()); @@ -886,7 +1068,19 @@ vpMbKltTracker::loadConfigFile(const char* configFile) setFarClippingDistance(xmlp.getFarClippingDistance()); if(xmlp.getFovClipping()) - setClipping(clippingFlag = clippingFlag | vpMbtPolygon::FOV_CLIPPING); + setClipping(clippingFlag = clippingFlag | vpPolygon3D::FOV_CLIPPING); + + useLodGeneral = xmlp.getLodState(); + minLineLengthThresholdGeneral = xmlp.getMinLineLengthThreshold(); + minPolygonAreaThresholdGeneral = xmlp.getMinPolygonAreaThreshold(); + + applyLodSettingInConfig = false; + if(this->getNbPolygon() > 0) { + applyLodSettingInConfig = true; + setLod(useLodGeneral); + setMinLineLengthThresh(minLineLengthThresholdGeneral); + setMinPolygonAreaThresh(minPolygonAreaThresholdGeneral); + } #else vpTRACE("You need the libXML2 to read the config file %s", configFile); @@ -908,48 +1102,46 @@ vpMbKltTracker::display(const vpImage<unsigned char>& I, const vpHomogeneousMatr const vpColor& col, const unsigned int thickness, const bool displayFullModel) { vpCameraParameters c = camera; - + if(clippingFlag > 3) // Contains at least one FOV constraint c.computeFov(I.getWidth(), I.getHeight()); - + vpMbtDistanceKltPoints *kltpoly; -// for (unsigned int i = 0; i < faces.size(); i += 1){ + vpMbtDistanceKltCylinder *kltPolyCylinder; + + // Previous version 12/08/2015 +// for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ +// kltpoly = *it; +// kltpoly->polygon->changeFrame(cMo_); +// kltpoly->polygon->computePolygonClipped(c); +// } + faces.computeClippedPolygons(cMo_,c); + + if(useScanLine && !displayFullModel) + faces.computeScanLineRender(cam,I.getWidth(), I.getHeight()); + for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ kltpoly = *it; - if(displayFullModel || kltpoly->polygon->isVisible()) - { - kltpoly->polygon->changeFrame(cMo_); - kltpoly->polygon->computeRoiClipped(c); - std::vector<std::pair<vpImagePoint,unsigned int> > roi; - kltpoly->polygon->getRoiClipped(c, roi); - - for (unsigned int j = 0; j < roi.size(); j += 1){ - if(((roi[(j+1)%roi.size()].second & roi[j].second & vpMbtPolygon::NEAR_CLIPPING) == 0) && - ((roi[(j+1)%roi.size()].second & roi[j].second & vpMbtPolygon::FAR_CLIPPING) == 0) && - ((roi[(j+1)%roi.size()].second & roi[j].second & vpMbtPolygon::DOWN_CLIPPING) == 0) && - ((roi[(j+1)%roi.size()].second & roi[j].second & vpMbtPolygon::UP_CLIPPING) == 0) && - ((roi[(j+1)%roi.size()].second & roi[j].second & vpMbtPolygon::LEFT_CLIPPING) == 0) && - ((roi[(j+1)%roi.size()].second & roi[j].second & vpMbtPolygon::RIGHT_CLIPPING) == 0)){ - vpImagePoint ip1, ip2; - ip1 = roi[j].first; - ip2 = roi[(j+1)%roi.size()].first; - - vpDisplay::displayLine (I, ip1, ip2, col, thickness); - } - } - } - if(displayFeatures && kltpoly->hasEnoughPoints() && kltpoly->polygon->isVisible()) { - kltpoly->displayPrimitive(I); + + kltpoly->display(I,cMo_,camera,col,thickness,displayFullModel); + + if(displayFeatures && kltpoly->hasEnoughPoints() && kltpoly->polygon->isVisible() && kltpoly->isTracked()) { + kltpoly->displayPrimitive(I); // faces[i]->displayNormal(I); } } - for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders_disp.begin(); it!=cylinders_disp.end(); ++it){ - (*it)->display(I, cMo_, camera, col, thickness); + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + + kltPolyCylinder->display(I,cMo_,camera,col,thickness,displayFullModel); + + if(displayFeatures && kltPolyCylinder->isTracked() && kltPolyCylinder->hasEnoughPoints()) + kltPolyCylinder->displayPrimitive(I); } for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles_disp.begin(); it!=circles_disp.end(); ++it){ - (*it)->display(I, cMo_, camera, col, thickness); + (*it)->display(I, cMo_, camera, col, thickness, displayFullModel); } #ifdef VISP_HAVE_OGRE @@ -976,41 +1168,39 @@ vpMbKltTracker::display(const vpImage<vpRGBa>& I, const vpHomogeneousMatrix &cMo if(clippingFlag > 3) // Contains at least one FOV constraint c.computeFov(I.getWidth(), I.getHeight()); - + vpMbtDistanceKltPoints *kltpoly; -// for (unsigned int i = 0; i < faces.size(); i += 1){ + vpMbtDistanceKltCylinder *kltPolyCylinder; + + // Previous version 12/08/2015 +// for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ +// kltpoly = *it; +// kltpoly->polygon->changeFrame(cMo_); +// kltpoly->polygon->computePolygonClipped(c); +// } + faces.computeClippedPolygons(cMo_,c); + + if(useScanLine && !displayFullModel) + faces.computeScanLineRender(cam,I.getWidth(), I.getHeight()); + for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ kltpoly = *it; - if(displayFullModel || kltpoly->polygon->isVisible()) - { - kltpoly->polygon->changeFrame(cMo_); - kltpoly->polygon->computeRoiClipped(c); - std::vector<std::pair<vpImagePoint,unsigned int> > roi; - kltpoly->polygon->getRoiClipped(c, roi); - - for (unsigned int j = 0; j < roi.size(); j += 1){ - if(((roi[(j+1)%roi.size()].second & roi[j].second & vpMbtPolygon::NEAR_CLIPPING) == 0) && - ((roi[(j+1)%roi.size()].second & roi[j].second & vpMbtPolygon::FAR_CLIPPING) == 0) && - ((roi[(j+1)%roi.size()].second & roi[j].second & vpMbtPolygon::DOWN_CLIPPING) == 0) && - ((roi[(j+1)%roi.size()].second & roi[j].second & vpMbtPolygon::UP_CLIPPING) == 0) && - ((roi[(j+1)%roi.size()].second & roi[j].second & vpMbtPolygon::LEFT_CLIPPING) == 0) && - ((roi[(j+1)%roi.size()].second & roi[j].second & vpMbtPolygon::RIGHT_CLIPPING) == 0)){ - vpImagePoint ip1, ip2; - ip1 = roi[j].first; - ip2 = roi[(j+1)%roi.size()].first; - - vpDisplay::displayLine (I, ip1, ip2, col, thickness); - } - } - } - if(displayFeatures && kltpoly->hasEnoughPoints() && kltpoly->polygon->isVisible()) { - kltpoly->displayPrimitive(I); + + kltpoly->display(I,cMo_,camera,col,thickness,displayFullModel); + + if(displayFeatures && kltpoly->hasEnoughPoints() && kltpoly->polygon->isVisible() && kltpoly->isTracked()) { + kltpoly->displayPrimitive(I); // faces[i]->displayNormal(I); } } - for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders_disp.begin(); it!=cylinders_disp.end(); ++it){ - (*it)->display(I, cMo_, camera, col, thickness); + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + + kltPolyCylinder->display(I,cMo_,camera,col,thickness,displayFullModel); + + if(displayFeatures && kltPolyCylinder->isTracked() && kltPolyCylinder->hasEnoughPoints()) + kltPolyCylinder->displayPrimitive(I); } for(std::list<vpMbtDistanceCircle*>::const_iterator it=circles_disp.begin(); it!=circles_disp.end(); ++it){ @@ -1039,11 +1229,18 @@ vpMbKltTracker::testTracking() // for (unsigned int i = 0; i < faces.size(); i += 1){ for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ kltpoly = *it; - if(kltpoly->polygon->isVisible() && kltpoly->polygon->getNbPoint() > 2){ + if(kltpoly->polygon->isVisible() && kltpoly->isTracked() && kltpoly->polygon->getNbPoint() > 2 && kltpoly->hasEnoughPoints()){ nbTotalPoints += kltpoly->getCurrentNumberPoints(); } } + vpMbtDistanceKltCylinder *kltPolyCylinder; + for(std::list<vpMbtDistanceKltCylinder*>::const_iterator it=kltCylinders.begin(); it!=kltCylinders.end(); ++it){ + kltPolyCylinder = *it; + if(kltPolyCylinder->isTracked() && kltPolyCylinder->hasEnoughPoints()) + nbTotalPoints += kltPolyCylinder->getCurrentNumberPoints(); + } + if(nbTotalPoints < 10){ std::cerr << "test tracking failed (too few points to realize a good tracking)." << std::endl; throw vpTrackingException(vpTrackingException::fatalError, @@ -1058,45 +1255,27 @@ vpMbKltTracker::testTracking() \param p1 : First point on the axis. \param p2 : Second point on the axis. \param radius : Radius of the cylinder. + \param idFace : Identifier of the polygon representing the revolution axis of the cylinder. \param name : The optional name of the cylinder. */ void -vpMbKltTracker::initCylinder(const vpPoint& p1, const vpPoint &p2, const double radius, const int /*idFace*/, - const std::string &name) +vpMbKltTracker::initCylinder(const vpPoint& p1, const vpPoint &p2, const double radius, const int idFace, + const std::string &/*name*/) { - addCylinder(p1, p2, radius, name); -} + vpMbtDistanceKltCylinder *kltPoly = new vpMbtDistanceKltCylinder(); + kltPoly->setCameraParameters(cam) ; -/*! - Add a cylinder to the list of cylinders. + kltPoly->buildFrom(p1,p2,radius); - \param P1 : The first extremity of the axis. - \param P2 : The second extremity of the axis. - \param r : The radius of the cylinder. - \param name : The optional name of the cylinder. -*/ -void -vpMbKltTracker::addCylinder(const vpPoint &P1, const vpPoint &P2, const double r, const std::string &name) -{ - bool already_here = false ; - vpMbtDistanceCylinder *cy ; + // Add the Cylinder BBox to the list of polygons + kltPoly->listIndicesCylinderBBox.push_back(idFace+1); + kltPoly->listIndicesCylinderBBox.push_back(idFace+2); + kltPoly->listIndicesCylinderBBox.push_back(idFace+3); + kltPoly->listIndicesCylinderBBox.push_back(idFace+4); -// for(std::list<vpMbtDistanceCylinder*>::const_iterator it=cylinders_disp.begin(); it!=cylinders_disp.end(); ++it){ -// cy = *it; -// if((samePoint(*(cy->p1),P1) && samePoint(*(cy->p2),P2)) || -// (samePoint(*(cy->p1),P2) && samePoint(*(cy->p2),P1)) ){ -// already_here = (std::fabs(cy->radius - r) < std::numeric_limits<double>::epsilon() * vpMath::maximum(cy->radius, r)); -// } -// } - - if (!already_here){ - cy = new vpMbtDistanceCylinder ; - - cy->setCameraParameters(cam); - cy->setName(name); - cy->buildFrom(P1, P2, r); - cylinders_disp.push_back(cy); - } + kltPoly->hiddenface = &faces ; + kltPoly->useScanLine = useScanLine; + kltCylinders.push_back(kltPoly); } /*! @@ -1178,7 +1357,7 @@ void vpMbKltTracker::reInitModel(const vpImage<unsigned char>& I, const char* cad_name, const vpHomogeneousMatrix& cMo_, const bool verbose) { - this->cMo.setIdentity(); + this->cMo.eye(); #if (VISP_HAVE_OPENCV_VERSION < 0x020408) if(cur != NULL){ @@ -1188,7 +1367,6 @@ vpMbKltTracker::reInitModel(const vpImage<unsigned char>& I, const char* cad_nam #endif firstInitialisation = true; - firstTrack = false; faces.reset(); @@ -1196,4 +1374,25 @@ vpMbKltTracker::reInitModel(const vpImage<unsigned char>& I, const char* cad_nam initFromPose(I, cMo_); } +/*! + Set if the polygons that have the given name have to be considered during the tracking phase. + + \param name : name of the polygon(s). + \param useKltTracking : True if it has to be considered, False otherwise. +*/ +void +vpMbKltTracker::setUseKltTracking(const std::string &name, const bool &useKltTracking) +{ + vpMbtDistanceKltPoints *kltpoly; + for(std::list<vpMbtDistanceKltPoints*>::const_iterator it=kltPolygons.begin(); it!=kltPolygons.end(); ++it){ + kltpoly = *it; + if(kltpoly->polygon->getName() == name){ + kltpoly->setTracked(useKltTracking); + } + } +} + +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_mbt.a(vpMbKltTracker.cpp.o) has no symbols +void dummy_vpMbKltTracker() {}; #endif //VISP_HAVE_OPENCV diff --git a/modules/tracker/mbt/src/klt/vpMbtDistanceKltCylinder.cpp b/modules/tracker/mbt/src/klt/vpMbtDistanceKltCylinder.cpp new file mode 100644 index 0000000000000000000000000000000000000000..048f253959a1412528cfef934858e73ba94a373d --- /dev/null +++ b/modules/tracker/mbt/src/klt/vpMbtDistanceKltCylinder.cpp @@ -0,0 +1,623 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Klt cylinder, containing points of interest. + * + * Authors: + * Aurelien Yol + * + *****************************************************************************/ + +#include <visp3/mbt/vpMbtDistanceKltCylinder.h> +#include <visp3/mbt/vpMbtDistanceKltPoints.h> +#include <visp3/core/vpPolygon.h> + + +#if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) + +/*! + Basic constructor. + +*/ +vpMbtDistanceKltCylinder::vpMbtDistanceKltCylinder() + : c0Mo(), p1Ext(), p2Ext(), cylinder(), circle1(), circle2(), + initPoints(), initPoints3D(), curPoints(), curPointsInd(), + nbPointsCur(0), nbPointsInit(0), minNbPoint(4), enoughPoints(false), + cam(), isTrackedKltCylinder(true), listIndicesCylinderBBox(), hiddenface(NULL), useScanLine(false) +{ +} + +/*! + Basic destructor. + +*/ +vpMbtDistanceKltCylinder::~vpMbtDistanceKltCylinder() +{} + + + +void +vpMbtDistanceKltCylinder::buildFrom(const vpPoint &p1, const vpPoint &p2, const double &r) +{ + p1Ext = p1; + p2Ext = p2; + + vpColVector ABC(3); + vpColVector V1(3); + vpColVector V2(3); + + V1[0] = p1.get_oX(); + V1[1] = p1.get_oY(); + V1[2] = p1.get_oZ(); + V2[0] = p2.get_oX(); + V2[1] = p2.get_oY(); + V2[2] = p2.get_oZ(); + + // Get the axis of the cylinder + ABC = V1-V2; + + // Build our extremity circles + circle1.setWorldCoordinates(ABC[0],ABC[1],ABC[2],p1.get_oX(),p1.get_oY(),p1.get_oZ(),r); + circle2.setWorldCoordinates(ABC[0],ABC[1],ABC[2],p2.get_oX(),p2.get_oY(),p2.get_oZ(),r); + + // Build our cylinder + cylinder.setWorldCoordinates(ABC[0],ABC[1],ABC[2],(p1.get_oX()+p2.get_oX())/2.0,(p1.get_oY()+p2.get_oY())/2.0,(p1.get_oZ()+p2.get_oZ())/2.0,r); +} + +/*! + Initialise the cylinder to track. All the points in the map, representing all the + map detected in the image, are parsed in order to extract the id of the points + that are indeed in the face. + + \param _tracker : ViSP OpenCV KLT Tracker. + \param cMo : Pose of the object in the camera frame at initialization. +*/ +void +vpMbtDistanceKltCylinder::init(const vpKltOpencv& _tracker, const vpHomogeneousMatrix &cMo) +{ + c0Mo = cMo; + cylinder.changeFrame(cMo); + + // extract ids of the points in the face + nbPointsInit = 0; + nbPointsCur = 0; + initPoints = std::map<int, vpImagePoint>(); + initPoints3D = std::map<int, vpPoint>(); + curPoints = std::map<int, vpImagePoint>(); + curPointsInd = std::map<int, int>(); + + for (unsigned int i = 0; i < static_cast<unsigned int>(_tracker.getNbFeatures()); i ++){ + int id; + float x_tmp, y_tmp; + _tracker.getFeature((int)i, id, x_tmp, y_tmp); + + bool add = false; + + if(useScanLine) + { + if((unsigned int)y_tmp < hiddenface->getMbScanLineRenderer().getPrimitiveIDs().getHeight() && + (unsigned int)x_tmp < hiddenface->getMbScanLineRenderer().getPrimitiveIDs().getWidth()) + { + for(unsigned int kc = 0 ; kc < listIndicesCylinderBBox.size() ; kc++) + if(hiddenface->getMbScanLineRenderer().getPrimitiveIDs()[(unsigned int)y_tmp][(unsigned int)x_tmp] == listIndicesCylinderBBox[kc]) + { + add = true; + break; + } + } + } + else + { + std::vector<vpImagePoint> roi; + for(unsigned int kc = 0 ; kc < listIndicesCylinderBBox.size() ; kc++) + { + hiddenface->getPolygon()[listIndicesCylinderBBox[kc]]->getRoiClipped(cam, roi); + if(vpPolygon::isInside(roi, y_tmp, x_tmp)) + { + add = true; + break; + } + roi.clear(); + } + } + + if(add){ + + double xm=0, ym=0; + vpPixelMeterConversion::convertPoint(cam, x_tmp, y_tmp, xm, ym); + double Z = computeZ(xm,ym); + if(!vpMath::isNaN(Z)){ + initPoints[id] = vpImagePoint(y_tmp, x_tmp); + curPoints[id] = vpImagePoint(y_tmp, x_tmp); + curPointsInd[id] = (int)i; + nbPointsInit++; + nbPointsCur++; + + + vpPoint p; + p.setWorldCoordinates(xm * Z, ym * Z, Z); + initPoints3D[id] = p; + //std::cout << "Computed Z for : " << xm << "," << ym << " : " << computeZ(xm,ym) << std::endl; + } + } + } + + if(nbPointsCur >= minNbPoint) enoughPoints = true; + else enoughPoints = false; + + //std::cout << "Nb detected points in cylinder : " << nbPointsCur << std::endl; +} + +/*! + compute the number of point in this instanciation of the tracker that corresponds + to the points of the cylinder + + \param _tracker : the KLT tracker + \return the number of points that are tracked in this face and in this instanciation of the tracker +*/ +unsigned int +vpMbtDistanceKltCylinder::computeNbDetectedCurrent(const vpKltOpencv& _tracker) +{ + int id; + float x, y; + nbPointsCur = 0; + curPoints = std::map<int, vpImagePoint>(); + curPointsInd = std::map<int, int>(); + + for (unsigned int i = 0; i < static_cast<unsigned int>(_tracker.getNbFeatures()); i++){ + _tracker.getFeature((int)i, id, x, y); + if(isTrackedFeature(id)){ + curPoints[id] = vpImagePoint(static_cast<double>(y),static_cast<double>(x)); + curPointsInd[id] = (int)i; + nbPointsCur++; + } + } + + if(nbPointsCur >= minNbPoint) enoughPoints = true; + else enoughPoints = false; + + return nbPointsCur; +} + +/*! + This method removes the outliers. A point is considered as outlier when its + associated weight is below a given threshold (threshold_outlier). + + \param _w : Vector containing the weight of all the tracked points. + \param threshold_outlier : Threshold to specify wether or not a point has to be deleted. +*/ +void +vpMbtDistanceKltCylinder::removeOutliers(const vpColVector& _w, const double &threshold_outlier) +{ + std::map<int, vpImagePoint> tmp; + std::map<int, int> tmp2; + unsigned int nbSupp = 0; + unsigned int k = 0; + + nbPointsCur = 0; + std::map<int, vpImagePoint>::const_iterator iter = curPoints.begin(); + for( ; iter != curPoints.end(); iter++){ + if(_w[k] > threshold_outlier && _w[k+1] > threshold_outlier){ +// if(_w[k] > threshold_outlier || _w[k+1] > threshold_outlier){ + tmp[iter->first] = vpImagePoint(iter->second.get_i(), iter->second.get_j()); + tmp2[iter->first] = curPointsInd[iter->first]; + nbPointsCur++; + } + else{ + nbSupp++; + initPoints.erase(iter->first); + } + + k+=2; + } + + if(nbSupp != 0){ + curPoints = std::map<int, vpImagePoint>(); + curPointsInd = std::map<int, int>(); + + curPoints = tmp; + curPointsInd = tmp2; + if(nbPointsCur >= minNbPoint) enoughPoints = true; + else enoughPoints = false; + } +} + +/*! + Compute the interaction matrix and the residu vector for the face. + The method assumes that these two objects are properly sized in order to be + able to improve the speed with the use of SubCoVector and subMatrix. + + \warning The function preCompute must be called before the this method. + + \param _cMc0 : camera displacement since initialisation + \param _R : the residu vector + \param _J : the interaction matrix +*/ +void +vpMbtDistanceKltCylinder::computeInteractionMatrixAndResidu(const vpHomogeneousMatrix &_cMc0, vpColVector& _R, vpMatrix& _J) +{ + unsigned int index_ = 0; + + cylinder.changeFrame(_cMc0 * c0Mo); + + std::map<int, vpImagePoint>::const_iterator iter = curPoints.begin(); + for( ; iter != curPoints.end(); iter++){ + int id(iter->first); + double i_cur(iter->second.get_i()), j_cur(iter->second.get_j()); + + double x_cur(0), y_cur(0); + vpPixelMeterConversion::convertPoint(cam, j_cur, i_cur, x_cur, y_cur); + + vpPoint p0 = initPoints3D[id]; + p0.changeFrame(_cMc0); + p0.project(); + + double x0_transform(p0.get_x()), y0_transform(p0.get_y()) ; + + double Z = computeZ(x_cur, y_cur); + + if(vpMath::isNaN(Z) || Z < std::numeric_limits<double>::epsilon()){ +// std::cout << "Z is Nan : " << A << " , " << B << " , " << C << " | " << Z << " | " << x_cur << " , " << y_cur << std::endl; +// std::cout << std::sqrt(B*B - A*C) << " , " << B*B - A*C << std::endl; + + _J[2*index_][0] = 0; + _J[2*index_][1] = 0; + _J[2*index_][2] = 0; + _J[2*index_][3] = 0; + _J[2*index_][4] = 0; + _J[2*index_][5] = 0; + + _J[2*index_+1][0] = 0; + _J[2*index_+1][1] = 0; + _J[2*index_+1][2] = 0; + _J[2*index_+1][3] = 0; + _J[2*index_+1][4] = 0; + _J[2*index_+1][5] = 0; + + _R[2*index_] = (x0_transform - x_cur); + _R[2*index_+1] = (y0_transform - y_cur); + index_++; + } + else + { + double invZ = 1.0/Z; + + _J[2*index_][0] = - invZ; + _J[2*index_][1] = 0; + _J[2*index_][2] = x_cur * invZ; + _J[2*index_][3] = x_cur * y_cur; + _J[2*index_][4] = -(1+x_cur*x_cur); + _J[2*index_][5] = y_cur; + + _J[2*index_+1][0] = 0; + _J[2*index_+1][1] = - invZ; + _J[2*index_+1][2] = y_cur * invZ; + _J[2*index_+1][3] = (1+y_cur*y_cur); + _J[2*index_+1][4] = - y_cur * x_cur; + _J[2*index_+1][5] = - x_cur; + + _R[2*index_] = (x0_transform - x_cur); + _R[2*index_+1] = (y0_transform - y_cur); + index_++; + } + } +} + +/*! + Test whether the feature with identifier id in paramters is in the list of tracked + features. + + \param _id : the id of the current feature to test + \return true if the id is in the list of tracked feature +*/ +bool +vpMbtDistanceKltCylinder::isTrackedFeature(const int _id) +{ + std::map<int, vpImagePoint>::iterator iter = initPoints.find(_id); + if(iter != initPoints.end()) + return true; + + return false; +} + +/*! + Modification of all the pixels that are in the roi to the value of _nb ( + default is 255). + + \param mask : the mask to update (0, not in the object, _nb otherwise). + \param nb : Optionnal value to set to the pixels included in the face. + \param shiftBorder : Optionnal shift for the border in pixel (sort of built-in erosion) to avoid to consider pixels near the limits of the face. +*/ +void +vpMbtDistanceKltCylinder::updateMask( +#if (VISP_HAVE_OPENCV_VERSION >= 0x020408) + cv::Mat &mask, +#else + IplImage* mask, +#endif + unsigned char nb, unsigned int shiftBorder) +{ +#if (VISP_HAVE_OPENCV_VERSION >= 0x020408) + int width = mask.cols; + int height = mask.rows; +#else + int width = mask->width; + int height = mask->height; +#endif + + for(unsigned int kc = 0 ; kc < listIndicesCylinderBBox.size() ; kc++) + { + if((*hiddenface)[listIndicesCylinderBBox[kc]]->isVisible() && (*hiddenface)[listIndicesCylinderBBox[kc]]->getNbPoint() > 2) + { + int i_min, i_max, j_min, j_max; + std::vector<vpImagePoint> roi; + (*hiddenface)[listIndicesCylinderBBox[kc]]->getRoiClipped(cam, roi); + vpPolygon3D::getMinMaxRoi(roi, i_min, i_max, j_min,j_max); + + /* check image boundaries */ + if(i_min > height){ //underflow + i_min = 0; + } + if(i_max > height){ + i_max = height; + } + if(j_min > width){ //underflow + j_min = 0; + } + if(j_max > width){ + j_max = width; + } + + double shiftBorder_d = (double) shiftBorder; + #if (VISP_HAVE_OPENCV_VERSION >= 0x020408) + for(int i=i_min; i< i_max; i++){ + double i_d = (double) i; + for(int j=j_min; j< j_max; j++){ + double j_d = (double) j; + if(shiftBorder != 0){ + if( vpPolygon::isInside(roi, i_d, j_d) + && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d+shiftBorder_d) + && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d+shiftBorder_d) + && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d-shiftBorder_d) + && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d-shiftBorder_d) ){ + mask.at<unsigned char>(i,j) = nb; + } + } + else{ + if(vpPolygon::isInside(roi, i, j)){ + mask.at<unsigned char>(i,j) = nb; + } + } + } + } + #else + unsigned char* ptrData = (unsigned char*)mask->imageData + i_min*mask->widthStep+j_min; + for(int i=i_min; i< i_max; i++){ + double i_d = (double) i; + for(int j=j_min; j< j_max; j++){ + double j_d = (double) j; + if(shiftBorder != 0){ + if( vpPolygon::isInside(roi, i_d, j_d) + && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d+shiftBorder_d) + && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d+shiftBorder_d) + && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d-shiftBorder_d) + && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d-shiftBorder_d) ){ + *(ptrData++) = nb; + } + else{ + ptrData++; + } + } + else{ + if(vpPolygon::isInside(roi, i, j)){ + *(ptrData++) = nb; + } + else{ + ptrData++; + } + } + } + ptrData += mask->widthStep - j_max + j_min; + } + #endif + } + } +} + +/*! + Display the primitives tracked for the cylinder. + + \param _I : The image where to display. +*/ +void +vpMbtDistanceKltCylinder::displayPrimitive(const vpImage<unsigned char>& _I) +{ + std::map<int, vpImagePoint>::const_iterator iter = curPoints.begin(); + for( ; iter != curPoints.end(); iter++){ + int id(iter->first); + vpImagePoint iP; + iP.set_i(static_cast<double>(iter->second.get_i())); + iP.set_j(static_cast<double>(iter->second.get_j())); + + vpDisplay::displayCross(_I, iP, 10, vpColor::red); + + iP.set_i( vpMath::round( iP.get_i() + 7 ) ); + iP.set_j( vpMath::round( iP.get_j() + 7 ) ); + char ide[10]; + sprintf(ide, "%ld", static_cast<long int>(id)); + vpDisplay::displayText(_I, iP, ide, vpColor::red); + } +} + +/*! + Display the primitives tracked for the cylinder. + + \param _I : The image where to display. +*/ +void +vpMbtDistanceKltCylinder::displayPrimitive(const vpImage<vpRGBa>& _I) +{ + std::map<int, vpImagePoint>::const_iterator iter = curPoints.begin(); + for( ; iter != curPoints.end(); iter++){ + int id(iter->first); + vpImagePoint iP; + iP.set_i(static_cast<double>(iter->second.get_i())); + iP.set_j(static_cast<double>(iter->second.get_j())); + + vpDisplay::displayCross(_I, iP, 10, vpColor::red); + + iP.set_i( vpMath::round( iP.get_i() + 7 ) ); + iP.set_j( vpMath::round( iP.get_j() + 7 ) ); + char ide[10]; + sprintf(ide, "%ld", static_cast<long int>(id)); + vpDisplay::displayText(_I, iP, ide, vpColor::red); + } +} + +void +vpMbtDistanceKltCylinder::display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &camera, + const vpColor col, const unsigned int thickness, const bool /*displayFullModel*/) +{ + //if(isvisible || displayFullModel) + { + // Perspective projection + circle1.changeFrame(cMo); + circle2.changeFrame(cMo); + cylinder.changeFrame(cMo); + + try{ + circle1.projection(); + } + catch(...){std::cout<<"Problem projection circle 1";} + try{ + circle2.projection(); + } + catch(...){std::cout<<"Problem projection circle 2";} + + cylinder.projection(); + + double rho1,theta1; + double rho2,theta2; + + // Meters to pixels conversion + vpMeterPixelConversion::convertLine(camera,cylinder.getRho1(),cylinder.getTheta1(),rho1,theta1); + vpMeterPixelConversion::convertLine(camera,cylinder.getRho2(),cylinder.getTheta2(),rho2,theta2); + + // Determine intersections between circles and limbos + double i11,i12,i21,i22,j11,j12,j21,j22; + + vpCircle::computeIntersectionPoint(circle1, cam, rho1, theta1, i11, j11); + vpCircle::computeIntersectionPoint(circle2, cam, rho1, theta1, i12, j12); + + vpCircle::computeIntersectionPoint(circle1, cam, rho2, theta2, i21, j21); + vpCircle::computeIntersectionPoint(circle2, cam, rho2, theta2, i22, j22); + + // Create the image points + vpImagePoint ip11,ip12,ip21,ip22; + ip11.set_ij(i11,j11); + ip12.set_ij(i12,j12); + ip21.set_ij(i21,j21); + ip22.set_ij(i22,j22); + + // Display + vpDisplay::displayLine(I,ip11,ip12,col, thickness); + vpDisplay::displayLine(I,ip21,ip22,col, thickness); + } +} + +void +vpMbtDistanceKltCylinder::display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &camera, + const vpColor col, const unsigned int thickness, const bool /*displayFullModel*/) +{ + //if(isvisible || displayFullModel) + { + // Perspective projection + circle1.changeFrame(cMo); + circle2.changeFrame(cMo); + cylinder.changeFrame(cMo); + + try{ + circle1.projection(); + } + catch(...){std::cout<<"Problem projection circle 1";} + try{ + circle2.projection(); + } + catch(...){std::cout<<"Problem projection circle 2";} + + cylinder.projection(); + + double rho1,theta1; + double rho2,theta2; + + // Meters to pixels conversion + vpMeterPixelConversion::convertLine(camera,cylinder.getRho1(),cylinder.getTheta1(),rho1,theta1); + vpMeterPixelConversion::convertLine(camera,cylinder.getRho2(),cylinder.getTheta2(),rho2,theta2); + + // Determine intersections between circles and limbos + double i11,i12,i21,i22,j11,j12,j21,j22; + + vpCircle::computeIntersectionPoint(circle1, camera, rho1, theta1, i11, j11); + vpCircle::computeIntersectionPoint(circle2, camera, rho1, theta1, i12, j12); + + vpCircle::computeIntersectionPoint(circle1, camera, rho2, theta2, i21, j21); + vpCircle::computeIntersectionPoint(circle2, camera, rho2, theta2, i22, j22); + + // Create the image points + vpImagePoint ip11,ip12,ip21,ip22; + ip11.set_ij(i11,j11); + ip12.set_ij(i12,j12); + ip21.set_ij(i21,j21); + ip22.set_ij(i22,j22); + + // Display + vpDisplay::displayLine(I,ip11,ip12,col, thickness); + vpDisplay::displayLine(I,ip21,ip22,col, thickness); + } +} + + +// ###################### +// Private Functions +// ###################### + +double +vpMbtDistanceKltCylinder::computeZ(const double &x, const double &y) +{ + double A = x*x + y*y + 1 - ((cylinder.getA()*x+cylinder.getB()*y+cylinder.getC()) * (cylinder.getA()*x+cylinder.getB()*y+cylinder.getC())); + double B = (x * cylinder.getX() + y * cylinder.getY() + cylinder.getZ()); + double C = cylinder.getX() * cylinder.getX() + cylinder.getY() * cylinder.getY() + cylinder.getZ() * cylinder.getZ() - cylinder.getR() * cylinder.getR(); + + return (B - std::sqrt(B*B - A*C))/A; +} +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_mbt.a(vpMbtDistanceKltCylinder.cpp.o) has no symbols +void dummy_vpMbtDistanceKltCylinder() {}; +#endif diff --git a/src/tracking/mbt/klt/vpMbtDistanceKltPoints.cpp b/modules/tracker/mbt/src/klt/vpMbtDistanceKltPoints.cpp similarity index 70% rename from src/tracking/mbt/klt/vpMbtDistanceKltPoints.cpp rename to modules/tracker/mbt/src/klt/vpMbtDistanceKltPoints.cpp index 8d8a8cfc622197e49904a8d76ecf3e64fe2e0240..52f39657235ea85286efcf3063d2f34f232f44c6 100644 --- a/src/tracking/mbt/klt/vpMbtDistanceKltPoints.cpp +++ b/modules/tracker/mbt/src/klt/vpMbtDistanceKltPoints.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpMbtDistanceKltPoints.cpp 4661 2014-02-10 19:34:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,9 +36,10 @@ * *****************************************************************************/ -#include <visp/vpMbtDistanceKltPoints.h> +#include <visp3/mbt/vpMbtDistanceKltPoints.h> +#include <visp3/core/vpPolygon.h> -#if (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) +#if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) /*! Basic constructor. @@ -50,7 +48,7 @@ vpMbtDistanceKltPoints::vpMbtDistanceKltPoints() : H(), N(), N_cur(), invd0(1.), cRc0_0n(), initPoints(), curPoints(), curPointsInd(), nbPointsCur(0), nbPointsInit(0), minNbPoint(4), enoughPoints(false), dt(1.), d0(1.), - cam(), polygon(NULL) + cam(), isTrackedKltPoints(true), polygon(NULL), hiddenface(NULL), useScanLine(false) { initPoints = std::map<int, vpImagePoint>(); curPoints = std::map<int, vpImagePoint>(); @@ -88,7 +86,21 @@ vpMbtDistanceKltPoints::init(const vpKltOpencv& _tracker) float x_tmp, y_tmp; _tracker.getFeature((int)i, id, x_tmp, y_tmp); - if(isInside(roi, y_tmp, x_tmp)){ + bool add = false; + + if(useScanLine) + { + if((unsigned int)y_tmp < hiddenface->getMbScanLineRenderer().getPrimitiveIDs().getHeight() && + (unsigned int)x_tmp < hiddenface->getMbScanLineRenderer().getPrimitiveIDs().getWidth() && + hiddenface->getMbScanLineRenderer().getPrimitiveIDs()[(unsigned int)y_tmp][(unsigned int)x_tmp] == polygon->getIndex()) + add = true; + } + else if(vpPolygon::isInside(roi, y_tmp, x_tmp)) + { + add = true; + } + + if(add){ initPoints[id] = vpImagePoint(y_tmp, x_tmp); curPoints[id] = vpImagePoint(y_tmp, x_tmp); curPointsInd[id] = (int)i; @@ -249,7 +261,7 @@ vpMbtDistanceKltPoints::computeHomography(const vpHomogeneousMatrix& _cTc0, vpHo _cTc0.extract(cRc0); _cTc0.extract(ctransc0); - vpMatrix cHc0(_cHc0); + vpMatrix cHc0 = _cHc0.convert(); // vpGEMM(cRc0, 1.0, invd0, cRc0, -1.0, _cHc0, VP_GEMM_A_T); vpGEMM(ctransc0, N, -invd0, cRc0, 1.0, cHc0, VP_GEMM_B_T); @@ -333,7 +345,7 @@ vpMbtDistanceKltPoints::updateMask( int i_min, i_max, j_min, j_max; std::vector<vpImagePoint> roi; polygon->getRoiClipped(cam, roi); - vpMbtPolygon::getMinMaxRoi(roi, i_min, i_max, j_min,j_max); + vpPolygon3D::getMinMaxRoi(roi, i_min, i_max, j_min,j_max); /* check image boundaries */ if(i_min > height){ //underflow @@ -356,16 +368,16 @@ vpMbtDistanceKltPoints::updateMask( for(int j=j_min; j< j_max; j++){ double j_d = (double) j; if(shiftBorder != 0){ - if( vpMbtDistanceKltPoints::isInside(roi, i_d, j_d) - && vpMbtDistanceKltPoints::isInside(roi, i_d+shiftBorder_d, j_d+shiftBorder_d) - && vpMbtDistanceKltPoints::isInside(roi, i_d-shiftBorder_d, j_d+shiftBorder_d) - && vpMbtDistanceKltPoints::isInside(roi, i_d+shiftBorder_d, j_d-shiftBorder_d) - && vpMbtDistanceKltPoints::isInside(roi, i_d-shiftBorder_d, j_d-shiftBorder_d) ){ + if( vpPolygon::isInside(roi, i_d, j_d) + && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d+shiftBorder_d) + && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d+shiftBorder_d) + && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d-shiftBorder_d) + && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d-shiftBorder_d) ){ mask.at<unsigned char>(i,j) = nb; } } else{ - if(vpMbtDistanceKltPoints::isInside(roi, i, j)){ + if(vpPolygon::isInside(roi, i, j)){ mask.at<unsigned char>(i,j) = nb; } } @@ -378,11 +390,11 @@ vpMbtDistanceKltPoints::updateMask( for(int j=j_min; j< j_max; j++){ double j_d = (double) j; if(shiftBorder != 0){ - if( vpMbtDistanceKltPoints::isInside(roi, i_d, j_d) - && vpMbtDistanceKltPoints::isInside(roi, i_d+shiftBorder_d, j_d+shiftBorder_d) - && vpMbtDistanceKltPoints::isInside(roi, i_d-shiftBorder_d, j_d+shiftBorder_d) - && vpMbtDistanceKltPoints::isInside(roi, i_d+shiftBorder_d, j_d-shiftBorder_d) - && vpMbtDistanceKltPoints::isInside(roi, i_d-shiftBorder_d, j_d-shiftBorder_d) ){ + if( vpPolygon::isInside(roi, i_d, j_d) + && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d+shiftBorder_d) + && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d+shiftBorder_d) + && vpPolygon::isInside(roi, i_d+shiftBorder_d, j_d-shiftBorder_d) + && vpPolygon::isInside(roi, i_d-shiftBorder_d, j_d-shiftBorder_d) ){ *(ptrData++) = nb; } else{ @@ -390,7 +402,7 @@ vpMbtDistanceKltPoints::updateMask( } } else{ - if(vpMbtDistanceKltPoints::isInside(roi, i, j)){ + if(vpPolygon::isInside(roi, i, j)){ *(ptrData++) = nb; } else{ @@ -496,60 +508,84 @@ vpMbtDistanceKltPoints::displayPrimitive(const vpImage<vpRGBa>& _I) } } -//################################### -// Static functions -//################################### - -bool -vpMbtDistanceKltPoints::intersect(const vpImagePoint& p1, const vpImagePoint& p2, const double i_test, const double j_test, const double i, const double j) +void +vpMbtDistanceKltPoints::display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &/*cMo*/, const vpCameraParameters &camera, + const vpColor col, const unsigned int thickness, const bool displayFullModel) { - double dx = p2.get_j() - p1.get_j(); - double dy = p2.get_i() - p1.get_i(); - double ex = j - j_test; - double ey = i - i_test; - - double den = dx * ey - dy * ex; - double t = 0, u = 0; - //if(den != 0){ - if(std::fabs(den) > std::fabs(den)*std::numeric_limits<double>::epsilon()){ - t = -( ey * ( p1.get_j() - j_test ) + ex * ( -p1.get_i() + i_test ) ) / den; - u = -( dx * ( -p1.get_i() + i_test ) + dy * ( p1.get_j() - j_test ) ) / den; - } - else{ - throw vpException(vpException::divideByZeroError, "denominator null"); - } - return ( t >= std::numeric_limits<double>::epsilon() && t < 1.0 && u >= std::numeric_limits<double>::epsilon() && u < 1.0); + if(polygon->isVisible() || displayFullModel) + { + std::vector<std::pair<vpPoint,unsigned int> > roi; + polygon->getPolygonClipped(roi); + + for (unsigned int j = 0; j < roi.size(); j += 1){ + if(((roi[(j+1)%roi.size()].second & roi[j].second & vpPolygon3D::NEAR_CLIPPING) == 0) && + ((roi[(j+1)%roi.size()].second & roi[j].second & vpPolygon3D::FAR_CLIPPING) == 0) && + ((roi[(j+1)%roi.size()].second & roi[j].second & vpPolygon3D::DOWN_CLIPPING) == 0) && + ((roi[(j+1)%roi.size()].second & roi[j].second & vpPolygon3D::UP_CLIPPING) == 0) && + ((roi[(j+1)%roi.size()].second & roi[j].second & vpPolygon3D::LEFT_CLIPPING) == 0) && + ((roi[(j+1)%roi.size()].second & roi[j].second & vpPolygon3D::RIGHT_CLIPPING) == 0)){ + + vpImagePoint ip1, ip2; + std::vector<std::pair<vpPoint, vpPoint> > linesLst; + + if(useScanLine && !displayFullModel) + hiddenface->computeScanLineQuery(roi[j].first,roi[(j+1)%roi.size()].first,linesLst, true); + else + linesLst.push_back(std::make_pair(roi[j].first,roi[(j+1)%roi.size()].first)); + + for(unsigned int i = 0 ; i < linesLst.size() ; i++){ + linesLst[i].first.project(); + linesLst[i].second.project(); + vpMeterPixelConversion::convertPoint(camera,linesLst[i].first.get_x(),linesLst[i].first.get_y(),ip1); + vpMeterPixelConversion::convertPoint(camera,linesLst[i].second.get_x(),linesLst[i].second.get_y(),ip2); + + vpDisplay::displayLine(I,ip1,ip2,col, thickness); + } + } + } + } } -bool -vpMbtDistanceKltPoints::isInside(const std::vector<vpImagePoint>& roi, const double i, const double j) + +void +vpMbtDistanceKltPoints::display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &/*cMo*/, const vpCameraParameters &camera, + const vpColor col, const unsigned int thickness, const bool displayFullModel) { - double i_test = 100000.; - double j_test = 100000.; - unsigned int nbInter = 0; - bool computeAgain = true; - - if(computeAgain){ - computeAgain = false; - for(unsigned int k=0; k< roi.size(); k++){ - try{ - if(vpMbtDistanceKltPoints::intersect(roi[k], roi[(k+1)%roi.size()], i, j, i_test, j_test)){ - nbInter++; + if(polygon->isVisible() || displayFullModel) + { + std::vector<std::pair<vpPoint,unsigned int> > roi; + polygon->getPolygonClipped(roi); + + for (unsigned int j = 0; j < roi.size(); j += 1){ + if(((roi[(j+1)%roi.size()].second & roi[j].second & vpPolygon3D::NEAR_CLIPPING) == 0) && + ((roi[(j+1)%roi.size()].second & roi[j].second & vpPolygon3D::FAR_CLIPPING) == 0) && + ((roi[(j+1)%roi.size()].second & roi[j].second & vpPolygon3D::DOWN_CLIPPING) == 0) && + ((roi[(j+1)%roi.size()].second & roi[j].second & vpPolygon3D::UP_CLIPPING) == 0) && + ((roi[(j+1)%roi.size()].second & roi[j].second & vpPolygon3D::LEFT_CLIPPING) == 0) && + ((roi[(j+1)%roi.size()].second & roi[j].second & vpPolygon3D::RIGHT_CLIPPING) == 0)){ + + vpImagePoint ip1, ip2; + std::vector<std::pair<vpPoint, vpPoint> > linesLst; + + if(useScanLine && !displayFullModel) + hiddenface->computeScanLineQuery(roi[j].first,roi[(j+1)%roi.size()].first,linesLst, true); + else + linesLst.push_back(std::make_pair(roi[j].first,roi[(j+1)%roi.size()].first)); + + for(unsigned int i = 0 ; i < linesLst.size() ; i++){ + linesLst[i].first.project(); + linesLst[i].second.project(); + vpMeterPixelConversion::convertPoint(camera,linesLst[i].first.get_x(),linesLst[i].first.get_y(),ip1); + vpMeterPixelConversion::convertPoint(camera,linesLst[i].second.get_x(),linesLst[i].second.get_y(),ip2); + + vpDisplay::displayLine(I,ip1,ip2,col, thickness); } } - catch(...){ - computeAgain = true; - break; - } - } - - if(computeAgain){ - i_test += 100; - j_test -= 100; - nbInter = 0; } } - return ((nbInter%2) == 1); } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_mbt.a(vpMbtDistanceKltPoints.cpp.o) has no symbols +void dummy_vpMbKltTracker() {}; #endif diff --git a/src/tracking/mbt/klt/vpMbtKltXmlParser.cpp b/modules/tracker/mbt/src/klt/vpMbtKltXmlParser.cpp similarity index 90% rename from src/tracking/mbt/klt/vpMbtKltXmlParser.cpp rename to modules/tracker/mbt/src/klt/vpMbtKltXmlParser.cpp index 239389a74556daa1e4fbbcf809269bd2a6411495..2d31f09b8e4bd023828aceecf38b703735a6c522 100644 --- a/src/tracking/mbt/klt/vpMbtKltXmlParser.cpp +++ b/modules/tracker/mbt/src/klt/vpMbtKltXmlParser.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbtKltXmlParser.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Load XML parameters of the Model based tracker (using point features). * @@ -38,7 +34,7 @@ * Aurelien Yol * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 @@ -47,7 +43,7 @@ #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */ -#include <visp/vpMbtKltXmlParser.h> +#include <visp3/mbt/vpMbtKltXmlParser.h> /*! @@ -124,6 +120,7 @@ vpMbtKltXmlParser::readMainClass(xmlDocPtr doc, xmlNodePtr node) bool camera_node = false; bool face_node = false; bool klt_node = false; + bool lod_node = false; for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) { if(dataNode->type == XML_ELEMENT_NODE){ @@ -142,6 +139,10 @@ vpMbtKltXmlParser::readMainClass(xmlDocPtr doc, xmlNodePtr node) this->read_klt(doc, dataNode); klt_node = true; }break; + case lod:{ + this->read_lod(doc, dataNode); + lod_node = true; + }break; default:{ // vpTRACE("unknown tag in read_sample : %d, %s", iter_data->second, (iter_data->first).c_str()); }break; @@ -172,6 +173,12 @@ vpMbtKltXmlParser::readMainClass(xmlDocPtr doc, xmlNodePtr node) std::cout << "klt : Block Size : "<< blockSize <<" (default)" <<std::endl; std::cout << "klt : Pyramid Levels : "<< pyramidLevels <<" (default)" <<std::endl; } + + if(!lod_node) { + std::cout << "lod : use lod : " << useLod << " (default)" << std::endl; + std::cout << "lod : min line length threshold : " << minLineLengthThreshold << " (default)" << std::endl; + std::cout << "lod : min polygon area threshold : " << minPolygonAreaThreshold << " (default)" << std::endl; + } } /*! @@ -280,5 +287,8 @@ vpMbtKltXmlParser::read_klt(xmlDocPtr doc, xmlNodePtr node) std::cout << "klt : Pyramid Levels : "<< pyramidLevels <<std::endl; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_mbt.a(vpMbtKltXmlParser.cpp.o) has no symbols +void dummy_vpMbtKltXmlParser() {}; #endif diff --git a/modules/tracker/mbt/src/vpMbScanLine.cpp b/modules/tracker/mbt/src/vpMbScanLine.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bcf771500c0f5154263a04c70df884a8416bb1de --- /dev/null +++ b/modules/tracker/mbt/src/vpMbScanLine.cpp @@ -0,0 +1,836 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Make the complete tracking of an object by using its CAD model + * + * Authors: + * Aurelien Yol + * + *****************************************************************************/ + +#include <visp3/core/vpConfig.h> + +#if defined _MSC_VER && _MSC_VER >= 1200 +# define NOMINMAX +#endif + +#include <cmath> +#include <algorithm> +#include <cstddef> +#include <iostream> +#include <utility> + +#include <visp3/mbt/vpMbScanLine.h> +#include <visp3/core/vpMeterPixelConversion.h> + +#if defined(DEBUG_DISP) +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayX.h> +#endif + + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +vpMbScanLine::vpMbScanLine() + : w(0), h(0), K(), maskBorder(0), mask(), primitive_ids(), + visibility_samples(), depthTreshold(1e-06) +#if defined(DEBUG_DISP) + ,dispMaskDebug(NULL), dispLineDebug(NULL), linedebugImg() +#endif +{ +#if defined(VISP_HAVE_X11) && defined(DEBUG_DISP) + dispLineDebug = new vpDisplayX(); + dispMaskDebug = new vpDisplayX(); +#elif defined(VISP_HAVE_GDI) && defined(DEBUG_DISP) + dispLineDebug = new vpDisplayGDI(); + dispMaskDebug = new vpDisplayGDI(); +#endif +} + +vpMbScanLine::~vpMbScanLine() +{ +#if (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(DEBUG_DISP) + if (dispLineDebug != NULL) delete dispLineDebug; + if (dispMaskDebug != NULL) delete dispMaskDebug; +#endif +} +/*! + Compute the intersections between Y-axis scanlines and a given line (two points polygon). + + \param a : First point of the line. + \param b : Second point of the line. + \param edge : Pair with the two points of the line. + \param ID : Id of the given line (has to be know when using queries). + \param scanlines : Resulting intersections. +*/ +void vpMbScanLine::drawLineY(const vpColVector &a, + const vpColVector &b, + const vpMbScanLineEdge &edge, + const int ID, + std::vector<std::vector<vpMbScanLineSegment> > &scanlines) +{ + double x0 = a[0] / a[2]; + double y0 = a[1] / a[2]; + double z0 = a[2]; + double x1 = b[0] / b[2]; + double y1 = b[1] / b[2]; + double z1 = b[2]; + if (y0 > y1) + { + std::swap(x0, x1); + std::swap(y0, y1); + std::swap(z0, z1); + } + + //if (y0 >= h - 1 || y1 < 0 || y1 == y0) + if (y0 >= h - 1 || y1 < 0 || std::fabs(y1 - y0) <= std::numeric_limits<double>::epsilon()) + return; + + const unsigned int _y0 = std::max<unsigned int>(0, (unsigned int)(std::ceil(y0))); + const double _y1 = std::min<double>(h, y1); + + const bool b_sample_Y = (std::fabs(y0 - y1) > std::fabs(x0 - x1)); + + for(unsigned int y = _y0 ; y < _y1 ; ++y) + { + const double x = x0 + (x1 - x0) * (y - y0) / (y1 - y0); + const double alpha = getAlpha(y, y0 * z0, z0, y1 * z1, z1); + vpMbScanLineSegment s; + s.p = x; + s.type = POINT; + s.Z2 = s.Z1 = mix(z0, z1, alpha); + s.P2 = s.P1 = s.p * s.Z1; + s.ID = ID; + s.edge = edge; + s.b_sample_Y = b_sample_Y; + scanlines[y].push_back(s); + } +} + +/*! + Compute the intersections between X-axis scanlines and a given line (two points polygon). + + \param a : First point of the line. + \param b : Second point of the line. + \param edge : Pair with the two points of the line. + \param ID : Id of the given line (has to be know when using queries). + \param scanlines : Resulting intersections. +*/ +void vpMbScanLine::drawLineX(const vpColVector &a, + const vpColVector &b, + const vpMbScanLineEdge &edge, + const int ID, + std::vector<std::vector<vpMbScanLineSegment> > &scanlines) +{ + double x0 = a[0] / a[2]; + double y0 = a[1] / a[2]; + double z0 = a[2]; + double x1 = b[0] / b[2]; + double y1 = b[1] / b[2]; + double z1 = b[2]; + if (x0 > x1) + { + std::swap(x0, x1); + std::swap(y0, y1); + std::swap(z0, z1); + } + + //if (x0 >= w - 1 || x1 < 0 || x1 == x0) + if (x0 >= w - 1 || x1 < 0 || std::fabs(x1 - x0) <= std::numeric_limits<double>::epsilon()) + return; + + const unsigned int _x0 = std::max<unsigned int>(0, (unsigned int)(std::ceil(x0))); + const double _x1 = std::min<double>(w, x1); + + const bool b_sample_Y = (std::fabs(y0 - y1) > std::fabs(x0 - x1)); + + for(unsigned int x = _x0 ; x < _x1 ; ++x) + { + const double y = y0 + (y1 - y0) * (x - x0) / (x1 - x0); + const double alpha = getAlpha(x, x0 * z0, z0, x1 * z1, z1); + vpMbScanLineSegment s; + s.p = y; + s.type = POINT; + s.Z2 = s.Z1 = mix(z0, z1, alpha); + s.P2 = s.P1 = s.p * s.Z1; + s.ID = ID; + s.edge = edge; + s.b_sample_Y = b_sample_Y; + scanlines[x].push_back(s); + } +} + + +/*! + Compute the Y-axis scanlines intersections of a polygon. + + \param polygon : Polygon composed by an array of lines. + \param ID : ID of the polygon (has to be know when using queries). + \param scanlines : Resulting intersections. +*/ +void +vpMbScanLine::drawPolygonY(const std::vector<std::pair<vpPoint, unsigned int> > &polygon, + const int ID, + std::vector<std::vector<vpMbScanLineSegment> > &scanlines) +{ + if (polygon.size() < 2) + return; + + if (polygon.size() == 2) + { + vpColVector p1, p2; + createVectorFromPoint(polygon.front().first, p1, K); + createVectorFromPoint(polygon.back().first, p2, K); + + drawLineY(p1, + p2, + makeMbScanLineEdge(polygon.front().first, polygon.back().first), + ID, + scanlines); + return; + } + + std::vector<std::vector<vpMbScanLineSegment> > local_scanlines; + local_scanlines.resize(h); + + for(size_t i = 0 ; i < polygon.size() ; ++i) + { + vpColVector p1, p2; + createVectorFromPoint(polygon[i].first, p1, K); + createVectorFromPoint(polygon[(i + 1) % polygon.size()].first, p2, K); + + drawLineY(p1, p2, makeMbScanLineEdge(polygon[i].first, polygon[(i + 1) % polygon.size()].first), ID, local_scanlines); + } + + createScanLinesFromLocals(scanlines,local_scanlines,h); +} + +/*! + Compute the X-axis scanlines intersections of a polygon. + + \param polygon : Polygon composed by an array of lines. + \param ID : ID of the polygon (has to be know when using queries). + \param scanlines : Resulting intersections. +*/ +void +vpMbScanLine::drawPolygonX(const std::vector<std::pair<vpPoint, unsigned int> > &polygon, + const int ID, + std::vector<std::vector<vpMbScanLineSegment> > &scanlines) +{ + if (polygon.size() < 2) + return; + + if (polygon.size() == 2) + { + vpColVector p1, p2; + createVectorFromPoint(polygon.front().first, p1, K); + createVectorFromPoint(polygon.back().first, p2, K); + + drawLineX(p1, + p2, + makeMbScanLineEdge(polygon.front().first, polygon.back().first), + ID, + scanlines); + return; + } + + std::vector<std::vector<vpMbScanLineSegment> > local_scanlines; + local_scanlines.resize(w); + + for(size_t i = 0 ; i < polygon.size() ; ++i) + { + vpColVector p1, p2; + createVectorFromPoint(polygon[i].first, p1, K); + createVectorFromPoint(polygon[(i + 1) % polygon.size()].first, p2, K); + + drawLineX(p1, p2, makeMbScanLineEdge(polygon[i].first, polygon[(i + 1) % polygon.size()].first), ID, local_scanlines); + } + + createScanLinesFromLocals(scanlines,local_scanlines,w); +} + +/*! + Organise local scanlines in a global scanline vector. + It also marks the computed intersections as starting or ending points. + This function will only be called by the drawPolygons functions. + + \param scanlines : Global scanline vector. + \param localScanlines : Local scanline vector (X or Y-axis). + \param size : Corresponding size (typically the width or the height). +*/ +void +vpMbScanLine::createScanLinesFromLocals(std::vector<std::vector<vpMbScanLineSegment> > &scanlines, + std::vector<std::vector<vpMbScanLineSegment> > &localScanlines, + const unsigned int &size) +{ + for(unsigned int j = 0 ; j < size ; ++j) + { + std::vector<vpMbScanLineSegment> &scanline = localScanlines[j]; + sort(scanline.begin(), scanline.end(), vpMbScanLineSegmentComparator()); // Not sure its necessary + + bool b_start = true; + for(size_t i = 0 ; i < scanline.size() ; ++i) + { + vpMbScanLineSegment s = scanline[i]; + if (b_start) + { + s.type = START; + s.P1 = s.p * s.Z1; + b_start = false; + } + else + { + vpMbScanLineSegment &prev = scanlines[j].back(); + s.type = END; + s.P1 = prev.P1; + s.Z1 = prev.Z1; + s.P2 = s.p * s.Z2; + prev.P2 = s.P2; + prev.Z2 = s.Z2; + b_start = true; + } + scanlines[j].push_back(s); + } + } +} + +/*! + Render a scene of polygons and compute scanlines intersections in order to use queries. + + \param polygons : List of polygons composed by arrays of lines. + \param listPolyIndices : List of polygons IDs (has to be know when using queries). + \param cam : Camera parameters. + \param width : Width of the image (render window). + \param height : Height of the image (render window). +*/ +void +vpMbScanLine::drawScene(const std::vector<std::vector<std::pair<vpPoint, unsigned int> > * > &polygons, + std::vector<int> listPolyIndices, + const vpCameraParameters &cam, unsigned int width, unsigned int height) +{ + this->w = width; + this->h = height; + this->K = cam; + + visibility_samples.clear(); + + std::vector<std::vector<vpMbScanLineSegment> > scanlinesY; + scanlinesY.resize(h); + std::vector<std::vector<vpMbScanLineSegment> > scanlinesX; + scanlinesX.resize(w); + + mask.resize(h,w,0); + + vpImage<unsigned char> maskY(h,w,0); + vpImage<unsigned char> maskX(h,w,0); + + primitive_ids.resize(h, w, -1); + + for(unsigned int ID = 0 ; ID < polygons.size() ; ++ID) + { + drawPolygonY(*(polygons[ID]), listPolyIndices[ID], scanlinesY); + drawPolygonX(*(polygons[ID]), listPolyIndices[ID], scanlinesX); + } + + // Y + int last_ID = -1; + vpMbScanLineSegment last_visible; + for(unsigned int y = 0 ; y < scanlinesY.size() ; ++y) + { + std::vector<vpMbScanLineSegment> &scanline = scanlinesY[y]; + sort(scanline.begin(), scanline.end(), vpMbScanLineSegmentComparator()); + + std::vector<std::pair<double, vpMbScanLineSegment> > stack; + for(size_t i = 0 ; i < scanline.size() ; ++i) + { + const vpMbScanLineSegment &s = scanline[i]; + + switch(s.type) + { + case START: + stack.push_back(std::make_pair(s.Z1, s)); + break; + case END: + for(size_t j = 0 ; j < stack.size() ; ++j) + if (stack[j].second.ID == s.ID) + { + stack[j] = stack.back(); + stack.pop_back(); + break; + } + break; + case POINT: + break; + } + + for(size_t j = 0 ; j < stack.size() ; ++j) + { + const vpMbScanLineSegment &s0 = stack[j].second; + stack[j].first = mix(s0.Z1, s0.Z2, getAlpha(s.type == POINT ? s.p : (s.p + 0.5), s0.P1, s0.Z1, s0.P2, s0.Z2)); + } + sort(stack.begin(), stack.end(), vpMbScanLineSegmentComparator()); + + int new_ID = stack.empty() ? -1 : stack.front().second.ID; + + if (new_ID != last_ID || s.type == POINT) + { + if (s.b_sample_Y) + switch(s.type) + { + case POINT: + if (new_ID == -1 || s.Z1 - depthTreshold <= stack.front().first) + visibility_samples[s.edge].insert((int)y); + break; + case START: + if (new_ID == s.ID) + visibility_samples[s.edge].insert((int)y); + break; + case END: + if (last_ID == s.ID) + visibility_samples[s.edge].insert((int)y); + break; + } + + // This part will only be used for MbKltTracking + if (last_ID != -1) + { + const unsigned int x0 = std::max<unsigned int>(0, (unsigned int)(std::ceil(last_visible.p))); + const double x1 = std::min<double>(w, s.p); + for(unsigned int x = x0 + maskBorder ; x < x1 - maskBorder; ++x) + { + primitive_ids[(unsigned int)y][(unsigned int)x] = last_visible.ID; + + if(maskBorder != 0) + maskY[(unsigned int)y][(unsigned int)x] = 255; + else + mask[(unsigned int)y][(unsigned int)x] = 255; + } + } + + last_ID = new_ID; + if (!stack.empty()) + { + last_visible = stack.front().second; + last_visible.p = s.p; + } + } + } + } + + // X + last_ID = -1; + for(unsigned int x = 0 ; x < scanlinesX.size() ; ++x) + { + std::vector<vpMbScanLineSegment> &scanline = scanlinesX[x]; + sort(scanline.begin(), scanline.end(), vpMbScanLineSegmentComparator()); + + std::vector<std::pair<double, vpMbScanLineSegment> > stack; + for(size_t i = 0 ; i < scanline.size() ; ++i) + { + const vpMbScanLineSegment &s = scanline[i]; + + switch(s.type) + { + case START: + stack.push_back(std::make_pair(s.Z1, s)); + break; + case END: + for(size_t j = 0 ; j < stack.size() ; ++j) + if (stack[j].second.ID == s.ID) + { + stack[j] = stack.back(); + stack.pop_back(); + break; + } + break; + case POINT: + break; + } + + for(size_t j = 0 ; j < stack.size() ; ++j) + { + const vpMbScanLineSegment &s0 = stack[j].second; + stack[j].first = mix(s0.Z1, s0.Z2, getAlpha(s.type == POINT ? s.p : (s.p + 0.5), s0.P1, s0.Z1, s0.P2, s0.Z2)); + } + sort(stack.begin(), stack.end(), vpMbScanLineSegmentComparator()); + + int new_ID = stack.empty() ? -1 : stack.front().second.ID; + + if (new_ID != last_ID || s.type == POINT) + { + if (!s.b_sample_Y) + switch(s.type) + { + case POINT: + if (new_ID == -1 || s.Z1 - depthTreshold <= stack.front().first) + visibility_samples[s.edge].insert((int)x); + break; + case START: + if (new_ID == s.ID) + visibility_samples[s.edge].insert((int)x); + break; + case END: + if (last_ID == s.ID) + visibility_samples[s.edge].insert((int)x); + break; + } + + // This part will only be used for MbKltTracking + if (maskBorder != 0 && last_ID != -1) + { + const unsigned int y0 = std::max<unsigned int>(0, (unsigned int)(std::ceil(last_visible.p))); + const double y1 = std::min<double>(h, s.p); + for(unsigned int y = y0 + maskBorder ; y < y1 - maskBorder; ++y) + { + //primitive_ids[(unsigned int)y][(unsigned int)x] = last_visible.ID; + maskX[(unsigned int)y][(unsigned int)x] = 255; + } + } + + last_ID = new_ID; + if (!stack.empty()) + { + last_visible = stack.front().second; + last_visible.p = s.p; + } + } + } + } + + if(maskBorder != 0) + for(unsigned int i = 0 ; i < h ; i++) + for(unsigned int j = 0 ; j < w ; j++) + if(maskX[i][j] == 255 && maskY[i][j] == 255) + mask[i][j] = 255; + +#if (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(DEBUG_DISP) + if(!dispMaskDebug->isInitialised()){ + dispMaskDebug->init(mask, 800, 600); + } + + vpDisplay::display(mask); + + for(unsigned int ID = 0 ; ID < polygons.size() ; ++ID) + { + for(unsigned int i = 0 ; i < polygons[ID]->size() ; i++){ + vpPoint p1 = (*(polygons[ID]))[i].first; + vpPoint p2 = (*(polygons[ID]))[(i+1)%polygons[ID]->size()].first; + double i1=0,j1=0,i2=0,j2=0; + p1.project(); + p2.project(); + vpMeterPixelConversion::convertPoint(K,p1.get_x(), p1.get_y(),j1,i1); + vpMeterPixelConversion::convertPoint(K,p2.get_x(), p2.get_y(),j2,i2); + + vpDisplay::displayLine(mask,i1,j1,i2,j2,vpColor::red,3); + } + } + + vpDisplay::flush(mask); + + + if(!dispLineDebug->isInitialised()){ + linedebugImg.resize(h,w,0); + dispLineDebug->init(linedebugImg, 800, 100); + } + vpDisplay::display(linedebugImg); +#endif + +} + +/*! + Test the visibility of a line. As a result, a subsampled line of the given one with all its visible parts. + + \param a : First point of the line. + \param b : Second point of the line. + \param lines : List of lines corresponding of the visible parts of the given line. + \param displayResults : True if the results have to be displayed. False otherwise. +*/ +void +vpMbScanLine::queryLineVisibility(const vpPoint &a, const vpPoint &b, + std::vector<std::pair<vpPoint, vpPoint> > &lines, + const bool &displayResults) +{ + vpColVector _a, _b; + createVectorFromPoint(a, _a, K); + createVectorFromPoint(b, _b, K); + + double x0 = _a[0] / _a[2]; + double y0 = _a[1] / _a[2]; + double z0 = _a[2]; + double x1 = _b[0] / _b[2]; + double y1 = _b[1] / _b[2]; + double z1 = _b[2]; + + vpMbScanLineEdge edge = makeMbScanLineEdge(a, b); + lines.clear(); + + if(displayResults){ +#if (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(DEBUG_DISP) + double i1(0.0), j1(0.0), i2(0.0), j2(0.0); + vpPoint a_(a), b_(b); + a_.project(); + b_.project(); + vpMeterPixelConversion::convertPoint(K,a_.get_x(), a_.get_y(),j1,i1); + vpMeterPixelConversion::convertPoint(K,b_.get_x(), b_.get_y(),j2,i2); + + vpDisplay::displayLine(linedebugImg,i1,j1,i2,j2,vpColor::yellow,3); +#endif + } + + if (!visibility_samples.count(edge)) + return; + + // Initialized as the biggest difference between the two points is on the X-axis + double *v0(&x0), *w0(&z0); + double *v1(&x1), *w1(&z1); + unsigned int size(w); + + if (std::fabs(y0 - y1) > std::fabs(x0 - x1)) // Test if the biggest difference is on the Y-axis + { + v0 = &y0; + v1 = &y1; + size = h; + } + + // Cannot call swap(a,b) since a and b are const + // The fix consists in 2 new points that contain the right points + vpPoint a_; + vpPoint b_; + + if (*v0 > *v1) + { + std::swap(v0, v1); + std::swap(w0, w1); + //std::swap(a, b); + // Cannot call swap(a,b) since a and b are const + // Instead of swap we set the right address of the corresponding pointers + a_ = b; + b_ = a; + } + else { + a_ = a; + b_ = b; + } + + //if (*v0 >= size - 1 || *v1 < 0 || *v1 == *v0) + if (*v0 >= size - 1 || *v1 < 0 || std::fabs(*v1 - *v0) <= std::numeric_limits<double>::epsilon()) + return; + + const int _v0 = std::max(0, int(std::ceil(*v0))); + const int _v1 = std::min<int>((int)(size - 1), (int)(std::ceil(*v1) - 1)); + + const std::set<int> &visible_samples = visibility_samples[edge]; + int last = _v0; + vpPoint line_start; + vpPoint line_end; + bool b_line_started = false; + for(std::set<int>::const_iterator it = visible_samples.begin() ; it != visible_samples.end() ; ++it) + { + const int v = *it; + const double alpha = getAlpha(v, (*v0) * (*w0), (*w0), (*v1) * (*w1), (*w1)); + //const vpPoint p = mix(a, b, alpha); + const vpPoint p = mix(a_, b_, alpha); + if (last + 1 != v) + { + if(b_line_started) + lines.push_back(std::make_pair(line_start, line_end)); + b_line_started = false; + } + if (v == _v0) + { + //line_start = a; + line_start = a_; + line_end = p; + b_line_started = true; + } + else if (v == _v1) + { + //line_end = b; + line_end = b_; + if (!b_line_started) + line_start = p; + b_line_started = true; + } + else + { + line_end = p; + if (!b_line_started) + line_start = p; + b_line_started = true; + } + last = v; + } + if (b_line_started) + lines.push_back(std::make_pair(line_start, line_end)); + + if(displayResults){ +#if (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(DEBUG_DISP) + double i1(0.0), j1(0.0), i2(0.0), j2(0.0); + for(unsigned int i = 0 ; i < lines.size() ; i++){ + lines[i].first.project(); + lines[i].second.project(); + vpMeterPixelConversion::convertPoint(K,lines[i].first.get_x(), lines[i].first.get_y(),j1,i1); + vpMeterPixelConversion::convertPoint(K,lines[i].second.get_x(), lines[i].second.get_y(),j2,i2); + + vpDisplay::displayLine(linedebugImg,i1,j1,i2,j2,vpColor::red,3); + } + vpDisplay::flush(linedebugImg); +#endif + } +} + +/*! + Create a vpMbScanLineEdge from two points while ordering them. + + \param a : First point of the line. + \param b : Second point of the line. + + \return Resulting vpMbScanLineEdge. +*/ +vpMbScanLine::vpMbScanLineEdge +vpMbScanLine::makeMbScanLineEdge(const vpPoint &a, const vpPoint &b) +{ + vpColVector _a(3); + vpColVector _b(3); + + _a[0] = std::ceil((a.get_X() * 1e8) * 1e-6); + _a[1] = std::ceil((a.get_Y() * 1e8) * 1e-6); + _a[2] = std::ceil((a.get_Z() * 1e8) * 1e-6); + + _b[0] = std::ceil((b.get_X() * 1e8) * 1e-6); + _b[1] = std::ceil((b.get_Y() * 1e8) * 1e-6); + _b[2] = std::ceil((b.get_Z() * 1e8) * 1e-6); + + bool b_comp = false; + for(unsigned int i = 0 ; i < 3 ; ++i) + if (_a[i] < _b[i]) + { + b_comp = true; + break; + } + else if(_a[i] > _b[i]) + break; + + if (b_comp) + return std::make_pair(_a, _b); + + return std::make_pair(_b, _a); +} + +/*! + Create a vpColVector of a projected point. + + \param p : Point to project. + \param v : Resulting vector. + \param K : Camera parameters. +*/ +void +vpMbScanLine::createVectorFromPoint(const vpPoint &p, vpColVector &v, const vpCameraParameters &K) +{ + v = vpColVector(3); + + v[0] = p.get_X() * K.get_px() + K.get_u0() * p.get_Z(); + v[1] = p.get_Y() * K.get_py() + K.get_v0() * p.get_Z(); + v[2] = p.get_Z(); +} + +/*! + Compute the interpolation factor. + + \param x : Value used as basis to compute the interpolation factor + \param X0 : First extremity. + \param Z0 : First extremity. + \param X1 : Second extremity. + \param Z1 : Second extremity. +*/ +double +vpMbScanLine::getAlpha(double x, double X0, double Z0, double X1, double Z1) +{ + const double N = X0 - x * Z0; + const double D = x * (Z1 - Z0) - (X1 - X0); + double alpha = N / D; + if (vpMath::isNaN(alpha) || vpMath::isInf(alpha)) + return 0.0; + + alpha = std::min(1.0,alpha); + alpha = std::max(0.0,alpha); + return alpha; +} + +/*! + Interpolate two values. + + \param a : first value. + \param b : second value. + \param alpha : interpolation factor. + + \return Interpolated value. +*/ +double +vpMbScanLine::mix(double a, double b, double alpha) +{ + return a + (b - a) * alpha; +} + +/*! + Interpolate two vpPoints. + + \param a : first point. + \param b : second point. + \param alpha : interpolation factor. + + \return Interpolated vpPoint. +*/ +vpPoint +vpMbScanLine::mix(const vpPoint &a, const vpPoint &b, double alpha) +{ + vpPoint res; + res.set_X(a.get_X() + ( b.get_X() - a.get_X() ) * alpha); + res.set_Y(a.get_Y() + ( b.get_Y() - a.get_Y() ) * alpha); + res.set_Z(a.get_Z() + ( b.get_Z() - a.get_Z() ) * alpha); + + return res; +} + +/*! + Compute the norm of two vpPoints. + + \param a : first point. + \param b : second point. + + \return Resulting norm. +*/ +double +vpMbScanLine::norm(const vpPoint &a, const vpPoint &b) +{ + return sqrt(vpMath::sqr(a.get_X()-b.get_X()) + vpMath::sqr(a.get_Y() - b.get_Y()) + vpMath::sqr(a.get_Z() - b.get_Z())); +} + +#endif diff --git a/src/tracking/mbt/vpMbTracker.cpp b/modules/tracker/mbt/src/vpMbTracker.cpp old mode 100755 new mode 100644 similarity index 88% rename from src/tracking/mbt/vpMbTracker.cpp rename to modules/tracker/mbt/src/vpMbTracker.cpp index 6b0760c196a935c9f0b35f5dc6ab49d3f65bdff1..e70e3a9d5d02a52e19f530c0dbfedd53c0939006 --- a/src/tracking/mbt/vpMbTracker.cpp +++ b/modules/tracker/mbt/src/vpMbTracker.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbTracker.cpp 5285 2015-02-09 14:32:54Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,27 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * Contact visp@irisa.fr if any conditions of this licensing are - * not clear to you. - * * Description: * Generic model based tracker * @@ -53,26 +47,30 @@ #include <algorithm> #include <map> -#include <visp/vpMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpColVector.h> -#include <visp/vpPoint.h> -#include <visp/vpPose.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpColor.h> -#include <visp/vpIoTools.h> -#include <visp/vpException.h> -#include <visp/vpImageIo.h> -#include <visp/vpMbTracker.h> -#include <visp/vpMatrixException.h> -#include <visp/vpIoTools.h> - -#ifdef VISP_HAVE_COIN +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpPoint.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpDisplay.h> +#ifdef VISP_HAVE_MODULE_GUI +# include <visp3/gui/vpDisplayOpenCV.h> +# include <visp3/gui/vpDisplayX.h> +# include <visp3/gui/vpDisplayGDI.h> +#endif +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpException.h> +#ifdef VISP_HAVE_MODULE_IO +# include <visp3/io/vpImageIo.h> +#endif +#include <visp3/mbt/vpMbTracker.h> +#include <visp3/core/vpMatrixException.h> +#include <visp3/core/vpIoTools.h> + +#ifdef VISP_HAVE_COIN3D //Inventor includes #include <Inventor/nodes/SoSeparator.h> #include <Inventor/VRMLnodes/SoVRMLIndexedFaceSet.h> @@ -91,6 +89,7 @@ +#ifndef DOXYGEN_SHOULD_SKIP_THIS /*! Structure to store info about segment in CAO model files. @@ -120,6 +119,7 @@ struct PolygonFaceInfo { vpPolygon polygon; std::vector<vpPoint> faceCorners; }; +#endif // DOXYGEN_SHOULD_SKIP_THIS /*! Basic constructor. @@ -128,14 +128,15 @@ struct PolygonFaceInfo { */ vpMbTracker::vpMbTracker() : cam(), cMo(), oJo(6,6), isoJoIdentity(true), modelFileName(), modelInitialised(false), - poseSavingFilename(), computeCovariance(false), covarianceMatrix(), displayFeatures(false), - m_w(), m_error(), faces(), angleAppears( vpMath::rad(89) ), angleDisappears( vpMath::rad(89) ), - distNearClip(0.001), distFarClip(100), clippingFlag(vpMbtPolygon::NO_CLIPPING), useOgre(false), + poseSavingFilename(), computeCovariance(false), covarianceMatrix(), computeProjError(false), + projectionError(90.0), displayFeatures(false), m_w(), m_error(), m_optimizationMethod(vpMbTracker::GAUSS_NEWTON_OPT), + faces(), angleAppears( vpMath::rad(89) ), angleDisappears( vpMath::rad(89) ), distNearClip(0.001), + distFarClip(100), clippingFlag(vpPolygon3D::NO_CLIPPING), useOgre(false), ogreShowConfigDialog(false), useScanLine(false), nbPoints(0), nbLines(0), nbPolygonLines(0), nbPolygonPoints(0), nbCylinders(0), nbCircles(0), useLodGeneral(false), applyLodSettingInConfig(false), minLineLengthThresholdGeneral(50.0), minPolygonAreaThresholdGeneral(2500.0), mapOfParameterNames() { - oJo.setIdentity(); + oJo.eye(); //Map used to parse additional information in CAO model files, //like name of faces or LOD setting mapOfParameterNames["name"] = "string"; @@ -151,6 +152,7 @@ vpMbTracker::~vpMbTracker() { } +#ifdef VISP_HAVE_MODULE_GUI /*! Initialise the tracking by clicking on the image points corresponding to the 3D points (object frame) in the file initFile. The structure of this file @@ -165,7 +167,8 @@ vpMbTracker::~vpMbTracker() \param I : Input image \param initFile : File containing the points where to click \param displayHelp : Optionnal display of an image ( 'initFile.ppm' ). This - image may be used to show where to click. + image may be used to show where to click. This functionality is only available + if visp_io module is used. \exception vpException::ioError : The file specified in initFile doesn't exist. @@ -202,7 +205,7 @@ vpMbTracker::initClick(const vpImage<unsigned char>& I, const std::string& initF } if(finitpos.fail() ){ std::cout << "cannot read " << s << std::endl << "cMo set to identity" << std::endl; - last_cMo.setIdentity(); + last_cMo.eye(); } else{ for (unsigned int i = 0; i < 6; i += 1){ @@ -265,6 +268,7 @@ vpMbTracker::initClick(const vpImage<unsigned char>& I, const std::string& initF throw vpException(vpException::ioError, "cannot read init file"); } +#ifdef VISP_HAVE_MODULE_IO //Display window creation and initialisation try{ if(displayHelp){ @@ -301,7 +305,9 @@ vpMbTracker::initClick(const vpImage<unsigned char>& I, const std::string& initF d_help = NULL; } } - +#else //#ifdef VISP_HAVE_MODULE_IO + (void)(displayHelp); +#endif //#ifdef VISP_HAVE_MODULE_IO char c; // skip lines starting with # as comment finit.get(c); @@ -438,7 +444,8 @@ vpMbTracker::initClick(const vpImage<unsigned char>& I, const std::string& initF \param I : Input image \param points3D_list : List of the 3D points (object frame). - \param displayFile : Path to the image used to display the help. + \param displayFile : Path to the image used to display the help. This functionality + is only available if visp_io module is used. */ void vpMbTracker::initClick(const vpImage<unsigned char>& I, const std::vector<vpPoint> &points3D_list, const std::string &displayFile) @@ -448,11 +455,12 @@ void vpMbTracker::initClick(const vpImage<unsigned char>& I, const std::vector<v vpDisplay *d_help = NULL; vpPose pose ; - vpPoint *P = NULL; P = new vpPoint [points3D_list.size()] ; + std::vector<vpPoint> P; for (unsigned int i=0 ; i < points3D_list.size() ; i++) - P[i].setWorldCoordinates(points3D_list[i].get_oX(),points3D_list[i].get_oY(),points3D_list[i].get_oZ()) ; + P.push_back( vpPoint(points3D_list[i].get_oX(), points3D_list[i].get_oY(), points3D_list[i].get_oZ()) ); - vpImage<vpRGBa> Iref ; +#ifdef VISP_HAVE_MODULE_IO + vpImage<vpRGBa> Iref ; //Display window creation and initialisation if(vpIoTools::checkFilename(displayFile)){ try{ @@ -480,7 +488,10 @@ void vpMbTracker::initClick(const vpImage<unsigned char>& I, const std::vector<v } } } - +#else //#ifdef VISP_HAVE_MODULE_IO + (void)(displayFile); +#endif //#ifdef VISP_HAVE_MODULE_IO + vpImagePoint ip; bool isWellInit = false; while(!isWellInit) @@ -527,7 +538,6 @@ void vpMbTracker::initClick(const vpImage<unsigned char>& I, const std::vector<v vpMouseButton::vpMouseButtonType button = vpMouseButton::button1; while (!vpDisplay::getClick(I, ip, button)) ; - if (button == vpMouseButton::button1) { isWellInit = true; @@ -542,7 +552,6 @@ void vpMbTracker::initClick(const vpImage<unsigned char>& I, const std::vector<v vpDisplay::displayFrame(I, cMo, cam, 0.05, vpColor::red); - delete [] P; if(d_help != NULL) { delete d_help; d_help = NULL; @@ -550,6 +559,7 @@ void vpMbTracker::initClick(const vpImage<unsigned char>& I, const std::vector<v init(I); } +#endif //#ifdef VISP_HAVE_MODULE_GUI /*! Initialise the tracking by reading the 3D points (object frame) and the image points @@ -660,12 +670,12 @@ void vpMbTracker::initFromPoints( const vpImage<unsigned char>& I, const std::ve vpERROR_TRACE( "vpMbTracker::initFromPoints(), Number of 2D points different to the number of 3D points." ); size_t size = points3D_list.size(); - vpPoint *P = new vpPoint [size]; + std::vector<vpPoint> P; vpPose pose ; for(size_t i=0 ; i< size ; i++) { - P[i].setWorldCoordinates(points3D_list[i].get_oX(),points3D_list[i].get_oY(),points3D_list[i].get_oZ()) ; + P.push_back( vpPoint(points3D_list[i].get_oX(), points3D_list[i].get_oY(), points3D_list[i].get_oZ()) ); double x=0,y=0; vpPixelMeterConversion::convertPoint(cam, points2D_list[i], x, y); P[i].set_x(x); @@ -686,8 +696,6 @@ void vpMbTracker::initFromPoints( const vpImage<unsigned char>& I, const std::ve pose.computePose(vpPose::VIRTUAL_VS, cMo); - delete [] P; - init(I); } @@ -722,7 +730,6 @@ void vpMbTracker::initFromPose(const vpImage<unsigned char>& I, const std::strin else sprintf(s,"%s.pos", initFile.c_str()); - std::cout << "filename " << s << std::endl ; finit.open(s,std::ios::in) ; if (finit.fail()){ std::cout << "cannot read " << s << std::endl; @@ -819,13 +826,13 @@ void vpMbTracker::addPolygon(const std::vector<vpPoint>& corners, const int idFa faces.addPolygon(&polygon); - if(clippingFlag != vpMbtPolygon::NO_CLIPPING) + if(clippingFlag != vpPolygon3D::NO_CLIPPING) faces.getPolygon().back()->setClipping(clippingFlag); - if((clippingFlag & vpMbtPolygon::NEAR_CLIPPING) == vpMbtPolygon::NEAR_CLIPPING) + if((clippingFlag & vpPolygon3D::NEAR_CLIPPING) == vpPolygon3D::NEAR_CLIPPING) faces.getPolygon().back()->setNearClippingDistance(distNearClip); - if((clippingFlag & vpMbtPolygon::FAR_CLIPPING) == vpMbtPolygon::FAR_CLIPPING) + if((clippingFlag & vpPolygon3D::FAR_CLIPPING) == vpPolygon3D::FAR_CLIPPING) faces.getPolygon().back()->setFarClippingDistance(distFarClip); } @@ -900,13 +907,13 @@ void vpMbTracker::addPolygon(const vpPoint& p1, const vpPoint &p2, const vpPoint polygon.setIndex(idFace); faces.addPolygon(&polygon); - if(clippingFlag != vpMbtPolygon::NO_CLIPPING) + if(clippingFlag != vpPolygon3D::NO_CLIPPING) faces.getPolygon().back()->setClipping(clippingFlag); - if((clippingFlag & vpMbtPolygon::NEAR_CLIPPING) == vpMbtPolygon::NEAR_CLIPPING) + if((clippingFlag & vpPolygon3D::NEAR_CLIPPING) == vpPolygon3D::NEAR_CLIPPING) faces.getPolygon().back()->setNearClippingDistance(distNearClip); - if((clippingFlag & vpMbtPolygon::FAR_CLIPPING) == vpMbtPolygon::FAR_CLIPPING) + if((clippingFlag & vpPolygon3D::FAR_CLIPPING) == vpPolygon3D::FAR_CLIPPING) faces.getPolygon().back()->setFarClippingDistance(distFarClip); } @@ -935,16 +942,49 @@ void vpMbTracker::addPolygon(const vpPoint& p1, const vpPoint &p2, const int idF faces.addPolygon(&polygon) ; - if(clippingFlag != vpMbtPolygon::NO_CLIPPING) + if(clippingFlag != vpPolygon3D::NO_CLIPPING) faces.getPolygon().back()->setClipping(clippingFlag); - if((clippingFlag & vpMbtPolygon::NEAR_CLIPPING) == vpMbtPolygon::NEAR_CLIPPING) + if((clippingFlag & vpPolygon3D::NEAR_CLIPPING) == vpPolygon3D::NEAR_CLIPPING) faces.getPolygon().back()->setNearClippingDistance(distNearClip); - if((clippingFlag & vpMbtPolygon::FAR_CLIPPING) == vpMbtPolygon::FAR_CLIPPING) + if((clippingFlag & vpPolygon3D::FAR_CLIPPING) == vpPolygon3D::FAR_CLIPPING) faces.getPolygon().back()->setFarClippingDistance(distFarClip); } +void vpMbTracker::addPolygon(const std::vector<std::vector<vpPoint> > &listFaces, const int idFace, const std::string &polygonName, + const bool useLod, const double minLineLengthThreshold) +{ + int id = idFace; + for(unsigned int i = 0 ; i < listFaces.size() ; i++) + { + vpMbtPolygon polygon; + polygon.setNbPoint((unsigned int)listFaces[i].size()); + for(unsigned int j = 0 ; j < listFaces[i].size() ; j++) + polygon.addPoint(j, listFaces[i][j]); + + polygon.setIndex(id) ; + polygon.setName(polygonName); + polygon.setIsPolygonOriented(false); + polygon.setLod(useLod); + polygon.setMinLineLengthThresh(minLineLengthThreshold); + polygon.setMinPolygonAreaThresh(minPolygonAreaThresholdGeneral); + + faces.addPolygon(&polygon) ; + + if(clippingFlag != vpPolygon3D::NO_CLIPPING) + faces.getPolygon().back()->setClipping(clippingFlag); + + if((clippingFlag & vpPolygon3D::NEAR_CLIPPING) == vpPolygon3D::NEAR_CLIPPING) + faces.getPolygon().back()->setNearClippingDistance(distNearClip); + + if((clippingFlag & vpPolygon3D::FAR_CLIPPING) == vpPolygon3D::FAR_CLIPPING) + faces.getPolygon().back()->setFarClippingDistance(distFarClip); + + id++; + } +} + /*! Load a 3D model from the file in parameter. This file must either be a vrml file (.wrl) or a CAO file (.cao). CAO format is described in the @@ -956,7 +996,7 @@ void vpMbTracker::addPolygon(const vpPoint& p1, const vpPoint &p2, const int idF int main() { ... -#if defined(VISP_HAVE_COIN) && (COIN_MAJOR_VERSION == 3) +#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3) SoDB::finish(); #endif } @@ -987,7 +1027,7 @@ vpMbTracker::loadModel(const char *modelFile, const bool verbose) int main() { ... -#if defined(VISP_HAVE_COIN) && (COIN_MAJOR_VERSION == 3) +#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3) SoDB::finish(); #endif } @@ -1011,7 +1051,7 @@ vpMbTracker::loadModel(const std::string& modelFile, const bool verbose) if((*(it-1) == 'o' && *(it-2) == 'a' && *(it-3) == 'c' && *(it-4) == '.') || (*(it-1) == 'O' && *(it-2) == 'A' && *(it-3) == 'C' && *(it-4) == '.') ){ std::vector<std::string> vectorOfModelFilename; - int startIdFace = 0; + int startIdFace = faces.size(); nbPoints = 0; nbLines = 0; nbPolygonLines = 0; @@ -1025,11 +1065,11 @@ vpMbTracker::loadModel(const std::string& modelFile, const bool verbose) loadVRMLModel(modelFile); } else{ - throw vpException(vpException::ioError, "file cannot be open"); + throw vpException(vpException::ioError, "Error: File %s doesn't contain a cao or wrl model", modelFile.c_str()); } } else{ - throw vpException(vpException::ioError, "file cannot be open"); + throw vpException(vpException::ioError, "Error: File %s doesn't exist", modelFile.c_str()); } this->modelInitialised = true; @@ -1047,7 +1087,7 @@ vpMbTracker::loadModel(const std::string& modelFile, const bool verbose) int main() { ... -#if defined(VISP_HAVE_COIN) && (COIN_MAJOR_VERSION == 3) +#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3) SoDB::finish(); #endif } @@ -1070,7 +1110,7 @@ geometry DEF cyl_cylinder1 IndexedFaceSet void vpMbTracker::loadVRMLModel(const std::string& modelFile) { -#ifdef VISP_HAVE_COIN +#ifdef VISP_HAVE_COIN3D SoDB::init(); // Call SoDB::finish() before ending the program. SoInput in; @@ -1106,7 +1146,7 @@ vpMbTracker::loadVRMLModel(const std::string& modelFile) in.closeFile(); vpHomogeneousMatrix transform; - int indexFace = 0; + int indexFace = faces.size(); extractGroup(sceneGraphVRML2, transform, indexFace); sceneGraphVRML2->unref(); @@ -1124,6 +1164,8 @@ void vpMbTracker::removeComment(std::ifstream& fileId) { fileId.ignore(256, '\n'); fileId.get(c); } + if (fileId.fail()) + throw(vpException(vpException::ioError, "Reached end of file")); fileId.unget(); } @@ -1364,13 +1406,14 @@ vpMbTracker::loadCAOModel(const std::string& modelFile, fileId >> x; fileId >> y; fileId >> z; - fileId.ignore(256, '\n'); // skip the rest of the line if (caoVersion == 2) { fileId >> i; fileId >> j; } + fileId.ignore(256, '\n'); // skip the rest of the line + caoPoints[k].setWorldCoordinates(x, y, z); } @@ -1664,8 +1707,15 @@ vpMbTracker::loadCAOModel(const std::string& modelFile, useLod = parseBoolean(mapOfParams["useLod"]); } - addPolygon(caoPoints[indexP1], caoPoints[indexP2], idFace, polygonName, useLod, minLineLengthThreshold); - initCylinder(caoPoints[indexP1], caoPoints[indexP2], radius, idFace++, polygonName); + int idRevolutionAxis = idFace; + addPolygon(caoPoints[indexP1], caoPoints[indexP2], idFace++, polygonName, useLod, minLineLengthThreshold); + + std::vector<std::vector<vpPoint> > listFaces; + createCylinderBBox(caoPoints[indexP1], caoPoints[indexP2], radius,listFaces); + addPolygon(listFaces, idFace, polygonName, useLod, minLineLengthThreshold); + idFace+=4; + + initCylinder(caoPoints[indexP1], caoPoints[indexP2], radius, idRevolutionAxis, polygonName); } } catch (...) { @@ -1775,7 +1825,7 @@ vpMbTracker::loadCAOModel(const std::string& modelFile, } } -#ifdef VISP_HAVE_COIN +#ifdef VISP_HAVE_COIN3D /*! Extract a VRML object Group. @@ -1839,6 +1889,8 @@ vpMbTracker::extractGroup(SoVRMLGroup *sceneGraphVRML2, vpHomogeneousMatrix &tra if (child->getTypeId() == SoVRMLShape::getClassTypeId()){ SoChildList * child2list = child->getChildren(); + std::string name = child->getName().getString(); + for (int j = 0; j < child2list->getLength(); j++) { if (((SoNode*)child2list->get(j))->getTypeId() == SoVRMLIndexedFaceSet::getClassTypeId()) @@ -1846,16 +1898,16 @@ vpMbTracker::extractGroup(SoVRMLGroup *sceneGraphVRML2, vpHomogeneousMatrix &tra SoVRMLIndexedFaceSet * face_set; face_set = (SoVRMLIndexedFaceSet*)child2list->get(j); if(!strncmp(face_set->getName().getString(),"cyl",3)){ - extractCylinders(face_set, transform, idFace); + extractCylinders(face_set, transform, idFace, name); }else{ - extractFaces(face_set, transform, idFace); + extractFaces(face_set, transform, idFace, name); } } if (((SoNode*)child2list->get(j))->getTypeId() == SoVRMLIndexedLineSet::getClassTypeId()) { SoVRMLIndexedLineSet * line_set; line_set = (SoVRMLIndexedLineSet*)child2list->get(j); - extractLines(line_set, idFace); + extractLines(line_set, idFace, name); } } } @@ -1869,9 +1921,10 @@ vpMbTracker::extractGroup(SoVRMLGroup *sceneGraphVRML2, vpHomogeneousMatrix &tra \param face_set : Pointer to the face in the vrml format. \param transform : Transformation matrix applied to the face. \param idFace : Face id. + \param polygonName: Name of the polygon. */ void -vpMbTracker::extractFaces(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatrix &transform, int &idFace) +vpMbTracker::extractFaces(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatrix &transform, int &idFace, const std::string &polygonName) { std::vector<vpPoint> corners; corners.resize(0); @@ -1890,7 +1943,7 @@ vpMbTracker::extractFaces(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatrix &t { if(corners.size() > 1) { - addPolygon(corners, idFace++); + addPolygon(corners, idFace++, polygonName); initFaceFromCorners(*(faces.getPolygon().back())); // Init from the last polygon that was added corners.resize(0); } @@ -1924,9 +1977,10 @@ vpMbTracker::extractFaces(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatrix &t \param face_set : Pointer to the cylinder in the vrml format. \param transform : Transformation matrix applied to the cylinder. \param idFace : Id of the face. + \param polygonName: Name of the polygon. */ void -vpMbTracker::extractCylinders(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatrix &transform, int &idFace) +vpMbTracker::extractCylinders(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatrix &transform, int &idFace, const std::string &polygonName) { std::vector<vpPoint> corners_c1, corners_c2;//points belonging to the first circle and to the second one. SoVRMLCoordinate* coords = (SoVRMLCoordinate *)face_set->coord.getValue(); @@ -1944,6 +1998,7 @@ vpMbTracker::extractCylinders(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatri // extract all points and fill the two sets. + for(int i=0; i<coords->point.getNum(); ++i){ pointTransformed[0]=coords->point[i].getValue()[0]; pointTransformed[1]=coords->point[i].getValue()[1]; @@ -1979,8 +2034,18 @@ vpMbTracker::extractCylinders(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatri throw vpException(vpException::badValue, "Radius from the two circles of the cylinders are different."); } - addPolygon(p1, p2, idFace); - initCylinder(p1, p2, radius_c1, idFace++); + //addPolygon(p1, p2, idFace, polygonName); + //initCylinder(p1, p2, radius_c1, idFace++); + + int idRevolutionAxis = idFace; + addPolygon(p1, p2, idFace++, polygonName); + + std::vector<std::vector<vpPoint> > listFaces; + createCylinderBBox(p1, p2, radius_c1, listFaces); + addPolygon(listFaces, idFace, polygonName); + idFace+=4; + + initCylinder(p1, p2, radius_c1, idRevolutionAxis, polygonName); } /*! @@ -1989,9 +2054,10 @@ vpMbTracker::extractCylinders(SoVRMLIndexedFaceSet* face_set, vpHomogeneousMatri \param line_set : Pointer to the line in the vrml format. \param idFace : Id of the face. + \param polygonName: Name of the polygon. */ void -vpMbTracker::extractLines(SoVRMLIndexedLineSet* line_set, int &idFace) +vpMbTracker::extractLines(SoVRMLIndexedLineSet* line_set, int &idFace, const std::string &polygonName) { std::vector<vpPoint> corners; corners.resize(0); @@ -2008,7 +2074,7 @@ vpMbTracker::extractLines(SoVRMLIndexedLineSet* line_set, int &idFace) { if(corners.size() > 1) { - addPolygon(corners, idFace++); + addPolygon(corners, idFace++, polygonName); initFaceFromCorners(*(faces.getPolygon().back())); // Init from the last polygon that was added corners.resize(0); } @@ -2027,7 +2093,7 @@ vpMbTracker::extractLines(SoVRMLIndexedLineSet* line_set, int &idFace) } } -#endif // VISP_HAVE_COIN +#endif // VISP_HAVE_COIN3D /*! Compute the center of gravity of a set of point. This is used in the cylinder @@ -2072,11 +2138,6 @@ vpMbTracker::getGravityCenter(const std::vector<vpPoint>& pts) std::pair<std::vector<vpPolygon>, std::vector<std::vector<vpPoint> > > vpMbTracker::getPolygonFaces(const bool orderPolygons, const bool useVisibility) { - vpHomogeneousMatrix cMo; - vpCameraParameters cam; - getPose(cMo); - getCameraParameters(cam); - //Temporary variable to permit to order polygons by distance std::vector<vpPolygon> polygonsTmp; std::vector<std::vector<vpPoint> > roisPtTmp; @@ -2174,12 +2235,12 @@ vpMbTracker::setOgreVisibilityTest(const bool &v) void vpMbTracker::setFarClippingDistance(const double &dist) { - if( (clippingFlag & vpMbtPolygon::NEAR_CLIPPING) == vpMbtPolygon::NEAR_CLIPPING && dist <= distNearClip) + if( (clippingFlag & vpPolygon3D::NEAR_CLIPPING) == vpPolygon3D::NEAR_CLIPPING && dist <= distNearClip) vpTRACE("Far clipping value cannot be inferior than near clipping value. Far clipping won't be considered."); else if ( dist < 0 ) vpTRACE("Far clipping value cannot be inferior than 0. Far clipping won't be considered."); else{ - clippingFlag = (clippingFlag | vpMbtPolygon::FAR_CLIPPING); + clippingFlag = (clippingFlag | vpPolygon3D::FAR_CLIPPING); distFarClip = dist; for (unsigned int i = 0; i < faces.size(); i ++){ faces[i]->setFarClippingDistance(distFarClip); @@ -2256,12 +2317,12 @@ vpMbTracker::setMinPolygonAreaThresh(const double minPolygonAreaThresh, const st void vpMbTracker::setNearClippingDistance(const double &dist) { - if( (clippingFlag & vpMbtPolygon::FAR_CLIPPING) == vpMbtPolygon::FAR_CLIPPING && dist >= distFarClip) + if( (clippingFlag & vpPolygon3D::FAR_CLIPPING) == vpPolygon3D::FAR_CLIPPING && dist >= distFarClip) vpTRACE("Near clipping value cannot be superior than far clipping value. Near clipping won't be considered."); else if ( dist < 0 ) vpTRACE("Near clipping value cannot be inferior than 0. Near clipping won't be considered."); else{ - clippingFlag = (clippingFlag | vpMbtPolygon::NEAR_CLIPPING); + clippingFlag = (clippingFlag | vpPolygon3D::NEAR_CLIPPING); distNearClip = dist; for (unsigned int i = 0; i < faces.size(); i ++){ faces[i]->setNearClippingDistance(distNearClip); @@ -2287,78 +2348,6 @@ vpMbTracker::setClipping(const unsigned int &flags) faces[i]->setClipping(clippingFlag); } - -void -vpMbTracker::computeCovarianceMatrix(const vpHomogeneousMatrix &cMoPrev, const vpColVector &deltaS, const vpMatrix &Ls, const vpMatrix &W) -{ - //building Lp - vpMatrix LpInv(6,6); - LpInv = 0; - LpInv[0][0] = -1.0; - LpInv[1][1] = -1.0; - LpInv[2][2] = -1.0; - - vpTranslationVector ctoInit; - - cMoPrev.extract(ctoInit); - vpMatrix ctoInitSkew = ctoInit.skew(); - - vpThetaUVector thetau; - cMoPrev.extract(thetau); - - vpColVector tu(3); - for(unsigned int i = 0 ; i < 3 ; i++) - tu[i] = thetau[i]; - - double theta = sqrt(tu.sumSquare()) ; - -// vpMatrix Lthetau(3,3); - vpMatrix LthetauInvAnalytic(3,3); - vpMatrix I3(3,3); - I3.setIdentity(); -// Lthetau = -I3; - LthetauInvAnalytic = -I3; - - if(theta / (2.0 * M_PI) > std::numeric_limits<double>::epsilon()) - { - // Computing [theta/2 u]_x - vpColVector theta2u(3) ; - for (unsigned int i=0 ; i < 3 ; i++) { - theta2u[i] = tu[i]/2.0 ; - } - vpMatrix theta2u_skew = vpColVector::skew(theta2u); - - vpColVector u(3) ; - for (unsigned int i=0 ; i < 3 ; i++) { - u[i] = tu[i]/theta ; - } - vpMatrix u_skew = vpColVector::skew(u); - -// Lthetau += (theta2u_skew - (1.0-vpMath::sinc(theta)/vpMath::sqr(vpMath::sinc(theta/2.0)))*u_skew*u_skew); - LthetauInvAnalytic += -(vpMath::sqr(vpMath::sinc(theta/2.0)) * theta2u_skew - (1.0-vpMath::sinc(theta))*u_skew*u_skew); - } - -// vpMatrix LthetauInv = Lthetau.inverseByLU(); - - ctoInitSkew = ctoInitSkew * LthetauInvAnalytic; - - for(unsigned int a = 0 ; a < 3 ; a++) - for(unsigned int b = 0 ; b < 3 ; b++) - LpInv[a][b+3] = ctoInitSkew[a][b]; - - for(unsigned int a = 0 ; a < 3 ; a++) - for(unsigned int b = 0 ; b < 3 ; b++) - LpInv[a+3][b+3] = LthetauInvAnalytic[a][b]; - - // Building Js - vpMatrix Js = Ls * LpInv; - - // building deltaP - vpColVector deltaP = (Js).pseudoInverse(Js.getRows()*std::numeric_limits<double>::epsilon()) * deltaS; - - covarianceMatrix = vpMatrix::computeCovarianceMatrix(Js,deltaP,deltaS,W); -} - /*! Compute \f$ J^T R \f$, with J the interaction matrix and R the vector of residu. @@ -2366,22 +2355,22 @@ vpMbTracker::computeCovarianceMatrix(const vpHomogeneousMatrix &cMoPrev, const v \throw vpMatrixException::incorrectMatrixSizeError if the sizes of the matrices do not allow the computation. - \warning The JTR matrix is resized. + \warning The JTR vector is resized. \param interaction : The interaction matrix (size Nx6). \param error : The residu vector (size Nx1). - \param JTR : The resulting JTR matrix (size 6x1). + \param JTR : The resulting JTR column vector (size 6x1). */ void -vpMbTracker::computeJTR(const vpMatrix& interaction, const vpColVector& error, vpMatrix& JTR) +vpMbTracker::computeJTR(const vpMatrix& interaction, const vpColVector& error, vpColVector& JTR) { if(interaction.getRows() != error.getRows() || interaction.getCols() != 6 ){ throw vpMatrixException(vpMatrixException::incorrectMatrixSizeError, "Incorrect matrices size in computeJTR."); } - JTR.resize(6, 1); + JTR.resize(6); const unsigned int N = interaction.getRows(); for (unsigned int i = 0; i < 6; i += 1){ @@ -2389,7 +2378,7 @@ vpMbTracker::computeJTR(const vpMatrix& interaction, const vpColVector& error, v for (unsigned int j = 0; j < N; j += 1){ ssum += interaction[j][i] * error[j]; } - JTR[i][0] = ssum; + JTR[i] = ssum; } } @@ -2443,3 +2432,95 @@ vpMbTracker::setEstimatedDoF(const vpColVector& v) } +void +vpMbTracker::createCylinderBBox(const vpPoint& p1, const vpPoint &p2, const double &radius, std::vector<std::vector<vpPoint> > &listFaces) +{ + listFaces.clear(); + +// std::vector<vpPoint> revolutionAxis; +// revolutionAxis.push_back(p1); +// revolutionAxis.push_back(p2); +// listFaces.push_back(revolutionAxis); + + vpColVector axis(3); + axis[0] = p1.get_oX() - p2.get_oX(); + axis[1] = p1.get_oY() - p2.get_oY(); + axis[2] = p1.get_oZ() - p2.get_oZ(); + + vpColVector randomVec(3); + randomVec = 0; + + vpColVector axisOrtho(3); + + randomVec[0] = 1.0; + axisOrtho = vpColVector::crossProd(axis, randomVec); + + if(axisOrtho.euclideanNorm() < std::numeric_limits<double>::epsilon()) + { + randomVec = 0; + randomVec[1] = 1.0; + axisOrtho = vpColVector::crossProd(axis, randomVec); + if(axisOrtho.euclideanNorm() < std::numeric_limits<double>::epsilon()) + { + randomVec = 0; + randomVec[2] = 1.0; + axisOrtho = vpColVector::crossProd(axis, randomVec); + if(axisOrtho.euclideanNorm() < std::numeric_limits<double>::epsilon()) + throw vpMatrixException(vpMatrixException::badValue, "Problem in the cylinder definition"); + } + } + + axisOrtho.normalize(); + + vpColVector axisOrthoBis(3); + axisOrthoBis = vpColVector::crossProd(axis, axisOrtho); + axisOrthoBis.normalize(); + + //First circle + vpColVector p1Vec(3); + p1Vec[0] = p1.get_oX(); + p1Vec[1] = p1.get_oY(); + p1Vec[2] = p1.get_oZ(); + vpColVector fc1 = p1Vec + axisOrtho*radius; + vpColVector fc2 = p1Vec + axisOrthoBis*radius; + vpColVector fc3 = p1Vec - axisOrtho*radius; + vpColVector fc4 = p1Vec - axisOrthoBis*radius; + + vpColVector p2Vec(3); + p2Vec[0] = p2.get_oX(); + p2Vec[1] = p2.get_oY(); + p2Vec[2] = p2.get_oZ(); + vpColVector sc1 = p2Vec + axisOrtho*radius; + vpColVector sc2 = p2Vec + axisOrthoBis*radius; + vpColVector sc3 = p2Vec - axisOrtho*radius; + vpColVector sc4 = p2Vec - axisOrthoBis*radius; + + std::vector<vpPoint> pointsFace; + pointsFace.push_back( vpPoint(fc1[0], fc1[1], fc1[2]) ); + pointsFace.push_back( vpPoint(sc1[0], sc1[1], sc1[2]) ); + pointsFace.push_back( vpPoint(sc2[0], sc2[1], sc2[2]) ); + pointsFace.push_back( vpPoint(fc2[0], fc2[1], fc2[2]) ); + listFaces.push_back(pointsFace); + + pointsFace.clear(); + pointsFace.push_back( vpPoint(fc2[0], fc2[1], fc2[2]) ); + pointsFace.push_back( vpPoint(sc2[0], sc2[1], sc2[2]) ); + pointsFace.push_back( vpPoint(sc3[0], sc3[1], sc3[2]) ); + pointsFace.push_back( vpPoint(fc3[0], fc3[1], fc3[2]) ); + listFaces.push_back(pointsFace); + + pointsFace.clear(); + pointsFace.push_back( vpPoint(fc3[0], fc3[1], fc3[2]) ); + pointsFace.push_back( vpPoint(sc3[0], sc3[1], sc3[2]) ); + pointsFace.push_back( vpPoint(sc4[0], sc4[1], sc4[2]) ); + pointsFace.push_back( vpPoint(fc4[0], fc4[1], fc4[2]) ); + listFaces.push_back(pointsFace); + + pointsFace.clear(); + pointsFace.push_back( vpPoint(fc4[0], fc4[1], fc4[2]) ); + pointsFace.push_back( vpPoint(sc4[0], sc4[1], sc4[2]) ); + pointsFace.push_back( vpPoint(sc1[0], sc1[1], sc1[2]) ); + pointsFace.push_back( vpPoint(fc1[0], fc1[1], fc1[2]) ); + listFaces.push_back(pointsFace); +} + diff --git a/src/tracking/mbt/vpMbXmlParser.cpp b/modules/tracker/mbt/src/vpMbXmlParser.cpp similarity index 74% rename from src/tracking/mbt/vpMbXmlParser.cpp rename to modules/tracker/mbt/src/vpMbXmlParser.cpp index 84b450b9341d36caf5f9b0a14fb642a389c60b22..bec3d8a7debdd61e444bb70c77c5b25c17fbaddd 100644 --- a/src/tracking/mbt/vpMbXmlParser.cpp +++ b/modules/tracker/mbt/src/vpMbXmlParser.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMbXmlParser.cpp 4577 2014-01-10 16:19:41Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Load XML Parameter for Model Based Tracker. * @@ -38,7 +34,7 @@ * Aurelien Yol * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 @@ -48,7 +44,7 @@ #include <libxml/xmlmemory.h> /* Fonctions de la lib XML. */ -#include <visp/vpMbXmlParser.h> +#include <visp3/mbt/vpMbXmlParser.h> /*! @@ -58,7 +54,8 @@ vpMbXmlParser::vpMbXmlParser() : cam(), angleAppear(70), angleDisappear(80), hasNearClipping(false), nearClipping(false), - hasFarClipping(false), farClipping(false), fovClipping(false) + hasFarClipping(false), farClipping(false), fovClipping(false), + useLod(false), minLineLengthThreshold(50.0), minPolygonAreaThreshold(2500.0) { init(); @@ -93,6 +90,10 @@ vpMbXmlParser::init() nodeMap["v0"] = v0; nodeMap["px"] = px; nodeMap["py"] = py; + nodeMap["lod"] = lod; + nodeMap["use_lod"] = use_lod; + nodeMap["min_line_length_threshold"] = min_line_length_threshold; + nodeMap["min_polygon_area_threshold"] = min_polygon_area_threshold; } /*! @@ -131,6 +132,7 @@ vpMbXmlParser::readMainClass(xmlDocPtr doc, xmlNodePtr node) { bool camera_node = false; bool face_node = false; + bool lod_node = false; for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) { if(dataNode->type == XML_ELEMENT_NODE){ @@ -145,6 +147,10 @@ vpMbXmlParser::readMainClass(xmlDocPtr doc, xmlNodePtr node) this->read_face(doc, dataNode); face_node = true; }break; + case lod:{ + this->read_lod(doc, dataNode); + lod_node = true; + }break; default:{ // vpTRACE("unknown tag in read_sample : %d, %s", iter_data->second, (iter_data->first).c_str()); }break; @@ -164,6 +170,12 @@ vpMbXmlParser::readMainClass(xmlDocPtr doc, xmlNodePtr node) std::cout << "face : Angle Appear : "<< angleAppear <<" (default)" <<std::endl; std::cout << "face : Angle Disappear : "<< angleDisappear <<" (default)" <<std::endl; } + + if(!lod_node) { + std::cout << "lod : use lod : " << useLod << " (default)" << std::endl; + std::cout << "lod : min line length threshold : " << minLineLengthThreshold << " (default)" << std::endl; + std::cout << "lod : min polygon area threshold : " << minPolygonAreaThreshold << " (default)" << std::endl; + } } /*! @@ -319,5 +331,56 @@ vpMbXmlParser::read_face(xmlDocPtr doc, xmlNodePtr node) } } +void +vpMbXmlParser::read_lod (xmlDocPtr doc, xmlNodePtr node) { + bool use_lod_node = false; + bool min_line_length_threshold_node = false; + bool min_polygon_area_threshold_node = false; + + + for(xmlNodePtr dataNode = node->xmlChildrenNode; dataNode != NULL; dataNode = dataNode->next) { + if(dataNode->type == XML_ELEMENT_NODE){ + std::map<std::string, int>::iterator iter_data= this->nodeMap.find((char*)dataNode->name); + if(iter_data != nodeMap.end()){ + switch (iter_data->second){ + case use_lod: + useLod = (xmlReadIntChild(doc, dataNode) != 0); + use_lod_node = true; + break; + case min_line_length_threshold: + minLineLengthThreshold = xmlReadDoubleChild(doc, dataNode); + min_line_length_threshold_node = true; + break; + case min_polygon_area_threshold: + minPolygonAreaThreshold = xmlReadDoubleChild(doc, dataNode); + min_polygon_area_threshold_node = true; + break; + default:{ +// vpTRACE("unknown tag in read_contrast : %d, %s", iter_data->second, (iter_data->first).c_str()); + }break; + } + } + } + } + + if(!use_lod_node) + std::cout << "lod : use lod : " << useLod << " (default)" <<std::endl; + else + std::cout << "lod : use lod : " << useLod << std::endl; + + if(!min_line_length_threshold_node) + std::cout <<"lod : min line length threshold : " << minLineLengthThreshold <<" (default)" <<std::endl; + else + std::cout <<"lod : min line length threshold : " << minLineLengthThreshold <<std::endl; + + if(!min_polygon_area_threshold_node) + std::cout <<"lod : min polygon area threshold : " << minPolygonAreaThreshold <<" (default)" <<std::endl; + else + std::cout <<"lod : min polygon area threshold : " << minPolygonAreaThreshold <<std::endl; +} + +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_mbt.a(vpMbXmlParser.cpp.o) has no symbols +void dummy_vpMbXmlParser() {}; #endif diff --git a/modules/tracker/mbt/src/vpMbtPolygon.cpp b/modules/tracker/mbt/src/vpMbtPolygon.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6c75bcdb7929c89a906acb81b9b2ffc58a1f2469 --- /dev/null +++ b/modules/tracker/mbt/src/vpMbtPolygon.cpp @@ -0,0 +1,285 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Make the complete tracking of an object by using its CAD model + * + * Authors: + * Nicolas Melchior + * Romain Tallonneau + * Eric Marchand + * Aurelien Yol + * + *****************************************************************************/ + +#include <limits.h> + +#include <visp3/core/vpConfig.h> +/*! + \file vpMbtPolygon.cpp + \brief Implements a polygon of the model used by the model-based tracker. +*/ + +#include <visp3/mbt/vpMbtPolygon.h> +#include <visp3/core/vpPolygon.h> + +/*! + Basic constructor. +*/ +vpMbtPolygon::vpMbtPolygon() + : index(-1), isvisible(false), isappearing(false), + useLod(false), minLineLengthThresh(50.0), minPolygonAreaThresh(2500.0), name(""), + hasOrientation(true) +{ +} + +vpMbtPolygon::vpMbtPolygon(const vpMbtPolygon& mbtp) + : vpPolygon3D(mbtp), index(mbtp.index), isvisible(mbtp.isvisible), isappearing(mbtp.isappearing), + useLod(mbtp.useLod), minLineLengthThresh(mbtp.minLineLengthThresh), minPolygonAreaThresh(mbtp.minPolygonAreaThresh), name(mbtp.name), + hasOrientation(mbtp.hasOrientation) +{ + //*this = mbtp; // Should not be called by copy contructor to avoid multiple assignements. +} + +vpMbtPolygon& vpMbtPolygon::operator=(const vpMbtPolygon& mbtp) +{ + vpPolygon3D::operator=(mbtp); + index = mbtp.index; + isvisible = mbtp.isvisible; + isappearing = mbtp.isappearing; + useLod = mbtp.useLod; + minLineLengthThresh = mbtp.minLineLengthThresh; + minPolygonAreaThresh = mbtp.minPolygonAreaThresh; + name = mbtp.name; + hasOrientation = mbtp.hasOrientation; + + return (*this); +} + +/*! + Basic destructor. +*/ +vpMbtPolygon::~vpMbtPolygon() +{ +} + +/*! + Check if the polygon is visible in the image and if the angle between the normal + to the face and the line vector going from the optical center to the cog of the face is below + the given threshold. + To do that, the polygon is projected into the image thanks to the camera pose. + + \param cMo : The pose of the camera. + \param alpha : Maximum angle to detect if the face is visible (in rad). + \param modulo : Indicates if the test should also consider faces that are not oriented + counter clockwise. If true, the orientation of the face is without importance. + \param cam : Camera parameters (intrinsics parameters) + \param I : Image used to consider level of detail. + + \return Return true if the polygon is visible. +*/ +bool +vpMbtPolygon::isVisible(const vpHomogeneousMatrix &cMo, const double alpha, const bool &modulo, + const vpCameraParameters &cam, const vpImage<unsigned char> &I) +{ + // std::cout << "Computing angle from MBT Face (cMo, alpha)" << std::endl; + + changeFrame(cMo); + + if(nbpt <= 2) { + //Level of detail (LOD) + if(useLod) { + vpCameraParameters c = cam; + if(clippingFlag > 3) { // Contains at least one FOV constraint + c.computeFov(I.getWidth(), I.getHeight()); + } + computePolygonClipped(c); + std::vector<vpImagePoint> roiImagePoints; + getRoiClipped(c, roiImagePoints); + + if (roiImagePoints.size() == 2) { + double x1 = roiImagePoints[0].get_u(); + double y1 = roiImagePoints[0].get_v(); + double x2 = roiImagePoints[1].get_u(); + double y2 = roiImagePoints[1].get_v(); + double length = std::sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); +// std::cout << "Index=" << index << " ; Line length=" << length << " ; clippingFlag=" << clippingFlag << std::endl; +// vpTRACE("index=%d lenght=%f minLineLengthThresh=%f", index, length, minLineLengthThresh); + + if (length < minLineLengthThresh) { + isvisible = false; + isappearing = false; + return false; + } + } + } + + /* a line is always visible when LOD is not used */ + isvisible = true; + isappearing = false; + return true ; + } + + // If the polygon has no orientation, the angle check visibility is always valid. + // Feature mainly used for cylinders. + if(!hasOrientation) + { + isvisible = true; + isappearing = false; + return true; + } + + //Check visibility from normal + //Newell's Method for calculating the normal of an arbitrary 3D polygon + //https://www.opengl.org/wiki/Calculating_a_Surface_Normal + vpColVector faceNormal(3); + vpColVector currentVertex, nextVertex; + for(unsigned int i = 0; i<nbpt; i++) { + currentVertex = p[i].cP; + nextVertex = p[(i+1) % nbpt].cP; + + faceNormal[0] += (currentVertex[1] - nextVertex[1]) * (currentVertex[2] + nextVertex[2]); + faceNormal[1] += (currentVertex[2] - nextVertex[2]) * (currentVertex[0] + nextVertex[0]); + faceNormal[2] += (currentVertex[0] - nextVertex[0]) * (currentVertex[1] + nextVertex[1]); + } + faceNormal.normalize(); + + vpColVector e4(3) ; + vpPoint pt; + for (unsigned int i = 0; i < nbpt; i += 1){ + pt.set_X(pt.get_X() + p[i].get_X()); + pt.set_Y(pt.get_Y() + p[i].get_Y()); + pt.set_Z(pt.get_Z() + p[i].get_Z()); + } + e4[0] = -pt.get_X() / (double)nbpt; + e4[1] = -pt.get_Y() / (double)nbpt; + e4[2] = -pt.get_Z() / (double)nbpt; + e4.normalize(); + + double angle = acos(vpColVector::dotProd(e4, faceNormal)); + +// vpCTRACE << angle << "/" << vpMath::deg(angle) << "/" << vpMath::deg(alpha) << std::endl; + + if( angle < alpha || (modulo && (M_PI - angle) < alpha)) { + isvisible = true; + isappearing = false; + + if (useLod) { + vpCameraParameters c = cam; + if(clippingFlag > 3) { // Contains at least one FOV constraint + c.computeFov(I.getWidth(), I.getHeight()); + } + computePolygonClipped(c); + std::vector<vpImagePoint> roiImagePoints; + getRoiClipped(c, roiImagePoints); + + vpPolygon roiPolygon(roiImagePoints); + double area = roiPolygon.getArea(); +// std::cout << "After normal test ; Index=" << index << " ; area=" << area << " ; clippingFlag=" +// << clippingFlag << std::endl; + if (area < minPolygonAreaThresh) { + isappearing = false; + isvisible = false; + return false; + } + } + + return true; + } + + if (angle < alpha+vpMath::rad(1) ){ + isappearing = true; + } + else if (modulo && (M_PI - angle) < alpha+vpMath::rad(1) ){ + isappearing = true; + } + else { + isappearing = false; + } + + isvisible = false ; + return false ; +} + +//################################### +// Static functions +//################################### + +/*! + Set the flag to consider if the level of detail (LOD) is used or not. + When activated, lines and faces of the 3D model are tracked if respectively their + projected lenght and area in the image are significative enough. By significative, we mean: + - if the lenght of the projected line in the image is greater that a threshold set by + setMinLineLengthThresh() + - if the area of the projected face in the image is greater that a threshold set by + setMinPolygonAreaThresh(). + + \param use_lod : true if level of detail must be used, false otherwise. + + The sample code below shows how to introduce this feature: + \code +#include <visp/vpMbEdgeTracker.h> +#include <visp/vpImageIo.h> + +int main() +{ +vpImage<unsigned char> I; + +// Acquire an image +vpImageIo::read(I, "my-image.pgm"); + +std::string object = "my-object"; +vpMbEdgeTracker tracker; +tracker.loadConfigFile( object+".xml" ); +tracker.loadModel( object+".cao" ); + +tracker.setLod(true); +tracker.setMinLineLengthThresh(20.); +tracker.setMinPolygonAreaThresh(20.*20.); + +tracker.initClick(I, object+".init" ); + +while (true) { + // tracking loop +} +vpXmlParser::cleanup(); + +return 0; +} + \endcode + + \sa setMinLineLengthThresh(), setMinPolygonAreaThresh() + */ +void +vpMbtPolygon::setLod(const bool use_lod) +{ + this->useLod = use_lod; +} + + diff --git a/modules/tracker/me/CMakeLists.txt b/modules/tracker/me/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..726c0a16462f7c4aa20a3e71b819f59d9c2da176 --- /dev/null +++ b/modules/tracker/me/CMakeLists.txt @@ -0,0 +1,42 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +vp_add_module(me visp_core) +vp_glob_module_sources() +vp_module_include_directories() +vp_create_module() +vp_add_tests(DEPENDS_ON visp_io visp_gui) diff --git a/src/tracking/moving-edges/vpMe.h b/modules/tracker/me/include/visp3/me/vpMe.h similarity index 83% rename from src/tracking/moving-edges/vpMe.h rename to modules/tracker/me/include/visp3/me/vpMe.h index d51f7f4116589721fd91a808fbe1cc83e1cdb748..22f35182d85585da83a2c14bab8248f435cfac92 100644 --- a/src/tracking/moving-edges/vpMe.h +++ b/modules/tracker/me/include/visp3/me/vpMe.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMe.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -46,27 +42,20 @@ \brief Moving edges */ -// ==================================================================== -/*! - \class vpMe - \ingroup TrackingImageME - - \brief Contains predetermined masks for sites and holds moving edges - tracking parameters. - -*/ -// ==================================================================== -// Andrew Comport added functionality - replaced points_to_track with -// sample step. - #ifndef vpMe_H #define vpMe_H -#include <visp/vpMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpImage.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpImage.h> +/*! + \class vpMe + \ingroup module_me + This class defines predetermined masks for sites and holds moving edges + tracking parameters. + */ class VISP_EXPORT vpMe { #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS @@ -304,40 +293,6 @@ public: \return Value of threshold. */ inline double getThreshold() const { return threshold; } - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated Attributes - */ -public: - double aberration; - double init_aberration; - - /*! - @name Deprecated Functions - */ - - /*! - \deprecated since it wasn't used.\n \n - Set aberration value. - - \param a : new value. - */ - vp_deprecated void setAberration(const double &a) { aberration = a ; } - - /*! - \deprecated since it wasn't used. \n \n - Set initial aberration value. - - \param a : new value. - */ - vp_deprecated void setInitAberration(const double &a) { init_aberration = a ; } - - /*! - \deprecated Use setMinSampleStep() instead. - */ - vp_deprecated void setMinSamplestep(const double &min) { min_samplestep = min ; } //Little mistake in the method name "step" should be "Step" -#endif }; diff --git a/src/tracking/moving-edges/vpMeEllipse.h b/modules/tracker/me/include/visp3/me/vpMeEllipse.h similarity index 81% rename from src/tracking/moving-edges/vpMeEllipse.h rename to modules/tracker/me/include/visp3/me/vpMeEllipse.h index fff27012ec61fb8b3277c3a23ab94313f5d73fc0..e6290df80e7d0dcf0990407f77c5f469e18de391 100644 --- a/src/tracking/moving-edges/vpMeEllipse.h +++ b/modules/tracker/me/include/visp3/me/vpMeEllipse.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMeEllipse.h 4705 2014-03-27 16:24:35Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -47,22 +43,22 @@ #ifndef vpMeEllipse_HH #define vpMeEllipse_HH -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpColVector.h> -#include <visp/vpMeTracker.h> -#include <visp/vpMeSite.h> -#include <visp/vpImagePoint.h> +#include <visp3/me/vpMeTracker.h> +#include <visp3/me/vpMeSite.h> +#include <visp3/core/vpImagePoint.h> -#include <visp/vpImage.h> -#include <visp/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpColor.h> #include <math.h> #include <list> /*! \class vpMeEllipse - \ingroup TrackingImageME + \ingroup module_me \brief Class that tracks an ellipse moving edges. @@ -95,50 +91,7 @@ \include tutorial-me-ellipse-tracker.cpp - */ -/* - The code below shows how to use this class. -\code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpMeEllipse.h> -#include <visp/vpImagePoint.h> - -int main() -{ - vpImage<unsigned char> I; - - // I is the image containing the ellipse to track - - // Set the moving-edges tracker parameters - vpMe me; - me.setRange(25); - me.setPointsToTrack(20); - me.setThreshold(15000); - me.setSampleStep(10); - - // Initialize the moving-edges ellipse tracker parameters - vpMeEllipse ellipse; - ellipse.setMe(&me); - - // Initialize the tracking. You have to click on five different points belonging to the ellipse. - ellipse.initTracking(I); - - while ( 1 ) - { - // ... Here the code to read or grab the next image. - - // Track the ellipse. - ellipse.track(I); - } - return 0; -} -\endcode - - \note It is possible to display the ellipse as an overlay. For that you - must use the display function of the class vpMeEllipse. */ - class VISP_EXPORT vpMeEllipse : public vpMeTracker { public: @@ -153,7 +106,8 @@ public: void track(const vpImage<unsigned char>& Im); void initTracking(const vpImage<unsigned char> &I) ; - void initTracking(const vpImage<unsigned char> &I, const unsigned int n, vpImagePoint* iP) ; + void initTracking(const vpImage<unsigned char> &I, const unsigned int n, vpImagePoint* iP); + void initTracking(const vpImage<unsigned char> &I, const std::vector<vpImagePoint> &iP); void initTracking(const vpImage<unsigned char> &I, const vpImagePoint &ic, double a_p, double b_p, double e_p, double low_alpha, double high_alpha) ; void display(const vpImage<unsigned char>&I, vpColor col) ; void display(const vpImage<unsigned char>& I) {vpMeTracker::display(I);} //Shouldn't be here since it's already in vpMeTracker @@ -168,21 +122,6 @@ public: unsigned *i, unsigned *j) ; //@} #endif //VISP_BUILD_DEPRECATED_FUNCTIONS - - /*! - Set to true if you are sure to track a circle. - - \warning During all the tracking, the shape must be approximatively a circle and not an ellipse with a strong difference between the majoraxis and the minoraxis. - - In that case, the set of points \f$ (i,j) \f$ satisfy the implicit equation : - - \f[ i^2 + j^2 + 2K_2i + 2K_3j + K4 = 0 \f] - - Compared to the classical equation of an ellipse, \f$ K_0 \f$ is equal to 1 and \f$ K_1 \f$ is equal to 0. - - \param is_circle : Set to true if you want to track a circle. - */ - void setCircle(bool is_circle) { this->circle = is_circle ; } /*! Gets the 0 order moment \f$ m_{00} \f$ which represents the area of the ellipse. @@ -301,8 +240,6 @@ public: } } - - #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS public: #else @@ -350,9 +287,6 @@ protected: double expecteddensity; private: - //! True if the ellipse to track is a circle - bool circle ; - void computeAngle(vpImagePoint pt1, vpImagePoint pt2); void sample(const vpImage<unsigned char>&image); void reSample(const vpImage<unsigned char> &I) ; @@ -372,6 +306,13 @@ private: void computeAngle(int ip1, int jp1,int ip2, int jp2) ; void computeAngle(int ip1, int jp1, double &alpha1, int ip2, int jp2, double &alpha2) ; + /*! + \deprecated This function does nothing and shouldn't be used since we modify + the code to detect automatically if the object to track becomes a circle + rather an ellipse. + */ + vp_deprecated void setCircle(bool ) { } + //@} #endif //VISP_BUILD_DEPRECATED_FUNCTIONS diff --git a/src/tracking/moving-edges/vpMeLine.h b/modules/tracker/me/include/visp3/me/vpMeLine.h similarity index 92% rename from src/tracking/moving-edges/vpMeLine.h rename to modules/tracker/me/include/visp3/me/vpMeLine.h index 3d51adda929a91c67e360cc3c650a3087c751042..99309ba70cf0e2da17f33f269770db5186d02d19 100644 --- a/src/tracking/moving-edges/vpMeLine.h +++ b/modules/tracker/me/include/visp3/me/vpMeLine.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMeLine.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -47,9 +43,9 @@ #ifndef vpMeLine_HH #define vpMeLine_HH -#include <visp/vpMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpMeTracker.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/me/vpMeTracker.h> #include <math.h> #include <iostream> @@ -57,7 +53,7 @@ /*! \class vpMeLine - \ingroup TrackingImageME + \ingroup module_me \brief Class that tracks in an image a line moving edges. @@ -102,10 +98,10 @@ /* The code below shows how to use this class. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpMeLine.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/me/vpMeLine.h> +#include <visp3/core/vpImagePoint.h> int main() { diff --git a/src/tracking/moving-edges/vpMeNurbs.h b/modules/tracker/me/include/visp3/me/vpMeNurbs.h similarity index 88% rename from src/tracking/moving-edges/vpMeNurbs.h rename to modules/tracker/me/include/visp3/me/vpMeNurbs.h index 242a99e2ef5febc319e024722d2a8380ad361945..7ca634498677159f406a2fac95f2a35db3b32bf4 100644 --- a/src/tracking/moving-edges/vpMeNurbs.h +++ b/modules/tracker/me/include/visp3/me/vpMeNurbs.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMeNurbs.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -47,10 +43,10 @@ #ifndef vpMeNurbs_HH #define vpMeNurbs_HH -#include <visp/vpMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpMeTracker.h> -#include <visp/vpNurbs.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/me/vpMeTracker.h> +#include <visp3/me/vpNurbs.h> #include <math.h> #include <iostream> @@ -59,7 +55,7 @@ /*! \class vpMeNurbs - \ingroup TrackingImageME + \ingroup module_me \brief Class that tracks in an image a edge defined by a Nurbs. @@ -70,9 +66,9 @@ The code below shows how to use this class. \code -#include <visp/vpImage.h> -#include <visp/vpMeNurbs.h> -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImage.h> +#include <visp3/me/vpMeNurbs.h> +#include <visp3/core/vpImagePoint.h> int main() { @@ -206,14 +202,6 @@ class VISP_EXPORT vpMeNurbs : public vpMeTracker inline vpNurbs getNurbs() const {return nurbs; } void display(const vpImage<unsigned char>& I, vpColor col) ; - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated functions - */ - vp_deprecated void initTracking(const vpImage<unsigned char> &I, - vpList<vpImagePoint> &ptList) ; -#endif private: bool computeFreemanChainElement(const vpImage<unsigned char> &I, diff --git a/src/tracking/moving-edges/vpMeSite.h b/modules/tracker/me/include/visp3/me/vpMeSite.h similarity index 92% rename from src/tracking/moving-edges/vpMeSite.h rename to modules/tracker/me/include/visp3/me/vpMeSite.h index 31c404893f944bdcbb4c3923d6c050d9bea19593..63d2396d79f8d7672ae0acbaf18f13e715e393ec 100644 --- a/src/tracking/moving-edges/vpMeSite.h +++ b/modules/tracker/me/include/visp3/me/vpMeSite.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMeSite.h 5060 2014-12-12 18:31:03Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -51,14 +47,14 @@ #ifndef vpMeSite_H #define vpMeSite_H -#include <visp/vpMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpMe.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/me/vpMe.h> /*! \class vpMeSite - \ingroup TrackingImageME + \ingroup module_me \brief Performs search in a given direction(normal) for a given distance(pixels) for a given 'site'. Gives the most likely site diff --git a/src/tracking/moving-edges/vpMeTracker.h b/modules/tracker/me/include/visp3/me/vpMeTracker.h similarity index 86% rename from src/tracking/moving-edges/vpMeTracker.h rename to modules/tracker/me/include/visp3/me/vpMeTracker.h index f82162207b47f1425720798f8c6e869ce60a4bc6..289fb844f5c49e3671e07d59dcfdc053e822f71d 100644 --- a/src/tracking/moving-edges/vpMeTracker.h +++ b/modules/tracker/me/include/visp3/me/vpMeTracker.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMeTracker.h 4797 2014-07-23 15:52:28Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -45,29 +41,26 @@ \brief Contains abstract elements for a Distance to Feature type feature. */ -// =================================================================== -/*! - \class vpMeTracker - \ingroup TrackingImageME - \brief Contains abstract elements for a Distance to Feature type feature. - - 2D state = list of points, 3D state = feature - - */ -// =================================================================== - #ifndef vpMeTracker_HH #define vpMeTracker_HH -#include <visp/vpColVector.h> -#include <visp/vpMeSite.h> -#include <visp/vpMe.h> -#include <visp/vpTracker.h> +#include <visp3/core/vpColVector.h> +#include <visp3/me/vpMeSite.h> +#include <visp3/me/vpMe.h> +#include <visp3/core/vpTracker.h> #include <math.h> #include <iostream> #include <list> +/*! + \class vpMeTracker + + \ingroup module_me + \brief Contains abstract elements for a Distance to Feature type feature. + + 2D state = list of points, 3D state = feature +*/ class VISP_EXPORT vpMeTracker : public vpTracker { #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS diff --git a/src/math/spline/vpNurbs.h b/modules/tracker/me/include/visp3/me/vpNurbs.h similarity index 78% rename from src/math/spline/vpNurbs.h rename to modules/tracker/me/include/visp3/me/vpNurbs.h index f0d5fdb674c6fee39d432fb524feb12caa04c6b9..7d95e1790479450d9e6364e4cf41472c5d37fdbb 100644 --- a/src/math/spline/vpNurbs.h +++ b/modules/tracker/me/include/visp3/me/vpNurbs.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpNurbs.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * This class implements the Non Uniform Rational B-Spline (NURBS) * @@ -47,18 +43,18 @@ \brief Class that provides tools to compute and manipulate a Non Uniform Rational B-Spline curve. */ -#include <visp/vpImagePoint.h> -#include <visp/vpMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpMeSite.h> -#include <visp/vpBSpline.h> -#include <visp/vpList.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/me/vpMeSite.h> +#include <visp3/core/vpBSpline.h> +#include <visp3/core/vpList.h> #include <list> /*! \class vpNurbs - \ingroup MathTools + \ingroup module_me \brief Class that provides tools to compute and manipulate a Non Uniform Rational B-Spline curve. @@ -151,41 +147,6 @@ public: void globalCurveApprox(const std::list<vpImagePoint>& l_crossingPoints, unsigned int n); void globalCurveApprox(const std::list<vpMeSite>& l_crossingPoints, unsigned int n); void globalCurveApprox(unsigned int n); - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated functions - */ - /*! - \deprecated This method is deprecated. You should use get_weights(std::list<double> &) const instead. \n \n - Gets all the weights relative to the control points. - - \return list : A list containing weights relative to the control points. - */ - vp_deprecated inline vpList<double> get_weights() const { - vpList<double> list; - for (unsigned int i = 0; i < weights.size(); i++) list.addRight(*(&(weights[0])+i)); - return list; } - - /*! - \deprecated This method is deprecated. You should use set_weights(const std::list<double>&) instead.\n \n - Sets all the knots. - - \param list : A list containing the value of the knots. - */ - vp_deprecated inline void set_weights(vpList<double> &list) { - weights.clear(); - list.front(); - for (unsigned int i = 0; i < list.nbElements(); i++) - { - weights.push_back(list.value()); - list.next(); - } - } - vp_deprecated void globalCurveApprox(vpList<vpImagePoint>& l_crossingPoints, unsigned int n); - vp_deprecated void globalCurveInterp(vpList<vpImagePoint>& l_crossingPoints); - -#endif }; #endif diff --git a/src/tracking/moving-edges/vpMe.cpp b/modules/tracker/me/src/moving-edges/vpMe.cpp similarity index 92% rename from src/tracking/moving-edges/vpMe.cpp rename to modules/tracker/me/src/moving-edges/vpMe.cpp index bdc02643c39ab8c68e36ba78174ba31048f919ef..c75e0cbed3f9dbb9f91341579152891666c51812 100644 --- a/src/tracking/moving-edges/vpMe.cpp +++ b/modules/tracker/me/src/moving-edges/vpMe.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMe.cpp 5060 2014-12-12 18:31:03Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -47,9 +43,9 @@ -#include <visp/vpMe.h> -#include <visp/vpColVector.h> -#include <visp/vpMath.h> +#include <visp3/me/vpMe.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpMath.h> #include <stdlib.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -201,7 +197,7 @@ clipping (point A, point B, // CAS GENERAL (on sait que code_P[0 ou 1] a au moins un bit a 1 - // - clippe le point P[n] qui sort de la fenêtre (coupe Droite i) + // - clippe le point P[n] qui sort de la fenetre (coupe Droite i) // - reboucle avec le nouveau couple de points // ================================================================ if(code_P[0] != 0000) @@ -403,20 +399,12 @@ vpMe::print( ) std::cout<<" Sample step......................"<<sample_step<<" pixels"<<std::endl ; std::cout<<" Strip............................"<<strip<<" pixels "<<std::endl ; std::cout<<" Min_Samplestep..................."<<min_samplestep<<" pixels "<<std::endl ; - - #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - std::cout<<" Aberration......................."<<aberration<< std::endl ; - std::cout<<" init_aberration.................."<<init_aberration<<std::endl ; - #endif } vpMe::vpMe() : threshold(1500), mu1(0.5), mu2(0.5), min_samplestep(4), anglestep(1), mask_sign(0), range(4), sample_step(10), ntotal_sample(0), points_to_track(500), mask_size(5), n_mask(180), strip(2), mask(NULL) -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - , aberration(2), init_aberration(5.) -#endif { //ntotal_sample = 0; // not sure that it is used //points_to_track = 500; // not sure that it is used @@ -429,9 +417,6 @@ vpMe::vpMe(const vpMe &me) : threshold(1500), mu1(0.5), mu2(0.5), min_samplestep(4), anglestep(1), mask_sign(0), range(4), sample_step(10), ntotal_sample(0), points_to_track(500), mask_size(5), n_mask(180), strip(2), mask(NULL) -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - , aberration(2), init_aberration(5.) -#endif { *this = me; } @@ -457,11 +442,6 @@ vpMe& vpMe::operator=(const vpMe &me) points_to_track = me.points_to_track; strip = me.strip ; - #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - aberration = me.aberration ; - init_aberration = me.init_aberration; - #endif - initMask() ; return *this; } diff --git a/src/tracking/moving-edges/vpMeEllipse.cpp b/modules/tracker/me/src/moving-edges/vpMeEllipse.cpp similarity index 73% rename from src/tracking/moving-edges/vpMeEllipse.cpp rename to modules/tracker/me/src/moving-edges/vpMeEllipse.cpp index 2ee89eabfa3326e1a90943cf54da3334babe9cf5..2f82d2ffc6792748ff6c40c525588fea9d337cd5 100644 --- a/src/tracking/moving-edges/vpMeEllipse.cpp +++ b/modules/tracker/me/src/moving-edges/vpMeEllipse.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMeEllipse.cpp 4706 2014-03-28 07:52:00Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -41,18 +37,20 @@ -#include <visp/vpMeEllipse.h> +#include <visp3/me/vpMeEllipse.h> -#include <visp/vpMe.h> -#include <visp/vpRobust.h> -#include <visp/vpTrackingException.h> -#include <visp/vpDebug.h> -#include <visp/vpImagePoint.h> +#include <visp3/me/vpMe.h> +#include <visp3/core/vpRobust.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpDebug.h> #include <cmath> // std::fabs #include <limits> // numeric_limits +#include <vector> void computeTheta(double &theta, vpColVector &K, vpImagePoint iP); + /*! Computes the \f$ \theta \f$ angle which represents the angle between the tangente to the curve and the i axis. @@ -63,7 +61,6 @@ void computeTheta(double &theta, vpColVector &K, vpImagePoint iP); void computeTheta(double &theta, vpColVector &K, vpImagePoint iP) { - double i = iP.get_i(); double j = iP.get_j(); @@ -84,10 +81,8 @@ vpMeEllipse::vpMeEllipse() : K(), iPc(), a(0.), b(0.), e(0.), iP1(), iP2(), alpha1(0), alpha2(2*M_PI), ce(0.), se(0.), angle(), m00(0.), mu11(0.), mu20(0.), mu02(0.), m10(0.), m01(0.), m11(0.), m02(0.), m20(0.), - thresholdWeight(0.2), expecteddensity(0.), circle(false) + thresholdWeight(0.2), expecteddensity(0.) { - vpCDEBUG(1) << "begin vpMeEllipse::vpMeEllipse() " << std::endl ; - // redimensionnement du vecteur de parametre // i^2 + K0 j^2 + 2 K1 i j + 2 K2 i + 2 K3 j + K4 @@ -98,8 +93,6 @@ vpMeEllipse::vpMeEllipse() iP1.set_j(0); iP2.set_i(0); iP2.set_j(0); - - vpCDEBUG(1) << "end vpMeEllipse::vpMeEllipse() " << std::endl ; } /*! @@ -109,7 +102,7 @@ vpMeEllipse::vpMeEllipse(const vpMeEllipse &meellipse) : vpMeTracker(meellipse), K(), iPc(), a(0.), b(0.), e(0.), iP1(), iP2(), alpha1(0), alpha2(2*M_PI), ce(0.), se(0.), angle(), m00(0.), mu11(0.), mu20(0.), mu02(0.), m10(0.), m01(0.), m11(0.), m02(0.), m20(0.), - thresholdWeight(0.2), expecteddensity(0.), circle(false) + thresholdWeight(0.2), expecteddensity(0.) { K = meellipse.K; iPc = meellipse.iPc; @@ -137,7 +130,6 @@ vpMeEllipse::vpMeEllipse(const vpMeEllipse &meellipse) m20 = meellipse.m20; thresholdWeight = meellipse.thresholdWeight; - circle = meellipse.circle; expecteddensity = meellipse.expecteddensity; } @@ -146,12 +138,8 @@ vpMeEllipse::vpMeEllipse(const vpMeEllipse &meellipse) */ vpMeEllipse::~vpMeEllipse() { - vpCDEBUG(1) << "begin vpMeEllipse::~vpMeEllipse() " << std::endl ; - list.clear(); angle.clear(); - - vpCDEBUG(1) << "end vpMeEllipse::~vpMeEllipse() " << std::endl ; } @@ -168,19 +156,14 @@ vpMeEllipse::~vpMeEllipse() void vpMeEllipse::sample(const vpImage<unsigned char> & I) { - vpCDEBUG(1) <<"begin vpMeEllipse::sample() : "<<std::endl ; - if (!me) { - vpDERROR_TRACE(2, "Tracking error: Moving edges not initialized"); - throw(vpTrackingException(vpTrackingException::initializationError, - "Moving edges not initialized")) ; + throw(vpException(vpException::fatalError, + "Moving edges on ellipse tracking not initialized")) ; } int height = (int)I.getHeight() ; int width = (int)I.getWidth() ; - double n_sample; - //if (me->getSampleStep()==0) if (std::fabs(me->getSampleStep()) <= std::numeric_limits<double>::epsilon()) { @@ -245,11 +228,6 @@ vpMeEllipse::sample(const vpImage<unsigned char> & I) } vpMeTracker::initTracking(I) ; - - n_sample = (unsigned int)list.size() ; - - vpCDEBUG(1) << "end vpMeEllipse::sample() : " ; - vpCDEBUG(1) << n_sample << " point inserted in the list " << std::endl ; } @@ -271,9 +249,8 @@ void vpMeEllipse::reSample(const vpImage<unsigned char> &I) { if (!me) { - vpDERROR_TRACE(2, "Tracking error: Moving edges not initialized"); - throw(vpTrackingException(vpTrackingException::initializationError, - "Moving edges not initialized")) ; + throw(vpException(vpException::fatalError, + "Moving edges on ellipse tracking not initialized")) ; } unsigned int n = numberOfSignal() ; @@ -293,7 +270,6 @@ vpMeEllipse::reSample(const vpImage<unsigned char> &I) void vpMeEllipse::getParameters() { - double k[6] ; for (unsigned int i=0 ; i < 5 ; i++) k[i+1] = K[i] ; @@ -305,18 +281,17 @@ vpMeEllipse::getParameters() iPc.set_j( (k[0] * k[4] - k[2] * k[3]) / d ); double sq = sqrt(vpMath::sqr(k[1]-k[0]) + 4.0*vpMath::sqr(k[2])) ; - if (circle ==true) - { - e = 0 ; + + if (std::fabs(k[2]) <= std::numeric_limits<double>::epsilon()) { + e = 0; } - else - { + else { e = (k[1] - k[0] + sq) / (2.0*k[2]); e = (-1/e) ; - - e = atan(e) ; } + e = atan(e) ; + if(e < 0.0) e += M_PI ; ce = cos(e) ; @@ -328,7 +303,6 @@ vpMeEllipse::getParameters() a = sqrt( a2 ) ; b = sqrt( b2 ) ; - } /*! @@ -343,9 +317,10 @@ vpMeEllipse::printParameters() } /*! - Computes the \f$ alpha \f$ angle of the two points and store them into alpha1 for the smallest and alpha2 for the biggest. + Computes the \f$ alpha \f$ counter clockwise angle of the two points and store them into alpha1 for the + smallest and alpha2 for the biggest. - \note this function is useful only during the initialization. + \note This function is useful only during the initialization. \param pt1 : First point whose \f$ alpha \f$ angle is computed. \param pt2 : Second point whose \f$ alpha \f$ angle is computed. @@ -353,7 +328,6 @@ vpMeEllipse::printParameters() void vpMeEllipse::computeAngle(vpImagePoint pt1, vpImagePoint pt2) { - getParameters() ; double j1, i1, j11, i11; j1 = i1 = 0.0 ; @@ -396,17 +370,12 @@ vpMeEllipse::computeAngle(vpImagePoint pt1, vpImagePoint pt2) } k += incr ; } - //std::cout << "end vpMeEllipse::computeAngle(..)" << alpha1 << " " << alpha2 << std::endl ; if (alpha2 < alpha1) alpha2 += 2 * M_PI; //else if (alpha2 == alpha1) else if (std::fabs(alpha2 - alpha1) < std::fabs(alpha1) * std::numeric_limits<double>::epsilon()) alpha2 += 2 * M_PI; - - //std::cout << "end vpMeEllipse::computeAngle(..)" << alpha1 << " " << alpha2 << std::endl ; - - } @@ -468,9 +437,8 @@ void vpMeEllipse::seekExtremities(const vpImage<unsigned char> &I) { if (!me) { - vpDERROR_TRACE(2, "Tracking error: Moving edges not initialized"); - throw(vpTrackingException(vpTrackingException::initializationError, - "Moving edges not initialized")) ; + throw(vpException(vpException::fatalError, + "Moving edges on ellipse tracking not initialized")) ; } int rows = (int)I.getHeight() ; @@ -521,11 +489,11 @@ vpMeEllipse::seekExtremities(const vpImage<unsigned char> &I) } } else { - if (vpDEBUG_ENABLE(3)) { - ip.set_i( P.i ); - ip.set_j( P.j ); - vpDisplay::displayCross(I, ip, 10, vpColor::blue) ; - } + if (vpDEBUG_ENABLE(3)) { + ip.set_i( P.i ); + ip.set_j( P.j ); + vpDisplay::displayCross(I, ip, 10, vpColor::blue) ; + } } } } @@ -627,7 +595,7 @@ void vpMeEllipse::leastSquare() { // Construction du systeme Ax=b - //! i^2 + K0 j^2 + 2 K1 i j + 2 K2 i + 2 K3 j + K4 + // i^2 + K0 j^2 + 2 K1 i j + 2 K2 i + 2 K3 j + K4 // A = (j^2 2ij 2i 2j 1) x = (K0 K1 K2 K3 K4)^T b = (-i^2 ) unsigned int i ; @@ -639,7 +607,7 @@ vpMeEllipse::leastSquare() r.setThreshold(2); r.setIteration(0) ; vpMatrix D(numberOfSignal(),numberOfSignal()) ; - D.setIdentity() ; + D.eye() ; vpMatrix DA, DAmemory ; vpColVector DAx ; vpColVector w(numberOfSignal()) ; @@ -648,128 +616,67 @@ vpMeEllipse::leastSquare() if (list.size() < 3) { - vpERROR_TRACE("Not enough point") ; - throw(vpTrackingException(vpTrackingException::notEnoughPointError, - "not enough point")) ; + throw(vpException(vpException::dimensionError, + "Not enought moving edges to track the ellipse")) ; } - if (circle ==false) - { - vpMatrix A(numberOfSignal(),5) ; - vpColVector x(5); - - unsigned int k =0 ; - for(std::list<vpMeSite>::const_iterator it=list.begin(); it!=list.end(); ++it){ - p_me = *it; - if (p_me.getState() == vpMeSite::NO_SUPPRESSION) - { - A[k][0] = vpMath::sqr(p_me.jfloat) ; - A[k][1] = 2 * p_me.ifloat * p_me.jfloat ; - A[k][2] = 2 * p_me.ifloat ; - A[k][3] = 2 * p_me.jfloat ; - A[k][4] = 1 ; - - b_[k] = - vpMath::sqr(p_me.ifloat) ; - k++ ; - } - } + vpMatrix A(numberOfSignal(),5) ; + vpColVector x(5); - while (iter < 4 ) + unsigned int k =0 ; + for(std::list<vpMeSite>::const_iterator it=list.begin(); it!=list.end(); ++it){ + p_me = *it; + if (p_me.getState() == vpMeSite::NO_SUPPRESSION) { - DA = D*A ; - vpMatrix DAp ; - - x = DA.pseudoInverse(1e-26) *D*b_ ; - - vpColVector residu(nos_1); - residu = b_ - A*x; - r.setIteration(iter) ; - r.MEstimator(vpRobust::TUKEY,residu,w) ; + A[k][0] = vpMath::sqr(p_me.jfloat) ; + A[k][1] = 2 * p_me.ifloat * p_me.jfloat ; + A[k][2] = 2 * p_me.ifloat ; + A[k][3] = 2 * p_me.jfloat ; + A[k][4] = 1 ; - k = 0; - for (i=0 ; i < nos_1 ; i++) - { - D[k][k] =w[k] ; - k++; - } - iter++; + b_[k] = - vpMath::sqr(p_me.ifloat) ; + k++ ; } - - k =0 ; - for(std::list<vpMeSite>::iterator it=list.begin(); it!=list.end(); ++it){ - p_me = *it; - if (p_me.getState() == vpMeSite::NO_SUPPRESSION) - { - if (w[k] < thresholdWeight) - { - p_me.setState(vpMeSite::M_ESTIMATOR); - - *it = p_me; - } - k++ ; - } - } - for(i = 0; i < 5; i ++) - K[i] = x[i]; } - - else + + while (iter < 4 ) { - vpMatrix A(numberOfSignal(),3) ; - vpColVector x(3); + DA = D*A ; + vpMatrix DAp ; - unsigned int k =0 ; - for(std::list<vpMeSite>::const_iterator it=list.begin(); it!=list.end(); ++it){ - p_me = *it; - if (p_me.getState() == vpMeSite::NO_SUPPRESSION) - { - A[k][0] = 2* p_me.ifloat ; - A[k][1] = 2 * p_me.jfloat ; - A[k][2] = 1 ; + x = DA.pseudoInverse(1e-26) *D*b_ ; - b_[k] = - vpMath::sqr(p_me.ifloat) - vpMath::sqr(p_me.jfloat) ; - k++ ; - } - } + vpColVector residu(nos_1); + residu = b_ - A*x; + r.setIteration(iter) ; + r.MEstimator(vpRobust::TUKEY,residu,w) ; - while (iter < 4 ) + k = 0; + for (i=0 ; i < nos_1 ; i++) { - DA = D*A ; - vpMatrix DAp ; - - x = DA.pseudoInverse(1e-26) *D*b_ ; - - vpColVector residu(nos_1); - residu = b_ - A*x; - r.setIteration(iter) ; - r.MEstimator(vpRobust::TUKEY,residu,w) ; - - k = 0; - for (i=0 ; i < nos_1 ; i++) - { - D[k][k] =w[k]; - k++; - } - iter++; + D[k][k] =w[k] ; + k++; } + iter++; + } - k =0 ; - for(std::list<vpMeSite>::iterator it=list.begin(); it!=list.end(); ++it){ - p_me = *it; - if (p_me.getState() == vpMeSite::NO_SUPPRESSION) + k =0 ; + for(std::list<vpMeSite>::iterator it=list.begin(); it!=list.end(); ++it){ + p_me = *it; + if (p_me.getState() == vpMeSite::NO_SUPPRESSION) + { + if (w[k] < thresholdWeight) { - if (w[k] < thresholdWeight) - { - p_me.setState(vpMeSite::M_ESTIMATOR); - - *it = p_me; - } - k++ ; + p_me.setState(vpMeSite::M_ESTIMATOR); + + *it = p_me; } + k++ ; } - for(i = 0; i < 3; i ++) - K[i+2] = x[i]; } + for(i = 0; i < 5; i ++) + K[i] = x[i]; + getParameters() ; } @@ -791,28 +698,28 @@ vpMeEllipse::display(const vpImage<unsigned char> &I, vpColor col) /*! - Initilization of the tracking. Ask the user to click on five points - from the ellipse edge to track. + Initilization of the tracking. Ask the user to click counter clockwise on five points + located on the ellipse edge to track. + + \warning The points should be selected counter clockwise. \param I : Image in which the ellipse appears. */ void vpMeEllipse::initTracking(const vpImage<unsigned char> &I) { - vpCDEBUG(1) <<" begin vpMeEllipse::initTracking()"<<std::endl ; - const unsigned int n=5 ; vpImagePoint iP[n]; for (unsigned int k =0 ; k < n ; k++) - { - std::cout << "Click points "<< k+1 <<"/" << n ; - std::cout << " on the ellipse in the trigonometric order" <<std::endl ; - vpDisplay::getClick(I, iP[k], true); - vpDisplay::displayCross(I, iP[k], 7, vpColor::red); - vpDisplay::flush(I); - std::cout << iP[k] << std::endl; - } + { + std::cout << "Click points "<< k+1 <<"/" << n ; + std::cout << " on the ellipse in the trigonometric order" <<std::endl ; + vpDisplay::getClick(I, iP[k], true); + vpDisplay::displayCross(I, iP[k], 7, vpColor::red); + vpDisplay::flush(I); + std::cout << iP[k] << std::endl; + } iP1 = iP[0]; iP2 = iP[n-1]; @@ -825,98 +732,111 @@ vpMeEllipse::initTracking(const vpImage<unsigned char> &I) Initialization of the tracking. The ellipse is defined thanks to the coordinates of n points. - \warning It is better to use at least five points to well estimate the K parameters. + \warning It is better to use at least five points to well estimate the ellipse parameters. + \warning The n points should be selected counter clockwise. \param I : Image in which the ellipse appears. \param n : The number of points in the list. - \param iP : A pointer to a list of pointsbelonging to the ellipse edge. + \param iP : A pointer to a list of points belonging to the ellipse edge. */ void vpMeEllipse::initTracking(const vpImage<unsigned char> &I, const unsigned int n, - vpImagePoint *iP) + vpImagePoint *iP) { - vpCDEBUG(1) <<" begin vpMeEllipse::initTracking()"<<std::endl ; + vpMatrix A(n,5) ; + vpColVector b_(n) ; + vpColVector x(5) ; + + // Construction du systeme Ax=b + // i^2 + K0 j^2 + 2 K1 i j + 2 K2 i + 2 K3 j + K4 + // A = (j^2 2ij 2i 2j 1) x = (K0 K1 K2 K3 K4)^T b = (-i^2 ) - if (circle==false) + for (unsigned int k =0 ; k < n ; k++) { - vpMatrix A(n,5) ; - vpColVector b_(n) ; - vpColVector x(5) ; + A[k][0] = vpMath::sqr(iP[k].get_j()) ; + A[k][1] = 2* iP[k].get_i() * iP[k].get_j() ; + A[k][2] = 2* iP[k].get_i() ; + A[k][3] = 2* iP[k].get_j() ; + A[k][4] = 1 ; - // Construction du systeme Ax=b - //! i^2 + K0 j^2 + 2 K1 i j + 2 K2 i + 2 K3 j + K4 - // A = (j^2 2ij 2i 2j 1) x = (K0 K1 K2 K3 K4)^T b = (-i^2 ) + b_[k] = - vpMath::sqr(iP[k].get_i()) ; + } - for (unsigned int k =0 ; k < n ; k++) - { - A[k][0] = vpMath::sqr(iP[k].get_j()) ; - A[k][1] = 2* iP[k].get_i() * iP[k].get_j() ; - A[k][2] = 2* iP[k].get_i() ; - A[k][3] = 2* iP[k].get_j() ; - A[k][4] = 1 ; + K = A.pseudoInverse(1e-26)*b_ ; - b_[k] = - vpMath::sqr(iP[k].get_i()) ; - } + iP1 = iP[0]; + iP2 = iP[n-1]; - K = A.pseudoInverse(1e-26)*b_ ; - std::cout << K << std::endl; - } - else - { - vpMatrix A(n,3) ; - vpColVector b_(n) ; - vpColVector x(3) ; + getParameters() ; - vpColVector Kc(3) ; - for (unsigned int k =0 ; k < n ; k++) - { - A[k][0] = 2* iP[k].get_i() ; - A[k][1] = 2* iP[k].get_j() ; - A[k][2] = 1 ; + computeAngle(iP1, iP2) ; - b_[k] = - vpMath::sqr(iP[k].get_i()) - vpMath::sqr(iP[k].get_j()) ; - } + expecteddensity = (alpha2-alpha1) / vpMath::rad((double)me->getSampleStep()); - Kc = A.pseudoInverse(1e-26)*b_ ; - K[0] = 1 ; - K[1] = 0 ; - K[2] = Kc[0] ; - K[3] = Kc[1] ; - K[4] = Kc[2] ; + display(I, vpColor::green) ; + sample(I) ; - std::cout << K << std::endl; + vpMeTracker::initTracking(I) ; + + track(I) ; + + vpMeTracker::display(I) ; + vpDisplay::flush(I) ; +} + +/*! + Initialization of the tracking. The ellipse is defined thanks to a vector of + n points. + + \warning It is better to use at least five points to well estimate the ellipse parameters. + \warning The n points should be selected counter clockwise. + + \param I : Image in which the ellipse appears. + \param iP : A vector of points belonging to the ellipse edge used to initialize the tracking. +*/ +void +vpMeEllipse::initTracking(const vpImage<unsigned char> &I, const std::vector<vpImagePoint> &iP) +{ + unsigned int n = (unsigned int)(iP.size()); + vpMatrix A(n,5) ; + vpColVector b_(n) ; + vpColVector x(5) ; + + // Construction du systeme Ax=b + // i^2 + K0 j^2 + 2 K1 i j + 2 K2 i + 2 K3 j + K4 + // A = (j^2 2ij 2i 2j 1) x = (K0 K1 K2 K3 K4)^T b = (-i^2 ) + + for (unsigned int k =0 ; k < n ; k++) + { + A[k][0] = vpMath::sqr(iP[k].get_j()) ; + A[k][1] = 2* iP[k].get_i() * iP[k].get_j() ; + A[k][2] = 2* iP[k].get_i() ; + A[k][3] = 2* iP[k].get_j() ; + A[k][4] = 1 ; + + b_[k] = - vpMath::sqr(iP[k].get_i()) ; } + K = A.pseudoInverse(1e-26)*b_ ; + iP1 = iP[0]; iP2 = iP[n-1]; getParameters() ; - std::cout << "vpMeEllipse::initTracking() ellipse avant: " << iPc << " " << a << " " << b << " " << vpMath::deg(e) << " alpha: " << alpha1 << " " << alpha2 << std::endl; computeAngle(iP1, iP2) ; - std::cout << "vpMeEllipse::initTracking() ellipse apres: " << iPc << " " << a << " " << b << " " << vpMath::deg(e) << " alpha: " << alpha1 << " " << alpha2 << std::endl; expecteddensity = (alpha2-alpha1) / vpMath::rad((double)me->getSampleStep()); display(I, vpColor::green) ; sample(I) ; - // 2. On appelle ce qui n'est pas specifique - { - vpMeTracker::initTracking(I) ; - } + vpMeTracker::initTracking(I) ; + + track(I) ; - try{ - track(I) ; - } - catch(...) - { - vpERROR_TRACE("Error caught") ; - throw ; - } vpMeTracker::display(I) ; vpDisplay::flush(I) ; - } void @@ -936,26 +856,13 @@ vpMeEllipse::initTracking(const vpImage<unsigned char> &I, const vpImagePoint &i ce = cos(e); se = sin(e); -// vpDisplay::displayEllipse(I, iPc, a, b, e, 0, vpMath::rad(360), vpColor::red, 2); // TODO remove debug only display(I, vpColor::green) ; -// vpDisplay::flush(I); // TODO remove debug only -// std::cout << "wait click" << std::endl; -// vpDisplay::getClick(I); // TODO remove debug only sample(I) ; - // 2. On appelle ce qui n'est pas specifique - { - vpMeTracker::initTracking(I) ; - } + vpMeTracker::initTracking(I) ; + + track(I) ; - try{ - track(I) ; - } - catch(...) - { - vpERROR_TRACE("Error caught") ; - throw ; - } vpMeTracker::display(I) ; vpDisplay::flush(I) ; } @@ -968,109 +875,39 @@ vpMeEllipse::initTracking(const vpImage<unsigned char> &I, const vpImagePoint &i void vpMeEllipse::track(const vpImage<unsigned char> &I) { - vpCDEBUG(1) <<"begin vpMeEllipse::track()"<<std::endl ; - - static int iter =0 ; - // 1. On fait ce qui concerne les ellipse (peut etre vide) - { - } - - //vpDisplay::display(I) ; - // 2. On appelle ce qui n'est pas specifique - { - - try{ - vpMeTracker::track(I) ; - } - catch(...) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - // std::cout << "number of signals " << numberOfSignal() << std::endl ; - } - - // 3. On revient aux ellipses - { - // Estimation des parametres de la droite aux moindres carre - suppressPoints() ; - setExtremities() ; + vpMeTracker::track(I) ; + // Estimation des parametres de la droite aux moindres carre + suppressPoints() ; + setExtremities() ; - try{ - leastSquare() ; } - catch(...) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - - seekExtremities(I) ; - - setExtremities() ; - - try - { - leastSquare() ; - } - catch(...) - { - vpERROR_TRACE("Error caught") ; - throw ; - } + leastSquare() ; + seekExtremities(I) ; + setExtremities() ; + leastSquare() ; - // suppression des points rejetes par la regression robuste - suppressPoints() ; - setExtremities() ; + // suppression des points rejetes par la regression robuste + suppressPoints() ; + setExtremities() ; - //reechantillonage si necessaire - reSample(I) ; + //reechantillonage si necessaire + reSample(I) ; - // remet a jour l'angle delta pour chaque point de la liste + // remet a jour l'angle delta pour chaque point de la liste - updateTheta() ; - - computeMoments(); + updateTheta() ; - // Remise a jour de delta dans la liste de site me - if (vpDEBUG_ENABLE(2)) - { - display(I,vpColor::red) ; - vpMeTracker::display(I) ; - vpDisplay::flush(I) ; - } -// computeAngle(iP1, iP2) ; -// -// if (iter%5==0) -// { -// sample(I) ; -// try{ -// leastSquare() ; } -// catch(...) -// { -// vpERROR_TRACE("Error caught") ; -// throw ; -// } -// computeAngle(iP1, iP2) ; -// } -// seekExtremities(I) ; -// -// vpMeTracker::display(I) ; -// // vpDisplay::flush(I) ; -// -// // remet a jour l'angle theta pour chaque point de la liste -// updateTheta() ; + computeMoments(); + // Remise a jour de delta dans la liste de site me + if (vpDEBUG_ENABLE(2)) + { + display(I,vpColor::red) ; + vpMeTracker::display(I) ; + vpDisplay::flush(I) ; } - - iter++ ; - - - vpCDEBUG(1) << "end vpMeEllipse::track()"<<std::endl ; - } - /*! Computes the 0 order moment \f$ m_{00} \f$ which represents the area of the ellipse. @@ -1091,13 +928,6 @@ vpMeEllipse::computeMoments() mu20 = m20 - iPc.get_i()*m10; } - - - - - - - #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS /*! @@ -1107,7 +937,6 @@ void vpMeEllipse::computeAngle(int ip1, int jp1, double &_alpha1, int ip2, int jp2, double &_alpha2) { - getParameters() ; double j1, i1, j11, i11; j1 = i1 = 0.0 ; @@ -1172,7 +1001,8 @@ vpMeEllipse::initTracking(const vpImage<unsigned char> &I, const unsigned int n, { vpCDEBUG(1) <<" begin vpMeEllipse::initTracking()"<<std::endl ; - if (circle==false) + //if (circle==false) + if (1) { vpMatrix A(n,5) ; vpColVector b_(n) ; diff --git a/src/tracking/moving-edges/vpMeLine.cpp b/modules/tracker/me/src/moving-edges/vpMeLine.cpp similarity index 98% rename from src/tracking/moving-edges/vpMeLine.cpp rename to modules/tracker/me/src/moving-edges/vpMeLine.cpp index 338fea347bb2e6cd15167165258a92496c705123..1c5bf30e88a96a9ccdda9fd5f500e0313e380bca 100644 --- a/src/tracking/moving-edges/vpMeLine.cpp +++ b/modules/tracker/me/src/moving-edges/vpMeLine.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMeLine.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -47,14 +43,14 @@ -#include <visp/vpMeTracker.h> -#include <visp/vpMe.h> -#include <visp/vpMeSite.h> -#include <visp/vpMeLine.h> -#include <visp/vpRobust.h> -#include <visp/vpTrackingException.h> -#include <visp/vpImagePoint.h> -#include <visp/vpMath.h> +#include <visp3/me/vpMeTracker.h> +#include <visp3/me/vpMe.h> +#include <visp3/me/vpMeSite.h> +#include <visp3/me/vpMeLine.h> +#include <visp3/core/vpRobust.h> +#include <visp3/core/vpTrackingException.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpMath.h> #include <stdlib.h> #include <cmath> // std::fabs #include <limits> // numeric_limits @@ -301,7 +297,7 @@ vpMeLine::leastSquare() r.setThreshold(2); r.setIteration(0) ; vpMatrix D(numberOfSignal(),numberOfSignal()) ; - D.setIdentity() ; + D.eye() ; vpMatrix DA, DAmemory ; vpColVector DAx ; vpColVector w(numberOfSignal()) ; diff --git a/src/tracking/moving-edges/vpMeNurbs.cpp b/modules/tracker/me/src/moving-edges/vpMeNurbs.cpp similarity index 96% rename from src/tracking/moving-edges/vpMeNurbs.cpp rename to modules/tracker/me/src/moving-edges/vpMeNurbs.cpp index 568561940b35712fd364b7efeb581b9de75686e8..882501327e7799f7be32054a1fbee4783eb0251a 100644 --- a/src/tracking/moving-edges/vpMeNurbs.cpp +++ b/modules/tracker/me/src/moving-edges/vpMeNurbs.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMeNurbs.cpp 5060 2014-12-12 18:31:03Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -45,18 +41,18 @@ \brief Moving edges */ -#include <visp/vpMeTracker.h> -#include <visp/vpMe.h> -#include <visp/vpMeSite.h> -#include <visp/vpMeNurbs.h> -#include <visp/vpRobust.h> -#include <visp/vpTrackingException.h> -#include <visp/vpImagePoint.h> -#include <visp/vpMath.h> -#include <visp/vpRect.h> -#include <visp/vpImageTools.h> -#include <visp/vpImageConvert.h> -#include <visp/vpImageFilter.h> +#include <visp3/me/vpMeTracker.h> +#include <visp3/me/vpMe.h> +#include <visp3/me/vpMeSite.h> +#include <visp3/me/vpMeNurbs.h> +#include <visp3/core/vpRobust.h> +#include <visp3/core/vpTrackingException.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRect.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpImageFilter.h> #include <stdlib.h> #include <cmath> // std::fabs #include <limits> // numeric_limits @@ -292,34 +288,6 @@ vpMeNurbs::initTracking(const vpImage<unsigned char> &I) throw (vpException(vpException::notInitialized,"Not enough points to initialize the Nurbs")); } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated You should use initTracking(const vpImage<unsigned char> &, const std::list<vpImagePoint> &) instead. - - Initialization of the tracking. The Nurbs is initialized thanks to the - list of vpImagePoint. - - - \param I : Image in which the edge appears. - \param ptList : List of point to initialize the Nurbs. -*/ -vp_deprecated void -vpMeNurbs::initTracking(const vpImage<unsigned char> &I, - vpList<vpImagePoint> &ptList) -{ - std::list<vpImagePoint> listStd; - for(ptList.front(); !ptList.outside(); ptList.next()){ - listStd.push_back(ptList.value()); - } - nurbs.globalCurveInterp(listStd); - - sample(I); - - vpMeTracker::initTracking(I) ; - track(I); -} -#endif - /*! Initialization of the tracking. The Nurbs is initialized thanks to the list of vpImagePoint. @@ -1071,6 +1039,9 @@ vpMeNurbs::track(const vpImage<unsigned char> &I) //Suppressions des points ejectes par le tracking suppressPoints(); + if (list.size() == 1) + throw(vpTrackingException(vpTrackingException::notEnoughPointError, "Not enough valid me to track")); + //Recalcule les parametres // nurbs.globalCurveInterp(list); nurbs.globalCurveApprox(list,nbControlPoints); diff --git a/src/tracking/moving-edges/vpMeSite.cpp b/modules/tracker/me/src/moving-edges/vpMeSite.cpp similarity index 97% rename from src/tracking/moving-edges/vpMeSite.cpp rename to modules/tracker/me/src/moving-edges/vpMeSite.cpp index 5b87a50f5894464924c69e1d0bdfdaf71c11c4da..2f1cbd2619885798ecd7b1eb73ef16d313210393 100644 --- a/src/tracking/moving-edges/vpMeSite.cpp +++ b/modules/tracker/me/src/moving-edges/vpMeSite.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpMeSite.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Moving edges. * @@ -48,13 +44,13 @@ -#include <visp/vpMeSite.h> -#include <visp/vpMe.h> -#include <visp/vpTrackingException.h> +#include <visp3/me/vpMeSite.h> +#include <visp3/me/vpMe.h> +#include <visp3/core/vpTrackingException.h> #include <stdlib.h> #include <cmath> // std::fabs #include <limits> // numeric_limits -#include "vpMeSite.h" +#include <visp3/me/vpMeSite.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/tracking/moving-edges/vpMeTracker.cpp b/modules/tracker/me/src/moving-edges/vpMeTracker.cpp similarity index 84% rename from src/tracking/moving-edges/vpMeTracker.cpp rename to modules/tracker/me/src/moving-edges/vpMeTracker.cpp index 895f95f8556b3469b5302473e9af6d6797ca53fe..433ca5b6cfd676f8ac9e729402cfe4ff7c67b2c8 100644 --- a/src/tracking/moving-edges/vpMeTracker.cpp +++ b/modules/tracker/me/src/moving-edges/vpMeTracker.cpp @@ -1,43 +1,39 @@ /**************************************************************************** -* -* $Id: vpMeTracker.cpp 4797 2014-07-23 15:52:28Z fspindle $ -* -* This file is part of the ViSP software. -* Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -* -* This software is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* ("GPL") version 2 as published by the Free Software Foundation. -* See the file LICENSE.txt at the root directory of this source -* distribution for additional information about the GNU GPL. -* -* For using ViSP with software that can not be combined with the GNU -* GPL, please contact INRIA about acquiring a ViSP Professional -* Edition License. -* -* See http://www.irisa.fr/lagadic/visp/visp.html for more information. -* -* This software was developed at: -* INRIA Rennes - Bretagne Atlantique -* Campus Universitaire de Beaulieu -* 35042 Rennes Cedex -* France -* http://www.irisa.fr/lagadic -* -* If you have questions regarding the use of this file, please contact -* INRIA at visp@inria.fr -* -* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -* -* -* Description: -* Moving edges. -* -* Authors: -* Andrew Comport -* -*****************************************************************************/ + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Moving edges. + * + * Authors: + * Andrew Comport + * + *****************************************************************************/ /*! \file vpMeTracker.cpp @@ -46,12 +42,12 @@ -#include <visp/vpMeTracker.h> -#include <visp/vpDisplay.h> -#include <visp/vpColor.h> +#include <visp3/me/vpMeTracker.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpColor.h> -#include <visp/vpTrackingException.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpTrackingException.h> +#include <visp3/core/vpDebug.h> #include <algorithm> #define DEBUG_LEVEL1 0 diff --git a/src/math/spline/vpNurbs.cpp b/modules/tracker/me/src/moving-edges/vpNurbs.cpp similarity index 94% rename from src/math/spline/vpNurbs.cpp rename to modules/tracker/me/src/moving-edges/vpNurbs.cpp index 63ba0d0b7d040867907b2b410f232d5712f7c398..a9a4a48fccf925d71aa34d41bb1264dd157f552e 100644 --- a/src/math/spline/vpNurbs.cpp +++ b/modules/tracker/me/src/moving-edges/vpNurbs.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpNurbs.cpp 5235 2015-01-30 13:51:21Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * This class implements the Non Uniform Rational B-Spline (NURBS) * @@ -41,8 +37,8 @@ -#include <visp/vpNurbs.h> -#include <visp/vpColVector.h> +#include <visp3/me/vpNurbs.h> +#include <visp3/core/vpColVector.h> #include <cmath> // std::fabs #include <limits> // numeric_limits /* @@ -1084,51 +1080,3 @@ void vpNurbs::globalCurveApprox(unsigned int n) globalCurveApprox(crossingPoints, p, n, knots, controlPoints, weights); } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated. You should use globalCurveInterp(const std::list<vpImagePoint> &) instead. - - Method which enables to compute a NURBS curve passing through a set of data points. - - The result of the method is composed by a knot vector, a set of control points and a set of associated weights. - - \param l_crossingPoints : The list of data points which have to be interpolated. -*/ -void vpNurbs::globalCurveInterp(vpList<vpImagePoint> &l_crossingPoints) -{ - std::vector<vpImagePoint> v_crossingPoints; - l_crossingPoints.front(); - while(!l_crossingPoints.outside()) - { - v_crossingPoints.push_back(l_crossingPoints.value()); - l_crossingPoints.next(); - } - globalCurveInterp(v_crossingPoints, p, knots, controlPoints, weights); -} - -/*! - \deprecated This method is deprecated. You should use globalCurveApprox(const std::list<vpImagePoint> &, unsigned int) instead. - - Method which enables to compute a NURBS curve approximating a set of data points. - - The data points are approximated thanks to a least square method. - - The result of the method is composed by a knot vector, a set of control points and a set of associated weights. - - \param l_crossingPoints : The list of data points which have to be interpolated. - \param n : The desired number of control points. The parameter \e n must be under or equal to the number of data points. -*/ -void vpNurbs::globalCurveApprox(vpList<vpImagePoint> &l_crossingPoints, unsigned int n) -{ - std::vector<vpImagePoint> v_crossingPoints; - l_crossingPoints.front(); - while(!l_crossingPoints.outside()) - { - v_crossingPoints.push_back(l_crossingPoints.value()); - l_crossingPoints.next(); - } - globalCurveApprox(v_crossingPoints, p, n, knots, controlPoints, weights); -} - -#endif - diff --git a/example/math/Nurbs.cpp b/modules/tracker/me/test/testNurbs.cpp similarity index 91% rename from example/math/Nurbs.cpp rename to modules/tracker/me/test/testNurbs.cpp index 1bd00c58da491c34e9d6c12a872e9e561992f3b3..5204657f16156a39fff642b04de3a0e51a759e93 100644 --- a/example/math/Nurbs.cpp +++ b/modules/tracker/me/test/testNurbs.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: Nurbs.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exemple of a Nurbs curve. * @@ -39,36 +35,30 @@ * *****************************************************************************/ /*! - \file Nurbs.cpp + \example testNurbs.cpp \brief Describe a curve thanks to a Nurbs. */ -/*! - \example Nurbs.cpp - - Describe a curve thanks to a BSpline. -*/ - +#include <visp3/core/vpDebug.h> +#include <visp3/me/vpNurbs.h> -#include <visp/vpDebug.h> - -#include <visp/vpNurbs.h> - -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> // Should be after #include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayX.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImagePoint.h> +#ifdef VISP_HAVE_MODULE_GUI +# include <visp3/gui/vpDisplayGTK.h> +# include <visp3/gui/vpDisplayGDI.h> +# include <visp3/gui/vpDisplayOpenCV.h> +# include <visp3/gui/vpDisplayD3D.h> +# include <visp3/gui/vpDisplayX.h> +#endif -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/core/vpIoTools.h> #include <cstdlib> -#if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV) || defined(VISP_HAVE_D3D9) +#if defined(VISP_HAVE_DISPLAY) // List of allowed command line options #define GETOPTARGS "cdh" diff --git a/modules/tracker/tt/CMakeLists.txt b/modules/tracker/tt/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..1bb195f006cae84270b096123aa75d36ddb92c6f --- /dev/null +++ b/modules/tracker/tt/CMakeLists.txt @@ -0,0 +1,41 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +vp_add_module(tt visp_vision visp_core) +vp_glob_module_sources() +vp_module_include_directories() +vp_create_module() diff --git a/src/tracking/template-tracker/vpTemplateTracker.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTracker.h similarity index 74% rename from src/tracking/template-tracker/vpTemplateTracker.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTracker.h index cac7730fb2b84b76f25449e4509cc077dfd823c1..370fdca673738127d10a9f3c28aadb93e35e7c19 100644 --- a/src/tracking/template-tracker/vpTemplateTracker.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTracker.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTracker.h 5113 2015-01-05 08:00:50Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -49,11 +46,15 @@ #include <math.h> -#include <visp/vpTemplateTrackerHeader.h> -#include <visp/vpTemplateTrackerZone.h> -#include <visp/vpTemplateTrackerWarp.h> -#include <visp/vpImageFilter.h> +#include <visp3/tt/vpTemplateTrackerHeader.h> +#include <visp3/tt/vpTemplateTrackerZone.h> +#include <visp3/tt/vpTemplateTrackerWarp.h> +#include <visp3/core/vpImageFilter.h> +/*! + \class vpTemplateTracker + \ingroup group_tt_tracker +*/ class VISP_EXPORT vpTemplateTracker { protected: @@ -133,7 +134,44 @@ class VISP_EXPORT vpTemplateTracker vpImage<double> dIy ; vpTemplateTrackerZone zoneRef_; // Reference zone +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpTemplateTracker(const vpTemplateTracker &) +// : nbLvlPyr(0), l0Pyr(0), pyrInitialised(false), ptTemplate(NULL), ptTemplatePyr(NULL), +// ptTemplateInit(false), templateSize(0), templateSizePyr(NULL), ptTemplateSelect(NULL), +// ptTemplateSelectPyr(NULL), ptTemplateSelectInit(false), templateSelectSize(0), +// ptTemplateSupp(NULL), ptTemplateSuppPyr(NULL), ptTemplateCompo(NULL), ptTemplateCompoPyr(NULL), +// zoneTracked(NULL), zoneTrackedPyr(NULL), pyr_IDes(NULL), H(), Hdesire(), HdesirePyr(NULL), +// HLM(), HLMdesire(), HLMdesirePyr(NULL), HLMdesireInverse(), HLMdesireInversePyr(NULL), +// G(), gain(0), thresholdGradient(0), costFunctionVerification(false), +// blur(false), useBrent(false), nbIterBrent(0), taillef(0), fgG(NULL), fgdG(NULL), +// ratioPixelIn(0), mod_i(0), mod_j(0), nbParam(), lambdaDep(0), iterationMax(0), +// iterationGlobale(0), diverge(false), nbIteration(0), useCompositionnal(false), +// useInverse(false), Warp(NULL), p(), dp(), X1(), X2(), dW(), BI(), dIx(), dIy(), zoneRef_() +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpTemplateTracker &operator=(const vpTemplateTracker &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: + //! Default constructor. + vpTemplateTracker() + : nbLvlPyr(0), l0Pyr(0), pyrInitialised(false), ptTemplate(NULL), ptTemplatePyr(NULL), + ptTemplateInit(false), templateSize(0), templateSizePyr(NULL), ptTemplateSelect(NULL), + ptTemplateSelectPyr(NULL), ptTemplateSelectInit(false), templateSelectSize(0), + ptTemplateSupp(NULL), ptTemplateSuppPyr(NULL), ptTemplateCompo(NULL), ptTemplateCompoPyr(NULL), + zoneTracked(NULL), zoneTrackedPyr(NULL), pyr_IDes(NULL), H(), Hdesire(), HdesirePyr(NULL), + HLM(), HLMdesire(), HLMdesirePyr(NULL), HLMdesireInverse(), HLMdesireInversePyr(NULL), + G(), gain(0), thresholdGradient(0), costFunctionVerification(false), + blur(false), useBrent(false), nbIterBrent(0), taillef(0), fgG(NULL), fgdG(NULL), + ratioPixelIn(0), mod_i(0), mod_j(0), nbParam(), lambdaDep(0), iterationMax(0), + iterationGlobale(0), diverge(false), nbIteration(0), useCompositionnal(false), + useInverse(false), Warp(NULL), p(), dp(), X1(), X2(), dW(), BI(), dIx(), dIy(), zoneRef_() + {} vpTemplateTracker(vpTemplateTrackerWarp *_warp); virtual ~vpTemplateTracker(); @@ -218,7 +256,7 @@ class VISP_EXPORT vpTemplateTracker protected: void computeOptimalBrentGain(const vpImage<unsigned char> &I,vpColVector &tp,double tMI,vpColVector &direction,double &alpha); - virtual double getCost(const vpImage<unsigned char> &I, vpColVector &tp) = 0; + virtual double getCost(const vpImage<unsigned char> &I, const vpColVector &tp) = 0; void getGaussianBluredImage(const vpImage<unsigned char> &I){ vpImageFilter::filter(I, BI,fgG,taillef); } void initCompInverse(const vpImage<unsigned char> &I); virtual void initCompInversePyr(const vpImage<unsigned char> &I); diff --git a/src/tracking/template-tracker/tools/vpTemplateTrackerBSpline.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerBSpline.h similarity index 76% rename from src/tracking/template-tracker/tools/vpTemplateTrackerBSpline.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerBSpline.h index 7a372d30bab574dcc2e51718f6a35116855538fa..6603dc8b9ad1a275a1c195e3ef75f1353969735a 100644 --- a/src/tracking/template-tracker/tools/vpTemplateTrackerBSpline.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerBSpline.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerBSpline.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -47,9 +44,9 @@ #ifndef vpTemplateTrackerBSpline_hh #define vpTemplateTrackerBSpline_hh -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpMath.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/src/tracking/template-tracker/tools/vpTemplateTrackerHeader.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerHeader.h similarity index 80% rename from src/tracking/template-tracker/tools/vpTemplateTrackerHeader.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerHeader.h index 339ff9260548399c038d294952aa1bf49120ddf2..3db48328422018cc255ae508d7a46c264330ece9 100644 --- a/src/tracking/template-tracker/tools/vpTemplateTrackerHeader.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerHeader.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerHeader.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -49,16 +46,28 @@ #include <stdio.h> +/*! + \struct vpTemplateTrackerZPoint + \ingroup group_tt_tools +*/ struct vpTemplateTrackerZPoint { int x,y; vpTemplateTrackerZPoint() : x(0), y(0) {} }; +/*! + \struct vpTemplateTrackerDPoint + \ingroup group_tt_tools +*/ struct vpTemplateTrackerDPoint { double x,y; vpTemplateTrackerDPoint() : x(0), y(0) {} }; +/*! + \struct vpTemplateTrackerPoint + \ingroup group_tt_tools +*/ struct vpTemplateTrackerPoint { int x,y; double dx,dy; @@ -68,6 +77,10 @@ struct vpTemplateTrackerPoint { vpTemplateTrackerPoint() : x(0), y(0), dx(0), dy(0), val(0), dW(NULL), HiG(NULL) {} }; +/*! + \struct vpTemplateTrackerPointCompo + \ingroup group_tt_tools +*/ struct vpTemplateTrackerPointCompo { double *dW; vpTemplateTrackerPointCompo() : dW(NULL) {} diff --git a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSD.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSD.h similarity index 67% rename from src/tracking/template-tracker/ssd/vpTemplateTrackerSSD.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSD.h index 462066a4c76a0daebde6070b5fa0ecc57676bff0..38c5dc75f7b4c17a127b1f6b1345dd74e112ec4d 100644 --- a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSD.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSD.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerSSD.h 4956 2014-11-12 15:50:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -49,17 +46,20 @@ #include <math.h> -#include <visp/vpTemplateTracker.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpImageTools.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpImageTools.h> -#include <visp/vpImageFilter.h> -#include <visp/vpMath.h> -#include <visp/vpHomography.h> +#include <visp3/tt/vpTemplateTracker.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpImageFilter.h> +#include <visp3/core/vpMath.h> +#include <visp3/vision/vpHomography.h> +/*! + \class vpTemplateTrackerSSD + \ingroup group_tt_tracker +*/ class VISP_EXPORT vpTemplateTrackerSSD: public vpTemplateTracker { protected: @@ -67,7 +67,7 @@ class VISP_EXPORT vpTemplateTrackerSSD: public vpTemplateTracker vpRowVector temp; protected: - double getCost(const vpImage<unsigned char> &I, vpColVector &tp); + double getCost(const vpImage<unsigned char> &I, const vpColVector &tp); double getCost(const vpImage<unsigned char> &I){ return getCost(I,p); } virtual void initHessienDesired(const vpImage<unsigned char> &I) = 0; virtual void trackNoPyr(const vpImage<unsigned char> &I) = 0; @@ -75,7 +75,7 @@ class VISP_EXPORT vpTemplateTrackerSSD: public vpTemplateTracker public: vpTemplateTrackerSSD(vpTemplateTrackerWarp *warp); - double getSSD(vpImage<unsigned char> &I,vpColVector &tp); + double getSSD(const vpImage<unsigned char> &I, const vpColVector &tp); void setGain(double g){ gain=g; } }; diff --git a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDESM.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSDESM.h similarity index 80% rename from src/tracking/template-tracker/ssd/vpTemplateTrackerSSDESM.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSDESM.h index 3ab98a1dddf8cc83327b3cb2375f4acb179f217f..fc05712274614dbb1b023daf1d047efee200524f 100644 --- a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDESM.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSDESM.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerSSDESM.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -47,8 +44,12 @@ #ifndef vpTemplateTrackerSSDESM_hh #define vpTemplateTrackerSSDESM_hh -#include <visp/vpTemplateTrackerSSD.h> +#include <visp3/tt/vpTemplateTrackerSSD.h> +/*! + \class vpTemplateTrackerSSDESM + \ingroup group_tt_tracker +*/ class VISP_EXPORT vpTemplateTrackerSSDESM: public vpTemplateTrackerSSD { protected: diff --git a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardAdditional.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSDForwardAdditional.h similarity index 80% rename from src/tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardAdditional.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSDForwardAdditional.h index 4d57db07f1edb662695870af441cd981c81c3c3e..bb05685a1e68fa08019013016e1738eec1b41099 100644 --- a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardAdditional.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSDForwardAdditional.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerSSDForwardAdditional.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -47,10 +44,11 @@ #ifndef vpTemplateTrackerSSDForwardAdditional_hh #define vpTemplateTrackerSSDForwardAdditional_hh -#include <visp/vpTemplateTrackerSSD.h> +#include <visp3/tt/vpTemplateTrackerSSD.h> /*! - The algorithm implemented in this class is described in \cite Baker04a. + \ingroup group_tt_tracker + The algorithm implemented in this class is described in \cite Baker04a. */ class VISP_EXPORT vpTemplateTrackerSSDForwardAdditional: public vpTemplateTrackerSSD { diff --git a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardCompositional.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSDForwardCompositional.h similarity index 77% rename from src/tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardCompositional.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSDForwardCompositional.h index 76134fe7ce8f1849abdef8d101915af7903cb66a..0e04cb4ddc138fb5b46b26173a97aaf4048ac2d6 100644 --- a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardCompositional.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSDForwardCompositional.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerSSDForwardCompositional.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -47,10 +44,11 @@ #ifndef vpTemplateTrackerSSDForwardCompositional_hh #define vpTemplateTrackerSSDForwardCompositional_hh -#include <visp/vpTemplateTrackerSSD.h> +#include <visp3/tt/vpTemplateTrackerSSD.h> /*! - The algorithm implemented in this class is described in \cite Baker04a. + \ingroup group_tt_tracker + The algorithm implemented in this class is described in \cite Baker04a. */ class VISP_EXPORT vpTemplateTrackerSSDForwardCompositional: public vpTemplateTrackerSSD { diff --git a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDInverseCompositional.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSDInverseCompositional.h similarity index 81% rename from src/tracking/template-tracker/ssd/vpTemplateTrackerSSDInverseCompositional.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSDInverseCompositional.h index c2c39e187a3c3bc12fdf10bac657a23d08b60d4c..d86ff97592623daa4fdc79b9a6056c831c361a39 100644 --- a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDInverseCompositional.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerSSDInverseCompositional.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerSSDInverseCompositional.h 4672 2014-02-17 09:01:17Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -48,10 +45,11 @@ #include <vector> -#include <visp/vpTemplateTrackerSSD.h> +#include <visp3/tt/vpTemplateTrackerSSD.h> /*! - The algorithm implemented in this class is described in \cite Baker04a. + \ingroup group_tt_tracker + The algorithm implemented in this class is described in \cite Baker04a. */ class VISP_EXPORT vpTemplateTrackerSSDInverseCompositional: public vpTemplateTrackerSSD { @@ -72,7 +70,7 @@ class VISP_EXPORT vpTemplateTrackerSSDInverseCompositional: public vpTemplateTra void trackNoPyr(const vpImage<unsigned char> &I); void deletePosEvalRMS(); void computeEvalRMS(const vpColVector &p); - void initPosEvalRMS(vpColVector &p); + void initPosEvalRMS(const vpColVector &p); public: vpTemplateTrackerSSDInverseCompositional(vpTemplateTrackerWarp *warp); diff --git a/src/tracking/template-tracker/tools/vpTemplateTrackerTriangle.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerTriangle.h similarity index 87% rename from src/tracking/template-tracker/tools/vpTemplateTrackerTriangle.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerTriangle.h index e4324d5dfe1ee796f3da94d63332e319947d9bef..5a5528915a985c144f9dfa40d71b3f27d2761d96 100644 --- a/src/tracking/template-tracker/tools/vpTemplateTrackerTriangle.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerTriangle.h @@ -1,165 +1,166 @@ -/**************************************************************************** - * - * $Id: vpTemplateTrackerTriangle.h 4781 2014-07-15 13:03:11Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Description: - * Template tracker. - * - * Authors: - * Amaury Dame - * Aurelien Yol - * Fabien Spindler - * - *****************************************************************************/ -/*! - \file vpTemplateTrackerTriangle.h - \brief -*/ - -#ifndef vpTemplateTrackerTriangle_hh -#define vpTemplateTrackerTriangle_hh - -#include <assert.h> -#include <vector> - -#include <visp/vpMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpColVector.h> -#include <visp/vpImagePoint.h> -#include <visp/vpTemplateTrackerHeader.h> - -class VISP_EXPORT vpTemplateTrackerTriangle -{ - protected: - double minx_temp; - double miny_temp; - vpTemplateTrackerDPoint C1; //! Corner 1 - vpTemplateTrackerDPoint C2; //! Corner 2 - vpTemplateTrackerDPoint C3; //! Corner 3 - - double l_t; - double h_t; - - bool not_good; - double uvinv00; - double uvinv01; - double uvinv10; - double uvinv11; - double marge_triangle; - double area; - - private: - vpColVector getCorner1() const; - vpColVector getCorner2() const; - vpColVector getCorner3() const; - - public: - vpTemplateTrackerTriangle(); - vpTemplateTrackerTriangle(const vpTemplateTrackerTriangle& T); - vpTemplateTrackerTriangle(const vpColVector &c1, const vpColVector &c2, const vpColVector &c3); - vpTemplateTrackerTriangle(const vpImagePoint &c1, const vpImagePoint &c2, const vpImagePoint &c3); - vpTemplateTrackerTriangle(int x1, int y1, int x2, int y2, int x3, int y3); - vpTemplateTrackerTriangle(double x1, double y1, double x2, double y2, double x3, double y3); - - /*! - Return the area of the triangle. - - \return The area of the triangle. - */ - inline double getArea() const{ - return this->area; - } - - vpTemplateTrackerTriangle getPyramidDown() const; - void getCorners(vpColVector &c1,vpColVector &c2,vpColVector &c3) const; - void getCorners(vpImagePoint &c1, vpImagePoint &c2, vpImagePoint &c3) const; - void getCorners(std::vector<vpImagePoint> &c) const; - - /*! - Returns the coordinates of a triangle corner. - \param i : Allowed values are 0, 1 or 2. - \return - - if i = 0, return corner 1 coordinates, - - if i = 1, return corner 2 coordinates, - - if i = 2, return corner 3 coordinates. - - The coordinates are returned as a 2 dimension vector (x,y). - */ - vpColVector getCorner(unsigned int i) const { - assert(i<3); - if(i==0) return getCorner1(); - else if(i==1) return getCorner2(); - else /*if(i==2)*/ return getCorner3(); - }; - /*! - Returns the coordinates of a triangle corner. - \param i : Allowed values are 0, 1 or 2. - - if i = 0, return corner 1 coordinates, - - if i = 1, return corner 2 coordinates, - - if i = 2, return corner 3 coordinates. - \param x,y : The coordinates of the corner. - */ - void getCorner(unsigned int i, double &x, double &y) const { - assert(i<3); - if(i==0) { - x = C1.x; - y = C1.y; - } - else if(i==1) { - x = C2.x; - y = C2.y; - } - else /*if(i==2)*/ { - x = C3.x; - y = C3.y; - } - }; - - double getMaxx() const; - double getMaxy() const; - double getMinx() const; - double getMiny() const; - - void getSize(double &w, double &h) const; - void getSize(int &w, int &h) const; - - void init(const vpColVector &c1,const vpColVector &c2,const vpColVector &c3); - void init(const vpImagePoint &c1, const vpImagePoint &c2, const vpImagePoint &c3); - void init(int x1,int y1, int x2,int y2, int x3,int y3); - void init(double x1,double y1, double x2,double y2, double x3,double y3); - bool inTriangle(const vpImagePoint &ip) const; - bool inTriangle(const int &i, const int &j) const; - bool inTriangle(const double &i,const double &j) const; - - vpTemplateTrackerTriangle & operator=(const vpTemplateTrackerTriangle& T); -}; -#endif - +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Template tracker. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +/*! + \file vpTemplateTrackerTriangle.h + \brief +*/ + +#ifndef vpTemplateTrackerTriangle_hh +#define vpTemplateTrackerTriangle_hh + +#include <assert.h> +#include <vector> + +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/tt/vpTemplateTrackerHeader.h> + +/*! + \class vpTemplateTrackerTriangle + \ingroup group_tt_tools +*/ +class VISP_EXPORT vpTemplateTrackerTriangle +{ + protected: + double minx_temp; + double miny_temp; + vpTemplateTrackerDPoint C1; //! Corner 1 + vpTemplateTrackerDPoint C2; //! Corner 2 + vpTemplateTrackerDPoint C3; //! Corner 3 + + double l_t; + double h_t; + + bool not_good; + double uvinv00; + double uvinv01; + double uvinv10; + double uvinv11; + double marge_triangle; + double area; + + private: + vpColVector getCorner1() const; + vpColVector getCorner2() const; + vpColVector getCorner3() const; + + public: + vpTemplateTrackerTriangle(); + vpTemplateTrackerTriangle(const vpTemplateTrackerTriangle& T); + vpTemplateTrackerTriangle(const vpColVector &c1, const vpColVector &c2, const vpColVector &c3); + vpTemplateTrackerTriangle(const vpImagePoint &c1, const vpImagePoint &c2, const vpImagePoint &c3); + vpTemplateTrackerTriangle(int x1, int y1, int x2, int y2, int x3, int y3); + vpTemplateTrackerTriangle(double x1, double y1, double x2, double y2, double x3, double y3); + + /*! + Return the area of the triangle. + + \return The area of the triangle. + */ + inline double getArea() const{ + return this->area; + } + + vpTemplateTrackerTriangle getPyramidDown() const; + void getCorners(vpColVector &c1,vpColVector &c2,vpColVector &c3) const; + void getCorners(vpImagePoint &c1, vpImagePoint &c2, vpImagePoint &c3) const; + void getCorners(std::vector<vpImagePoint> &c) const; + + /*! + Returns the coordinates of a triangle corner. + \param i : Allowed values are 0, 1 or 2. + \return + - if i = 0, return corner 1 coordinates, + - if i = 1, return corner 2 coordinates, + - if i = 2, return corner 3 coordinates. + + The coordinates are returned as a 2 dimension vector (x,y). + */ + vpColVector getCorner(unsigned int i) const { + assert(i<3); + if(i==0) return getCorner1(); + else if(i==1) return getCorner2(); + else /*if(i==2)*/ return getCorner3(); + }; + /*! + Returns the coordinates of a triangle corner. + \param i : Allowed values are 0, 1 or 2. + - if i = 0, return corner 1 coordinates, + - if i = 1, return corner 2 coordinates, + - if i = 2, return corner 3 coordinates. + \param x,y : The coordinates of the corner. + */ + void getCorner(unsigned int i, double &x, double &y) const { + assert(i<3); + if(i==0) { + x = C1.x; + y = C1.y; + } + else if(i==1) { + x = C2.x; + y = C2.y; + } + else /*if(i==2)*/ { + x = C3.x; + y = C3.y; + } + }; + + double getMaxx() const; + double getMaxy() const; + double getMinx() const; + double getMiny() const; + + void getSize(double &w, double &h) const; + void getSize(int &w, int &h) const; + + void init(const vpColVector &c1,const vpColVector &c2,const vpColVector &c3); + void init(const vpImagePoint &c1, const vpImagePoint &c2, const vpImagePoint &c3); + void init(int x1,int y1, int x2,int y2, int x3,int y3); + void init(double x1,double y1, double x2,double y2, double x3,double y3); + bool inTriangle(const vpImagePoint &ip) const; + bool inTriangle(const int &i, const int &j) const; + bool inTriangle(const double &i,const double &j) const; + + vpTemplateTrackerTriangle & operator=(const vpTemplateTrackerTriangle& T); +}; +#endif + diff --git a/src/tracking/template-tracker/warp/vpTemplateTrackerWarp.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarp.h similarity index 93% rename from src/tracking/template-tracker/warp/vpTemplateTrackerWarp.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarp.h index 74f527333effc53086fbd6602c4f2c287f0a4a7d..9063c5c66ab4f3bff25330a024fc86dafe1fb143 100644 --- a/src/tracking/template-tracker/warp/vpTemplateTrackerWarp.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarp.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerWarp.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -48,12 +45,16 @@ #ifndef vpTemplateTrackerWarp_hh #define vpTemplateTrackerWarp_hh -#include <visp/vpDisplay.h> -#include <visp/vpTemplateTrackerHeader.h> -#include <visp/vpTemplateTrackerTriangle.h> -#include <visp/vpTemplateTrackerZone.h> -#include <visp/vpTrackingException.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/tt/vpTemplateTrackerHeader.h> +#include <visp3/tt/vpTemplateTrackerTriangle.h> +#include <visp3/tt/vpTemplateTrackerZone.h> +#include <visp3/core/vpTrackingException.h> +/*! + \class vpTemplateTrackerWarp + \ingroup group_tt_warp +*/ class VISP_EXPORT vpTemplateTrackerWarp { protected: diff --git a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpAffine.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpAffine.h similarity index 93% rename from src/tracking/template-tracker/warp/vpTemplateTrackerWarpAffine.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpAffine.h index 0c60a29fe2c3940df995be5ae6a2d8e79b82a2d6..98b18d8e8dfbe1fca47b3ca33f5e899621631e27 100644 --- a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpAffine.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpAffine.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerWarpAffine.h 4607 2014-01-21 16:02:11Z ayol $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -48,9 +45,12 @@ #ifndef vpTemplateTrackerWarpAffine_hh #define vpTemplateTrackerWarpAffine_hh -#include <visp/vpTemplateTrackerWarp.h> - +#include <visp3/tt/vpTemplateTrackerWarp.h> +/*! + \class vpTemplateTrackerWarpAffine + \ingroup group_tt_warp +*/ class VISP_EXPORT vpTemplateTrackerWarpAffine: public vpTemplateTrackerWarp { public: diff --git a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpHomography.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpHomography.h similarity index 93% rename from src/tracking/template-tracker/warp/vpTemplateTrackerWarpHomography.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpHomography.h index 58201ab16a0c311a947ce93cabd121003e4f7fbf..e16ae17d53984f1a83000d37eddbb7ecb1d582c7 100644 --- a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpHomography.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpHomography.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerWarpHomography.h 4607 2014-01-21 16:02:11Z ayol $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -48,10 +45,13 @@ #ifndef vpTemplateTrackerWarpHomography_hh #define vpTemplateTrackerWarpHomography_hh -#include <visp/vpTemplateTrackerWarp.h> -#include <visp/vpHomography.h> - +#include <visp3/tt/vpTemplateTrackerWarp.h> +#include <visp3/vision/vpHomography.h> +/*! + \class vpTemplateTrackerWarpHomography + \ingroup group_tt_warp +*/ class VISP_EXPORT vpTemplateTrackerWarpHomography: public vpTemplateTrackerWarp { public: diff --git a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpHomographySL3.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpHomographySL3.h similarity index 94% rename from src/tracking/template-tracker/warp/vpTemplateTrackerWarpHomographySL3.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpHomographySL3.h index 43adff0e036df23a51d9b2f56ec02eab7e6e9453..4d52d89e92c615552501cfe2c806cf55272f6d7b 100644 --- a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpHomographySL3.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpHomographySL3.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerWarpHomographySL3.h 4669 2014-02-16 16:25:57Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -50,9 +47,13 @@ #include <vector> -#include <visp/vpTemplateTrackerWarp.h> -#include <visp/vpHomography.h> +#include <visp3/tt/vpTemplateTrackerWarp.h> +#include <visp3/vision/vpHomography.h> +/*! + \class vpTemplateTrackerWarpHomographySL3 + \ingroup group_tt_warp +*/ class VISP_EXPORT vpTemplateTrackerWarpHomographySL3: public vpTemplateTrackerWarp { protected: diff --git a/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpRT.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpRT.h new file mode 100644 index 0000000000000000000000000000000000000000..5db4f1cb2309678c910a9d710a1a1c29d319cef9 --- /dev/null +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpRT.h @@ -0,0 +1,175 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Template tracker. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +/*! + \file vpTemplateTrackerWarpRT.h + \brief sRt warping function +*/ + + +#ifndef vpTemplateTrackerWarpRT_hh +#define vpTemplateTrackerWarpRT_hh + +#include <visp3/tt/vpTemplateTrackerWarp.h> + +/*! + \class vpTemplateTrackerWarpRT + \ingroup group_tt_warp +*/ +class VISP_EXPORT vpTemplateTrackerWarpRT: public vpTemplateTrackerWarp +{ +public: + //constructor; + vpTemplateTrackerWarpRT(); + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + void computeCoeff(const vpColVector &/*p*/){} + void computeDenom(vpColVector &/*vX*/, const vpColVector &/*ParamM*/){} +#endif + + /*! + Compute the derivative of the warping function according to its parameters. + + \param X1 : Point to consider in the derivative computation. + \param X2 : Point to consider in the derivative computation. + \param ParamM : Parameters of the warping function. + \param dW : Resulting derivative matrix. + */ + void dWarp(const vpColVector &X1,const vpColVector &X2,const vpColVector &ParamM,vpMatrix &dW); + + /*! + Compute the compositionnal derivative of the warping function according to its parameters. + + \param X1 : Point to consider in the derivative computation. + \param X2 : Point to consider in the derivative computation. + \param ParamM : Parameters of the warping function. + \param dwdp0 : Derivative matrix of the warping function according to the initial warping function parameters (p=0). + \param dW : Resulting compositionnal derivative matrix. + */ + void dWarpCompo(const vpColVector &X1,const vpColVector &X2,const vpColVector &ParamM,const double *dwdp0,vpMatrix &dW); + + /*! + Compute the derivative of the image with relation to the warping function parameters. + + \param i : i coordinate (along the rows) of the point to consider in the image. + \param j : j coordinate (along the columns) of the point to consider in the image. + \param dy : Derivative on the y-axis (along the rows) of the point (i,j). + \param dx : Derivative on the x-axis (along the columns) of the point (i,j). + \param dIdW : Resulting derivative matrix (Image according to the warping function). + */ + void getdW0(const int &i,const int &j,const double &dy,const double &dx,double *dIdW); + + /*! + Compute the derivative of the warping function according to the initial parameters. + + \param i : i coordinate (along the rows) of the point to consider in the image. + \param j : j coordinate (along the columns) of the point to consider in the image. + \param dIdW : Resulting derivative matrix (Image according to the warping function). + */ + void getdWdp0(const int &i,const int &j,double *dIdW); + + /*! + Get the inverse of the warping function parameters. + + \param ParamM : Parameters of the warping function. + \param ParamMinv : Inverse parameters. + */ + void getParamInverse(const vpColVector &ParamM,vpColVector &ParamMinv) const; + + /*! + Get the parameters of the warping function one level down. + + \param p : Current parameters of the warping function. + \param pdown : Resulting parameters on level down. + */ + void getParamPyramidDown(const vpColVector &p,vpColVector &pdown); + + /*! + Get the parameters of the warping function one level up. + + \param p : Current parameters of the warping function. + \param pup : Resulting parameters one level up. + */ + void getParamPyramidUp(const vpColVector &p,vpColVector &pup); + + /*! + Tells if the warping function is ESM compatible. + + \return True if it is ESM compatible, False otherwise. + */ + bool isESMcompatible() const {return false;} + + /*! + Get the displacement resulting from the composition of two other displacements. + + \param p1 : First displacement. + \param p2 : Second displacement. + \param pres : Displacement resulting from the composition of p1 and p2. + */ + void pRondp(const vpColVector &p1, const vpColVector &p2,vpColVector &pres) const; + + /*! + Warp a point. + + \param vX : Coordinates of the point to warp. + \param vXres : Coordinates of the warped point. + \param ParamM : Parameters of the warping function. + */ + void warpX(const vpColVector &vX,vpColVector &vXres,const vpColVector &ParamM); + + /*! + Warp a point. + + \param i : i coordinate (along the rows) of the point to warp. + \param j : j coordinate (along the columns) of the point to warp. + \param i2 : i coordinate (along the rows) of the warped point. + \param j2 : j coordinate (along the columns) of the warped point. + \param ParamM : Parameters of the warping function. + */ + void warpX(const int &i,const int &j,double &i2,double &j2,const vpColVector &ParamM); + + /*! + Inverse Warp a point. + + \param vX : Coordinates of the point to warp. + \param vXres : Coordinates of the warped point. + \param ParamM : Parameters of the warping function. + */ + void warpXInv(const vpColVector &vX,vpColVector &vXres,const vpColVector &ParamM); +}; +#endif diff --git a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpSRT.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpSRT.h similarity index 93% rename from src/tracking/template-tracker/warp/vpTemplateTrackerWarpSRT.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpSRT.h index 08f7d50e9008891583b92bdc30362133fac49b94..8930ce2dca72c10be31ae6201d61476e347e50bf 100644 --- a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpSRT.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpSRT.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerWarpSRT.h 4607 2014-01-21 16:02:11Z ayol $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -48,8 +45,12 @@ #ifndef vpTemplateTrackerWarpSRT_hh #define vpTemplateTrackerWarpSRT_hh -#include <visp/vpTemplateTrackerWarp.h> +#include <visp3/tt/vpTemplateTrackerWarp.h> +/*! + \class vpTemplateTrackerWarpSRT + \ingroup group_tt_warp +*/ class VISP_EXPORT vpTemplateTrackerWarpSRT: public vpTemplateTrackerWarp { public: diff --git a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpTranslation.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpTranslation.h similarity index 93% rename from src/tracking/template-tracker/warp/vpTemplateTrackerWarpTranslation.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpTranslation.h index 61a705fd92d1618f4ba614aea2f5dcdc9abea9c7..63551a6c5812f2402fe018baa268f8f83d5a666d 100644 --- a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpTranslation.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerWarpTranslation.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerWarpTranslation.h 4607 2014-01-21 16:02:11Z ayol $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -48,9 +45,12 @@ #ifndef vpTemplateTrackerWarpTranslation_hh #define vpTemplateTrackerWarpTranslation_hh -#include <visp/vpTemplateTrackerWarp.h> - +#include <visp3/tt/vpTemplateTrackerWarp.h> +/*! + \class vpTemplateTrackerWarpTranslation + \ingroup group_tt_warp +*/ class VISP_EXPORT vpTemplateTrackerWarpTranslation: public vpTemplateTrackerWarp { public: diff --git a/src/tracking/template-tracker/zncc/vpTemplateTrackerZNCC.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerZNCC.h similarity index 70% rename from src/tracking/template-tracker/zncc/vpTemplateTrackerZNCC.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerZNCC.h index 39e45fa86a2f44eed4221eb5367d8b1ae8e4cb10..31df8fdf8f621b1da2fecee8db74b5bf946db693 100644 --- a/src/tracking/template-tracker/zncc/vpTemplateTrackerZNCC.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerZNCC.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerZNCC.h 4956 2014-11-12 15:50:23Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -49,18 +46,22 @@ #include <math.h> -#include <visp/vpTemplateTracker.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpImageTools.h> -#include <visp/vpIoTools.h> -#include <visp/vpImageTools.h> -#include <visp/vpImageFilter.h> -#include <visp/vpMath.h> -#include <visp/vpHomography.h> +#include <visp3/tt/vpTemplateTracker.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpImageFilter.h> +#include <visp3/core/vpMath.h> +#include <visp3/vision/vpHomography.h> #define APPROX_NCC +/*! + \class vpTemplateTrackerZNCC + \ingroup group_tt_tracker +*/ class VISP_EXPORT vpTemplateTrackerZNCC: public vpTemplateTracker { protected: @@ -68,7 +69,7 @@ class VISP_EXPORT vpTemplateTrackerZNCC: public vpTemplateTracker vpRowVector temp; protected: - double getCost(const vpImage<unsigned char> &I, vpColVector &tp) ; + double getCost(const vpImage<unsigned char> &I, const vpColVector &tp) ; double getCost(const vpImage<unsigned char> &I) {vpColVector tp; return getCost(I,tp);} virtual void initHessienDesired(const vpImage<unsigned char> &I)=0; virtual void trackNoPyr(const vpImage<unsigned char> &I)=0; diff --git a/src/tracking/template-tracker/zncc/vpTemplateTrackerZNCCForwardAdditional.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerZNCCForwardAdditional.h similarity index 75% rename from src/tracking/template-tracker/zncc/vpTemplateTrackerZNCCForwardAdditional.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerZNCCForwardAdditional.h index 5da1c7ec2fffc4cb6cf09625b4fcc3ec82764f25..847a8fefc2d2097a4eb0c63528b1ce2cb3fd1f46 100644 --- a/src/tracking/template-tracker/zncc/vpTemplateTrackerZNCCForwardAdditional.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerZNCCForwardAdditional.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerZNCCForwardAdditional.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -48,10 +45,12 @@ #define vpTemplateTrackerZNCCForwardAdditional_hh -#include <visp/vpTemplateTrackerZNCC.h> +#include <visp3/tt/vpTemplateTrackerZNCC.h> /*! - The algorithm implemented in this class is described in \cite Irani98a. + \class vpTemplateTrackerZNCCForwardAdditional + \ingroup group_tt_tracker + The algorithm implemented in this class is described in \cite Irani98a. */ class VISP_EXPORT vpTemplateTrackerZNCCForwardAdditional: public vpTemplateTrackerZNCC { diff --git a/src/tracking/template-tracker/zncc/vpTemplateTrackerZNCCInverseCompositional.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerZNCCInverseCompositional.h similarity index 79% rename from src/tracking/template-tracker/zncc/vpTemplateTrackerZNCCInverseCompositional.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerZNCCInverseCompositional.h index 814b2379475b15c49c161f2e80a2c3396fdd983d..f8d037b13797de68412723b2b2001b18e1e527a7 100644 --- a/src/tracking/template-tracker/zncc/vpTemplateTrackerZNCCInverseCompositional.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerZNCCInverseCompositional.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerZNCCInverseCompositional.h 4669 2014-02-16 16:25:57Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -49,10 +46,12 @@ #include <vector> -#include <visp/vpTemplateTrackerZNCC.h> +#include <visp3/tt/vpTemplateTrackerZNCC.h> /*! - The algorithm implemented in this class is described in \cite Irani98a. + \class vpTemplateTrackerZNCCInverseCompositional + \ingroup group_tt_tracker + The algorithm implemented in this class is described in \cite Irani98a. */ class VISP_EXPORT vpTemplateTrackerZNCCInverseCompositional: public vpTemplateTrackerZNCC { @@ -71,7 +70,7 @@ class VISP_EXPORT vpTemplateTrackerZNCCInverseCompositional: public vpTemplateTr void trackNoPyr(const vpImage<unsigned char> &I); void deletePosEvalRMS(); void computeEvalRMS(const vpColVector &p); - void initPosEvalRMS(vpColVector &p); + void initPosEvalRMS(const vpColVector &p); public: vpTemplateTrackerZNCCInverseCompositional(vpTemplateTrackerWarp *warp); diff --git a/src/tracking/template-tracker/tools/vpTemplateTrackerZone.h b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerZone.h similarity index 82% rename from src/tracking/template-tracker/tools/vpTemplateTrackerZone.h rename to modules/tracker/tt/include/visp3/tt/vpTemplateTrackerZone.h index 324eb9353240265d6a1c31b9f70296d2e0934e8a..e1c0fe00310e7f0daeb13408a6e094026915c366 100644 --- a/src/tracking/template-tracker/tools/vpTemplateTrackerZone.h +++ b/modules/tracker/tt/include/visp3/tt/vpTemplateTrackerZone.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerZone.h 4781 2014-07-15 13:03:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -44,18 +41,20 @@ #include <vector> -#include <visp/vpDisplay.h> -#include <visp/vpException.h> -#include <visp/vpImage.h> -#include <visp/vpTemplateTrackerTriangle.h> -#include <visp/vpTemplateTrackerHeader.h> -#include <visp/vpRect.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpImage.h> +#include <visp3/tt/vpTemplateTrackerTriangle.h> +#include <visp3/tt/vpTemplateTrackerHeader.h> +#include <visp3/core/vpRect.h> /*! - A zone is defined by a set of triangles defined as vpTemplateTrackerTriangle. + \class vpTemplateTrackerZone + \ingroup group_tt_tools + A zone is defined by a set of triangles defined as vpTemplateTrackerTriangle. - A zone can be initialized either by user interaction using mouse click in a display device - throw initClick(), or by a list of points throw initFromPoints(). + A zone can be initialized either by user interaction using mouse click in a display device + throw initClick(), or by a list of points throw initFromPoints(). */ class VISP_EXPORT vpTemplateTrackerZone { diff --git a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSD.cpp b/modules/tracker/tt/src/ssd/vpTemplateTrackerSSD.cpp similarity index 85% rename from src/tracking/template-tracker/ssd/vpTemplateTrackerSSD.cpp rename to modules/tracker/tt/src/ssd/vpTemplateTrackerSSD.cpp index e5fed1971f4148483f0df3ab6828e95c6bd6b88f..bb18a3561db529c1cd157784aff2e2a8690909bc 100644 --- a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSD.cpp +++ b/modules/tracker/tt/src/ssd/vpTemplateTrackerSSD.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerSSD.cpp 5264 2015-02-04 13:49:55Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -40,7 +37,7 @@ * *****************************************************************************/ -#include <visp/vpTemplateTrackerSSD.h> +#include <visp3/tt/vpTemplateTrackerSSD.h> vpTemplateTrackerSSD::vpTemplateTrackerSSD(vpTemplateTrackerWarp *warp) : vpTemplateTracker(warp), DI(), temp() @@ -57,7 +54,7 @@ vpTemplateTrackerSSD::vpTemplateTrackerSSD(vpTemplateTrackerWarp *warp) DI.resize(2); } -double vpTemplateTrackerSSD::getCost(const vpImage<unsigned char> &I,vpColVector &tp) +double vpTemplateTrackerSSD::getCost(const vpImage<unsigned char> &I, const vpColVector &tp) { double erreur=0; double IW,Tij; @@ -94,7 +91,7 @@ double vpTemplateTrackerSSD::getCost(const vpImage<unsigned char> &I,vpColVector } -double vpTemplateTrackerSSD::getSSD(vpImage<unsigned char> &I,vpColVector &tp) +double vpTemplateTrackerSSD::getSSD(const vpImage<unsigned char> &I, const vpColVector &tp) { double erreur=0; double IW,Tij; diff --git a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDESM.cpp b/modules/tracker/tt/src/ssd/vpTemplateTrackerSSDESM.cpp similarity index 94% rename from src/tracking/template-tracker/ssd/vpTemplateTrackerSSDESM.cpp rename to modules/tracker/tt/src/ssd/vpTemplateTrackerSSDESM.cpp index 7865c9d88c6247b79dd1a76253bea110669f3b05..125496117f8249d150be92086d912e652f7640a3 100644 --- a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDESM.cpp +++ b/modules/tracker/tt/src/ssd/vpTemplateTrackerSSDESM.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerSSDESM.cpp 5264 2015-02-04 13:49:55Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,8 +36,8 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpTemplateTrackerSSDESM.h> -#include <visp/vpImageFilter.h> +#include <visp3/tt/vpTemplateTrackerSSDESM.h> +#include <visp3/core/vpImageFilter.h> vpTemplateTrackerSSDESM::vpTemplateTrackerSSDESM(vpTemplateTrackerWarp *warp) : vpTemplateTrackerSSD(warp), compoInitialised(false), HDir(), HInv(), diff --git a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardAdditional.cpp b/modules/tracker/tt/src/ssd/vpTemplateTrackerSSDForwardAdditional.cpp similarity index 91% rename from src/tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardAdditional.cpp rename to modules/tracker/tt/src/ssd/vpTemplateTrackerSSDForwardAdditional.cpp index 90480f1119052715c7b0080852ef168480762289..2722aa37d46971a5165f4ddec6390c7d24d630d7 100644 --- a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardAdditional.cpp +++ b/modules/tracker/tt/src/ssd/vpTemplateTrackerSSDForwardAdditional.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerSSDForwardAdditional.cpp 5264 2015-02-04 13:49:55Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -42,8 +39,8 @@ #include <limits> // numeric_limits -#include <visp/vpTemplateTrackerSSDForwardAdditional.h> -#include <visp/vpImageTools.h> +#include <visp3/tt/vpTemplateTrackerSSDForwardAdditional.h> +#include <visp3/core/vpImageTools.h> vpTemplateTrackerSSDForwardAdditional::vpTemplateTrackerSSDForwardAdditional(vpTemplateTrackerWarp *warp) : vpTemplateTrackerSSD(warp), minimizationMethod(USE_NEWTON), p_prec(), G_prec(), KQuasiNewton() @@ -162,7 +159,7 @@ void vpTemplateTrackerSSDForwardAdditional::trackNoPyr(const vpImage<unsigned ch computeOptimalBrentGain(I,p,erreur,dp,alpha); dp=alpha*dp; } - p+=1.*dp; + p += 1. * dp; break; } diff --git a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardCompositional.cpp b/modules/tracker/tt/src/ssd/vpTemplateTrackerSSDForwardCompositional.cpp similarity index 90% rename from src/tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardCompositional.cpp rename to modules/tracker/tt/src/ssd/vpTemplateTrackerSSDForwardCompositional.cpp index d3e605ed068f26dd6c68007a1c95fbd2abb70658..e8c186d39398223b76e89e0e82feae094d07460a 100644 --- a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDForwardCompositional.cpp +++ b/modules/tracker/tt/src/ssd/vpTemplateTrackerSSDForwardCompositional.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerSSDForwardCompositional.cpp 5264 2015-02-04 13:49:55Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,8 +36,8 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpTemplateTrackerSSDForwardCompositional.h> -#include <visp/vpImageFilter.h> +#include <visp3/tt/vpTemplateTrackerSSDForwardCompositional.h> +#include <visp3/core/vpImageFilter.h> vpTemplateTrackerSSDForwardCompositional::vpTemplateTrackerSSDForwardCompositional(vpTemplateTrackerWarp *warp) : vpTemplateTrackerSSD(warp), compoInitialised(false) diff --git a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDInverseCompositional.cpp b/modules/tracker/tt/src/ssd/vpTemplateTrackerSSDInverseCompositional.cpp similarity index 92% rename from src/tracking/template-tracker/ssd/vpTemplateTrackerSSDInverseCompositional.cpp rename to modules/tracker/tt/src/ssd/vpTemplateTrackerSSDInverseCompositional.cpp index bd955a52c2e90de3073657ba218401106140c3d1..07e282f9a2ff54226d1006386c2034cd7dbd1434 100644 --- a/src/tracking/template-tracker/ssd/vpTemplateTrackerSSDInverseCompositional.cpp +++ b/modules/tracker/tt/src/ssd/vpTemplateTrackerSSDInverseCompositional.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerSSDInverseCompositional.cpp 5264 2015-02-04 13:49:55Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,8 +36,8 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpTemplateTrackerSSDInverseCompositional.h> -#include <visp/vpImageTools.h> +#include <visp3/tt/vpTemplateTrackerSSDInverseCompositional.h> +#include <visp3/core/vpImageTools.h> vpTemplateTrackerSSDInverseCompositional::vpTemplateTrackerSSDInverseCompositional(vpTemplateTrackerWarp *warp) : vpTemplateTrackerSSD(warp), compoInitialised(false), HInv(), HCompInverse(), useTemplateSelect(false), @@ -190,7 +187,7 @@ void vpTemplateTrackerSSDInverseCompositional::trackNoPyr(const vpImage<unsigned deletePosEvalRMS(); } -void vpTemplateTrackerSSDInverseCompositional::initPosEvalRMS(vpColVector &p_) +void vpTemplateTrackerSSDInverseCompositional::initPosEvalRMS(const vpColVector &p_) { unsigned int nb_corners = zoneTracked->getNbTriangle() * 3; x_pos.resize(nb_corners); diff --git a/src/tracking/template-tracker/tools/vpTemplateTrackerBSpline.cpp b/modules/tracker/tt/src/tools/vpTemplateTrackerBSpline.cpp similarity index 82% rename from src/tracking/template-tracker/tools/vpTemplateTrackerBSpline.cpp rename to modules/tracker/tt/src/tools/vpTemplateTrackerBSpline.cpp index 7e3c33643f29955b034cde4642632a2fcf5fe630..eb471276401b304fd918259105023f92f4827c9f 100644 --- a/src/tracking/template-tracker/tools/vpTemplateTrackerBSpline.cpp +++ b/modules/tracker/tt/src/tools/vpTemplateTrackerBSpline.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerBSpline.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,7 +36,7 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpTemplateTrackerBSpline.h> +#include <visp3/tt/vpTemplateTrackerBSpline.h> #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -52,7 +49,7 @@ double vpTemplateTrackerBSpline::getSubPixBspline4(const vpImage<double> &I, dou double et=(double)t-ct; int height=(int)I.getHeight();//r int width=(int)I.getWidth();//t - int tr,tt; + volatile int tr,tt; for(int ir=-1;ir<=2;ir++) { tr=ir+cr; diff --git a/src/tracking/template-tracker/tools/vpTemplateTrackerTriangle.cpp b/modules/tracker/tt/src/tools/vpTemplateTrackerTriangle.cpp similarity index 93% rename from src/tracking/template-tracker/tools/vpTemplateTrackerTriangle.cpp rename to modules/tracker/tt/src/tools/vpTemplateTrackerTriangle.cpp index 10c6f8f47da7b67147fb511e8a56e5c0980a1a9d..ec59ef04e14b42386bf15cbc0f1541f04c959aa5 100644 --- a/src/tracking/template-tracker/tools/vpTemplateTrackerTriangle.cpp +++ b/modules/tracker/tt/src/tools/vpTemplateTrackerTriangle.cpp @@ -1,438 +1,435 @@ -/**************************************************************************** - * - * $Id: vpTemplateTrackerTriangle.cpp 5060 2014-12-12 18:31:03Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Description: - * Template tracker. - * - * Authors: - * Amaury Dame - * Aurelien Yol - * Fabien Spindler - * - *****************************************************************************/ -#include <visp/vpTemplateTrackerTriangle.h> - -/*! - Default constructor. - */ -vpTemplateTrackerTriangle::vpTemplateTrackerTriangle() - : minx_temp(0), miny_temp(0), C1(), C2(), C3(), l_t(0), h_t(0), not_good(false), - uvinv00(0.), uvinv01(0.), uvinv10(0.), uvinv11(0.), marge_triangle(0.00001), area(0) -{ -} - -/*! - Copy constructor. - */ -vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(const vpTemplateTrackerTriangle& T) - : minx_temp(0), miny_temp(0), C1(), C2(), C3(), l_t(0), h_t(0), not_good(false), - uvinv00(0.), uvinv01(0.), uvinv10(0.), uvinv11(0.), marge_triangle(0.00001), area(0) -{ - *this = T; -} - -/*! - Copy operator. - */ -vpTemplateTrackerTriangle & vpTemplateTrackerTriangle::operator=(const vpTemplateTrackerTriangle& T) -{ - minx_temp=T.minx_temp; - miny_temp=T.miny_temp; - - l_t=T.l_t; - h_t=T.h_t; - C1.x=T.C1.x; - C1.y=T.C1.y; - C2.x=T.C2.x; - C2.y=T.C2.y; - C3.x=T.C3.x; - C3.y=T.C3.y; - //uvinv.resize(2,2); - //uvinv=T.uvinv; - //p_ds_uv.resize(2); - //p_ds_uv=T.p_ds_uv; - //ptempo.resize(2); - //ptempo=T.ptempo; - not_good=T.not_good; - - uvinv00=T.uvinv00; - uvinv01=T.uvinv01; - uvinv10=T.uvinv10; - uvinv11=T.uvinv11; - - marge_triangle = T.marge_triangle; - area = T.area; - - return (*this); -} - -/*! - Create a triangle from 3 corners. - \param c1 : First corner. - \param c2 : Second corner. - \param c3 : Third corner. - - The coordinates of the points are defined as a 2 dimension vector with coordinates (x,y). - */ -vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(const vpColVector &c1, - const vpColVector &c2, - const vpColVector &c3) - : minx_temp(0), miny_temp(0), C1(), C2(), C3(), l_t(0), h_t(0), not_good(false), - uvinv00(0.), uvinv01(0.), uvinv10(0.), uvinv11(0.), marge_triangle(0.00001), area(0) -{ - init(c1[0],c1[1],c2[0],c2[1],c3[0],c3[1]); -} -/*! - Return a triangle with coordinates that are down scaled by a factor 2. - */ -vpTemplateTrackerTriangle vpTemplateTrackerTriangle::getPyramidDown() const -{ - vpTemplateTrackerTriangle Ttemp; - Ttemp.init(C1.x/2.,C1.y/2.,C2.x/2.,C2.y/2.,C3.x/2.,C3.y/2.); - return Ttemp; -} - -/*! - Create a triangle from 3 corners with coordinates (x1,y1), (x2,y2), (x3,y3). - - x coordinate is along the columns - - y coordinate is along the rows. - */ -vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(int x1,int y1, int x2,int y2, int x3,int y3) - : minx_temp(0), miny_temp(0), C1(), C2(), C3(), l_t(0), h_t(0), not_good(false), - uvinv00(0.), uvinv01(0.), uvinv10(0.), uvinv11(0.), marge_triangle(0.00001), area(0) -{ - init(x1,y1,x2,y2,x3,y3); -} - -/*! - Create a triangle from 3 corners defined as image points. - \param c1 : First corner. - \param c2 : Second corner. - \param c3 : Third corner. - */ -vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(const vpImagePoint &c1, const vpImagePoint &c2, const vpImagePoint &c3) - : minx_temp(0), miny_temp(0), C1(), C2(), C3(), l_t(0), h_t(0), not_good(false), - uvinv00(0.), uvinv01(0.), uvinv10(0.), uvinv11(0.), marge_triangle(0.00001), area(0) -{ - init(c1.get_u(), c1.get_v(), c2.get_u(), c2.get_v(), c3.get_u(), c3.get_v()); -} - -/*! - Create a triangle from 3 corners with coordinates (x1,y1), (x2,y2), (x3,y3). - - x coordinate is along the columns - - y coordinate is along the rows. - */ -vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(double x1,double y1, double x2,double y2, double x3,double y3) - : minx_temp(0), miny_temp(0), C1(), C2(), C3(), l_t(0), h_t(0), not_good(false), - uvinv00(0.), uvinv01(0.), uvinv10(0.), uvinv11(0.), marge_triangle(0.00001), area(0) -{ - init(x1,y1,x2,y2,x3,y3); -} -/*! - Initializes a triangle from 3 corners. - \param c1 : First corner. - \param c2 : Second corner. - \param c3 : Third corner. - - The coordinates of the points are defined as a 2 dimension vector with coordinates (x,y). - */ -void vpTemplateTrackerTriangle::init(const vpColVector &c1,const vpColVector &c2,const vpColVector &c3) -{ - init(c1[0],c1[1],c2[0],c2[1],c3[0],c3[1]); -} -/*! - Initializes a triangle from 3 corners defined as image points. - \param c1 : First corner. - \param c2 : Second corner. - \param c3 : Third corner. - */ -void vpTemplateTrackerTriangle::init(const vpImagePoint &c1, const vpImagePoint &c2, const vpImagePoint &c3) -{ - init(c1.get_u(), c1.get_v(), c2.get_u(), c2.get_v(), c3.get_u(), c3.get_v()); -} - -/*! - Initializes a triangle from 3 corners with coordinates (x1,y1), (x2,y2), (x3,y3). - - x coordinate is along the columns - - y coordinate is along the rows. - */ -void vpTemplateTrackerTriangle::init(int x1, int y1, int x2,int y2, int x3, int y3) -{ - init((double)x1,(double)y1,(double)x2,(double)y2,(double)x3,(double)y3); -} - -/*! - Initializes a triangle from 3 corners with coordinates (x1,y1), (x2,y2), (x3,y3). - - x coordinate is along the columns - - y coordinate is along the rows. - */ -void vpTemplateTrackerTriangle::init(double x1, double y1, double x2,double y2, double x3, double y3) -{ - C1.x=x1;C1.y=y1; - C2.x=x2;C2.y=y2; - C3.x=x3;C3.y=y3; - - double minx,miny,maxx,maxy; - //calcul du rectangle minimal contenant le triangle seletionne - minx=(x1<x2)?x1:x2; - miny=(y1<y2)?y1:y2; - minx=(minx<x3)?minx:x3; - miny=(miny<y3)?miny:y3; - maxx=(x1>x2)?x1:x2; - maxy=(y1>y2)?y1:y2; - maxx=(maxx>x3)?maxx:x3; - maxy=(maxy>y3)?maxy:y3; - - vpColVector u; - vpColVector v; - u.resize(2); - v.resize(2); - vpMatrix uv(2,2); - vpMatrix uvinv(2,2); - - u[0]=C2.x-C1.x; - u[1]=C2.y-C1.y; - - v[0]=C3.x-C1.x; - v[1]=C3.y-C1.y; - - uv[0][0]=u[0];uv[1][0]=v[0]; - uv[0][1]=u[1];uv[1][1]=v[1]; - try - { - uvinv=uv.inverseByLU(); - not_good=false; - } - catch(...) - { - not_good=true; - std::cout<<"Triangle vide"<<std::endl; - - } - uvinv00=uvinv[0][0]; - uvinv01=uvinv[0][1]; - uvinv10=uvinv[1][0]; - uvinv11=uvinv[1][1]; - - l_t=maxx-minx; - h_t=maxy-miny; - minx_temp=minx; - miny_temp=miny; - - marge_triangle = 0.00001; - area = 0.5 * fabs(uv.det()); -} - -//marge ajoutee a zone pour que sommet soit pris en compte - -/*! - Indicates if a point with coordinates (i,j) is in the triangle. - \param i : Coordinate along the rows. - \param j : Coordinate along the columns. - */ -bool vpTemplateTrackerTriangle::inTriangle(const int &i, const int &j) const -{ - if(not_good) - return false; - - /*ptempo[0]=j-C1.x; - ptempo[1]=i-C1.y; - - p_ds_uv=ptempo*uvinv; - return (p_ds_uv[0]+p_ds_uv[1]<1. && p_ds_uv[0]>0 && p_ds_uv[1]>0);*/ - - double ptempo0=j-C1.x; - double ptempo1=i-C1.y; - double p_ds_uv0=ptempo0*uvinv00+ptempo1*uvinv10; - double p_ds_uv1=ptempo0*uvinv01+ptempo1*uvinv11; - return (p_ds_uv0+p_ds_uv1<1.+marge_triangle && p_ds_uv0>-marge_triangle && p_ds_uv1>-marge_triangle); -} - -/*! - Indicates if a point with coordinates (i,j) is in the triangle. - \param i : Coordinate along the rows. - \param j : Coordinate along the columns. - */ -bool vpTemplateTrackerTriangle::inTriangle(const double &i, const double &j) const -{ - if(not_good) - return false; - /*ptempo[0]=j-C1.x; - ptempo[1]=i-C1.y; - - p_ds_uv=ptempo*uvinv; - return (p_ds_uv[0]+p_ds_uv[1]<1. && p_ds_uv[0]>0 && p_ds_uv[1]>0);*/ - double ptempo0=j-C1.x; - double ptempo1=i-C1.y; - double p_ds_uv0=ptempo0*uvinv00+ptempo1*uvinv10; - double p_ds_uv1=ptempo0*uvinv01+ptempo1*uvinv11; - return (p_ds_uv0+p_ds_uv1<1.+marge_triangle && p_ds_uv0>-marge_triangle && p_ds_uv1>-marge_triangle); -} - -/*! - Indicates if an image point is in the triangle. - \param ip : Image point to consider. - */ -bool vpTemplateTrackerTriangle::inTriangle(const vpImagePoint &ip) const -{ - return inTriangle(ip.get_i(), ip.get_j()); -} -/*! - Returns the coordinates of the triangle corners as an image point. - \param c1 : First corner. - \param c2 : Second corner. - \param c3 : Third corner. - */ -void vpTemplateTrackerTriangle::getCorners(vpImagePoint &c1, vpImagePoint &c2, vpImagePoint &c3) const -{ - c1.set_uv(C1.x, C1.y); - c2.set_uv(C2.x, C2.y); - c3.set_uv(C3.x, C3.y); -} - -/*! - Returns the coordinates of the triangle corners as a 3 dimension vector of image points. - \param c : 3 dimension vector of image points that correspond to the triangle corners. - */ -void vpTemplateTrackerTriangle::getCorners(std::vector<vpImagePoint> &c) const -{ - c.resize(3); - c[0].set_uv(C1.x, C1.y); - c[1].set_uv(C2.x, C2.y); - c[2].set_uv(C3.x, C3.y); -} - -/*! - Returns the coordinates of the triangle corners as a 2 dimension vector (x,y). - \param c1 : First corner. - \param c2 : Second corner. - \param c3 : Third corner. - */ -void vpTemplateTrackerTriangle::getCorners(vpColVector &c1,vpColVector &c2,vpColVector &c3) const -{ - c1=getCorner1(); - c2=getCorner2(); - c3=getCorner3(); -} - -/*! - Returns the coordinates of the triangle first corner. - \return A vector with dimension 2, that contains the coordinates (x,y) of the corner. - */ -vpColVector vpTemplateTrackerTriangle::getCorner1() const -{ - vpColVector c(2); - c[0]=C1.x; - c[1]=C1.y; - - return c; -} -/*! - Returns the coordinates of the triangle second corner. - \return A vector with dimension 2, that contains the coordinates (x,y) of the corner. - */ -vpColVector vpTemplateTrackerTriangle::getCorner2() const -{ - vpColVector c(2); - c[0]=C2.x; - c[1]=C2.y; - return c; -} - -/*! - Returns the coordinates of the triangle third corner. - \return A vector with dimension 2, that contains the coordinates (x,y) of the corner. - */ -vpColVector vpTemplateTrackerTriangle::getCorner3() const -{ - vpColVector c(2); - c[0]=C3.x; - c[1]=C3.y; - return c; -} - -/*! - Get the size of the triangle bounding box. - \param w : Bounding box width. - \param h : Bounding box height. - */ -void vpTemplateTrackerTriangle::getSize(double &w,double &h) const -{ - w=l_t; - h=h_t; -} -/*! - Get the size of the triangle bounding box. - \param w : Bounding box width. - \param h : Bounding box height. - */ -void vpTemplateTrackerTriangle::getSize(int &w,int &h) const -{ - w=(int)l_t+1; - h=(int)h_t+1; -} - -/*! - \return The minimal x coordinate (along the columns of the image) of the points that are in the triangle. - \sa getMaxx() - */ -double vpTemplateTrackerTriangle::getMinx() const -{ - return minx_temp-1; -} -/*! - \return The minimal y coordinate (along the rows of the image) of the points that are in the triangle. - \sa getMaxy() - */ -double vpTemplateTrackerTriangle::getMiny() const -{ - return miny_temp-1; -} -/*! - \return The maximal x coordinate (along the columns of the image) of the points that are in the triangle. - \sa getMinx() - */ -double vpTemplateTrackerTriangle::getMaxx() const -{ - return minx_temp+l_t+1; -} -/*! - \return The maximal y coordinate (along the rows of the image) of the points that are in the triangle. - \sa getMaxx() - */ -double vpTemplateTrackerTriangle::getMaxy() const -{ - return miny_temp+h_t+1; -} - - - +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Template tracker. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +#include <visp3/tt/vpTemplateTrackerTriangle.h> + +/*! + Default constructor. + */ +vpTemplateTrackerTriangle::vpTemplateTrackerTriangle() + : minx_temp(0), miny_temp(0), C1(), C2(), C3(), l_t(0), h_t(0), not_good(false), + uvinv00(0.), uvinv01(0.), uvinv10(0.), uvinv11(0.), marge_triangle(0.00001), area(0) +{ +} + +/*! + Copy constructor. + */ +vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(const vpTemplateTrackerTriangle& T) + : minx_temp(0), miny_temp(0), C1(), C2(), C3(), l_t(0), h_t(0), not_good(false), + uvinv00(0.), uvinv01(0.), uvinv10(0.), uvinv11(0.), marge_triangle(0.00001), area(0) +{ + *this = T; +} + +/*! + Copy operator. + */ +vpTemplateTrackerTriangle & vpTemplateTrackerTriangle::operator=(const vpTemplateTrackerTriangle& T) +{ + minx_temp=T.minx_temp; + miny_temp=T.miny_temp; + + l_t=T.l_t; + h_t=T.h_t; + C1.x=T.C1.x; + C1.y=T.C1.y; + C2.x=T.C2.x; + C2.y=T.C2.y; + C3.x=T.C3.x; + C3.y=T.C3.y; + //uvinv.resize(2,2); + //uvinv=T.uvinv; + //p_ds_uv.resize(2); + //p_ds_uv=T.p_ds_uv; + //ptempo.resize(2); + //ptempo=T.ptempo; + not_good=T.not_good; + + uvinv00=T.uvinv00; + uvinv01=T.uvinv01; + uvinv10=T.uvinv10; + uvinv11=T.uvinv11; + + marge_triangle = T.marge_triangle; + area = T.area; + + return (*this); +} + +/*! + Create a triangle from 3 corners. + \param c1 : First corner. + \param c2 : Second corner. + \param c3 : Third corner. + + The coordinates of the points are defined as a 2 dimension vector with coordinates (x,y). + */ +vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(const vpColVector &c1, + const vpColVector &c2, + const vpColVector &c3) + : minx_temp(0), miny_temp(0), C1(), C2(), C3(), l_t(0), h_t(0), not_good(false), + uvinv00(0.), uvinv01(0.), uvinv10(0.), uvinv11(0.), marge_triangle(0.00001), area(0) +{ + init(c1[0],c1[1],c2[0],c2[1],c3[0],c3[1]); +} +/*! + Return a triangle with coordinates that are down scaled by a factor 2. + */ +vpTemplateTrackerTriangle vpTemplateTrackerTriangle::getPyramidDown() const +{ + vpTemplateTrackerTriangle Ttemp; + Ttemp.init(C1.x/2.,C1.y/2.,C2.x/2.,C2.y/2.,C3.x/2.,C3.y/2.); + return Ttemp; +} + +/*! + Create a triangle from 3 corners with coordinates (x1,y1), (x2,y2), (x3,y3). + - x coordinate is along the columns + - y coordinate is along the rows. + */ +vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(int x1,int y1, int x2,int y2, int x3,int y3) + : minx_temp(0), miny_temp(0), C1(), C2(), C3(), l_t(0), h_t(0), not_good(false), + uvinv00(0.), uvinv01(0.), uvinv10(0.), uvinv11(0.), marge_triangle(0.00001), area(0) +{ + init(x1,y1,x2,y2,x3,y3); +} + +/*! + Create a triangle from 3 corners defined as image points. + \param c1 : First corner. + \param c2 : Second corner. + \param c3 : Third corner. + */ +vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(const vpImagePoint &c1, const vpImagePoint &c2, const vpImagePoint &c3) + : minx_temp(0), miny_temp(0), C1(), C2(), C3(), l_t(0), h_t(0), not_good(false), + uvinv00(0.), uvinv01(0.), uvinv10(0.), uvinv11(0.), marge_triangle(0.00001), area(0) +{ + init(c1.get_u(), c1.get_v(), c2.get_u(), c2.get_v(), c3.get_u(), c3.get_v()); +} + +/*! + Create a triangle from 3 corners with coordinates (x1,y1), (x2,y2), (x3,y3). + - x coordinate is along the columns + - y coordinate is along the rows. + */ +vpTemplateTrackerTriangle::vpTemplateTrackerTriangle(double x1,double y1, double x2,double y2, double x3,double y3) + : minx_temp(0), miny_temp(0), C1(), C2(), C3(), l_t(0), h_t(0), not_good(false), + uvinv00(0.), uvinv01(0.), uvinv10(0.), uvinv11(0.), marge_triangle(0.00001), area(0) +{ + init(x1,y1,x2,y2,x3,y3); +} +/*! + Initializes a triangle from 3 corners. + \param c1 : First corner. + \param c2 : Second corner. + \param c3 : Third corner. + + The coordinates of the points are defined as a 2 dimension vector with coordinates (x,y). + */ +void vpTemplateTrackerTriangle::init(const vpColVector &c1,const vpColVector &c2,const vpColVector &c3) +{ + init(c1[0],c1[1],c2[0],c2[1],c3[0],c3[1]); +} +/*! + Initializes a triangle from 3 corners defined as image points. + \param c1 : First corner. + \param c2 : Second corner. + \param c3 : Third corner. + */ +void vpTemplateTrackerTriangle::init(const vpImagePoint &c1, const vpImagePoint &c2, const vpImagePoint &c3) +{ + init(c1.get_u(), c1.get_v(), c2.get_u(), c2.get_v(), c3.get_u(), c3.get_v()); +} + +/*! + Initializes a triangle from 3 corners with coordinates (x1,y1), (x2,y2), (x3,y3). + - x coordinate is along the columns + - y coordinate is along the rows. + */ +void vpTemplateTrackerTriangle::init(int x1, int y1, int x2,int y2, int x3, int y3) +{ + init((double)x1,(double)y1,(double)x2,(double)y2,(double)x3,(double)y3); +} + +/*! + Initializes a triangle from 3 corners with coordinates (x1,y1), (x2,y2), (x3,y3). + - x coordinate is along the columns + - y coordinate is along the rows. + */ +void vpTemplateTrackerTriangle::init(double x1, double y1, double x2,double y2, double x3, double y3) +{ + C1.x=x1;C1.y=y1; + C2.x=x2;C2.y=y2; + C3.x=x3;C3.y=y3; + + double minx,miny,maxx,maxy; + //calcul du rectangle minimal contenant le triangle seletionne + minx=(x1<x2)?x1:x2; + miny=(y1<y2)?y1:y2; + minx=(minx<x3)?minx:x3; + miny=(miny<y3)?miny:y3; + maxx=(x1>x2)?x1:x2; + maxy=(y1>y2)?y1:y2; + maxx=(maxx>x3)?maxx:x3; + maxy=(maxy>y3)?maxy:y3; + + vpColVector u; + vpColVector v; + u.resize(2); + v.resize(2); + vpMatrix uv(2,2); + vpMatrix uvinv(2,2); + + u[0]=C2.x-C1.x; + u[1]=C2.y-C1.y; + + v[0]=C3.x-C1.x; + v[1]=C3.y-C1.y; + + uv[0][0]=u[0];uv[1][0]=v[0]; + uv[0][1]=u[1];uv[1][1]=v[1]; + try + { + uvinv=uv.inverseByLU(); + not_good=false; + } + catch(...) + { + not_good=true; + std::cout<<"Triangle vide"<<std::endl; + + } + uvinv00=uvinv[0][0]; + uvinv01=uvinv[0][1]; + uvinv10=uvinv[1][0]; + uvinv11=uvinv[1][1]; + + l_t=maxx-minx; + h_t=maxy-miny; + minx_temp=minx; + miny_temp=miny; + + marge_triangle = 0.00001; + area = 0.5 * fabs(uv.det()); +} + +//marge ajoutee a zone pour que sommet soit pris en compte + +/*! + Indicates if a point with coordinates (i,j) is in the triangle. + \param i : Coordinate along the rows. + \param j : Coordinate along the columns. + */ +bool vpTemplateTrackerTriangle::inTriangle(const int &i, const int &j) const +{ + if(not_good) + return false; + + /*ptempo[0]=j-C1.x; + ptempo[1]=i-C1.y; + + p_ds_uv=ptempo*uvinv; + return (p_ds_uv[0]+p_ds_uv[1]<1. && p_ds_uv[0]>0 && p_ds_uv[1]>0);*/ + + double ptempo0=j-C1.x; + double ptempo1=i-C1.y; + double p_ds_uv0=ptempo0*uvinv00+ptempo1*uvinv10; + double p_ds_uv1=ptempo0*uvinv01+ptempo1*uvinv11; + return (p_ds_uv0+p_ds_uv1<1.+marge_triangle && p_ds_uv0>-marge_triangle && p_ds_uv1>-marge_triangle); +} + +/*! + Indicates if a point with coordinates (i,j) is in the triangle. + \param i : Coordinate along the rows. + \param j : Coordinate along the columns. + */ +bool vpTemplateTrackerTriangle::inTriangle(const double &i, const double &j) const +{ + if(not_good) + return false; + /*ptempo[0]=j-C1.x; + ptempo[1]=i-C1.y; + + p_ds_uv=ptempo*uvinv; + return (p_ds_uv[0]+p_ds_uv[1]<1. && p_ds_uv[0]>0 && p_ds_uv[1]>0);*/ + double ptempo0=j-C1.x; + double ptempo1=i-C1.y; + double p_ds_uv0=ptempo0*uvinv00+ptempo1*uvinv10; + double p_ds_uv1=ptempo0*uvinv01+ptempo1*uvinv11; + return (p_ds_uv0+p_ds_uv1<1.+marge_triangle && p_ds_uv0>-marge_triangle && p_ds_uv1>-marge_triangle); +} + +/*! + Indicates if an image point is in the triangle. + \param ip : Image point to consider. + */ +bool vpTemplateTrackerTriangle::inTriangle(const vpImagePoint &ip) const +{ + return inTriangle(ip.get_i(), ip.get_j()); +} +/*! + Returns the coordinates of the triangle corners as an image point. + \param c1 : First corner. + \param c2 : Second corner. + \param c3 : Third corner. + */ +void vpTemplateTrackerTriangle::getCorners(vpImagePoint &c1, vpImagePoint &c2, vpImagePoint &c3) const +{ + c1.set_uv(C1.x, C1.y); + c2.set_uv(C2.x, C2.y); + c3.set_uv(C3.x, C3.y); +} + +/*! + Returns the coordinates of the triangle corners as a 3 dimension vector of image points. + \param c : 3 dimension vector of image points that correspond to the triangle corners. + */ +void vpTemplateTrackerTriangle::getCorners(std::vector<vpImagePoint> &c) const +{ + c.resize(3); + c[0].set_uv(C1.x, C1.y); + c[1].set_uv(C2.x, C2.y); + c[2].set_uv(C3.x, C3.y); +} + +/*! + Returns the coordinates of the triangle corners as a 2 dimension vector (x,y). + \param c1 : First corner. + \param c2 : Second corner. + \param c3 : Third corner. + */ +void vpTemplateTrackerTriangle::getCorners(vpColVector &c1,vpColVector &c2,vpColVector &c3) const +{ + c1=getCorner1(); + c2=getCorner2(); + c3=getCorner3(); +} + +/*! + Returns the coordinates of the triangle first corner. + \return A vector with dimension 2, that contains the coordinates (x,y) of the corner. + */ +vpColVector vpTemplateTrackerTriangle::getCorner1() const +{ + vpColVector c(2); + c[0]=C1.x; + c[1]=C1.y; + + return c; +} +/*! + Returns the coordinates of the triangle second corner. + \return A vector with dimension 2, that contains the coordinates (x,y) of the corner. + */ +vpColVector vpTemplateTrackerTriangle::getCorner2() const +{ + vpColVector c(2); + c[0]=C2.x; + c[1]=C2.y; + return c; +} + +/*! + Returns the coordinates of the triangle third corner. + \return A vector with dimension 2, that contains the coordinates (x,y) of the corner. + */ +vpColVector vpTemplateTrackerTriangle::getCorner3() const +{ + vpColVector c(2); + c[0]=C3.x; + c[1]=C3.y; + return c; +} + +/*! + Get the size of the triangle bounding box. + \param w : Bounding box width. + \param h : Bounding box height. + */ +void vpTemplateTrackerTriangle::getSize(double &w,double &h) const +{ + w=l_t; + h=h_t; +} +/*! + Get the size of the triangle bounding box. + \param w : Bounding box width. + \param h : Bounding box height. + */ +void vpTemplateTrackerTriangle::getSize(int &w,int &h) const +{ + w=(int)l_t+1; + h=(int)h_t+1; +} + +/*! + \return The minimal x coordinate (along the columns of the image) of the points that are in the triangle. + \sa getMaxx() + */ +double vpTemplateTrackerTriangle::getMinx() const +{ + return minx_temp-1; +} +/*! + \return The minimal y coordinate (along the rows of the image) of the points that are in the triangle. + \sa getMaxy() + */ +double vpTemplateTrackerTriangle::getMiny() const +{ + return miny_temp-1; +} +/*! + \return The maximal x coordinate (along the columns of the image) of the points that are in the triangle. + \sa getMinx() + */ +double vpTemplateTrackerTriangle::getMaxx() const +{ + return minx_temp+l_t+1; +} +/*! + \return The maximal y coordinate (along the rows of the image) of the points that are in the triangle. + \sa getMaxx() + */ +double vpTemplateTrackerTriangle::getMaxy() const +{ + return miny_temp+h_t+1; +} + + + diff --git a/src/tracking/template-tracker/tools/vpTemplateTrackerZone.cpp b/modules/tracker/tt/src/tools/vpTemplateTrackerZone.cpp similarity index 97% rename from src/tracking/template-tracker/tools/vpTemplateTrackerZone.cpp rename to modules/tracker/tt/src/tools/vpTemplateTrackerZone.cpp index 573786a84cbc7cb32b59a7d3bec24634ab5d7de7..6104472b59564949c41c2e5faec3c30f71b8c44b 100644 --- a/src/tracking/template-tracker/tools/vpTemplateTrackerZone.cpp +++ b/modules/tracker/tt/src/tools/vpTemplateTrackerZone.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerZone.cpp 5119 2015-01-05 10:02:46Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -42,13 +39,13 @@ #include <limits> // numeric_limits -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if VISP_HAVE_OPENCV_VERSION >= 0x020300 #include <opencv2/imgproc/imgproc.hpp> #endif -#include <visp/vpTemplateTrackerZone.h> +#include <visp3/tt/vpTemplateTrackerZone.h> /*! diff --git a/src/tracking/template-tracker/vpTemplateTracker.cpp b/modules/tracker/tt/src/vpTemplateTracker.cpp similarity index 97% rename from src/tracking/template-tracker/vpTemplateTracker.cpp rename to modules/tracker/tt/src/vpTemplateTracker.cpp index 8e85adcd14e2c33d9bde48ae8ab14a00eff58e2f..ebe2c3f95effee5590bf6c1ecdcd30ed66b79939 100644 --- a/src/tracking/template-tracker/vpTemplateTracker.cpp +++ b/modules/tracker/tt/src/vpTemplateTracker.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTracker.cpp 5062 2014-12-15 13:43:33Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -40,8 +37,8 @@ * *****************************************************************************/ -#include <visp/vpTemplateTracker.h> -#include <visp/vpTemplateTrackerBSpline.h> +#include <visp3/tt/vpTemplateTracker.h> +#include <visp3/tt/vpTemplateTrackerBSpline.h> vpTemplateTracker::vpTemplateTracker(vpTemplateTrackerWarp *_warp) : nbLvlPyr(1), l0Pyr(0), pyrInitialised(false), ptTemplate(NULL), ptTemplatePyr(NULL), @@ -324,8 +321,8 @@ void vpTemplateTracker::resetTracker() The following code shows how to use display capabilities: \code -#include <visp/vpTemplateTrackerSSDInverseCompositional.h> -#include <visp/vpTemplateTrackerWarpHomography.h> +#include <visp3/tt/vpTemplateTrackerSSDInverseCompositional.h> +#include <visp3/tt/vpTemplateTrackerWarpHomography.h> int main() { @@ -366,8 +363,8 @@ void vpTemplateTracker::display(const vpImage<unsigned char> &I, const vpColor& The following code shows how to use display capabilities: \code -#include <visp/vpTemplateTrackerSSDInverseCompositional.h> -#include <visp/vpTemplateTrackerWarpHomography.h> +#include <visp3/tt/vpTemplateTrackerSSDInverseCompositional.h> +#include <visp3/tt/vpTemplateTrackerWarpHomography.h> int main() { diff --git a/src/tracking/template-tracker/warp/vpTemplateTrackerWarp.cpp b/modules/tracker/tt/src/warp/vpTemplateTrackerWarp.cpp similarity index 90% rename from src/tracking/template-tracker/warp/vpTemplateTrackerWarp.cpp rename to modules/tracker/tt/src/warp/vpTemplateTrackerWarp.cpp index 23333ef44bf5a03f3012aee974df6be6894d308e..fcd205136ec711ed01036da1be6557d45df55528 100644 --- a/src/tracking/template-tracker/warp/vpTemplateTrackerWarp.cpp +++ b/modules/tracker/tt/src/warp/vpTemplateTrackerWarp.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerWarp.cpp 4782 2014-07-15 13:04:19Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,7 +36,7 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpTemplateTrackerWarp.h> +#include <visp3/tt/vpTemplateTrackerWarp.h> void vpTemplateTrackerWarp::warpTriangle(const vpTemplateTrackerTriangle &in,const vpColVector &p, vpTemplateTrackerTriangle &out) { @@ -152,7 +149,7 @@ void vpTemplateTrackerWarp::findWarp(const double *ut0,const double *vt0,const d vpMatrix::computeHLM(H, lambda, HLM); try{ - p+=HLM.inverseByLU()*G; + p+=(vpColVector)(HLM.inverseByLU()*G, 0); } catch(vpException &e) { //std::cout<<"Cannot inverse the matrix by LU " << std::endl; diff --git a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpAffine.cpp b/modules/tracker/tt/src/warp/vpTemplateTrackerWarpAffine.cpp similarity index 91% rename from src/tracking/template-tracker/warp/vpTemplateTrackerWarpAffine.cpp rename to modules/tracker/tt/src/warp/vpTemplateTrackerWarpAffine.cpp index 078f13cf5450ad857909bd922e7b28feb0affaca..6fa68eac6a9a53674ba5d5023260cc13b221ec3a 100644 --- a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpAffine.cpp +++ b/modules/tracker/tt/src/warp/vpTemplateTrackerWarpAffine.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerWarpAffine.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,7 +36,7 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpTemplateTrackerWarpAffine.h> +#include <visp3/tt/vpTemplateTrackerWarpAffine.h> vpTemplateTrackerWarpAffine::vpTemplateTrackerWarpAffine() diff --git a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpHomography.cpp b/modules/tracker/tt/src/warp/vpTemplateTrackerWarpHomography.cpp similarity index 92% rename from src/tracking/template-tracker/warp/vpTemplateTrackerWarpHomography.cpp rename to modules/tracker/tt/src/warp/vpTemplateTrackerWarpHomography.cpp index 46ad0f129a1e08276bbb2be49e924dca0be4a460..bac2f8587ceab77de5ae965798e5d6908381d8d3 100644 --- a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpHomography.cpp +++ b/modules/tracker/tt/src/warp/vpTemplateTrackerWarpHomography.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerWarpHomography.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,8 +36,8 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpTemplateTrackerWarpHomography.h> -#include <visp/vpTrackingException.h> +#include <visp3/tt/vpTemplateTrackerWarpHomography.h> +#include <visp3/core/vpTrackingException.h> vpTemplateTrackerWarpHomography::vpTemplateTrackerWarpHomography() { diff --git a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpHomographySL3.cpp b/modules/tracker/tt/src/warp/vpTemplateTrackerWarpHomographySL3.cpp similarity index 95% rename from src/tracking/template-tracker/warp/vpTemplateTrackerWarpHomographySL3.cpp rename to modules/tracker/tt/src/warp/vpTemplateTrackerWarpHomographySL3.cpp index 507fec221a4be1bd1b72f23e3ec107669f7f0f3c..cafde7e663467eebc6e2d999ddb49935822eb02d 100644 --- a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpHomographySL3.cpp +++ b/modules/tracker/tt/src/warp/vpTemplateTrackerWarpHomographySL3.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerWarpHomographySL3.cpp 4783 2014-07-15 13:07:52Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,7 +36,7 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpTemplateTrackerWarpHomographySL3.h> +#include <visp3/tt/vpTemplateTrackerWarpHomographySL3.h> //findWarp special a SL3 car methode additionnelle ne marche pas (la derivee n est calculable qu en p=0) // => resout le probleme de maniere compositionnelle @@ -292,7 +289,7 @@ void vpTemplateTrackerWarpHomographySL3::getdW0(const int &i,const int &j,const vpMatrix dhdx(1,3); dhdx=0; dhdx[0][0]=dx;dhdx[0][1]=dy;dhdx[0][2]=-j*dx-i*dy; - G.setIdentity(); + G.eye(); dGx=0; for(unsigned int par=0;par<3;par++) @@ -324,7 +321,7 @@ void vpTemplateTrackerWarpHomographySL3::getdWdp0(const int &i,const int &j,doub vpMatrix dhdx(2,3); dhdx=0; dhdx[0][0]=1.;dhdx[1][1]=1.;dhdx[0][2]=-j;dhdx[1][2]=-i; - G.setIdentity(); + G.eye(); dGx=0; for(unsigned int par=0;par<3;par++) @@ -353,7 +350,7 @@ void vpTemplateTrackerWarpHomographySL3::getdWdp0(const double &i,const double & vpMatrix dhdx(2,3); dhdx=0; dhdx[0][0]=1.;dhdx[1][1]=1.;dhdx[0][2]=-j;dhdx[1][2]=-i; - G.setIdentity(); + G.eye(); dGx=0; for(unsigned int par=0;par<3;par++) diff --git a/modules/tracker/tt/src/warp/vpTemplateTrackerWarpRT.cpp b/modules/tracker/tt/src/warp/vpTemplateTrackerWarpRT.cpp new file mode 100644 index 0000000000000000000000000000000000000000..52c21800eb1a82df4ed66a3101d0a5da41fa9c8c --- /dev/null +++ b/modules/tracker/tt/src/warp/vpTemplateTrackerWarpRT.cpp @@ -0,0 +1,177 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Template tracker. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +#include <visp3/tt/vpTemplateTrackerWarpRT.h> + + +vpTemplateTrackerWarpRT::vpTemplateTrackerWarpRT() +{ + nbParam = 3; + dW.resize(2,nbParam); +} + +//get the parameter corresponding to the lower level of a gaussian pyramid +void vpTemplateTrackerWarpRT::getParamPyramidDown(const vpColVector &p,vpColVector &pdown) +{ + pdown=p; + pdown[1]=p[1]/2.; + pdown[2]=p[2]/2.; +} + +void vpTemplateTrackerWarpRT::getParamPyramidUp(const vpColVector &p,vpColVector &pup) +{ + pup=p; + pup[1]=p[1]*2.; + pup[2]=p[2]*2.; +} +/*calcul de di*dw(x,p0)/dp +*/ +void vpTemplateTrackerWarpRT::getdW0(const int &i,const int &j,const double &dy,const double &dx,double *dIdW) +{ + // std::cout << "getdW0" << std::endl; + dIdW[0]=-i*dx + j*dy; + dIdW[1]=dx; + dIdW[2]=dy; +} +/*calcul de dw(x,p0)/dp +*/ +void vpTemplateTrackerWarpRT::getdWdp0(const int &i,const int &j,double *dIdW) +{ + dIdW[0]=-i; + dIdW[1]=1.; + dIdW[2]=0; + + dIdW[3]=j; + dIdW[4]=0; + dIdW[5]=1.; +} + +void vpTemplateTrackerWarpRT::warpX(const int &i,const int &j,double &i2,double &j2,const vpColVector &ParamM) +{ + j2=(cos(ParamM[0])*j) - (sin(ParamM[0])*i) + ParamM[1]; + i2=(sin(ParamM[0])*j) + (cos(ParamM[0])*i) + ParamM[2]; +} + + +void vpTemplateTrackerWarpRT::warpX(const vpColVector &vX,vpColVector &vXres,const vpColVector &ParamM) +{ + vXres[0]=(cos(ParamM[0])*vX[0]) - (sin(ParamM[0])*vX[1]) + ParamM[1]; + vXres[1]=(sin(ParamM[0])*vX[0]) + (cos(ParamM[0])*vX[1]) + ParamM[2]; +} + +void vpTemplateTrackerWarpRT::dWarp(const vpColVector &X1,const vpColVector &/*X2*/,const vpColVector &ParamM,vpMatrix &dW_) +{ + double j=X1[0]; + double i=X1[1]; + dW_=0; + dW_[0][0]=(-sin(ParamM[0])*j) - (cos(ParamM[0])*i); + dW_[0][1]=1; + + dW_[1][0]=cos(ParamM[0])*j - sin(ParamM[0])*i; + dW_[1][2]=1; +} + +/*compute dw=dw/dx*dw/dp +*/ +void vpTemplateTrackerWarpRT::dWarpCompo(const vpColVector &/*X1*/,const vpColVector &/*X2*/,const vpColVector &ParamM, + const double *dwdp0,vpMatrix &dW_) +{ + for(unsigned int i=0;i<nbParam;i++) + { + dW_[0][i]=(cos(ParamM[0])*dwdp0[i]) - (sin(ParamM[0])*dwdp0[i+nbParam]); + dW_[1][i]=(sin(ParamM[0])*dwdp0[i]) + (cos(ParamM[0])*dwdp0[i+nbParam]); + } +} + +void vpTemplateTrackerWarpRT::warpXInv(const vpColVector &vX,vpColVector &vXres,const vpColVector &ParamM) +{ + // std::cout << "warpXspe" << std::endl; + vXres[0]=(cos(ParamM[0])*vX[0]) - (sin(ParamM[0])*vX[1]) + ParamM[1]; + vXres[1]=(sin(ParamM[0])*vX[0]) + (cos(ParamM[0])*vX[1]) + ParamM[2]; +} + +void vpTemplateTrackerWarpRT::getParamInverse(const vpColVector &ParamM,vpColVector &ParamMinv) const +{ + vpColVector Trans(2); + vpMatrix MWrap(2,2); + Trans[0]=ParamM[1]; + Trans[1]=ParamM[2]; + MWrap[0][0]=cos(ParamM[0]); + MWrap[0][1]=-sin(ParamM[0]); + MWrap[1][0]=sin(ParamM[0]); + MWrap[1][1]=cos(ParamM[0]); + + vpMatrix MWrapInv(2,2); + MWrapInv=MWrap.transpose(); + vpColVector TransInv(2); + TransInv=(-1.0)*MWrapInv*Trans; + + ParamMinv[0]= atan2(MWrapInv[1][0],MWrapInv[1][1]); + ParamMinv[1]=TransInv[0]; + ParamMinv[2]=TransInv[1]; +} + +void vpTemplateTrackerWarpRT::pRondp(const vpColVector &p1, const vpColVector &p2,vpColVector &pres) const +{ + vpColVector Trans1(2); + vpMatrix MWrap1(2,2); + Trans1[0]=p1[1];Trans1[1]=p1[2]; + + MWrap1[0][0]=cos(p1[0]); + MWrap1[0][1]=-sin(p1[0]); + MWrap1[1][0]=sin(p1[0]); + MWrap1[1][1]=cos(p1[0]); + + vpColVector Trans2(2); + vpMatrix MWrap2(2,2); + Trans2[0]=p2[1];Trans2[1]=p2[1]; + + MWrap2[0][0]=cos(p2[0]); + MWrap2[0][1]=-sin(p2[0]); + MWrap2[1][0]=sin(p2[0]); + MWrap2[1][1]=cos(p2[0]); + + vpColVector TransRes(2); + vpMatrix MWrapRes(2,2); + TransRes=MWrap1*Trans2+Trans1; + MWrapRes=MWrap1*MWrap2; + + pres[0]=atan2(MWrapRes[1][0],MWrapRes[1][1]); + pres[1]=TransRes[0]; + pres[2]=TransRes[1]; +} diff --git a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpSRT.cpp b/modules/tracker/tt/src/warp/vpTemplateTrackerWarpSRT.cpp similarity index 92% rename from src/tracking/template-tracker/warp/vpTemplateTrackerWarpSRT.cpp rename to modules/tracker/tt/src/warp/vpTemplateTrackerWarpSRT.cpp index 6913eff1e994820747d9922b72c84afd8eb59104..b289f2ee9c503cc35ecba55ea423a9617ada568c 100644 --- a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpSRT.cpp +++ b/modules/tracker/tt/src/warp/vpTemplateTrackerWarpSRT.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerWarpSRT.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,7 +36,7 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpTemplateTrackerWarpSRT.h> +#include <visp3/tt/vpTemplateTrackerWarpSRT.h> vpTemplateTrackerWarpSRT::vpTemplateTrackerWarpSRT() diff --git a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpTranslation.cpp b/modules/tracker/tt/src/warp/vpTemplateTrackerWarpTranslation.cpp similarity index 88% rename from src/tracking/template-tracker/warp/vpTemplateTrackerWarpTranslation.cpp rename to modules/tracker/tt/src/warp/vpTemplateTrackerWarpTranslation.cpp index d61f8fc065cf516b8066b984d548d75603adf836..c0ad366a655efe17db7822b1f7cbe9e053cf2515 100644 --- a/src/tracking/template-tracker/warp/vpTemplateTrackerWarpTranslation.cpp +++ b/modules/tracker/tt/src/warp/vpTemplateTrackerWarpTranslation.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerWarpTranslation.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,7 +36,7 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpTemplateTrackerWarpTranslation.h> +#include <visp3/tt/vpTemplateTrackerWarpTranslation.h> vpTemplateTrackerWarpTranslation::vpTemplateTrackerWarpTranslation() { diff --git a/src/tracking/template-tracker/zncc/vpTemplateTrackerZNCC.cpp b/modules/tracker/tt/src/zncc/vpTemplateTrackerZNCC.cpp similarity index 87% rename from src/tracking/template-tracker/zncc/vpTemplateTrackerZNCC.cpp rename to modules/tracker/tt/src/zncc/vpTemplateTrackerZNCC.cpp index 1b14af265c20999e05003a9d1bb95e4a2089f4d4..1c683775429a294232861268ecad03b89689bb9a 100644 --- a/src/tracking/template-tracker/zncc/vpTemplateTrackerZNCC.cpp +++ b/modules/tracker/tt/src/zncc/vpTemplateTrackerZNCC.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerZNCC.cpp 4682 2014-02-24 07:56:27Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,7 +36,7 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpTemplateTrackerZNCC.h> +#include <visp3/tt/vpTemplateTrackerZNCC.h> vpTemplateTrackerZNCC::vpTemplateTrackerZNCC(vpTemplateTrackerWarp *warp) : vpTemplateTracker(warp), DI(), temp() @@ -57,7 +54,7 @@ vpTemplateTrackerZNCC::vpTemplateTrackerZNCC(vpTemplateTrackerWarp *warp) } -double vpTemplateTrackerZNCC::getCost(const vpImage<unsigned char> &I, vpColVector &tp) +double vpTemplateTrackerZNCC::getCost(const vpImage<unsigned char> &I, const vpColVector &tp) { double IW,Tij; int i,j; diff --git a/src/tracking/template-tracker/zncc/vpTemplateTrackerZNCCForwardAdditional.cpp b/modules/tracker/tt/src/zncc/vpTemplateTrackerZNCCForwardAdditional.cpp similarity index 94% rename from src/tracking/template-tracker/zncc/vpTemplateTrackerZNCCForwardAdditional.cpp rename to modules/tracker/tt/src/zncc/vpTemplateTrackerZNCCForwardAdditional.cpp index 98ab0ed8056a8a32a0160e4e3e7fa7c5f280c50a..1e17f811ca89565bb9ba49febf020496ecd1e7e7 100644 --- a/src/tracking/template-tracker/zncc/vpTemplateTrackerZNCCForwardAdditional.cpp +++ b/modules/tracker/tt/src/zncc/vpTemplateTrackerZNCCForwardAdditional.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerZNCCForwardAdditional.cpp 4783 2014-07-15 13:07:52Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -39,8 +36,8 @@ * Fabien Spindler * *****************************************************************************/ -#include <visp/vpTemplateTrackerZNCCForwardAdditional.h> -#include <visp/vpImageFilter.h> +#include <visp3/tt/vpTemplateTrackerZNCCForwardAdditional.h> +#include <visp3/core/vpImageFilter.h> vpTemplateTrackerZNCCForwardAdditional::vpTemplateTrackerZNCCForwardAdditional(vpTemplateTrackerWarp *warp):vpTemplateTrackerZNCC(warp) { diff --git a/src/tracking/template-tracker/zncc/vpTemplateTrackerZNCCInverseCompositional.cpp b/modules/tracker/tt/src/zncc/vpTemplateTrackerZNCCInverseCompositional.cpp similarity index 95% rename from src/tracking/template-tracker/zncc/vpTemplateTrackerZNCCInverseCompositional.cpp rename to modules/tracker/tt/src/zncc/vpTemplateTrackerZNCCInverseCompositional.cpp index 8d9cdcad9c7c7155fc048575e5b705ad06f67218..2ba051c69b23a1041dcecb2b8fcc2dfbead1d6a6 100644 --- a/src/tracking/template-tracker/zncc/vpTemplateTrackerZNCCInverseCompositional.cpp +++ b/modules/tracker/tt/src/zncc/vpTemplateTrackerZNCCInverseCompositional.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpTemplateTrackerZNCCInverseCompositional.cpp 5264 2015-02-04 13:49:55Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -41,8 +38,8 @@ *****************************************************************************/ #include <limits> // numeric_limits -#include <visp/vpTemplateTrackerZNCCInverseCompositional.h> -#include <visp/vpImageFilter.h> +#include <visp3/tt/vpTemplateTrackerZNCCInverseCompositional.h> +#include <visp3/core/vpImageFilter.h> vpTemplateTrackerZNCCInverseCompositional::vpTemplateTrackerZNCCInverseCompositional(vpTemplateTrackerWarp *warp) : vpTemplateTrackerZNCC(warp), compoInitialised(false), @@ -386,7 +383,7 @@ void vpTemplateTrackerZNCCInverseCompositional::trackNoPyr(const vpImage<unsigne deletePosEvalRMS(); } -void vpTemplateTrackerZNCCInverseCompositional::initPosEvalRMS(vpColVector &p_) +void vpTemplateTrackerZNCCInverseCompositional::initPosEvalRMS(const vpColVector &p_) { unsigned int nb_corners = zoneTracked->getNbTriangle() * 3; x_pos.resize(nb_corners); diff --git a/test/tools/CMakeLists.txt b/modules/tracker/tt_mi/CMakeLists.txt similarity index 59% rename from test/tools/CMakeLists.txt rename to modules/tracker/tt_mi/CMakeLists.txt index b1437dfea560519f173589e9ddf558ee06c9f819..42317762d68aef473e5d9248e2c282d6dc6951ca 100644 --- a/test/tools/CMakeLists.txt +++ b/modules/tracker/tt_mi/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeLists.txt 5255 2015-02-03 14:52:43Z strinh $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,43 +10,36 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: -# ViSP overall configuration file. +# ViSP configuration file. # # Authors: # Fabien Spindler # ############################################################################# -# Set SRC_SUBDIRS variable to all the sub directories we want to parse during -# the build process. -# -# If you add/remove a directory, modify here -SET (SRC_SUBDIRS - convert - io - geometry - time - xml -) +vp_define_module(tt_mi visp_tt) -# Build process propagation in the sub directories -SUBDIRS(${SRC_SUBDIRS}) +# The previous line is similar to the following: +#vp_add_module(tt_mi visp_tt) +#vp_glob_module_sources() +#vp_module_include_directories() +#vp_create_module() +#vp_add_tests() diff --git a/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMI.h b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMI.h new file mode 100644 index 0000000000000000000000000000000000000000..82b1dba97b80bbb69eae996a97ade977e74f36ea --- /dev/null +++ b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMI.h @@ -0,0 +1,172 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Example of template tracking. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +#ifndef vpTemplateTrackerMI_hh +#define vpTemplateTrackerMI_hh + +#include <visp3/core/vpConfig.h> + +#include <visp3/tt/vpTemplateTracker.h> +#include <visp3/tt/vpTemplateTrackerHeader.h> +#include <visp3/core/vpImageFilter.h> + +/*! + \class vpTemplateTrackerMI + \ingroup group_tt_mi_tracker +*/ +class VISP_EXPORT vpTemplateTrackerMI: public vpTemplateTracker +{ +public: + /*! Hessian approximation. */ + typedef enum { + HESSIAN_NONSECOND = -1, + HESSIAN_0, + HESSIAN_d2I, + HESSIAN_YOUCEF, + HESSIAN_EXACT, + HESSIAN_NEW + } vpHessienApproximationType; + + /*! Hessian computation. */ + typedef enum { + USE_HESSIEN_NORMAL, + USE_HESSIEN_DESIRE, + USE_HESSIEN_BEST_COND + } vpHessienType; + + /*! Hessian computation. */ + typedef enum { + BSPLINE_THIRD_ORDER = 3, + BSPLINE_FOURTH_ORDER = 4 + } vpBsplineType; + +protected: + vpHessienType hessianComputation; + vpHessienApproximationType ApproxHessian; + double lambda; + + double *temp; + double *Prt; + double *dPrt; + double *Pt; + double *Pr; + double *d2Prt; + double *PrtTout; + double *dprtemp; + + double *PrtD; + double *dPrtD; + int influBspline; + + int bspline; + //Nombre de couleur concidere dans l'histogramme + int Nc; + int Ncb; + + vpImage<double> d2Ix ; + vpImage<double> d2Iy ; + vpImage<double> d2Ixy ; + + double MI_preEstimation; + double MI_postEstimation; + + double NMI_preEstimation; + double NMI_postEstimation; + + vpMatrix covarianceMatrix; + bool computeCovariance; + +protected: + void computeGradient(); + void computeHessien(vpMatrix &H); + void computeHessienNormalized(vpMatrix &H); + void computeMI(double &MI); + void computeProba(int &nbpoint); + double getCost(const vpImage<unsigned char> &I, const vpColVector &tp); + double getCost(const vpImage<unsigned char> &I){return getCost(I,p);} + double getNormalizedCost(const vpImage<unsigned char> &I, const vpColVector &tp); + double getNormalizedCost(const vpImage<unsigned char> &I){return getNormalizedCost(I,p);} + virtual void initHessienDesired(const vpImage<unsigned char> &I)=0; + virtual void trackNoPyr(const vpImage<unsigned char> &I)=0; + void zeroProbabilities(); + +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpTemplateTrackerMI(const vpTemplateTrackerMI &) +// : vpTemplateTracker(), hessianComputation(USE_HESSIEN_NORMAL), ApproxHessian(HESSIAN_0), lambda(0), +// temp(NULL), Prt(NULL), dPrt(NULL), Pt(NULL), Pr(NULL), d2Prt(NULL), PrtTout(NULL), +// dprtemp(NULL), PrtD(NULL), dPrtD(NULL), influBspline(0), bspline(0), Nc(0), Ncb(0), +// d2Ix(), d2Iy(), d2Ixy(), MI_preEstimation(0), MI_postEstimation(0), +// NMI_preEstimation(0), NMI_postEstimation(0), covarianceMatrix(), computeCovariance(false) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpTemplateTrackerMI &operator=(const vpTemplateTrackerMI &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + +public: + //constructeur + //! Default constructor. + vpTemplateTrackerMI() + : vpTemplateTracker(), hessianComputation(USE_HESSIEN_NORMAL), ApproxHessian(HESSIAN_0), lambda(0), + temp(NULL), Prt(NULL), dPrt(NULL), Pt(NULL), Pr(NULL), d2Prt(NULL), PrtTout(NULL), + dprtemp(NULL), PrtD(NULL), dPrtD(NULL), influBspline(0), bspline(0), Nc(0), Ncb(0), + d2Ix(), d2Iy(), d2Ixy(), MI_preEstimation(0), MI_postEstimation(0), + NMI_preEstimation(0), NMI_postEstimation(0), covarianceMatrix(), computeCovariance(false) + {} + vpTemplateTrackerMI(vpTemplateTrackerWarp *_warp); + ~vpTemplateTrackerMI(); + vpMatrix getCovarianceMatrix() const { return covarianceMatrix; } + double getMI() const {return MI_postEstimation;} + double getMI(const vpImage<unsigned char> &I,int &nc, const int &bspline,vpColVector &tp); + double getMI256(const vpImage<unsigned char> &I, const vpColVector &tp); + double getNMI() const {return NMI_postEstimation;} + //initialisation du Hessien en position desiree + void setApprocHessian(vpHessienApproximationType approx){ApproxHessian=approx;} + void setCovarianceComputation(const bool & flag){ computeCovariance = flag; } + void setHessianComputation(vpHessienType type){hessianComputation=type;} + void setBspline(const vpBsplineType &newbs); + void setLambda(double _l) {lambda = _l ; } + void setNc(int newNc); +}; + +#endif + diff --git a/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIBSpline.h b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIBSpline.h new file mode 100644 index 0000000000000000000000000000000000000000..73b7f2debc34d3d23fb8b30dec2a16b1ff8c204c --- /dev/null +++ b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIBSpline.h @@ -0,0 +1,103 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Template tracker. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +/*! + \file vpTemplateTrackerMIBSpline.h + \brief +*/ + +#ifndef vpTemplateTrackerMIBSpline_hh +#define vpTemplateTrackerMIBSpline_hh + +#include <visp3/core/vpConfig.h> + +#include <visp3/core/vpImage.h> +#include <visp3/core/vpMath.h> +#include <visp3/tt/vpTemplateTrackerHeader.h> +#include <visp3/tt/vpTemplateTrackerBSpline.h> + +#include <visp3/tt_mi/vpTemplateTrackerMI.h> + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +class VISP_EXPORT vpTemplateTrackerMIBSpline +{ +public: + static void PutPVBsplineD(double *Prt, int cr, double er, int ct, double et,int Nc, double val, const int °re); + static void PutPVBsplineD3(double *Prt, int cr, double er, int ct, double et,int Nc, double val); + static void PutPVBsplineD4(double *Prt, int cr, double er, int ct, double et,int Nc, double val); + + static void PutTotPVBspline(double *Prt, int cr, double &er, int ct, double &et,int Nc, double *val, unsigned int &NbParam, int °ree); + static void PutTotPVBspline(double *Prt, double *dPrt, double *d2Prt, int cr, double &er, int ct, double &et,int Ncb, double *val, unsigned int &NbParam, int °ree); + static void PutTotPVBspline3(double *Prt, int cr, double &er, int ct, double &et,int Nc, double *val, unsigned int &NbParam); + static void PutTotPVBspline3(double *Prt, double *dPrt, double *d2Prt, int cr, double &er, int ct, double &et,int Ncb, double *val, unsigned int &NbParam); + static void PutTotPVBspline4(double *Prt, int cr, double er, int ct, double et,int Nc, double *val, unsigned int &NbParam); + static void PutTotPVBspline4(double *Prt, double *dPrt, double *d2Prt, int cr, double er, int ct, double et,int Ncb, double *val, unsigned int &NbParam); + + // AY Optimisation + static void PutTotPVBspline3(double *Prt, double &er, double *et, unsigned int NbParam); + static void PutTotPVBspline4(double *Prt, double &er, double *et, unsigned int NbParam); + // + + static void PutTotPVBsplineNoSecond(double *Prt, int &cr, double &er, int &ct, double &et,int &Nc, double *val, unsigned int &NbParam, int °ree); + static void PutTotPVBsplineNoSecond(double *Prt, double *dPrt, int &cr, double &er, int &ct, double &et,int &Ncb, double *val, unsigned int &NbParam, int °ree); + static void PutTotPVBspline3NoSecond(double *Prt, int &cr, double &er, int &ct, double &et,int &Nc, double *val, unsigned int &NbParam); + static void PutTotPVBspline3NoSecond(double *Prt, double *dPrt, int &cr, double &er, int &ct, double &et,int &Ncb, double *val, unsigned int &NbParam); + static void PutTotPVBspline4NoSecond(double *Prt, int &cr, double &er, int &ct, double &et,int &Nc, double *val, unsigned int &NbParam); + static void PutTotPVBspline4NoSecond(double *Prt, double *dPrt, int &cr, double &er, int &ct, double &et,int &Ncb, double *val, unsigned int &NbParam); + + static void PutTotPVBsplinePrtTout(double *Prt, int &cr, double &er, int &ct, double &et,int &Nc, unsigned int &NbParam, int °ree); + static void PutTotPVBspline3PrtTout(double *Prt, int &cr, double &er, int &ct, double &et,int &Nc, unsigned int &NbParam); + static void PutTotPVBspline4PrtTout(double *Prt, int &cr, double &er, int &ct, double &et,int &Nc, unsigned int &NbParam); + + static void PutTotPVBsplinePrt(double *Prt, int &cr, double &er, int &ct, double &et,int &Ncb, unsigned int &NbParam, int °ree); + static void PutTotPVBspline3Prt(double *Prt, int &cr, double &er, int &ct, double &et,int &Ncb); + static void PutTotPVBspline4Prt(double *Prt, int &cr, double &er, int &ct, double &et,int &Ncb); + + static double Bspline3(double diff); + static double Bspline4i(double diff,int &interv); + + static double dBspline3(double diff); + static double dBspline4(double diff); + + static double d2Bspline3(double diff); + static double d2Bspline4(double diff); +}; + +#endif +#endif diff --git a/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIESM.h b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIESM.h new file mode 100644 index 0000000000000000000000000000000000000000..e31e2c86c5a65eba469a46b3f300a8725f13f5fb --- /dev/null +++ b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIESM.h @@ -0,0 +1,105 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Example of template tracking. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +#ifndef vpTemplateTrackerMIESM_hh +#define vpTemplateTrackerMIESM_hh + + +#include <visp3/tt/vpTemplateTracker.h> +#include <visp3/tt/vpTemplateTrackerHeader.h> +#include <visp3/core/vpImageFilter.h> + +#include <visp3/tt_mi/vpTemplateTrackerMI.h> +#include <visp3/tt_mi/vpTemplateTrackerMIBSpline.h> + +/*! + \class vpTemplateTrackerMIESM + \ingroup group_tt_mi_tracker +*/ +class VISP_EXPORT vpTemplateTrackerMIESM: public vpTemplateTrackerMI +{ + /*! Minimization method. */ + typedef enum { + USE_NEWTON, // not used + USE_LMA, // not used + USE_GRADIENT, + USE_QUASINEWTON //not used => see default equivalence + } vpMinimizationTypeMIESM; + +protected: + vpMinimizationTypeMIESM minimizationMethod; + bool CompoInitialised; + vpMatrix HDirect; + vpMatrix HInverse; + vpMatrix HdesireDirect; + vpMatrix HdesireInverse; + vpColVector GDirect; + vpColVector GInverse; + +protected: + void initCompInverse(); + void initHessienDesired(const vpImage<unsigned char> &I); + void trackNoPyr(const vpImage<unsigned char> &I); + +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpTemplateTrackerMIESM(const vpTemplateTrackerMIESM &) +// : vpTemplateTrackerMI(), minimizationMethod(USE_NEWTON), CompoInitialised(false), +// HDirect(), HInverse(), HdesireDirect(), HdesireInverse(), GDirect(), GInverse() +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpTemplateTrackerMIESM &operator=(const vpTemplateTrackerMIESM &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + +public: + //! Default constructor. + vpTemplateTrackerMIESM() + : vpTemplateTrackerMI(), minimizationMethod(USE_NEWTON), CompoInitialised(false), + HDirect(), HInverse(), HdesireDirect(), HdesireInverse(), GDirect(), GInverse() + {} + vpTemplateTrackerMIESM(vpTemplateTrackerWarp *_warp); + + void setMinimizationMethod(vpMinimizationTypeMIESM method){minimizationMethod=method;} +}; + +#endif + diff --git a/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIForwardAdditional.h b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIForwardAdditional.h new file mode 100644 index 0000000000000000000000000000000000000000..968aec35d9b5fe51cf10a51490b5e82ec587e4ac --- /dev/null +++ b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIForwardAdditional.h @@ -0,0 +1,111 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Example of template tracking. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +#ifndef vpTemplateTrackerMIForwardAdditional_hh +#define vpTemplateTrackerMIForwardAdditional_hh + +#include <visp3/core/vpConfig.h> + +#include <visp3/tt/vpTemplateTracker.h> +#include <visp3/tt/vpTemplateTrackerHeader.h> +#include <visp3/core/vpImageFilter.h> + +#include <visp3/tt_mi/vpTemplateTrackerMIBSpline.h> +#include <visp3/tt_mi/vpTemplateTrackerMI.h> + +/*! + \class vpTemplateTrackerMIForwardAdditional + \ingroup group_tt_mi_tracker +*/ +class VISP_EXPORT vpTemplateTrackerMIForwardAdditional: public vpTemplateTrackerMI +{ +public: + /*! Minimization method. */ + typedef enum { + USE_NEWTON, + USE_LMA, + USE_GRADIENT, + USE_QUASINEWTON + } vpMinimizationTypeMIForwardAdditional; + +private: + vpMinimizationTypeMIForwardAdditional minimizationMethod; + //pour eval evolRMS + double evolRMS; + double *x_pos; + double *y_pos; + double threshold_RMS; + //valeur pour calculer Quasi_Newton + vpColVector p_prec; + vpColVector G_prec; + vpMatrix KQuasiNewton; + +protected: + void initHessienDesired(const vpImage<unsigned char> &I); + void trackNoPyr(const vpImage<unsigned char> &I); + void deletePosEvalRMS(); + void computeEvalRMS(const vpColVector &p); + void initPosEvalRMS(const vpColVector &p); + +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpTemplateTrackerMIForwardAdditional(const vpTemplateTrackerMIForwardAdditional &) +// : vpTemplateTrackerMI(), minimizationMethod(USE_NEWTON), evolRMS(0), x_pos(NULL), y_pos(NULL), +// threshold_RMS(0), p_prec(), G_prec(), KQuasiNewton() +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpTemplateTrackerMIForwardAdditional &operator=(const vpTemplateTrackerMIForwardAdditional &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + +public: + //! Default constructor. + vpTemplateTrackerMIForwardAdditional() + : vpTemplateTrackerMI(), minimizationMethod(USE_NEWTON), evolRMS(0), x_pos(NULL), y_pos(NULL), + threshold_RMS(0), p_prec(), G_prec(), KQuasiNewton() + {} + vpTemplateTrackerMIForwardAdditional(vpTemplateTrackerWarp *_warp); + void setThresholdRMS(double threshold){threshold_RMS=threshold;} + void setMinimizationMethod(vpMinimizationTypeMIForwardAdditional method){minimizationMethod=method;} +}; + +#endif + diff --git a/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIForwardCompositional.h b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIForwardCompositional.h new file mode 100644 index 0000000000000000000000000000000000000000..62ad41685a30b125b37e021e6175379a59f23f4a --- /dev/null +++ b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIForwardCompositional.h @@ -0,0 +1,70 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Example of template tracking. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +#ifndef vpTemplateTrackerMIForwardCompositional_hh +#define vpTemplateTrackerMIForwardCompositional_hh + +#include <visp3/core/vpConfig.h> + +#include <visp3/tt/vpTemplateTracker.h> +#include <visp3/tt/vpTemplateTrackerHeader.h> +#include <visp3/core/vpImageFilter.h> + +#include <visp3/tt_mi/vpTemplateTrackerMI.h> +#include <visp3/tt_mi/vpTemplateTrackerMIBSpline.h> + +/*! + \class vpTemplateTrackerMIForwardCompositional + \ingroup group_tt_mi_tracker +*/ +class VISP_EXPORT vpTemplateTrackerMIForwardCompositional: public vpTemplateTrackerMI +{ +protected: + bool CompoInitialised; + +protected: + void initCompo(); + void initHessienDesired(const vpImage<unsigned char> &I); + void trackNoPyr(const vpImage<unsigned char> &I); + +public: + vpTemplateTrackerMIForwardCompositional(vpTemplateTrackerWarp *_warp); +}; + +#endif + diff --git a/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIInverseCompositional.h b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIInverseCompositional.h new file mode 100644 index 0000000000000000000000000000000000000000..b6cc39a11358b15c86ea92a7ecc4550ce5bcac83 --- /dev/null +++ b/modules/tracker/tt_mi/include/visp3/tt_mi/vpTemplateTrackerMIInverseCompositional.h @@ -0,0 +1,121 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Example of template tracking. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +#ifndef vpTemplateTrackerMIInverseCompositional_hh +#define vpTemplateTrackerMIInverseCompositional_hh + +#include <visp3/core/vpConfig.h> + +#include <visp3/tt/vpTemplateTracker.h> +#include <visp3/tt/vpTemplateTrackerHeader.h> +#include <visp3/core/vpImageFilter.h> + +#include <visp3/tt_mi/vpTemplateTrackerMI.h> +#include <visp3/tt_mi/vpTemplateTrackerMIBSpline.h> + +/*! + \class vpTemplateTrackerMIInverseCompositional + \ingroup group_tt_mi_tracker +*/ +class VISP_EXPORT vpTemplateTrackerMIInverseCompositional: public vpTemplateTrackerMI +{ +public: + /*! Minimization method. */ + typedef enum { + USE_NEWTON, + USE_LMA, + USE_GRADIENT, + USE_QUASINEWTON + } vpMinimizationTypeMIInverseCompositional; + +private: + vpMinimizationTypeMIInverseCompositional minimizationMethod; + bool CompoInitialised; + bool useTemplateSelect;//use only the strong gradient pixels to compute the Jabocian + //pour eval evolRMS + double evolRMS; + double *x_pos; + double *y_pos; + double threshold_RMS; + //valeur pour calculer Quasi_Newton + vpColVector p_prec; + vpColVector G_prec; + vpMatrix KQuasiNewton; + + //bool useAYOptim; + +public: // AY Optimisation + void initTemplateRefBspline(unsigned int ptIndex, double &et); + +protected: + void initCompInverse(const vpImage<unsigned char> &I); + void initHessienDesired(const vpImage<unsigned char> &I); + void trackNoPyr(const vpImage<unsigned char> &I); + void deletePosEvalRMS(); + void computeEvalRMS(const vpColVector &p); + void initPosEvalRMS(const vpColVector &p); + +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpTemplateTrackerMIInverseCompositional(const vpTemplateTrackerMIInverseCompositional &) +// : vpTemplateTrackerMI(), minimizationMethod(USE_LMA), CompoInitialised(false), useTemplateSelect(false), +// evolRMS(0), x_pos(NULL), y_pos(NULL), threshold_RMS(0), p_prec(), G_prec(), KQuasiNewton()//, useAYOptim(false) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpTemplateTrackerMIInverseCompositional &operator=(const vpTemplateTrackerMIInverseCompositional &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + +public: + //! Default constructor. + vpTemplateTrackerMIInverseCompositional() + : vpTemplateTrackerMI(), minimizationMethod(USE_LMA), CompoInitialised(false), useTemplateSelect(false), + evolRMS(0), x_pos(NULL), y_pos(NULL), threshold_RMS(0), p_prec(), G_prec(), KQuasiNewton()//, useAYOptim(false) + {} + vpTemplateTrackerMIInverseCompositional(vpTemplateTrackerWarp *_warp); + + /*! Use only the strong gradient pixels to compute the Jabobian. By default this feature is disabled. */ + void setUseTemplateSelect(bool b) {useTemplateSelect = b;} + void setThresholdRMS(double threshold){threshold_RMS=threshold;} + void setMinimizationMethod(vpMinimizationTypeMIInverseCompositional method){minimizationMethod=method;} +}; +#endif + diff --git a/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMI.cpp b/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMI.cpp new file mode 100644 index 0000000000000000000000000000000000000000..526e5c7ae964abef1e42bf9565297e436677f96e --- /dev/null +++ b/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMI.cpp @@ -0,0 +1,859 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Example of template tracking. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +#include <visp3/core/vpException.h> +#include <visp3/tt_mi/vpTemplateTrackerMI.h> +#include <visp3/tt_mi/vpTemplateTrackerMIBSpline.h> + +void vpTemplateTrackerMI::setBspline(const vpBsplineType &newbs) +{ + bspline=(int)newbs; + influBspline=bspline*bspline; + Ncb=Nc+bspline; + if (Pt) delete[] Pt; + if (Pr) delete[] Pr; + if (Prt) delete[] Prt; + if (dPrt) delete[] dPrt; + if (d2Prt) delete[] d2Prt; + if (PrtD) delete[] PrtD; + if (dPrtD) delete[] dPrtD; + if (PrtTout) delete[] PrtTout; + + Pt= new double[Ncb]; + Pr= new double[Ncb]; + + Prt= new double[Ncb*Ncb]; + dPrt= new double[Ncb*Ncb*(int)(nbParam)]; + d2Prt= new double[Ncb*Ncb*(int)(nbParam*nbParam)]; + + /*std::cout<<Nc*Nc*influBspline<<std::endl;std::cout<<Nc*Nc*nbParam*influBspline<<std::endl;*/ + PrtD= new double[Nc*Nc*influBspline]; + dPrtD= new double[Nc*Nc*(int)(nbParam)*influBspline]; + PrtTout= new double[Nc*Nc*influBspline*(1+(int)(nbParam+nbParam*nbParam))]; + + hessianComputation=USE_HESSIEN_DESIRE; +} + + +vpTemplateTrackerMI::vpTemplateTrackerMI(vpTemplateTrackerWarp *_warp) + : vpTemplateTracker(_warp), hessianComputation(USE_HESSIEN_NORMAL), ApproxHessian(HESSIAN_NEW), lambda(0), + temp(NULL), Prt(NULL), dPrt(NULL), Pt(NULL), Pr(NULL), d2Prt(NULL), PrtTout(NULL), + dprtemp(NULL), PrtD(NULL), dPrtD(NULL), influBspline(0), bspline(3), Nc(8), Ncb(0), + d2Ix(), d2Iy(), d2Ixy(), MI_preEstimation(0), MI_postEstimation(0), + NMI_preEstimation(0), NMI_postEstimation(0), covarianceMatrix(), computeCovariance(false) +{ + Ncb=Nc+bspline; + influBspline=bspline*bspline; + + dW.resize(2,nbParam); + H.resize(nbParam,nbParam); + G.resize(nbParam); + Hdesire.resize(nbParam,nbParam); + HLM.resize(nbParam,nbParam); + HLMdesire.resize(nbParam,nbParam); + dprtemp= new double[nbParam]; + temp= new double[nbParam]; + + X1.resize(2); + X2.resize(2); + + PrtD= new double[Nc*Nc*influBspline];//(r,t) + dPrtD= new double[Nc*Nc*(int)(nbParam)*influBspline]; + + Prt= new double[Ncb*Ncb];//(r,t) + Pt= new double[Ncb]; + Pr= new double[Ncb]; + dPrt= new double[Ncb*Ncb*(int)(nbParam)]; + d2Prt= new double[Ncb*Ncb*(int)(nbParam*nbParam)]; + + PrtTout= new double[Nc*Nc*influBspline*(1+(int)(nbParam+nbParam*nbParam))]; + + lambda=lambdaDep; +} + +void vpTemplateTrackerMI::setNc(int nc) +{ + Nc=nc; + Ncb=Nc+bspline; + + if (Pt) delete[] Pt; + if (Pr) delete[] Pr; + if (Prt) delete[] Prt; + if (dPrt) delete[] dPrt; + if (d2Prt) delete[] d2Prt; + if (PrtD) delete[] PrtD; + if (dPrtD) delete[] dPrtD; + if (PrtTout) delete[] PrtTout; + + PrtD= new double[Nc*Nc*influBspline];//(r,t) + dPrtD= new double[Nc*Nc*(int)(nbParam)*influBspline]; + Prt= new double[Ncb*Ncb];//(r,t) + dPrt= new double[Ncb*Ncb*(int)(nbParam)]; + Pt= new double[Ncb]; + Pr= new double[Ncb]; + d2Prt= new double[Ncb*Ncb*(int)(nbParam*nbParam)];//(r,t) + PrtTout= new double[Nc*Nc*influBspline*(1+(int)(nbParam+nbParam*nbParam))]; +} + + +double vpTemplateTrackerMI::getCost(const vpImage<unsigned char> &I, const vpColVector &tp) +{ + double MI=0; + int Nbpoint=0; + double i2,j2; + double Tij; + double IW; + + int i,j; + int cr,ct; + double er,et; + unsigned int Ncb_ = (unsigned int) Ncb; + + memset(Prt, 0, Ncb*Ncb*sizeof(double)); + memset(PrtD, 0, Nc*Nc*influBspline*sizeof(double)); + + //Warp->ComputeMAtWarp(tp); + Warp->computeCoeff(tp); + for(unsigned int point=0;point<templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + + Warp->computeDenom(X1,tp); + Warp->warpX(X1,X2,tp); + j2=X2[0];i2=X2[1]; + + //Tij=Templ[i-(int)Triangle->GetMiny()][j-(int)Triangle->GetMinx()]; + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth()-1)) + { + Nbpoint++; + + Tij=ptTemplate[point].val; + if(!blur) + IW=I.getValue(i2,j2); + else + IW=BI.getValue(i2,j2); + + cr=(int)((IW*(Nc-1))/255.); + ct=(int)((Tij*(Nc-1))/255.); + er=(IW*(Nc-1))/255.-cr; + et=((double)Tij*(Nc-1))/255.-ct; + + //Calcul de l'histogramme joint par interpolation bilinÈaire (Bspline ordre 1) + vpTemplateTrackerMIBSpline::PutPVBsplineD(PrtD, cr, er, ct, et, Nc, 1.,bspline); + } + } + + ratioPixelIn=(double)Nbpoint/(double)templateSize; + + double *pt=PrtD; + for(int r=0;r<Nc;r++) + for(int t=0;t<Nc;t++) + { + for(i=0;i<influBspline;i++) + { + int r2,t2; + r2=r+i/bspline; + t2=t+i%bspline; + Prt[r2*Ncb+t2]+=*pt; + + pt++; + } + } + + if(Nbpoint==0) + return 0; + for(unsigned int r=0;r<Ncb_;r++) + for(unsigned int t=0;t<Ncb_;t++) + //printf("%f ",Prt[r*Ncb+t]); + Prt[r*Ncb_+t]=Prt[r*Ncb_+t]/Nbpoint; + //calcul Pr; + memset(Pr, 0, Ncb_*sizeof(double)); + for(unsigned int r=0;r<Ncb_;r++) + { + for(unsigned int t=0;t<Ncb_;t++) + Pr[r]+=Prt[r*Ncb_+t]; + } + + //calcul Pt; + memset(Pt, 0, Ncb_*sizeof(double)); + for(unsigned int t=0;t<Ncb_;t++) + { + for(unsigned int r=0;r<Ncb_;r++) + Pt[t]+=Prt[r*Ncb_+t]; + } + for(unsigned int r=0;r<Ncb_;r++) + //if(Pr[r]!=0) + if(std::fabs(Pr[r]) > std::numeric_limits<double>::epsilon()) + MI-=Pr[r]*log(Pr[r]); + + for(unsigned int t=0;t<Ncb_;t++) + //if(Pt[t]!=0) + if(std::fabs(Pt[t]) > std::numeric_limits<double>::epsilon()) + MI-=Pt[t]*log(Pt[t]); + + for(unsigned int r=0;r<Ncb_;r++) + for(unsigned int t=0;t<Ncb_;t++) + //if(Prt[r*Ncb+t]!=0) + if(std::fabs(Prt[r*Ncb_+t]) > std::numeric_limits<double>::epsilon()) + MI+=Prt[r*Ncb_+t]*log(Prt[r*Ncb_+t]); + + return -MI; +} + +double vpTemplateTrackerMI::getNormalizedCost(const vpImage<unsigned char> &I, const vpColVector &tp) +{ + // Attention, cette version calculée de la NMI ne pourra pas atteindre le maximum de 2 + // Ceci est du au fait que par defaut, l'image est floutée dans vpTemplateTracker::initTracking() + + double MI=0; + double Nbpoint=0; + double i2,j2; + double Tij; + double IW; + + double Pr_[256]; + double Pt_[256]; + double Prt_[256][256]; + + memset(Pr_, 0, 256*sizeof(double)); + memset(Pt_, 0, 256*sizeof(double)); + memset(Prt_, 0, 256*256*sizeof(double)); + + for(unsigned int point=0;point<templateSize;point++) + { + int i=ptTemplate[point].y; + int j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + + Warp->computeDenom(X1,tp); + Warp->warpX(X1,X2,tp); + j2=X2[0];i2=X2[1]; + + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth()-1)) + { + Nbpoint++; + Tij=ptTemplate[point].val; + if(!blur) + IW=I[(int)i2][(int)j2]; + else + IW=BI.getValue(i2,j2); + + Pr_[(int)Tij]++; + Pt_[(int)IW]++; + Prt_[(int)Tij][(int)IW]++; + } + } + + for(int i = 0 ; i < 256 ; i++) + { + Pr_[i] /= Nbpoint; + Pt_[i] /= Nbpoint; + for(int j = 0 ; j < 256 ; j++) + Prt_[i][j] /= Nbpoint; + } + + for(int r=0;r<256;r++) + //if(Pr_[r]!=0) + if(std::fabs(Pr_[r]) > std::numeric_limits<double>::epsilon()) + MI-=Pr_[r]*log(Pr_[r]); + + for(int t=0;t<256;t++) + //if(Pt_[t]!=0) + if(std::fabs(Pt_[t]) > std::numeric_limits<double>::epsilon()) + MI-=Pt_[t]*log(Pt_[t]); + + double denom = 0; + for(int r=0;r<256;r++) + for(int t=0;t<256;t++) + //if(Prt_[r][t]!=0) + if(std::fabs(Prt_[r][t]) > std::numeric_limits<double>::epsilon()) + denom-=(Prt_[r][t]*log(Prt_[r][t])); + + //if(denom != 0) + if(std::fabs(denom) > std::numeric_limits<double>::epsilon()) + MI = MI/denom; + else MI = 0; + + return -MI; +} + +vpTemplateTrackerMI::~vpTemplateTrackerMI() +{ + if (Pt) delete[] Pt; + if (Pr) delete[] Pr; + if (Prt) delete[] Prt; + if (dPrt) delete[] dPrt; + if (d2Prt) delete[] d2Prt; + if (PrtD) delete[] PrtD; + if (dPrtD) delete[] dPrtD; + if (PrtTout) delete[] PrtTout; + if (temp) delete[] temp; + if (dprtemp) delete[] dprtemp; +} + +void vpTemplateTrackerMI::computeProba(int &nbpoint) +{ + double *pt=PrtTout; + unsigned int Nc_ = (unsigned int)Nc; + unsigned int Ncb_ = (unsigned int)Ncb; + unsigned int bspline_ = (unsigned int)bspline; + + for(unsigned int r=0;r<Nc_;r++) { + for(unsigned int t=0;t<Nc_;t++) + { + for(unsigned int r2=0;r2<bspline_;r2++) { + for(unsigned int t2=0;t2<bspline_;t2++) + { + Prt[((r2+r)*Ncb_+(t2+t))]+=*pt++; + for(unsigned int ip=0;ip<nbParam;ip++) + { + dPrt[((r2+r)*Ncb_+(t2+t))*nbParam+ip]+=*pt++; + for(unsigned int it=0;it<nbParam;it++){ + d2Prt[((r2+r)*Ncb_+(t2+t))*nbParam*nbParam+ip*nbParam+it]+=*pt++; + } + } + } + } + } + } + + // for(unsigned int r=0;r<Nc;r++) + // for(unsigned int t=0;t<Nc;t++) + // { + // for(int r2=0;r2<bspline;r2++) + // for(int t2=0;t2<bspline;t2++) + // { + // Prt[((r2+r)*Ncb+(t2+t))]+=*pt++; + // for(int ip=0;ip<nbParam;ip++) + // { + // dPrt[((r2+r)*Ncb+(t2+t))*nbParam+ip]+=*pt++; + // } + // for(int ip=0;ip<nbParam;ip++) + // { + // for(int it=0;it<nbParam;it++) + // d2Prt[((r2+r)*Ncb+(t2+t))*nbParam*nbParam+ip*nbParam+it]+=*pt++; + // } + // } + // } + + // int vr2, vt2, vt2ip; + // for(unsigned int r=0;r<Nc;r++) + // for(unsigned int t=0;t<Nc;t++) + // { + // for(int r2=0;r2<bspline;r2++) + // { + // vr2 = (r2+r)*Ncb; + // for(int t2=0;t2<bspline;t2++) + // { + // vt2 = vr2+(t2+t); + // Prt[vt2]+=*pt++; + // vt2 *= nbParam; + + // for(int ip=0;ip<nbParam;ip++) + // dPrt[vt2+ip]+=*pt++; + + // for(int ip=0;ip<nbParam;ip++) + // { + // vt2ip = vt2*nbParam+ip*nbParam; + // for(int it=0;it<nbParam;it++) + // d2Prt[vt2ip+it]+=*pt++; + // } + // } + // } + // } + + if(nbpoint==0) { + //std::cout<<"plus de point dans template suivi"<<std::endl; + throw(vpTrackingException(vpTrackingException::notEnoughPointError, "No points in the template")); + } + unsigned int indd, indd2; + indd = indd2 = 0; + for(int i=0;i<Ncb*Ncb;i++){ + Prt[i]=Prt[i]/nbpoint; + for(unsigned int j=0;j<nbParam;j++){ + dPrt[indd]=dPrt[indd]/nbpoint; + indd++; + for(unsigned int k=0;k<nbParam;k++){ + d2Prt[indd2]=d2Prt[indd2]/nbpoint; + indd2++; + } + } + } +} + +void vpTemplateTrackerMI::computeMI(double &MI) +{ + unsigned int Ncb_ = (unsigned int) Ncb; + + //calcul Pr; + memset(Pr, 0, Ncb_*sizeof(double)); + for(unsigned int r=0;r<Ncb_;r++) + { + for(unsigned int t=0;t<Ncb_;t++) + Pr[r]+=Prt[r*Ncb_+t]; + } + + //calcul Pt; + memset(Pt, 0, Ncb_*sizeof(double)); + for(unsigned int t=0;t<Ncb_;t++) + { + for(unsigned int r=0;r<Ncb_;r++) + Pt[t]+=Prt[r*Ncb_+t]; + } + + //calcul Entropies; + double entropieI=0; + for(unsigned int r=0;r<Ncb_;r++) + { + //if(Pr[r]!=0) + if(std::fabs(Pr[r]) > std::numeric_limits<double>::epsilon()) + { + entropieI-=Pr[r]*log(Pr[r]); + MI-=Pr[r]*log(Pr[r]); + } + } + + double entropieT=0; + for(unsigned int t=0;t<Ncb_;t++) + { + //if(Pt[t]!=0) + if(std::fabs(Pt[t]) > std::numeric_limits<double>::epsilon()) + { + entropieT-=Pt[t]*log(Pt[t]); + MI-=Pt[t]*log(Pt[t]); + } + } + + for(unsigned int r=0;r<Ncb_;r++) + for(unsigned int t=0;t<Ncb_;t++) + //if(Prt[r*Ncb+t]!=0) + if(std::fabs(Prt[r*Ncb_+t]) > std::numeric_limits<double>::epsilon()) + MI+=Prt[r*Ncb_+t]*log(Prt[r*Ncb_+t]); +} + +void vpTemplateTrackerMI::computeHessien(vpMatrix &Hessian) +{ + double seuilevitinf=1e-200; + Hessian=0; + double dtemp; + unsigned int Ncb_ = (unsigned int)Ncb; + for(unsigned int t=0;t<Ncb_;t++) + { + //if(Pt[t]!=0) + if(Pt[t]>seuilevitinf) + { + for(unsigned int r=0;r<Ncb_;r++) + { + //if(Prt[r*Ncb+t]!=0) + if(Prt[r*Ncb_+t]>seuilevitinf) + { + for(unsigned int it=0;it<nbParam;it++) + dprtemp[it]=dPrt[(r*Ncb_+t)*nbParam+it]; + + dtemp=1.+log(Prt[r*Ncb_+t]/Pt[t]); + for(unsigned int it=0;it<nbParam;it++) + for(unsigned int jt=0;jt<nbParam;jt++) + if(ApproxHessian!=HESSIAN_NONSECOND && ApproxHessian!=HESSIAN_NEW) + Hessian[it][jt]+=dprtemp[it]*dprtemp[jt]*(1./Prt[r*Ncb_+t]-1./Pt[t])+d2Prt[(r*Ncb_+t)*nbParam*nbParam+it*nbParam+jt]*dtemp; + else if(ApproxHessian==HESSIAN_NEW) + Hessian[it][jt]+=d2Prt[(r*Ncb_+t)*nbParam*nbParam+it*nbParam+jt]*dtemp; + else + Hessian[it][jt]+=dprtemp[it]*dprtemp[jt]*(1./Prt[r*Ncb_+t]-1./Pt[t]); + /*std::cout<<"Prt[r*Ncb+t]="<<Prt[r*Ncb+t]<<std::endl; + std::cout<<"Pt[t]="<<Pt[t]<<std::endl; + + std::cout<<"Hessian="<<Hessian<<std::endl;*/ + } + } + } + } + // std::cout<<"Hessian="<<Hessian<<std::endl; +} + +void vpTemplateTrackerMI::computeHessienNormalized(vpMatrix &Hessian) +{ + double seuilevitinf=1e-200; + //double dtemp; + double u=0,v=0,B=0; + double *du = new double[nbParam]; + double *dv = new double[nbParam]; + double *A = new double[nbParam]; + double *dB = new double[nbParam]; + double **d2u = new double *[nbParam]; + double **d2v = new double *[nbParam]; + double **dA = new double *[nbParam]; + for (unsigned int i = 0; i < nbParam; i++) { + d2u[i] = new double[nbParam]; + d2v[i] = new double[nbParam]; + dA[i] = new double[nbParam]; + } + + memset(du, 0, nbParam*sizeof(double)); + memset(dv, 0, nbParam*sizeof(double)); + memset(A, 0, nbParam*sizeof(double)); + memset(dB, 0, nbParam*sizeof(double)); + memset(dprtemp, 0, nbParam*sizeof(double)); + + for(unsigned int it=0;it<nbParam;it++){ + for(unsigned int jt=0;jt<nbParam;jt++){ + memset(d2u[it], 0, nbParam*sizeof(double)); + memset(d2v[it], 0, nbParam*sizeof(double)); + memset(dA[it], 0, nbParam*sizeof(double)); + } + } + + unsigned int Ncb_ = (unsigned int)Ncb; + + for(unsigned int t=0;t<Ncb_;t++) + { + //if(Pt[t]!=0) + if(Pt[t]>seuilevitinf) + { + for(unsigned int r=0;r<Ncb_;r++) + { + //if(Prt[r*Ncb+t]!=0) + if(Prt[r*Ncb_+t]>seuilevitinf) + { + for(unsigned int it=0;it<nbParam;it++){ + // dPxy/dt + dprtemp[it]=dPrt[(r*Ncb_+t)*nbParam+it]; + } + //dtemp=1.+log(Prt[r*Ncb+t]/Pt[t]); + // u = som(Pxy.logPxPy) + u += Prt[r*Ncb_+t]*log(Pt[t]*Pr[r]); + // v = som(Pxy.logPxy) + v += Prt[r*Ncb_+t]*log(Prt[r*Ncb_+t]); + + for(unsigned int it=0;it<nbParam;it++){ + // u' = som dPxylog(PxPy) + du[it] += dprtemp[it]*log(Pt[t]*Pr[r]); + // v' = som dPxy(1+log(Pxy)) + dv[it] += dprtemp[it]*(1+log(Prt[r*Ncb_+t])); + + } + for(unsigned int it=0;it<nbParam;it++){ + for(unsigned int jt=0;jt<nbParam;jt++){ + d2u[it][jt] += d2Prt[(r*Ncb_+t)*nbParam*nbParam+it*nbParam+jt]*log(Pt[t]*Pr[r]) + + (1.0/Prt[r*Ncb_+t])*(dprtemp[it]*dprtemp[it]); + d2v[it][jt] += d2Prt[(r*Ncb_+t)*nbParam*nbParam+it*nbParam+jt]*(1+log(Prt[r*Ncb_+t])) + + (1.0/Prt[r*Ncb_+t])*(dprtemp[it]*dprtemp[it]); + } + } + } + } + } + } + // B = v2 + B = (v*v); + for(unsigned int it=0;it<nbParam;it++){ + // A = u'v-uv' + A[it] = du[it] * v - u * dv[it]; + // B' = 2vv' + dB[it] = 2 * v * dv[it]; + // G = (u'v-v'u)/v2 + // G[it] = A[it]/B; + for(unsigned int jt=0;jt<nbParam;jt++){ + // A' = u''v-v''u + dA[it][jt] = d2u[it][jt]*v-d2v[it][jt]*u; + // Hessian = (A'B-AB')/B2 + Hessian[it][jt] = (dA[it][jt] * B -A[it] * dB[it])/(B*B); + } + } + + delete[] du; + delete[] dv; + delete[] A; + delete[] dB; + for (unsigned int i = 0; i < nbParam; i++) { + delete[] d2u[i]; + delete[] d2v[i]; + delete[] dA[i]; + } + delete[] d2u; + delete[] d2v; + delete[] dA; + + // std::cout<<"Hdes - compute Hessien\n"<<u<<"\n"<<v<<"\n"<<du[0]<<" "<<du[1]<<" "<<du[2]<<"\n"<<dv[2]<<"\n"<<d2u[2][2]<<"\n"<<d2v[2][2]<<"\n"<<H<<std::endl; +} + + +void vpTemplateTrackerMI::computeGradient() +{ + + double seuilevitinf=1e-200; + G=0; + unsigned int Ncb_ = (unsigned int)Ncb; + double dtemp; + for(unsigned int t=0;t<Ncb_;t++) + { + //if(Pt[t]!=0) + if(Pt[t]>seuilevitinf) + { + for(unsigned int r=0;r<Ncb_;r++) + { + if(Prt[r*Ncb_+t]>seuilevitinf) + //if(Prt[r*Ncb+t]!=0) + { + for(unsigned int it=0;it<nbParam;it++) + dprtemp[it]=dPrt[(r*Ncb_+t)*nbParam+it]; + + dtemp=1.+log(Prt[r*Ncb_+t]/Pt[t]); + + for(unsigned int it=0;it<nbParam;it++) + G[it]+=dtemp*dprtemp[it]; + } + } + } + } + +} +void vpTemplateTrackerMI::zeroProbabilities() +{ + unsigned int Ncb_ = (unsigned int)Ncb; + unsigned int Nc_ = (unsigned int)Nc; + unsigned int influBspline_ = (unsigned int)influBspline; + + memset(Prt, 0, Ncb_*Ncb_*sizeof(double)); + memset(dPrt, 0, Ncb_*Ncb_*nbParam*sizeof(double)); + memset(d2Prt, 0, Ncb_*Ncb_*nbParam*nbParam*sizeof(double)); + memset(PrtTout, 0, Nc_*Nc_*influBspline_*(1+nbParam+nbParam*nbParam)*sizeof(double)); + + // std::cout << Ncb*Ncb << std::endl; + // std::cout << Ncb*Ncb*nbParam << std::endl; + // std::cout << Ncb*Ncb*nbParam*nbParam << std::endl; + // std::cout << Ncb*Ncb*influBspline*(1+nbParam+nbParam*nbParam) << std::endl; +} + +double vpTemplateTrackerMI::getMI(const vpImage<unsigned char> &I,int &nc, const int &bspline_,vpColVector &tp) +{ + int tNcb=nc+bspline_; + int tinfluBspline=bspline_*bspline_; + double *tPrtD = new double[nc*nc*tinfluBspline]; + double *tPrt = new double[tNcb*tNcb]; + double *tPr = new double[tNcb]; + double *tPt = new double[tNcb]; + + double MI=0; + int Nbpoint=0; + double i2,j2; + double Tij; + double IW; + + vpImage<double> GaussI ; + vpImageFilter::filter(I, GaussI,fgG,taillef); + + int i,j; + int cr,ct; + double er,et; + memset(tPrt, 0, tNcb*tNcb*sizeof(double)); + memset(tPrtD, 0, nc*nc*tinfluBspline*sizeof(double)); + + //Warp->ComputeMAtWarp(tp); + Warp->computeCoeff(tp); + for(unsigned int point=0;point<templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + + Warp->computeDenom(X1,tp); + Warp->warpX(X1,X2,tp); + j2=X2[0];i2=X2[1]; + + //Tij=Templ[i-(int)Triangle->GetMiny()][j-(int)Triangle->GetMinx()]; + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth())-1) + { + Nbpoint++; + + Tij=ptTemplate[point].val; + if(!blur) + IW=I.getValue(i2,j2); + else + IW=GaussI.getValue(i2,j2); + + cr=(int)((IW*(nc-1))/255.); + ct=(int)((Tij*(nc-1))/255.); + er=(IW*(nc-1))/255.-cr; + et=((double)Tij*(nc-1))/255.-ct; + + //Calcul de l'histogramme joint par interpolation bilineaire (Bspline_ ordre 1) + vpTemplateTrackerMIBSpline::PutPVBsplineD(tPrtD, cr, er, ct, et, nc, 1.,bspline_); + } + } + double *pt=tPrtD; + for(int r=0;r<nc;r++) + for(int t=0;t<nc;t++) + { + for(i=0;i<tinfluBspline;i++) + { + int r2,t2; + r2=r+i/bspline_; + t2=t+i%bspline_; + tPrt[r2*tNcb+t2]+=*pt; + + pt++; + } + } + + if (Nbpoint == 0) { + delete[] tPrtD; + delete[] tPrt; + delete[] tPr; + delete[] tPt; + + return 0; + } + else + { + for(int r=0;r<tNcb;r++) + for(int t=0;t<tNcb;t++) + //printf("%f ",tPrt[r*tNcb+t]); + tPrt[r*tNcb+t]=tPrt[r*tNcb+t]/Nbpoint; + //calcul Pr; + memset(tPr, 0, tNcb*sizeof(double)); + for(int r=0;r<tNcb;r++) + { + for(int t=0;t<tNcb;t++) + tPr[r]+=tPrt[r*tNcb+t]; + } + + //calcul Pt; + memset(tPt, 0, tNcb*sizeof(double)); + for(int t=0;t<tNcb;t++) + { + for(int r=0;r<tNcb;r++) + tPt[t]+=tPrt[r*tNcb+t]; + } + for(int r=0;r<tNcb;r++) + //if(tPr[r]!=0) + if(std::fabs(tPr[r]) > std::numeric_limits<double>::epsilon()) + MI-=tPr[r]*log(tPr[r]); + + for(int t=0;t<tNcb;t++) + //if(tPt[t]!=0) + if(std::fabs(tPt[t]) > std::numeric_limits<double>::epsilon()) + MI-=tPt[t]*log(tPt[t]); + + for(int r=0;r<tNcb;r++) + for(int t=0;t<tNcb;t++) + //if(tPrt[r*tNcb+t]!=0) + if(std::fabs(tPrt[r*tNcb+t]) > std::numeric_limits<double>::epsilon()) + MI+=tPrt[r*tNcb+t]*log(tPrt[r*tNcb+t]); + } + delete[] tPrtD; + delete[] tPrt; + delete[] tPr; + delete[] tPt; + + return MI; +} + +double vpTemplateTrackerMI::getMI256(const vpImage<unsigned char> &I, const vpColVector &tp) +{ + vpMatrix Prt256(256,256);Prt256=0; + vpColVector Pr256(256);Pr256=0; + vpColVector Pt256(256);Pt256=0; + + int Nbpoint=0; + double i2,j2; + unsigned int Tij,IW; + + int i,j; + vpImage<double> GaussI ; + if(blur) + vpImageFilter::filter(I, GaussI,fgG,taillef); + + //Warp->ComputeMAtWarp(tp); + Warp->computeCoeff(tp); + for(unsigned int point=0;point<templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + + Warp->computeDenom(X1,tp); + Warp->warpX(X1,X2,tp); + j2=X2[0];i2=X2[1]; + + //Tij=Templ[i-(int)Triangle->GetMiny()][j-(int)Triangle->GetMinx()]; + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth())-1) + { + Nbpoint++; + + Tij=(unsigned int)ptTemplate[point].val; + if(!blur) + IW=(unsigned int)I.getValue(i2,j2); + else + IW=(unsigned int)GaussI.getValue(i2,j2); + + Prt256[Tij][IW]++; + Pr256[Tij]++; + Pt256[IW]++; + } + } + + if (Nbpoint == 0){ + throw(vpException(vpException::divideByZeroError, + "Cannot get MI; number of points = 0")); + } + Prt256=Prt256/Nbpoint; + Pr256=Pr256/Nbpoint; + Pt256=Pt256/Nbpoint; + + double MI=0; + + for(unsigned int t=0;t<256;t++) + { + for(unsigned int r=0;r<256;r++) + { + //if(Prt256[r][t]!=0) + if(std::fabs(Prt256[r][t]) > std::numeric_limits<double>::epsilon()) + MI+=Prt256[r][t]*log(Prt256[r][t]); + } + //if(Pt256[t]!=0) + if(std::fabs(Pt256[t]) > std::numeric_limits<double>::epsilon()) + MI+=-Pt256[t]*log(Pt256[t]); + //if(Pr256[t]!=0) + if(std::fabs(Pr256[t]) > std::numeric_limits<double>::epsilon()) + MI+=-Pr256[t]*log(Pr256[t]); + + } + return MI; +} diff --git a/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMIESM.cpp b/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMIESM.cpp new file mode 100644 index 0000000000000000000000000000000000000000..74b879e86f672af19efe960fa1775b4a68f8ef43 --- /dev/null +++ b/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMIESM.cpp @@ -0,0 +1,492 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Example of template tracking. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ + +#include <visp3/tt_mi/vpTemplateTrackerMIESM.h> + +#ifdef VISP_HAVE_OPENMP +#include <omp.h> +#endif + +vpTemplateTrackerMIESM::vpTemplateTrackerMIESM(vpTemplateTrackerWarp *_warp) + : vpTemplateTrackerMI(_warp), minimizationMethod(USE_NEWTON), CompoInitialised(false), + HDirect(), HInverse(), HdesireDirect(), HdesireInverse(), GDirect(), GInverse() +{ + useCompositionnal=false; + useInverse=false; + if(!Warp->isESMcompatible()) + std::cerr<<"The selected warp function is not appropriate for the ESM algorithm..."<<std::endl; +} + +void vpTemplateTrackerMIESM::initHessienDesired(const vpImage<unsigned char> &I) +{ + initCompInverse(); + std::cout<<"Initialise Hessian at Desired position..."<<std::endl; + + dW=0; + + double erreur=0; + int Nbpoint=0; + + double i2,j2; + double Tij; + double IW,dx,dy; + //int cr,ct; + //double er,et; + int i,j; + + Nbpoint=0; + erreur=0; + + if(blur) + vpImageFilter::filter(I, BI,fgG,taillef); + + zeroProbabilities(); + + Warp->computeCoeff(p); + for(unsigned int point=0;point<templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + + Warp->computeDenom(X1,p); + Warp->warpX(X1,X2,p); + + j2=X2[0];i2=X2[1]; + + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth()-1)) + { + Nbpoint++; +// if(blur) +// IW=BI.getValue(i2,j2); +// else +// IW=I.getValue(i2,j2); + + //ct=ptTemplateSupp[point].ct; + //et=ptTemplateSupp[point].et; + //cr=(int)((IW*(Nc-1))/255.); + //er=((double)IW*(Nc-1))/255.-cr; + + // if(ApproxHessian==vpTemplateTrackerMI::HESSIAN_NONSECOND) // cas à tester AY + // vpTemplateTrackerMIBSpline::PutTotPVBsplineNoSecond(PrtTout,cr, er, ct, et, Nc, ptTemplate[point].dW, nbParam, bspline); + // else + // vpTemplateTrackerMIBSpline::PutTotPVBspline(PrtTout,cr, er, ct, et, Nc, ptTemplate[point].dW, nbParam, bspline); + + // vpTemplateTrackerMIBSpline::computeProbabilities(PrtTout,cr, er, ct, et, Nc, ptTemplate[point].dW, nbParam,bspline,ApproxHessian,false); + } + } + + + double MI; + computeProba(Nbpoint); + computeMI(MI); + computeHessien(HdesireInverse); + //std::cout<<"HdesireInverse"<<std::endl<<HdesireInverse<<std::endl; + + ///////////////////////////////////////////////////////////////////////// + // DIRECT COMPO + + vpImageFilter::getGradXGauss2D(I, dIx, fgG,fgdG,taillef); + vpImageFilter::getGradYGauss2D(I, dIy, fgG,fgdG,taillef); + if(ApproxHessian!=HESSIAN_NONSECOND && ApproxHessian!=HESSIAN_0 && ApproxHessian!=HESSIAN_NEW && ApproxHessian!=HESSIAN_YOUCEF) + { + vpImageFilter::getGradX(dIx, d2Ix,fgdG,taillef); + vpImageFilter::getGradY(dIx, d2Ixy,fgdG,taillef); + vpImageFilter::getGradY(dIy, d2Iy,fgdG,taillef); + } + + Nbpoint=0; + erreur=0; + zeroProbabilities(); + + Warp->computeCoeff(p); + for(unsigned int point=0;point<templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + + Warp->computeDenom(X1,p); + Warp->warpX(X1,X2,p); + + j2=X2[0];i2=X2[1]; + + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight())&&(j2<I.getWidth())) + { + Nbpoint++; + Tij=ptTemplate[point].val; + if(!blur) + IW=I.getValue(i2,j2); + else + IW=BI.getValue(i2,j2); + + dx=1.*dIx.getValue(i2,j2)*(Nc-1)/255.; + dy=1.*dIy.getValue(i2,j2)*(Nc-1)/255.; + + //cr=ptTemplateSupp[point].ct; + //er=ptTemplateSupp[point].et; + //ct=(int)((IW*(Nc-1))/255.); + //et=((double)IW*(Nc-1))/255.-ct; + + Warp->dWarpCompo(X1,X2,p,ptTemplateCompo[point].dW,dW); + + double *tptemp=new double[nbParam]; + for(unsigned int it=0;it<nbParam;it++) + tptemp[it] =dW[0][it]*dx+dW[1][it]*dy; + + + // vpTemplateTrackerMIBSpline::computeProbabilities(PrtTout,cr, er, ct, et, Nc, ptTemplate[point].dW, nbParam,bspline,ApproxHessian, + // hessianComputation== vpTemplateTrackerMI::USE_HESSIEN_DESIRE); + //calcul de l'erreur + erreur+=(Tij-IW)*(Tij-IW); + + // if(ApproxHessian==vpTemplateTrackerMI::HESSIAN_NONSECOND) // cas à tester AY + // vpTemplateTrackerMIBSpline::PutTotPVBsplineNoSecond(PrtTout,cr, er, ct, et, Nc, tptemp, nbParam, bspline); + // else + // vpTemplateTrackerMIBSpline::PutTotPVBspline(PrtTout,cr, er, ct, et, Nc, tptemp, nbParam, bspline); + + // vpTemplateTrackerMIBSpline::computeProbabilities(PrtTout,cr, er, ct, et, Nc, tptemp, nbParam,bspline,ApproxHessian,false); + + delete[] tptemp; + } + } + + computeProba(Nbpoint); + computeMI(MI); + computeHessien(HdesireDirect); + //std::cout<<"HdesireDirect"<<std::endl<<HdesireDirect<<std::endl; + + lambda=lambdaDep; + + Hdesire=HdesireDirect+HdesireInverse; + //Hdesire=HdesireDirect; + //Hdesire=HdesireInverse; + + //std::cout<<"HdesireDirect "<<HdesireDirect<<std::endl; + //std::cout<<"HdesireInverse "<<HdesireInverse<<std::endl; + vpMatrix::computeHLM(Hdesire,lambda,HLMdesire); + HLMdesireInverse=HLMdesire.inverseByLU(); + + //std::cout<<"\tEnd initialisation..."<<std::endl; + +} + +void vpTemplateTrackerMIESM::initCompInverse() +{ + //std::cout<<"Initialise precomputed value of ESM Tracker"<<std::endl; + + HDirect.resize(nbParam,nbParam); + HInverse.resize(nbParam,nbParam); + HdesireDirect.resize(nbParam,nbParam); + HdesireInverse.resize(nbParam,nbParam); + GDirect.resize(nbParam); + GInverse.resize(nbParam); + + ptTemplateSupp=new vpTemplateTrackerPointSuppMIInv[templateSize]; + ptTemplateCompo=new vpTemplateTrackerPointCompo[templateSize]; + int i,j; + double et; + int ct; + double Tij; + for(unsigned int point=0;point<templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + Warp->computeDenom(X1,p); + + ptTemplateCompo[point].dW=new double[2*nbParam]; + Warp->getdWdp0(i,j,ptTemplateCompo[point].dW); + + ptTemplate[point].dW=new double[nbParam]; + double dx=ptTemplate[point].dx*(Nc-1)/255.; + double dy=ptTemplate[point].dy*(Nc-1)/255.; + Warp->getdW0(i,j,dy,dx,ptTemplate[point].dW); + + Tij=ptTemplate[point].val; + ct=(int)((Tij*(Nc-1))/255.); + et=(Tij*(Nc-1))/255.-ct; + ptTemplateSupp[point].et=et; + ptTemplateSupp[point].ct=ct; + ptTemplateSupp[point].Bt=new double[4]; + ptTemplateSupp[point].dBt=new double[4]; + for(char it=-1;it<=2;it++) + { + ptTemplateSupp[point].Bt[it+1] =vpTemplateTrackerBSpline::Bspline4(-it+et); + ptTemplateSupp[point].dBt[it+1] =vpTemplateTrackerMIBSpline::dBspline4(-it+et); + } + } + CompoInitialised=true; +} + +void vpTemplateTrackerMIESM::trackNoPyr(const vpImage<unsigned char> &I) +{ + if(!CompoInitialised) + std::cout<<"Compositionnal tracking no initialised\nUse initCompInverse(vpImage<unsigned char> &I) function"<<std::endl; + dW=0; + + if(blur) + vpImageFilter::filter(I, BI,fgG,taillef); + vpImageFilter::getGradXGauss2D(I, dIx, fgG,fgdG,taillef); + vpImageFilter::getGradYGauss2D(I, dIy, fgG,fgdG,taillef); + /* if(ApproxHessian!=HESSIAN_NONSECOND && ApproxHessian!=HESSIAN_0 && ApproxHessian!=HESSIAN_NEW && ApproxHessian!=HESSIAN_YOUCEF) + { + getGradX(dIx, d2Ix,fgdG,taillef); + getGradY(dIx, d2Ixy,fgdG,taillef); + getGradY(dIy, d2Iy,fgdG,taillef); + }*/ + + double erreur=0; + int Nbpoint=0; + int point; + + MI_preEstimation=-getCost(I,p); + + lambda=lambdaDep; + double MI=0; + //double MIprec=-1000; + + double i2,j2; + double Tij; + double IW; + //int cr,ct; + //double er,et; + + vpColVector dpinv(nbParam); + + double dx,dy; + double alpha=2.; + + int i,j; + unsigned int iteration=0; + do + { + Nbpoint=0; + //MIprec=MI; + MI=0; + erreur=0; + + zeroProbabilities(); + + ///////////////////////////////////////////////////////////////////////// + // Inverse + Warp->computeCoeff(p); + for(point=0;point<(int)templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + + Warp->computeDenom(X1,p); + Warp->warpX(X1,X2,p); + + j2=X2[0];i2=X2[1]; + + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth()-1)) + { + Nbpoint++; + //Tij=ptTemplate[point].val; + //if(!blur) + // IW=I.getValue(i2,j2); + //else + // IW=BI.getValue(i2,j2); + + //ct=ptTemplateSupp[point].ct; + //et=ptTemplateSupp[point].et; + //cr=(int)((IW*(Nc-1))/255.); + //er=((double)IW*(Nc-1))/255.-cr; + + // if(ApproxHessian==vpTemplateTrackerMI::HESSIAN_NONSECOND||hessianComputation==vpTemplateTrackerMI::USE_HESSIEN_DESIRE) // cas à tester AY + // vpTemplateTrackerMIBSpline::PutTotPVBsplineNoSecond(PrtTout, cr, er, ct, et, Nc, ptTemplate[point].dW, nbParam, bspline); + // else + // vpTemplateTrackerMIBSpline::PutTotPVBspline(PrtTout, cr, er, ct, et, Nc, ptTemplate[point].dW, nbParam, bspline); + } + } + + if(Nbpoint==0) + { + //std::cout<<"plus de point dans template suivi"<<std::endl; + diverge=true; + MI=0; + throw(vpTrackingException(vpTrackingException::notEnoughPointError, "No points in the template")); + } + else + { + computeProba(Nbpoint); + computeMI(MI); + if(hessianComputation!= vpTemplateTrackerMI::USE_HESSIEN_DESIRE) + computeHessien(HInverse); + computeGradient(); + GInverse=G; + + ///////////////////////////////////////////////////////////////////////// + // DIRECT + + Nbpoint=0; + //MIprec=MI; + MI=0; + erreur=0; + + zeroProbabilities(); + + Warp->computeCoeff(p); +#ifdef VISP_HAVE_OPENMP + int nthreads = omp_get_num_procs() ; + //std::cout << "file: " __FILE__ << " line: " << __LINE__ << " function: " << __FUNCTION__ << " nthread: " << nthreads << std::endl; + omp_set_num_threads(nthreads); +#pragma omp parallel for private(point, Tij,IW,i,j,i2,j2,/*cr,ct,er,et,*/dx,dy) default(shared) +#endif + for(point=0;point<(int)templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + Warp->computeDenom(X1,p); + Warp->warpX(i,j,i2,j2,p); + X2[0]=j2;X2[1]=i2; + + //Warp->computeDenom(X1,p); + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth()-1)) + { + Nbpoint++; + Tij=ptTemplate[point].val; + //Tij=Iterateurvecteur->val; + if(!blur) + IW=I.getValue(i2,j2); + else + IW=BI.getValue(i2,j2); + + dx=1.*dIx.getValue(i2,j2)*(Nc-1)/255.; + dy=1.*dIy.getValue(i2,j2)*(Nc-1)/255.; + + //ct=(int)((IW*(Nc-1))/255.); + //et=((double)IW*(Nc-1))/255.-ct; + //cr=ptTemplateSupp[point].ct; + //er=ptTemplateSupp[point].et; + + Warp->dWarpCompo(X1,X2,p,ptTemplateCompo[point].dW,dW); + + double *tptemp=new double[nbParam]; + for(unsigned int it=0;it<nbParam;it++) + tptemp[it] =dW[0][it]*dx+dW[1][it]*dy; + + + //calcul de l'erreur + erreur+=(Tij-IW)*(Tij-IW); + // if(bspline==3) + // vpTemplateTrackerMIBSpline::PutTotPVBspline3NoSecond(PrtTout, cr, er, ct, et, Nc, tptemp, nbParam); + // else + // vpTemplateTrackerMIBSpline::PutTotPVBspline4NoSecond(PrtTout, cr, er, ct, et, Nc, tptemp, nbParam); + // vpTemplateTrackerMIBSpline::computeProbabilities(PrtTout,cr, er, ct, et, Nc, tptemp, nbParam,bspline,ApproxHessian, + // hessianComputation==vpHessienType::USE_HESSIEN_DESIRE); + + delete[] tptemp; + + } + } + + computeProba(Nbpoint); + computeMI(MI); + if(hessianComputation!=vpTemplateTrackerMI::USE_HESSIEN_DESIRE) + computeHessien(HDirect); + computeGradient(); + GDirect=G; + + if(hessianComputation!=vpTemplateTrackerMI::USE_HESSIEN_DESIRE) + { + H=HDirect+HInverse; + vpMatrix::computeHLM(H,lambda,HLM); + } + G=GDirect-GInverse; + //G=GDirect; + //G=-GInverse; + + try + { + if(minimizationMethod==vpTemplateTrackerMIESM::USE_GRADIENT) + dp=-gain*0.3*G; + else + { + switch(hessianComputation) + { + case vpTemplateTrackerMI::USE_HESSIEN_DESIRE: + dp=gain*HLMdesireInverse*G; + break; + case vpTemplateTrackerMI::USE_HESSIEN_BEST_COND: + if(HLM.cond()>HLMdesire.cond()) + dp=gain*HLMdesireInverse*G; + else + dp=gain*0.3*HLM.inverseByLU()*G; + break; + default: + dp=gain*0.3*HLM.inverseByLU()*G; + break; + } + } + } + catch(vpException &e) + { + //std::cerr<<"probleme inversion"<<std::endl; + throw(e); + } + + if(ApproxHessian==HESSIAN_NONSECOND) + dp=-1.*dp; + + if(useBrent) + { + alpha=2.; + computeOptimalBrentGain(I,p,-MI,dp,alpha); + dp=alpha*dp; + } + p+=dp; + + iteration++; + } + } + while( /*(MI!=MIprec) &&*/(iteration< iterationMax)); + + MI_postEstimation=-getCost(I,p); + if(MI_preEstimation>MI_postEstimation) + { + MI_postEstimation = -1; + } + + nbIteration=iteration; +} diff --git a/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMIForwardAdditional.cpp b/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMIForwardAdditional.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3d7f16fe83b418614c1c28d3c16e72cdfc874b0f --- /dev/null +++ b/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMIForwardAdditional.cpp @@ -0,0 +1,436 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Example of template tracking. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ + +#include <visp3/tt_mi/vpTemplateTrackerMIForwardAdditional.h> + +#ifdef VISP_HAVE_OPENMP +#include <omp.h> +#endif + +vpTemplateTrackerMIForwardAdditional::vpTemplateTrackerMIForwardAdditional(vpTemplateTrackerWarp *_warp) + : vpTemplateTrackerMI(_warp), minimizationMethod(USE_NEWTON), evolRMS(0), x_pos(NULL), y_pos(NULL), + threshold_RMS(0), p_prec(), G_prec(), KQuasiNewton() +{ + evolRMS = 0; + x_pos = y_pos = NULL; + useCompositionnal=false; + threshold_RMS=1e-20; + minimizationMethod=USE_NEWTON; +} + +void vpTemplateTrackerMIForwardAdditional::initHessienDesired(const vpImage<unsigned char> &I) +{ + //std::cout<<"Initialise Hessian at Desired position..."<<std::endl; + + dW=0; + + int Nbpoint=0; + + if(blur) + vpImageFilter::filter(I, BI,fgG,taillef); + vpImageFilter::getGradXGauss2D(I, dIx, fgG,fgdG,taillef); + vpImageFilter::getGradYGauss2D(I, dIy, fgG,fgdG,taillef); + + double i2,j2; + double Tij; + double IW,dx,dy; + int cr,ct; + double er,et; + + int i,j; + + Nbpoint=0; + + zeroProbabilities(); + Warp->computeCoeff(p); + for(unsigned int point=0;point<templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + X2[0]=j;X2[1]=i; + + Warp->computeDenom(X1,p); + Warp->warpX(X1,X2,p); + + j2=X2[0];i2=X2[1]; + + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth()-1)) + { + Nbpoint++; + Tij=ptTemplate[point].val; + if(!blur) + IW=I.getValue(i2,j2); + else + IW=BI.getValue(i2,j2); + + dx=1.*dIx.getValue(i2,j2)*(Nc-1)/255.; + dy=1.*dIy.getValue(i2,j2)*(Nc-1)/255.; + + ct=(int)((IW*(Nc-1))/255.); + cr=(int)((Tij*(Nc-1))/255.); + et=(IW*(Nc-1))/255.-ct; + er=((double)Tij*(Nc-1))/255.-cr; + //std::cout<<"test"<<std::endl; + Warp->dWarp(X1,X2,p,dW); + + double *tptemp=new double[nbParam]; + for(unsigned int it=0;it<nbParam;it++) + tptemp[it] =dW[0][it]*dx+dW[1][it]*dy; + + if(ApproxHessian==HESSIAN_NONSECOND) + vpTemplateTrackerMIBSpline::PutTotPVBsplineNoSecond(PrtTout, cr, er, ct, et, Nc, tptemp, nbParam, bspline); + else if(ApproxHessian==HESSIAN_0 || ApproxHessian==HESSIAN_NEW) + vpTemplateTrackerMIBSpline::PutTotPVBspline(PrtTout, cr, er, ct, et, Nc, tptemp, nbParam, bspline); + + delete[] tptemp; + } + } + + if(Nbpoint>0) + { + double MI; + computeProba(Nbpoint); + computeMI(MI); + computeHessien(Hdesire); + + + // double conditionnement=GetConditionnement(Hdesire); + // std::cout<<"conditionnement : "<<conditionnement<<std::endl; + vpMatrix::computeHLM(Hdesire,lambda,HLMdesire); + try + { + HLMdesireInverse=HLMdesire.inverseByLU(); + } + catch(vpException &e) + { + //std::cerr<<"probleme inversion"<<std::endl; + throw(e); + } + //std::cout<<"Hdesire = "<<Hdesire<<std::endl; + //std::cout<<"\tEnd initialisation..."<<std::endl; + } + +} + +void vpTemplateTrackerMIForwardAdditional::trackNoPyr(const vpImage<unsigned char> &I) +{ + dW=0; + + double erreur=0; + int Nbpoint=0; + if(blur) + vpImageFilter::filter(I, BI,fgG,taillef); + vpImageFilter::getGradXGauss2D(I, dIx, fgG,fgdG,taillef); + vpImageFilter::getGradYGauss2D(I, dIy, fgG,fgdG,taillef); + + double MI=0,MIprec=-1000; + + MI_preEstimation=-getCost(I,p); + + double i2,j2; + double Tij; + double IW,dx,dy; + //unsigned + int cr,ct; + double er,et; + double alpha=2.; + + int i,j; + unsigned int iteration=0; + + initPosEvalRMS(p); + do + { + if(iteration%5==0) + initHessienDesired(I); + Nbpoint=0; + MIprec=MI; + MI=0; + erreur=0; + + zeroProbabilities(); + + Warp->computeCoeff(p); +#ifdef VISP_HAVE_OPENMP + int nthreads = omp_get_num_procs() ; + //std::cout << "file: " __FILE__ << " line: " << __LINE__ << " function: " << __FUNCTION__ << " nthread: " << nthreads << std::endl; + omp_set_num_threads(nthreads); +#pragma omp parallel for private(Tij,IW,i,j,i2,j2,cr,ct,er,et,dx,dy) default(shared) +#endif + for(int point=0;point<(int)templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + + Warp->computeDenom(X1,p); + Warp->warpX(X1,X2,p); + + j2=X2[0];i2=X2[1]; + + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth()-1)) + { + Nbpoint++; + Tij=ptTemplate[point].val; + //Tij=Iterateurvecteur->val; + if(!blur) + IW=I.getValue(i2,j2); + else + IW=BI.getValue(i2,j2); + + dx=1.*dIx.getValue(i2,j2)*(Nc-1)/255.; + dy=1.*dIy.getValue(i2,j2)*(Nc-1)/255.; + + ct=(int)((IW*(Nc-1))/255.); + cr=(int)((Tij*(Nc-1))/255.); + et=(IW*(Nc-1))/255.-ct; + er=((double)Tij*(Nc-1))/255.-cr; + + //calcul de l'erreur + erreur+=(Tij-IW)*(Tij-IW); + + //Calcul de l'histogramme joint par interpolation bilinÈaire (Bspline ordre 1) + Warp->dWarp(X1,X2,p,dW); + + //double *tptemp=temp; + double *tptemp=new double[nbParam];; + for(unsigned int it=0;it<nbParam;it++) + tptemp[it] =(dW[0][it]*dx+dW[1][it]*dy); + //*tptemp++ =dW[0][it]*dIWx+dW[1][it]*dIWy; + //std::cout<<cr<<" "<<ct<<" ; "; + if(ApproxHessian==HESSIAN_NONSECOND||hessianComputation==vpTemplateTrackerMI::USE_HESSIEN_DESIRE) + vpTemplateTrackerMIBSpline::PutTotPVBsplineNoSecond(PrtTout, cr, er, ct, et, Nc, tptemp, nbParam, bspline); + else if(ApproxHessian==HESSIAN_0 || ApproxHessian==HESSIAN_NEW) + vpTemplateTrackerMIBSpline::PutTotPVBspline(PrtTout, cr, er, ct, et, Nc, tptemp, nbParam, bspline); + + delete[] tptemp; + } + } + + if(Nbpoint==0) + { + //std::cout<<"plus de point dans template suivi"<<std::endl; + diverge=true; + MI=0; + deletePosEvalRMS(); + throw(vpTrackingException(vpTrackingException::notEnoughPointError, "No points in the template")); + } + else + { + computeProba(Nbpoint); + computeMI(MI); + //std::cout<<iteration<<"\tMI= "<<MI<<std::endl; + computeHessien(H); + computeGradient(); + + vpMatrix::computeHLM(H,lambda,HLM); + try + { + switch(hessianComputation) + { + case vpTemplateTrackerMI::USE_HESSIEN_DESIRE: + dp=gain*HLMdesireInverse*G; + break; + case vpTemplateTrackerMI::USE_HESSIEN_BEST_COND: + if(HLM.cond()>HLMdesire.cond()) + dp=gain*HLMdesireInverse*G; + else + dp=gain*0.2*HLM.inverseByLU()*G; + break; + default: + dp=gain*0.2*HLM.inverseByLU()*G; + break; + } + } + catch(vpException &e) + { + //std::cerr<<"probleme inversion"<<std::endl; + deletePosEvalRMS(); + throw(e); + } + } + + switch(minimizationMethod) + { + case vpTemplateTrackerMIForwardAdditional::USE_LMA: + { + vpColVector p_test_LMA(nbParam); + if(ApproxHessian==HESSIAN_NONSECOND) + p_test_LMA=p-100000.1*dp; + else + p_test_LMA=p+1.*dp; + MI=-getCost(I,p); + double MI_LMA=-getCost(I,p_test_LMA); + if(MI_LMA>MI) + { + p=p_test_LMA; + lambda=(lambda/10.<1e-6)?lambda/10.:1e-6; + } + else + { + lambda=(lambda*10.<1e6)?1e6:lambda*10.; + } + } + break; + case vpTemplateTrackerMIForwardAdditional::USE_GRADIENT: + { + dp=-gain*6.0*G; + if(useBrent) + { + alpha=2.; + computeOptimalBrentGain(I,p,-MI,dp,alpha); + dp=alpha*dp; + } + p+=1.*dp; + break; + } + + case vpTemplateTrackerMIForwardAdditional::USE_QUASINEWTON: + { + double s_scal_y; + if(iterationGlobale!=0) + { + vpColVector s_quasi=p-p_prec; + vpColVector y_quasi=G-G_prec; + s_scal_y=s_quasi.t()*y_quasi; + //if(s_scal_y!=0)//BFGS + // KQuasiNewton=KQuasiNewton-(s_quasi*y_quasi.t()*KQuasiNewton+KQuasiNewton*y_quasi*s_quasi.t())/s_scal_y+(1.+y_quasi.t()*(KQuasiNewton*y_quasi)/s_scal_y)*s_quasi*s_quasi.t()/s_scal_y; + //if(s_scal_y!=0)//DFP + if(std::fabs(s_scal_y) > std::numeric_limits<double>::epsilon()) + KQuasiNewton=KQuasiNewton+0.001*(s_quasi*s_quasi.t()/s_scal_y-KQuasiNewton*y_quasi*y_quasi.t()*KQuasiNewton/(y_quasi.t()*KQuasiNewton*y_quasi)); + } + dp=-KQuasiNewton*G; + p_prec=p; + G_prec=G; + p-=1.01*dp; + } + break; + + default: + { + if(ApproxHessian==HESSIAN_NONSECOND) + dp=-0.1*dp; + if(useBrent) + { + alpha=2.; + computeOptimalBrentGain(I,p,-MI,dp,alpha); + //std::cout<<alpha<<std::endl; + dp=alpha*dp; + } + + p+=1.*dp; + break; + } + } + + computeEvalRMS(p); + iteration++; + iterationGlobale++; + + } + while( (std::fabs(MI-MIprec) > std::fabs(MI)*std::numeric_limits<double>::epsilon()) &&(iteration< iterationMax)&&(evolRMS>threshold_RMS) ); + //while( (MI!=MIprec) &&(iteration< iterationMax)&&(evolRMS>threshold_RMS) ); + if(Nbpoint==0) { + //std::cout<<"plus de point dans template suivi"<<std::endl; + deletePosEvalRMS(); + throw(vpTrackingException(vpTrackingException::notEnoughPointError, "No points in the template")); + } + + nbIteration=iteration; + MI_postEstimation=-getCost(I,p); + if(MI_preEstimation>MI_postEstimation) + { + MI_postEstimation = -1; + } + deletePosEvalRMS(); +} + +void vpTemplateTrackerMIForwardAdditional::initPosEvalRMS(const vpColVector &pw) +{ + unsigned int nb_corners = zoneTracked->getNbTriangle() * 3; + x_pos=new double[nb_corners]; + y_pos=new double[nb_corners]; + + Warp->computeCoeff(pw); + vpTemplateTrackerTriangle triangle; + + for(unsigned int i=0;i<zoneTracked->getNbTriangle();i++) + { + zoneTracked->getTriangle(i, triangle); + for (unsigned int j=0; j<3; j++) { + triangle.getCorner(j, X1[0], X1[1]); + + Warp->computeDenom(X1,pw); + Warp->warpX(X1,X2,pw); + x_pos[i*3+j]=X2[0]; + y_pos[i*3+j]=X2[1]; + } + } +} + +void vpTemplateTrackerMIForwardAdditional::computeEvalRMS(const vpColVector &pw) +{ + unsigned int nb_corners = zoneTracked->getNbTriangle() * 3; + + Warp->computeCoeff(pw); + evolRMS=0; + vpTemplateTrackerTriangle triangle; + + for(unsigned int i=0;i<zoneTracked->getNbTriangle();i++) + { + zoneTracked->getTriangle(i, triangle); + for (unsigned int j=0; j<3; j++) { + triangle.getCorner(j, X1[0], X1[1]); + + Warp->computeDenom(X1,pw); + Warp->warpX(X1,X2,pw); + evolRMS+=(x_pos[i*3+j]-X2[0])*(x_pos[i*3+j]-X2[0])+(y_pos[i*3+j]-X2[1])*(y_pos[i*3+j]-X2[1]); + x_pos[i*3+j]=X2[0]; + y_pos[i*3+j]=X2[1]; + } + } + evolRMS=evolRMS/nb_corners; +} + +void vpTemplateTrackerMIForwardAdditional::deletePosEvalRMS() +{ + delete[] x_pos; + delete[] y_pos; +} diff --git a/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMIForwardCompositional.cpp b/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMIForwardCompositional.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6d37c0d85bfa65ed5514402c8ac8a96e1ebffe95 --- /dev/null +++ b/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMIForwardCompositional.cpp @@ -0,0 +1,323 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Example of template tracking. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +#include <visp3/tt_mi/vpTemplateTrackerMIForwardCompositional.h> + +vpTemplateTrackerMIForwardCompositional::vpTemplateTrackerMIForwardCompositional(vpTemplateTrackerWarp *_warp) + : vpTemplateTrackerMI(_warp), CompoInitialised(false) +{ +} + +void vpTemplateTrackerMIForwardCompositional::initCompo() +{ + std::cout<<"Initialise precomputed value of Compositionnal Direct"<<std::endl; + ptTemplateSupp=new vpTemplateTrackerPointSuppMIInv[templateSize]; + int i,j; + double et; + int ct; + double Tij; + for(unsigned int point=0;point<templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + Warp->computeDenom(X1,p); + ptTemplate[point].dW=new double[2*nbParam]; + Warp->getdWdp0(i,j,ptTemplate[point].dW); + + Tij=ptTemplate[point].val; + ct=(int)((Tij*(Nc-1))/255.); + et=(Tij*(Nc-1))/255.-ct; + ptTemplateSupp[point].et=et; + ptTemplateSupp[point].ct=ct; + ptTemplateSupp[point].Bt=new double[4]; + ptTemplateSupp[point].dBt=new double[4]; + for(char it=-1;it<=2;it++) + { + ptTemplateSupp[point].Bt[it+1] =vpTemplateTrackerBSpline::Bspline4(-it+et); + ptTemplateSupp[point].dBt[it+1] =vpTemplateTrackerMIBSpline::dBspline4(-it+et); + } + + } + CompoInitialised=true; +} +void vpTemplateTrackerMIForwardCompositional::initHessienDesired(const vpImage<unsigned char> &I) +{ + initCompo(); + + //std::cout<<"Initialise Hessian at Desired position..."<<std::endl; + + dW=0; + + if(blur) + vpImageFilter::filter(I, BI,fgG,taillef); + vpImageFilter::getGradXGauss2D(I, dIx, fgG,fgdG,taillef); + vpImageFilter::getGradYGauss2D(I, dIy, fgG,fgdG,taillef); + + double erreur=0; + int Nbpoint=0; + + double i2,j2; + double Tij; + double IW,dx,dy; + int cr,ct; + double er,et; + + int i,j; + + Nbpoint=0; + erreur=0; + + zeroProbabilities(); + + Warp->computeCoeff(p); + for(unsigned int point=0;point<templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + + Warp->computeDenom(X1,p); + Warp->warpX(X1,X2,p); + + j2=X2[0];i2=X2[1]; + + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth()-1)) + { + Nbpoint++; + Tij=ptTemplate[point].val; + if(!blur) + IW=I.getValue(i2,j2); + else + IW=BI.getValue(i2,j2); + + dx=1.*dIx.getValue(i2,j2)*(Nc-1)/255.; + dy=1.*dIy.getValue(i2,j2)*(Nc-1)/255.; + + cr=ptTemplateSupp[point].ct; + er=ptTemplateSupp[point].et; + ct=(int)((IW*(Nc-1))/255.); + et=((double)IW*(Nc-1))/255.-ct; + + Warp->dWarpCompo(X1,X2,p,ptTemplate[point].dW,dW); + + double *tptemp=new double[nbParam]; + for(unsigned int it=0;it<nbParam;it++) + tptemp[it] =dW[0][it]*dx+dW[1][it]*dy; + + //calcul de l'erreur + erreur+=(Tij-IW)*(Tij-IW); + + vpTemplateTrackerMIBSpline::PutTotPVBspline(PrtTout, cr, er, ct, et, Nc,tptemp, nbParam, bspline); + + delete[] tptemp; + } + } + double MI; + computeProba(Nbpoint); + computeMI(MI); + computeHessien(Hdesire); + + lambda=lambdaDep; + + vpMatrix::computeHLM(Hdesire,lambda,HLMdesire); + HLMdesireInverse=HLMdesire.inverseByLU(); + //std::cout<<"Hdesire = "<<Hdesire<<std::endl; + //std::cout<<"\tEnd initialisation..."<<std::endl; +} + + +void vpTemplateTrackerMIForwardCompositional::trackNoPyr(const vpImage<unsigned char> &I) +{ + if(!CompoInitialised) + std::cout<<"Compositionnal tracking no initialised\nUse initCompo(vpImage<unsigned char> &I) function"<<std::endl; + dW=0; + + if(blur) + vpImageFilter::filter(I, BI,fgG,taillef); + vpImageFilter::getGradXGauss2D(I, dIx, fgG,fgdG,taillef); + vpImageFilter::getGradYGauss2D(I, dIy, fgG,fgdG,taillef); + + double erreur=0; + int Nbpoint=0; + + + lambda=lambdaDep; + double MI=0,MIprec=-1000; + + MI_preEstimation=-getCost(I,p); + + double i2,j2; + double Tij; + double IW; + //unsigned + int cr,ct; + double er,et; + double dx,dy; + + vpColVector dpinv(nbParam); + double alpha=2.; + + int i,j; + unsigned int iteration=0; + do + { + Nbpoint=0; + MIprec=MI; + MI=0; + erreur=0; + + zeroProbabilities(); + + Warp->computeCoeff(p); + + for(unsigned int point=0;point<templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + Warp->warpX(i,j,i2,j2,p); + X2[0]=j2;X2[1]=i2; + + Warp->computeDenom(X1,p); + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth()-1)) + { + Nbpoint++; + Tij=ptTemplate[point].val; + if(!blur) + IW=I.getValue(i2,j2); + else + IW=BI.getValue(i2,j2); + + dx=1.*dIx.getValue(i2,j2)*(Nc-1)/255.; + dy=1.*dIy.getValue(i2,j2)*(Nc-1)/255.; + + ct=(int)((IW*(Nc-1))/255.); + et=((double)IW*(Nc-1))/255.-ct; + cr=ptTemplateSupp[point].ct; + er=ptTemplateSupp[point].et; + + Warp->dWarpCompo(X1,X2,p,ptTemplate[point].dW,dW); + + double *tptemp=new double[nbParam]; + for(unsigned int it=0;it<nbParam;it++) + tptemp[it] =dW[0][it]*dx+dW[1][it]*dy; + + + //calcul de l'erreur + erreur+=(Tij-IW)*(Tij-IW); + + if(ApproxHessian==HESSIAN_NONSECOND||hessianComputation==vpTemplateTrackerMI::USE_HESSIEN_DESIRE) + vpTemplateTrackerMIBSpline::PutTotPVBsplineNoSecond(PrtTout, cr, er, ct, et, Nc, tptemp, nbParam, bspline); + else if(ApproxHessian==HESSIAN_0|| ApproxHessian==HESSIAN_NEW) + vpTemplateTrackerMIBSpline::PutTotPVBspline(PrtTout, cr, er, ct, et, Nc, tptemp, nbParam, bspline); + + delete[] tptemp; + + } + } + if(Nbpoint==0) + { + //std::cout<<"plus de point dans template suivi"<<std::endl; + diverge=true; + MI=0; + throw(vpTrackingException(vpTrackingException::notEnoughPointError, "No points in the template")); + } + else + { + computeProba(Nbpoint); + computeMI(MI); + if(hessianComputation!=vpTemplateTrackerMI::USE_HESSIEN_DESIRE) + computeHessien(H); + computeGradient(); + + vpMatrix::computeHLM(H,lambda,HLM); + + try + { + switch(hessianComputation) + { + case vpTemplateTrackerMI::USE_HESSIEN_DESIRE: + dp=gain*HLMdesireInverse*G; + break; + case vpTemplateTrackerMI::USE_HESSIEN_BEST_COND: + if(HLM.cond()>HLMdesire.cond()) + dp=gain*HLMdesireInverse*G; + else + dp=gain*0.2*HLM.inverseByLU()*G; + break; + default: + dp=gain*0.2*HLM.inverseByLU()*G; + break; + } + } + catch(vpException &e) + { + //std::cerr<<"probleme inversion"<<std::endl; + throw(e); + } + } + + if(ApproxHessian==HESSIAN_NONSECOND) + dp=-0.04*dp; + else + dp=1.*dp; + + if(useBrent) + { + alpha=2.; + computeOptimalBrentGain(I,p,-MI,dp,alpha); + dp=alpha*dp; + } + Warp->pRondp(p,dp,p); + + iteration++; + + + } + while( (std::fabs(MI-MIprec) > std::fabs(MI)*std::numeric_limits<double>::epsilon()) && (iteration< iterationMax) ); + //while( (MI!=MIprec) && (iteration< iterationMax) ); + nbIteration=iteration; + + MI_postEstimation=-getCost(I,p); + if(MI_preEstimation>MI_postEstimation) + { + MI_postEstimation = -1; + } +} + diff --git a/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMIInverseCompositional.cpp b/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMIInverseCompositional.cpp new file mode 100644 index 0000000000000000000000000000000000000000..36c5b87f57a0181c31169a791ff6b82f50e75cbd --- /dev/null +++ b/modules/tracker/tt_mi/src/mi/vpTemplateTrackerMIInverseCompositional.cpp @@ -0,0 +1,588 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Example of template tracking. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +#include <visp3/tt_mi/vpTemplateTrackerMIInverseCompositional.h> +#include <visp3/core/vpTrackingException.h> + +#include <memory> + +vpTemplateTrackerMIInverseCompositional::vpTemplateTrackerMIInverseCompositional(vpTemplateTrackerWarp *_warp) + : vpTemplateTrackerMI(_warp), minimizationMethod(USE_LMA), CompoInitialised(false), useTemplateSelect(false), + evolRMS(0), x_pos(NULL), y_pos(NULL), threshold_RMS(1e-20), p_prec(), G_prec(), KQuasiNewton() //, useAYOptim(false) +{ + useInverse=true; +} + +void vpTemplateTrackerMIInverseCompositional::initTemplateRefBspline(unsigned int ptIndex, double &et) //AY : Optim +{ + ptTemplateSupp[ptIndex].BtInit=new double[(1 + nbParam + nbParam*nbParam)*(unsigned int)bspline]; + + unsigned int index = 0; + int endIndex = 1; + + double (*ptBspFct)(double); + double (*ptdBspFct)(double); + double (*ptd2BspFct)(double); + if(bspline == 3){ + if(et>0.5){et=et-1;} + ptBspFct = &vpTemplateTrackerMIBSpline::Bspline3; + ptdBspFct = &vpTemplateTrackerMIBSpline::dBspline3; + ptd2BspFct = &vpTemplateTrackerMIBSpline::d2Bspline3; + } + else{ + ptBspFct = &vpTemplateTrackerBSpline::Bspline4; + ptdBspFct = &vpTemplateTrackerMIBSpline::dBspline4; + ptd2BspFct = &vpTemplateTrackerMIBSpline::d2Bspline4; + endIndex = 2; + } + + for(int it=-1; it<=endIndex; it++) + { + ptTemplateSupp[ptIndex].BtInit[index++] = (*ptBspFct)((double)(-it)+et); + + for(unsigned int ip=0;ip<nbParam;++ip) + { + ptTemplateSupp[ptIndex].BtInit[index++] = (*ptdBspFct)((double)(-it)+et) * ptTemplate[ptIndex].dW[ip] * (-1.0); + for(unsigned int ip2=0;ip2<nbParam;++ip2) + { + ptTemplateSupp[ptIndex].BtInit[index++] = (*ptd2BspFct)((double)(-it)+et) * ptTemplate[ptIndex].dW[ip] * ptTemplate[ptIndex].dW[ip2]; + } + } + } +} + +void vpTemplateTrackerMIInverseCompositional::initCompInverse(const vpImage<unsigned char> &I) +{ + ptTemplateSupp=new vpTemplateTrackerPointSuppMIInv[templateSize]; + int i,j; + double et; + int ct; + double Tij; + + vpImageFilter::getGradXGauss2D(I, dIx, fgG,fgdG,taillef); + vpImageFilter::getGradYGauss2D(I, dIy, fgG,fgdG,taillef); + + if(ApproxHessian!=HESSIAN_NONSECOND && ApproxHessian!=HESSIAN_0 && ApproxHessian!=HESSIAN_NEW && ApproxHessian!=HESSIAN_YOUCEF) + { + vpImageFilter::getGradX(dIx, d2Ix,fgdG,taillef); + vpImageFilter::getGradY(dIx, d2Ixy,fgdG,taillef); + vpImageFilter::getGradY(dIy, d2Iy,fgdG,taillef); + } + + Warp->computeCoeff(p); + for(unsigned int point=0;point<templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + + X1[0]=j;X1[1]=i; + + Warp->computeDenom(X1,p); + ptTemplate[point].dW=new double[nbParam]; + + double dx=ptTemplate[point].dx*(Nc-1)/255.; + double dy=ptTemplate[point].dy*(Nc-1)/255.; + + Warp->getdW0(i,j,dy,dx,ptTemplate[point].dW); + Tij=ptTemplate[point].val; + ct=(int)((Tij*(Nc-1))/255.); + et=(Tij*(Nc-1))/255.-ct; + + ptTemplateSupp[point].et=et; + ptTemplateSupp[point].ct=ct; + + // ###### AY Optim + // if(useAYOptim) + // if(ApproxHessian != HESSIAN_NONSECOND /*&& hessianComputation != vpTemplateTrackerMI::USE_HESSIEN_DESIRE*/) + // initTemplateRefBspline(point, et); + // ################### + } + CompoInitialised=true; + +} +void vpTemplateTrackerMIInverseCompositional::initHessienDesired(const vpImage<unsigned char> &I) +{ + initCompInverse(I); + + double erreur=0; + int Nbpoint=0; + + double i2,j2; + double Tij; + double IW; + int cr,ct; + double er,et; + + int i,j; + + Nbpoint=0; + erreur=0; + + if(blur) + vpImageFilter::filter(I, BI,fgG,taillef); + + zeroProbabilities(); + Warp->computeCoeff(p); + + // AY : Optim + // unsigned int totParam = (bspline * bspline)*(1+nbParam+nbParam*nbParam); + // unsigned int size = (1 + nbParam + nbParam*nbParam)*bspline; + // double *ptb; + + for(unsigned int point=0;point<templateSize;point++) + { + i=ptTemplate[point].y; + j=ptTemplate[point].x; + X1[0]=j;X1[1]=i; + + Warp->computeDenom(X1,p); + Warp->warpX(X1,X2,p); + + j2=X2[0];i2=X2[1]; + + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth()-1)) + { + Nbpoint++; + Tij=ptTemplate[point].val; + + if(blur) + IW=BI.getValue(i2,j2); + else + IW=I.getValue(i2,j2); + + ct=ptTemplateSupp[point].ct; + et=ptTemplateSupp[point].et; + cr=(int)((IW*(Nc-1))/255.); + er=((double)IW*(Nc-1))/255.-cr; + + //calcul de l'erreur + erreur+=(Tij-IW)*(Tij-IW); + + if( ApproxHessian==HESSIAN_NONSECOND && (ptTemplateSelect[point] || !useTemplateSelect) ) + { + vpTemplateTrackerMIBSpline::PutTotPVBsplineNoSecond(PrtTout, cr, er, ct, et, Nc, ptTemplate[point].dW, nbParam, bspline); + } + else if ((ApproxHessian==HESSIAN_0||ApproxHessian==HESSIAN_NEW) && (ptTemplateSelect[point] || !useTemplateSelect)) + { + if(bspline==3){ + vpTemplateTrackerMIBSpline::PutTotPVBspline3(PrtTout, cr, er, ct, et, Nc, ptTemplate[point].dW, nbParam); + // { + // if(et>0.5){ct++;} + // if(er>0.5){cr++;} + // int index = (cr*Nc+ct)*totParam; + // double *ptb = &PrtTout[index]; + // vpTemplateTrackerMIBSpline::PutTotPVBspline3(ptb, er, ptTemplateSupp[point].BtInit, size); + // } + } + else{ + vpTemplateTrackerMIBSpline::PutTotPVBspline4(PrtTout, cr, er, ct, et, Nc, ptTemplate[point].dW, nbParam); + + // { + // // ################### AY : Optim + // unsigned int index = (cr*Nc+ct)*totParam; + // ptb = &PrtTout[index]; + // vpTemplateTrackerMIBSpline::PutTotPVBspline4(ptb, er, ptTemplateSupp[point].BtInit, size); + // // ################### + // } + } + } + else if (ptTemplateSelect[point] || !useTemplateSelect) + vpTemplateTrackerMIBSpline::PutTotPVBsplinePrt(PrtTout, cr, er, ct, et, Nc,nbParam, bspline); + } + } + + double MI; + computeProba(Nbpoint); + computeMI(MI); + computeHessien(Hdesire); + + lambda=lambdaDep; + + vpMatrix::computeHLM(Hdesire,lambda,HLMdesire); + + HLMdesireInverse=HLMdesire.inverseByLU(); + KQuasiNewton=HLMdesireInverse; +} + +void vpTemplateTrackerMIInverseCompositional::trackNoPyr(const vpImage<unsigned char> &I) +{ + if(!CompoInitialised) + std::cout<<"Compositionnal tracking no initialised\nUse InitCompInverse(vpImage<unsigned char> &I) function"<<std::endl; + dW=0; + + if(blur) + vpImageFilter::filter(I, BI,fgG,taillef); + + int Nbpoint=0; + + lambda=lambdaDep; + double MI=0,MIprec=-1000; + + vpColVector p_avant_estimation;p_avant_estimation=p; + MI_preEstimation=-getCost(I,p); + NMI_preEstimation=-getNormalizedCost(I,p); + + // std::cout << "MI avant: " << MI_preEstimation << std::endl; + // std::cout << "NMI avant: " << NMI_preEstimation << std::endl; + + initPosEvalRMS(p); + + vpColVector dpinv(nbParam); + double alpha=2.; + + unsigned int iteration=0; + + //unsigned int bspline_ = (unsigned int) bspline; + //unsigned int totParam = (bspline_ * bspline_)*(1+nbParam+nbParam*nbParam); + + vpMatrix Hnorm(nbParam,nbParam); + + do + { + Nbpoint=0; + MIprec=MI; + MI=0; + + zeroProbabilities(); + + Warp->computeCoeff(p); + + { + for(int point=0;point<(int)templateSize;point++) + { + vpColVector x1(2),x2(2); + double i2,j2; + double IW; + int cr,ct; + double er,et; + + x1[0]=(double)ptTemplate[point].x; + x1[1]=(double)ptTemplate[point].y; + + Warp->computeDenom(x1,p); // A modif pour parallelisation mais ne pose pas de pb avec warp utilises dans DECSA + Warp->warpX(x1,x2,p); + + j2=x2[0]; + i2=x2[1]; + + if((i2>=0)&&(j2>=0)&&(i2<I.getHeight()-1)&&(j2<I.getWidth()-1)) + { + + //if(m_ptCurrentMask == NULL ||(m_ptCurrentMask->getWidth() == I.getWidth() && m_ptCurrentMask->getHeight() == I.getHeight() && (*m_ptCurrentMask)[(unsigned int)i2][(unsigned int)j2] > 128)) + { + Nbpoint++; + if(!blur) + IW=(double)I.getValue(i2,j2); + else + IW=BI.getValue(i2,j2); + + ct=ptTemplateSupp[point].ct; + et=ptTemplateSupp[point].et; + double tmp = IW*(((double)Nc)-1.f)/255.f; + cr=(int)tmp; + er=tmp-(double)cr; + + if( (ApproxHessian==HESSIAN_NONSECOND||hessianComputation==vpTemplateTrackerMI::USE_HESSIEN_DESIRE) && (ptTemplateSelect[point] || !useTemplateSelect) ) + { + vpTemplateTrackerMIBSpline::PutTotPVBsplineNoSecond(Prt, dPrt, cr, er, ct, et, Ncb, ptTemplate[point].dW, nbParam, bspline); + } + else if (ptTemplateSelect[point] || !useTemplateSelect) + { + if(bspline==3){ + vpTemplateTrackerMIBSpline::PutTotPVBspline3(Prt, dPrt, d2Prt, cr, er, ct, et, Ncb, ptTemplate[point].dW, nbParam); + } + else{ + vpTemplateTrackerMIBSpline::PutTotPVBspline4(Prt, dPrt, d2Prt, cr, er, ct, et, Ncb, ptTemplate[point].dW, nbParam); + } + } + else{ + vpTemplateTrackerMIBSpline::PutTotPVBsplinePrt(Prt, cr, er, ct, et, Ncb,nbParam, bspline); + } + } + + } + } + } + + if(Nbpoint==0) + { + diverge=true; + MI=0; + deletePosEvalRMS(); + throw(vpTrackingException(vpTrackingException::notEnoughPointError, "No points in the template")); + + } + else + { + // computeProba(Nbpoint); + + unsigned int indd, indd2; + indd = indd2 = 0; + unsigned int Ncb_ = (unsigned int)Ncb; + for(unsigned int i=0;i<Ncb_*Ncb_;i++){ + Prt[i]=Prt[i]/Nbpoint; + for(unsigned int j=0;j<nbParam;j++){ + dPrt[indd]=dPrt[indd]/Nbpoint; + indd++; + for(unsigned int k=0;k<nbParam;k++){ + d2Prt[indd2]=d2Prt[indd2]/Nbpoint; + indd2++; + } + } + } + + computeMI(MI); + + if(hessianComputation!=vpTemplateTrackerMI::USE_HESSIEN_DESIRE){ + computeHessienNormalized(Hnorm); + computeHessien(H); + } + computeGradient(); + + vpMatrix::computeHLM(H,lambda,HLM); + + try + { + switch(hessianComputation) + { + case vpTemplateTrackerMI::USE_HESSIEN_DESIRE: + dp=gain*HLMdesireInverse*G; + break; + case vpTemplateTrackerMI::USE_HESSIEN_BEST_COND: + if(HLM.cond()>HLMdesire.cond()) + dp=gain*HLMdesireInverse*G; + else + dp=gain*0.2*HLM.inverseByLU()*G; + break; + default: + dp=gain*0.2*HLM.inverseByLU()*G; + break; + } + } + catch(vpException &e) + { + //std::cerr<<"probleme inversion"<<std::endl; + throw(e); + } + } + + switch(minimizationMethod) + { + case vpTemplateTrackerMIInverseCompositional::USE_LMA: + { + vpColVector dp_test_LMA(nbParam); + vpColVector dpinv_test_LMA(nbParam); + vpColVector p_test_LMA(nbParam); + if(ApproxHessian==HESSIAN_NONSECOND) + dp_test_LMA=-100000.1*dp; + else + dp_test_LMA=1.*dp; + Warp->getParamInverse(dp_test_LMA,dpinv_test_LMA); + Warp->pRondp(p,dpinv_test_LMA,p_test_LMA); + + MI=-getCost(I,p); + double MI_LMA=-getCost(I,p_test_LMA); + if(MI_LMA>MI) + { + dp=dp_test_LMA; + lambda=(lambda/10.<1e-6)?lambda/10.:1e-6; + } + else + { + dp=0; + lambda=(lambda*10.<1e6)?1e6:lambda*10.; + } + } + break; + case vpTemplateTrackerMIInverseCompositional::USE_GRADIENT: + dp=-gain*0.3*G*20; + break; + + case vpTemplateTrackerMIInverseCompositional::USE_QUASINEWTON: + { + double s_scal_y; + if(iterationGlobale!=0) + { + vpColVector s_quasi=p-p_prec; + vpColVector y_quasi=G-G_prec; + s_scal_y=s_quasi.t()*y_quasi; + //std::cout<<"mise a jour K"<<std::endl; + /*if(s_scal_y!=0)//BFGS + KQuasiNewton=KQuasiNewton+0.01*(-(s_quasi*y_quasi.t()*KQuasiNewton+KQuasiNewton*y_quasi*s_quasi.t())/s_scal_y+(1.+y_quasi.t()*(KQuasiNewton*y_quasi)/s_scal_y)*s_quasi*s_quasi.t()/s_scal_y);*/ + //if(s_scal_y!=0)//DFP + if(std::fabs(s_scal_y) > std::numeric_limits<double>::epsilon())//DFP + { + KQuasiNewton=KQuasiNewton+0.0001*(s_quasi*s_quasi.t()/s_scal_y-KQuasiNewton*y_quasi*y_quasi.t()*KQuasiNewton/(y_quasi.t()*KQuasiNewton*y_quasi)); + //std::cout<<"mise a jour K"<<std::endl; + } + } + dp=gain*KQuasiNewton*G; + //std::cout<<KQuasiNewton<<std::endl<<std::endl; + p_prec=p; + G_prec=G; + //p-=1.01*dp; + } + break; + + default: + { + if(useBrent) + { + alpha=2.; + computeOptimalBrentGain(I,p,-MI,dp,alpha); + dp=alpha*dp; + } + if(ApproxHessian==HESSIAN_NONSECOND) + dp=-1.*dp; + + break; + } + } + + Warp->getParamInverse(dp,dpinv); + Warp->pRondp(p,dpinv,p); + + iteration++; + iterationGlobale++; + + computeEvalRMS(p); + + // std::cout << p.t() << std::endl; + } + while( (!diverge) && (std::fabs(MI-MIprec) > std::fabs(MI)*std::numeric_limits<double>::epsilon()) &&(iteration< iterationMax)&&(evolRMS>threshold_RMS) ); + //while( (!diverge) && (MI!=MIprec) &&(iteration< iterationMax)&&(evolRMS>threshold_RMS) ); + + nbIteration=iteration; + + if(diverge) + { + if(computeCovariance){ + covarianceMatrix = vpMatrix(Warp->getNbParam(),Warp->getNbParam()); + covarianceMatrix = -1; + MI_postEstimation = -1; + NMI_postEstimation = -1; + } + deletePosEvalRMS(); + + // throw(vpTrackingException(vpTrackingException::badValue, "Tracking failed")) ; + } + else + { + MI_postEstimation=-getCost(I,p); + NMI_postEstimation=-getNormalizedCost(I,p); + // std::cout << "MI apres: " << MI_postEstimation << std::endl; + // std::cout << "NMI apres: " << NMI_postEstimation << std::endl; + if(MI_preEstimation>MI_postEstimation) + { + p=p_avant_estimation; + MI_postEstimation = MI_preEstimation; + NMI_postEstimation = NMI_preEstimation; + covarianceMatrix = vpMatrix(Warp->getNbParam(),Warp->getNbParam()); + covarianceMatrix = -1; + } + + deletePosEvalRMS(); + + if(computeCovariance){ + try{ + covarianceMatrix = (-H).inverseByLU(); + // covarianceMatrix = (-Hnorm).inverseByLU(); + } + catch(...){ + covarianceMatrix = vpMatrix(Warp->getNbParam(),Warp->getNbParam()); + covarianceMatrix = -1; + MI_postEstimation = -1; + NMI_postEstimation = -1; + deletePosEvalRMS(); + } + } + } +} + +void vpTemplateTrackerMIInverseCompositional::initPosEvalRMS(const vpColVector &pw) +{ + unsigned int nb_corners = zoneTracked->getNbTriangle() * 3; + x_pos=new double[nb_corners]; + y_pos=new double[nb_corners]; + + Warp->computeCoeff(pw); + vpTemplateTrackerTriangle triangle; + + for(unsigned int i=0;i<zoneTracked->getNbTriangle();i++) + { + zoneTracked->getTriangle(i, triangle); + for (unsigned int j=0; j<3; j++) { + triangle.getCorner(j, X1[0], X1[1]); + + Warp->computeDenom(X1,pw); + Warp->warpX(X1,X2,p); + x_pos[i*3+j]=X2[0]; + y_pos[i*3+j]=X2[1]; + } + } +} + +void vpTemplateTrackerMIInverseCompositional::computeEvalRMS(const vpColVector &pw) +{ + unsigned int nb_corners = zoneTracked->getNbTriangle() * 3; + + Warp->computeCoeff(pw); + evolRMS=0; + vpTemplateTrackerTriangle triangle; + + for(unsigned int i=0;i<zoneTracked->getNbTriangle();i++) + { + zoneTracked->getTriangle(i, triangle); + for (unsigned int j=0; j<3; j++) { + triangle.getCorner(j, X1[0], X1[1]); + + Warp->computeDenom(X1,pw); + Warp->warpX(X1,X2,pw); + evolRMS+=(x_pos[i*3+j]-X2[0])*(x_pos[i*3+j]-X2[0])+(y_pos[i*3+j]-X2[1])*(y_pos[i*3+j]-X2[1]); + x_pos[i*3+j]=X2[0]; + y_pos[i*3+j]=X2[1]; + } + } + evolRMS=evolRMS/nb_corners; +} + +void vpTemplateTrackerMIInverseCompositional::deletePosEvalRMS() +{ + delete[] x_pos; + delete[] y_pos; +} diff --git a/modules/tracker/tt_mi/src/tools/vpTemplateTrackerMIBSpline.cpp b/modules/tracker/tt_mi/src/tools/vpTemplateTrackerMIBSpline.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7ff4e247fb1abe07864e719c10af3d2e9336ec93 --- /dev/null +++ b/modules/tracker/tt_mi/src/tools/vpTemplateTrackerMIBSpline.cpp @@ -0,0 +1,791 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Template tracker. + * + * Authors: + * Amaury Dame + * Aurelien Yol + * Fabien Spindler + * + *****************************************************************************/ +#include <visp3/tt_mi/vpTemplateTrackerMIBSpline.h> + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +void vpTemplateTrackerMIBSpline::PutPVBsplineD(double *Prt, int cr, double er, int ct, double et,int Nc, double val, const int °re) +{ + switch(degre) + { + case 4: + PutPVBsplineD4(Prt, cr, er, ct, et, Nc, val);break; + default: + PutPVBsplineD3(Prt, cr, er, ct, et, Nc, val);//std::cout<<"DEFAUT"<<std::endl; + } +} + +void vpTemplateTrackerMIBSpline::PutPVBsplineD3(double *Prt, int cr, double er, int ct, double et,int Nc, double val) +{ + int sr=0; + int st=0; + if(er>0.5){sr=1;er=er-1;} + if(et>0.5){st=1;et=et-1;} + double *pt=&Prt[((cr+sr)*Nc+(ct+st))*9]; + for(int ir=-1;ir<=1;ir++) + for(int it=-1;it<=1;it++) + { + *pt++ +=Bspline3(ir-er)*Bspline3(it-et)*val; + //pt++; + } +} + +void vpTemplateTrackerMIBSpline::PutPVBsplineD4(double *Prt, int cr, double er, int ct, double et,int Nc, double val) +{ + double Bti[4]; + + double Br; + double *ptBti=&Bti[0]; + for(int it=-1;it<=2;it++) + { + *ptBti++ =Bspline4i(it-et,it); + //pt++; + } + double *pt=&Prt[(cr*Nc+ct)*16]; + for(int ir=-1;ir<=2;ir++) + { + Br=Bspline4i(ir-er,ir); + ptBti=&Bti[0]; + for(int it=-1;it<=2;it++) + { + *pt++ +=Br* *ptBti++ *val; + } + } +} + +double vpTemplateTrackerMIBSpline::Bspline3(double diff) +{ + //double result; + double aDiff=std::fabs(diff); + // if(aDiff<0.5) + //// return (-(aDiff-0.5)*(aDiff-0.5)+(-aDiff+0.5)+0.5); + // return (-(aDiff * aDiff) + 0.75); + // else if(aDiff<1.5) + // return (0.5*(1.5-aDiff)*(1.5-aDiff)); + + if(aDiff<1.5){ + if(aDiff<0.5) + return (-(aDiff * aDiff) + 0.75); + return (0.5*(1.5-aDiff)*(1.5-aDiff)); + } + + return 0; +} + +double vpTemplateTrackerMIBSpline::Bspline4i(double diff,int &interv) +{ + switch(interv) + { + case -1: + return ((2.+diff)*(2.+diff)*(2.+diff)/6.); + case 0: + return (-diff*diff*diff/2.-diff*diff+4./6.); + case 1: + return (diff*diff*diff/2.-diff*diff+4./6.); + case 2: + return ((2.-diff)*(2.-diff)*(2.-diff)/6.); + default: + return 0; + } +} + +double vpTemplateTrackerMIBSpline::dBspline3(double diff) +{ + if((diff>-1.5)&&(diff<=-0.5)) + return diff+1.5; + else if((diff>-0.5)&&(diff<=0.5)) + return -2.*diff; + else if((diff>0.5)&&(diff<=1.5)) + return diff-1.5; + + // if(fabs(diff + 1.5) <= (-0.5 + 1.5)) + // return diff+1.5; + // else if(fabs(diff + 0.5) <= (0.5 + 0.5)) + // return -2.*diff; + // else if(fabs(diff - 0.5) <= (1.5 - 0.5)) + // return diff-1.5; + + return 0; +} + +double vpTemplateTrackerMIBSpline::dBspline4(double diff) +{ + if((diff>-2.)&&(diff<=-1.)) + return (diff+2.)*(diff+2.)/2.; + else if((diff>-1.)&&(diff<=0.)) + return -3.*diff*diff/2.-2.*diff; + else if((diff>0.)&&(diff<=1.)) + return 3.*diff*diff/2.-2.*diff; + else if((diff>1.)&&(diff<=2.)) + return -(diff-2.)*(diff-2.)/2.; + else + return 0; +} + +double vpTemplateTrackerMIBSpline::d2Bspline3(double diff) +{ + if((diff>-1.5)&&(diff<=-0.5)) + return 1.; + else if((diff>-0.5)&&(diff<=0.5)) + return -2.; + else if((diff>0.5)&&(diff<=1.5)) + return 1.; + else + return 0; +} + +double vpTemplateTrackerMIBSpline::d2Bspline4(double diff) +{ + if((diff>-2.)&&(diff<=-1.)) + return (diff+2.); + else if((diff>-1.)&&(diff<=0.)) + return -3.*diff-2.; + else if((diff>0.)&&(diff<=1.)) + return 3.*diff-2.; + else if((diff>1.)&&(diff<=2.)) + return -(diff-2.); + else + return 0; + +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline(double *Prt, int cr, double &er, int ct, double &et,int Nc, double *val, unsigned int &NbParam, int °ree) +{ + switch(degree) + { + case 4: + PutTotPVBspline4(Prt, cr, er, ct, et, Nc, val, NbParam); break; + default: + PutTotPVBspline3(Prt, cr, er, ct, et, Nc, val, NbParam); + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline(double *Prt, double *dPrt, double *d2Prt, int cr, double &er, int ct, double &et,int Ncb, double *val, unsigned int &NbParam, int °ree) +{ + switch(degree) + { + case 4: + PutTotPVBspline4(Prt, dPrt, d2Prt, cr, er, ct, et, Ncb, val, NbParam); break; + default: + PutTotPVBspline3(Prt, dPrt, d2Prt, cr, er, ct, et, Ncb, val, NbParam); + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline3(double *Prt, int cr, double &er, int ct, double &et,int Nc, double *val, unsigned int &NbParam) +{ + short int sr=0; + short int st=0; + if(er>0.5){sr=1;er=er-1;} + if(et>0.5){st=1;et=et-1;} + + double Br; + + double Bti[3]; + double dBti[3]; + double d2Bti[3]; + + double *ptBti=&Bti[0]; + double *ptdBti=&dBti[0]; + double *ptd2Bti=&d2Bti[0]; + + for(short int it=1;it>=-1;it--) + { + *ptBti++ =Bspline3(it+et); + *ptdBti++ =dBspline3(it+et); + *ptd2Bti++ =d2Bspline3(it+et); + } + + double *pt=&Prt[((cr+sr)*Nc+(ct+st))*9*(1+(int)(NbParam+NbParam*NbParam))]; + for(short int ir=-1;ir<=1;++ir) + { + Br=Bspline3(-ir+er); + + for(short unsigned int it=0;it<=2;++it) + { + *pt++ += Br * (Bti[it]); + + double v1 = Br * (dBti[it]); + for(short unsigned int ip=0;ip<NbParam;++ip) + { + *pt++ -= v1*val[ip]; + double v2 = Br * (d2Bti[it]) * val[ip]; + for(short unsigned int ip2=0;ip2<NbParam;++ip2) + *pt++ += v2*val[ip2]; + } + } + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline3(double *Prt, double *dPrt, double *d2Prt, int cr, double &er, int ct, double &et,int Ncb, double *val, unsigned int &NbParam) +{ + short int sr=0; + short int st=0; + if(er>0.5){sr=1;er=er-1;} + if(et>0.5){st=1;et=et-1;} + + double Br; + + double Bti[3]; + double dBti[3]; + double d2Bti[3]; + + double *ptBti=&Bti[0]; + double *ptdBti=&dBti[0]; + double *ptd2Bti=&d2Bti[0]; + + for(short int it=1;it>=-1;it--) + { + *ptBti++ =Bspline3(it+et); + *ptdBti++ =dBspline3(it+et); + *ptd2Bti++ =d2Bspline3(it+et); + } + + int NbParam_ = (int)NbParam; + for(short int ir=-1;ir<=1;++ir) + { + Br=Bspline3(-ir+er); + short int irInd = ir + 1; + short int ind = (cr+sr+irInd)*Ncb; + for(short int it=0;it<=2;++it) + { + Prt[ind+(ct+st+it)] += Br * (Bti[it]); + + double v1 = Br * (dBti[it]); + int ind1 = ((cr+sr+irInd)*Ncb+(ct+st+it))*NbParam_; + for (int ip=0;ip<NbParam_;++ip) + { + dPrt[ind1+ip]-= v1*val[ip]; + double v2 = Br * (d2Bti[it]) * val[ip]; + int ind2 = ((cr+sr+irInd)*Ncb+(ct+st+it))*NbParam_*NbParam_+ip*NbParam_; + for(short int ip2=0;ip2<NbParam_;++ip2) + d2Prt[ind2+ip2] += v2*val[ip2]; + } + } + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline3(double *Prt, double &er, double *bt, unsigned int size) +{ + // double Br; + // for(short int ir=-1;ir<=1;++ir) + // { + // Br=Bspline3(-ir+er); + + // for(short unsigned int it=0;it < size;++it) + // *Prt++ += Br * bt[it]; + // } +#define LSIZE 12 + + double Br; + const double *btend; + double *bt0 = &bt[0]; + if(er>0.5){er=er-1.0;} + + for(int ir=-1;ir<=1;++ir) + { + Br=Bspline3(-ir+er); + btend = bt0 + size; + bt = bt0; + + if (size >= LSIZE) { + btend -= LSIZE - 1; + for (; bt < btend; bt += LSIZE){ + *Prt++ += Br * bt[0]; + *Prt++ += Br * bt[1]; + *Prt++ += Br * bt[2]; + *Prt++ += Br * bt[3]; + *Prt++ += Br * bt[4]; + *Prt++ += Br * bt[5]; + *Prt++ += Br * bt[6]; + *Prt++ += Br * bt[7]; + *Prt++ += Br * bt[8]; + *Prt++ += Br * bt[9]; + *Prt++ += Br * bt[10]; + *Prt++ += Br * bt[11]; + } + btend += LSIZE - 1; + } + for (; bt < btend; *Prt++ += Br * *bt++) {}; + + } +#undef LSIZE +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline4(double *Prt, int cr, double er, int ct, double et,int Nc, double *val, unsigned int &NbParam) +{ + double Br; + + double Bti[4]; + double dBti[4]; + double d2Bti[4]; + + double *ptBti=&Bti[0]; + double *ptdBti=&dBti[0]; + double *ptd2Bti=&d2Bti[0]; + for(char it=-1;it<=2;it++) + { + *ptBti++ =vpTemplateTrackerBSpline::Bspline4(-it+et); + *ptdBti++ =dBspline4(-it+et); + *ptd2Bti++ =d2Bspline4(-it+et); + } + + int NbParam_ = (int)NbParam; + + double *pt=&Prt[(cr*Nc+ct)*16*(1+NbParam_+NbParam_*NbParam_)]; + for(char ir=-1;ir<=2;ir++) + { + Br=vpTemplateTrackerBSpline::Bspline4(-ir+er); + ptBti=&Bti[0]; + ptdBti=&dBti[0]; + ptd2Bti=&d2Bti[0]; + for(char it=-1;it<=2;it++) + { + *pt++ +=Br**ptBti; + for(short int ip=0;ip<NbParam_;ip++) + { + *pt++ -=Br**ptdBti*val[ip]; + for(short int ip2=0;ip2<NbParam_;ip2++) + *pt++ +=Br**ptd2Bti*val[ip]*val[ip2]; + } + ptBti++; + ptdBti++; + ptd2Bti++; + } + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline4(double *Prt, double *dPrt, double *d2Prt, int cr, double er, int ct, double et,int Ncb, double *val, unsigned int &NbParam) +{ + double Br; + + double Bti[4]; + double dBti[4]; + double d2Bti[4]; + + double *ptBti=&Bti[0]; + double *ptdBti=&dBti[0]; + double *ptd2Bti=&d2Bti[0]; + for(char it=-1;it<=2;it++) + { + *ptBti++ =vpTemplateTrackerBSpline::Bspline4(-it+et); + *ptdBti++ =dBspline4(-it+et); + *ptd2Bti++ =d2Bspline4(-it+et); + } + + int NbParam_ = (int)NbParam; + + for(int ir=-1;ir<=2;ir++) + { + Br=vpTemplateTrackerBSpline::Bspline4(-ir+er); + int irInd = ir + 1; + int ind = (cr+irInd)*Ncb+ct; + + ptBti=&Bti[0]; + ptdBti=&dBti[0]; + ptd2Bti=&d2Bti[0]; + + for(int it=-1;it<=2;it++) + { + Prt[ind+it] += Br * *ptBti; + int ind1 = ((cr+irInd)*Ncb+(ct+it))*NbParam_; + for(int ip=0;ip<NbParam_;ip++) + { + dPrt[ind1+ip]-= Br**ptdBti*val[ip]; + int ind2 = ((cr+irInd)*Ncb+(ct+it))*NbParam_*NbParam_+ip*NbParam_; + for(int ip2=0;ip2<NbParam_;ip2++) + d2Prt[ind2+ip2] += Br**ptd2Bti*val[ip]*val[ip2]; + } + ptBti++; + ptdBti++; + ptd2Bti++; + } + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline4(double *Prt, double &er, double *bt, unsigned int size) +{ +#define LSIZE 12 + double Br; + const double *btend; + double *bt0 = &bt[0]; + + for(int ir=-1;ir<=2;++ir) + { + Br=vpTemplateTrackerBSpline::Bspline4(-ir+er); + btend = bt0 + size; + bt = bt0; + + if (size >= LSIZE) { + btend -= LSIZE - 1; + for (; bt < btend; bt += LSIZE){ + *Prt++ += Br * bt[0]; + *Prt++ += Br * bt[1]; + *Prt++ += Br * bt[2]; + *Prt++ += Br * bt[3]; + *Prt++ += Br * bt[4]; + *Prt++ += Br * bt[5]; + *Prt++ += Br * bt[6]; + *Prt++ += Br * bt[7]; + *Prt++ += Br * bt[8]; + *Prt++ += Br * bt[9]; + *Prt++ += Br * bt[10]; + *Prt++ += Br * bt[11]; + } + btend += LSIZE - 1; + } + for (; bt < btend; *Prt++ += Br * *bt++) {}; + + } +#undef LSIZE +} + +void vpTemplateTrackerMIBSpline::PutTotPVBsplineNoSecond(double *Prt, int &cr, double &er, int &ct, double &et,int &Nc, double *val, unsigned int &NbParam, int °ree) +{ + switch(degree) + { + case 4: + PutTotPVBspline4NoSecond(Prt, cr, er, ct, et, Nc, val, NbParam); break; + default: + PutTotPVBspline3NoSecond(Prt, cr, er, ct, et, Nc, val, NbParam); + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBsplineNoSecond(double *Prt, double *dPrt, int &cr, double &er, int &ct, double &et,int &Ncb, double *val, unsigned int &NbParam, int °ree) +{ + switch(degree) + { + case 4: + PutTotPVBspline4NoSecond(Prt, dPrt, cr, er, ct, et, Ncb, val, NbParam); break; + default: + PutTotPVBspline3NoSecond(Prt, dPrt, cr, er, ct, et, Ncb, val, NbParam); + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline3NoSecond(double *Prt, int &cr, double &er, int &ct, double &et,int &Nc, double *val, unsigned int &NbParam) +{ + int sr=0; + int st=0; + if(er>0.5){sr=1;er=er-1;} + if(et>0.5){st=1;et=et-1;} + + double Br; + + double Bti[3]; + double dBti[3]; + + double *ptBti=&Bti[0]; + double *ptdBti=&dBti[0]; + for(char it=-1;it<=1;it++) + { + *ptBti++ =Bspline3(-it+et); + *ptdBti++ =dBspline3(-it+et); + } + + int NbParam_ = (int)NbParam; + + double *pt=&Prt[((cr+sr)*Nc+(ct+st))*9*(1+NbParam_+NbParam_*NbParam_)]; + for(char ir=-1;ir<=1;ir++) + { + Br=Bspline3(-ir+er); + ptBti=&Bti[0]; + ptdBti=&dBti[0]; + for(char it=-1;it<=1;it++) + { + *pt++ +=Br**ptBti; + for(unsigned int ip=0;ip<NbParam;ip++) + { + *pt++ -=Br**ptdBti*val[ip]; + pt=pt+NbParam; // Modif AY + } + // pt=pt+NbParam*NbParam; // Modif AY + ptBti++; + ptdBti++; + } + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline3NoSecond(double *Prt, double *dPrt, int &cr, double &er, int &ct, double &et,int &Ncb, double *val, unsigned int &NbParam) +{ + int sr=0; + int st=0; + if(er>0.5){sr=1;er=er-1;} + if(et>0.5){st=1;et=et-1;} + + double Br; + + double Bti[3]; + double dBti[3]; + + double *ptBti=&Bti[0]; + double *ptdBti=&dBti[0]; + for(char it=-1;it<=1;it++) + { + *ptBti++ =Bspline3(-it+et); + *ptdBti++ =dBspline3(-it+et); + } + + int NbParam_ = (int)NbParam; + + for(char ir=-1;ir<=1;ir++) + { + Br=Bspline3(-ir+er); + + int irInd = ir + 1; + int ind = (cr+sr+irInd)*Ncb; + + ptBti=&Bti[0]; + ptdBti=&dBti[0]; + for(char it=-1;it<=1;it++) + { + Prt[ind+(ct+st+it)] += Br**ptBti; + int ind1 = ((cr+sr+irInd)*Ncb+(ct+st+it))*NbParam_; + for(short int ip=0;ip<NbParam_;ip++) + { + dPrt[ind1+ip]-= Br**ptdBti*val[ip]; + } + ptBti++; + ptdBti++; + } + } +} + + +void vpTemplateTrackerMIBSpline::PutTotPVBspline4NoSecond(double *Prt, int &cr, double &er, int &ct, double &et,int &Nc, double *val, unsigned int &NbParam) +{ + double Br; + + double Bti[4]; + double dBti[4]; + + for(char it=-1;it<=2;it++) + { + Bti[it+1] =vpTemplateTrackerBSpline::Bspline4(-it+et); + dBti[it+1] = dBspline4(-it+et); + } + + int NbParam_ = (int)NbParam; + + double *pt=&Prt[(cr*Nc+ct)*16*(1+NbParam_+NbParam_*NbParam_)]; + for(int ir=-1;ir<=2;ir++) + { + Br=vpTemplateTrackerBSpline::Bspline4(-ir+er); + for(int it=0;it<=3;it++) + { + (*pt++) +=Br*Bti[it]; + + for(int ip=0;ip<NbParam_;ip++) + { + (*pt++) -=Br*dBti[it]*val[ip]; + pt=pt+NbParam_; // Modif AY + } + // pt=pt+NbParam*NbParam; // Modif AY + } + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline4NoSecond(double *Prt, double *dPrt, int &cr, double &er, int &ct, double &et,int &Ncb, double *val, unsigned int &NbParam) +{ + double Br; + + double Bti[4]; + double dBti[4]; + + for(char it=-1;it<=2;it++) + { + Bti[it+1] =vpTemplateTrackerBSpline::Bspline4(-it+et); + dBti[it+1] = dBspline4(-it+et); + } + + int NbParam_ = (int)NbParam; + + for(int ir=-1;ir<=2;ir++) + { + Br=vpTemplateTrackerBSpline::Bspline4(-ir+er); + int irInd = ir + 1; + int ind = (cr+irInd)*Ncb+ct; + + for(int it=0;it<=3;it++) + { + Prt[ind+it] += Br*Bti[it]; + int ind1 = ((cr+irInd)*Ncb+(ct+it))*NbParam_; + + for(int ip=0;ip<NbParam_;ip++) + { + dPrt[ind1+ip]-= Br*dBti[it]*val[ip]; + } + } + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBsplinePrtTout(double *PrtTout, int &cr, double &er, int &ct, double &et,int &Nc, unsigned int &NbParam, int °ree) +{ + switch(degree) + { + case 4: + PutTotPVBspline4PrtTout(PrtTout, cr, er, ct, et, Nc, NbParam); break; + default: + PutTotPVBspline3PrtTout(PrtTout, cr, er, ct, et, Nc, NbParam); + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline3PrtTout(double *PrtTout, int &cr, double &er, int &ct, double &et,int &Nc, unsigned int &NbParam) +{ + + int sr=0; + int st=0; + if(er>0.5){sr=1;er=er-1;} + if(et>0.5){st=1;et=et-1;} + + double Br; + + double Bti[3]; + + for(char it=-1;it<=1;it++) + { + Bti[it+1] = Bspline3(-it+et); + } + + int NbParam_ = (int)NbParam; + int NbParam_val = NbParam_+NbParam_*NbParam_; + + double *pt=&PrtTout[(unsigned int)(((cr+sr)*Nc+(ct+st))*9*(1+NbParam_val))]; + for(int ir=-1;ir<=1;ir++) + { + Br= Bspline3(-ir+er); + for(int it=0;it<=2;it++) + { + (*pt++) +=Br*Bti[it]; + pt=pt+NbParam_val; + } + } +} +void vpTemplateTrackerMIBSpline::PutTotPVBspline4PrtTout(double *PrtTout, int &cr, double &er, int &ct, double &et,int &Nc, unsigned int &NbParam) +{ + + double Br; + + double Bti[4]; + + for(char it=-1;it<=2;it++) + { + Bti[it+1] =vpTemplateTrackerBSpline::Bspline4(-it+et); + } + + int NbParam_ = (int)NbParam; + int NbParam_val = NbParam_+NbParam_*NbParam_; + double *pt=&PrtTout[(unsigned int)((cr*Nc+ct)*16*(1+NbParam_val))]; + for(int ir=-1;ir<=2;ir++) + { + Br=vpTemplateTrackerBSpline::Bspline4(-ir+er); + for(int it=0;it<=3;it++) + { + (*pt++) +=Br*Bti[it]; + pt=pt+NbParam_val; + } + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBsplinePrt(double *Prt, int &cr, double &er, int &ct, double &et,int &Ncb, unsigned int &NbParam, int °ree) +{ + switch(degree) + { + case 4: + PutTotPVBspline4PrtTout(Prt, cr, er, ct, et, Ncb, NbParam); break; + default: + PutTotPVBspline3PrtTout(Prt, cr, er, ct, et, Ncb, NbParam); + } +} + +void vpTemplateTrackerMIBSpline::PutTotPVBspline3Prt(double *Prt, int &cr, double &er, int &ct, double &et,int &Ncb) +{ + + int sr=0; + int st=0; + if(er>0.5){sr=1;er=er-1;} + if(et>0.5){st=1;et=et-1;} + + double Br; + + double Bti[3]; + + for(char it=-1;it<=1;it++) + { + Bti[it+1] = Bspline3(-it+et); + } + + for(int ir=-1;ir<=1;ir++) + { + Br= Bspline3(-ir+er); + + int irInd = ir + 1; + int ind = (cr+sr+irInd)*Ncb; + for(int it=0;it<=2;it++) + { + Prt[ind+(ct+st+it)] += Br*Bti[it]; + } + } +} + + +void vpTemplateTrackerMIBSpline::PutTotPVBspline4Prt(double *Prt, int &cr, double &er, int &ct, double &et,int &Ncb) +{ + + double Br; + + double Bti[4]; + + for(char it=-1;it<=2;it++) + { + Bti[it+1] =vpTemplateTrackerBSpline::Bspline4(-it+et); + } + + for(int ir=-1;ir<=2;ir++) + { + Br=vpTemplateTrackerBSpline::Bspline4(-ir+er); + int irInd = ir + 1; + int ind = (cr+irInd)*Ncb+ct; + + for(int it=0;it<=3;it++) + { + Prt[ind+it] += Br*Bti[it]; + } + } +} + +#endif diff --git a/src/robot/simulator-robot/arms/CMakeRobotArmsList.cmake b/modules/vision/CMakeLists.txt similarity index 56% rename from src/robot/simulator-robot/arms/CMakeRobotArmsList.cmake rename to modules/vision/CMakeLists.txt index 4cf0a103fcf2b89f0fcc63ae08a0e266ff62890a..63a1b9948172bae57d33336cf6b6dc92be39c45f 100644 --- a/src/robot/simulator-robot/arms/CMakeRobotArmsList.cmake +++ b/modules/vision/CMakeLists.txt @@ -1,10 +1,8 @@ ############################################################################# # -# $Id: CMakeRobotArmsList.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# # This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# # This software is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # ("GPL") version 2 as published by the Free Software Foundation. @@ -12,45 +10,42 @@ # distribution for additional information about the GNU GPL. # # For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional +# GPL, please contact Inria about acquiring a ViSP Professional # Edition License. # -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# +# See http://visp.inria.fr for more information. +# # This software was developed at: -# INRIA Rennes - Bretagne Atlantique +# Inria Rennes - Bretagne Atlantique # Campus Universitaire de Beaulieu # 35042 Rennes Cedex # France -# http://www.irisa.fr/lagadic # # If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# +# Inria at visp@inria.fr +# # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # # Description: -# Default scenes used by the vpSimulatorViper850 +# ViSP configuration file. # # Authors: -# Nicolas Melchior +# Fabien Spindler # ############################################################################# -SET(ROBOT_ARMS_SCENES - afma6_gate.bnd - afma6_arm1.bnd - afma6_arm2.bnd - afma6_arm3.bnd - afma6_arm4.bnd - afma6_tool_ccmop.bnd - afma6_tool_gripper.bnd - afma6_tool_vacuum.bnd - viper850_arm1.bnd - viper850_arm2.bnd - viper850_arm3.bnd - viper850_arm4.bnd - viper850_arm5.bnd - viper850_arm6.bnd -) +vp_add_module(vision visp_core OPTIONAL visp_visual_features visp_io) +vp_glob_module_sources() +vp_module_include_directories() +vp_create_module() + +if (CMAKE_VERSION VERSION_LESS 2.8.12) + vp_add_tests( + SOURCES_EXCLUDE + key-point/testKeyPoint-2.cpp + key-point/testKeyPoint-4.cpp + DEPENDS_ON visp_mbt visp_gui visp_io) +else() + vp_add_tests(DEPENDS_ON visp_mbt visp_gui visp_io) +endif() diff --git a/src/key-point/vpBasicKeyPoint.h b/modules/vision/include/visp3/vision/vpBasicKeyPoint.h similarity index 94% rename from src/key-point/vpBasicKeyPoint.h rename to modules/vision/include/visp3/vision/vpBasicKeyPoint.h index 375aa74911432fadecfa1b3ba63af7069fb2a2b8..4290ad0faa41bf3576168b7627ae36f00bf64c43 100644 --- a/src/key-point/vpBasicKeyPoint.h +++ b/modules/vision/include/visp3/vision/vpBasicKeyPoint.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpBasicKeyPoint.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Key point used in matching algorithm. * @@ -48,23 +44,22 @@ \brief class that defines what is a Keypoint */ -#include <visp/vpColor.h> -#include <visp/vpImage.h> -#include <visp/vpImagePoint.h> -#include <visp/vpRect.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpRect.h> #include <vector> /*! \class vpBasicKeyPoint + \ingroup group_vision_keypoints \brief class that defines what is a Keypoint. This class provides all the basic elements to implement classes which aims to match points from an image to another. */ - - class VISP_EXPORT vpBasicKeyPoint { public: diff --git a/src/camera/calibration/vpCalibration.h b/modules/vision/include/visp3/vision/vpCalibration.h similarity index 80% rename from src/camera/calibration/vpCalibration.h rename to modules/vision/include/visp3/vision/vpCalibration.h index 7be48a69aa05681718b4b8e93be73e7a476e7b4a..34be3a125e1295d40229618cee0352a59b01dbe7 100644 --- a/src/camera/calibration/vpCalibration.h +++ b/modules/vision/include/visp3/vision/vpCalibration.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpCalibration.h 4921 2014-10-09 08:19:29Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Camera calibration. * @@ -53,24 +49,21 @@ #ifndef vpCalibration_h #define vpCalibration_h -#include <visp/vpMatrix.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpExponentialMap.h> -#include <visp/vpMath.h> -#include <visp/vpDisplay.h> -#include <visp/vpImage.h> -#include <visp/vpCalibrationException.h> -#include <visp/vpImagePoint.h> -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -# include <visp/vpList.h> -#endif +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpExponentialMap.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpImage.h> +#include <visp3/vision/vpCalibrationException.h> +#include <visp3/core/vpImagePoint.h> #include <list> #include <vector> /*! \class vpCalibration - \ingroup Calibration + \ingroup group_vision_calib \brief Tools for perspective camera calibration. @@ -169,26 +162,6 @@ public: static void setLambda(const double &lambda){gain = lambda;} int writeData(const char *filename) ; -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated functions - */ - static void calibrationTsai(unsigned int nbPose, vpHomogeneousMatrix cMo[], - vpHomogeneousMatrix rMe[], - vpHomogeneousMatrix &eMc); - static int computeCalibrationMulti(vpCalibrationMethodType method,unsigned int nbPose, - vpCalibration table_cal[], - vpCameraParameters &cam, - bool verbose = false) ; - vp_deprecated static int computeCalibrationTsai(unsigned int nbPose, - vpCalibration table_cal[], - vpHomogeneousMatrix &eMc, - vpHomogeneousMatrix &eMc_dist); - vp_deprecated static int readGrid(const char *filename,unsigned int &n, - vpList<double> &oX,vpList<double> &oY,vpList<double> &oZ, - bool verbose = false); -#endif - private: void computePose(const vpCameraParameters &cam, vpHomogeneousMatrix &cMo); void calibLagrange( vpCameraParameters &cam , vpHomogeneousMatrix &cMo) ; diff --git a/src/camera/calibration/vpCalibrationException.h b/modules/vision/include/visp3/vision/vpCalibrationException.h similarity index 86% rename from src/camera/calibration/vpCalibrationException.h rename to modules/vision/include/visp3/vision/vpCalibrationException.h index 17724202e736513e67d2a54bad563545e24ed56d..38f1d1e2d98d4516ea5ee5d6ed487455ca8481b7 100644 --- a/src/camera/calibration/vpCalibrationException.h +++ b/modules/vision/include/visp3/vision/vpCalibrationException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpCalibrationException.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exceptions that can be emited by the vpCalibration class and its derivates. * @@ -50,8 +46,8 @@ /* Classes standards. */ // -#include <visp/vpConfig.h> -#include <visp/vpException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> #include <iostream> /* Classe std::ostream. */ #include <string> /* Classe string. */ @@ -63,9 +59,6 @@ /*! \class vpCalibrationException - - \ingroup Exception - \brief Error that can be emited by the vpCalibration class. */ class VISP_EXPORT vpCalibrationException : public vpException diff --git a/src/key-point/vpFernClassifier.h b/modules/vision/include/visp3/vision/vpFernClassifier.h similarity index 93% rename from src/key-point/vpFernClassifier.h rename to modules/vision/include/visp3/vision/vpFernClassifier.h index 118105b68e6453fde526982282e9c1f4a69a4948..811d00f3c1f312925a2d8d3ad166d3ddae15d670 100644 --- a/src/key-point/vpFernClassifier.h +++ b/modules/vision/include/visp3/vision/vpFernClassifier.h @@ -1,36 +1,32 @@ /**************************************************************************** - * - * $Id: vpFernClassifier.h 5203 2015-01-24 09:33:54Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.GPL at the root directory of this source + * See the file LICENSE.txt at the root directory of this source * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Class that implements the Fern classifier and the YAPE detector thanks * to the OpenCV library. @@ -43,7 +39,7 @@ #ifndef vpFernClassifier_H #define vpFernClassifier_H -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <string> @@ -57,10 +53,11 @@ # include <cvaux.hpp> #endif -#include <visp/vpBasicKeyPoint.h> +#include <visp3/vision/vpBasicKeyPoint.h> /*! \class vpFernClassifier + \ingroup group_vision_keypoints \brief Class that implements the Fern classifier and the YAPE detector thanks to the OpenCV library. @@ -87,9 +84,9 @@ The following small example shows how to use the class. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpFernClassifier.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/vision/vpFernClassifier.h> #if VISP_HAVE_OPENCV_VERSION >= 0x020000 // Fern classifier only available since OpenCV-2.0.0 int main() @@ -123,10 +120,10 @@ int main() {} part of the current image. The small following example shows how to do this. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpFernClassifier.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/vision/vpFernClassifier.h> #if VISP_HAVE_OPENCV_VERSION >= 0x020000 // Fern classifier only available since OpenCV-2.0.0 int main() diff --git a/src/computer-vision/homography-estimation/vpHomography.h b/modules/vision/include/visp3/vision/vpHomography.h similarity index 78% rename from src/computer-vision/homography-estimation/vpHomography.h rename to modules/vision/include/visp3/vision/vpHomography.h index c7c885377c077e3f505ec4f59830db4640b8f4fb..1ef90ab3877e2c8ad7396445e010ae57ec2e83b3 100644 --- a/src/computer-vision/homography-estimation/vpHomography.h +++ b/modules/vision/include/visp3/vision/vpHomography.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHomography.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Homography transformation. * @@ -54,19 +50,24 @@ tools for homography computation. #include <list> #include <vector> -#include <visp/vpCameraParameters.h> -#include <visp/vpImagePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpPlane.h> -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -# include <visp/vpList.h> -#endif +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpPlane.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpMatrix.h> /*! \class vpHomography - \ingroup Homography HomographyTransformation - \brief This class aims to compute the homography wrt.two images. + \ingroup group_vision_homography + + \brief Implementation of an homography and operations on homographies. + + This class aims to compute the homography wrt. two images. + + The vpHomography class is derived from vpArray2D<double>. These two images are both described by a set of points. The 2 sets (one per image) are sets of corresponding points : for a point in a image, there is @@ -96,10 +97,10 @@ tools for homography computation. respectively. \code -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpHomography.h> -#include <visp/vpMath.h> -#include <visp/vpMeterPixelConversion.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpMeterPixelConversion.h> int main() { @@ -175,12 +176,8 @@ int main() \endcode */ -class VISP_EXPORT vpHomography +class VISP_EXPORT vpHomography : public vpArray2D<double> { - public: - //! Data array - double *data; - private: static const double sing_threshold; // = 0.0001; static const double threshold_rotation; @@ -214,8 +211,7 @@ class VISP_EXPORT vpHomography vpHomography() ; vpHomography(const vpHomography &H) ; //! Construction from Translation and rotation and a plane - vpHomography(const vpHomogeneousMatrix &aMb, - const vpPlane &bP) ; + vpHomography(const vpHomogeneousMatrix &aMb, const vpPlane &bP) ; //! Construction from Translation and rotation and a plane vpHomography(const vpRotationMatrix &aRb, const vpTranslationVector &atb, @@ -227,7 +223,7 @@ class VISP_EXPORT vpHomography //! Construction from Translation and rotation and a plane vpHomography(const vpPoseVector &arb, const vpPlane &bP) ; - virtual ~vpHomography(); + virtual ~vpHomography() {}; //! Construction from Translation and rotation and a plane void buildFrom(const vpRotationMatrix &aRb, @@ -243,6 +239,7 @@ class VISP_EXPORT vpHomography //! Construction from homogeneous matrix and a plane void buildFrom(const vpHomogeneousMatrix &aMb, const vpPlane &bP) ; + vpMatrix convert() const; void computeDisplacement(vpRotationMatrix &aRb, vpTranslationVector &atb, @@ -253,10 +250,7 @@ class VISP_EXPORT vpHomography vpTranslationVector &atb, vpColVector &n) ; - //! Return the number of rows of the homography matrix. - inline unsigned int getRows() const { return 3;} - //! Return the number of columns of the homography matrix. - inline unsigned int getCols() const { return 3; } + void eye(); //! invert the homography vpHomography inverse() const ; @@ -266,17 +260,13 @@ class VISP_EXPORT vpHomography //! Load an homography from a file void load(std::ifstream &f) ; - //! Write elements Hij (usage : H[i][j] = x ) - inline double *operator[](unsigned int i) { return &data[i*3]; } - //! Read elements Hij (usage : x = H[i][j] ) - inline double *operator[](unsigned int i) const {return &data[i*3];} - // Multiplication by an homography vpHomography operator*(const vpHomography &H) const; - // Multiplication by a scalar vpHomography operator*(const double &v) const; vpColVector operator*(const vpColVector &b) const; + // Multiplication by a point + vpPoint operator*(const vpPoint &H) const; // Division by a scalar vpHomography operator/(const double &v) const; @@ -284,12 +274,23 @@ class VISP_EXPORT vpHomography vpHomography & operator=(const vpHomography &H); vpHomography & operator=(const vpMatrix &H); - //! Save an homography in a file - void save(std::ofstream &f) const ; + vpImagePoint projection(const vpImagePoint &p); - void setIdentity(); + /*! + This function is not applicable to an homography that is always a + 3-by-3 matrix. + \exception vpException::fatalError When this function is called. + */ + void resize(const unsigned int nrows, const unsigned int ncols, + const bool flagNullify = true) + { + (void)nrows; + (void)ncols; + (void)flagNullify; + throw(vpException(vpException::fatalError, "Cannot resize an homography matrix")); + }; - friend VISP_EXPORT std::ostream &operator << (std::ostream &s,const vpHomography &H); + void save(std::ofstream &f) const ; static void DLT(const std::vector<double> &xb, const std::vector<double> &yb, const std::vector<double> &xa, const std::vector<double> &ya , @@ -339,7 +340,7 @@ class VISP_EXPORT vpHomography vpTranslationVector &atb, vpColVector &n) ; - static void computeDisplacement(const vpMatrix &H, + static void computeDisplacement(const vpHomography &H, const double x, const double y, std::list<vpRotationMatrix> & vR, @@ -388,55 +389,15 @@ class VISP_EXPORT vpHomography #endif // DOXYGEN_SHOULD_SKIP_THIS -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + /*! @name Deprecated functions */ - vp_deprecated static void computeDisplacement(const vpMatrix H, - const double x, - const double y, - vpList<vpRotationMatrix> & vR, - vpList<vpTranslationVector> & vT, - vpList<vpColVector> & vN); - - static void DLT(unsigned int n, - double *xb, double *yb , - double *xa, double *ya, - vpHomography &aHb) ; - vp_deprecated static void HartleyDLT(unsigned int n, - double *xb, double *yb , - double *xa, double *ya, - vpHomography &aHb) ; - - static void HLM(unsigned int n, - double *xb, double *yb, - double *xa, double *ya , - bool isplan, - vpHomography &aHb) ; - - //! Print the matrix - vp_deprecated void print() ; - - vp_deprecated static bool ransac(unsigned int n, - double *xb, double *yb, - double *xa, double *ya , - vpHomography &aHb, - int consensus = 1000, - double threshold = 1e-6) ; - - vp_deprecated static bool ransac(unsigned int n, - double *xb, double *yb, - double *xa, double *ya , - vpHomography &aHb, - vpColVector& inliers, - double residual = 0.1, // Not used - int consensus = 1000, - double threshold = 1e-6, - double areaThreshold = 0.0); - -#endif // VISP_BUILD_DEPRECATED_FUNCTIONS -} ; - + //@{ + void setIdentity(); + //@} +#endif +}; #endif diff --git a/src/key-point/vpKeyPoint.h b/modules/vision/include/visp3/vision/vpKeyPoint.h similarity index 76% rename from src/key-point/vpKeyPoint.h rename to modules/vision/include/visp3/vision/vpKeyPoint.h index 7d1e70f5c44834b725391fd9f0a08988cd1a4824..a26c95e7ae5b2910f6f9ac49aa6e848aaae38b3c 100644 --- a/src/key-point/vpKeyPoint.h +++ b/modules/vision/include/visp3/vision/vpKeyPoint.h @@ -1,7 +1,7 @@ /**************************************************************************** * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -10,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -48,26 +47,28 @@ #include <map> // std::map #include <limits> -#include <visp/vpConfig.h> -#include <visp/vpBasicKeyPoint.h> -#include <visp/vpImageConvert.h> -#include <visp/vpPoint.h> -#include <visp/vpDisplay.h> -#include <visp/vpPlane.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpMbEdgeTracker.h> -#include <visp/vpIoTools.h> -#include <visp/vpPose.h> -#include <visp/vpImageIo.h> -#include <visp/vpPolygon.h> -#include <visp/vpXmlConfigParserKeyPoint.h> -#include <visp/vpConvert.h> +#include <visp3/core/vpConfig.h> +#include <visp3/vision/vpBasicKeyPoint.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpPlane.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/vision/vpPose.h> +#ifdef VISP_HAVE_MODULE_IO +# include <visp3/io/vpImageIo.h> +#endif +#include <visp3/core/vpPolygon.h> +#include <visp3/vision/vpXmlConfigParserKeyPoint.h> +#include <visp3/core/vpConvert.h> +#include <visp3/core/vpMeterPixelConversion.h> // Require at least OpenCV >= 2.1.1 #if (VISP_HAVE_OPENCV_VERSION >= 0x020101) #include <opencv2/features2d/features2d.hpp> #include <opencv2/calib3d/calib3d.hpp> +#include <opencv2/imgproc/imgproc.hpp> #if defined(VISP_HAVE_OPENCV_XFEATURES2D) // OpenCV >= 3.0.0 # include <opencv2/xfeatures2d.hpp> @@ -81,6 +82,7 @@ /*! \class vpKeyPoint + \ingroup group_vision_keypoints \brief Class that allows keypoints detection (and descriptors extraction) and matching thanks to OpenCV library. This class permits to use different types of detectors, extractors and matchers easily. @@ -99,7 +101,6 @@ you can also estimate the pose of the object by matching a set of detected keypoints in the current image with the reference keypoints. - If you use this class, the first thing you have to do is to build the reference keypoints by detecting keypoints in a reference image which contains the object to detect. Then you match keypoints detected in a current image with those detected in a reference image @@ -118,9 +119,9 @@ The following small example shows how to use the class to do the matching between current and reference keypoints. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpKeyPoint.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/vision/vpKeyPoint.h> int main() { @@ -154,10 +155,10 @@ int main() and find keypoints to match in only a part of the current image. The small following example shows how to do this: \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpKeyPoint.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/vision/vpKeyPoint.h> int main() { @@ -229,6 +230,14 @@ public: the object is present if the score is above the threshold. */ } vpDetectionMethodType; + /*! Predefined constant for training image format. */ + typedef enum { + jpgImageFormat, /*!< Save training images in JPG format. */ + pngImageFormat, /*!< Save training images in PNG format. */ + ppmImageFormat, /*!< Save training images in PPM format. */ + pgmImageFormat /*!< Save training images in PGM format. */ + } vpImageFormatType; + vpKeyPoint(const std::string &detectorName="ORB", const std::string &extractorName="ORB", const std::string &matcherName="BruteForce-Hamming", const vpFilterMatchingType &filterType=ratioDistanceThreshold); @@ -241,9 +250,10 @@ public: unsigned int buildReference(const vpImage<unsigned char> &I, const vpRect& rectangle); void buildReference(const vpImage<unsigned char> &I, std::vector<cv::KeyPoint> &trainKeyPoint, - std::vector<cv::Point3f> &points3f, bool append=false); + std::vector<cv::Point3f> &points3f, const bool append=false, const int class_id=-1); void buildReference(const vpImage<unsigned char> &I, const std::vector<cv::KeyPoint> &trainKeyPoint, - const cv::Mat &trainDescriptors, const std::vector<cv::Point3f> &points3f, bool append=false); + const cv::Mat &trainDescriptors, const std::vector<cv::Point3f> &points3f, + const bool append=false, const int class_id=-1); static void compute3D(const cv::KeyPoint &candidate, const std::vector<vpPoint> &roi, const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, cv::Point3f &point); @@ -252,20 +262,24 @@ public: const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo, vpPoint &point); static void compute3DForPointsInPolygons(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, - std::vector<cv::KeyPoint> &candidate, std::vector<vpPolygon> &polygons, std::vector<std::vector<vpPoint> > &roisPt, - std::vector<cv::Point3f> &points, cv::Mat *descriptors=NULL); + std::vector<cv::KeyPoint> &candidate, const std::vector<vpPolygon> &polygons, + const std::vector<std::vector<vpPoint> > &roisPt, std::vector<cv::Point3f> &points, cv::Mat *descriptors=NULL); static void compute3DForPointsInPolygons(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, - std::vector<vpImagePoint> &candidate, std::vector<vpPolygon> &polygons, std::vector<std::vector<vpPoint> > &roisPt, - std::vector<vpPoint> &points, cv::Mat *descriptors=NULL); + std::vector<vpImagePoint> &candidate, const std::vector<vpPolygon> &polygons, + const std::vector<std::vector<vpPoint> > &roisPt, std::vector<vpPoint> &points, cv::Mat *descriptors=NULL); bool computePose(const std::vector<cv::Point2f> &imagePoints, const std::vector<cv::Point3f> &objectPoints, - const vpCameraParameters &cam, vpHomogeneousMatrix &cMo, std::vector<int> &inlierIndex, double &elapsedTime, - bool (*func)(vpHomogeneousMatrix *)=NULL); + const vpCameraParameters &cam, vpHomogeneousMatrix &cMo, std::vector<int> &inlierIndex, + double &elapsedTime, bool (*func)(vpHomogeneousMatrix *)=NULL); bool computePose(const std::vector<vpPoint> &objectVpPoints, vpHomogeneousMatrix &cMo, std::vector<vpPoint> &inliers, double &elapsedTime, bool (*func)(vpHomogeneousMatrix *)=NULL); + bool computePose(const std::vector<vpPoint> &objectVpPoints, vpHomogeneousMatrix &cMo, + std::vector<vpPoint> &inliers, std::vector<unsigned int> &inlierIndex, + double &elapsedTime, bool (*func)(vpHomogeneousMatrix *)=NULL); + void createImageMatching(vpImage<unsigned char> &IRef, vpImage<unsigned char> &ICurrent, vpImage<unsigned char> &IMatching); void createImageMatching(vpImage<unsigned char> &ICurrent, vpImage<unsigned char> &IMatching); @@ -288,8 +302,10 @@ public: const std::vector<vpImagePoint> &ransacInliers=std::vector<vpImagePoint>(), unsigned int crossSize=3, unsigned int lineThickness=1); - void extract(const vpImage<unsigned char> &I, std::vector<cv::KeyPoint> &keyPoints, cv::Mat &descriptors, double &elapsedTime); - void extract(const cv::Mat &matImg, std::vector<cv::KeyPoint> &keyPoints, cv::Mat &descriptors, double &elapsedTime); + void extract(const vpImage<unsigned char> &I, std::vector<cv::KeyPoint> &keyPoints, cv::Mat &descriptors, + double &elapsedTime, std::vector<cv::Point3f> *trainPoints=NULL); + void extract(const cv::Mat &matImg, std::vector<cv::KeyPoint> &keyPoints, cv::Mat &descriptors, + double &elapsedTime, std::vector<cv::Point3f> *trainPoints=NULL); /*! Get the covariance matrix when estimating the pose using the Virtual Visual Servoing approach. @@ -323,6 +339,21 @@ public: return m_detectionTime; } + /*! + Get the detector pointer. + \param name : Name of the detector. + + \return The detector or NULL if the name passed in parameter does not exist. + */ + inline cv::Ptr<cv::FeatureDetector> getDetector(const std::string &name) const { + std::map<std::string, cv::Ptr<cv::FeatureDetector> >::const_iterator findDetector = m_detectors.find(name); + if(findDetector != m_detectors.end()) { + return findDetector->second; + } + + return cv::Ptr<cv::FeatureDetector>(); + } + /*! Get the elapsed time to compute the keypoint extraction. @@ -332,6 +363,30 @@ public: return m_extractionTime; } + /*! + Get the extractor pointer. + \param name : Name of the extractor. + + \return The extractor or NULL if the name passed in parameter does not exist. + */ + inline cv::Ptr<cv::DescriptorExtractor> getExtractor(const std::string &name) const { + std::map<std::string, cv::Ptr<cv::DescriptorExtractor> >::const_iterator findExtractor = m_extractors.find(name); + if(findExtractor != m_extractors.end()) { + return findExtractor->second; + } + + return cv::Ptr<cv::DescriptorExtractor>(); + } + + /*! + Get the image format to use when saving training images. + + \return The image format. + */ + inline vpImageFormatType getImageFormat() const { + return m_imageFormat; + } + /*! Get the elapsed time to compute the matching. @@ -341,6 +396,15 @@ public: return m_matchingTime; } + /*! + Get the matcher pointer. + + \return The matcher pointer. + */ + inline cv::Ptr<cv::DescriptorMatcher> getMatcher() const { + return m_matcher; + } + /*! Get the list of matches (correspondences between the indexes of the detected keypoints and the train keypoints). @@ -356,7 +420,13 @@ public: \return The list of pairs with the correspondence between the matched query and train keypoints. */ inline std::vector<std::pair<cv::KeyPoint, cv::KeyPoint> > getMatchQueryToTrainKeyPoints() const { - return m_matchQueryToTrainKeyPoints; + std::vector<std::pair<cv::KeyPoint, cv::KeyPoint> > matchQueryToTrainKeyPoints(m_filteredMatches.size()); + for (size_t i = 0; i < m_filteredMatches.size(); i++) { + matchQueryToTrainKeyPoints.push_back(std::pair<cv::KeyPoint, cv::KeyPoint>( + m_queryFilteredKeyPoints[(size_t) m_filteredMatches[i].queryIdx], + m_trainKeyPoints[(size_t) m_filteredMatches[i].trainIdx])); + } + return matchQueryToTrainKeyPoints; } /*! @@ -446,16 +516,19 @@ public: unsigned int matchPoint(const vpImage<unsigned char> &I, const vpRect& rectangle); bool matchPoint(const vpImage<unsigned char> &I, const vpCameraParameters &cam, vpHomogeneousMatrix &cMo, - double &error, double &elapsedTime, bool (*func)(vpHomogeneousMatrix *)=NULL); + double &error, double &elapsedTime, bool (*func)(vpHomogeneousMatrix *)=NULL, + const vpRect& rectangle=vpRect()); bool matchPointAndDetect(const vpImage<unsigned char> &I, vpRect &boundingBox, vpImagePoint ¢erOfGravity, const bool isPlanarObject=true, std::vector<vpImagePoint> *imPts1=NULL, std::vector<vpImagePoint> *imPts2=NULL, double *meanDescriptorDistance=NULL, - double *detectionScore=NULL); + double *detectionScore=NULL, const vpRect& rectangle=vpRect()); bool matchPointAndDetect(const vpImage<unsigned char> &I, const vpCameraParameters &cam, vpHomogeneousMatrix &cMo, double &error, double &elapsedTime, vpRect &boundingBox, vpImagePoint ¢erOfGravity, - bool (*func)(vpHomogeneousMatrix *)=NULL); + bool (*func)(vpHomogeneousMatrix *)=NULL, const vpRect& rectangle=vpRect()); + + void reset(); void saveLearningData(const std::string &filename, const bool binaryMode=false, const bool saveTrainingImages=true); @@ -494,6 +567,7 @@ public: initDetector(detectorName); } +#if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000) /*! Template function to set to a \p parameterName a value for a specific detector named by his \p detectorName. @@ -507,6 +581,7 @@ public: m_detectors[detectorName]->set(parameterName, value); } } +#endif /*! Set and initialize a list of detectors denominated by their names \p detectorNames. @@ -532,6 +607,7 @@ public: initExtractor(extractorName); } +#if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000) /*! Template function to set to a \p parameterName a value for a specific extractor named by his \p extractorName. @@ -545,6 +621,7 @@ public: m_extractors[extractorName]->set(parameterName, value); } } +#endif /*! Set and initialize a list of extractors denominated by their names \p extractorNames. @@ -558,6 +635,15 @@ public: initExtractors(m_extractorNames); } + /*! + Set the image format to use when saving training images. + + \param imageFormat : The image format. + */ + inline void setImageFormat(const vpImageFormatType &imageFormat) { + m_imageFormat = imageFormat; + } + /*! Set and initialize a matcher denominated by his name \p matcherName. The different matchers are: @@ -595,8 +681,23 @@ public: //So this is useful only for ratioDistanceThreshold method if(filterType == ratioDistanceThreshold || filterType == stdAndRatioDistanceThreshold) { m_useKnn = true; + + #if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000) + if(m_matcher != NULL && m_matcherName == "BruteForce") { + //if a matcher is already initialized, disable the crossCheck + //because it will not work with knnMatch + m_matcher->set("crossCheck", false); + } + #endif } else { m_useKnn = false; + + #if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000) + if(m_matcher != NULL && m_matcherName == "BruteForce") { + //if a matcher is already initialized, set the crossCheck mode if necessary + m_matcher->set("crossCheck", m_useBruteForceCrossCheck); + } + #endif } } @@ -700,7 +801,7 @@ public: m_useAffineDetection = useAffine; } -#if (VISP_HAVE_OPENCV_VERSION >= 0x020400) +#if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000) /*! Set if cross check method must be used to eliminate some false matches with a brute-force matching method. @@ -710,10 +811,22 @@ public: //Only available with BruteForce and with k=1 (i.e not used with a ratioDistanceThreshold method) if(m_matcher != NULL && !m_useKnn && m_matcherName == "BruteForce") { m_matcher->set("crossCheck", useCrossCheck); + } else if(m_matcher != NULL && m_useKnn && m_matcherName == "BruteForce") { + std::cout << "Warning, you try to set the crossCheck parameter with a BruteForce matcher but knn is enabled"; + std::cout << " (the filtering method uses a ratio constraint)" << std::endl; } } #endif + /*! + Set if we want to match the train keypoints to the query keypoints. + + \param useMatchTrainToQuery : True to match the train keypoints to the query keypoints + */ + inline void setUseMatchTrainToQuery(const bool useMatchTrainToQuery) { + m_useMatchTrainToQuery = useMatchTrainToQuery; + } + /*! Set the flag to choose between a percentage value of inliers for the cardinality of the consensus group or a minimum number. @@ -733,6 +846,15 @@ public: m_useRansacVVS = ransacVVS; } + /*! + Set the flag to filter matches where multiple query keypoints are matched to the same train keypoints. + + \param singleMatchFilter : True to use the single match filter. + */ + inline void setUseSingleMatchFilter(const bool singleMatchFilter) { + m_useSingleMatchFilter = singleMatchFilter; + } + private: //! If true, compute covariance matrix if the user select the pose estimation method using ViSP bool m_computeCovariance; @@ -764,6 +886,8 @@ private: std::vector<cv::DMatch> m_filteredMatches; //! Chosen method of filtering to eliminate false matching. vpFilterMatchingType m_filterType; + //! Image format to use when saving the training images + vpImageFormatType m_imageFormat; //! List of k-nearest neighbors for each detected keypoints (if the method chosen is based upon on knn). std::vector<std::vector<cv::DMatch> > m_knnMatches; //! Map of image id to know to which training image is related a training keypoints. @@ -782,12 +906,8 @@ private: double m_matchingRatioThreshold; //! Elapsed time to do the matching. double m_matchingTime; - //! List of pairs between the matched query and train keypoints. - std::vector<std::pair<cv::KeyPoint, cv::KeyPoint> > m_matchQueryToTrainKeyPoints; //! List of pairs between the keypoint and the 3D point after the Ransac. std::vector<std::pair<cv::KeyPoint, cv::Point3f> > m_matchRansacKeyPointsToPoints; - //! List of pairs between the matched query and train keypoints after the Ransac. - std::vector<std::pair<cv::KeyPoint, cv::KeyPoint> > m_matchRansacQueryToTrainKeyPoints; //! Maximum number of iterations for the Ransac method. int m_nbRansacIterations; //! Minimum number of inliers for the Ransac method. @@ -824,15 +944,23 @@ private: std::vector<vpPoint> m_trainVpPoints; //! If true, use multiple affine transformations to cober the 6 affine parameters bool m_useAffineDetection; +#if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000) //! If true, some false matches will be eliminate by keeping only pairs (i,j) such that for i-th //! query descriptor the j-th descriptor in the matcher’s collection is the nearest and vice versa. bool m_useBruteForceCrossCheck; +#endif //! Flag set if a percentage value is used to determine the number of inliers for the Ransac method. bool m_useConsensusPercentage; //! Flag set if a knn matching method must be used. bool m_useKnn; + //! Flag set if we want to match the train keypoints to the query keypoints, useful when there is only one train image + //! because it reduces the number of possible false matches (by default it is the inverse because normally there are multiple + //! train images of different views of the object) + bool m_useMatchTrainToQuery; //! Flag set if a Ransac VVS pose estimation must be used. bool m_useRansacVVS; + //! If true, keep only pairs of keypoints where each train keypoint is matched to a single query keypoint + bool m_useSingleMatchFilter; void affineSkew(double tilt, double phi, cv::Mat& img, cv::Mat& mask, cv::Mat& Ai); @@ -849,12 +977,85 @@ private: void initExtractor(const std::string &extractorName); void initExtractors(const std::vector<std::string> &extractorNames); -//TODO: Try to implement a pyramidal feature detection -//#if (VISP_HAVE_OPENCV_VERSION >= 0x030000) -// void pyramidFeatureDetection(cv::Ptr<cv::FeatureDetector> &detector, const cv::Mat& image, std::vector<cv::KeyPoint>& keypoints, const cv::Mat& mask, -// const int maxLevel=2); -// void runByPixelsMask(std::vector<cv::KeyPoint>& keypoints, const cv::Mat& mask); -//#endif + inline size_t myKeypointHash(const cv::KeyPoint &kp) { + size_t _Val = 2166136261U, scale = 16777619U; + Cv32suf u; + u.f = kp.pt.x; _Val = (scale * _Val) ^ u.u; + u.f = kp.pt.y; _Val = (scale * _Val) ^ u.u; + u.f = kp.size; _Val = (scale * _Val) ^ u.u; + //As the keypoint angle can be computed for certain type of keypoint only when extracting + //the corresponding descriptor, the angle field is not taking into account for the hash +// u.f = kp.angle; _Val = (scale * _Val) ^ u.u; + u.f = kp.response; _Val = (scale * _Val) ^ u.u; + _Val = (scale * _Val) ^ ((size_t) kp.octave); + _Val = (scale * _Val) ^ ((size_t) kp.class_id); + return _Val; + } + + +#if (VISP_HAVE_OPENCV_VERSION >= 0x030000) + /* + * Adapts a detector to detect points over multiple levels of a Gaussian + * pyramid. Useful for detectors that are not inherently scaled. + * From OpenCV 2.4.11 source code. + */ + class PyramidAdaptedFeatureDetector: public cv::FeatureDetector { + public: + // maxLevel - The 0-based index of the last pyramid layer + PyramidAdaptedFeatureDetector(const cv::Ptr<cv::FeatureDetector>& detector, int maxLevel = 2); + + // TODO implement read/write + virtual bool empty() const; + + protected: + virtual void detect(cv::InputArray image, + CV_OUT std::vector<cv::KeyPoint>& keypoints, cv::InputArray mask = + cv::noArray()); + virtual void detectImpl(const cv::Mat& image, + std::vector<cv::KeyPoint>& keypoints, const cv::Mat& mask = + cv::Mat()) const; + + cv::Ptr<cv::FeatureDetector> detector; + int maxLevel; + }; + + /* + * A class filters a vector of keypoints. + * Because now it is difficult to provide a convenient interface for all usage scenarios of the keypoints filter class, + * it has only several needed by now static methods. + */ + class KeyPointsFilter { + public: + KeyPointsFilter() { + } + + /* + * Remove keypoints within borderPixels of an image edge. + */ + static void runByImageBorder(std::vector<cv::KeyPoint>& keypoints, + cv::Size imageSize, int borderSize); + /* + * Remove keypoints of sizes out of range. + */ + static void runByKeypointSize(std::vector<cv::KeyPoint>& keypoints, + float minSize, float maxSize = FLT_MAX); + /* + * Remove keypoints from some image by mask for pixels of this image. + */ + static void runByPixelsMask(std::vector<cv::KeyPoint>& keypoints, + const cv::Mat& mask); + /* + * Remove duplicated keypoints. + */ + static void removeDuplicated(std::vector<cv::KeyPoint>& keypoints); + + /* + * Retain the specified number of the best keypoints (according to the response) + */ + static void retainBest(std::vector<cv::KeyPoint>& keypoints, int npoints); + }; + +#endif }; #endif diff --git a/src/key-point/vpKeyPointSurf.h b/modules/vision/include/visp3/vision/vpKeyPointSurf.h similarity index 90% rename from src/key-point/vpKeyPointSurf.h rename to modules/vision/include/visp3/vision/vpKeyPointSurf.h index 4b7035eb0fa6e7404ed162562696f5c3dff739b3..0de6dbb919d8c7757f00b7056f69bdb9803e5407 100644 --- a/src/key-point/vpKeyPointSurf.h +++ b/modules/vision/include/visp3/vision/vpKeyPointSurf.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpKeyPointSurf.h 5205 2015-01-26 08:56:41Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Key point Surf. * @@ -50,10 +46,7 @@ to the OpenCV library. */ -#include <visp/vpBasicKeyPoint.h> -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -# include <visp/vpList.h> -#endif +#include <visp3/vision/vpBasicKeyPoint.h> #include <list> #include <vector> @@ -61,6 +54,7 @@ #if defined (VISP_HAVE_OPENCV_NONFREE) && (VISP_HAVE_OPENCV_VERSION < 0x030000) #if (VISP_HAVE_OPENCV_VERSION >= 0x020400) // Require opencv >= 1.1.0 < 3.0.0 +# include <opencv2/core/core.hpp> # include <opencv2/features2d/features2d.hpp> # include <opencv2/legacy/compat.hpp> # include <opencv2/nonfree/nonfree.hpp> @@ -73,6 +67,7 @@ /*! \class vpKeyPointSurf + \ingroup group_vision_keypoints \brief Class that implements the SURF key points and technics thanks to OpenCV library. @@ -103,9 +98,9 @@ how to use the class. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpKeyPointSurf.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/vision/vpKeyPointSurf.h> int main() { @@ -137,10 +132,10 @@ int main() part of the current image. The small following example shows how to this \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpKeyPointSurf.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/vision/vpKeyPointSurf.h> int main() { @@ -262,21 +257,14 @@ class VISP_EXPORT vpKeyPointSurf : public vpBasicKeyPoint \return the hessian threshold value. */ - double getHessianThreshold () {return hessianThreshold;} ; + double getHessianThreshold () {return hessianThreshold;} /*! Gets the type of descriptor used. \return the type of descriptor used. */ - vpDescriptorType getDescriptorType () {return descriptorType;} ; - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! - @name Deprecated functions - */ - vp_deprecated vpList<int*>* matchPoint(vpList<float*> descriptorList, vpList<int> laplacianList); -#endif + vpDescriptorType getDescriptorType () {return descriptorType;} private: void init(); diff --git a/src/computer-vision/pose-estimation/vpLevenbergMarquartd.h b/modules/vision/include/visp3/vision/vpLevenbergMarquartd.h similarity index 86% rename from src/computer-vision/pose-estimation/vpLevenbergMarquartd.h rename to modules/vision/include/visp3/vision/vpLevenbergMarquartd.h index a746f59a44f380174571c9fa239a35248a301ed1..ff71da81923346f0658f5ff5da1d4491f5a7b7c8 100644 --- a/src/computer-vision/pose-estimation/vpLevenbergMarquartd.h +++ b/modules/vision/include/visp3/vision/vpLevenbergMarquartd.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpLevenbergMarquartd.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Levenberg Marquartd. * @@ -44,8 +40,8 @@ #ifndef vpLevenbergMarquartd_h #define vpLevenbergMarquartd_h -#include <visp/vpConfig.h> -#include <visp/vpMath.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpMath.h> #include <stdio.h> #include <errno.h> diff --git a/src/key-point/vpPlanarObjectDetector.h b/modules/vision/include/visp3/vision/vpPlanarObjectDetector.h old mode 100755 new mode 100644 similarity index 91% rename from src/key-point/vpPlanarObjectDetector.h rename to modules/vision/include/visp3/vision/vpPlanarObjectDetector.h index ad772537a77655f5639a466b9ff5e581564f2022..f1d056f1b9f066caa8705e9454021547f2fa11c2 --- a/src/key-point/vpPlanarObjectDetector.h +++ b/modules/vision/include/visp3/vision/vpPlanarObjectDetector.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPlanarObjectDetector.h 5203 2015-01-24 09:33:54Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Planar surface detection tool. * @@ -42,7 +38,7 @@ #ifndef VPPLANAROBJECTDETECTOR_H_ #define VPPLANAROBJECTDETECTOR_H_ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if (VISP_HAVE_OPENCV_VERSION >= 0x020000) && (VISP_HAVE_OPENCV_VERSION < 0x030000) // Require opencv >= 2.0.0 and < 3.0.0 @@ -55,19 +51,20 @@ # include <cvaux.hpp> #endif -#include <visp/vpImagePoint.h> -#include <visp/vpImage.h> -#include <visp/vpRect.h> -#include <visp/vpImagePoint.h> -#include <visp/vpPoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpHomography.h> -#include <visp/vpFernClassifier.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRect.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/vision/vpFernClassifier.h> /*! \class vpPlanarObjectDetector - \ingroup PlanarSurfaceDetector + \ingroup group_vision_keypoints + \brief Class used to detect a planar surface. \deprecated This class is deprecated with OpenCV 3.0.0 or more recent. @@ -88,10 +85,10 @@ The following example shows how to use the class. \code -#include <visp/vpConfig.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpPlanarObjectDetector.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/vision/vpPlanarObjectDetector.h> #if VISP_HAVE_OPENCV_VERSION >= 0x020000 // Surf Fern classifier only available since 2.1.0 int main() diff --git a/src/computer-vision/pose-estimation/vpPose.h b/modules/vision/include/visp3/vision/vpPose.h similarity index 74% rename from src/computer-vision/pose-estimation/vpPose.h rename to modules/vision/include/visp3/vision/vpPose.h index 191aea118bebdca34efd1b0d5cac85ad9ba82ab4..3565d6f5983c8c20c4b91acf63d0890bbfd5eb31 100644 --- a/src/computer-vision/pose-estimation/vpPose.h +++ b/modules/vision/include/visp3/vision/vpPose.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPose.h 5211 2015-01-26 17:44:35Z strinh $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pose computation. * @@ -52,12 +48,12 @@ #ifndef vpPOSE_HH #define vpPOSE_HH -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpHomography.h> -#include <visp/vpPoint.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpRGBa.h> #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -# include <visp/vpList.h> +# include <visp3/core/vpList.h> #endif #include <math.h> @@ -66,7 +62,7 @@ /*! \class vpPose - \ingroup Pose + \ingroup group_vision_pose \brief Class used for pose computation from N points (pose from point only). \note It is also possible to estimate a pose from other features using vpPoseFeatures class. @@ -111,6 +107,7 @@ private: unsigned int ransacNbInlierConsensus; int ransacMaxTrials; std::vector<vpPoint> ransacInliers; + std::vector<unsigned int> ransacInlierIndex; double ransacThreshold; protected: @@ -177,6 +174,7 @@ public: } void setRansacMaxTrials(const int &rM){ ransacMaxTrials = rM; } unsigned int getRansacNbInliers() const { return (unsigned int) ransacInliers.size(); } + std::vector<unsigned int> getRansacInlierIndex() const{ return ransacInlierIndex; } std::vector<vpPoint> getRansacInliers() const{ return ransacInliers; } /*! @@ -219,54 +217,6 @@ public: std::vector<vpPoint> &listInliers, vpHomogeneousMatrix &cMo, const int &maxNbTrials = 10000); - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -private: - /*! - @name Deprecated functions - */ - static void initRansac(const unsigned int n, - const double *x, const double *y, - const unsigned int m, - const double *X, const double *Y, const double *Z, - vpColVector &data) ; - -public: - static void computeTransformation(vpColVector &x, unsigned int *ind, vpColVector &M) ; - - static double computeResidual(const vpColVector &x, const vpColVector &M, vpColVector &d) ; - - static bool degenerateConfiguration(vpColVector &x, unsigned int *ind) ; - - static void ransac(const unsigned int n, - const double *x, const double *y, - const unsigned int m, - const double *X, const double *Y, const double *Z, - const int numberOfInlierToReachAConsensus, - const double threshold, - unsigned int &ninliers, - vpColVector &xi, vpColVector &yi, - vpColVector &Xi, vpColVector &Yi, vpColVector &Zi, - vpHomogeneousMatrix &cMo, const int maxNbTrials = 10000) ; - - vp_deprecated static void ransac(const unsigned int n, - const vpPoint *p, - const unsigned int m, - const vpPoint *P, - const int numberOfInlierToReachAConsensus, - const double threshold, - unsigned int &ninliers, - std::list<vpPoint> &Pi, - vpHomogeneousMatrix &cMo, const int maxNbTrials = 10000) ; - - vp_deprecated static void ransac(std::list<vpPoint> &p, - std::list<vpPoint> &P, - const int numberOfInlierToReachAConsensus, - const double threshold, - unsigned int &ninliers, - std::list<vpPoint> &lPi, - vpHomogeneousMatrix &cMo, const int maxNbTrials = 10000) ; -#endif } ; diff --git a/src/computer-vision/pose-estimation/vpPoseException.h b/modules/vision/include/visp3/vision/vpPoseException.h similarity index 86% rename from src/computer-vision/pose-estimation/vpPoseException.h rename to modules/vision/include/visp3/vision/vpPoseException.h index 23c4c54f38a0141e8a2ed2ca2b0414a463607396..436a5152df643f7775267362d50a78d3922c55c6 100644 --- a/src/computer-vision/pose-estimation/vpPoseException.h +++ b/modules/vision/include/visp3/vision/vpPoseException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPoseException.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Error that can be emited by the vpPose class and its derivates * @@ -51,7 +47,7 @@ /* Classes standards. */ -#include <visp/vpException.h> +#include <visp3/core/vpException.h> #include <iostream> /* Classe std::ostream. */ #include <string> /* Classe string. */ @@ -62,7 +58,7 @@ /*! \class vpPoseException - \ingroup Exception + \ingroup group_vision_pose \brief Error that can be emited by the vpPose class and its derivates. */ class VISP_EXPORT vpPoseException : public vpException diff --git a/src/computer-vision/pose-estimation/vpPoseFeatures.h b/modules/vision/include/visp3/vision/vpPoseFeatures.h similarity index 95% rename from src/computer-vision/pose-estimation/vpPoseFeatures.h rename to modules/vision/include/visp3/vision/vpPoseFeatures.h index 787ed4ba1a8e2ebc27bb28e3b7ab65e56036ff1b..78da39127f65f44cad040e4d1abff67958ca3a5c 100644 --- a/src/computer-vision/pose-estimation/vpPoseFeatures.h +++ b/modules/vision/include/visp3/vision/vpPoseFeatures.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPoseFeatures.h 4660 2014-02-09 14:13:27Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pose computation from any features. * @@ -50,20 +46,24 @@ #ifndef vpPoseFeatures_HH #define vpPoseFeatures_HH -#include <visp/vpDebug.h> -#include <visp/vpException.h> -#include <visp/vpExponentialMap.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpBasicFeature.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpFeatureEllipse.h> -#include <visp/vpRobust.h> -#include <visp/vpForwardProjection.h> -#include <visp/vpPoint.h> -#include <visp/vpCircle.h> -#include <visp/vpSphere.h> -#include <visp/vpLine.h> -#include <visp/vpCylinder.h> +#include <visp3/core/vpConfig.h> + +#ifdef VISP_HAVE_MODULE_VISUAL_FEATURES + +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpExponentialMap.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/visual_features/vpFeatureEllipse.h> +#include <visp3/core/vpRobust.h> +#include <visp3/core/vpForwardProjection.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpCircle.h> +#include <visp3/core/vpSphere.h> +#include <visp3/core/vpLine.h> +#include <visp3/core/vpCylinder.h> #include <vector> #include <iostream> @@ -298,7 +298,7 @@ void buildCurrentFeatureObjectWithTuple( objType *obj, featureType &feature, //################################################# /*! \class vpPoseSpecificFeature - \ingroup Pose + \ingroup group_vision_pose \brief Class used to define specific features that could be considered in pose estimation from visual features implemented in vpPoseFeatures. */ class VISP_EXPORT vpPoseSpecificFeature @@ -319,7 +319,7 @@ public: /*! \class vpPoseSpecificFeatureTemplate - \ingroup Pose + \ingroup group_vision_pose \brief Template class that allows to estimate a pose from all kind of specific features if the compiler support C++ 11. */ template< typename featureType, typename RetType, typename ...Args > @@ -368,7 +368,7 @@ public: /*! \class vpPoseSpecificFeatureTemplateObject - \ingroup Pose + \ingroup group_vision_pose \brief Template class that allows to estimate a pose from all kind of specific features if the compiler support C++ 11. */ template< typename ObjectType, typename featureType, typename RetType, typename ...Args > @@ -416,7 +416,7 @@ public: /*! \class vpPoseFeatures \brief Tools for pose computation from any feature. - \ingroup Pose + \ingroup group_vision_pose This class allows to estimate a pose by virtual visual servoing from visual features. The features that are considered are points, segments, lines, ellipses. If the compiler is compatible with C++ 11, it is possible to introduce specific features that are not directly implemented in ViSP. @@ -593,8 +593,8 @@ private: \warning This function is only available with C++11. It has to be activated with USE_CPP11 option from CMake. \code -#include <visp/vpConfig.h> -#include <visp/vpPoseFeatures.h> +#include <visp3/core/vpConfig.h> +#include <visp3/vision/vpPoseFeatures.h> void vp_createPoint(vpFeaturePoint &fp,const vpPoint &p){ vpFeatureBuilder::create(fp,p); @@ -663,8 +663,8 @@ void vpPoseFeatures::addSpecificFeature(RetType (*fct_ptr)(ArgsFunc ...), Args & \warning This function is only available with C++11. It has to be activated with USE_CPP11 option from CMake. \code -#include <visp/vpConfig.h> -#include <visp/vpPoseFeatures.h> +#include <visp3/core/vpConfig.h> +#include <visp3/vision/vpPoseFeatures.h> class vp_createClass{ public: @@ -731,5 +731,6 @@ void vpPoseFeatures::addSpecificFeature(ObjType *obj, RetType (ObjType::*fct_ptr } #endif +#endif //#ifdef VISP_HAVE_MODULE_VISUAL_FEATURES #endif diff --git a/src/key-point/vpXmlConfigParserKeyPoint.h b/modules/vision/include/visp3/vision/vpXmlConfigParserKeyPoint.h similarity index 95% rename from src/key-point/vpXmlConfigParserKeyPoint.h rename to modules/vision/include/visp3/vision/vpXmlConfigParserKeyPoint.h index 3d6e8b588b71460d407f659507ea4bf17a551748..9447c0ddde51094661c43cc0e9fe4f3432663485 100644 --- a/src/key-point/vpXmlConfigParserKeyPoint.h +++ b/modules/vision/include/visp3/vision/vpXmlConfigParserKeyPoint.h @@ -1,7 +1,7 @@ /**************************************************************************** * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -10,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -46,7 +45,7 @@ #ifndef __vpXmlConfigParserKeyPoint_h__ #define __vpXmlConfigParserKeyPoint_h__ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_HAVE_XML2 @@ -55,9 +54,12 @@ #include <libxml/xmlmemory.h> // Functions of libxml. -#include <visp/vpXmlParser.h> - +#include <visp3/core/vpXmlParser.h> +/*! + \class vpXmlConfigParserKeyPoint + \ingroup group_vision_keypoints +*/ class VISP_EXPORT vpXmlConfigParserKeyPoint: public vpXmlParser { diff --git a/src/camera/calibration/vpCalibration.cpp b/modules/vision/src/calibration/vpCalibration.cpp similarity index 75% rename from src/camera/calibration/vpCalibration.cpp rename to modules/vision/src/calibration/vpCalibration.cpp index 48403fc06cba6e93b37f3dc1bf48c0fc4c5d5e16..4a91380b20695aa832df3fd11adc0bf28222795c 100644 --- a/src/camera/calibration/vpCalibration.cpp +++ b/modules/vision/src/calibration/vpCalibration.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpCalibration.cpp 5233 2015-01-30 13:50:39Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Camera calibration. * @@ -47,10 +43,10 @@ \brief Tools for camera calibration. */ -#include <visp/vpCalibration.h> -#include <visp/vpDebug.h> -#include <visp/vpPose.h> -#include <visp/vpPixelMeterConversion.h> +#include <visp3/vision/vpCalibration.h> +#include <visp3/core/vpDebug.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpPixelMeterConversion.h> double vpCalibration::threshold = 1e-10f; unsigned int vpCalibration::nbIterMax = 4000; @@ -182,8 +178,7 @@ void vpCalibration::computePose(const vpCameraParameters &camera, vpHomogeneousM for (unsigned int i =0 ; i < npt ; i++) { - vpPoint P; - P.setWorldCoordinates(*it_LoX, *it_LoY, *it_LoZ); + vpPoint P(*it_LoX, *it_LoY, *it_LoZ); double x=0,y=0 ; vpPixelMeterConversion::convertPoint(camera, *it_Lip, x,y) ; P.set_x(x) ; @@ -834,223 +829,3 @@ int vpCalibration::displayGrid(vpImage<unsigned char> &I, vpColor color, } return 0; } - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated. You should use - vpCalibration::computeCalibrationMulti(vpCalibrationMethodType, std::vector<vpCalibration> &, - vpCameraParameters &, bool) - - Compute the multi-images calibration according to the desired method using many poses. - - \param method : Method used to estimate the camera parameters. - \param nbPose : number of images used to compute multi-images calibration - \param table_cal : array of vpCalibration. - \param cam_est : estimated intrinsic camera parameters. - \param verbose : set at true if information about the residual at each loop - of the algorithm is hoped. - - \return 0 if the computation was managed succeed. -*/ -int vpCalibration::computeCalibrationMulti(vpCalibrationMethodType method, - unsigned int nbPose, - vpCalibration table_cal[], - vpCameraParameters& cam_est, - bool verbose) -{ - try{ - for(unsigned int i=0;i<nbPose;i++){ - if(table_cal[i].get_npt()>3) - table_cal[i].computePose(cam_est,table_cal[i].cMo); - } - switch (method) { - case CALIB_LAGRANGE : { - if(nbPose > 1){ - std::cout << "this calibration method is not available in" << std::endl - << "vpCalibration::computeCalibrationMulti()" << std::endl; - return -1 ; - } - else { - table_cal[0].calibLagrange(cam_est,table_cal[0].cMo); - table_cal[0].cam = cam_est ; - table_cal[0].cam_dist = cam_est ; - table_cal[0].cMo_dist = table_cal[0].cMo ; - } - break; - } - case CALIB_LAGRANGE_VIRTUAL_VS : - case CALIB_LAGRANGE_VIRTUAL_VS_DIST : { - if(nbPose > 1){ - std::cout << "this calibration method is not available in" << std::endl - << "vpCalibration::computeCalibrationMulti()" << std::endl - << "with several images." << std::endl; - return -1 ; - } - else { - table_cal[0].calibLagrange(cam_est,table_cal[0].cMo); - table_cal[0].cam = cam_est ; - table_cal[0].cam_dist = cam_est ; - table_cal[0].cMo_dist = table_cal[0].cMo ; - } - calibVVSMulti(nbPose, table_cal, cam_est, verbose); - break ; - } - case CALIB_VIRTUAL_VS: - case CALIB_VIRTUAL_VS_DIST: { - calibVVSMulti(nbPose, table_cal, cam_est, verbose); - break ; - } - } - //Print camera parameters - if(verbose){ - // std::cout << "Camera parameters without distortion :" << std::endl; - cam_est.printParameters(); - } - - switch (method) - { - case CALIB_LAGRANGE : - case CALIB_LAGRANGE_VIRTUAL_VS : - case CALIB_VIRTUAL_VS: - verbose = false ; - break; - case CALIB_LAGRANGE_VIRTUAL_VS_DIST : - case CALIB_VIRTUAL_VS_DIST: - { - if(verbose) - std::cout << "Compute camera parameters with distortion"<<std::endl; - - calibVVSWithDistortionMulti(nbPose, table_cal, cam_est, verbose); - } - break ; - } - //Print camera parameters - if(verbose){ - // std::cout << "Camera parameters without distortion :" << std::endl; - table_cal[0].cam.printParameters(); - // std::cout << "Camera parameters with distortion:" << std::endl; - cam_est.printParameters(); - std::cout<<std::endl; - } - return 0 ; - } - catch(...){ throw; } -} - -/*! - \deprecated This method is deprecated. You should use - vpCalibration::computeCalibrationTsai(std::vector<vpCalibration> &, vpHomogeneousMatrix &, - vpHomogeneousMatrix &) - - \brief Compute the multi-image calibration of effector-camera from R. Tsai and R. Lenz \cite Tsai89a. - - Compute extrinsic camera parameters : the constant transformation from - the effector to the camera coordinates (eMc). - - \param nbPose : number of images used to compute multi-images calibration - \param table_cal : array of vpCalibration. All the vpHomogeneousMatrix cMo - and rMe of each vpCalibration have to be initialized. - \param eMc : output: estimated pose of the camera in relation to the effector - (camera support) with the camera model without distortion. - \param eMc_dist : output: estimated pose of the camera in relation to the - effector (camera support) with the model with distortion. - \return 0 if the computation managed, -1 if less than three poses are provides as input. -*/ -int vpCalibration::computeCalibrationTsai(unsigned int nbPose, - vpCalibration table_cal[], - vpHomogeneousMatrix& eMc, - vpHomogeneousMatrix& eMc_dist) -{ - try{ - if (nbPose > 2){ - vpHomogeneousMatrix* table_cMo = new vpHomogeneousMatrix[nbPose]; - vpHomogeneousMatrix* table_cMo_dist = new vpHomogeneousMatrix[nbPose]; - vpHomogeneousMatrix* table_rMe = new vpHomogeneousMatrix[nbPose]; - - for(unsigned int i=0;i<nbPose;i++){ - table_cMo[i] = table_cal[i].cMo; - table_cMo_dist[i] = table_cal[i].cMo_dist; - table_rMe[i] = table_cal[i].rMe; - } - calibrationTsai(nbPose,table_cMo,table_rMe,eMc); - calibrationTsai(nbPose,table_cMo_dist,table_rMe,eMc_dist); - - delete [] table_cMo; - delete [] table_cMo_dist; - delete [] table_rMe; - - return 0; - } - else{ - vpERROR_TRACE("Three images are needed to compute Tsai calibration !\n"); - return -1; - } - } - catch(...){ - throw; - } -} - -/*! - \deprecated This method is deprecated. You should use - vpCalibration::readGrid(const char*,unsigned int &, vpList<double> &, vpList<double> &, vpList<double> &, bool) instead. - - Read calibration grid coordinates from disk : - data are organized as follow oX oY oZ - - \param filename : name of the file - \param n : number of points in the calibration grid - \param oX : List of oX coordinates - \param oY : List of oY coordinates - \param oZ : List of oZ coordinates - - \param verbose : Additionnal printings if true (number of points on - the calibration grid and their respective coordinates in the object - frame). - - \return 0 : if success -*/ -int vpCalibration::readGrid(const char* filename,unsigned int &n, - vpList<double> &oX,vpList<double> &oY,vpList<double> &oZ, bool verbose) -{ - try{ - std::ifstream f; - f.open(filename); - if (! f.fail()){ - - f >> n ; - if(verbose) - std::cout << "There are "<< n <<" points on the calibration grid " << std::endl ; - int no_pt; - double x,y,z; - - oX.front(); - oY.front(); - oZ.front(); - - if (n > 100000) - throw(vpException(vpException::badValue, "Bad number of point in the calibration grid")); - - for (unsigned int i=0 ; i < n ; i++) - { - f >> no_pt >> x >> y >> z ; - if(verbose){ - std::cout << no_pt <<std::endl ; - std::cout << x <<" "<< y <<" "<< z <<std::endl ; - } - oX.addRight(x) ; - oY.addRight(y) ; - oZ.addRight(z) ; - } - - f.close() ; - } - else{ - return -1; - } - } - catch(...){return -1;} - return 0 ; -} - -#endif // VISP_BUILD_DEPRECATED_FUNCTIONS diff --git a/src/camera/calibration/vpCalibrationTools.cpp b/modules/vision/src/calibration/vpCalibrationTools.cpp similarity index 89% rename from src/camera/calibration/vpCalibrationTools.cpp rename to modules/vision/src/calibration/vpCalibrationTools.cpp index 37230606e1e6fe817a4d450286a49face4589343..2a60a3a167154831d42f0101c8f207d1415b9339 100644 --- a/src/camera/calibration/vpCalibrationTools.cpp +++ b/modules/vision/src/calibration/vpCalibrationTools.cpp @@ -1,7 +1,45 @@ -#include <visp/vpCalibration.h> -#include <visp/vpMath.h> -#include <visp/vpPose.h> -#include <visp/vpPixelMeterConversion.h> +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Camera calibration. + * + * Authors: + * Eric Marchand + * Francois Chaumette + * + *****************************************************************************/ + +#include <visp3/vision/vpCalibration.h> +#include <visp3/core/vpMath.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpPixelMeterConversion.h> #include <cmath> // std::fabs #include <limits> // numeric_limits @@ -1082,215 +1120,6 @@ vpCalibration::calibVVSWithDistortionMulti(std::vector<vpCalibration> &table_cal std::cout.flags(original_flags); } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated Calibration method of effector-camera from R. Tsai and R. Lorenz \cite Tsai89a. - - Compute extrinsic camera parameters : the constant transformation from - the effector to the camera coordinates (eMc). - - \param nbPose : number of different positions (input) - \param cMo : table of homogeneous matrices representing the transformation - between the camera and the scene (input) - \param rMe : table of homogeneous matrices representing the transformation - between the effector (where the camera is fixed) and the reference coordinates - (base of the manipulator) (input) - \param eMc : homogeneous matrix representing the transformation - between the effector and the camera (output) -*/ -void -vpCalibration::calibrationTsai(unsigned int nbPose, - vpHomogeneousMatrix cMo[], - vpHomogeneousMatrix rMe[], - vpHomogeneousMatrix &eMc) -{ - - vpColVector x ; - { - vpMatrix A ; - vpColVector B ; - unsigned int k = 0 ; - // for all couples ij - for (unsigned int i=0 ; i < nbPose ; i++) - { - vpRotationMatrix rRei, ciRo ; - rMe[i].extract(rRei) ; - cMo[i].extract(ciRo) ; - //std::cout << "rMei: " << std::endl << rMe[i] << std::endl; - - for (unsigned int j=0 ; j < nbPose ; j++) - { - if (j>i) // we don't use two times same couples... - { - vpRotationMatrix rRej, cjRo ; - rMe[j].extract(rRej) ; - cMo[j].extract(cjRo) ; - //std::cout << "rMej: " << std::endl << rMe[j] << std::endl; - - vpRotationMatrix rReij = rRej.t() * rRei; - - vpRotationMatrix cijRo = cjRo * ciRo.t(); - - vpThetaUVector rPeij(rReij); - - double theta = sqrt(rPeij[0]*rPeij[0] + rPeij[1]*rPeij[1] - + rPeij[2]*rPeij[2]); - - for (unsigned int m=0;m<3;m++) rPeij[m] = rPeij[m] * vpMath::sinc(theta/2); - - vpThetaUVector cijPo(cijRo) ; - theta = sqrt(cijPo[0]*cijPo[0] + cijPo[1]*cijPo[1] - + cijPo[2]*cijPo[2]); - for (unsigned int m=0;m<3;m++) cijPo[m] = cijPo[m] * vpMath::sinc(theta/2); - - vpMatrix As; - vpColVector b(3) ; - - As = vpColVector::skew(vpColVector(rPeij) + vpColVector(cijPo)) ; - - b = (vpColVector)cijPo - (vpColVector)rPeij ; // A.40 - - if (k==0) - { - A = As ; - B = b ; - } - else - { - A = vpMatrix::stackMatrices(A,As) ; - B = vpMatrix::stackMatrices(B,b) ; - } - k++ ; - } - } - } - - // the linear system is defined - // x = AtA^-1AtB is solved - vpMatrix AtA = A.AtA() ; - - vpMatrix Ap ; - AtA.pseudoInverse(Ap, 1e-6) ; // rank 3 - x = Ap*A.t()*B ; - -// { -// // Residual -// vpColVector residual; -// residual = A*x-B; -// std::cout << "Residual: " << std::endl << residual << std::endl; - -// double res = 0; -// for (int i=0; i < residual.getRows(); i++) -// res += residual[i]*residual[i]; -// res = sqrt(res/residual.getRows()); -// printf("Mean residual = %lf\n",res); -// } - - // extraction of theta and U - double theta ; - double d=x.sumSquare() ; - for (unsigned int i=0 ; i < 3 ; i++) x[i] = 2*x[i]/sqrt(1+d) ; - theta = sqrt(x.sumSquare())/2 ; - theta = 2*asin(theta) ; - //if (theta !=0) - if (std::fabs(theta) > std::numeric_limits<double>::epsilon()) - { - for (unsigned int i=0 ; i < 3 ; i++) x[i] *= theta/(2*sin(theta/2)) ; - } - else - x = 0 ; - } - - // Building of the rotation matrix eRc - vpThetaUVector xP(x[0],x[1],x[2]); - vpRotationMatrix eRc(xP); - - { - vpMatrix A ; - vpColVector B ; - // Building of the system for the translation estimation - // for all couples ij - vpRotationMatrix I3 ; - I3.setIdentity() ; - int k = 0 ; - for (unsigned int i=0 ; i < nbPose ; i++) - { - vpRotationMatrix rRei, ciRo ; - vpTranslationVector rTei, ciTo ; - rMe[i].extract(rRei) ; - cMo[i].extract(ciRo) ; - rMe[i].extract(rTei) ; - cMo[i].extract(ciTo) ; - - - for (unsigned int j=0 ; j < nbPose ; j++) - { - if (j>i) // we don't use two times same couples... - { - - vpRotationMatrix rRej, cjRo ; - rMe[j].extract(rRej) ; - cMo[j].extract(cjRo) ; - - vpTranslationVector rTej, cjTo ; - rMe[j].extract(rTej) ; - cMo[j].extract(cjTo) ; - - vpRotationMatrix rReij = rRej.t() * rRei ; - - vpTranslationVector rTeij = rTej+ (-rTei); - - rTeij = rRej.t()*rTeij ; - - vpMatrix a ; - a = (vpMatrix)rReij - (vpMatrix)I3 ; - - vpTranslationVector b ; - b = eRc*cjTo - rReij*eRc*ciTo + rTeij ; - - if (k==0) - { - A = a ; - B = b ; - } - else - { - A = vpMatrix::stackMatrices(A,a) ; - B = vpMatrix::stackMatrices(B,b) ; - } - k++ ; - } - } - } - - // the linear system is solved - // x = AtA^-1AtB is solved - vpMatrix AtA = A.AtA() ; - vpMatrix Ap ; - vpColVector AeTc ; - AtA.pseudoInverse(Ap, 1e-6) ; - AeTc = Ap*A.t()*B ; - -// { -// // residual -// vpColVector residual; -// residual = A*AeTc-B; -// std::cout << "Residual: " << std::endl << residual << std::endl; -// double res = 0; -// for (int i=0; i < residual.getRows(); i++) -// res += residual[i]*residual[i]; -// res = sqrt(res/residual.getRows()); -// printf("mean residual = %lf\n",res); -// } - - vpTranslationVector eTc(AeTc[0],AeTc[1],AeTc[2]); - - eMc.insert(eTc) ; - eMc.insert(eRc) ; - } -} -#endif - /*! \brief calibration method of effector-camera from R. Tsai and R. Lorenz \cite Tsai89a. @@ -1363,8 +1192,8 @@ void vpCalibration::calibrationTsai(std::vector<vpHomogeneousMatrix>& cMo, } else { - A = vpMatrix::stackMatrices(A,As) ; - B = vpMatrix::stackMatrices(B,b) ; + A = vpMatrix::stack(A,As) ; + B = vpColVector::stack(B,b) ; } k++ ; } @@ -1417,7 +1246,7 @@ void vpCalibration::calibrationTsai(std::vector<vpHomogeneousMatrix>& cMo, // Building of the system for the translation estimation // for all couples ij vpRotationMatrix I3 ; - I3.setIdentity() ; + I3.eye() ; int k = 0 ; for (unsigned int i=0 ; i < nbPose ; i++) { @@ -1448,11 +1277,10 @@ void vpCalibration::calibrationTsai(std::vector<vpHomogeneousMatrix>& cMo, rTeij = rRej.t()*rTeij ; - vpMatrix a ; - a = (vpMatrix)rReij - (vpMatrix)I3 ; + vpMatrix a = vpMatrix(rReij) - vpMatrix(I3); vpTranslationVector b ; - b = eRc*cjTo - rReij*eRc*ciTo + rTeij ; + b = eRc*cjTo - rReij*eRc*ciTo + rTeij ; if (k==0) { @@ -1461,8 +1289,8 @@ void vpCalibration::calibrationTsai(std::vector<vpHomogeneousMatrix>& cMo, } else { - A = vpMatrix::stackMatrices(A,a) ; - B = vpMatrix::stackMatrices(B,b) ; + A = vpMatrix::stack(A,a) ; + B = vpColVector::stack(B,b) ; } k++ ; } diff --git a/src/computer-vision/homography-estimation/vpHomography.cpp b/modules/vision/src/homography-estimation/vpHomography.cpp similarity index 83% rename from src/computer-vision/homography-estimation/vpHomography.cpp rename to modules/vision/src/homography-estimation/vpHomography.cpp index cb4ee3033b8b06211789560a52d2d9b94a61bdd5..041251e6f13b5eab4a3c28309fb9468a8dfd278f 100644 --- a/src/computer-vision/homography-estimation/vpHomography.cpp +++ b/modules/vision/src/homography-estimation/vpHomography.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHomography.cpp 4661 2014-02-10 19:34:58Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Homography transformation. * @@ -49,21 +45,21 @@ #include <stdio.h> -#include <visp/vpDebug.h> -#include <visp/vpHomography.h> -#include <visp/vpMatrix.h> -#include <visp/vpRobust.h> +#include <visp3/core/vpDebug.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpRobust.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpMatrixException.h> /*! \brief initialize an homography as Identity */ -vpHomography::vpHomography() : data(NULL), aMb(), bP() +vpHomography::vpHomography() + : vpArray2D<double>(3,3), aMb(), bP() { - data = new double [9]; setIdentity(); } @@ -72,51 +68,43 @@ vpHomography::vpHomography() : data(NULL), aMb(), bP() \brief initialize an homography from another homography */ -vpHomography::vpHomography(const vpHomography &H) : data(NULL), aMb(), bP() +vpHomography::vpHomography(const vpHomography &H) + : vpArray2D<double>(3,3), aMb(), bP() { - data = new double [9]; - *this = H; } /*! \brief initialize an homography from another homography */ -vpHomography::vpHomography(const vpHomogeneousMatrix &M, const vpPlane &p) : data(NULL), aMb(), bP() +vpHomography::vpHomography(const vpHomogeneousMatrix &M, const vpPlane &p) + : vpArray2D<double>(3,3), aMb(), bP() { - data = new double [9]; buildFrom(M, p) ; } vpHomography::vpHomography(const vpThetaUVector &tu, const vpTranslationVector &atb, - const vpPlane &p) : data(NULL), aMb(), bP() + const vpPlane &p) + : vpArray2D<double>(3,3), aMb(), bP() { - data = new double [9]; buildFrom(tu, atb, p) ; } vpHomography::vpHomography(const vpRotationMatrix &aRb, const vpTranslationVector &atb, - const vpPlane &p) : data(NULL), aMb(), bP() + const vpPlane &p) + : vpArray2D<double>(3,3), aMb(), bP() { - data = new double [9]; buildFrom(aRb, atb, p) ; } -vpHomography::vpHomography(const vpPoseVector &arb, const vpPlane &p) : data(NULL), aMb(), bP() +vpHomography::vpHomography(const vpPoseVector &arb, const vpPlane &p) + : vpArray2D<double>(3,3), aMb(), bP() { - data = new double [9]; buildFrom(arb, p) ; } -vpHomography::~vpHomography() -{ - if (data) - delete [] data; - data = NULL; -} - void vpHomography::buildFrom(const vpHomogeneousMatrix &M, const vpPlane &p) @@ -221,7 +209,7 @@ vpHomography::insert(const vpPlane &p) vpHomography vpHomography::inverse() const { - vpMatrix M = (*this); + vpMatrix M = (*this).convert(); vpMatrix Minv; M.pseudoInverse(Minv, 1e-16); @@ -245,7 +233,12 @@ vpHomography::inverse(vpHomography &bHa) const bHa = inverse() ; } +/*! + Save an homography in a file. + The laod() function allows then to read and set the homography from this file. + \sa load() + */ void vpHomography::save(std::ofstream &f) const { @@ -333,6 +326,34 @@ vpHomography vpHomography::operator*(const double &v) const return H; } +/*! + From the coordinates of the point in image plane b and the homography between image + a and b computes the coordinates of the point in image plane a. + + \param b_P : 2D coordinates of the point in the image plane b. + + \return A point with 2D coordinates in the image plane a. +*/ +vpPoint vpHomography::operator*(const vpPoint& b_P) const +{ + vpPoint a_P ; + vpColVector v(3),v1(3) ; + + v[0] = b_P.get_x() ; + v[1] = b_P.get_y() ; + v[2] = b_P.get_w() ; + + v1[0] = (*this)[0][0]*v[0] + (*this)[0][1]*v[1]+ (*this)[0][2]*v[2] ; + v1[1] = (*this)[1][0]*v[0] + (*this)[1][1]*v[1]+ (*this)[1][2]*v[2] ; + v1[2] = (*this)[2][0]*v[0] + (*this)[2][1]*v[1]+ (*this)[2][2]*v[2] ; + + // v1 = M*v ; + a_P.set_x(v1[0]) ; + a_P.set_y(v1[1]) ; + a_P.set_w(v1[2]) ; + + return a_P ; +} /*! Divide an homography by a scalar. @@ -414,7 +435,9 @@ vpHomography::operator=(const vpMatrix &H) Read an homography in a file, verify if it is really an homogeneous matrix. - \param f : the file. + \param f : the file. This file has to be written using save(). + + \sa save() */ void vpHomography::load(std::ifstream &f) @@ -433,16 +456,6 @@ vpHomography::load(std::ifstream &f) } } - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -//! Print the homography as a matrix. -void -vpHomography::print() -{ - std::cout <<*this << std::endl ; -} -#endif // #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! \brief Compute aHb such that @@ -511,10 +524,11 @@ vpHomography::build(vpHomography &aHb, } /*! - Set the homography as identity transformation. + Set the homography as identity transformation by setting the diagonal to 1 + and all other values to 0. */ void -vpHomography::setIdentity() +vpHomography::eye() { for (unsigned int i=0 ; i < 3 ; i++) for (unsigned int j=0 ; j < 3; j++) @@ -524,6 +538,20 @@ vpHomography::setIdentity() (*this)[i][j] = 0.0; } +#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) +/*! + \deprecated You should rather use eye(). + + Set the homography as identity transformation. + \sa eye() +*/ +void +vpHomography::setIdentity() +{ + eye(); +} +#endif // #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) + /*! Given \c iPa a point with coordinates \f$(u_a,v_a)\f$ expressed in pixel in image a, and the homography \c bHa that links image a and b, computes the coordinates of the point \f$(u_b,v_b)\f$ in the image b using the camera parameters @@ -538,7 +566,7 @@ vpImagePoint vpHomography::project(const vpCameraParameters &cam, const vpHomogr { double xa = iPa.get_u(); double ya = iPa.get_v(); - vpMatrix H = cam.get_K() * bHa * cam.get_K_inverse(); + vpMatrix H = cam.get_K() * bHa.convert() * cam.get_K_inverse(); double z = xa * H[2][0] + ya * H[2][1] + H[2][2]; double xb = (xa * H[0][0] + ya * H[0][1] + H[0][2]) / z; double yb = (xa * H[1][0] + ya * H[1][1] + H[1][2]) / z; @@ -547,6 +575,7 @@ vpImagePoint vpHomography::project(const vpCameraParameters &cam, const vpHomogr return iPb; } + /*! Given \c Pa a point with normalized coordinates \f$(x_a,y_a,1)\f$ in the image plane a, and the homography \c bHa that links image a and b, computes the normalized coordinates of the point \f$(x_b,y_b,1)\f$ in the image plane b. @@ -700,7 +729,7 @@ vpHomography::robust(const std::vector<double> &xb, const std::vector<double> &y aHbn.data[i]= X[i]; aHbn[2][2] = 1; { - vpMatrix aHbnorm = aHbn; + vpMatrix aHbnorm = aHbn.convert(); aHbnorm /= aHbnorm[2][2] ; } @@ -746,23 +775,41 @@ vpHomography::robust(const std::vector<double> &xb, const std::vector<double> &y } /*! -\brief std::cout a matrix + Project the current image point (in frame b) into the frame a using the + homography aHb. + + \param ipb : Homography defining the relation between frame a and frame b. + \return The projected image point in the frame a. */ -VISP_EXPORT std::ostream &operator <<(std::ostream &s,const vpHomography &H) +vpImagePoint +vpHomography::projection(const vpImagePoint &ipb) { - std::ios_base::fmtflags original_flags = s.flags(); + vpImagePoint ipa; + double i = ipb.get_i(); + double j = ipb.get_j(); - s.precision(10) ; - for (unsigned int i=0;i<H.getRows();i++) { - for (unsigned int j=0;j<H.getCols();j++){ - s << H[i][j] << " "; - } - // We don't add a \n char on the end of the last matrix line - if (i < H.getRows()-1) - s << std::endl; + double i_a = (*this)[0][0] * i + (*this)[0][1] * j + (*this)[0][2]; + double j_a = (*this)[1][0] * i + (*this)[1][1] * j + (*this)[1][2]; + double k_a = (*this)[2][0] * i + (*this)[2][1] * j + (*this)[2][2]; + + if(std::fabs(k_a) > std::numeric_limits<double>::epsilon()){ + ipa.set_i(i_a / k_a); + ipa.set_j(j_a / k_a); } - s.flags(original_flags); // restore s to standard state + return ipa; +} + +/*! + Converts an homography to a matrix. + \return The 3x3 matrix corresponding to the homography. + */ +vpMatrix vpHomography::convert() const +{ + vpMatrix M(3, 3); + for(unsigned int i=0; i<3; i++) + for(unsigned int j=0; j<3; j++) + M[i][j] = (*this)[i][j]; - return s; + return M; } diff --git a/src/computer-vision/homography-estimation/vpHomographyDLT.cpp b/modules/vision/src/homography-estimation/vpHomographyDLT.cpp similarity index 58% rename from src/computer-vision/homography-estimation/vpHomographyDLT.cpp rename to modules/vision/src/homography-estimation/vpHomographyDLT.cpp index 10f4ff5a15219f1c4bded1e9f77037be1255aaac..9146cc2e8fee6d3bc8aa97394e1a2547a4c173a7 100644 --- a/src/computer-vision/homography-estimation/vpHomographyDLT.cpp +++ b/modules/vision/src/homography-estimation/vpHomographyDLT.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHomographyDLT.cpp 5052 2014-12-11 14:18:49Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Homography estimation. * @@ -47,9 +43,9 @@ estimation using the DLT algorithm */ -#include <visp/vpHomography.h> -#include <visp/vpMatrix.h> -#include <visp/vpMatrixException.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpMatrixException.h> #include <cmath> // std::fabs #include <limits> // numeric_limits @@ -173,9 +169,9 @@ vpHomography::HartleyDenormalization(vpHomography &aHbn, vpMatrix T2(3,3); vpMatrix T2T(3,3); - T1.setIdentity(); - T2.setIdentity(); - T2T.setIdentity(); + T1.eye(); + T2.eye(); + T2T.eye(); T1[0][0]=T1[1][1]=coef1; T1[0][2]=-coef1*xg1 ; @@ -201,247 +197,6 @@ vpHomography::HartleyDenormalization(vpHomography &aHbn, #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - -/*! - - \deprecated You should rather use - vpHomography::DLT(const std::vector<double> &, const std::vector<double> &, const std::vector<double> &, const std::vector<double> &, vpHomography &, bool) - - \brief Computes the homography matrix using the DLT (Direct Linear - Transform) algorithm on normalized data. - - Normalizes data, computes H wrt. these normalized data and denormalizes - the result. The normalization carried out is the one preconized by Hartley . - At least 4 correspondant points couples are needed. - - \sa DLT() - - \exception vpMatrixException::rankDeficient : When the rank of the matrix - that should be 8 is deficient. - -*/ -void -vpHomography::HartleyDLT(unsigned int n, - double *xb, double *yb, - double *xa, double *ya , - vpHomography &aHb) -{ - try{ - //initialise les donnees initiales - // code_retour =InitialData(n, p1,p2); - - // normalize points - double *xbn; - double *ybn; - xbn = new double [n]; - ybn = new double [n]; - - double xg1, yg1, coef1 ; - vpHomography::HartleyNormalization(n, - xb,yb, - xbn,ybn, - xg1, yg1,coef1); - - double *xan; - double *yan; - xan = new double [n]; - yan = new double [n]; - - double xg2, yg2, coef2 ; - vpHomography::HartleyNormalization(n, - xa,ya, - xan,yan, - xg2, yg2,coef2); - - vpHomography aHbn ; - //compute the homography using the DLT from normalized data - vpHomography::DLT(n,xbn,ybn,xan,yan,aHbn); - - //H denormalisee - vpHomography::HartleyDenormalization(aHbn,aHb,xg1,yg1,coef1,xg2,yg2, coef2); - - delete [] xbn; - delete [] ybn; - delete [] xan; - delete [] yan; - - } - catch(...) - { - vpTRACE(" ") ; - throw ; - } -} -#endif //#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - -/*! - \deprecated You should rather use - vpHomography::DLT(const std::vector<double> &, const std::vector<double> &, const std::vector<double> &, const std::vector<double> &, vpHomography &, bool) - - \brief Computes the homography matrix wrt. the - data using the DLT (Direct Linear Transform) algorithm. - - Computes H such as \f[ - ^a{\bf p} = ^a{\bf H}_b\; ^b{\bf p} - \f] - - To do so, we use the DLT algorithm on the data, - ie we resolve the linear system by SDV : \f$\bf{Ah} =0\f$. - \f$\bf{h}\f$ is the vector with the terms of \f$\mathbf{H}\f$, - - \f$\mathbf{A}\f$ depends on the points coordinates. - - At least 4 correspondant points couples are needed. - - For each point, in homogeneous coordinates we have: - \f[ - \mathbf{p}_{a}= \mathbf{H}\mathbf{p}_{b} - \f] - which is equivalent to: - \f[ - \mathbf{p}_{a} \times \mathbf{H}\mathbf{p}_{b} =0 - \f] - If we note \f$\mathbf{h}_j^T\f$ the \f$j^{\textrm{th}}\f$ line of \f$\mathbf{H}\f$, we can write: - \f[ - \mathbf{H}\mathbf{p}_{b} = \left( \begin{array}{c}\mathbf{h}_1^T\mathbf{p}_{b} \\\mathbf{h}_2^T\mathbf{p}_{b} \\\mathbf{h}_3^T \mathbf{p}_{b} \end{array}\right) - \f] - - Setting \f$\mathbf{p}_{a}=(x_{a},y_{a},w_{a})\f$, the cross product can be rewritten by: - \f[ - \mathbf{p}_{a} \times \mathbf{H}\mathbf{p}_{b} =\left( \begin{array}{c}y_{a}\mathbf{h}_3^T\mathbf{p}_{b}-w_{a}\mathbf{h}_2^T\mathbf{p}_{b} \\w_{a}\mathbf{h}_1^T\mathbf{p}_{b} -x_{a}\mathbf{h}_3^T \mathbf{p}_{b} \\x_{a}\mathbf{h}_2^T \mathbf{p}_{b}- y_{a}\mathbf{h}_1^T\mathbf{p}_{b}\end{array}\right) - \f] - - \f[ - \underbrace{\left( \begin{array}{ccc}\mathbf{0}^T & -w_{a} \mathbf{p}_{b}^T - & y_{a} \mathbf{p}_{b}^T \\ w_{a} - \mathbf{p}_{b}^T&\mathbf{0}^T & -x_{a} \mathbf{p}_{b}^T \\ - -y_{a} \mathbf{p}_{b}^T & x_{a} \mathbf{p}_{b}^T & - \mathbf{0}^T\end{array}\right)}_{\mathbf{A}_i (3\times 9)} - \underbrace{\left( \begin{array}{c}\mathbf{h}_{1}^{T} \\ - \mathbf{h}_{2}^{T}\\\mathbf{h}_{3}^{T}\end{array}\right)}_{\mathbf{h} (9\times 1)}=0 - \f] - - leading to an homogeneous system to be solve: \f$\mathbf{A}\mathbf{h}=0\f$ with - \f$\mathbf{A}=\left(\mathbf{A}_1^T, ..., \mathbf{A}_i^T, ..., \mathbf{A}_n^T \right)^T\f$. - - It can be solved using an SVD decomposition: - \f[\bf A = UDV^T \f] - <b>h</b> is the column of <b>V</b> associated with the smalest singular value of <b>A - </b> - - \exception vpMatrixException::rankDeficient : When the rank of the matrix - that should be 8 is deficient. -*/ -void vpHomography::DLT(unsigned int n, - double *xb, double *yb, - double *xa, double *ya , - vpHomography &aHb) -{ - - // 4 point are required - if(n<4) - { - vpTRACE("there must be at least 4 points in the both images\n") ; - throw ; - } - - try{ - vpMatrix A(2*n,9); - vpColVector h(9); - vpColVector D(9); - vpMatrix V(9,9); - - // We need here to compute the SVD on a (n*2)*9 matrix (where n is - // the number of points). if n == 4, the matrix has more columns - // than rows. This kind of matrix is not supported by GSL for - // SVD. The solution is to add an extra line with zeros - if (n == 4) - A.resize(2*n+1,9); - - // build matrix A - for(unsigned int i=0; i<n;i++) - { - A[2*i][0]=0; - A[2*i][1]=0; - A[2*i][2]=0; - A[2*i][3]=-xb[i] ; - A[2*i][4]=-yb[i] ; - A[2*i][5]=-1; - A[2*i][6]=xb[i]*ya[i] ; - A[2*i][7]=yb[i]*ya[i]; - A[2*i][8]=ya[i]; - - - A[2*i+1][0]=xb[i] ; - A[2*i+1][1]=yb[i] ; - A[2*i+1][2]=1; - A[2*i+1][3]=0; - A[2*i+1][4]=0; - A[2*i+1][5]=0; - A[2*i+1][6]=-xb[i]*xa[i]; - A[2*i+1][7]=-yb[i]*xa[i]; - A[2*i+1][8]=-xa[i] ; - } - - // Add an extra line with zero. - if (n == 4) { - for (unsigned int i=0; i < 9; i ++) { - A[2*n][i] = 0; - } - } - - // solve Ah = 0 - // SVD Decomposition A = UDV^T (destructive wrt A) - A.svd(D,V); - - // on en profite pour effectuer un controle sur le rang de la matrice : - // pas plus de 2 valeurs singulieres quasi=0 - int rank=0; - for(unsigned int i = 0; i<9;i++) if(D[i]>1e-7) rank++; - if(rank <7) - { - vpTRACE(" Rank is : %d, should be 8", rank); - throw(vpMatrixException(vpMatrixException::rankDeficient, - "\n\t\t Matrix rank is deficient")) ; - } - //h = is the column of V associated with the smallest singular value of A - - // since we are not sure that the svd implemented sort the - // singular value... we seek for the smallest - double smallestSv = 1e30 ; - unsigned int indexSmallestSv = 0 ; - for (unsigned int i=0 ; i < 9 ; i++) - if ((D[i] < smallestSv) ){ smallestSv = D[i] ;indexSmallestSv = i ; } - - - h=V.getCol(indexSmallestSv); - - // build the homography - for(unsigned int i =0;i<3;i++) - { - for(unsigned int j=0;j<3;j++) - aHb[i][j]=h[3*i+j]; - } - - } - catch(vpMatrixException me) - { - vpTRACE("Matrix Exception ") ; - throw(me) ; - } - catch(vpException me) - { - vpERROR_TRACE("caught another error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; - } - -} -#endif // #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! From couples of matched points \f$^a{\bf p}=(x_a,y_a,1)\f$ in image a and \f$^b{\bf p}=(x_b,y_b,1)\f$ in image b with homogeneous coordinates, computes the diff --git a/src/computer-vision/homography-estimation/vpHomographyExtract.cpp b/modules/vision/src/homography-estimation/vpHomographyExtract.cpp similarity index 67% rename from src/computer-vision/homography-estimation/vpHomographyExtract.cpp rename to modules/vision/src/homography-estimation/vpHomographyExtract.cpp index 8937d63a6906cc2095723955f0efcb9cf0a22a13..96adefb7fcd991438132e2e90cf89cfaaf6ca94d 100644 --- a/src/computer-vision/homography-estimation/vpHomographyExtract.cpp +++ b/modules/vision/src/homography-estimation/vpHomographyExtract.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHomographyExtract.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Homography transformation. * @@ -39,8 +35,8 @@ * *****************************************************************************/ -#include <visp/vpHomography.h> -#include <visp/vpMath.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpMath.h> #include <math.h> //#define DEBUG_Homographie 0 @@ -81,7 +77,7 @@ void vpHomography::computeDisplacement(vpRotationMatrix &aRb, Camera displacement between \f$ {^a}{\bf p} \f$ and \f$ {^a}{\bf p} \f$ is represented as a rotation matrix \f$ {^a}{\bf R}_b \f$ and a translation - vector \f$ ^a{\bf t}_b \f$ from which an homogenous matrix can be build + vector \f$ ^a{\bf t}_b \f$ from which an homogeneous matrix can be build (vpHomogeneousMatrix). \param nd : Input normal vector to the plane used to compar with the normal @@ -111,7 +107,7 @@ void vpHomography::computeDisplacement(const vpColVector& nd, Camera displacement between \f$ {^a}{\bf p} \f$ and \f$ {^b}{\bf p} \f$ is represented as a rotation matrix \f$ {^a}{\bf R}_b \f$ and a translation - vector \f$ ^a{\bf t}_b \f$ from which an homogenous matrix can be build + vector \f$ ^a{\bf t}_b \f$ from which an homogeneous matrix can be build (vpHomogeneousMatrix). \param aHb : Input homography \f$ {^a}{\bf H}_b \f$. @@ -402,7 +398,7 @@ void Camera displacement between \f$ {^a}{\bf p} \f$ and \f$ {^a}{\bf p} \f$ is represented as a rotation matrix \f$ {^a}{\bf R}_b \f$ and a translation - vector \f$ ^a{\bf t}_b \f$ from which an homogenous matrix can be build + vector \f$ ^a{\bf t}_b \f$ from which an homogeneous matrix can be build (vpHomogeneousMatrix). \param aHb : Input homography \f$ {^a}{\bf H}_b \f$. @@ -680,7 +676,7 @@ void } -void vpHomography::computeDisplacement(const vpMatrix &H, +void vpHomography::computeDisplacement(const vpHomography &H, const double x, const double y, std::list<vpRotationMatrix> & vR, @@ -723,7 +719,7 @@ void vpHomography::computeDisplacement(const vpMatrix &H, /* Preparation au calcul de la SVD */ - mTempU = H; + mTempU = H.convert(); /***** Remarque : mTempU, svTemp et mTempV sont modifies par svd @@ -1055,7 +1051,7 @@ void vpHomography::computeDisplacement(const vpMatrix &H, if (norm1ok) { - Rprim1.setIdentity(); + Rprim1.eye(); Tprim1 = Nprim1[0]; Tprim1*= (sv[2] - sv[0]); @@ -1063,7 +1059,7 @@ void vpHomography::computeDisplacement(const vpMatrix &H, if (norm2ok) { - Rprim2.setIdentity(); + Rprim2.eye(); Tprim2 = Nprim2[1]; Tprim2*= (sv[2] - sv[0]); @@ -1073,7 +1069,7 @@ void vpHomography::computeDisplacement(const vpMatrix &H, { if (norm1ok) { - Rprim1.setIdentity(); + Rprim1.eye(); Tprim1 = Nprim1[0]; Tprim1*= (sv[0] - sv[1]); @@ -1081,7 +1077,7 @@ void vpHomography::computeDisplacement(const vpMatrix &H, if (norm2ok) { - Rprim2.setIdentity(); + Rprim2.eye(); Tprim2 = Nprim2[1]; Tprim2*= (sv[0] - sv[1]); @@ -1090,7 +1086,7 @@ void vpHomography::computeDisplacement(const vpMatrix &H, if (cas == cas4) { // on ne connait pas la normale dans ce cas la - Rprim1.setIdentity(); + Rprim1.eye(); Tprim1 = 0.0; } } @@ -1208,7 +1204,7 @@ void vpHomography::computeDisplacement(const vpMatrix &H, if (norm1ok) { - Rprim1.setIdentity(); + Rprim1.eye(); Rprim1[0][0] = -1; Rprim1[1][1] = -1; @@ -1218,7 +1214,7 @@ void vpHomography::computeDisplacement(const vpMatrix &H, if (norm2ok) { - Rprim2.setIdentity(); + Rprim2.eye(); Rprim2[0][0] = -1; Rprim2[1][1] = -1; @@ -1230,7 +1226,7 @@ void vpHomography::computeDisplacement(const vpMatrix &H, { if (norm1ok) { - Rprim1.setIdentity(); + Rprim1.eye(); Rprim1[2][2] = -1; Rprim1[1][1] = -1; @@ -1240,7 +1236,7 @@ void vpHomography::computeDisplacement(const vpMatrix &H, if (norm2ok) { - Rprim2.setIdentity(); + Rprim2.eye(); Rprim2[2][2] = -1; Rprim2[1][1] = -1; @@ -1333,663 +1329,3 @@ void vpHomography::computeDisplacement(const vpMatrix &H, #endif } #endif //#ifndef DOXYGEN_SHOULD_SKIP_THIS - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated. You should use - computeDisplacement(const vpMatrix &, const double, const double, std::list<vpRotationMatrix> &, std::list<vpTranslationVector> &, std::list<vpColVector> &) instead. -*/ -void vpHomography::computeDisplacement(const vpMatrix H, - const double x, - const double y, - vpList<vpRotationMatrix> & vR, - vpList<vpTranslationVector> & vT, - vpList<vpColVector> & vN) -{ - -#ifdef DEBUG_Homographie - printf ("debut : Homographie_EstimationDeplacementCamera\n"); -#endif - - vR.kill(); - vT.kill(); - vN.kill(); - - /**** Declarations des variables ****/ - int cas1 =1, cas2=2, cas3=3, cas4=4; - int cas =0; - bool norm1ok=false, norm2ok = false,norm3ok=false,norm4ok =false; - - double tmp,determinantU,determinantV,s,distanceFictive; - vpMatrix mTempU(3,3),mTempV(3,3),U(3,3),V(3,3); - - vpRotationMatrix Rprim1,R1; - vpRotationMatrix Rprim2,R2; - vpRotationMatrix Rprim3,R3; - vpRotationMatrix Rprim4,R4; - vpTranslationVector Tprim1, T1; - vpTranslationVector Tprim2, T2; - vpTranslationVector Tprim3, T3; - vpTranslationVector Tprim4, T4; - vpColVector Nprim1(3), N1(3); - vpColVector Nprim2(3), N2(3); - vpColVector Nprim3(3), N3(3); - vpColVector Nprim4(3), N4(3); - - vpColVector svTemp(3),sv(3); - unsigned int vOrdre[3]; - vpColVector vTp(3); - - - /* Preparation au calcul de la SVD */ - mTempU = H; - - /***** - Remarque : mTempU, svTemp et mTempV sont modifies par svd - Il est necessaire apres de les trier dans l'ordre decroissant - des valeurs singulieres - *****/ - - // cette fonction ne renvoit pas d'erreur - mTempU.svd(svTemp, mTempV); - - /* On va mettre les valeurs singulieres en ordre decroissant : */ - /* Determination de l'ordre des valeurs */ - if (svTemp[0] >= svTemp[1]) { - if (svTemp[0] >= svTemp[2]) - { - if (svTemp[1] > svTemp[2]) - { - vOrdre[0] = 0; vOrdre[1] = 1; vOrdre[2] = 2; - } - else - { - vOrdre[0] = 0; vOrdre[1] = 2; vOrdre[2] = 1; - } - } - else - { - vOrdre[0] = 2; vOrdre[1] = 0; vOrdre[2] = 1; - } - } else { - if (svTemp[1] >= svTemp[2]){ - if (svTemp[0] > svTemp[2]) { - vOrdre[0] = 1; vOrdre[1] = 0; vOrdre[2] = 2; - } else { - vOrdre[0] = 1; vOrdre[1] = 2; vOrdre[2] = 0; - } - } else { - vOrdre[0] = 2; vOrdre[1] = 1; vOrdre[2] = 0; - } - } - /***** - Tri decroissant des matrices U, V, sv - en fonction des valeurs singulieres car - hypothese : sv[0]>=sv[1]>=sv[2]>=0 - *****/ - for (unsigned int i = 0; i < 3; i++) { - sv[i] = svTemp[vOrdre[i]]; - for (unsigned int j = 0; j < 3; j++) { - U[i][j] = mTempU[i][vOrdre[j]]; - V[i][j] = mTempV[i][vOrdre[j]]; - } - } - -#ifdef DEBUG_Homographie - printf("U : \n") ; Affiche(U) ; - printf("V : \n") ; affiche(V) ; - printf("Valeurs singulieres : ") ; affiche(sv); -#endif - - // calcul du determinant de U et V - determinantU = U[0][0] * (U[1][1]*U[2][2] - U[1][2]*U[2][1]) + - U[0][1] * (U[1][2]*U[2][0] - U[1][0]*U[2][2]) + - U[0][2] * (U[1][0]*U[2][1] - U[1][1]*U[2][0]); - - determinantV = V[0][0] * (V[1][1]*V[2][2] - V[1][2]*V[2][1]) + - V[0][1] * (V[1][2]*V[2][0] - V[1][0]*V[2][2]) + - V[0][2] * (V[1][0]*V[2][1] - V[1][1]*V[2][0]); - - s = determinantU * determinantV; - -#ifdef DEBUG_Homographie - printf ("s = det(U) * det(V) = %f * %f = %f\n",determinantU,determinantV,s); -#endif - - // deux cas sont a traiter : - // distance Fictive = sv[1] - // distance fictive = -sv[1] - - // pour savoir quelle est le bon signe, - // on utilise le point qui appartient au plan - // la contrainte est : - // (h_31x_1 + h_32x_2 + h_33)/d > 0 - // et d = sd' - - tmp = H[2][0]*x + H[2][1]*y + H[2][2] ; - - if ((tmp/(sv[1] *s)) > 0) - distanceFictive = sv[1]; - else - distanceFictive = -sv[1]; - - // il faut ensuite considerer l'ordre de multiplicite de chaque variable - // 1er cas : d1<>d2<>d3 - // 2eme cas : d1=d2 <> d3 - // 3eme cas : d1 <>d2 =d3 - // 4eme cas : d1 =d2=d3 - - if ((sv[0] - sv[1]) < sing_threshold) - { - if ((sv[1] - sv[2]) < sing_threshold) - cas = cas4; - else - cas = cas2; - } - else - { - if ((sv[1] - sv[2]) < sing_threshold) - cas = cas3; - else - cas = cas1; - } - - Nprim1 = 0.0; Nprim2 = 0.0; Nprim3 = 0.0; Nprim4 = 0.0; - - // on filtre ensuite les diff'erentes normales possibles - // condition : nm/d > 0 - // avec d = sd' - // et n = Vn' - - // les quatres cas sont : ++, +-, -+ , -- - // dans tous les cas, Normale[1] = 0; - Nprim1[1] = 0.0; - Nprim2[1] = 0.0; - Nprim3[1] = 0.0; - Nprim4[1] = 0.0; - - // on calcule les quatres cas de normale - - if (cas == cas1) - { - // quatre normales sont possibles - Nprim1[0] = sqrt((sv[0] * sv[0] - sv[1] * sv[1] )/ - (sv[0] * sv[0] - sv[2] * sv[2] )); - - Nprim1[2] = sqrt((sv[1] * sv[1] - sv[2] * sv[2] )/ - (sv[0] * sv[0] - sv[2] * sv[2] )); - - Nprim2[0] = Nprim1[0]; Nprim2[2] = - Nprim1[2]; - Nprim3[0] = - Nprim1[0]; Nprim3[2] = Nprim1[2]; - Nprim4[0] = - Nprim1[0]; Nprim4[2] = - Nprim1[2]; - } - if (cas == cas2) - { - // 2 normales sont possibles - // x3 = +-1 - Nprim1[2] = 1; - Nprim2[2] = -1; - } - - if (cas == cas3) - { - // 2 normales sont possibles - // x1 = +-1 - Nprim1[0] = 1; - Nprim2[0] = -1; - } - // si on est dans le cas 4, - // on considere que x reste indefini - - // on peut maintenant filtrer les solutions avec la contrainte - // n^tm / d > 0 - // attention, il faut travailler avec la bonne normale, - // soit Ni et non pas Nprimi - if (cas == cas1) - { - N1 = V *Nprim1; - - tmp = N1[0] * x + N1[1] * y + N1[2]; - tmp/= (distanceFictive *s); - norm1ok = (tmp>0); - - N2 = V *Nprim2; - tmp = N2[0] * x + N2[1] *y+ N2[2]; - tmp/= (distanceFictive*s); - norm2ok = (tmp>0); - - N3 = V *Nprim3; - tmp = N3[0] * x + N3[1]*y+ N3[2]; - tmp/= (distanceFictive*s); - norm3ok = (tmp>0); - - N4 = V *Nprim4; - tmp = N4[0] * x + N4[1] * y + N4[2]; - tmp/= (distanceFictive*s); - norm4ok = (tmp>0); - } - - if (cas == cas2) - { - N1 = V *Nprim1; - tmp = N1[0] * x + N1[1] * y + N1[2]; - tmp/= (distanceFictive*s); - norm1ok = (tmp>0); - - N2 = V *Nprim2; - tmp = N2[0] * x + N2[1] * y + N2[2]; - tmp/= (distanceFictive*s); - norm2ok = (tmp>0); - } - - if (cas == cas3) - { - N1 = V *Nprim1; - tmp = N1[0] * x + N1[1] * y + N1[2]; - tmp/= (distanceFictive*s); - norm1ok = (tmp>0); - - N2 = V *Nprim2; - tmp = N2[0] * x + N2[1] * y + N2[2]; - tmp/= (distanceFictive*s); - norm2ok = (tmp>0); - } - - // on a donc maintenant les differents cas possibles - // on peut ensuite remonter aux deplacements - // on separe encore les cas 1,2,3 - // la, deux choix se posent suivant le signe de d - if (distanceFictive>0) - { - if (cas == cas1) - { - if (norm1ok) - { - - //cos theta - Rprim1[0][0] = (vpMath::sqr(sv[1]) + sv[0] * sv[2]) / - ((sv[0] + sv[2]) * sv[1]); - - Rprim1[2][2] = Rprim1[0][0]; - - // sin theta - Rprim1[2][0] = (sqrt((vpMath::sqr(sv[0]) - vpMath::sqr(sv[1])) * - (vpMath::sqr(sv[1]) - vpMath::sqr(sv[2])))) - / ((sv[0] + sv[2]) * sv[1]); - - Rprim1[0][2] = -Rprim1[2][0]; - - Rprim1[1][1] =1.0; - - Tprim1[0] = Nprim1[0]; - Tprim1[1] = 0.0; - Tprim1[2] = -Nprim1[2]; - - Tprim1*=(sv[0] - sv[2]); - - } - - if (norm2ok) - { - - //cos theta - Rprim2[0][0] = (vpMath::sqr(sv[1]) + sv[0] * sv[2]) / - ((sv[0] + sv[2]) * sv[1]); - - Rprim2[2][2] = Rprim2[0][0]; - - // sin theta - Rprim2[2][0] = -(sqrt((vpMath::sqr(sv[0]) - vpMath::sqr(sv[1])) * - (vpMath::sqr(sv[1]) - vpMath::sqr(sv[2])))) - / ((sv[0] + sv[2]) * sv[1]); - - Rprim2[0][2] = -Rprim2[2][0]; - - Rprim2[1][1] =1.0; - - Tprim2[0] = Nprim2[0]; - Tprim2[1] = 0.0; - Tprim2[2] = -Nprim2[2]; - - Tprim2*=(sv[0] - sv[2]); - - } - - if (norm3ok) - { - - //cos theta - Rprim3[0][0] = (vpMath::sqr(sv[1]) + sv[0] * sv[2]) / - ((sv[0] + sv[2]) * sv[1]); - - Rprim3[2][2] = Rprim3[0][0]; - - // sin theta - Rprim3[2][0] = -(sqrt((vpMath::sqr(sv[0]) - vpMath::sqr(sv[1])) * - (vpMath::sqr(sv[1]) - vpMath::sqr(sv[2])))) - / ((sv[0] + sv[2]) * sv[1]); - - Rprim3[0][2] = -Rprim3[2][0]; - - Rprim3[1][1] =1.0; - - Tprim3[0] = Nprim3[0]; - Tprim3[1] = 0.0; - Tprim3[2] = -Nprim3[2]; - - Tprim3*=(sv[0] - sv[2]); - - } - - if (norm4ok) - { - - //cos theta - Rprim4[0][0] = (vpMath::sqr(sv[1]) + sv[0] * sv[2])/ - ((sv[0] + sv[2]) * sv[1]); - - Rprim4[2][2] = Rprim4[0][0]; - - // sin theta - Rprim4[2][0] = (sqrt((vpMath::sqr(sv[0]) - vpMath::sqr(sv[1])) * - (vpMath::sqr(sv[1]) - vpMath::sqr(sv[2])))) - / ((sv[0] + sv[2]) * sv[1]); - - Rprim4[0][2] = -Rprim4[2][0]; - - Rprim4[1][1] =1.0; - - Tprim4[0] = Nprim4[0]; - Tprim4[1] = 0.0; - Tprim4[2] = -Nprim4[2]; - - Tprim4*=(sv[0] - sv[2]); - - } - } - - if (cas == cas2) - { - // 2 normales sont potentiellement candidates - - if (norm1ok) - { - Rprim1.setIdentity(); - - Tprim1 = Nprim1[0]; - Tprim1*= (sv[2] - sv[0]); - } - - if (norm2ok) - { - Rprim2.setIdentity(); - - Tprim2 = Nprim2[1]; - Tprim2*= (sv[2] - sv[0]); - } - } - if (cas == cas3) - { - if (norm1ok) - { - Rprim1.setIdentity(); - - Tprim1 = Nprim1[0]; - Tprim1*= (sv[0] - sv[1]); - } - - if (norm2ok) - { - Rprim2.setIdentity(); - - Tprim2 = Nprim2[1]; - Tprim2*= (sv[0] - sv[1]); - } - } - if (cas == cas4) - { - // on ne connait pas la normale dans ce cas la - Rprim1.setIdentity(); - Tprim1 = 0.0; - } - } - - if (distanceFictive <0) - { - - if (cas == cas1) - { - if (norm1ok) - { - - - //cos theta - Rprim1[0][0] = ( sv[0] * sv[2] - vpMath::sqr(sv[1])) / - ((sv[0] - sv[2]) * sv[1]); - - Rprim1[2][2] = -Rprim1[0][0]; - - // sin theta - Rprim1[2][0] = (sqrt((vpMath::sqr(sv[0]) - vpMath::sqr(sv[1])) * - (vpMath::sqr(sv[1]) - vpMath::sqr(sv[2])))) - / ((sv[0] - sv[2]) * sv[1]); - - Rprim1[0][2] = Rprim1[2][0]; - - Rprim1[1][1] = -1.0; - - Tprim1[0] = Nprim1[0]; - Tprim1[1] = 0.0; - Tprim1[2] = Nprim1[2]; - - Tprim1*=(sv[0] + sv[2]); - - } - - if (norm2ok) - { - - //cos theta - Rprim2[0][0] = (sv[0] * sv[2] - vpMath::sqr(sv[1])) / - ((sv[0] - sv[2]) * sv[1]); - - Rprim2[2][2] = -Rprim2[0][0]; - - // sin theta - Rprim2[2][0] = -(sqrt((vpMath::sqr(sv[0]) - vpMath::sqr(sv[1])) * - (vpMath::sqr(sv[1]) - vpMath::sqr(sv[2])))) - / ((sv[0] - sv[2]) * sv[1]); - - Rprim2[0][2] = Rprim2[2][0]; - - Rprim2[1][1] = - 1.0; - - Tprim2[0] = Nprim2[0]; - Tprim2[1] = 0.0; - Tprim2[2] = Nprim2[2]; - - Tprim2*=(sv[0] + sv[2]); - - } - - if (norm3ok) - { - - //cos theta - Rprim3[0][0] = ( sv[0] * sv[2] - vpMath::sqr(sv[1])) / - ((sv[0] - sv[2]) * sv[1]); - - Rprim3[2][2] = -Rprim3[0][0]; - - // sin theta - Rprim3[2][0] = -(sqrt((vpMath::sqr(sv[0]) - vpMath::sqr(sv[1])) * - (vpMath::sqr(sv[1]) - vpMath::sqr(sv[2])))) - / ((sv[0] - sv[2]) * sv[1]); - - Rprim3[0][2] = Rprim3[2][0]; - - Rprim3[1][1] = -1.0; - - Tprim3[0] = Nprim3[0]; - Tprim3[1] = 0.0; - Tprim3[2] = Nprim3[2]; - - Tprim3*=(sv[0] + sv[2]); - - } - - if (norm4ok) - { - //cos theta - Rprim4[0][0] = ( sv[0] * sv[2]-vpMath::sqr(sv[1]))/((sv[0] - sv[2]) * sv[1]); - - Rprim4[2][2] = -Rprim4[0][0]; - - // sin theta - Rprim4[2][0] = (sqrt((vpMath::sqr(sv[0]) - vpMath::sqr(sv[1])) * - (vpMath::sqr(sv[1]) - vpMath::sqr(sv[2])))) - / ((sv[0] - sv[2]) * sv[1]); - - Rprim4[0][2] = Rprim4[2][0]; - - Rprim4[1][1] = - 1.0; - - Tprim4[0] = Nprim4[0]; - Tprim4[1] = 0.0; - Tprim4[2] = Nprim4[2]; - - Tprim4*=(sv[0] + sv[2]); - } - } - if (cas == cas2) - { - // 2 normales sont potentiellement candidates - - if (norm1ok) - { - Rprim1.setIdentity(); - Rprim1[0][0] = -1; - Rprim1[1][1] = -1; - - Tprim1 = Nprim1[0]; - Tprim1*= (sv[2] + sv[0]); - } - - if (norm2ok) - { - Rprim2.setIdentity(); - Rprim2[0][0] = -1; - Rprim2[1][1] = -1; - - Tprim2 = Nprim2[1]; - Tprim2*= (sv[2] + sv[0]); - } - } - if (cas == cas3) - { - if (norm1ok) - { - Rprim1.setIdentity(); - Rprim1[2][2] = -1; - Rprim1[1][1] = -1; - - Tprim1 = Nprim1[0]; - Tprim1*= (sv[2] + sv[0]); - } - - if (norm2ok) - { - Rprim2.setIdentity(); - Rprim2[2][2] = -1; - Rprim2[1][1] = -1; - - Tprim2 = Nprim2[1]; - Tprim2*= (sv[0] + sv[2]); - } - } - - // ON NE CONSIDERE PAS LE CAS NUMERO 4 - } - // tous les Rprim et Tprim sont calcules - // on peut maintenant recuperer la - // rotation, et la translation - // IL Y A JUSTE LE CAS D<0 ET CAS 4 QU'ON NE TRAITE PAS - if ((distanceFictive>0) || (cas != cas4)) - { - // on controle juste si les normales sont ok - - if (norm1ok) - { - R1 = s * U * Rprim1 * V.t(); - T1 = U * Tprim1; - T1 /= (distanceFictive *s); - N1 = V *Nprim1; - - // je rajoute le resultat - vR.addRight(R1); - vT.addRight(T1); - vN.addRight(N1); - } - if (norm2ok) - { - R2 = s * U * Rprim2 * V.t(); - T2 = U * Tprim2; - T2 /= (distanceFictive *s); - N2 = V *Nprim2; - - // je rajoute le resultat - vR.addRight(R2); - vT.addRight(T2); - vN.addRight(N2); - } - if (norm3ok) - { - R3 = s * U * Rprim3 * V.t(); - T3 = U * Tprim3; - T3 /= (distanceFictive *s); - N3 = V *Nprim3; - // je rajoute le resultat - vR.addRight(R3); - vT.addRight(T3); - vN.addRight(N3); - } - if (norm4ok) - { - R4 = s * U * Rprim4 * V.t(); - T4 = U * Tprim4; - T4 /= (distanceFictive *s); - N4 = V *Nprim4; - - // je rajoute le resultat - vR.addRight(R4); - vT.addRight(T4); - vN.addRight(N4); - } - } - else - { - std::cout << "On tombe dans le cas particulier ou le mouvement n'est pas estimable!" << std::endl; - } - - // on peut ensuite afficher les resultats... - /* std::cout << "Analyse des resultats : "<< std::endl; */ - /* if (cas==cas1) */ - /* std::cout << "On est dans le cas 1" << std::endl; */ - /* if (cas==cas2) */ - /* std::cout << "On est dans le cas 2" << std::endl; */ - /* if (cas==cas3) */ - /* std::cout << "On est dans le cas 3" << std::endl; */ - /* if (cas==cas4) */ - /* std::cout << "On est dans le cas 4" << std::endl; */ - - /* if (distanceFictive < 0) */ - /* std::cout << "d'<0" << std::endl; */ - /* else */ - /* std::cout << "d'>0" << std::endl; */ - -#ifdef DEBUG_Homographie - printf("fin : Homographie_EstimationDeplacementCamera\n"); -#endif -} - -#endif // VISP_BUILD_DEPRECATED_FUNCTIONS diff --git a/src/computer-vision/homography-estimation/vpHomographyMalis.cpp b/modules/vision/src/homography-estimation/vpHomographyMalis.cpp similarity index 84% rename from src/computer-vision/homography-estimation/vpHomographyMalis.cpp rename to modules/vision/src/homography-estimation/vpHomographyMalis.cpp index 0423c113959c3359a0a4c266c7aa4ec48ab155f2..04907abf5ad23e47d6b63304e6a34556a3b6a628 100644 --- a/src/computer-vision/homography-estimation/vpHomographyMalis.cpp +++ b/modules/vision/src/homography-estimation/vpHomographyMalis.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHomographyMalis.cpp 5264 2015-02-04 13:49:55Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Homography estimation. * @@ -52,9 +48,9 @@ */ -#include <visp/vpHomography.h> -#include <visp/vpDebug.h> -#include <visp/vpMatrixException.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpMatrixException.h> #include <cmath> // std::fabs #include <limits> // numeric_limits @@ -625,94 +621,6 @@ HLM3D(unsigned int nb_pts, } } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - -/************************************************************************** - * NOM : - * Homographie_CrvMafCalculHomographie - * - * DESCRIPTION : - * Calcul de l'homographie, en fonction de la cible desiree et de la cible - * en cours. C'est une estimation lineaire. - * Cette procedure n'effectue pas elle-meme le calcul de l'homographie : - * elle se contente d'appeler la bonne sous-procedure. - * Cette procedure est appellee par "crv_maf_calcul_tomographie". - * - **************************************************************************** - * ENTREES : - * STR_CIBLE_ASSER *cible_asser Pointeur sur structure contenant les - * commandes du robot, les donnees de la - * carte... - * Voir "cvda/edixaa/param/robot.h" - * STR_VITESSE_ROBOT *data_common Pointeur sur la structure decrivant la - * cible d'asservissement. - * Voir "cvda/edixia/param/param.h" - * STR_MACH_DIV *machine_div Pointeur sur structure contenant divers - * parametres de configuration du robot. - * Voir "cvda/edixia/param/param.h" - * - * SORTIES : - * - * double **H matrice d'homographie - - * - **************************************************************************** - * AUTEUR : BOSSARD Nicolas. INSA Rennes 5eme annee. - * - * DATE DE CREATION : 01/12/98 - * - * DATES DE MISE A JOUR : - * - ****************************************************************************/ -void -HLM(unsigned int q_cible, - unsigned int nbpt, - double *xm, double *ym, - double *xmi, double *ymi, - vpMatrix &H) -{ - unsigned int i; - - /**** - on regarde si il y a au moins un point mais pour l'homographie - il faut au moins quatre points - ****/ - vpMatrix pd(nbpt,3) ; - vpMatrix p(nbpt,3) ; - - for (i=0;i<nbpt;i++) { - /**** - on assigne les points fournies par la structure robot - pour la commande globale - ****/ - pd[i][0] = xmi[i]; - pd[i][1] = ymi[i]; - pd[i][2] = 1.0 ; - p[i][0] = xm[i]; - p[i][1] = ym[i]; - p[i][2] = 1.0 ; - } - - - switch (q_cible) { - case (1): - case (2): - /* La cible est planaire de type points */ - - HLM2D(nbpt,pd,p,H); - - break; - case (3) : /* cible non planaire : chateau */ - /* cible non planaire de type points */ - HLM3D(nbpt,pd,p,H); - break; - } /* fin switch */ - - - -} /* fin procedure calcul_homogaphie */ -#endif // #ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - void HLM(unsigned int q_cible, const std::vector<double> &xm, const std::vector<double> &ym, @@ -761,49 +669,6 @@ HLM(unsigned int q_cible, #endif // #ifndef DOXYGEN_SHOULD_SKIP_THIS -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - -/*! - \brief Computes the homography matrix from planar \cite TheseMalis or non planar points - using Ezio Malis linear method (HLM) \cite Malis00b. - - Computes H such as \f[ - ^a{\bf p} = ^a{\bf H}_b\; ^b{\bf p} - \f] - - The algorithm for 2D scene implemented in this file is described in Ezio - Malis PhD thesis. - - If the boolean isplanar is true the point is assumed to be in a plane - otherwise there are assumed to be planar. - - The reference planar is the plane build from the 3 first points. - -*/ -void vpHomography::HLM(unsigned int n, - double *xb, double *yb, - double *xa, double *ya , - bool isplanar, - vpHomography &aHb) -{ - unsigned int i,j; - unsigned int q_cible; - vpMatrix H; // matrice d'homographie en metre - - if (isplanar) - q_cible =1; - else - q_cible =3; - - ::HLM(q_cible,n, xa,ya,xb,yb,H) ; - - for(i=0;i<3;i++) - for(j=0;j<3;j++) - aHb[i][j] = H[i][j]; -} - -#endif //#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! From couples of matched points \f$^a{\bf p}=(x_a,y_a,1)\f$ in image a and \f$^b{\bf p}=(x_b,y_b,1)\f$ in image b with homogeneous coordinates, computes the diff --git a/src/computer-vision/homography-estimation/vpHomographyRansac.cpp b/modules/vision/src/homography-estimation/vpHomographyRansac.cpp similarity index 77% rename from src/computer-vision/homography-estimation/vpHomographyRansac.cpp rename to modules/vision/src/homography-estimation/vpHomographyRansac.cpp index 777c0eeb144c63f01d34b991221619e66132d9a7..3b2262e6ecfdaad427ce16c5685cae17d77f843e 100644 --- a/src/computer-vision/homography-estimation/vpHomographyRansac.cpp +++ b/modules/vision/src/homography-estimation/vpHomographyRansac.cpp @@ -1,28 +1,47 @@ - -/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - * Copyright Projet Lagadic / IRISA-INRIA Rennes, 2005 - * www : http://www.irisa.fr/lagadic - *+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France * - * File: vpHomographyRansac.cpp - * Project: ViSP 2.0 - * Author: Eric Marchand - * From: vpHomographyRansac.cpp, ViSP 2 + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr * - * Version control - * =============== + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: vpHomographyRansac.cpp 4649 2014-02-07 14:57:11Z fspindle $ - * optimized by Tran to improve speed. - * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ + * Description: + * Homography estimation. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ -#include <visp/vpHomography.h> -#include <visp/vpColVector.h> -#include <visp/vpRansac.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpRansac.h> -#include <visp/vpImage.h> -#include <visp/vpDisplay.h> -#include <visp/vpMeterPixelConversion.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpMeterPixelConversion.h> #define vpEps 1e-6 @@ -309,103 +328,6 @@ vpHomography::initRansac(unsigned int n, } } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - -/*! - \deprecated This method is deprecated. You should rather use - vpHomography::ransac(const std::vector<double> &, const std::vector<double> &, const std::vector<double> &, const std::vector<double> &, vpHomography &, std::vector<bool> &, double &, unsigned int, double, bool) - */ -bool -vpHomography::ransac(unsigned int n, - double *xb, double *yb, - double *xa, double *ya , - vpHomography &aHb, - int consensus, - double threshold - ) -{ - vpColVector x ; - vpHomography::initRansac(n, xb, yb, xa, ya, x) ; - - vpColVector M ; - vpColVector inliers(n) ; - - - bool ransacable = vpRansac<vpHomography>::ransac(n, x, 4, threshold, M, inliers, consensus); - - if(ransacable) - { - for (unsigned int i = 0 ;i < 9 ;i++) - { - aHb.data[i] = M[i]; - } - aHb /= aHb[2][2]; - } - return ransacable; -} - -/*! - \deprecated This method is deprecated. You should rather use - vpHomography::ransac(const std::vector<double> &, const std::vector<double> &, const std::vector<double> &, const std::vector<double> &, vpHomography &, std::vector<bool> &, double &, unsigned int, double, bool) - - Computes homography matrix \f$ b^H_a \f$ such as \f$X_b = b^H_a X_a \f$ with - \f$ X_a = (xa, ya)^t \f$ and \f$ X_b = (xb, yb)^t \f$. - - \param n : Number of points. - \param xb, yb : Coordinates of the points in \f$ X_b \f$ vector. - \param xa, ya : Coordinates of the points in \f$ X_a \f$ vector. - - \param bHa : Homography matrix computed from \f$ X_a \f$ and \f$ X_b \f$ - vectors. - - \param inliers : n dimention vector indicating if a point is an inlier - (value 1.0) or an outlier (value 0). Matches are stocked in inliers vector - column. - - \param residual : Residual. Not used. - - \param consensus : Minimal number of points (less than n) fitting the model. - - \param threshold : Threshold for outlier removing. - - \param areaThreshold : Ensure that the area formed by every 3 points within - the 4 points used to compute the homography is greater than this - threshold. If the area is smaller, we are in a degenerate case. - - \return true if the homography could be computed from 4 non-degenerated - points. - -*/ -bool vpHomography::ransac(unsigned int n, - double *xb, double *yb, - double *xa, double *ya , - vpHomography &bHa, - vpColVector &inliers, - double /* residual */, - int consensus, - double threshold, - double areaThreshold) -{ - vpColVector x ; - vpHomography::initRansac(n, xb, yb, xa, ya, x); - - vpColVector M ; - - bool ransacable= vpRansac<vpHomography>::ransac(n, x, 4, - threshold, M, - inliers, consensus, - areaThreshold); - - for (unsigned int i = 0 ;i < 9 ;i++) - { - bHa.data[i] = M[i]; - } - - bHa /= bHa[2][2]; - return ransacable; -} -#endif //#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - /*! From couples of matched points \f$^a{\bf p}=(x_a,y_a,1)\f$ in image a diff --git a/src/computer-vision/homography-estimation/vpHomographyVVS.cpp b/modules/vision/src/homography-estimation/vpHomographyVVS.cpp similarity index 87% rename from src/computer-vision/homography-estimation/vpHomographyVVS.cpp rename to modules/vision/src/homography-estimation/vpHomographyVVS.cpp index 9d8688d7176c785a33b46158b1c7c24c419de844..46772d92129afa8f8f81a61f164c0fbe6d8786c2 100644 --- a/src/computer-vision/homography-estimation/vpHomographyVVS.cpp +++ b/modules/vision/src/homography-estimation/vpHomographyVVS.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpHomographyVVS.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Homography transformation. * @@ -41,15 +37,15 @@ //#include <computeHomography.h> //#include <utilsHomography.h> -#include <visp/vpRobust.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpHomography.h> -#include <visp/vpMath.h> -#include <visp/vpMatrix.h> -#include <visp/vpPoint.h> -#include <visp/vpPlane.h> +#include <visp3/core/vpRobust.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpPlane.h> #include <iostream> -#include <visp/vpExponentialMap.h> +#include <visp3/core/vpExponentialMap.h> const double vpHomography::threshold_rotation = 1e-7; @@ -210,8 +206,8 @@ vpHomography::computeRotation(unsigned int nbpoint, if (k == 0) { L = H2 ; e = e2 ; } else { - L = vpMatrix::stackMatrices(L,H2) ; - e = vpMatrix::stackMatrices(e,e2) ; + L = vpMatrix::stack(L,H2) ; + e = vpColVector::stack(e,e2) ; } } else @@ -220,8 +216,8 @@ vpHomography::computeRotation(unsigned int nbpoint, if (k == 0) { L = H1 ; e= e1 ; } else { - L = vpMatrix::stackMatrices(L,H1) ; - e = vpMatrix::stackMatrices(e,e1) ; + L = vpMatrix::stack(L,H1) ; + e = vpColVector::stack(e,e1) ; } } else @@ -229,11 +225,11 @@ vpHomography::computeRotation(unsigned int nbpoint, if (k == 0) {L = H2 ; e = e2 ; } else { - L = vpMatrix::stackMatrices(L,H2) ; - e = vpMatrix::stackMatrices(e,e2) ; + L = vpMatrix::stack(L,H2) ; + e = vpColVector::stack(e,e2) ; } - L = vpMatrix::stackMatrices(L,H1) ; - e = vpMatrix::stackMatrices(e,e1) ; + L = vpMatrix::stack(L,H1) ; + e = vpColVector::stack(e,e1) ; } k++ ; @@ -332,9 +328,10 @@ vpHomography::computeDisplacement(unsigned int nbpoint, only_1 = 1 ; only_2 = 0 ; - //if ((only_1==1) || (only_2==1)) ; else n *=2 ; - if ( (! only_1) && (! only_2) ) - n *=2 ; + //if ((only_1==1) || (only_2==1)) ; else n *=2 ; + // Since only_1 is initialized to 1, the next 2 lines connt be reached. We remove them + //if ( (! only_1) && (! only_2) ) + // n *=2 ; vpRobust robust(n); vpColVector res(n) ; @@ -382,8 +379,8 @@ vpHomography::computeDisplacement(unsigned int nbpoint, vpMatrix H(3,3) ; - Hp2 = ((vpMatrix)c1Rc2 + ((vpMatrix)c1Tc2*N2.t())/d2)*p2 ; // p2 = Hp1 - Hp1 = ((vpMatrix)c2Rc1 + ((vpMatrix)c2Tc1*N1.t())/d1)*p1 ; // p1 = Hp2 + Hp2 = ((vpMatrix)c1Rc2 + (c1Tc2*N2.t())/d2)*p2 ; // p2 = Hp1 + Hp1 = ((vpMatrix)c2Rc1 + (c2Tc1*N1.t())/d1)*p1 ; // p1 = Hp2 Hp2 /= Hp2[2] ; // normalisation Hp1 /= Hp1[2] ; @@ -439,8 +436,8 @@ vpHomography::computeDisplacement(unsigned int nbpoint, if (k == 0) { L = H2 ; e = e2 ; } else { - L = vpMatrix::stackMatrices(L,H2) ; - e = vpMatrix::stackMatrices(e,e2) ; + L = vpMatrix::stack(L,H2) ; + e = vpColVector::stack(e,e2) ; } } else @@ -449,8 +446,8 @@ vpHomography::computeDisplacement(unsigned int nbpoint, if (k == 0) { L = H1 ; e= e1 ; } else { - L = vpMatrix::stackMatrices(L,H1) ; - e = vpMatrix::stackMatrices(e,e1) ; + L = vpMatrix::stack(L,H1) ; + e = vpColVector::stack(e,e1) ; } } else @@ -458,11 +455,11 @@ vpHomography::computeDisplacement(unsigned int nbpoint, if (k == 0) {L = H2 ; e = e2 ; } else { - L = vpMatrix::stackMatrices(L,H2) ; - e = vpMatrix::stackMatrices(e,e2) ; + L = vpMatrix::stack(L,H2) ; + e = vpColVector::stack(e,e2) ; } - L = vpMatrix::stackMatrices(L,H1) ; - e = vpMatrix::stackMatrices(e,e1) ; + L = vpMatrix::stack(L,H1) ; + e = vpColVector::stack(e,e1) ; } @@ -546,9 +543,10 @@ vpHomography::computeDisplacement(unsigned int nbpoint, only_1 = 1 ; only_2 = 0 ; n = nbpoint ; - // if ((only_1==1) || (only_2==1)) ; else n *=2 ; - if ( (! only_1) && (! only_2) ) - n *=2 ; + + // Remove next 2 lines, since when only_1 is initialized to 1 (as it is), we cannot reach the code + //if ( (! only_1) && (! only_2) ) + // n *=2 ; vpRobust robust(n); vpColVector res(n) ; @@ -599,8 +597,8 @@ vpHomography::computeDisplacement(unsigned int nbpoint, vpMatrix H(3,3) ; - Hp2 = ((vpMatrix)c1Rc2 + ((vpMatrix)c1Tc2*N2.t())/d2)*p2 ; // p2 = Hp1 - Hp1 = ((vpMatrix)c2Rc1 + ((vpMatrix)c2Tc1*N1.t())/d1)*p1 ; // p1 = Hp2 + Hp2 = ((vpMatrix)c1Rc2 + (c1Tc2*N2.t())/d2)*p2 ; // p2 = Hp1 + Hp1 = ((vpMatrix)c2Rc1 + (c2Tc1*N1.t())/d1)*p1 ; // p1 = Hp2 Hp2 /= Hp2[2] ; // normalisation Hp1 /= Hp1[2] ; @@ -657,8 +655,8 @@ vpHomography::computeDisplacement(unsigned int nbpoint, if (k == 0) { L = H2 ; e = e2 ; } else { - L = vpMatrix::stackMatrices(L,H2) ; - e = vpMatrix::stackMatrices(e,e2) ; + L = vpMatrix::stack(L,H2) ; + e = vpColVector::stack(e,e2) ; } } else @@ -667,8 +665,8 @@ vpHomography::computeDisplacement(unsigned int nbpoint, if (k == 0) { L = H1 ; e= e1 ; } else { - L = vpMatrix::stackMatrices(L,H1) ; - e = vpMatrix::stackMatrices(e,e1) ; + L = vpMatrix::stack(L,H1) ; + e = vpColVector::stack(e,e1) ; } } else @@ -676,11 +674,11 @@ vpHomography::computeDisplacement(unsigned int nbpoint, if (k == 0) {L = H2 ; e = e2 ; } else { - L = vpMatrix::stackMatrices(L,H2) ; - e = vpMatrix::stackMatrices(e,e2) ; + L = vpMatrix::stack(L,H2) ; + e = vpColVector::stack(e,e2) ; } - L = vpMatrix::stackMatrices(L,H1) ; - e = vpMatrix::stackMatrices(e,e1) ; + L = vpMatrix::stack(L,H1) ; + e = vpColVector::stack(e,e1) ; } diff --git a/src/key-point/vpBasicKeyPoint.cpp b/modules/vision/src/key-point/vpBasicKeyPoint.cpp similarity index 75% rename from src/key-point/vpBasicKeyPoint.cpp rename to modules/vision/src/key-point/vpBasicKeyPoint.cpp index 68ad68b1f71044aae478a024d210abed2548bd11..b5660ee4599a608e6bcf930ab84492a8e5ccb63b 100644 --- a/src/key-point/vpBasicKeyPoint.cpp +++ b/modules/vision/src/key-point/vpBasicKeyPoint.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpBasicKeyPoint.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Key point used in matching algorithm. * @@ -40,7 +36,7 @@ *****************************************************************************/ -#include <visp/vpBasicKeyPoint.h> +#include <visp3/vision/vpBasicKeyPoint.h> /*! Basic constructor. diff --git a/src/key-point/vpFernClassifier.cpp b/modules/vision/src/key-point/vpFernClassifier.cpp similarity index 96% rename from src/key-point/vpFernClassifier.cpp rename to modules/vision/src/key-point/vpFernClassifier.cpp index a14886f194a8f34f2625cdfda2eb1b2334000d23..4c348a271300ef4c13d0ce3e1ab975041ca3960b 100644 --- a/src/key-point/vpFernClassifier.cpp +++ b/modules/vision/src/key-point/vpFernClassifier.cpp @@ -1,36 +1,32 @@ /**************************************************************************** - * - * $Id: vpFernClassifier.cpp 5023 2014-12-03 16:07:48Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.GPL at the root directory of this source + * See the file LICENSE.txt at the root directory of this source * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Class that implements the Fern classifier and the YAPE detector thanks * to the OpenCV library. @@ -40,15 +36,15 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #if (VISP_HAVE_OPENCV_VERSION >= 0x020000) && (VISP_HAVE_OPENCV_VERSION < 0x030000) // Require opencv >= 2.0.0 and < 3.0.0 -#include <visp/vpFernClassifier.h> -#include <visp/vpImageTools.h> -#include <visp/vpImageConvert.h> -#include <visp/vpColor.h> -#include <visp/vpDisplay.h> +#include <visp3/vision/vpFernClassifier.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpDisplay.h> /*! Basic constructor @@ -580,5 +576,8 @@ vpFernClassifier::setImage(const vpImage<unsigned char>& I) } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_vision.a(vpFernClassifier.cpp.o) has no symbols +void dummy_vpFernClassifier() {}; #endif diff --git a/src/key-point/vpKeyPoint.cpp b/modules/vision/src/key-point/vpKeyPoint.cpp similarity index 65% rename from src/key-point/vpKeyPoint.cpp rename to modules/vision/src/key-point/vpKeyPoint.cpp index 18e7d68d747b7b3e6d4b9c3b6370cec9d025f69d..03386acd89ab55b5d28ab4d3910ce8e592c5e710 100644 --- a/src/key-point/vpKeyPoint.cpp +++ b/modules/vision/src/key-point/vpKeyPoint.cpp @@ -1,7 +1,7 @@ /**************************************************************************** * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -10,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -37,8 +36,11 @@ *****************************************************************************/ #include <limits> +#include <iomanip> +#include <stdint.h> //uint32_t ; works also with >= VS2010 / _MSC_VER >= 1600 -#include <visp/vpKeyPoint.h> +#include <visp3/vision/vpKeyPoint.h> +#include <visp3/core/vpIoTools.h> #if (VISP_HAVE_OPENCV_VERSION >= 0x020101) @@ -47,6 +49,7 @@ #endif +//TODO: test saveLearningData with little / big endian platform //Specific Type transformation functions ///*! // Convert a list of cv::DMatch to a cv::DMatch (extract the first cv::DMatch, the nearest neighbor). @@ -72,81 +75,129 @@ inline vpImagePoint matchRansacToVpImage(const std::pair<cv::KeyPoint, cv::Point return vpImagePoint(pair.first.pt.y, pair.first.pt.x); } -//TODO: Try to implement a pyramidal feature detection -//#if (VISP_HAVE_OPENCV_VERSION >= 0x030000) -//class MaskPredicate -//{ -//public: -// MaskPredicate( const cv::Mat& _mask ) : mask(_mask) {} -// bool operator() (const cv::KeyPoint& key_pt) const -// { -// return mask.at<uchar>( (int)(key_pt.pt.y + 0.5f), (int)(key_pt.pt.x + 0.5f) ) == 0; -// } -// -//private: -// const cv::Mat mask; -// MaskPredicate& operator=(const MaskPredicate&); -//}; -// -//void vpKeyPoint::runByPixelsMask( std::vector<cv::KeyPoint>& keypoints, const cv::Mat& mask ) -//{ -// if( mask.empty() ) -// { -// return; -// } -// -// keypoints.erase(std::remove_if(keypoints.begin(), keypoints.end(), MaskPredicate(mask)), keypoints.end()); -//} -// -//void vpKeyPoint::pyramidFeatureDetection(cv::Ptr<cv::FeatureDetector> &detector, const cv::Mat& image, std::vector<cv::KeyPoint>& keypoints, const cv::Mat& mask, -// const int maxLevel) -//{ -// cv::Mat src = image; -// cv::Mat src_mask = mask; -// -// cv::Mat dilated_mask; -// if( !mask.empty() ) -// { -// dilate( mask, dilated_mask, cv::Mat() ); -// cv::Mat mask255( mask.size(), CV_8UC1, cv::Scalar(0) ); -// mask255.setTo( cv::Scalar(255), dilated_mask != 0 ); -// dilated_mask = mask255; -// } -// -// for( int l = 0, multiplier = 1; l <= maxLevel; ++l, multiplier *= 2 ) -// { -// // Detect on current level of the pyramid -// std::vector<cv::KeyPoint> new_pts; -// detector->detect( src, new_pts, src_mask ); -// std::vector<cv::KeyPoint>::iterator it = new_pts.begin(), -// end = new_pts.end(); -// for( ; it != end; ++it) -// { -// it->pt.x *= multiplier; -// it->pt.y *= multiplier; -// it->size *= multiplier; -// it->octave = l; -// } -// keypoints.insert( keypoints.end(), new_pts.begin(), new_pts.end() ); -// -// // Downsample -// if( l < maxLevel ) -// { -// cv::Mat dst; -// pyrDown( src, dst ); -// src = dst; -// -// if( !mask.empty() ) -// resize( dilated_mask, src_mask, src.size(), 0, 0, CV_INTER_AREA ); -// } -// } -// -// if( !mask.empty() ) -// { -// //KeyPointsFilter::runByPixelsMask( keypoints, mask ); -// } -//} -//#endif +bool isBigEndian() { + union { + uint32_t i; + char c[4]; + } bint = { 0x01020304 }; + + return bint.c[0] == 1; +} + +uint16_t reverse16bits(const uint16_t n) { + unsigned char *np = (unsigned char *) &n; + + return ((uint16_t) np[0] << 8) | (uint16_t) np[1]; +} + +uint32_t reverse32bits(const uint32_t n) { + unsigned char *np = (unsigned char *) &n; + + return ((uint32_t) np[0] << 24) | ((uint32_t) np[1] << 16) + | ((uint32_t) np[2] << 8) | (uint32_t) np[3]; +} + +float reverseFloat(const float f) { + union { + float f; + unsigned char b[4]; + } dat1, dat2; + + dat1.f = f; + dat2.b[0] = dat1.b[3]; + dat2.b[1] = dat1.b[2]; + dat2.b[2] = dat1.b[1]; + dat2.b[3] = dat1.b[0]; + return dat2.f; +} + +double reverseDouble(const double d) { + union { + double d; + unsigned char b[8]; + } dat1, dat2; + + dat1.d = d; + dat2.b[0] = dat1.b[7]; + dat2.b[1] = dat1.b[6]; + dat2.b[2] = dat1.b[5]; + dat2.b[3] = dat1.b[4]; + dat2.b[4] = dat1.b[3]; + dat2.b[5] = dat1.b[2]; + dat2.b[6] = dat1.b[1]; + dat2.b[7] = dat1.b[0]; + return dat2.d; +} + +void writeBinaryUShortLE(std::ofstream &file, const unsigned short ushort_value) { + if(isBigEndian()) { + //Reverse bytes order to little endian + uint16_t reverse_ushort = reverse16bits(ushort_value); + file.write((char *)(&reverse_ushort), sizeof(reverse_ushort)); + } else { + file.write((char *)(&ushort_value), sizeof(ushort_value)); + } +} + +void writeBinaryShortLE(std::ofstream &file, const short short_value) { + if(isBigEndian()) { + //Reverse bytes order to little endian + uint16_t reverse_short = reverse16bits((uint16_t) short_value); + file.write((char *)(&reverse_short), sizeof(reverse_short)); + } else { + file.write((char *)(&short_value), sizeof(short_value)); + } +} + +void writeBinaryUIntLE(std::ofstream &file, const unsigned int uint_value) { + if(isBigEndian()) { + //Reverse bytes order to little endian + if(sizeof(uint_value) == 4) { + uint32_t reverse_uint = reverse32bits(uint_value); + file.write((char *)(&reverse_uint), sizeof(reverse_uint)); + } else { + uint16_t reverse_uint = reverse16bits(uint_value); + file.write((char *)(&reverse_uint), sizeof(reverse_uint)); + } + } else { + file.write((char *)(&uint_value), sizeof(uint_value)); + } +} + +void writeBinaryIntLE(std::ofstream &file, const int int_value) { + if(isBigEndian()) { + //Reverse bytes order to little endian + if(sizeof(int_value) == 4) { + uint32_t reverse_int = reverse32bits((uint32_t) int_value); + file.write((char *)(&reverse_int), sizeof(reverse_int)); + } else { + uint16_t reverse_int = reverse16bits((uint16_t) int_value); + file.write((char *)(&reverse_int), sizeof(reverse_int)); + } + } else { + file.write((char *)(&int_value), sizeof(int_value)); + } +} + +void writeBinaryFloatLE(std::ofstream &file, const float float_value) { + if(isBigEndian()) { + //Reverse bytes order to little endian + float reverse_float = reverseFloat(float_value); + file.write((char *)(&reverse_float), sizeof(reverse_float)); + } else { + file.write((char *)(&float_value), sizeof(float_value)); + } +} + +void writeBinaryDoubleLE(std::ofstream &file, const double double_value) { + if(isBigEndian()) { + //Reverse bytes order to little endian + double reverse_double = reverseDouble(double_value); + file.write((char *)(&reverse_double), sizeof(reverse_double)); + } else { + file.write((char *)(&double_value), sizeof(double_value)); + } +} /*! Constructor to initialize specified detector, extractor, matcher and filtering method. @@ -161,15 +212,19 @@ vpKeyPoint::vpKeyPoint(const std::string &detectorName, const std::string &extra : m_computeCovariance(false), m_covarianceMatrix(), m_currentImageId(0), m_detectionMethod(detectionScore), m_detectionScore(0.15), m_detectionThreshold(100.0), m_detectionTime(0.), m_detectorNames(), m_detectors(), m_extractionTime(0.), m_extractorNames(), m_extractors(), m_filteredMatches(), m_filterType(filterType), - m_knnMatches(), m_mapOfImageId(), m_mapOfImages(), m_matcher(), m_matcherName(matcherName), m_matches(), - m_matchingFactorThreshold(2.0), m_matchingRatioThreshold(0.85), m_matchingTime(0.), - m_matchQueryToTrainKeyPoints(), m_matchRansacKeyPointsToPoints(), m_matchRansacQueryToTrainKeyPoints(), - m_nbRansacIterations(200), m_nbRansacMinInlierCount(100), m_objectFilteredPoints(), + m_imageFormat(jpgImageFormat), m_knnMatches(), m_mapOfImageId(), m_mapOfImages(), + m_matcher(), m_matcherName(matcherName), + m_matches(), m_matchingFactorThreshold(2.0), m_matchingRatioThreshold(0.85), m_matchingTime(0.), + m_matchRansacKeyPointsToPoints(), m_nbRansacIterations(200), m_nbRansacMinInlierCount(100), m_objectFilteredPoints(), m_poseTime(0.), m_queryDescriptors(), m_queryFilteredKeyPoints(), m_queryKeyPoints(), m_ransacConsensusPercentage(20.0), m_ransacInliers(), m_ransacOutliers(), m_ransacReprojectionError(6.0), - m_ransacThreshold(0.001), m_trainDescriptors(), m_trainKeyPoints(), m_trainPoints(), - m_trainVpPoints(), m_useAffineDetection(false), m_useBruteForceCrossCheck(true), - m_useConsensusPercentage(false), m_useKnn(false), m_useRansacVVS(false) + m_ransacThreshold(0.01), m_trainDescriptors(), m_trainKeyPoints(), m_trainPoints(), + m_trainVpPoints(), m_useAffineDetection(false), + #if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000) + m_useBruteForceCrossCheck(true), + #endif + m_useConsensusPercentage(false), + m_useKnn(false), m_useMatchTrainToQuery(false), m_useRansacVVS(true), m_useSingleMatchFilter(true) { //Use k-nearest neighbors (knn) to retrieve the two best matches for a keypoint //So this is useful only for ratioDistanceThreshold method @@ -196,15 +251,19 @@ vpKeyPoint::vpKeyPoint(const std::vector<std::string> &detectorNames, const std: : m_computeCovariance(false), m_covarianceMatrix(), m_currentImageId(0), m_detectionMethod(detectionScore), m_detectionScore(0.15), m_detectionThreshold(100.0), m_detectionTime(0.), m_detectorNames(detectorNames), m_detectors(), m_extractionTime(0.), m_extractorNames(extractorNames), m_extractors(), m_filteredMatches(), - m_filterType(filterType), m_knnMatches(), m_mapOfImageId(), m_mapOfImages(), m_matcher(), m_matcherName(matcherName), - m_matches(), m_matchingFactorThreshold(2.0), m_matchingRatioThreshold(0.85), m_matchingTime(0.), - m_matchQueryToTrainKeyPoints(), m_matchRansacKeyPointsToPoints(), m_matchRansacQueryToTrainKeyPoints(), - m_nbRansacIterations(200), m_nbRansacMinInlierCount(100), m_objectFilteredPoints(), + m_filterType(filterType), m_imageFormat(jpgImageFormat), m_knnMatches(), m_mapOfImageId(), m_mapOfImages(), + m_matcher(), + m_matcherName(matcherName), m_matches(), m_matchingFactorThreshold(2.0), m_matchingRatioThreshold(0.85), m_matchingTime(0.), + m_matchRansacKeyPointsToPoints(), m_nbRansacIterations(200), m_nbRansacMinInlierCount(100), m_objectFilteredPoints(), m_poseTime(0.), m_queryDescriptors(), m_queryFilteredKeyPoints(), m_queryKeyPoints(), m_ransacConsensusPercentage(20.0), m_ransacInliers(), m_ransacOutliers(), m_ransacReprojectionError(6.0), - m_ransacThreshold(0.001), m_trainDescriptors(), m_trainKeyPoints(), m_trainPoints(), - m_trainVpPoints(), m_useAffineDetection(false), m_useBruteForceCrossCheck(true), - m_useConsensusPercentage(false), m_useKnn(false), m_useRansacVVS(false) + m_ransacThreshold(0.01), m_trainDescriptors(), m_trainKeyPoints(), m_trainPoints(), + m_trainVpPoints(), m_useAffineDetection(false), + #if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000) + m_useBruteForceCrossCheck(true), + #endif + m_useConsensusPercentage(false), + m_useKnn(false), m_useMatchTrainToQuery(false), m_useRansacVVS(true), m_useSingleMatchFilter(true) { //Use k-nearest neighbors (knn) to retrieve the two best matches for a keypoint //So this is useful only for ratioDistanceThreshold method @@ -248,9 +307,9 @@ void vpKeyPoint::affineSkew(double tilt, double phi, cv::Mat& img, std::vector<cv::Mat> channels; channels.push_back(tcorners_x); channels.push_back(tcorners_y); - merge(channels, tcorners); + cv::merge(channels, tcorners); - cv::Rect rect = boundingRect(tcorners); + cv::Rect rect = cv::boundingRect(tcorners); A = (cv::Mat_<float>(2, 3) << c, -s, -rect.x, s, c, -rect.y); cv::warpAffine(img, img, A, cv::Size(rect.width, rect.height), @@ -269,7 +328,7 @@ void vpKeyPoint::affineSkew(double tilt, double phi, cv::Mat& img, w = img.cols; cv::warpAffine(mask, mask, A, cv::Size(w, h), cv::INTER_NEAREST); } - invertAffineTransform(A, Ai); + cv::invertAffineTransform(A, Ai); } /*! @@ -356,6 +415,10 @@ unsigned int vpKeyPoint::buildReference(const vpImage<unsigned char> &I, _reference_computed = true; + //Add train descriptors in matcher object + m_matcher->clear(); + m_matcher->add(std::vector<cv::Mat>(1, m_trainDescriptors)); + return static_cast<unsigned int>(m_trainKeyPoints.size()); } @@ -366,13 +429,37 @@ unsigned int vpKeyPoint::buildReference(const vpImage<unsigned char> &I, \param trainKeyPoints : List of the train keypoints. \param points3f : Output list of the 3D position corresponding of the keypoints locations. \param append : If true, append the supply train keypoints with those already present. + \param class_id : The class id to be set to the input cv::KeyPoint if != -1. */ void vpKeyPoint::buildReference(const vpImage<unsigned char> &I, std::vector<cv::KeyPoint> &trainKeyPoints, - std::vector<cv::Point3f> &points3f, bool append) { + std::vector<cv::Point3f> &points3f, const bool append, const int class_id) { cv::Mat trainDescriptors; - extract(I, trainKeyPoints, trainDescriptors, m_extractionTime); + //Copy the input list of keypoints + std::vector<cv::KeyPoint> trainKeyPoints_tmp = trainKeyPoints; - buildReference(I, trainKeyPoints, trainDescriptors, points3f, append); + extract(I, trainKeyPoints, trainDescriptors, m_extractionTime, &points3f); + + if(trainKeyPoints.size() != trainKeyPoints_tmp.size()) { + //Keypoints have been removed + //Store the hash of a keypoint as the key and the index of the keypoint as the value + std::map<size_t, size_t> mapOfKeypointHashes; + size_t cpt = 0; + for(std::vector<cv::KeyPoint>::const_iterator it = trainKeyPoints_tmp.begin(); it != trainKeyPoints_tmp.end(); ++it, cpt++) { + mapOfKeypointHashes[myKeypointHash(*it)] = cpt; + } + + std::vector<cv::Point3f> trainPoints_tmp; + for(std::vector<cv::KeyPoint>::const_iterator it = trainKeyPoints.begin(); it != trainKeyPoints.end(); ++it) { + if(mapOfKeypointHashes.find(myKeypointHash(*it)) != mapOfKeypointHashes.end()) { + trainPoints_tmp.push_back(points3f[mapOfKeypointHashes[myKeypointHash(*it)]]); + } + } + + //Copy trainPoints_tmp to points3f + points3f = trainPoints_tmp; + } + + buildReference(I, trainKeyPoints, trainDescriptors, points3f, append, class_id); } /*! @@ -383,9 +470,11 @@ void vpKeyPoint::buildReference(const vpImage<unsigned char> &I, std::vector<cv: \param points3f : List of the 3D position corresponding of the keypoints locations. \param trainDescriptors : List of the train descriptors. \param append : If true, append the supply train keypoints with those already present. + \param class_id : The class id to be set to the input cv::KeyPoint if != -1. */ void vpKeyPoint::buildReference(const vpImage<unsigned char> &I, const std::vector<cv::KeyPoint> &trainKeyPoints, - const cv::Mat &trainDescriptors, const std::vector<cv::Point3f> &points3f, bool append) { + const cv::Mat &trainDescriptors, const std::vector<cv::Point3f> &points3f, + const bool append, const int class_id) { if(!append) { m_currentImageId = 0; m_mapOfImageId.clear(); @@ -396,9 +485,17 @@ void vpKeyPoint::buildReference(const vpImage<unsigned char> &I, const std::vect m_currentImageId++; + std::vector<cv::KeyPoint> trainKeyPoints_tmp = trainKeyPoints; + //Set class_id if != -1 + if(class_id != -1) { + for(std::vector<cv::KeyPoint>::iterator it = trainKeyPoints_tmp.begin(); it != trainKeyPoints_tmp.end(); ++it) { + it->class_id = class_id; + } + } + //Save the correspondence keypoint class_id with the training image_id in a map //Used to display the matching with all the training images - for(std::vector<cv::KeyPoint>::const_iterator it = trainKeyPoints.begin(); it != trainKeyPoints.end(); ++it) { + for(std::vector<cv::KeyPoint>::const_iterator it = trainKeyPoints_tmp.begin(); it != trainKeyPoints_tmp.end(); ++it) { m_mapOfImageId[it->class_id] = m_currentImageId; } @@ -406,7 +503,7 @@ void vpKeyPoint::buildReference(const vpImage<unsigned char> &I, const std::vect m_mapOfImages[m_currentImageId] = I; //Append reference lists - this->m_trainKeyPoints.insert(this->m_trainKeyPoints.end(), trainKeyPoints.begin(), trainKeyPoints.end()); + this->m_trainKeyPoints.insert(this->m_trainKeyPoints.end(), trainKeyPoints_tmp.begin(), trainKeyPoints_tmp.end()); if(!append) { trainDescriptors.copyTo(this->m_trainDescriptors); } else { @@ -419,6 +516,10 @@ void vpKeyPoint::buildReference(const vpImage<unsigned char> &I, const std::vect vpConvert::convertFromOpenCV(this->m_trainKeyPoints, referenceImagePointsList); vpConvert::convertFromOpenCV(this->m_trainPoints, m_trainVpPoints); + //Add train descriptors in matcher object + m_matcher->clear(); + m_matcher->add(std::vector<cv::Mat>(1, m_trainDescriptors)); + _reference_computed = true; } @@ -512,32 +613,39 @@ void vpKeyPoint::compute3D(const vpImagePoint &candidate, const std::vector<vpPo \param descriptors : Optional parameter, pointer to the descriptors to filter */ void vpKeyPoint::compute3DForPointsInPolygons(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, - std::vector<cv::KeyPoint> &candidates, std::vector<vpPolygon> &polygons, std::vector<std::vector<vpPoint> > &roisPt, - std::vector<cv::Point3f> &points, cv::Mat *descriptors) { + std::vector<cv::KeyPoint> &candidates, const std::vector<vpPolygon> &polygons, + const std::vector<std::vector<vpPoint> > &roisPt, std::vector<cv::Point3f> &points, cv::Mat *descriptors) { - std::vector<cv::KeyPoint> candidateToCheck = candidates; + std::vector<cv::KeyPoint> candidatesToCheck = candidates; candidates.clear(); - vpImagePoint iPt; + points.clear(); + vpImagePoint imPt; cv::Point3f pt; cv::Mat desc; + std::vector<std::pair<cv::KeyPoint, size_t> > pairOfCandidatesToCheck(candidatesToCheck.size()); + for(size_t i = 0; i < candidatesToCheck.size(); i++) { + pairOfCandidatesToCheck[i] = std::pair<cv::KeyPoint, size_t>(candidatesToCheck[i], i); + } + size_t cpt1 = 0; - for (std::vector<vpPolygon>::iterator it1 = polygons.begin(); it1 != polygons.end(); ++it1, cpt1++) { - int cpt2 = 0; - - for (std::vector<cv::KeyPoint>::iterator it2 = candidateToCheck.begin(); it2 != candidateToCheck.end(); cpt2++) { - iPt.set_ij(it2->pt.y, it2->pt.x); - if (it1->isInside(iPt)) { - candidates.push_back(*it2); - vpKeyPoint::compute3D(*it2, roisPt[cpt1], cam, cMo, pt); + std::vector<vpPolygon> polygons_tmp = polygons; + for (std::vector<vpPolygon>::iterator it1 = polygons_tmp.begin(); it1 != polygons_tmp.end(); ++it1, cpt1++) { + std::vector<std::pair<cv::KeyPoint, size_t> >::iterator it2 = pairOfCandidatesToCheck.begin(); + + while(it2 != pairOfCandidatesToCheck.end()) { + imPt.set_ij(it2->first.pt.y, it2->first.pt.x); + if (it1->isInside(imPt)) { + candidates.push_back(it2->first); + vpKeyPoint::compute3D(it2->first, roisPt[cpt1], cam, cMo, pt); points.push_back(pt); if(descriptors != NULL) { - desc.push_back(descriptors->row(cpt2)); + desc.push_back(descriptors->row((int) it2->second)); } //Remove candidate keypoint which is located on the current polygon - candidateToCheck.erase(it2); + it2 = pairOfCandidatesToCheck.erase(it2); } else { ++it2; } @@ -563,30 +671,37 @@ void vpKeyPoint::compute3DForPointsInPolygons(const vpHomogeneousMatrix &cMo, co \param descriptors : Optional parameter, pointer to the descriptors to filter */ void vpKeyPoint::compute3DForPointsInPolygons(const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, - std::vector<vpImagePoint> &candidates, std::vector<vpPolygon> &polygons, std::vector<std::vector<vpPoint> > &roisPt, - std::vector<vpPoint> &points, cv::Mat *descriptors) { + std::vector<vpImagePoint> &candidates, const std::vector<vpPolygon> &polygons, + const std::vector<std::vector<vpPoint> > &roisPt, std::vector<vpPoint> &points, cv::Mat *descriptors) { - std::vector<vpImagePoint> candidateToCheck = candidates; + std::vector<vpImagePoint> candidatesToCheck = candidates; candidates.clear(); + points.clear(); vpPoint pt; cv::Mat desc; - size_t cpt1 = 0; - for (std::vector<vpPolygon>::iterator it1 = polygons.begin(); it1 != polygons.end(); ++it1, cpt1++) { - int cpt2 = 0; + std::vector<std::pair<vpImagePoint, size_t> > pairOfCandidatesToCheck(candidatesToCheck.size()); + for(size_t i = 0; i < candidatesToCheck.size(); i++) { + pairOfCandidatesToCheck[i] = std::pair<vpImagePoint, size_t>(candidatesToCheck[i], i); + } - for (std::vector<vpImagePoint>::iterator it2 = candidateToCheck.begin(); it2 != candidateToCheck.end(); cpt2++) { - if (it1->isInside(*it2)) { - candidates.push_back(*it2); - vpKeyPoint::compute3D(*it2, roisPt[cpt1], cam, cMo, pt); + size_t cpt1 = 0; + std::vector<vpPolygon> polygons_tmp = polygons; + for (std::vector<vpPolygon>::iterator it1 = polygons_tmp.begin(); it1 != polygons_tmp.end(); ++it1, cpt1++) { + std::vector<std::pair<vpImagePoint, size_t> >::iterator it2 = pairOfCandidatesToCheck.begin(); + + while(it2 != pairOfCandidatesToCheck.end()) { + if (it1->isInside(it2->first)) { + candidates.push_back(it2->first); + vpKeyPoint::compute3D(it2->first, roisPt[cpt1], cam, cMo, pt); points.push_back(pt); if(descriptors != NULL) { - desc.push_back(descriptors->row(cpt2)); + desc.push_back(descriptors->row((int) it2->second)); } //Remove candidate keypoint which is located on the current polygon - candidateToCheck.erase(it2); + it2 = pairOfCandidatesToCheck.erase(it2); } else { ++it2; } @@ -621,7 +736,14 @@ bool vpKeyPoint::computePose(const std::vector<cv::Point2f> &imagePoints, const cv::Mat cameraMatrix = (cv::Mat_<double>(3, 3) << cam.get_px(), 0, cam.get_u0(), 0, cam.get_py(), cam.get_v0(), 0, 0, 1); cv::Mat rvec, tvec; - cv::Mat distCoeffs; + + + //Bug with OpenCV < 2.4.0 when zero distorsion is provided by an empty array. + //http://code.opencv.org/issues/1700 ; http://code.opencv.org/issues/1718 + //what(): Distortion coefficients must be 1x4, 4x1, 1x5, 5x1, 1x8 or 8x1 floating-point vector in function cvProjectPoints2 + //Fixed in OpenCV 2.4.0 (r7558) +// cv::Mat distCoeffs; + cv::Mat distCoeffs = cv::Mat::zeros(1, 5, CV_64F); try { #if (VISP_HAVE_OPENCV_VERSION >= 0x030000) @@ -667,9 +789,8 @@ bool vpKeyPoint::computePose(const std::vector<cv::Point2f> &imagePoints, const cMo = vpHomogeneousMatrix(translationVec, thetaUVector); if(func != NULL) { - //Check the final pose returned by the Ransac VVS pose estimation as in rare some cases - //we can converge toward a final cMo that does not respect the pose criterion even - //if the 4 minimal points picked to respect the pose criterion. + //Check the final pose returned by solvePnPRansac to discard + //solutions which do not respect the pose criterion. if(!func(&cMo)) { elapsedTime = (vpTime::measureTimeMs() - t); return false; @@ -693,17 +814,35 @@ bool vpKeyPoint::computePose(const std::vector<cv::Point2f> &imagePoints, const */ bool vpKeyPoint::computePose(const std::vector<vpPoint> &objectVpPoints, vpHomogeneousMatrix &cMo, std::vector<vpPoint> &inliers, double &elapsedTime, bool (*func)(vpHomogeneousMatrix *)) { + std::vector<unsigned int> inlierIndex; + return computePose(objectVpPoints, cMo, inliers, inlierIndex, elapsedTime, func); +} + +/*! + Compute the pose using the correspondence between 2D points and 3D points using ViSP function with RANSAC method. + + \param objectVpPoints : List of vpPoint with coordinates expressed in the object and in the camera frame. + \param cMo : Homogeneous matrix between the object frame and the camera frame. + \param inliers : List of inlier points. + \param inlierIndex : List of inlier index. + \param elapsedTime : Elapsed time. + \return True if the pose has been computed, false otherwise (not enough points, or size list mismatch). + \param func : Function pointer to filter the pose in Ransac pose estimation, if we want to eliminate + the poses which do not respect some criterion + */ +bool vpKeyPoint::computePose(const std::vector<vpPoint> &objectVpPoints, vpHomogeneousMatrix &cMo, + std::vector<vpPoint> &inliers, std::vector<unsigned int> &inlierIndex, + double &elapsedTime, bool (*func)(vpHomogeneousMatrix *)) { double t = vpTime::measureTimeMs(); if(objectVpPoints.size() < 4) { elapsedTime = (vpTime::measureTimeMs() - t); - std::cerr << "Not enough points to compute the pose (at least 4 points are needed)." << std::endl; +// std::cerr << "Not enough points to compute the pose (at least 4 points are needed)." << std::endl; return false; } vpPose pose; - pose.setCovarianceComputation(true); for(std::vector<vpPoint>::const_iterator it = objectVpPoints.begin(); it != objectVpPoints.end(); ++it) { pose.addPoint(*it); @@ -724,6 +863,8 @@ bool vpKeyPoint::computePose(const std::vector<vpPoint> &objectVpPoints, vpHomog pose.setCovarianceComputation(m_computeCovariance); isRansacPoseEstimationOk = pose.computePose(vpPose::RANSAC, cMo, func); inliers = pose.getRansacInliers(); + inlierIndex = pose.getRansacInlierIndex(); + if(m_computeCovariance) { m_covarianceMatrix = pose.getCovarianceMatrix(); } @@ -733,15 +874,15 @@ bool vpKeyPoint::computePose(const std::vector<vpPoint> &objectVpPoints, vpHomog return false; } - if(func != NULL && isRansacPoseEstimationOk) { - //Check the final pose returned by the Ransac VVS pose estimation as in rare some cases - //we can converge toward a final cMo that does not respect the pose criterion even - //if the 4 minimal points picked to respect the pose criterion. - if(!func(&cMo)) { - elapsedTime = (vpTime::measureTimeMs() - t); - return false; - } - } +// if(func != NULL && isRansacPoseEstimationOk) { +// //Check the final pose returned by the Ransac VVS pose estimation as in rare some cases +// //we can converge toward a final cMo that does not respect the pose criterion even +// //if the 4 minimal points picked to respect the pose criterion. +// if(!func(&cMo)) { +// elapsedTime = (vpTime::measureTimeMs() - t); +// return false; +// } +// } elapsedTime = (vpTime::measureTimeMs() - t); return isRansacPoseEstimationOk; @@ -811,6 +952,7 @@ void vpKeyPoint::createImageMatching(vpImage<unsigned char> &ICurrent, vpImage<u unsigned int nbImg = (unsigned int) (m_mapOfImages.size() + 1); if(m_mapOfImages.empty()) { + std::cerr << "There is no training image loaded !" << std::endl; return; } @@ -819,9 +961,8 @@ void vpKeyPoint::createImageMatching(vpImage<unsigned char> &ICurrent, vpImage<u createImageMatching(m_mapOfImages.begin()->second, ICurrent, IMatching); } else { //Multiple training images, display them as a mosaic image - //round(std::sqrt((double) nbImg)); VC++ compiler does not have round so the next line is used - //Different implementations of round exist, here round to the closest integer but will not work for negative numbers - unsigned int nbImgSqrt = (unsigned int) std::floor(std::sqrt((double) nbImg) + 0.5); + //(unsigned int) std::floor(std::sqrt((double) nbImg) + 0.5); + unsigned int nbImgSqrt = (unsigned int) vpMath::round(std::sqrt((double) nbImg)); //Number of columns in the mosaic grid unsigned int nbWidth = nbImgSqrt; @@ -868,7 +1009,7 @@ void vpKeyPoint::detect(const vpImage<unsigned char> &I, std::vector<cv::KeyPoin (int) rectangle.getBottom()); cv::rectangle(mask, leftTop, rightBottom, cv::Scalar(255), CV_FILLED); } else { - mask = cv::Mat::ones(matImg.rows, matImg.cols, CV_8U); + mask = cv::Mat::ones(matImg.rows, matImg.cols, CV_8U) * 255; } detect(matImg, keyPoints, elapsedTime, mask); @@ -979,8 +1120,9 @@ void vpKeyPoint::displayMatching(const vpImage<unsigned char> &IRef, vpImage<uns */ void vpKeyPoint::displayMatching(const vpImage<unsigned char> &ICurrent, vpImage<unsigned char> &IMatching, const std::vector<vpImagePoint> &ransacInliers, unsigned int crossSize, unsigned int lineThickness) { - if(m_mapOfImages.empty()) { + if(m_mapOfImages.empty() || m_mapOfImageId.empty()) { //No training images so return + std::cerr << "There is no training image loaded !" << std::endl; return; } @@ -992,9 +1134,7 @@ void vpKeyPoint::displayMatching(const vpImage<unsigned char> &ICurrent, vpImage displayMatching(m_mapOfImages.begin()->second, IMatching, crossSize); } else { //Multiple training images, display them as a mosaic image - //round(std::sqrt((double) nbImg)); VC++ compiler does not have round so the next line is used - //Different implementations of round exist, here round to the closest integer but will not work for negative numbers - int nbImgSqrt = (int) std::floor(std::sqrt((double) nbImg) + 0.5); + int nbImgSqrt = vpMath::round(std::sqrt((double) nbImg)); //(int) std::floor(std::sqrt((double) nbImg) + 0.5); int nbWidth = nbImgSqrt; int nbHeight = nbImgSqrt; @@ -1050,29 +1190,30 @@ void vpKeyPoint::displayMatching(const vpImage<unsigned char> &ICurrent, vpImage it != ransacInliers.end(); ++it) { //Display green circle for RANSAC inliers vpDisplay::displayCircle(IMatching, (int) (it->get_v() + topLeftCorner.get_i()), (int) (it->get_u() + - topLeftCorner.get_j()), 4, vpColor::green); + topLeftCorner.get_j()), 4, vpColor::green); } for(std::vector<vpImagePoint>::const_iterator it = m_ransacOutliers.begin(); it != m_ransacOutliers.end(); ++it) { //Display red circle for RANSAC outliers vpDisplay::displayCircle(IMatching, (int) (it->get_i() + topLeftCorner.get_i()), (int) (it->get_j() + - topLeftCorner.get_j()), 4, vpColor::red); + topLeftCorner.get_j()), 4, vpColor::red); } - for(std::vector<std::pair<cv::KeyPoint, cv::KeyPoint> >::const_iterator it = m_matchQueryToTrainKeyPoints.begin(); - it != m_matchQueryToTrainKeyPoints.end(); ++it) { + for(std::vector<cv::DMatch>::const_iterator it = m_filteredMatches.begin(); it != m_filteredMatches.end(); ++it) { int current_class_id = 0; - if(mapOfImageIdIndex[m_mapOfImageId[it->second.class_id]] < medianIndex) { - current_class_id = mapOfImageIdIndex[m_mapOfImageId[it->second.class_id]]; + if(mapOfImageIdIndex[m_mapOfImageId[m_trainKeyPoints[(size_t) it->trainIdx].class_id]] < medianIndex) { + current_class_id = mapOfImageIdIndex[m_mapOfImageId[m_trainKeyPoints[(size_t) it->trainIdx].class_id]]; } else { //Shift of one unity the index of the training images which are after the current image - current_class_id = mapOfImageIdIndex[m_mapOfImageId[it->second.class_id]] + 1; + current_class_id = mapOfImageIdIndex[m_mapOfImageId[m_trainKeyPoints[(size_t) it->trainIdx].class_id]] + 1; } int indexI = current_class_id / nbWidth; int indexJ = current_class_id - (indexI * nbWidth); - vpImagePoint end((int)maxH*indexI + it->second.pt.y, (int)maxW*indexJ + it->second.pt.x); - vpImagePoint start((int)maxH*medianI + it->first.pt.y, (int)maxW*medianJ + it->first.pt.x); + vpImagePoint end((int)maxH*indexI + m_trainKeyPoints[(size_t) it->trainIdx].pt.y, + (int)maxW*indexJ + m_trainKeyPoints[(size_t) it->trainIdx].pt.x); + vpImagePoint start((int)maxH*medianI + m_queryFilteredKeyPoints[(size_t) it->queryIdx].pt.y, + (int)maxW*medianJ + m_queryFilteredKeyPoints[(size_t) it->queryIdx].pt.x); //Draw line for matching keypoints detected in the current image and those detected //in the training images @@ -1088,12 +1229,14 @@ void vpKeyPoint::displayMatching(const vpImage<unsigned char> &ICurrent, vpImage \param keyPoints : List of keypoints we want to extract their descriptors. \param descriptors : Descriptors matrix with at each row the descriptors values for each keypoint. \param elapsedTime : Elapsed time. + \param trainPoints : Pointer to the list of 3D train points, when a keypoint cannot be extracted, we need to remove + the corresponding 3D point. */ void vpKeyPoint::extract(const vpImage<unsigned char> &I, std::vector<cv::KeyPoint> &keyPoints, cv::Mat &descriptors, - double &elapsedTime) { + double &elapsedTime, std::vector<cv::Point3f> *trainPoints) { cv::Mat matImg; vpImageConvert::convert(I, matImg, false); - extract(matImg, keyPoints, descriptors, elapsedTime); + extract(matImg, keyPoints, descriptors, elapsedTime, trainPoints); } /*! @@ -1103,20 +1246,89 @@ void vpKeyPoint::extract(const vpImage<unsigned char> &I, std::vector<cv::KeyPoi \param keyPoints : List of keypoints we want to extract their descriptors. \param descriptors : Descriptors matrix with at each row the descriptors values for each keypoint. \param elapsedTime : Elapsed time. + \param trainPoints : Pointer to the list of 3D train points, when a keypoint cannot be extracted, we need to remove + the corresponding 3D point. */ void vpKeyPoint::extract(const cv::Mat &matImg, std::vector<cv::KeyPoint> &keyPoints, cv::Mat &descriptors, - double &elapsedTime) { + double &elapsedTime, std::vector<cv::Point3f> *trainPoints) { double t = vpTime::measureTimeMs(); bool first = true; - for(std::map<std::string, cv::Ptr<cv::DescriptorExtractor> >::const_iterator it = m_extractors.begin(); - it != m_extractors.end(); ++it) { + for(std::map<std::string, cv::Ptr<cv::DescriptorExtractor> >::const_iterator itd = m_extractors.begin(); + itd != m_extractors.end(); ++itd) { if(first) { first = false; - it->second->compute(matImg, keyPoints, descriptors); + //Check if we have 3D object points information + if(trainPoints != NULL && !trainPoints->empty()) { + //Copy the input list of keypoints, keypoints that cannot be computed are removed in the function compute + std::vector<cv::KeyPoint> keyPoints_tmp = keyPoints; + + //Extract descriptors for the given list of keypoints + itd->second->compute(matImg, keyPoints, descriptors); + + if(keyPoints.size() != keyPoints_tmp.size()) { + //Keypoints have been removed + //Store the hash of a keypoint as the key and the index of the keypoint as the value + std::map<size_t, size_t> mapOfKeypointHashes; + size_t cpt = 0; + for(std::vector<cv::KeyPoint>::const_iterator it = keyPoints_tmp.begin(); it != keyPoints_tmp.end(); ++it, cpt++) { + mapOfKeypointHashes[myKeypointHash(*it)] = cpt; + } + + std::vector<cv::Point3f> trainPoints_tmp; + for(std::vector<cv::KeyPoint>::const_iterator it = keyPoints.begin(); it != keyPoints.end(); ++it) { + if(mapOfKeypointHashes.find(myKeypointHash(*it)) != mapOfKeypointHashes.end()) { + trainPoints_tmp.push_back((*trainPoints)[mapOfKeypointHashes[myKeypointHash(*it)]]); + } + } + + //Copy trainPoints_tmp to m_trainPoints + *trainPoints = trainPoints_tmp; + } + } else { + //Extract descriptors for the given list of keypoints + itd->second->compute(matImg, keyPoints, descriptors); + } } else { + //Copy the input list of keypoints, keypoints that cannot be computed are removed in the function compute + std::vector<cv::KeyPoint> keyPoints_tmp = keyPoints; + cv::Mat desc; - it->second->compute(matImg, keyPoints, desc); + //Extract descriptors for the given list of keypoints + itd->second->compute(matImg, keyPoints, desc); + + if(keyPoints.size() != keyPoints_tmp.size()) { + //Keypoints have been removed + //Store the hash of a keypoint as the key and the index of the keypoint as the value + std::map<size_t, size_t> mapOfKeypointHashes; + size_t cpt = 0; + for(std::vector<cv::KeyPoint>::const_iterator it = keyPoints_tmp.begin(); it != keyPoints_tmp.end(); ++it, cpt++) { + mapOfKeypointHashes[myKeypointHash(*it)] = cpt; + } + + std::vector<cv::Point3f> trainPoints_tmp; + cv::Mat descriptors_tmp; + for(std::vector<cv::KeyPoint>::const_iterator it = keyPoints.begin(); it != keyPoints.end(); ++it) { + if(mapOfKeypointHashes.find(myKeypointHash(*it)) != mapOfKeypointHashes.end()) { + if(trainPoints != NULL && !trainPoints->empty()) { + trainPoints_tmp.push_back((*trainPoints)[mapOfKeypointHashes[myKeypointHash(*it)]]); + } + + if(!descriptors.empty()) { + descriptors_tmp.push_back(descriptors.row((int) mapOfKeypointHashes[myKeypointHash(*it)])); + } + } + } + + if(trainPoints != NULL) { + //Copy trainPoints_tmp to m_trainPoints + *trainPoints = trainPoints_tmp; + } + //Copy descriptors_tmp to descriptors + descriptors_tmp.copyTo(descriptors); + } + + //Merge descriptors horizontally if(descriptors.empty()) { desc.copyTo(descriptors); } else { @@ -1135,8 +1347,6 @@ void vpKeyPoint::extract(const cv::Mat &matImg, std::vector<cv::KeyPoint> &keyPo Filter the matches using the desired filtering method. */ void vpKeyPoint::filterMatches() { - m_matchQueryToTrainKeyPoints.clear(); - std::vector<cv::KeyPoint> queryKpts; std::vector<cv::Point3f> trainPts; std::vector<cv::DMatch> m; @@ -1183,17 +1393,13 @@ void vpKeyPoint::filterMatches() { trainPts.push_back(m_trainPoints[(size_t)m_knnMatches[i][0].trainIdx]); } queryKpts.push_back(m_queryKeyPoints[(size_t)m_knnMatches[i][0].queryIdx]); - -// //Add the pair with the correspondence between the detected keypoints and the one matched in the train keypoints list -// m_matchQueryToTrainKeyPoints.push_back(std::pair<cv::KeyPoint, cv::KeyPoint>( -// m_queryKeyPoints[(size_t)m_knnMatches[i][0].queryIdx], -// m_trainKeyPoints[(size_t)m_knnMatches[i][0].trainIdx])); } } } } else { double max_dist = 0; - //double min_dist = std::numeric_limits<double>::max(); // create an error under Windows. To fix it we have to add #undef max + // create an error under Windows. To fix it we have to add #undef max + //double min_dist = std::numeric_limits<double>::max(); double min_dist = DBL_MAX; double mean = 0.0; std::vector<double> distance_vec(m_matches.size()); @@ -1227,45 +1433,42 @@ void vpKeyPoint::filterMatches() { trainPts.push_back(m_trainPoints[(size_t)m_matches[i].trainIdx]); } queryKpts.push_back(m_queryKeyPoints[(size_t)m_matches[i].queryIdx]); - -// //Add the pair with the correspondence between the detected keypoints and the one matched in the train keypoints list -// m_matchQueryToTrainKeyPoints.push_back(std::pair<cv::KeyPoint, cv::KeyPoint>( -// m_queryKeyPoints[(size_t)m_matches[i].queryIdx], m_trainKeyPoints[(size_t)m_matches[i].trainIdx])); } } } - //Eliminate matches where multiple query keypoints are matched to the same train keypoint - std::vector<cv::DMatch> mTmp; - std::vector<cv::Point3f> trainPtsTmp; - std::vector<cv::KeyPoint> queryKptsTmp; + if(m_useSingleMatchFilter) { + //Eliminate matches where multiple query keypoints are matched to the same train keypoint + std::vector<cv::DMatch> mTmp; + std::vector<cv::Point3f> trainPtsTmp; + std::vector<cv::KeyPoint> queryKptsTmp; - std::map<int, int> mapOfTrainIdx; - //Count the number of query points matched to the same train point - for(std::vector<cv::DMatch>::const_iterator it = m.begin(); it != m.end(); ++it) { - mapOfTrainIdx[it->trainIdx]++; - } + std::map<int, int> mapOfTrainIdx; + //Count the number of query points matched to the same train point + for(std::vector<cv::DMatch>::const_iterator it = m.begin(); it != m.end(); ++it) { + mapOfTrainIdx[it->trainIdx]++; + } - //Keep matches with only one correspondence - for(std::vector<cv::DMatch>::const_iterator it = m.begin(); it != m.end(); ++it) { - if(mapOfTrainIdx[it->trainIdx] == 1) { - mTmp.push_back(cv::DMatch((int) queryKptsTmp.size(), it->trainIdx, it->distance)); + //Keep matches with only one correspondence + for(std::vector<cv::DMatch>::const_iterator it = m.begin(); it != m.end(); ++it) { + if(mapOfTrainIdx[it->trainIdx] == 1) { + mTmp.push_back(cv::DMatch((int) queryKptsTmp.size(), it->trainIdx, it->distance)); - if(!m_trainPoints.empty()) { - trainPtsTmp.push_back(m_trainPoints[(size_t) it->trainIdx]); + if(!m_trainPoints.empty()) { + trainPtsTmp.push_back(m_trainPoints[(size_t) it->trainIdx]); + } + queryKptsTmp.push_back(queryKpts[(size_t) it->queryIdx]); } - queryKptsTmp.push_back(queryKpts[(size_t) it->queryIdx]); - - //Add the pair with the correspondence between the detected keypoints and the one matched in the train keypoints list - m_matchQueryToTrainKeyPoints.push_back(std::pair<cv::KeyPoint, cv::KeyPoint>( - queryKpts[(size_t) it->queryIdx], - m_trainKeyPoints[(size_t) it->trainIdx])); } - } - m_filteredMatches = mTmp; - m_objectFilteredPoints = trainPtsTmp; - m_queryFilteredKeyPoints = queryKptsTmp; + m_filteredMatches = mTmp; + m_objectFilteredPoints = trainPtsTmp; + m_queryFilteredKeyPoints = queryKptsTmp; + } else { + m_filteredMatches = m; + m_objectFilteredPoints = trainPts; + m_queryFilteredKeyPoints = queryKpts; + } } /*! @@ -1346,7 +1549,8 @@ void vpKeyPoint::getTrainPoints(std::vector<vpPoint> &points) const { Initialize method for RANSAC parameters and for detectors, extractors and matcher, and for others parameters. */ void vpKeyPoint::init() { -#if defined(VISP_HAVE_OPENCV_NONFREE) && (VISP_HAVE_OPENCV_VERSION >= 0x020400) && (VISP_HAVE_OPENCV_VERSION < 0x030000) // Require 2.4.0 <= opencv < 3.0.0 + // Require 2.4.0 <= opencv < 3.0.0 +#if defined(VISP_HAVE_OPENCV_NONFREE) && (VISP_HAVE_OPENCV_VERSION >= 0x020400) && (VISP_HAVE_OPENCV_VERSION < 0x030000) //The following line must be called in order to use SIFT or SURF if (!cv::initModule_nonfree()) { std::cerr << "Cannot init module non free, SIFT or SURF cannot be used." @@ -1365,17 +1569,6 @@ void vpKeyPoint::init() { \param detectorName : Name of the detector (e.g FAST, SIFT, SURF, etc.). */ void vpKeyPoint::initDetector(const std::string &detectorName) { - // TODO: Add function to process detection in pyramid images with OpenCV 3.0.0 - // since there seems to have no equivalent function (2014/12/11) - // std::string pyramid = "Pyramid"; - // std::size_t pos = detectorName.find(pyramid); - // if(pos != std::string::npos) { - // std::string sub = detectorName.substr(pos + pyramid.size()); - // detectors[detectorName] = cv::Ptr<cv::FeatureDetector>( - // new cv::PyramidAdaptedFeatureDetector(cv::FeatureDetector::create<cv::FeatureDetector>(sub), 2)); - // } else { - // detectors[detectorName] = cv::FeatureDetector::create<cv::FeatureDetector>(detectorName); - // } #if (VISP_HAVE_OPENCV_VERSION < 0x030000) m_detectors[detectorName] = cv::FeatureDetector::create(detectorName); @@ -1386,17 +1579,24 @@ void vpKeyPoint::initDetector(const std::string &detectorName) { throw vpException(vpException::fatalError, ss_msg.str()); } #else - //TODO: Add a pyramidal feature detection std::string detectorNameTmp = detectorName; std::string pyramid = "Pyramid"; std::size_t pos = detectorName.find(pyramid); + bool usePyramid = false; if(pos != std::string::npos) { detectorNameTmp = detectorName.substr(pos + pyramid.size()); + usePyramid = true; } if(detectorNameTmp == "SIFT") { #ifdef VISP_HAVE_OPENCV_XFEATURES2D - m_detectors[detectorNameTmp] = cv::xfeatures2d::SIFT::create(); + cv::Ptr<cv::FeatureDetector> siftDetector = cv::xfeatures2d::SIFT::create(); + if(!usePyramid) { + m_detectors[detectorNameTmp] = siftDetector; + } else { + std::cerr << "Kind of non sense to use SIFT with Pyramid !" << std::endl; + m_detectors[detectorName] = cv::makePtr<PyramidAdaptedFeatureDetector>(siftDetector); + } #else std::stringstream ss_msg; ss_msg << "Fail to initialize the detector: SIFT. OpenCV version " @@ -1405,7 +1605,13 @@ void vpKeyPoint::initDetector(const std::string &detectorName) { #endif } else if(detectorNameTmp == "SURF") { #ifdef VISP_HAVE_OPENCV_XFEATURES2D - m_detectors[detectorNameTmp] = cv::xfeatures2d::SURF::create(); + cv::Ptr<cv::FeatureDetector> surfDetector = cv::xfeatures2d::SURF::create(); + if(!usePyramid) { + m_detectors[detectorNameTmp] = surfDetector; + } else { + std::cerr << "Kind of non sense to use SURF with Pyramid !" << std::endl; + m_detectors[detectorName] = cv::makePtr<PyramidAdaptedFeatureDetector>(surfDetector); + } #else std::stringstream ss_msg; ss_msg << "Fail to initialize the detector: SURF. OpenCV version " @@ -1413,41 +1619,109 @@ void vpKeyPoint::initDetector(const std::string &detectorName) { throw vpException(vpException::fatalError, ss_msg.str()); #endif } else if(detectorNameTmp == "FAST") { - m_detectors[detectorNameTmp] = cv::FastFeatureDetector::create(); + cv::Ptr<cv::FeatureDetector> fastDetector = cv::FastFeatureDetector::create(); + if(!usePyramid) { + m_detectors[detectorNameTmp] = fastDetector; + } else { +// m_detectors[detectorName] = new PyramidAdaptedFeatureDetector(cv::FastFeatureDetector::create()); + m_detectors[detectorName] = cv::makePtr<PyramidAdaptedFeatureDetector>(fastDetector); + } } else if(detectorNameTmp == "MSER") { - m_detectors[detectorNameTmp] = cv::MSER::create(); + cv::Ptr<cv::FeatureDetector> fastDetector = cv::MSER::create(); + if(!usePyramid) { + m_detectors[detectorNameTmp] = fastDetector; + } else { +// m_detectors[detectorName] = new PyramidAdaptedFeatureDetector(cv::MSER::create()); + m_detectors[detectorName] = cv::makePtr<PyramidAdaptedFeatureDetector>(fastDetector); + } } else if(detectorNameTmp == "ORB") { - m_detectors[detectorNameTmp] = cv::ORB::create(); + cv::Ptr<cv::FeatureDetector> orbDetector = cv::ORB::create(); + if(!usePyramid) { + m_detectors[detectorNameTmp] = orbDetector; + } else { + std::cerr << "Kind of non sense to use ORB with Pyramid !" << std::endl; + m_detectors[detectorName] = cv::makePtr<PyramidAdaptedFeatureDetector>(orbDetector); + } } else if(detectorNameTmp == "BRISK") { - m_detectors[detectorNameTmp] = cv::BRISK::create(); + cv::Ptr<cv::FeatureDetector> briskDetector = cv::BRISK::create(); + if(!usePyramid) { + m_detectors[detectorNameTmp] = briskDetector; + } else { + std::cerr << "Kind of non sense to use BRISK with Pyramid !" << std::endl; + m_detectors[detectorName] = cv::makePtr<PyramidAdaptedFeatureDetector>(briskDetector); + } } else if(detectorNameTmp == "KAZE") { - m_detectors[detectorNameTmp] = cv::KAZE::create(); + cv::Ptr<cv::FeatureDetector> kazeDetector = cv::KAZE::create(); + if(!usePyramid) { + m_detectors[detectorNameTmp] = kazeDetector; + } else { + std::cerr << "Kind of non sense to use KAZE with Pyramid !" << std::endl; + m_detectors[detectorName] = cv::makePtr<PyramidAdaptedFeatureDetector>(kazeDetector); + } } else if(detectorNameTmp == "AKAZE") { - m_detectors[detectorNameTmp] = cv::AKAZE::create(); - } else if(detectorNameTmp == "GFFT") { - m_detectors[detectorNameTmp] = cv::GFTTDetector::create(); + cv::Ptr<cv::FeatureDetector> akazeDetector = cv::AKAZE::create(); + if(!usePyramid) { + m_detectors[detectorNameTmp] = akazeDetector; + } else { + std::cerr << "Kind of non sense to use AKAZE with Pyramid !" << std::endl; + m_detectors[detectorName] = cv::makePtr<PyramidAdaptedFeatureDetector>(akazeDetector); + } + } else if(detectorNameTmp == "GFTT") { + cv::Ptr<cv::FeatureDetector> gfttDetector = cv::GFTTDetector::create(); + if(!usePyramid) { + m_detectors[detectorNameTmp] = gfttDetector; + } else { +// m_detectors[detectorName] = new PyramidAdaptedFeatureDetector(cv::GFTTDetector::create()); + m_detectors[detectorName] = cv::makePtr<PyramidAdaptedFeatureDetector>(gfttDetector); + } } else if(detectorNameTmp == "SimpleBlob") { - m_detectors[detectorNameTmp] = cv::SimpleBlobDetector::create(); + cv::Ptr<cv::FeatureDetector> simpleBlobDetector = cv::SimpleBlobDetector::create(); + if(!usePyramid) { + m_detectors[detectorNameTmp] = simpleBlobDetector; + } else { +// m_detectors[detectorName] = new PyramidAdaptedFeatureDetector(cv::SimpleBlobDetector::create()); + m_detectors[detectorName] = cv::makePtr<PyramidAdaptedFeatureDetector>(simpleBlobDetector); + } } else if(detectorNameTmp == "STAR") { #ifdef VISP_HAVE_OPENCV_XFEATURES2D - m_detectors[detectorNameTmp] = cv::xfeatures2d::StarDetector::create(); + cv::Ptr<cv::FeatureDetector> starDetector = cv::xfeatures2d::StarDetector::create(); + if(!usePyramid) { + m_detectors[detectorNameTmp] = starDetector; + } else { +// m_detectors[detectorName] = new PyramidAdaptedFeatureDetector(cv::xfeatures2d::StarDetector::create()); + m_detectors[detectorName] = cv::makePtr<PyramidAdaptedFeatureDetector>(starDetector); + } #else std::stringstream ss_msg; ss_msg << "Fail to initialize the detector: STAR. OpenCV version " << std::hex << VISP_HAVE_OPENCV_VERSION << " was not build with xFeatures2d module."; throw vpException(vpException::fatalError, ss_msg.str()); #endif + } else if(detectorNameTmp == "AGAST") { + cv::Ptr<cv::FeatureDetector> agastDetector = cv::AgastFeatureDetector::create(); + if(!usePyramid) { + m_detectors[detectorNameTmp] = agastDetector; + } else { + m_detectors[detectorName] = cv::makePtr<PyramidAdaptedFeatureDetector>(agastDetector); + } } else { std::cerr << "The detector:" << detectorNameTmp << " is not available." << std::endl; } - if(m_detectors[detectorNameTmp] == NULL) { + bool detectorInitialized = false; + if(!usePyramid) { + detectorInitialized = (m_detectors[detectorNameTmp] != NULL); + } else { + detectorInitialized = (m_detectors[detectorName] != NULL); + } + + if(!detectorInitialized) { std::stringstream ss_msg; ss_msg << "Fail to initialize the detector: " << detectorNameTmp << " or it is not available in OpenCV version: " << std::hex << VISP_HAVE_OPENCV_VERSION << "."; throw vpException(vpException::fatalError, ss_msg.str()); } -// m_detectors[detectorName] = cv::FeatureDetector::create<cv::FeatureDetector>(detectorName); + #endif } @@ -1482,7 +1756,8 @@ void vpKeyPoint::initExtractor(const std::string &extractorName) { #endif } else if(extractorName == "SURF") { #ifdef VISP_HAVE_OPENCV_XFEATURES2D - m_extractors[extractorName] = cv::xfeatures2d::SURF::create(); + //Use extended set of SURF descriptors (128 instead of 64) + m_extractors[extractorName] = cv::xfeatures2d::SURF::create(100, 4, 3, true); #else std::stringstream ss_msg; ss_msg << "Fail to initialize the extractor: SURF. OpenCV version " @@ -1510,11 +1785,41 @@ void vpKeyPoint::initExtractor(const std::string &extractorName) { ss_msg << "Fail to initialize the extractor: BRIEF. OpenCV version " << std::hex << VISP_HAVE_OPENCV_VERSION << " was not build with xFeatures2d module."; throw vpException(vpException::fatalError, ss_msg.str()); +#endif + } else if(extractorName == "KAZE") { + m_extractors[extractorName] = cv::KAZE::create(); + } else if(extractorName == "AKAZE") { + m_extractors[extractorName] = cv::AKAZE::create(); + } else if(extractorName == "DAISY") { +#ifdef VISP_HAVE_OPENCV_XFEATURES2D + m_extractors[extractorName] = cv::xfeatures2d::DAISY::create(); +#else + std::stringstream ss_msg; + ss_msg << "Fail to initialize the extractor: DAISY. OpenCV version " + << std::hex << VISP_HAVE_OPENCV_VERSION << " was not build with xFeatures2d module."; + throw vpException(vpException::fatalError, ss_msg.str()); +#endif + } else if(extractorName == "LATCH") { +#ifdef VISP_HAVE_OPENCV_XFEATURES2D + m_extractors[extractorName] = cv::xfeatures2d::LATCH::create(); +#else + std::stringstream ss_msg; + ss_msg << "Fail to initialize the extractor: LATCH. OpenCV version " + << std::hex << VISP_HAVE_OPENCV_VERSION << " was not build with xFeatures2d module."; + throw vpException(vpException::fatalError, ss_msg.str()); +#endif + } else if(extractorName == "LUCID") { +#ifdef VISP_HAVE_OPENCV_XFEATURES2D + m_extractors[extractorName] = cv::xfeatures2d::LUCID::create(1, 2); +#else + std::stringstream ss_msg; + ss_msg << "Fail to initialize the extractor: LUCID. OpenCV version " + << std::hex << VISP_HAVE_OPENCV_VERSION << " was not build with xFeatures2d module."; + throw vpException(vpException::fatalError, ss_msg.str()); #endif } else { std::cerr << "The extractor:" << extractorName << " is not available." << std::endl; } -// m_extractors[extractorName] = cv::DescriptorExtractor::create<cv::DescriptorExtractor>(extractorName); #endif if(m_extractors[extractorName] == NULL) { @@ -1523,6 +1828,13 @@ void vpKeyPoint::initExtractor(const std::string &extractorName) { << std::hex << VISP_HAVE_OPENCV_VERSION << "."; throw vpException(vpException::fatalError, ss_msg.str()); } + +#if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000) + if(extractorName == "SURF") { + //Use extended set of SURF descriptors (128 instead of 64) + m_extractors[extractorName]->set("extended", 1); + } +#endif } /*! @@ -1534,6 +1846,20 @@ void vpKeyPoint::initExtractors(const std::vector<std::string> &extractorNames) for(std::vector<std::string>::const_iterator it = extractorNames.begin(); it != extractorNames.end(); ++it) { initExtractor(*it); } + + int descriptorType = CV_32F; + bool firstIteration = true; + for(std::map<std::string, cv::Ptr<cv::DescriptorExtractor> >::const_iterator it = m_extractors.begin(); + it != m_extractors.end(); ++it) { + if(firstIteration) { + firstIteration = false; + descriptorType = it->second->descriptorType(); + } else { + if(descriptorType != it->second->descriptorType()) { + throw vpException(vpException::fatalError, "All the descriptors must have the same type !"); + } + } + } } /*! @@ -1542,9 +1868,44 @@ void vpKeyPoint::initExtractors(const std::vector<std::string> &extractorNames) \param matcherName : Name of the matcher (e.g BruteForce, FlannBased). */ void vpKeyPoint::initMatcher(const std::string &matcherName) { - m_matcher = cv::DescriptorMatcher::create(matcherName); + int descriptorType = CV_32F; + bool firstIteration = true; + for(std::map<std::string, cv::Ptr<cv::DescriptorExtractor> >::const_iterator it = m_extractors.begin(); + it != m_extractors.end(); ++it) { + if(firstIteration) { + firstIteration = false; + descriptorType = it->second->descriptorType(); + } else { + if(descriptorType != it->second->descriptorType()) { + throw vpException(vpException::fatalError, "All the descriptors must have the same type !"); + } + } + } -#if (VISP_HAVE_OPENCV_VERSION >= 0x020400) + if(matcherName == "FlannBased") { + if(m_extractors.empty()) { + std::cout << "Warning: No extractor initialized, by default use floating values (CV_32F) " + "for descriptor type !" << std::endl; + } + + if(descriptorType == CV_8U) { +#if (VISP_HAVE_OPENCV_VERSION >= 0x030000) + m_matcher = cv::makePtr<cv::FlannBasedMatcher>(cv::makePtr<cv::flann::LshIndexParams>(12, 20, 2)); +#else + m_matcher = new cv::FlannBasedMatcher(new cv::flann::LshIndexParams(12, 20, 2)); +#endif + } else { +#if (VISP_HAVE_OPENCV_VERSION >= 0x030000) + m_matcher = cv::makePtr<cv::FlannBasedMatcher>(cv::makePtr<cv::flann::KDTreeIndexParams>()); +#else + m_matcher = new cv::FlannBasedMatcher(new cv::flann::KDTreeIndexParams()); +#endif + } + } else { + m_matcher = cv::DescriptorMatcher::create(matcherName); + } + +#if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000) if(m_matcher != NULL && !m_useKnn && matcherName == "BruteForce") { m_matcher->set("crossCheck", m_useBruteForceCrossCheck); } @@ -1585,14 +1946,17 @@ void vpKeyPoint::insertImageMatching(const vpImage<unsigned char> &ICurrent, vpI //Nb images in the training database + the current image we want to detect the object int nbImg = (int) (m_mapOfImages.size() + 1); + if(m_mapOfImages.empty()) { + std::cerr << "There is no training image loaded !" << std::endl; + return; + } + if(nbImg == 2) { //Only one training image, so we display them side by side insertImageMatching(m_mapOfImages.begin()->second, ICurrent, IMatching); } else { //Multiple training images, display them as a mosaic image - //round(std::sqrt((double) nbImg)); VC++ compiler does not have round so the next line is used - //Different implementations of round exist, here round to the closest integer but will not work for negative numbers - int nbImgSqrt = (int) std::floor(std::sqrt((double) nbImg) + 0.5); + int nbImgSqrt = vpMath::round(std::sqrt((double) nbImg)); //(int) std::floor(std::sqrt((double) nbImg) + 0.5); int nbWidth = nbImgSqrt; int nbHeight = nbImgSqrt; @@ -1755,6 +2119,13 @@ void vpKeyPoint::loadLearningData(const std::string &filename, const bool binary int nbImgs = 0; file.read((char *)(&nbImgs), sizeof(nbImgs)); +#if !defined(VISP_HAVE_MODULE_IO) + if(nbImgs > 0) { + std::cout << "Warning: The learning file contains image data that will not be loaded as visp_io module " + "is not available !" << std::endl; + } +#endif + for(int i = 0; i < nbImgs; i++) { //Read image_id int id = 0; @@ -1773,13 +2144,19 @@ void vpKeyPoint::loadLearningData(const std::string &filename, const bool binary path[length] = '\0'; vpImage<unsigned char> I; +#ifdef VISP_HAVE_MODULE_IO if(vpIoTools::isAbsolutePathname(std::string(path))) { vpImageIo::read(I, path); } else { vpImageIo::read(I, parent + path); } + //Add the image previously loaded only if VISP_HAVE_MODULE_IO m_mapOfImages[id + startImageId] = I; +#endif + + //Delete path + delete[] path; } //Read if 3D point information are saved or not @@ -1816,8 +2193,10 @@ void vpKeyPoint::loadLearningData(const std::string &filename, const bool binary m_trainKeyPoints.push_back(keyPoint); if(image_id != -1) { +#ifdef VISP_HAVE_MODULE_IO //No training images if image_id == -1 m_mapOfImageId[class_id] = image_id + startImageId; +#endif } if(have3DInfo) { @@ -1949,9 +2328,15 @@ void vpKeyPoint::loadLearningData(const std::string &filename, const bool binary if(name == "trainImg") { //Read image_id - int id = std::atoi((char *) xmlGetProp(image_info_node, BAD_CAST "image_id")); + xmlChar *image_id_property = xmlGetProp(image_info_node, BAD_CAST "image_id"); + int id = 0; + if(image_id_property) { + id = std::atoi((char *) image_id_property); + } + xmlFree(image_id_property); vpImage<unsigned char> I; +#ifdef VISP_HAVE_MODULE_IO std::string path((char *) image_info_node->children->content); //Read path to the training images if(vpIoTools::isAbsolutePathname(std::string(path))) { @@ -1960,7 +2345,9 @@ void vpKeyPoint::loadLearningData(const std::string &filename, const bool binary vpImageIo::read(I, parent + path); } + //Add the image previously loaded only if VISP_HAVE_MODULE_IO m_mapOfImages[id + startImageId] = I; +#endif } } } else if(first_level_node->type == XML_ELEMENT_NODE && name == "DescriptorsInfo") { @@ -2015,8 +2402,10 @@ void vpKeyPoint::loadLearningData(const std::string &filename, const bool binary } else if(name == "image_id") { image_id = std::atoi((char *) point_node->children->content); if(image_id != -1) { +#ifdef VISP_HAVE_MODULE_IO //No training images if image_id == -1 m_mapOfImageId[m_trainKeyPoints.back().class_id] = image_id + startImageId; +#endif } } else if (name == "oX") { oX = std::atof((char *) point_node->children->content); @@ -2118,6 +2507,10 @@ void vpKeyPoint::loadLearningData(const std::string &filename, const bool binary vpConvert::convertFromOpenCV(m_trainKeyPoints, referenceImagePointsList); vpConvert::convertFromOpenCV(this->m_trainPoints, m_trainVpPoints); + //Add train descriptors in matcher object + m_matcher->clear(); + m_matcher->add(std::vector<cv::Mat>(1, m_trainDescriptors)); + //Set _reference_computed to true as we load learning file _reference_computed = true; } @@ -2136,12 +2529,46 @@ void vpKeyPoint::match(const cv::Mat &trainDescriptors, const cv::Mat &queryDesc if(m_useKnn) { m_knnMatches.clear(); - m_matcher->knnMatch(queryDescriptors, trainDescriptors, m_knnMatches, 2); - matches.resize(m_knnMatches.size()); - std::transform(m_knnMatches.begin(), m_knnMatches.end(), matches.begin(), knnToDMatch); + + if(m_useMatchTrainToQuery) { + std::vector<std::vector<cv::DMatch> > knnMatchesTmp; + + //Match train descriptors to query descriptors + cv::Ptr<cv::DescriptorMatcher> matcherTmp = m_matcher->clone(true); + matcherTmp->knnMatch(trainDescriptors, queryDescriptors, knnMatchesTmp, 2); + + for(std::vector<std::vector<cv::DMatch> >::const_iterator it1 = knnMatchesTmp.begin(); it1 != knnMatchesTmp.end(); ++it1) { + std::vector<cv::DMatch> tmp; + for(std::vector<cv::DMatch>::const_iterator it2 = it1->begin(); it2 != it1->end(); ++it2) { + tmp.push_back(cv::DMatch(it2->trainIdx, it2->queryIdx, it2->distance)); + } + m_knnMatches.push_back(tmp); + } + + matches.resize(m_knnMatches.size()); + std::transform(m_knnMatches.begin(), m_knnMatches.end(), matches.begin(), knnToDMatch); + } else { + //Match query descriptors to train descriptors + m_matcher->knnMatch(queryDescriptors, m_knnMatches, 2); + matches.resize(m_knnMatches.size()); + std::transform(m_knnMatches.begin(), m_knnMatches.end(), matches.begin(), knnToDMatch); + } } else { matches.clear(); - m_matcher->match(queryDescriptors, trainDescriptors, matches); + + if(m_useMatchTrainToQuery) { + std::vector<cv::DMatch> matchesTmp; + //Match train descriptors to query descriptors + cv::Ptr<cv::DescriptorMatcher> matcherTmp = m_matcher->clone(true); + matcherTmp->match(trainDescriptors, queryDescriptors, matchesTmp); + + for(std::vector<cv::DMatch>::const_iterator it = matchesTmp.begin(); it != matchesTmp.end(); ++it) { + matches.push_back(cv::DMatch(it->trainIdx, it->queryIdx, it->distance)); + } + } else { + //Match query descriptors to train descriptors + m_matcher->match(queryDescriptors, matches); + } } elapsedTime = vpTime::measureTimeMs() - t; } @@ -2229,15 +2656,27 @@ unsigned int vpKeyPoint::matchPoint(const vpImage<unsigned char> &I, filterMatches(); } else { - m_queryFilteredKeyPoints = m_queryKeyPoints; - m_objectFilteredPoints = m_trainPoints; - m_filteredMatches = m_matches; + if(m_useMatchTrainToQuery) { + //Add only query keypoints matched with a train keypoints + m_queryFilteredKeyPoints.clear(); + m_filteredMatches.clear(); + for(std::vector<cv::DMatch>::const_iterator it = m_matches.begin(); it != m_matches.end(); ++it) { + m_filteredMatches.push_back(cv::DMatch((int) m_queryFilteredKeyPoints.size(), it->trainIdx, it->distance)); + m_queryFilteredKeyPoints.push_back(m_queryKeyPoints[(size_t) it->queryIdx]); + } + } else { + m_queryFilteredKeyPoints = m_queryKeyPoints; + m_filteredMatches = m_matches; + } - m_matchQueryToTrainKeyPoints.clear(); - for (size_t i = 0; i < m_matches.size(); i++) { - m_matchQueryToTrainKeyPoints.push_back(std::pair<cv::KeyPoint, cv::KeyPoint>( - m_queryKeyPoints[(size_t) m_matches[i].queryIdx], - m_trainKeyPoints[(size_t) m_matches[i].trainIdx])); + if(!m_trainPoints.empty()) { + m_objectFilteredPoints.clear(); + //Add 3D object points such as the same index in m_queryFilteredKeyPoints and in m_objectFilteredPoints + // matches to the same train object + for(std::vector<cv::DMatch>::const_iterator it = m_matches.begin(); it != m_matches.end(); ++it) { + //m_matches is normally ordered following the queryDescriptor index + m_objectFilteredPoints.push_back(m_trainPoints[(size_t) it->trainIdx]); + } } } @@ -2259,10 +2698,11 @@ unsigned int vpKeyPoint::matchPoint(const vpImage<unsigned char> &I, \param elapsedTime : Time to detect, extract, match and compute the pose \param func : Function pointer to filter the pose in Ransac pose estimation, if we want to eliminate the poses which do not respect some criterion + \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider \return True if the matching and the pose estimation are OK, false otherwise */ bool vpKeyPoint::matchPoint(const vpImage<unsigned char> &I, const vpCameraParameters &cam, vpHomogeneousMatrix &cMo, - double &error, double &elapsedTime, bool (*func)(vpHomogeneousMatrix *)) { + double &error, double &elapsedTime, bool (*func)(vpHomogeneousMatrix *), const vpRect& rectangle) { //Check if we have training descriptors if(m_trainDescriptors.empty()) { std::cerr << "Reference is empty." << std::endl; @@ -2298,7 +2738,7 @@ bool vpKeyPoint::matchPoint(const vpImage<unsigned char> &I, const vpCameraParam } } } else { - detect(I, m_queryKeyPoints, m_detectionTime); + detect(I, m_queryKeyPoints, m_detectionTime, rectangle); extract(I, m_queryKeyPoints, m_queryDescriptors, m_extractionTime); } @@ -2313,15 +2753,27 @@ bool vpKeyPoint::matchPoint(const vpImage<unsigned char> &I, const vpCameraParam filterMatches(); } else { - m_queryFilteredKeyPoints = m_queryKeyPoints; - m_objectFilteredPoints = m_trainPoints; - m_filteredMatches = m_matches; + if(m_useMatchTrainToQuery) { + //Add only query keypoints matched with a train keypoints + m_queryFilteredKeyPoints.clear(); + m_filteredMatches.clear(); + for(std::vector<cv::DMatch>::const_iterator it = m_matches.begin(); it != m_matches.end(); ++it) { + m_filteredMatches.push_back(cv::DMatch((int) m_queryFilteredKeyPoints.size(), it->trainIdx, it->distance)); + m_queryFilteredKeyPoints.push_back(m_queryKeyPoints[(size_t) it->queryIdx]); + } + } else { + m_queryFilteredKeyPoints = m_queryKeyPoints; + m_filteredMatches = m_matches; + } - m_matchQueryToTrainKeyPoints.clear(); - for (size_t i = 0; i < m_matches.size(); i++) { - m_matchQueryToTrainKeyPoints.push_back(std::pair<cv::KeyPoint, cv::KeyPoint>( - m_queryKeyPoints[(size_t) m_matches[i].queryIdx], - m_trainKeyPoints[(size_t) m_matches[i].trainIdx])); + if(!m_trainPoints.empty()) { + m_objectFilteredPoints.clear(); + //Add 3D object points such as the same index in m_queryFilteredKeyPoints and in m_objectFilteredPoints + // matches to the same train object + for(std::vector<cv::DMatch>::const_iterator it = m_matches.begin(); it != m_matches.end(); ++it) { + //m_matches is normally ordered following the queryDescriptor index + m_objectFilteredPoints.push_back(m_trainPoints[(size_t) it->trainIdx]); + } } } @@ -2354,12 +2806,31 @@ bool vpKeyPoint::matchPoint(const vpImage<unsigned char> &I, const vpCameraParam } std::vector<vpPoint> inliers; - bool res = computePose(objectVpPoints, cMo, inliers, m_poseTime, func); - m_ransacInliers.resize(inliers.size()); - for(size_t i = 0; i < m_ransacInliers.size(); i++) { - vpMeterPixelConversion::convertPoint(cam, inliers[i].get_x(), inliers[i].get_y(), m_ransacInliers[i]); + std::vector<unsigned int> inlierIndex; + + bool res = computePose(objectVpPoints, cMo, inliers, inlierIndex, m_poseTime, func); + + std::map<unsigned int, bool> mapOfInlierIndex; + m_matchRansacKeyPointsToPoints.clear(); + + for (std::vector<unsigned int>::const_iterator it = inlierIndex.begin(); it != inlierIndex.end(); ++it) { + m_matchRansacKeyPointsToPoints.push_back(std::pair<cv::KeyPoint, cv::Point3f>(m_queryFilteredKeyPoints[(size_t)(*it)], + m_objectFilteredPoints[(size_t)(*it)])); + mapOfInlierIndex[*it] = true; + } + + for(size_t i = 0; i < m_queryFilteredKeyPoints.size(); i++) { + if(mapOfInlierIndex.find((unsigned int) i) == mapOfInlierIndex.end()) { + m_ransacOutliers.push_back(vpImagePoint(m_queryFilteredKeyPoints[i].pt.y, m_queryFilteredKeyPoints[i].pt.x)); + } } + error = computePoseEstimationError(m_matchRansacKeyPointsToPoints, cam, cMo); + + m_ransacInliers.resize(m_matchRansacKeyPointsToPoints.size()); + std::transform(m_matchRansacKeyPointsToPoints.begin(), m_matchRansacKeyPointsToPoints.end(), m_ransacInliers.begin(), + matchRansacToVpImage); + elapsedTime += m_poseTime; return res; @@ -2371,12 +2842,10 @@ bool vpKeyPoint::matchPoint(const vpImage<unsigned char> &I, const vpCameraParam std::map<int, bool> mapOfInlierIndex; m_matchRansacKeyPointsToPoints.clear(); - m_matchRansacQueryToTrainKeyPoints.clear(); + for (std::vector<int>::const_iterator it = inlierIndex.begin(); it != inlierIndex.end(); ++it) { m_matchRansacKeyPointsToPoints.push_back(std::pair<cv::KeyPoint, cv::Point3f>(m_queryFilteredKeyPoints[(size_t)(*it)], m_objectFilteredPoints[(size_t)(*it)])); - m_matchRansacQueryToTrainKeyPoints.push_back(std::pair<cv::KeyPoint, cv::KeyPoint>(m_queryFilteredKeyPoints[(size_t)(*it)], - m_trainKeyPoints[(size_t)m_matches[(size_t)(*it)].trainIdx])); mapOfInlierIndex[*it] = true; } @@ -2411,18 +2880,19 @@ bool vpKeyPoint::matchPoint(const vpImage<unsigned char> &I, const vpCameraParam \param imPts1 : Pointer to the list of reference keypoints if not null \param imPts2 : Pointer to the list of current keypoints if not null \param meanDescriptorDistance : Pointer to the value of the average distance of the descriptors if not null - \param detectionScore : Pointer to the value of the detection score if not null + \param detection_score : Pointer to the value of the detection score if not null + \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider \return True if the object is present, false otherwise */ bool vpKeyPoint::matchPointAndDetect(const vpImage<unsigned char> &I, vpRect &boundingBox, vpImagePoint ¢erOfGravity, const bool isPlanarObject, std::vector<vpImagePoint> *imPts1, std::vector<vpImagePoint> *imPts2, - double *meanDescriptorDistance, double *detectionScore) { + double *meanDescriptorDistance, double *detection_score, const vpRect& rectangle) { if(imPts1 != NULL && imPts2 != NULL) { imPts1->clear(); imPts2->clear(); } - matchPoint(I); + matchPoint(I, rectangle); double meanDescriptorDistanceTmp = 0.0; for(std::vector<cv::DMatch>::const_iterator it = m_filteredMatches.begin(); it != m_filteredMatches.end(); ++it) { @@ -2435,8 +2905,8 @@ bool vpKeyPoint::matchPointAndDetect(const vpImage<unsigned char> &I, vpRect &bo if(meanDescriptorDistance != NULL) { *meanDescriptorDistance = meanDescriptorDistanceTmp; } - if(detectionScore != NULL) { - *detectionScore = score; + if(detection_score != NULL) { + *detection_score = score; } if(m_filteredMatches.size() >= 4) { @@ -2545,12 +3015,13 @@ bool vpKeyPoint::matchPointAndDetect(const vpImage<unsigned char> &I, vpRect &bo the bounding box) \param func : Function pointer to filter the pose in Ransac pose estimation, if we want to eliminate the poses which do not respect some criterion + \param rectangle : Rectangle corresponding to the ROI (Region of Interest) to consider \return True if the matching and the pose estimation are OK, false otherwise. */ bool vpKeyPoint::matchPointAndDetect(const vpImage<unsigned char> &I, const vpCameraParameters &cam, vpHomogeneousMatrix &cMo, double &error, double &elapsedTime, vpRect &boundingBox, vpImagePoint ¢erOfGravity, - bool (*func)(vpHomogeneousMatrix *)) { - bool isMatchOk = matchPoint(I, cam, cMo, error, elapsedTime, func); + bool (*func)(vpHomogeneousMatrix *), const vpRect& rectangle) { + bool isMatchOk = matchPoint(I, cam, cMo, error, elapsedTime, func, rectangle); if(isMatchOk) { //Use the pose estimated to project the model points in the image vpPoint pt; @@ -2599,6 +3070,7 @@ bool vpKeyPoint::matchPointAndDetect(const vpImage<unsigned char> &I, const vpCa */ void vpKeyPoint::detectExtractAffine(const vpImage<unsigned char> &I,std::vector<std::vector<cv::KeyPoint> >& listOfKeypoints, std::vector<cv::Mat>& listOfDescriptors, std::vector<vpImage<unsigned char> > *listOfAffineI) { +#if 0 cv::Mat img; vpImageConvert::convert(I, img); listOfKeypoints.clear(); @@ -2624,12 +3096,15 @@ void vpKeyPoint::detectExtractAffine(const vpImage<unsigned char> &I,std::vector listOfAffineI->push_back(tI); } #if 0 + cv::Mat img_disp; + cv::bitwise_and(mask, timg, img_disp); cv::namedWindow( "Skew", cv::WINDOW_AUTOSIZE ); // Create a window for display. cv::imshow( "Skew", img_disp ); cv::waitKey(0); #endif - for(std::map<std::string, cv::Ptr<cv::FeatureDetector> >::const_iterator it = m_detectors.begin(); it != m_detectors.end(); ++it) { + for(std::map<std::string, cv::Ptr<cv::FeatureDetector> >::const_iterator it = m_detectors.begin(); + it != m_detectors.end(); ++it) { std::vector<cv::KeyPoint> kp; it->second->detect(timg, kp, mask); keypoints.insert(keypoints.end(), kp.begin(), kp.end()); @@ -2649,6 +3124,111 @@ void vpKeyPoint::detectExtractAffine(const vpImage<unsigned char> &I,std::vector listOfDescriptors.push_back(descriptors); } } + +#else + cv::Mat img; + vpImageConvert::convert(I, img); + + //Create a vector for storing the affine skew parameters + std::vector<std::pair<double, int> > listOfAffineParams; + for (int tl = 1; tl < 6; tl++) { + double t = pow(2, 0.5 * tl); + for (int phi = 0; phi < 180; phi += (int)(72.0 / t)) { + listOfAffineParams.push_back(std::pair<double, int>(t, phi)); + } + } + + listOfKeypoints.resize(listOfAffineParams.size()); + listOfDescriptors.resize(listOfAffineParams.size()); + + if(listOfAffineI != NULL) { + listOfAffineI->resize(listOfAffineParams.size()); + } + +#ifdef VISP_HAVE_OPENMP + #pragma omp parallel for +#endif + for(int cpt = 0; cpt < static_cast<int>(listOfAffineParams.size()); cpt++) { + std::vector<cv::KeyPoint> keypoints; + cv::Mat descriptors; + + cv::Mat timg, mask, Ai; + img.copyTo(timg); + + affineSkew(listOfAffineParams[(size_t) cpt].first, listOfAffineParams[(size_t) cpt].second, timg, mask, Ai); + + + if(listOfAffineI != NULL) { + cv::Mat img_disp; + bitwise_and(mask, timg, img_disp); + vpImage<unsigned char> tI; + vpImageConvert::convert(img_disp, tI); + (*listOfAffineI)[(size_t) cpt] = tI; + } + +#if 0 + cv::Mat img_disp; + cv::bitwise_and(mask, timg, img_disp); + cv::namedWindow( "Skew", cv::WINDOW_AUTOSIZE ); // Create a window for display. + cv::imshow( "Skew", img_disp ); + cv::waitKey(0); +#endif + + for(std::map<std::string, cv::Ptr<cv::FeatureDetector> >::const_iterator it = m_detectors.begin(); + it != m_detectors.end(); ++it) { + std::vector<cv::KeyPoint> kp; + it->second->detect(timg, kp, mask); + keypoints.insert(keypoints.end(), kp.begin(), kp.end()); + } + + double elapsedTime; + extract(timg, keypoints, descriptors, elapsedTime); + + for(size_t i = 0; i < keypoints.size(); i++) { + cv::Point3f kpt(keypoints[i].pt.x, keypoints[i].pt.y, 1.f); + cv::Mat kpt_t = Ai * cv::Mat(kpt); + keypoints[i].pt.x = kpt_t.at<float>(0, 0); + keypoints[i].pt.y = kpt_t.at<float>(1, 0); + } + + listOfKeypoints[(size_t) cpt] = keypoints; + listOfDescriptors[(size_t) cpt] = descriptors; + } +#endif +} + +/*! + Reset the instance as if we would declare another vpKeyPoint variable. + */ +void vpKeyPoint::reset() { + //vpBasicKeyPoint class + referenceImagePointsList.clear(); currentImagePointsList.clear(); matchedReferencePoints.clear(); _reference_computed = false; + + + m_computeCovariance = false; m_covarianceMatrix = vpMatrix(); m_currentImageId = 0; m_detectionMethod = detectionScore; + m_detectionScore = 0.15; m_detectionThreshold = 100.0; m_detectionTime = 0.0; m_detectorNames.clear(); + m_detectors.clear(); m_extractionTime = 0.0; m_extractorNames.clear(); m_extractors.clear(); m_filteredMatches.clear(); + m_filterType = ratioDistanceThreshold; + m_imageFormat = jpgImageFormat; m_knnMatches.clear(); m_mapOfImageId.clear(); m_mapOfImages.clear(); + m_matcher = cv::Ptr<cv::DescriptorMatcher>(); m_matcherName = "BruteForce-Hamming"; + m_matches.clear(); m_matchingFactorThreshold = 2.0; m_matchingRatioThreshold = 0.85; m_matchingTime = 0.0; + m_matchRansacKeyPointsToPoints.clear(); m_nbRansacIterations = 200; m_nbRansacMinInlierCount = 100; + m_objectFilteredPoints.clear(); + m_poseTime = 0.0; m_queryDescriptors = cv::Mat(); m_queryFilteredKeyPoints.clear(); m_queryKeyPoints.clear(); + m_ransacConsensusPercentage = 20.0; m_ransacInliers.clear(); m_ransacOutliers.clear(); m_ransacReprojectionError = 6.0; + m_ransacThreshold = 0.01; m_trainDescriptors = cv::Mat(); m_trainKeyPoints.clear(); m_trainPoints.clear(); + m_trainVpPoints.clear(); m_useAffineDetection = false; +#if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000) + m_useBruteForceCrossCheck = true; +#endif + m_useConsensusPercentage = false; + m_useKnn = true; //as m_filterType == ratioDistanceThreshold + m_useMatchTrainToQuery = false; m_useRansacVVS = true; m_useSingleMatchFilter = true; + + m_detectorNames.push_back("ORB"); + m_extractorNames.push_back("ORB"); + + init(); } /*! @@ -2666,18 +3246,50 @@ void vpKeyPoint::saveLearningData(const std::string &filename, bool binaryMode, std::map<int, std::string> mapOfImgPath; if(saveTrainingImages) { +#ifdef VISP_HAVE_MODULE_IO //Save the training image files in the same directory int cpt = 0; for(std::map<int, vpImage<unsigned char> >::const_iterator it = m_mapOfImages.begin(); it != m_mapOfImages.end(); ++it, cpt++) { + if(cpt > 999) { + throw vpException(vpException::fatalError, "The number of training images to save is too big !"); + } + char buffer[4]; sprintf(buffer, "%03d", cpt); std::stringstream ss; - ss << "train_image_" << buffer << ".jpg"; - std::string filename_ = ss.str(); - mapOfImgPath[it->first] = filename_; - vpImageIo::write(it->second, parent + (!parent.empty() ? "/" : "") + filename_); + ss << "train_image_" << buffer; + + switch(m_imageFormat) { + case jpgImageFormat: + ss << ".jpg"; + break; + + case pngImageFormat: + ss << ".png"; + break; + + case ppmImageFormat: + ss << ".ppm"; + break; + + case pgmImageFormat: + ss << ".pgm"; + break; + + default: + ss << ".png"; + break; + } + + std::string imgFilename = ss.str(); + mapOfImgPath[it->first] = imgFilename; + vpImageIo::write(it->second, parent + (!parent.empty() ? "/" : "") + imgFilename); } +#else + std::cout << "Warning: in vpKeyPoint::saveLearningData() training images are not saved because " + "visp_io module is not available !" << std::endl; +#endif } bool have3DInfo = m_trainPoints.size() > 0; @@ -2686,6 +3298,7 @@ void vpKeyPoint::saveLearningData(const std::string &filename, bool binaryMode, } if(binaryMode) { + //Save the learning data into little endian binary file. std::ofstream file(filename.c_str(), std::ofstream::binary); if(!file.is_open()) { throw vpException(vpException::ioError, "Cannot create the file."); @@ -2693,26 +3306,32 @@ void vpKeyPoint::saveLearningData(const std::string &filename, bool binaryMode, //Write info about training images int nbImgs = (int) mapOfImgPath.size(); - file.write((char *)(&nbImgs), sizeof(nbImgs)); +// file.write((char *)(&nbImgs), sizeof(nbImgs)); + writeBinaryIntLE(file, nbImgs); +#ifdef VISP_HAVE_MODULE_IO for(std::map<int, std::string>::const_iterator it = mapOfImgPath.begin(); it != mapOfImgPath.end(); ++it) { //Write image_id int id = it->first; - file.write((char *)(&id), sizeof(id)); +// file.write((char *)(&id), sizeof(id)); + writeBinaryIntLE(file, id); //Write image path std::string path = it->second; int length = (int) path.length(); - file.write((char *)(&length), sizeof(length)); +// file.write((char *)(&length), sizeof(length)); + writeBinaryIntLE(file, length); for(int cpt = 0; cpt < length; cpt++) { file.write((char *) (&path[(size_t)cpt]), sizeof(path[(size_t)cpt])); } } +#endif //Write if we have 3D point information int have3DInfoInt = have3DInfo ? 1 : 0; - file.write((char *)(&have3DInfoInt), sizeof(have3DInfoInt)); +// file.write((char *)(&have3DInfoInt), sizeof(have3DInfoInt)); + writeBinaryIntLE(file, have3DInfoInt); int nRows = m_trainDescriptors.rows, @@ -2720,58 +3339,79 @@ void vpKeyPoint::saveLearningData(const std::string &filename, bool binaryMode, int descriptorType = m_trainDescriptors.type(); //Write the number of descriptors - file.write((char *)(&nRows), sizeof(nRows)); +// file.write((char *)(&nRows), sizeof(nRows)); + writeBinaryIntLE(file, nRows); //Write the size of the descriptor - file.write((char *)(&nCols), sizeof(nCols)); +// file.write((char *)(&nCols), sizeof(nCols)); + writeBinaryIntLE(file, nCols); //Write the type of the descriptor - file.write((char *)(&descriptorType), sizeof(descriptorType)); +// file.write((char *)(&descriptorType), sizeof(descriptorType)); + writeBinaryIntLE(file, descriptorType); for (int i = 0; i < nRows; i++) { unsigned int i_ = (unsigned int) i; //Write u float u = m_trainKeyPoints[i_].pt.x; - file.write((char *)(&u), sizeof(u)); +// file.write((char *)(&u), sizeof(u)); + writeBinaryFloatLE(file, u); //Write v float v = m_trainKeyPoints[i_].pt.y; - file.write((char *)(&v), sizeof(v)); +// file.write((char *)(&v), sizeof(v)); + writeBinaryFloatLE(file, v); //Write size float size = m_trainKeyPoints[i_].size; - file.write((char *)(&size), sizeof(size)); +// file.write((char *)(&size), sizeof(size)); + writeBinaryFloatLE(file, size); //Write angle float angle = m_trainKeyPoints[i_].angle; - file.write((char *)(&angle), sizeof(angle)); +// file.write((char *)(&angle), sizeof(angle)); + writeBinaryFloatLE(file, angle); //Write response float response = m_trainKeyPoints[i_].response; - file.write((char *)(&response), sizeof(response)); +// file.write((char *)(&response), sizeof(response)); + writeBinaryFloatLE(file, response); //Write octave int octave = m_trainKeyPoints[i_].octave; - file.write((char *)(&octave), sizeof(octave)); +// file.write((char *)(&octave), sizeof(octave)); + writeBinaryIntLE(file, octave); //Write class_id int class_id = m_trainKeyPoints[i_].class_id; - file.write((char *)(&class_id), sizeof(class_id)); +// file.write((char *)(&class_id), sizeof(class_id)); + writeBinaryIntLE(file, class_id); //Write image_id - int image_id = (saveTrainingImages && m_mapOfImageId.size() > 0) ? m_mapOfImageId[m_trainKeyPoints[i_].class_id] : -1; - file.write((char *)(&image_id), sizeof(image_id)); +#ifdef VISP_HAVE_MODULE_IO + std::map<int, int>::const_iterator it_findImgId = m_mapOfImageId.find(m_trainKeyPoints[i_].class_id); + int image_id = (saveTrainingImages && it_findImgId != m_mapOfImageId.end()) ? it_findImgId->second : -1; +// file.write((char *)(&image_id), sizeof(image_id)); + writeBinaryIntLE(file, image_id); +#else + int image_id = -1; +// file.write((char *)(&image_id), sizeof(image_id)); + writeBinaryIntLE(file, image_id); +#endif if(have3DInfo) { float oX = m_trainPoints[i_].x, oY = m_trainPoints[i_].y, oZ = m_trainPoints[i_].z; //Write oX - file.write((char *)(&oX), sizeof(oX)); +// file.write((char *)(&oX), sizeof(oX)); + writeBinaryFloatLE(file, oX); //Write oY - file.write((char *)(&oY), sizeof(oY)); +// file.write((char *)(&oY), sizeof(oY)); + writeBinaryFloatLE(file, oY); //Write oZ - file.write((char *)(&oZ), sizeof(oZ)); +// file.write((char *)(&oZ), sizeof(oZ)); + writeBinaryFloatLE(file, oZ); } for (int j = 0; j < nCols; j++) { @@ -2786,27 +3426,32 @@ void vpKeyPoint::saveLearningData(const std::string &filename, bool binaryMode, break; case CV_16U: - file.write((char *)(&m_trainDescriptors.at<unsigned short int>(i, j)), sizeof(m_trainDescriptors.at<unsigned short int>(i, j))); +// file.write((char *)(&m_trainDescriptors.at<unsigned short int>(i, j)), sizeof(m_trainDescriptors.at<unsigned short int>(i, j))); + writeBinaryUShortLE(file, m_trainDescriptors.at<unsigned short int>(i, j)); break; case CV_16S: - file.write((char *)(&m_trainDescriptors.at<short int>(i, j)), sizeof(m_trainDescriptors.at<short int>(i, j))); +// file.write((char *)(&m_trainDescriptors.at<short int>(i, j)), sizeof(m_trainDescriptors.at<short int>(i, j))); + writeBinaryShortLE(file, m_trainDescriptors.at<short int>(i, j)); break; case CV_32S: - file.write((char *)(&m_trainDescriptors.at<int>(i, j)), sizeof(m_trainDescriptors.at<int>(i, j))); +// file.write((char *)(&m_trainDescriptors.at<int>(i, j)), sizeof(m_trainDescriptors.at<int>(i, j))); + writeBinaryIntLE(file, m_trainDescriptors.at<int>(i, j)); break; case CV_32F: - file.write((char *)(&m_trainDescriptors.at<float>(i, j)), sizeof(m_trainDescriptors.at<float>(i, j))); +// file.write((char *)(&m_trainDescriptors.at<float>(i, j)), sizeof(m_trainDescriptors.at<float>(i, j))); + writeBinaryFloatLE(file, m_trainDescriptors.at<float>(i, j)); break; case CV_64F: - file.write((char *)(&m_trainDescriptors.at<double>(i, j)), sizeof(m_trainDescriptors.at<double>(i, j))); +// file.write((char *)(&m_trainDescriptors.at<double>(i, j)), sizeof(m_trainDescriptors.at<double>(i, j))); + writeBinaryDoubleLE(file, m_trainDescriptors.at<double>(i, j)); break; default: - file.write((char *)(&m_trainDescriptors.at<float>(i, j)), sizeof(m_trainDescriptors.at<float>(i, j))); + throw vpException(vpException::fatalError, "Problem with the data type of descriptors !"); break; } } @@ -2840,6 +3485,7 @@ void vpKeyPoint::saveLearningData(const std::string &filename, bool binaryMode, //Write the training images info image_node = xmlNewChild(root_node, NULL, BAD_CAST "TrainingImageInfo", NULL); +#ifdef VISP_HAVE_MODULE_IO for(std::map<int, std::string>::const_iterator it = mapOfImgPath.begin(); it != mapOfImgPath.end(); ++it) { image_info_node = xmlNewChild(image_node, NULL, BAD_CAST "trainImg", BAD_CAST it->second.c_str()); @@ -2847,6 +3493,7 @@ void vpKeyPoint::saveLearningData(const std::string &filename, bool binaryMode, ss << it->first; xmlNewProp(image_info_node, BAD_CAST "image_id", BAD_CAST ss.str().c_str()); } +#endif //Write information about descriptors descriptors_info_node = xmlNewChild(root_node, NULL, BAD_CAST "DescriptorsInfo", NULL); @@ -2876,27 +3523,32 @@ void vpKeyPoint::saveLearningData(const std::string &filename, bool binaryMode, NULL); ss.str(""); - ss << m_trainKeyPoints[i_].pt.x; + //max_digits10 == 9 for float + ss << std::fixed << std::setprecision(9) << m_trainKeyPoints[i_].pt.x; xmlNewChild(descriptor_node, NULL, BAD_CAST "u", BAD_CAST ss.str().c_str()); ss.str(""); - ss << m_trainKeyPoints[i_].pt.y; + //max_digits10 == 9 for float + ss << std::fixed << std::setprecision(9) << m_trainKeyPoints[i_].pt.y; xmlNewChild(descriptor_node, NULL, BAD_CAST "v", BAD_CAST ss.str().c_str()); ss.str(""); - ss << m_trainKeyPoints[i_].size; + //max_digits10 == 9 for float + ss << std::fixed << std::setprecision(9) << m_trainKeyPoints[i_].size; xmlNewChild(descriptor_node, NULL, BAD_CAST "size", BAD_CAST ss.str().c_str()); ss.str(""); - ss << m_trainKeyPoints[i_].angle; + //max_digits10 == 9 for float + ss << std::fixed << std::setprecision(9) << m_trainKeyPoints[i_].angle; xmlNewChild(descriptor_node, NULL, BAD_CAST "angle", BAD_CAST ss.str().c_str()); ss.str(""); - ss << m_trainKeyPoints[i_].response; + //max_digits10 == 9 for float + ss << std::fixed << std::setprecision(9) << m_trainKeyPoints[i_].response; xmlNewChild(descriptor_node, NULL, BAD_CAST "response", BAD_CAST ss.str().c_str()); @@ -2911,23 +3563,33 @@ void vpKeyPoint::saveLearningData(const std::string &filename, bool binaryMode, BAD_CAST ss.str().c_str()); ss.str(""); - ss << ((saveTrainingImages && m_mapOfImageId.size() > 0) ? m_mapOfImageId[m_trainKeyPoints[i_].class_id] : -1); +#ifdef VISP_HAVE_MODULE_IO + std::map<int, int>::const_iterator it_findImgId = m_mapOfImageId.find(m_trainKeyPoints[i_].class_id); + ss << ((saveTrainingImages && it_findImgId != m_mapOfImageId.end()) ? it_findImgId->second : -1); + xmlNewChild(descriptor_node, NULL, BAD_CAST "image_id", + BAD_CAST ss.str().c_str()); +#else + ss << -1; xmlNewChild(descriptor_node, NULL, BAD_CAST "image_id", BAD_CAST ss.str().c_str()); +#endif if (have3DInfo) { ss.str(""); - ss << m_trainPoints[i_].x; + //max_digits10 == 9 for float + ss << std::fixed << std::setprecision(9) << m_trainPoints[i_].x; xmlNewChild(descriptor_node, NULL, BAD_CAST "oX", BAD_CAST ss.str().c_str()); ss.str(""); - ss << m_trainPoints[i_].y; + //max_digits10 == 9 for float + ss << std::fixed << std::setprecision(9) << m_trainPoints[i_].y; xmlNewChild(descriptor_node, NULL, BAD_CAST "oY", BAD_CAST ss.str().c_str()); ss.str(""); - ss << m_trainPoints[i_].z; + //max_digits10 == 9 for float + ss << std::fixed << std::setprecision(9) << m_trainPoints[i_].z; xmlNewChild(descriptor_node, NULL, BAD_CAST "oZ", BAD_CAST ss.str().c_str()); } @@ -2973,15 +3635,17 @@ void vpKeyPoint::saveLearningData(const std::string &filename, bool binaryMode, break; case CV_32F: - ss << m_trainDescriptors.at<float>(i, j); + //max_digits10 == 9 for float + ss << std::fixed << std::setprecision(9) << m_trainDescriptors.at<float>(i, j); break; case CV_64F: - ss << m_trainDescriptors.at<double>(i, j); + //max_digits10 == 17 for double + ss << std::fixed << std::setprecision(17) << m_trainDescriptors.at<double>(i, j); break; default: - ss << m_trainDescriptors.at<float>(i, j); + throw vpException(vpException::fatalError, "Problem with the data type of descriptors !"); break; } xmlNewChild(desc_node, NULL, BAD_CAST "val", @@ -3005,4 +3669,260 @@ void vpKeyPoint::saveLearningData(const std::string &filename, bool binaryMode, } } +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x030000) +//From OpenCV 2.4.11 source code. +struct KeypointResponseGreaterThanThreshold { + KeypointResponseGreaterThanThreshold(float _value) : + value(_value) { + } + inline bool operator()(const cv::KeyPoint& kpt) const { + return kpt.response >= value; + } + float value; +}; + +struct KeypointResponseGreater { + inline bool operator()(const cv::KeyPoint& kp1, + const cv::KeyPoint& kp2) const { + return kp1.response > kp2.response; + } +}; + +// takes keypoints and culls them by the response +void vpKeyPoint::KeyPointsFilter::retainBest( + std::vector<cv::KeyPoint>& keypoints, int n_points) { + //this is only necessary if the keypoints size is greater than the number of desired points. + if (n_points >= 0 && keypoints.size() > (size_t) n_points) { + if (n_points == 0) { + keypoints.clear(); + return; + } + //first use nth element to partition the keypoints into the best and worst. + std::nth_element(keypoints.begin(), keypoints.begin() + n_points, + keypoints.end(), KeypointResponseGreater()); + //this is the boundary response, and in the case of FAST may be ambiguous + float ambiguous_response = keypoints[(size_t) (n_points - 1)].response; + //use std::partition to grab all of the keypoints with the boundary response. + std::vector<cv::KeyPoint>::const_iterator new_end = std::partition( + keypoints.begin() + n_points, keypoints.end(), + KeypointResponseGreaterThanThreshold(ambiguous_response)); + //resize the keypoints, given this new end point. nth_element and partition reordered the points inplace + keypoints.resize((size_t) (new_end - keypoints.begin())); + } +} + +struct RoiPredicate { + RoiPredicate(const cv::Rect& _r) : + r(_r) { + } + + bool operator()(const cv::KeyPoint& keyPt) const { + return !r.contains(keyPt.pt); + } + + cv::Rect r; +}; + +void vpKeyPoint::KeyPointsFilter::runByImageBorder( + std::vector<cv::KeyPoint>& keypoints, cv::Size imageSize, int borderSize) { + if (borderSize > 0) { + if (imageSize.height <= borderSize * 2 || imageSize.width <= borderSize * 2) + keypoints.clear(); + else + keypoints.erase( + std::remove_if(keypoints.begin(), keypoints.end(), + RoiPredicate( + cv::Rect(cv::Point(borderSize, borderSize), + cv::Point(imageSize.width - borderSize, + imageSize.height - borderSize)))), keypoints.end()); + } +} + +struct SizePredicate { + SizePredicate(float _minSize, float _maxSize) : + minSize(_minSize), maxSize(_maxSize) { + } + + bool operator()(const cv::KeyPoint& keyPt) const { + float size = keyPt.size; + return (size < minSize) || (size > maxSize); + } + + float minSize, maxSize; +}; + +void vpKeyPoint::KeyPointsFilter::runByKeypointSize( + std::vector<cv::KeyPoint>& keypoints, float minSize, float maxSize) { + CV_Assert(minSize >= 0); + CV_Assert(maxSize >= 0); + CV_Assert(minSize <= maxSize); + + keypoints.erase( + std::remove_if(keypoints.begin(), keypoints.end(), + SizePredicate(minSize, maxSize)), keypoints.end()); +} + +class MaskPredicate { +public: + MaskPredicate(const cv::Mat& _mask) : + mask(_mask) { + } + bool operator()(const cv::KeyPoint& key_pt) const { + return mask.at<uchar>((int) (key_pt.pt.y + 0.5f), + (int) (key_pt.pt.x + 0.5f)) == 0; + } + +private: + const cv::Mat mask; + MaskPredicate& operator=(const MaskPredicate&); +}; + +void vpKeyPoint::KeyPointsFilter::runByPixelsMask( + std::vector<cv::KeyPoint>& keypoints, const cv::Mat& mask) { + if (mask.empty()) + return; + + keypoints.erase( + std::remove_if(keypoints.begin(), keypoints.end(), MaskPredicate(mask)), + keypoints.end()); +} + +struct KeyPoint_LessThan { + KeyPoint_LessThan(const std::vector<cv::KeyPoint>& _kp) : + kp(&_kp) { + } + bool operator()(/*int i, int j*/ size_t i, size_t j) const { + const cv::KeyPoint& kp1 = (*kp)[/*(size_t)*/ i]; + const cv::KeyPoint& kp2 = (*kp)[/*(size_t)*/ j]; + if (!vpMath::equal(kp1.pt.x, kp2.pt.x, std::numeric_limits<float>::epsilon())) { //if (kp1.pt.x != kp2.pt.x) { + return kp1.pt.x < kp2.pt.x; + } + + if (!vpMath::equal(kp1.pt.y, kp2.pt.y, std::numeric_limits<float>::epsilon())) { //if (kp1.pt.y != kp2.pt.y) { + return kp1.pt.y < kp2.pt.y; + } + + if (!vpMath::equal(kp1.size, kp2.size, std::numeric_limits<float>::epsilon())) { //if (kp1.size != kp2.size) { + return kp1.size > kp2.size; + } + + if (!vpMath::equal(kp1.angle, kp2.angle, std::numeric_limits<float>::epsilon())) { //if (kp1.angle != kp2.angle) { + return kp1.angle < kp2.angle; + } + + if (!vpMath::equal(kp1.response, kp2.response, std::numeric_limits<float>::epsilon())) { //if (kp1.response != kp2.response) { + return kp1.response > kp2.response; + } + + if (kp1.octave != kp2.octave) { + return kp1.octave > kp2.octave; + } + + if (kp1.class_id != kp2.class_id) { + return kp1.class_id > kp2.class_id; + } + + return i < j; + } + const std::vector<cv::KeyPoint>* kp; +}; + +void vpKeyPoint::KeyPointsFilter::removeDuplicated( + std::vector<cv::KeyPoint>& keypoints) { + size_t i, j, n = keypoints.size(); + std::vector<size_t> kpidx(n); + std::vector<uchar> mask(n, (uchar) 1); + + for (i = 0; i < n; i++) { + kpidx[i] = i; + } + std::sort(kpidx.begin(), kpidx.end(), KeyPoint_LessThan(keypoints)); + for (i = 1, j = 0; i < n; i++) { + cv::KeyPoint& kp1 = keypoints[kpidx[i]]; + cv::KeyPoint& kp2 = keypoints[kpidx[j]]; +// if (kp1.pt.x != kp2.pt.x || kp1.pt.y != kp2.pt.y || kp1.size != kp2.size || kp1.angle != kp2.angle) { + if (!vpMath::equal(kp1.pt.x, kp2.pt.x, std::numeric_limits<float>::epsilon()) || + !vpMath::equal(kp1.pt.y, kp2.pt.y, std::numeric_limits<float>::epsilon()) || + !vpMath::equal(kp1.size, kp2.size, std::numeric_limits<float>::epsilon()) || + !vpMath::equal(kp1.angle, kp2.angle, std::numeric_limits<float>::epsilon())) { + j = i; + } else { + mask[kpidx[i]] = 0; + } + } + + for (i = j = 0; i < n; i++) { + if (mask[i]) { + if (i != j) { + keypoints[j] = keypoints[i]; + } + j++; + } + } + keypoints.resize(j); +} + +/* + * PyramidAdaptedFeatureDetector + */ +vpKeyPoint::PyramidAdaptedFeatureDetector::PyramidAdaptedFeatureDetector( + const cv::Ptr<cv::FeatureDetector>& _detector, int _maxLevel) : + detector(_detector), maxLevel(_maxLevel) { +} + +bool vpKeyPoint::PyramidAdaptedFeatureDetector::empty() const { + return detector.empty() || (cv::FeatureDetector*) detector->empty(); +} + +void vpKeyPoint::PyramidAdaptedFeatureDetector::detect( cv::InputArray image, CV_OUT std::vector<cv::KeyPoint>& keypoints, + cv::InputArray mask ) { + detectImpl(image.getMat(), keypoints, mask.getMat()); +} + +void vpKeyPoint::PyramidAdaptedFeatureDetector::detectImpl(const cv::Mat& image, + std::vector<cv::KeyPoint>& keypoints, const cv::Mat& mask) const { + cv::Mat src = image; + cv::Mat src_mask = mask; + + cv::Mat dilated_mask; + if (!mask.empty()) { + cv::dilate(mask, dilated_mask, cv::Mat()); + cv::Mat mask255(mask.size(), CV_8UC1, cv::Scalar(0)); + mask255.setTo(cv::Scalar(255), dilated_mask != 0); + dilated_mask = mask255; + } + + for (int l = 0, multiplier = 1; l <= maxLevel; ++l, multiplier *= 2) { + // Detect on current level of the pyramid + std::vector<cv::KeyPoint> new_pts; + detector->detect(src, new_pts, src_mask); + std::vector<cv::KeyPoint>::iterator it = new_pts.begin(), end = + new_pts.end(); + for (; it != end; ++it) { + it->pt.x *= multiplier; + it->pt.y *= multiplier; + it->size *= multiplier; + it->octave = l; + } + keypoints.insert(keypoints.end(), new_pts.begin(), new_pts.end()); + + // Downsample + if (l < maxLevel) { + cv::Mat dst; + pyrDown(src, dst); + src = dst; + + if (!mask.empty()) + resize(dilated_mask, src_mask, src.size(), 0, 0, CV_INTER_AREA); + } + } + + if (!mask.empty()) + vpKeyPoint::KeyPointsFilter::runByPixelsMask(keypoints, mask); +} +#endif + +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work around to avoid warning: libvisp_vision.a(vpKeyPoint.cpp.o) has no symbols +void dummy_vpKeyPoint() {}; #endif diff --git a/src/key-point/vpKeyPointSurf.cpp b/modules/vision/src/key-point/vpKeyPointSurf.cpp similarity index 89% rename from src/key-point/vpKeyPointSurf.cpp rename to modules/vision/src/key-point/vpKeyPointSurf.cpp index f75051d8405ea016caa5a50afc0784af646f952b..6ec647fc1cb7362060832b9ab2cdc1e6f8c79db1 100644 --- a/src/key-point/vpKeyPointSurf.cpp +++ b/modules/vision/src/key-point/vpKeyPointSurf.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpKeyPointSurf.cpp 5202 2015-01-24 09:29:06Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Key point Surf. * @@ -40,15 +36,14 @@ *****************************************************************************/ -#include <visp/vpKeyPointSurf.h> +#include <visp3/vision/vpKeyPointSurf.h> -#if defined (VISP_HAVE_OPENCV_NONFREE) -#if (VISP_HAVE_OPENCV_VERSION >= 0x010100) && VISP_HAVE_OPENCV_VERSION < 0x030000// Require opencv >= 1.1.0 < 3.0.0 +#if defined(VISP_HAVE_OPENCV_NONFREE) && (VISP_HAVE_OPENCV_VERSION >= 0x010100) && (VISP_HAVE_OPENCV_VERSION < 0x030000) // Require opencv >= 1.1.0 < 3.0.0 -#include <visp/vpImageConvert.h> -#include <visp/vpImageTools.h> -#include <visp/vpDisplay.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpDebug.h> #include <ctype.h> #include <stdio.h> @@ -599,63 +594,6 @@ void vpKeyPointSurf::display(const vpImage<unsigned char> &Icurrent, unsigned in } } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - - \deprecated This method is deprecated, you should use - matchPoint(std::list<float*> , std::list<int> ) - instead. - - Computes the SURF points given by their descriptor and laplacian and try to match - them with the points in the reference list. Only the matched points - are stored. The two lists must have the same number of element while they correspond - the same unique list of point. - - \warning The list returned contains allocated data (2 int per element). Must be deleted to avoid memory leak. - - \param descriptorList : The list of the descriptor - - \param laplacianList : The list of laplacian - - \return the list of the pair, the first element contains the index in the reference sequence and the second element contains the index in the list given in parameter. -*/ -vp_deprecated vpList<int*>* vpKeyPointSurf::matchPoint(vpList<float*> descriptorList, vpList<int> laplacianList) -{ - vpList<int*>* pairPoints = new vpList<int*>; - - if(descriptorList.nb != laplacianList.nb){ - vpTRACE("Error, the two lists have different number of element"); - return pairPoints; - } - - CvSeqReader reader; - cvStartReadSeq( ref_descriptors, &reader ); - - descriptorList.front(); - pairPoints->front(); - laplacianList.front(); - int indexList = 0; - while(!descriptorList.outside()){ - float* descriptor = descriptorList.value(); - - int nearest_neighbor = naiveNearestNeighbor( descriptor, laplacianList.value(), ref_keypoints, ref_descriptors); - - if(nearest_neighbor >= 0){ - int* tab; - tab = new int[2]; - tab[0] = nearest_neighbor; - tab[1] = indexList; - pairPoints->addRight(tab); - } - indexList++; - descriptorList.next(); - laplacianList.next(); - } - - return pairPoints; -} -#endif - std::list<int*>* vpKeyPointSurf::matchPoint(std::list<float*> descriptorList, std::list<int> laplacianList) { std::list<int*>* pairPoints = new std::list<int*>; @@ -777,7 +715,8 @@ void vpKeyPointSurf::getDescriptorParamReferencePoint (const int index, int& siz } } - -#endif +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_vision.a(vpKeyPointSurf.cpp.o) has no symbols +void dummy_vpKeyPointSurf() {}; #endif diff --git a/src/key-point/vpPlanarObjectDetector.cpp b/modules/vision/src/key-point/vpPlanarObjectDetector.cpp old mode 100755 new mode 100644 similarity index 95% rename from src/key-point/vpPlanarObjectDetector.cpp rename to modules/vision/src/key-point/vpPlanarObjectDetector.cpp index 818d12394e5f9b7ba4992b699c23a3acabad48f5..46f1c81f21b022a4d14d3df534deb39b3248338c --- a/src/key-point/vpPlanarObjectDetector.cpp +++ b/modules/vision/src/key-point/vpPlanarObjectDetector.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPlanarObjectDetector.cpp 4976 2014-11-18 10:17:38Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Planar surface detection tool. * @@ -39,17 +35,16 @@ * *****************************************************************************/ -#include <visp/vpPlanarObjectDetector.h> +#include <visp3/vision/vpPlanarObjectDetector.h> #if (VISP_HAVE_OPENCV_VERSION >= 0x020000) && (VISP_HAVE_OPENCV_VERSION < 0x030000) // Require opencv >= 2.0.0 and < 3.0.0 -#include <visp/vpImageConvert.h> -#include <visp/vpException.h> -#include <visp/vpImagePoint.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpColor.h> -#include <visp/vpImageTools.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpException.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImageTools.h> #include <vector> #include <iostream> @@ -538,5 +533,8 @@ vpPlanarObjectDetector::getMatchedPoints(const unsigned int _index, vpImagePoint _currentPoint = currentImagePoints[_index]; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_vision.a(vpPlanarObjectDetector.cpp.o) has no symbols +void dummy_vpPlanarObjectDetector() {}; #endif diff --git a/src/key-point/vpXmlConfigParserKeyPoint.cpp b/modules/vision/src/key-point/vpXmlConfigParserKeyPoint.cpp similarity index 93% rename from src/key-point/vpXmlConfigParserKeyPoint.cpp rename to modules/vision/src/key-point/vpXmlConfigParserKeyPoint.cpp index 2ee1811923cb93cff0f0c313a5357f78c760f3f2..6b57c87df5b18a41b5ab75347a13fd992e52ee15 100644 --- a/src/key-point/vpXmlConfigParserKeyPoint.cpp +++ b/modules/vision/src/key-point/vpXmlConfigParserKeyPoint.cpp @@ -1,7 +1,7 @@ /**************************************************************************** * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -10,20 +10,19 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -45,14 +44,15 @@ #include <iostream> -#include <visp/vpXmlConfigParserKeyPoint.h> +#include <visp3/vision/vpXmlConfigParserKeyPoint.h> #ifdef VISP_HAVE_XML2 -vpXmlConfigParserKeyPoint::vpXmlConfigParserKeyPoint() : m_detectorName("SIFT"), m_extractorName("SIFT"), m_matcherName("BruteForce"), -m_matchingFactorThreshold(2.0), m_matchingMethod(stdDistanceThreshold), m_matchingRatioThreshold(0.85), m_nbRansacIterations(200), -m_nbRansacMinInlierCount(100), m_ransacConsensusPercentage(20.0), m_ransacReprojectionError(6.0), m_ransacThreshold(0.001), -m_useRansacConsensusPercentage(false), m_useRansacVVS(false) +vpXmlConfigParserKeyPoint::vpXmlConfigParserKeyPoint() : m_detectorName("ORB"), m_extractorName("ORB"), + m_matcherName("BruteForce-Hamming"), m_matchingFactorThreshold(2.0), m_matchingMethod(ratioDistanceThreshold), + m_matchingRatioThreshold(0.85), m_nbRansacIterations(200), m_nbRansacMinInlierCount(100), + m_ransacConsensusPercentage(20.0), m_ransacReprojectionError(6.0), m_ransacThreshold(0.01), + m_useRansacConsensusPercentage(false), m_useRansacVVS(true) { init(); } @@ -235,7 +235,7 @@ vpXmlConfigParserKeyPoint::read_matcher(xmlDocPtr doc, xmlNodePtr node) { bool matcher_name_node = false; bool matching_method_node = false; - std::string matchingMethodName = "stdDistanceThreshold"; + std::string matchingMethodName = "ratioDistanceThreshold"; bool matching_factor_threshold_node = false; bool matching_ratio_threshold_node = false; @@ -423,4 +423,7 @@ vpXmlConfigParserKeyPoint::read_ransac(xmlDocPtr doc, xmlNodePtr node) std::cout << "ransac: consensus percentage: "<< m_ransacConsensusPercentage <<std::endl; } +#elif !defined(VISP_BUILD_SHARED_LIBS) +// Work arround to avoid warning: libvisp_vision.a(vpXmlConfigParserKeyPoint.cpp.o) has no symbols +void dummy_vpXmlConfigParserKeyPoint() {}; #endif //VISP_HAVE_XML2 diff --git a/src/computer-vision/pose-estimation/vpLevenbergMarquartd.cpp b/modules/vision/src/pose-estimation/vpLevenbergMarquartd.cpp similarity index 99% rename from src/computer-vision/pose-estimation/vpLevenbergMarquartd.cpp rename to modules/vision/src/pose-estimation/vpLevenbergMarquartd.cpp index 47c24794d8c0f1144c941bbef0dabdf0e547f626..a492276d222713b3cff6462ac4df315f9e9864b0 100644 --- a/src/computer-vision/pose-estimation/vpLevenbergMarquartd.cpp +++ b/modules/vision/src/pose-estimation/vpLevenbergMarquartd.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpLevenbergMarquartd.cpp 5107 2015-01-05 07:47:13Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Levenberg Marquartd. * @@ -45,8 +41,8 @@ #include <iostream> #include <algorithm> // std::min -#include <visp/vpLevenbergMarquartd.h> -#include <visp/vpMath.h> +#include <visp3/vision/vpLevenbergMarquartd.h> +#include <visp3/core/vpMath.h> #define SIGN(x) ((x) < 0 ? -1 : 1) #define SWAP(a,b,c) {(c) = (a); (a) = (b); (b) = (c);} diff --git a/src/computer-vision/pose-estimation/vpPose.cpp b/modules/vision/src/pose-estimation/vpPose.cpp similarity index 90% rename from src/computer-vision/pose-estimation/vpPose.cpp rename to modules/vision/src/pose-estimation/vpPose.cpp index ab652586684e2bf3604d67a8d37af2aef77f38f7..d4913849cc19c38626f0fa815912530f003f6462 100644 --- a/src/computer-vision/pose-estimation/vpPose.cpp +++ b/modules/vision/src/pose-estimation/vpPose.cpp @@ -1,44 +1,40 @@ /**************************************************************************** -* -* $Id: vpPose.cpp 5212 2015-01-26 17:45:45Z strinh $ -* -* This file is part of the ViSP software. -* Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -* -* This software is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* ("GPL") version 2 as published by the Free Software Foundation. -* See the file LICENSE.txt at the root directory of this source -* distribution for additional information about the GNU GPL. -* -* For using ViSP with software that can not be combined with the GNU -* GPL, please contact INRIA about acquiring a ViSP Professional -* Edition License. -* -* See http://www.irisa.fr/lagadic/visp/visp.html for more information. -* -* This software was developed at: -* INRIA Rennes - Bretagne Atlantique -* Campus Universitaire de Beaulieu -* 35042 Rennes Cedex -* France -* http://www.irisa.fr/lagadic -* -* If you have questions regarding the use of this file, please contact -* INRIA at visp@inria.fr -* -* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -* -* -* Description: -* Pose computation. -* -* Authors: -* Eric Marchand -* Francois Chaumette -* -*****************************************************************************/ + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Pose computation. + * + * Authors: + * Eric Marchand + * Francois Chaumette + * + *****************************************************************************/ /*! @@ -47,14 +43,14 @@ pour faire du calcul de pose par difference methode */ -#include <visp/vpPose.h> -#include <visp/vpDebug.h> -#include <visp/vpException.h> -#include <visp/vpPoseException.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplay.h> -#include <visp/vpMath.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpException.h> +#include <visp3/vision/vpPoseException.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpMath.h> #include <cmath> // std::fabs #include <limits> // numeric_limits @@ -96,7 +92,7 @@ vpPose::init() vpPose::vpPose() : npt(0), listP(), residual(0), lambda(0.25), vvsIterMax(200), c3d(), computeCovariance(false), covarianceMatrix(), - ransacNbInlierConsensus(4), ransacMaxTrials(1000), ransacInliers(), ransacThreshold(0.0001), + ransacNbInlierConsensus(4), ransacMaxTrials(1000), ransacInliers(), ransacInlierIndex(), ransacThreshold(0.0001), distanceToPlaneForCoplanarityTest(0.001) { #if (DEBUG_LEVEL1) @@ -423,7 +419,7 @@ vpPose::computePose(vpPoseMethodType methode, vpHomogeneousMatrix& cMo, bool (*f } catch(...) { - vpERROR_TRACE(" ") ; +// vpERROR_TRACE(" ") ; throw ; } //std::cout << "Fin Plan" << std::endl; @@ -436,7 +432,7 @@ vpPose::computePose(vpPoseMethodType methode, vpHomogeneousMatrix& cMo, bool (*f } catch(...) { - vpERROR_TRACE(" ") ; +// vpERROR_TRACE(" ") ; throw ; } //std::cout << "Fin No Plan" << std::endl; @@ -474,7 +470,7 @@ vpPose::computePose(vpPoseMethodType methode, vpHomogeneousMatrix& cMo, bool (*f } catch(...) { - vpERROR_TRACE(" ") ; +// vpERROR_TRACE(" ") ; throw ; } } @@ -493,7 +489,7 @@ vpPose::computePose(vpPoseMethodType methode, vpHomogeneousMatrix& cMo, bool (*f } catch(...) { - vpERROR_TRACE(" ") ; +// vpERROR_TRACE(" ") ; throw ; } } @@ -513,7 +509,7 @@ vpPose::computePose(vpPoseMethodType methode, vpHomogeneousMatrix& cMo, bool (*f } catch(...) { - vpERROR_TRACE(" ") ; +// vpERROR_TRACE(" ") ; throw ; } break; @@ -538,7 +534,7 @@ vpPose::computePose(vpPoseMethodType methode, vpHomogeneousMatrix& cMo, bool (*f } catch(...) { - vpERROR_TRACE(" ") ; +// vpERROR_TRACE(" ") ; throw ; } } @@ -553,7 +549,7 @@ vpPose::computePose(vpPoseMethodType methode, vpHomogeneousMatrix& cMo, bool (*f } catch(...) { - vpERROR_TRACE(" ") ; +// vpERROR_TRACE(" ") ; throw ; } } @@ -714,19 +710,17 @@ vpPose::poseFromRectangle(vpPoint &p1,vpPoint &p2, vpColVector kh2(3); vpMatrix K(3,3); K = cam.get_K(); - K.setIdentity(); + K.eye(); vpMatrix Kinv =K.pseudoInverse(); vpMatrix KinvH =Kinv*H; kh1=KinvH.getCol(0); kh2=KinvH.getCol(1); - double s= sqrt(kh1.sumSquare())/sqrt(kh2.sumSquare()); - vpMatrix D(3,3); - D.setIdentity(); + D.eye(); D[1][1]=1/s; vpMatrix cHo=H*D; @@ -744,8 +738,6 @@ vpPose::poseFromRectangle(vpPoint &p1,vpPoint &p2, P.addPoint(p3) ; P.addPoint(p4) ; - P.computePose(vpPose::DEMENTHON_LOWE,cMo) ; return lx/s ; - } diff --git a/src/computer-vision/pose-estimation/vpPoseDementhon.cpp b/modules/vision/src/pose-estimation/vpPoseDementhon.cpp similarity index 91% rename from src/computer-vision/pose-estimation/vpPoseDementhon.cpp rename to modules/vision/src/pose-estimation/vpPoseDementhon.cpp index 58edca4e248f214b39fe89fcdff393821fbf07a9..3ccfd4a94f7172d84cccf1e70fac1421ea45352c 100644 --- a/src/computer-vision/pose-estimation/vpPoseDementhon.cpp +++ b/modules/vision/src/pose-estimation/vpPoseDementhon.cpp @@ -1,49 +1,45 @@ /**************************************************************************** -* -* $Id: vpPoseDementhon.cpp 5198 2015-01-23 17:32:04Z fspindle $ -* -* This file is part of the ViSP software. -* Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -* -* This software is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* ("GPL") version 2 as published by the Free Software Foundation. -* See the file LICENSE.txt at the root directory of this source -* distribution for additional information about the GNU GPL. -* -* For using ViSP with software that can not be combined with the GNU -* GPL, please contact INRIA about acquiring a ViSP Professional -* Edition License. -* -* See http://www.irisa.fr/lagadic/visp/visp.html for more information. -* -* This software was developed at: -* INRIA Rennes - Bretagne Atlantique -* Campus Universitaire de Beaulieu -* 35042 Rennes Cedex -* France -* http://www.irisa.fr/lagadic -* -* If you have questions regarding the use of this file, please contact -* INRIA at visp@inria.fr -* -* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -* -* -* Description: -* Pose computation. -* -* Authors: -* Eric Marchand -* Francois Chaumette -* -*****************************************************************************/ - - - -#include <visp/vpPose.h> -#include <visp/vpMath.h> + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Pose computation. + * + * Authors: + * Eric Marchand + * Francois Chaumette + * + *****************************************************************************/ + + + +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpMath.h> #define DEBUG_LEVEL1 0 #define DEBUG_LEVEL2 0 diff --git a/src/computer-vision/pose-estimation/vpPoseFeatures.cpp b/modules/vision/src/pose-estimation/vpPoseFeatures.cpp similarity index 91% rename from src/computer-vision/pose-estimation/vpPoseFeatures.cpp rename to modules/vision/src/pose-estimation/vpPoseFeatures.cpp index 132c074351f7fbfa02920e43c20954d2abc5c45b..4a4838e091092370dcec9b419fc467ad564df5cc 100644 --- a/src/computer-vision/pose-estimation/vpPoseFeatures.cpp +++ b/modules/vision/src/pose-estimation/vpPoseFeatures.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpPoseFeatures.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pose computation from any features. * @@ -38,7 +34,9 @@ * Aurelien Yol * *****************************************************************************/ -#include <visp/vpPoseFeatures.h> +#include <visp3/vision/vpPoseFeatures.h> + +#ifdef VISP_HAVE_MODULE_VISUAL_FEATURES /*! Default constructor. @@ -291,8 +289,8 @@ void vpPoseFeatures::error_and_interaction(vpHomogeneousMatrix & cMo, vpColVecto vpPoint p(featurePoint_Point_list[i].firstParam); p.track(cMo); vpFeatureBuilder::create(fp, p); - err.stackMatrices(fp.error(*(featurePoint_Point_list[i].desiredFeature))); - L.stackMatrices(fp.interaction()); + err.stack(fp.error(*(featurePoint_Point_list[i].desiredFeature))); + L.stack(fp.interaction()); } //--------------vpFeaturePoint3D-------------- @@ -302,8 +300,8 @@ void vpPoseFeatures::error_and_interaction(vpHomogeneousMatrix & cMo, vpColVecto vpPoint p(featurePoint3D_Point_list[i].firstParam); p.track(cMo); vpFeatureBuilder::create(fp3D, p); - err.stackMatrices(fp3D.error(*(featurePoint3D_Point_list[i].desiredFeature))); - L.stackMatrices(fp3D.interaction()); + err.stack(fp3D.error(*(featurePoint3D_Point_list[i].desiredFeature))); + L.stack(fp3D.interaction()); } //--------------vpFeatureVanishingPoint-------------- @@ -313,8 +311,8 @@ void vpPoseFeatures::error_and_interaction(vpHomogeneousMatrix & cMo, vpColVecto vpPoint p(featureVanishingPoint_Point_list[i].firstParam); p.track(cMo); vpFeatureBuilder::create(fvp, p); - err.stackMatrices(fvp.error(*(featureVanishingPoint_Point_list[i].desiredFeature))); - L.stackMatrices(fvp.interaction()); + err.stack(fvp.error(*(featureVanishingPoint_Point_list[i].desiredFeature))); + L.stack(fvp.interaction()); } //From Duo of vpLines if( i < featureVanishingPoint_DuoLine_list.size() ){ @@ -324,8 +322,8 @@ void vpPoseFeatures::error_and_interaction(vpHomogeneousMatrix & cMo, vpColVecto l1.track(cMo); l2.track(cMo); vpFeatureBuilder::create(fvp, l1, l2); - err.stackMatrices(fvp.error(*(featureVanishingPoint_DuoLine_list[i].desiredFeature))); - L.stackMatrices(fvp.interaction()); + err.stack(fvp.error(*(featureVanishingPoint_DuoLine_list[i].desiredFeature))); + L.stack(fvp.interaction()); } //--------------vpFeatureEllipse-------------- @@ -335,8 +333,8 @@ void vpPoseFeatures::error_and_interaction(vpHomogeneousMatrix & cMo, vpColVecto vpSphere s(featureEllipse_Sphere_list[i].firstParam); s.track(cMo); vpFeatureBuilder::create(fe, s); - err.stackMatrices(fe.error(*(featureEllipse_Sphere_list[i].desiredFeature))); - L.stackMatrices(fe.interaction()); + err.stack(fe.error(*(featureEllipse_Sphere_list[i].desiredFeature))); + L.stack(fe.interaction()); } //From vpCircle if( i < featureEllipse_Circle_list.size() ){ @@ -344,8 +342,8 @@ void vpPoseFeatures::error_and_interaction(vpHomogeneousMatrix & cMo, vpColVecto vpCircle c(featureEllipse_Circle_list[i].firstParam); c.track(cMo); vpFeatureBuilder::create(fe, c); - err.stackMatrices(fe.error(*(featureEllipse_Circle_list[i].desiredFeature))); - L.stackMatrices(fe.interaction()); + err.stack(fe.error(*(featureEllipse_Circle_list[i].desiredFeature))); + L.stack(fe.interaction()); } //--------------vpFeatureLine-------------- @@ -355,8 +353,8 @@ void vpPoseFeatures::error_and_interaction(vpHomogeneousMatrix & cMo, vpColVecto vpLine l(featureLine_Line_list[i].firstParam); l.track(cMo); vpFeatureBuilder::create(fl, l); - err.stackMatrices(fl.error(*(featureLine_Line_list[i].desiredFeature))); - L.stackMatrices(fl.interaction()); + err.stack(fl.error(*(featureLine_Line_list[i].desiredFeature))); + L.stack(fl.interaction()); } //From Duo of vpCylinder / Integer if( i < featureLine_DuoLineInt_List.size() ){ @@ -364,8 +362,8 @@ void vpPoseFeatures::error_and_interaction(vpHomogeneousMatrix & cMo, vpColVecto vpCylinder c(featureLine_DuoLineInt_List[i].firstParam); c.track(cMo); vpFeatureBuilder::create(fl, c, featureLine_DuoLineInt_List[i].secondParam); - err.stackMatrices(fl.error(*(featureLine_DuoLineInt_List[i].desiredFeature))); - L.stackMatrices(fl.interaction()); + err.stack(fl.error(*(featureLine_DuoLineInt_List[i].desiredFeature))); + L.stack(fl.interaction()); } //--------------vpFeatureSegment-------------- @@ -377,16 +375,16 @@ void vpPoseFeatures::error_and_interaction(vpHomogeneousMatrix & cMo, vpColVecto p1.track(cMo); p2.track(cMo); vpFeatureBuilder::create(fs, p1, p2); - err.stackMatrices(fs.error(*(featureSegment_DuoPoints_list[i].desiredFeature))); - L.stackMatrices(fs.interaction()); + err.stack(fs.error(*(featureSegment_DuoPoints_list[i].desiredFeature))); + L.stack(fs.interaction()); } #ifdef VISP_HAVE_CPP11_COMPATIBILITY //--------------Specific Feature-------------- if( i < featureSpecific_list.size() ){ featureSpecific_list[i]->createCurrent(cMo); - err.stackMatrices(featureSpecific_list[i]->error()); - L.stackMatrices(featureSpecific_list[i]->currentInteraction()); + err.stack(featureSpecific_list[i]->error()); + L.stack(featureSpecific_list[i]->currentInteraction()); } #endif } @@ -574,9 +572,4 @@ void vpPoseFeatures::computePoseRobustVVS(vpHomogeneousMatrix & cMo) } } - - - - - - +#endif //#ifdef VISP_HAVE_MODULE_VISUAL_FEATURES diff --git a/src/computer-vision/pose-estimation/vpPoseLagrange.cpp b/modules/vision/src/pose-estimation/vpPoseLagrange.cpp similarity index 91% rename from src/computer-vision/pose-estimation/vpPoseLagrange.cpp rename to modules/vision/src/pose-estimation/vpPoseLagrange.cpp index 8491fae30c50e8447c382882dcc8b976ef32b3bf..458f8640179bf729cc2f0846c1b9fc664d2d6ce6 100644 --- a/src/computer-vision/pose-estimation/vpPoseLagrange.cpp +++ b/modules/vision/src/pose-estimation/vpPoseLagrange.cpp @@ -1,47 +1,43 @@ /**************************************************************************** -* -* $Id: vpPoseLagrange.cpp 5198 2015-01-23 17:32:04Z fspindle $ -* -* This file is part of the ViSP software. -* Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -* -* This software is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* ("GPL") version 2 as published by the Free Software Foundation. -* See the file LICENSE.txt at the root directory of this source -* distribution for additional information about the GNU GPL. -* -* For using ViSP with software that can not be combined with the GNU -* GPL, please contact INRIA about acquiring a ViSP Professional -* Edition License. -* -* See http://www.irisa.fr/lagadic/visp/visp.html for more information. -* -* This software was developed at: -* INRIA Rennes - Bretagne Atlantique -* Campus Universitaire de Beaulieu -* 35042 Rennes Cedex -* France -* http://www.irisa.fr/lagadic -* -* If you have questions regarding the use of this file, please contact -* INRIA at visp@inria.fr -* -* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -* -* -* Description: -* Pose computation. -* -* Authors: -* Eric Marchand -* Francois Chaumette -* -*****************************************************************************/ - - -#include <visp/vpPose.h> + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Pose computation. + * + * Authors: + * Eric Marchand + * Francois Chaumette + * + *****************************************************************************/ + + +#include <visp3/vision/vpPose.h> #define DEBUG_LEVEL1 0 #define DEBUG_LEVEL2 0 diff --git a/src/computer-vision/pose-estimation/vpPoseLowe.cpp b/modules/vision/src/pose-estimation/vpPoseLowe.cpp similarity index 87% rename from src/computer-vision/pose-estimation/vpPoseLowe.cpp rename to modules/vision/src/pose-estimation/vpPoseLowe.cpp index 0e08327bdde039dacea9cd844ff5d7eb42ddd4b1..5a2a9645d75d2991bc4d216b0b75b34c38595ca6 100644 --- a/src/computer-vision/pose-estimation/vpPoseLowe.cpp +++ b/modules/vision/src/pose-estimation/vpPoseLowe.cpp @@ -1,44 +1,40 @@ /**************************************************************************** -* -* $Id: vpPoseLowe.cpp 5107 2015-01-05 07:47:13Z fspindle $ -* -* This file is part of the ViSP software. -* Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -* -* This software is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* ("GPL") version 2 as published by the Free Software Foundation. -* See the file LICENSE.txt at the root directory of this source -* distribution for additional information about the GNU GPL. -* -* For using ViSP with software that can not be combined with the GNU -* GPL, please contact INRIA about acquiring a ViSP Professional -* Edition License. -* -* See http://www.irisa.fr/lagadic/visp/visp.html for more information. -* -* This software was developed at: -* INRIA Rennes - Bretagne Atlantique -* Campus Universitaire de Beaulieu -* 35042 Rennes Cedex -* France -* http://www.irisa.fr/lagadic -* -* If you have questions regarding the use of this file, please contact -* INRIA at visp@inria.fr -* -* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -* -* -* Description: -* Pose computation. -* -* Authors: -* Eric Marchand -* Francois Chaumette -* -*****************************************************************************/ + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Pose computation. + * + * Authors: + * Eric Marchand + * Francois Chaumette + * + *****************************************************************************/ #include <math.h> #include <float.h> @@ -47,8 +43,8 @@ // besoin de la librairie mathematique, en particulier des // fonctions de minimisation de Levenberg Marquartd -#include <visp/vpLevenbergMarquartd.h> -#include <visp/vpPose.h> +#include <visp3/vision/vpLevenbergMarquartd.h> +#include <visp3/vision/vpPose.h> #define NBR_PAR 6 #define X3_SIZE 3 diff --git a/src/computer-vision/pose-estimation/vpPoseRansac.cpp b/modules/vision/src/pose-estimation/vpPoseRansac.cpp similarity index 51% rename from src/computer-vision/pose-estimation/vpPoseRansac.cpp rename to modules/vision/src/pose-estimation/vpPoseRansac.cpp index 9e74a48f57870e6e29495fb6e1fc0e465124f9e2..70ee46bc1ce4afe9297fd335dced88668440ef8a 100644 --- a/src/computer-vision/pose-estimation/vpPoseRansac.cpp +++ b/modules/vision/src/pose-estimation/vpPoseRansac.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPoseRansac.cpp 5211 2015-01-26 17:44:35Z strinh $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pose computation. * @@ -52,14 +48,15 @@ #include <limits> // numeric_limits #include <stdlib.h> #include <algorithm> // std::count -#include <float.h> //DBL_MAX +#include <float.h> // DBL_MAX -#include <visp/vpPose.h> -#include <visp/vpColVector.h> -#include <visp/vpRansac.h> -#include <visp/vpTime.h> -#include <visp/vpList.h> -#include <visp/vpPoseException.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpRansac.h> +#include <visp3/core/vpTime.h> +#include <visp3/core/vpList.h> +#include <visp3/vision/vpPoseException.h> +#include <visp3/core/vpMath.h> #define eps 1e-6 @@ -74,6 +71,9 @@ */ bool vpPose::poseRansac(vpHomogeneousMatrix & cMo, bool (*func)(vpHomogeneousMatrix *)) { + ransacInliers.clear(); + ransacInlierIndex.clear(); + srand(0); //Fix seed here so we will have the same pseudo-random series at each run. std::vector<unsigned int> best_consensus; std::vector<unsigned int> cur_consensus; @@ -177,6 +177,17 @@ bool vpPose::poseRansac(vpHomogeneousMatrix & cMo, bool (*func)(vpHomogeneousMat // std::cerr << e.what() << std::endl; } + //If residual returned is not a number (NAN), set valid to false + if(vpMath::isNaN(r_lagrange)) { + is_valid_lagrange = false; + r_lagrange = DBL_MAX; + } + + if(vpMath::isNaN(r_dementhon)) { + is_valid_dementhon = false; + r_dementhon = DBL_MAX; + } + //If at least one pose computation is OK, //we can continue, otherwise pick another random set if(is_valid_lagrange || is_valid_dementhon) { @@ -259,7 +270,7 @@ bool vpPose::poseRansac(vpHomogeneousMatrix & cMo, bool (*func)(vpHomogeneousMat nbTrials++; if(nbTrials >= ransacMaxTrials) { - vpERROR_TRACE("Ransac reached the maximum number of trials"); +// vpERROR_TRACE("Ransac reached the maximum number of trials"); foundSolution = true; } } @@ -267,20 +278,20 @@ bool vpPose::poseRansac(vpHomogeneousMatrix & cMo, bool (*func)(vpHomogeneousMat nbTrials++; if(nbTrials >= ransacMaxTrials) { - vpERROR_TRACE("Ransac reached the maximum number of trials"); +// vpERROR_TRACE("Ransac reached the maximum number of trials"); } } } else { nbTrials++; if(nbTrials >= ransacMaxTrials) { - vpERROR_TRACE("Ransac reached the maximum number of trials"); +// vpERROR_TRACE("Ransac reached the maximum number of trials"); } } } if(foundSolution) { - //std::cout << "Nombre d'inliers " << nbInliers << std::endl ; +// std::cout << "Nombre d'inliers " << nbInliers << std::endl ; //Display the random picked points /* @@ -315,6 +326,9 @@ bool vpPose::poseRansac(vpHomogeneousMatrix & cMo, bool (*func)(vpHomogeneousMat ransacInliers.push_back(pt); } + //Update the list of inlier index + ransacInlierIndex = best_consensus; + //Flags set if pose computation is OK bool is_valid_lagrange = false; bool is_valid_dementhon = false; @@ -339,6 +353,17 @@ bool vpPose::poseRansac(vpHomogeneousMatrix & cMo, bool (*func)(vpHomogeneousMat // std::cerr << e.what() << std::endl; } + //If residual returned is not a number (NAN), set valid to false + if(vpMath::isNaN(r_lagrange)) { + is_valid_lagrange = false; + r_lagrange = DBL_MAX; + } + + if(vpMath::isNaN(r_dementhon)) { + is_valid_dementhon = false; + r_dementhon = DBL_MAX; + } + if(is_valid_lagrange || is_valid_dementhon) { if (r_lagrange < r_dementhon) { cMo = cMo_lagrange; @@ -349,6 +374,13 @@ bool vpPose::poseRansac(vpHomogeneousMatrix & cMo, bool (*func)(vpHomogeneousMat pose.setCovarianceComputation(computeCovariance); pose.computePose(vpPose::VIRTUAL_VS, cMo); + + //In some rare cases, the final pose could not respect the pose criterion even + //if the 4 minimal points picked respect the pose criterion. + if(func != NULL && !func(&cMo)) { + return false; + } + if(computeCovariance) { covarianceMatrix = pose.covarianceMatrix; } @@ -401,10 +433,9 @@ void vpPose::findMatch(std::vector<vpPoint> &p2D, { for(unsigned int j = 0 ; j < p3D.size() ; j++) { - vpPoint pt; + vpPoint pt(p3D[j].getWorldCoordinates()); pt.set_x(p2D[i].get_x()); pt.set_y(p2D[i].get_y()); - pt.setWorldCoordinates(p3D[j].getWorldCoordinates()); pose.addPoint(pt); nbPts++; } @@ -429,427 +460,6 @@ void vpPose::findMatch(std::vector<vpPoint> &p2D, } } -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS - -/* -\brief - -determines if there more than one the same point in the chosen set of point - -point are coded this way -x1,y1, X1, Y1, Z1 -xnm, ynm, Xnm, Ynm, Znm - -leading to 5*n*m -*/ -bool -vpPose::degenerateConfiguration(vpColVector &x, unsigned int *ind) -{ - - // vpTRACE("%p %p %d",&x, ind, x.getRows()) ; - for (int i=1 ; i < 4 ; i++) - for (int j=0 ; j<i ; j++) - { - unsigned int indi = 5*ind[i] ; - unsigned int indj = 5*ind[j] ; - - if ((fabs(x[indi] - x[indj]) < 1e-6) && (fabs(x[indi+1] - x[indj+1]) < 1e-6)) - { return true ; } - - if ((fabs(x[indi+2] - x[indj+2]) < 1e-6) && (fabs(x[indi+3] - x[indj+3]) < 1e-6) && (fabs(x[indi+4] - x[indj+4]) < 1e-6)) - { return true ; } - } - - return false ; -} -/*! - \deprecated Fit model to this random selection of data points. \n \n - We chose the Dementhon algorithm to compute the pose. -*/ -void -vpPose::computeTransformation(vpColVector &x, unsigned int *ind, vpColVector &M) -{ - unsigned int i ; - - vpPoint p[4] ; - - vpPose pose ; - pose.clearPoint() ; - for(i=0 ; i < 4 ; i++) - { - - unsigned int index = 5*ind[i] ; - - p[i].set_x(x[index]) ; - p[i].set_y(x[index+1]) ; - - p[i].setWorldCoordinates(x[index+2],x[index+3], x[index+4]) ; - pose.addPoint(p[i]) ; - } - - - // pose.printPoint() ; - vpHomogeneousMatrix cMo ; - try { - pose.computePose(vpPose::DEMENTHON, cMo) ; - // std::cout << cMo << std::endl ; - } - catch(...) - { - cMo.setIdentity() ; - } - - M.resize(16) ; - for (i=0 ; i <16 ; i++) - { - M[i] = cMo.data[i] ; - } - -} - - -/*! - \deprecated Evaluate distances between points and model. \n \n - This function can certainly be optimized... -*/ - -double -vpPose::computeResidual(const vpColVector &x, const vpColVector &M, vpColVector &d) -{ - - unsigned int i ; - unsigned int n = x.getRows()/5 ; - - vpPoint *p; - p = new vpPoint [n] ; - { - // firsttime=1 ; - for( i=0 ; i < n ; i++) - { - p[i].setWorldCoordinates(x[5*i+2],x[5*i+3], x[5*i+4]) ; - } - } - - vpHomogeneousMatrix cMo ; - for (i=0 ; i <16 ; i++) - { - cMo.data[i] = M[i]; - } - - - d.resize(n) ; - vpColVector cP, xy ; - - for( i=0 ; i < n ; i++) - { - p[i].changeFrame(cMo,cP) ; - p[i].projection(cP,xy) ; - d[i] = sqrt(vpMath::sqr(x[5*i]-xy[0])+vpMath::sqr(x[5*i+1]-xy[1])) ; - } - - delete [] p; - - return 0 ; -} - -void -vpPose::initRansac(const unsigned int n, - const double *x, const double *y, - const unsigned int m, - const double *X, const double *Y, const double *Z, - vpColVector &data) -{ - data.resize(5*n*m) ; - unsigned int k =0 ; - for (unsigned int i=0 ; i < n ; i++) - { - for (unsigned int j=0 ; j < m ; j++) - { - data[k] = x[i] ; - data[k+1] = y[i] ; - data[k+2] = X[j] ; - data[k+3] = Y[j] ; - data[k+4] = Z[j] ; - - k+=5 ; - } - } -} - - -/*! - \deprecated - Compute the pose from a set of n 2D point (x,y) and m 3D points - (X,Y,Z) using the Ransac algorithm. It is not assumed that - the 2D and 3D points are registred (there is nm posibilities). \n \n - At least numberOfInlierToReachAConsensus of true correspondance are required - to validate the pose. \n \n - The inliers are given in xi, yi, Xi, Yi, Zi. \n - The pose is returned in cMo. - - \param n : Number of 2d points. - \param x : Array (of size \e n) of the x coordinates of the 2d points. - \param y : Array (of size \e n) of the y coordinates of the 2d points. - \param m : Number of 3d points. - \param X : Array (of size \e m) of the oX coordinates of the 3d points. - \param Y : Array (of size \e m) of the oY coordinates of the 3d points. - \param Z : Array (of size \e m) of the oZ coordinates of the 3d points. - \param numberOfInlierToReachAConsensus : The minimum number of inlier to have - to consider a trial as correct. - \param threshold : The maximum error allowed between the 2d points and the - reprojection of its associated 3d points by the current pose (in meter). - \param ninliers : Number of inliers found for the best solution. - \param xi : Array (of size \e ninliers) of the x coordinates of the inliers. - \param yi : Array (of size \e ninliers) of the y coordinates of the inliers. - \param Xi : Array (of size \e ninliers) of the oX coordinates of the inliers. - \param Yi : Array (of size \e ninliers) of the oY coordinates of the inliers. - \param Zi : Array (of size \e ninliers) of the oZ coordinates of the inliers. - \param cMo : The computed pose (best solution). - \param maxNbTrials : Maximum number of trials before considering a solution - fitting the required \e numberOfInlierToReachAConsensus and \e threshold - cannot be found. - */ -void -vpPose::ransac(const unsigned int n, - const double *x, const double *y, - const unsigned int m, - const double *X, const double *Y, const double *Z, - const int numberOfInlierToReachAConsensus, - const double threshold, - unsigned int &ninliers, - vpColVector &xi, vpColVector &yi, - vpColVector &Xi, vpColVector &Yi, vpColVector &Zi, - vpHomogeneousMatrix &cMo, - const int maxNbTrials) -{ - - - double tms = vpTime::measureTimeMs() ; - vpColVector data ; - unsigned int i; - vpPose::initRansac(n,x,y,m,X,Y,Z, data) ; - - vpColVector M(16) ; - vpColVector inliers(n*m) ; - vpRansac<vpPose>::ransac(n*m,data,4, - threshold, M,inliers, - numberOfInlierToReachAConsensus, 0.0, maxNbTrials) ; - - - // we count the number of inliers - ninliers = 0 ; - for(i=0 ; i < n*m ; i++) - { - //if (inliers[i]==1) - if (std::fabs(inliers[i]-1) <= std::fabs(vpMath::maximum(inliers[i], 1.)) * std::numeric_limits<double>::epsilon()) - { - ninliers++ ; - } - } - - xi.resize(ninliers) ; - yi.resize(ninliers) ; - Xi.resize(ninliers) ; - Yi.resize(ninliers) ; - Zi.resize(ninliers) ; - - unsigned int k =0 ; - for(i=0 ; i < n*m ; i++) - { - //if (inliers[i]==1) - if (std::fabs(inliers[i]-1) <= std::fabs(vpMath::maximum(inliers[i], 1.)) * std::numeric_limits<double>::epsilon()) - { - xi[k] = data[5*i] ; - yi[k] = data[5*i+1] ; - Xi[k] = data[5*i+2] ; - Yi[k] = data[5*i+3] ; - Zi[k] = data[5*i+4] ; - k++ ; - } - } - - for (i=0 ; i <16 ; i++) - { - cMo.data[i] = M[i]; - } - - std::cout << vpTime::measureTimeMs() - tms << "ms" << std::endl ; - -} - -/*! - \deprecated - Compute the pose from a set of n 2D point (x,y) in p and m 3D points - (X,Y,Z) in P using the Ransac algorithm. It is not assumed that - the 2D and 3D points are registred (there is nm posibilities). \n \n - At least numberOfInlierToReachAConsensus of true correspondance are required - to validate the pose. \n \n - The inliers are given in a list of vpPoint. \n - The pose is returned in cMo. - - \param n : Number of 2d points. - \param p : Array (of size n) of 2d points (x and y attributes are used). - \param m : Number of 3d points. - \param P : Array of size m of 3d points (oX, oY and oZ attributes are used). - \param numberOfInlierToReachAConsensus : The minimum number of inlier to have - to consider a trial as correct. - \param threshold : The maximum error allowed between the 2d points and the - reprojection of its associated 3d points by the current pose (in meter). - \param ninliers : Number of inliers found for the best solution. - \param lPi : List of points (2d and 3d) that are inliers for the best solution. - \param cMo : The computed pose (best solution). - \param maxNbTrials : Maximum number of trials before considering a solution - fitting the required \e numberOfInlierToReachAConsensus and \e threshold - cannot be found. - */ -void -vpPose::ransac(const unsigned int n, - const vpPoint *p, - const unsigned int m, - const vpPoint *P, - const int numberOfInlierToReachAConsensus, - const double threshold, - unsigned int &ninliers, - std::list<vpPoint> &lPi, - vpHomogeneousMatrix &cMo, - const int maxNbTrials) -{ - double *x, *y; - x = new double [n]; - y = new double [n] ; - for (unsigned int i=0 ; i < n ; i++) - { - x[i] = p[i].get_x() ; - y[i] = p[i].get_y() ; - } - double *X, *Y, *Z; - X = new double [m]; - Y = new double [m]; - Z = new double [m]; - for (unsigned int i=0 ; i < m ; i++) - { - X[i] = P[i].get_oX() ; - Y[i] = P[i].get_oY() ; - Z[i] = P[i].get_oZ() ; - } - - vpColVector xi,yi,Xi,Yi,Zi ; - - ransac(n,x,y, - m,X,Y,Z, numberOfInlierToReachAConsensus, - threshold, - ninliers, - xi,yi,Xi,Yi,Zi, - cMo, maxNbTrials) ; - - for(unsigned int i=0 ; i < ninliers ; i++) - { - vpPoint Pi ; - Pi.setWorldCoordinates(Xi[i], Yi[i], Zi[i]) ; - Pi.set_x(xi[i]) ; - Pi.set_y(yi[i]) ; - lPi.push_back(Pi) ; - } - - delete [] x; - delete [] y; - delete [] X; - delete [] Y; - delete [] Z; -} - -/*! - \deprecated - Compute the pose from a list lp of 2D point (x,y) and a list lP 3D points - (X,Y,Z) in P using the Ransac algorithm. It is not assumed that - the 2D and 3D points are registred. \n \n - At least numberOfInlierToReachAConsensus of true correspondance are required - to validate the pose. \n \n - The inliers are given in a list of vpPoint lPi. \n - The pose is returned in cMo. - - \param lp : List of 2d points (x and y attributes are used). - \param lP : List of 3d points (oX, oY and oZ attributes are used). - \param numberOfInlierToReachAConsensus : The minimum number of inlier to have - to consider a trial as correct. - \param threshold : The maximum error allowed between the 2d points and the - reprojection of its associated 3d points by the current pose (in meter). - \param ninliers : Number of inliers found for the best solution. - \param lPi : List of points (2d and 3d) that are inliers for the best solution. - \param cMo : The computed pose (best solution). - \param maxNbTrials : Maximum number of trials before considering a solution - fitting the required \e numberOfInlierToReachAConsensus and \e threshold - cannot be found. - */ -void -vpPose::ransac(std::list<vpPoint> &lp, - std::list<vpPoint> &lP, - const int numberOfInlierToReachAConsensus, - const double threshold, - unsigned int &ninliers, - std::list<vpPoint> &lPi, - vpHomogeneousMatrix &cMo, - const int maxNbTrials) -{ - unsigned int i; - unsigned int n = (unsigned int)lp.size() ; - unsigned int m = (unsigned int)lP.size() ; - - double *x, *y; - x = new double [n]; - y = new double [n]; - - vpPoint pin ; - i = 0; - for (std::list<vpPoint>::const_iterator it = lp.begin(); it != lp.end(); ++it) - { - pin = *it; - x[i] = pin.get_x() ; - y[i] = pin.get_y() ; - ++ i; - } - - double *X, *Y, *Z; - X = new double [m]; - Y = new double [m]; - Z = new double [m]; - i = 0; - for (std::list<vpPoint>::const_iterator it = lP.begin(); it != lP.end(); ++it) - { - pin = *it; - X[i] = pin.get_oX() ; - Y[i] = pin.get_oY() ; - Z[i] = pin.get_oZ() ; - ++i; - } - - vpColVector xi,yi,Xi,Yi,Zi ; - - ransac(n,x,y, - m,X,Y,Z, numberOfInlierToReachAConsensus, - threshold, - ninliers, - xi,yi,Xi,Yi,Zi, - cMo, maxNbTrials) ; - - for( i=0 ; i < ninliers ; i++) - { - vpPoint Pi ; - Pi.setWorldCoordinates(Xi[i],Yi[i], Zi[i]) ; - Pi.set_x(xi[i]) ; - Pi.set_y(yi[i]) ; - lPi.push_back(Pi); - } - - delete [] x; - delete [] y; - delete [] X; - delete [] Y; - delete [] Z; - -} -#endif // VISP_BUILD_DEPRECATED_FUNCTIONS - /* * Local variables: * c-basic-offset: 2 diff --git a/src/computer-vision/pose-estimation/vpPoseVirtualVisualServoing.cpp b/modules/vision/src/pose-estimation/vpPoseVirtualVisualServoing.cpp old mode 100755 new mode 100644 similarity index 90% rename from src/computer-vision/pose-estimation/vpPoseVirtualVisualServoing.cpp rename to modules/vision/src/pose-estimation/vpPoseVirtualVisualServoing.cpp index fa9477c03bad25b50fa8822c69a7d7b3de3fe332..21e4955d4c23752f73e28b835695a5a8edcfa490 --- a/src/computer-vision/pose-estimation/vpPoseVirtualVisualServoing.cpp +++ b/modules/vision/src/pose-estimation/vpPoseVirtualVisualServoing.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpPoseVirtualVisualServoing.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pose computation. * @@ -44,12 +40,10 @@ \brief Compute the pose using virtual visual servoing approach */ -#include <visp/vpPose.h> -#include <visp/vpPoint.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpExponentialMap.h> -#include <visp/vpRobust.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpExponentialMap.h> +#include <visp3/core/vpRobust.h> /*! \brief Compute the pose using virtual visual servoing approach @@ -91,6 +85,7 @@ vpPose::poseVirtualVS(vpHomogeneousMatrix & cMo) k ++; } + vpHomogeneousMatrix cMoPrev = cMo; while((int)((residu_1 - r)*1e12) !=0) { residu_1 = r ; @@ -139,12 +134,13 @@ vpPose::poseVirtualVS(vpHomogeneousMatrix & cMo) //std::cout << "r=" << r <<std::endl ; // update the pose + cMoPrev = cMo; cMo = vpExponentialMap::direct(v).inverse()*cMo ; ; if (iter++>vvsIterMax) break ; } if(computeCovariance) - covarianceMatrix = vpMatrix::computeCovarianceMatrix(L,v,-lambda*err); + covarianceMatrix = vpMatrix::computeCovarianceMatrixVVS(cMoPrev, err, L); } catch(...) @@ -156,7 +152,7 @@ vpPose::poseVirtualVS(vpHomogeneousMatrix & cMo) /*! \brief Compute the pose using virtual visual servoing approach and - a robust cotrol law + a robust control law This approach is described in \cite Comport06b. diff --git a/test/homography/testDisplacement.cpp b/modules/vision/test/homography/testDisplacement.cpp similarity index 68% rename from test/homography/testDisplacement.cpp rename to modules/vision/test/homography/testDisplacement.cpp index 1f9c5abe10f944b7dcfe58f9ab568aed984d65e6..cfcec291716dc64f2173f58089ca626815f90e05 100644 --- a/test/homography/testDisplacement.cpp +++ b/modules/vision/test/homography/testDisplacement.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testDisplacement.cpp 4833 2014-08-28 14:21:46Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Tests transformation within various representations of rotation. * @@ -47,89 +43,48 @@ /*! \example testDisplacement.cpp - - */ -#include <visp/vpMath.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomography.h> -#include <visp/vpDebug.h> -#include <visp/vpThetaUVector.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpThetaUVector.h> #include <stdlib.h> #include <stdio.h> -// List of allowed command line options -#define GETOPTARGS "h" - -void usage(const char *name, const char *badparam); -bool getOptions(int argc, const char **argv); - -/*! - - Print the program options. - -*/ -void usage(const char *name, const char *badparam) +bool test(const std::string &s, const vpHomography &H, const std::vector<double> &bench) { - fprintf(stdout, "\n\ -Tests transformation within various representations of rotation.\n\ -\n\ -SYNOPSIS\n\ - %s [-h]\n", name); - - fprintf(stdout, "\n\ -OPTIONS: Default\n\ - -h\n\ - Print the help.\n"); - - if (badparam) - fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); -} -/*! - - Set the program options. - - \return false if the program has to be stopped, true otherwise. - -*/ -bool getOptions(int argc, const char **argv) -{ - const char *optarg_; - int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { - - switch (c) { - case 'h': usage(argv[0], NULL); return false; break; - - default: - usage(argv[0], optarg_); - return false; break; - } - } - - if ((c == 1) || (c == -1)) { - // standalone param or error - usage(argv[0], NULL); - std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; + static unsigned int cpt = 0; + std::cout << "** Test " << ++cpt << std::endl; + std::cout << s << "(" << H.getRows() << "," << H.getCols() << ") = \n[" << H << "]" << std::endl; + if(bench.size() != H.size()) { + std::cout << "Test fails: bad size wrt bench" << std::endl; return false; } + for (unsigned int i=0; i<H.size(); i++) { + if (std::fabs(H.data[i]-bench[i]) > std::fabs(H.data[i])*std::numeric_limits<double>::epsilon()) { + std::cout << "Test fails: bad content" << std::endl; + return false; + } + } return true; } - - -int -main(int argc, const char ** argv) +int main() { try { - // Read the command line options - if (getOptions(argc, argv) == false) { - exit (-1); + int err = 1; + { + vpHomography H; + H.eye(); + std::vector<double> bench(9, 0); + bench[0] = bench[4] = bench[8] = 1.; + if (test("H", H, bench) == false) + return err; + if (test("H", H/H[2][2], bench) == false) + return err; } - { vpThetaUVector tu(vpMath::rad(90), vpMath::rad(120), vpMath::rad(45)) ; @@ -228,6 +183,7 @@ main(int argc, const char ** argv) H.buildFrom(R,T,p1) ; std::cout << "H" << std::endl << H << std::endl ; } + std::cout << "All tests succeed" << std::endl; return 0; } catch(vpException e) { diff --git a/modules/vision/test/key-point/testKeyPoint-2.cpp b/modules/vision/test/key-point/testKeyPoint-2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5a24654fc9f47de20c00021da435940285923626 --- /dev/null +++ b/modules/vision/test/key-point/testKeyPoint-2.cpp @@ -0,0 +1,437 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test keypoint matching and pose estimation. + * + * Authors: + * Souriya Trinh + * + *****************************************************************************/ + +#include <iostream> + +#include <visp3/core/vpConfig.h> + +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020301) + +#include <visp3/vision/vpKeyPoint.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/mbt/vpMbEdgeTracker.h> +#include <visp3/io/vpParseArgv.h> + +// List of allowed command line options +#define GETOPTARGS "cdh" + +void usage(const char *name, const char *badparam); +bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); + +/*! + + Print the program options. + + \param name : Program name. + \param badparam : Bad parameter name. + +*/ +void usage(const char *name, const char *badparam) +{ + fprintf(stdout, "\n\ +Test keypoints matching.\n\ +\n\ +SYNOPSIS\n\ + %s [-c] [-d] [-h]\n", name); + + fprintf(stdout, "\n\ +OPTIONS: \n\ +\n\ + -c\n\ + Disable the mouse click. Useful to automaze the \n\ + execution of this program without humain intervention.\n\ +\n\ + -d \n\ + Turn off the display.\n\ +\n\ + -h\n\ + Print the help.\n"); + + if (badparam) + fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); +} + +/*! + + Set the program options. + + \param argc : Command line number of parameters. + \param argv : Array of command line parameters. + \param click_allowed : Mouse click activation. + \param display : Display activation. + \return false if the program has to be stopped, true otherwise. + +*/ +bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display) +{ + const char *optarg_; + int c; + while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { + + switch (c) { + case 'c': click_allowed = false; break; + case 'd': display = false; break; + case 'h': usage(argv[0], NULL); return false; break; + + default: + usage(argv[0], optarg_); + return false; break; + } + } + + if ((c == 1) || (c == -1)) { + // standalone param or error + usage(argv[0], NULL); + std::cerr << "ERROR: " << std::endl; + std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; + return false; + } + + return true; +} + +/*! + \example testKeyPoint-2.cpp + + \brief Test keypoint matching and pose estimation. +*/ +int main(int argc, const char ** argv) { + try { + std::string env_ipath; + bool opt_click_allowed = true; + bool opt_display = true; + + // Read the command line options + if (getOptions(argc, argv, opt_click_allowed, opt_display) == false) { + exit (-1); + } + + //Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value + env_ipath = vpIoTools::getViSPImagesDataPath(); + + if(env_ipath.empty()) { + std::cerr << "Please set the VISP_INPUT_IMAGE_PATH environment variable value." << std::endl; + return -1; + } + + vpImage<unsigned char> I; + + //Set the path location of the image sequence + std::string dirname = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube"); + + //Build the name of the image files + std::string filenameRef = vpIoTools::createFilePath(dirname, "image0000.pgm"); + vpImageIo::read(I, filenameRef); + std::string filenameCur = vpIoTools::createFilePath(dirname, "image%04d.pgm"); + +#if defined VISP_HAVE_X11 + vpDisplayX display; +#elif defined VISP_HAVE_GTK + vpDisplayGTK display; +#elif defined VISP_HAVE_GDI + vpDisplayGDI display; +#else + vpDisplayOpenCV display; +#endif + + if (opt_display) { + display.init(I, 0, 0, "ORB keypoints matching and pose estimation"); + } + + vpCameraParameters cam; + vpMbEdgeTracker tracker; + //Load config for tracker + std::string tracker_config_file = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube.xml"); + + bool usexml = false; +#ifdef VISP_HAVE_XML2 + tracker.loadConfigFile(tracker_config_file); + tracker.getCameraParameters(cam); + + usexml = true; +#endif + if (! usexml) { + vpMe me; + me.setMaskSize(5); + me.setMaskNumber(180); + me.setRange(8); + me.setThreshold(10000); + me.setMu1(0.5); + me.setMu2(0.5); + me.setSampleStep(4); + me.setNbTotalSample(250); + tracker.setMovingEdge(me); + cam.initPersProjWithoutDistortion(547.7367575, 542.0744058, 338.7036994, 234.5083345); + tracker.setCameraParameters(cam); + tracker.setNearClippingDistance(0.01); + tracker.setFarClippingDistance(100.0); + tracker.setClipping(tracker.getClipping() | vpMbtPolygon::FOV_CLIPPING); + } + + tracker.setAngleAppear(vpMath::rad(89)); + tracker.setAngleDisappear(vpMath::rad(89)); + + //Load CAO model + std::string cao_model_file = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube.cao"); + tracker.loadModel(cao_model_file); + + //Initialize the pose + std::string init_file = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube.init"); + if (opt_display && opt_click_allowed) { + tracker.initClick(I, init_file); + } + else + { + vpHomogeneousMatrix cMoi(0.02044769891, 0.1101505452, 0.5078963719, 2.063603907, 1.110231561, -0.4392789872); + tracker.initFromPose(I, cMoi); + } + + //Get the init pose + vpHomogeneousMatrix cMo; + tracker.getPose(cMo); + + //Init keypoints + vpKeyPoint keypoints("ORB", "ORB", "BruteForce-Hamming"); +#if (VISP_HAVE_OPENCV_VERSION >= 0x020400) + //Bug when using LSH index with FLANN and OpenCV 2.3.1. + //see http://code.opencv.org/issues/1741 (Bug #1741) + keypoints.setMatcher("FlannBased"); +#if (VISP_HAVE_OPENCV_VERSION < 0x030000) + keypoints.setDetectorParameter("ORB", "nLevels", 1); +#else + cv::Ptr<cv::ORB> orb_detector = keypoints.getDetector("ORB").dynamicCast<cv::ORB>(); + if(orb_detector != NULL) { + orb_detector->setNLevels(1); + } +#endif +#endif + + //Detect keypoints on the current image + std::vector<cv::KeyPoint> trainKeyPoints; + double elapsedTime; + keypoints.detect(I, trainKeyPoints, elapsedTime); + + //Keep only keypoints on the cube + std::vector<vpPolygon> polygons; + std::vector<std::vector<vpPoint> > roisPt; + std::pair<std::vector<vpPolygon>, std::vector<std::vector<vpPoint> > > pair = tracker.getPolygonFaces(false); + polygons = pair.first; + roisPt = pair.second; + + //Compute the 3D coordinates + std::vector<cv::Point3f> points3f; + vpKeyPoint::compute3DForPointsInPolygons(cMo, cam, trainKeyPoints, polygons, roisPt, points3f); + + //Build the reference keypoints + keypoints.buildReference(I, trainKeyPoints, points3f, false, 1); + + + //Read image 150 + filenameRef = vpIoTools::createFilePath(dirname, "image0150.pgm"); + vpImageIo::read(I, filenameRef); + + //Init pose at image 150 + cMo.buildFrom(0.02651282185, -0.03713587374, 0.6873765919, 2.314744454, 0.3492296488, -0.1226054828); + tracker.initFromPose(I, cMo); + + //Detect keypoints on the image 150 + keypoints.detect(I, trainKeyPoints, elapsedTime); + + //Keep only keypoints on the cube + pair = tracker.getPolygonFaces(false); + polygons = pair.first; + roisPt = pair.second; + + //Compute the 3D coordinates + vpKeyPoint::compute3DForPointsInPolygons(cMo, cam, trainKeyPoints, polygons, roisPt, points3f); + + //Build the reference keypoints + keypoints.buildReference(I, trainKeyPoints, points3f, true, 2); + + + //Read image 200 + filenameRef = vpIoTools::createFilePath(dirname, "image0200.pgm"); + vpImageIo::read(I, filenameRef); + + //Init pose at image 200 + cMo.buildFrom(0.02965448956, -0.07283091786, 0.7253526051, 2.300529617, -0.4286674806, 0.1788761025); + tracker.initFromPose(I, cMo); + + //Detect keypoints on the image 200 + keypoints.detect(I, trainKeyPoints, elapsedTime); + + //Keep only keypoints on the cube + pair = tracker.getPolygonFaces(false); + polygons = pair.first; + roisPt = pair.second; + + //Compute the 3D coordinates + vpKeyPoint::compute3DForPointsInPolygons(cMo, cam, trainKeyPoints, polygons, roisPt, points3f); + + //Build the reference keypoints + keypoints.buildReference(I, trainKeyPoints, points3f, true, 3); + + + //Init reader for getting the input image sequence + vpVideoReader g; + g.setFileName(filenameCur); + g.open(I); + g.acquire(I); + +#if defined VISP_HAVE_X11 + vpDisplayX display2; +#elif defined VISP_HAVE_GTK + vpDisplayGTK display2; +#elif defined VISP_HAVE_GDI + vpDisplayGDI display2; +#else + vpDisplayOpenCV display2; +#endif + + vpImage<unsigned char> IMatching; + + keypoints.createImageMatching(I, IMatching); + + if (opt_display) { + display2.init(IMatching, 0, (int)I.getHeight() + 80, "IMatching"); + } + + bool opt_click = false; + double error; + vpMouseButton::vpMouseButtonType button; + while((opt_display && !g.end()) || (!opt_display && g.getFrameIndex() < 30)) { + g.acquire(I); + + if(opt_display) { + vpDisplay::display(I); + + //Display image matching + keypoints.insertImageMatching(I, IMatching); + + vpDisplay::display(IMatching); + } + + //Match keypoints and estimate the pose + if(keypoints.matchPoint(I, cam, cMo, error, elapsedTime)) { + tracker.setCameraParameters(cam); + tracker.setPose(I, cMo); + + if(opt_display) { + tracker.display(I, cMo, cam, vpColor::red, 2); + vpDisplay::displayFrame(I, cMo, cam, 0.025, vpColor::none, 3); + + std::vector<vpImagePoint> ransacInliers = keypoints.getRansacInliers(); + std::vector<vpImagePoint> ransacOutliers = keypoints.getRansacOutliers(); + + for(std::vector<vpImagePoint>::const_iterator it = ransacInliers.begin(); it != ransacInliers.end(); ++it) { + vpDisplay::displayCircle(I, *it, 4, vpColor::green); + vpImagePoint imPt(*it); + imPt.set_u(imPt.get_u() + I.getWidth()); + imPt.set_v(imPt.get_v() + I.getHeight()); + vpDisplay::displayCircle(IMatching, imPt, 4, vpColor::green); + } + + for(std::vector<vpImagePoint>::const_iterator it = ransacOutliers.begin(); it != ransacOutliers.end(); ++it) { + vpDisplay::displayCircle(I, *it, 4, vpColor::red); + vpImagePoint imPt(*it); + imPt.set_u(imPt.get_u() + I.getWidth()); + imPt.set_v(imPt.get_v() + I.getHeight()); + vpDisplay::displayCircle(IMatching, imPt, 4, vpColor::red); + } + + keypoints.displayMatching(I, IMatching); + + //Display model in the correct sub-image in IMatching + vpCameraParameters cam2; + cam2.initPersProjWithoutDistortion(cam.get_px(), cam.get_py(), + cam.get_u0() + I.getWidth(), cam.get_v0() + I.getHeight()); + tracker.setCameraParameters(cam2); + tracker.setPose(IMatching, cMo); + tracker.display(IMatching, cMo, cam2, vpColor::red, 2); + vpDisplay::displayFrame(IMatching, cMo, cam2, 0.025, vpColor::none, 3); + } + } + + if(opt_display) { + vpDisplay::flush(I); + vpDisplay::flush(IMatching); + } + + if (opt_click_allowed && opt_display) { + //Click requested to process next image + if(opt_click) { + vpDisplay::getClick(I, button, true); + if(button == vpMouseButton::button3) { + opt_click = false; + } + } else { + //Use right click to enable/disable step by step tracking + if(vpDisplay::getClick(I, button, false)) { + if (button == vpMouseButton::button3) { + opt_click = true; + } + else if(button == vpMouseButton::button1) { + break; + } + } + } + } + } + + } catch(vpException &e) { + std::cerr << e.what() << std::endl; + return -1; + } + + std::cout << "testKeyPoint-2 is ok !" << std::endl; + return 0; +} +#else +int main() { + std::cerr << "You need OpenCV library." << std::endl; + + return 0; +} + +#endif diff --git a/modules/vision/test/key-point/testKeyPoint-3.cpp b/modules/vision/test/key-point/testKeyPoint-3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5af6d40efe23d201d2b015c7640d52bb8b3e7397 --- /dev/null +++ b/modules/vision/test/key-point/testKeyPoint-3.cpp @@ -0,0 +1,287 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test keypoint matching with mostly OpenCV functions calls + * to detect potential memory leaks in testKeyPoint.cpp. + * + * Authors: + * Souriya Trinh + * + *****************************************************************************/ + +#include <iostream> + +#include <visp3/core/vpConfig.h> + +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020301) + +#include <opencv2/core/core.hpp> +#include <opencv2/features2d/features2d.hpp> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> + +// List of allowed command line options +#define GETOPTARGS "cdh" + +void usage(const char *name, const char *badparam); +bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); + +/*! + + Print the program options. + + \param name : Program name. + \param badparam : Bad parameter name. +*/ +void usage(const char *name, const char *badparam) +{ + fprintf(stdout, "\n\ +Test keypoints matching.\n\ +\n\ +SYNOPSIS\n\ + %s [-c] [-d] [-h]\n", name); + + fprintf(stdout, "\n\ +OPTIONS: \n\ +\n\ + -c\n\ + Disable the mouse click. Useful to automate the \n\ + execution of this program without human intervention.\n\ +\n\ + -d \n\ + Turn off the display.\n\ +\n\ + -h\n\ + Print the help.\n"); + + if (badparam) + fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); +} + +/*! + + Set the program options. + + \param argc : Command line number of parameters. + \param argv : Array of command line parameters. + \param click_allowed : Mouse click activation. + \param display : Display activation. + \return false if the program has to be stopped, true otherwise. + +*/ +bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display) +{ + const char *optarg_; + int c; + while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { + + switch (c) { + case 'c': click_allowed = false; break; + case 'd': display = false; break; + case 'h': usage(argv[0], NULL); return false; break; + + default: + usage(argv[0], optarg_); + return false; break; + } + } + + if ((c == 1) || (c == -1)) { + // standalone param or error + usage(argv[0], NULL); + std::cerr << "ERROR: " << std::endl; + std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; + return false; + } + + return true; +} + +/*! + \example testKeyPoint-3.cpp + + \brief Test keypoint matching with mostly OpenCV functions calls + to detect potential memory leaks in testKeyPoint.cpp. +*/ +int main(int argc, const char ** argv) { + try { + std::string env_ipath; + bool opt_click_allowed = true; + bool opt_display = true; + + // Read the command line options + if (getOptions(argc, argv, opt_click_allowed, opt_display) == false) { + exit (-1); + } + + //Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value + env_ipath = vpIoTools::getViSPImagesDataPath(); + + if(env_ipath.empty()) { + std::cerr << "Please set the VISP_INPUT_IMAGE_PATH environment variable value." << std::endl; + return -1; + } + + vpImage<unsigned char> Iref, Icur, Imatch; + + //Set the path location of the image sequence + std::string dirname = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube"); + + //Build the name of the image files + std::string filenameRef = vpIoTools::createFilePath(dirname, "image0000.pgm"); + vpImageIo::read(Iref, filenameRef); + std::string filenameCur = vpIoTools::createFilePath(dirname, "image%04d.pgm"); + + //Init keypoints + cv::Ptr<cv::FeatureDetector> detector; + cv::Ptr<cv::DescriptorExtractor> extractor; + cv::Ptr<cv::DescriptorMatcher> matcher; + +#if (VISP_HAVE_OPENCV_VERSION >= 0x030000) + detector = cv::ORB::create(); + extractor = cv::ORB::create(); +#else + detector = cv::FeatureDetector::create("ORB"); + extractor = cv::DescriptorExtractor::create("ORB"); +#endif + matcher = cv::DescriptorMatcher::create("BruteForce-Hamming"); + + std::vector<cv::KeyPoint> trainKeyPoints; + cv::Mat matImg, trainDescriptors; + vpImageConvert::convert(Iref, matImg); + detector->detect(matImg, trainKeyPoints); + extractor->compute(matImg, trainKeyPoints, trainDescriptors); + + vpVideoReader g; + g.setFileName(filenameCur); + g.open(Icur); + g.acquire(Icur); + + Imatch.resize(Icur.getHeight(), 2*Icur.getWidth()); + Imatch.insert(Iref, vpImagePoint(0,0)); + +#if defined VISP_HAVE_X11 + vpDisplayX display; +#elif defined VISP_HAVE_GTK + vpDisplayGTK display; +#elif defined VISP_HAVE_GDI + vpDisplayGDI display; +#else + vpDisplayOpenCV display; +#endif + + if (opt_display) { + display.init(Imatch, 0, 0, "ORB keypoints matching"); + } + + bool opt_click = false; + vpMouseButton::vpMouseButtonType button; + while(!g.end()) { + g.acquire(Icur); + Imatch.insert(Icur, vpImagePoint(0, Icur.getWidth())); + + if(opt_display) { + vpDisplay::display(Imatch); + } + + vpImageConvert::convert(Icur, matImg); + std::vector<cv::KeyPoint> queryKeyPoints; + detector->detect(matImg, queryKeyPoints); + + cv::Mat queryDescriptors; + extractor->compute(matImg, queryKeyPoints, queryDescriptors); + + std::vector<std::vector<cv::DMatch> > knn_matches; + std::vector<cv::DMatch> matches; + matcher->knnMatch(queryDescriptors, trainDescriptors, knn_matches, 2); + for(std::vector<std::vector<cv::DMatch> >::const_iterator it = knn_matches.begin(); it != knn_matches.end(); ++it) { + if(it->size() > 1) { + double ratio = (*it)[0].distance / (*it)[1].distance; + if(ratio < 0.85) { + matches.push_back((*it)[0]); + } + } + } + + if(opt_display) { + for(std::vector<cv::DMatch>::const_iterator it = matches.begin(); it != matches.end(); ++it) { + vpImagePoint leftPt(trainKeyPoints[(size_t) it->trainIdx].pt.y, trainKeyPoints[(size_t) it->trainIdx].pt.x); + vpImagePoint rightPt(queryKeyPoints[(size_t) it->queryIdx].pt.y, queryKeyPoints[(size_t) it->queryIdx].pt.x + + Iref.getWidth()); + vpDisplay::displayLine(Imatch, leftPt, rightPt, vpColor::green); + } + + vpDisplay::flush(Imatch); + } + + //Click requested to process next image + if (opt_click_allowed && opt_display) { + if(opt_click) { + vpDisplay::getClick(Imatch, button, true); + if(button == vpMouseButton::button3) { + opt_click = false; + } + } else { + //Use right click to enable/disable step by step tracking + if(vpDisplay::getClick(Imatch, button, false)) { + if (button == vpMouseButton::button3) { + opt_click = true; + } + else if(button == vpMouseButton::button1) { + break; + } + } + } + } + } + + } catch(vpException &e) { + std::cerr << e.what() << std::endl; + return -1; + } + + std::cout << "testKeyPoint-3 is ok !" << std::endl; + return 0; +} +#else +int main() { + std::cerr << "You need OpenCV library." << std::endl; + + return 0; +} + +#endif diff --git a/modules/vision/test/key-point/testKeyPoint-4.cpp b/modules/vision/test/key-point/testKeyPoint-4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c8d3ed93ead1d4513afb0446bf264eb03e1354d7 --- /dev/null +++ b/modules/vision/test/key-point/testKeyPoint-4.cpp @@ -0,0 +1,406 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test keypoint matching and pose estimation with mostly OpenCV functions calls + * to detect potential memory leaks in testKeyPoint-2.cpp. + * + * Authors: + * Souriya Trinh + * + *****************************************************************************/ + +#include <iostream> + +#include <visp3/core/vpConfig.h> + +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020301) + +#include <opencv2/core/core.hpp> +#include <opencv2/features2d/features2d.hpp> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/mbt/vpMbEdgeTracker.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vision/vpKeyPoint.h> + +// List of allowed command line options +#define GETOPTARGS "cdh" + +void usage(const char *name, const char *badparam); +bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); + +/*! + + Print the program options. + + \param name : Program name. + \param badparam : Bad parameter name. + +*/ +void usage(const char *name, const char *badparam) +{ + fprintf(stdout, "\n\ +Test keypoints matching.\n\ +\n\ +SYNOPSIS\n\ + %s [-c] [-d] [-h]\n", name); + + fprintf(stdout, "\n\ +OPTIONS: \n\ +\n\ + -c\n\ + Disable the mouse click. Useful to automate the \n\ + execution of this program without human intervention.\n\ +\n\ + -d \n\ + Turn off the display.\n\ +\n\ + -h\n\ + Print the help.\n"); + + if (badparam) + fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); +} + +/*! + + Set the program options. + + \param argc : Command line number of parameters. + \param argv : Array of command line parameters. + \param click_allowed : Mouse click activation. + \param display : Display activation. + \return false if the program has to be stopped, true otherwise. + +*/ +bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display) +{ + const char *optarg_; + int c; + while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { + + switch (c) { + case 'c': click_allowed = false; break; + case 'd': display = false; break; + case 'h': usage(argv[0], NULL); return false; break; + + default: + usage(argv[0], optarg_); + return false; break; + } + } + + if ((c == 1) || (c == -1)) { + // standalone param or error + usage(argv[0], NULL); + std::cerr << "ERROR: " << std::endl; + std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; + return false; + } + + return true; +} + +/*! + \example testKeyPoint-4.cpp + + \brief Test keypoint matching and pose estimation with mostly OpenCV functions calls + to detect potential memory leaks in testKeyPoint-2.cpp. +*/ +int main(int argc, const char ** argv) { + try { + std::string env_ipath; + bool opt_click_allowed = true; + bool opt_display = true; + + // Read the command line options + if (getOptions(argc, argv, opt_click_allowed, opt_display) == false) { + exit (-1); + } + + //Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value + env_ipath = vpIoTools::getViSPImagesDataPath(); + + if(env_ipath.empty()) { + std::cerr << "Please set the VISP_INPUT_IMAGE_PATH environment variable value." << std::endl; + return -1; + } + + vpImage<unsigned char> I, Imatch, Iref; + + //Set the path location of the image sequence + std::string dirname = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube"); + + //Build the name of the image files + std::string filenameRef = vpIoTools::createFilePath(dirname, "image0000.pgm"); + vpImageIo::read(I, filenameRef); + Iref = I; + std::string filenameCur = vpIoTools::createFilePath(dirname, "image%04d.pgm"); + +#if defined VISP_HAVE_X11 + vpDisplayX display, display2; +#elif defined VISP_HAVE_GTK + vpDisplayGTK display, display2; +#elif defined VISP_HAVE_GDI + vpDisplayGDI display, display2; +#else + vpDisplayOpenCV display, display2; +#endif + + if (opt_display) { + display.init(I, 0, 0, "ORB keypoints matching"); + Imatch.resize(I.getHeight(), 2*I.getWidth()); + Imatch.insert(I, vpImagePoint(0, 0)); + display2.init(Imatch, 0, (int)I.getHeight() + 70, "ORB keypoints matching"); + } + + vpCameraParameters cam; + vpMbEdgeTracker tracker; + //Load config for tracker + std::string tracker_config_file = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube.xml"); + + bool usexml = false; +#ifdef VISP_HAVE_XML2 + tracker.loadConfigFile(tracker_config_file); + tracker.getCameraParameters(cam); + + usexml = true; +#endif + if (! usexml) { + vpMe me; + me.setMaskSize(5); + me.setMaskNumber(180); + me.setRange(8); + me.setThreshold(10000); + me.setMu1(0.5); + me.setMu2(0.5); + me.setSampleStep(4); + me.setNbTotalSample(250); + tracker.setMovingEdge(me); + cam.initPersProjWithoutDistortion(547.7367575, 542.0744058, 338.7036994, 234.5083345); + tracker.setCameraParameters(cam); + tracker.setNearClippingDistance(0.01); + tracker.setFarClippingDistance(100.0); + tracker.setClipping(tracker.getClipping() | vpMbtPolygon::FOV_CLIPPING); + } + + tracker.setAngleAppear(vpMath::rad(89)); + tracker.setAngleDisappear(vpMath::rad(89)); + + //Load CAO model + std::string cao_model_file = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube.cao"); + tracker.loadModel(cao_model_file); + + //Initialize the pose + std::string init_file = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube.init"); + if (opt_display && opt_click_allowed) { + tracker.initClick(I, init_file); + } + else + { + vpHomogeneousMatrix cMoi(0.02044769891, 0.1101505452, 0.5078963719, 2.063603907, 1.110231561, -0.4392789872); + tracker.initFromPose(I, cMoi); + } + + //Get the init pose + vpHomogeneousMatrix cMo; + tracker.getPose(cMo); + + //Init keypoints + cv::Ptr<cv::FeatureDetector> detector; + cv::Ptr<cv::DescriptorExtractor> extractor; + cv::Ptr<cv::DescriptorMatcher> matcher; + +#if (VISP_HAVE_OPENCV_VERSION >= 0x030000) + detector = cv::ORB::create(500, 1.2f, 1); + extractor = cv::ORB::create(500, 1.2f, 1); +#elif (VISP_HAVE_OPENCV_VERSION >= 0x020301) + detector = cv::FeatureDetector::create("ORB"); + extractor = cv::DescriptorExtractor::create("ORB"); +#endif + matcher = cv::DescriptorMatcher::create("BruteForce-Hamming"); + +#if (VISP_HAVE_OPENCV_VERSION >= 0x020400 && VISP_HAVE_OPENCV_VERSION < 0x030000) + detector->set("nLevels", 1); +#endif + + //Detect keypoints on the current image + std::vector<cv::KeyPoint> trainKeyPoints; + cv::Mat matImg; + vpImageConvert::convert(I, matImg); + detector->detect(matImg, trainKeyPoints); + + + //Keep only keypoints on the cube + std::vector<vpPolygon> polygons; + std::vector<std::vector<vpPoint> > roisPt; + std::pair<std::vector<vpPolygon>, std::vector<std::vector<vpPoint> > > pair = tracker.getPolygonFaces(false); + polygons = pair.first; + roisPt = pair.second; + + //Compute the 3D coordinates + std::vector<cv::Point3f> points3f; + vpKeyPoint::compute3DForPointsInPolygons(cMo, cam, trainKeyPoints, polygons, roisPt, points3f); + + + //Extract descriptors + cv::Mat trainDescriptors; + extractor->compute(matImg, trainKeyPoints, trainDescriptors); + + if(trainKeyPoints.size() != (size_t) trainDescriptors.rows || trainKeyPoints.size() != points3f.size()) { + std::cerr << "Problem with training data size !" << std::endl; + return -1; + } + + + //Init reader for getting the input image sequence + vpVideoReader g; + g.setFileName(filenameCur); + g.open(I); + g.acquire(I); + + bool opt_click = false; + vpMouseButton::vpMouseButtonType button; + while((opt_display && !g.end()) || (!opt_display && g.getFrameIndex() < 30)) { + g.acquire(I); + + vpImageConvert::convert(I, matImg); + std::vector<cv::KeyPoint> queryKeyPoints; + detector->detect(matImg, queryKeyPoints); + + cv::Mat queryDescriptors; + extractor->compute(matImg, queryKeyPoints, queryDescriptors); + + std::vector<std::vector<cv::DMatch> > knn_matches; + std::vector<cv::DMatch> matches; + matcher->knnMatch(queryDescriptors, trainDescriptors, knn_matches, 2); + for(std::vector<std::vector<cv::DMatch> >::const_iterator it = knn_matches.begin(); it != knn_matches.end(); ++it) { + if(it->size() > 1) { + double ratio = (*it)[0].distance / (*it)[1].distance; + if(ratio < 0.85) { + matches.push_back((*it)[0]); + } + } + } + + vpPose estimated_pose; + for(std::vector<cv::DMatch>::const_iterator it = matches.begin(); it != matches.end(); ++it) { + vpPoint pt(points3f[(size_t)(it->trainIdx)].x, + points3f[(size_t)(it->trainIdx)].y, + points3f[(size_t)(it->trainIdx)].z); + + double x = 0.0, y = 0.0; + vpPixelMeterConversion::convertPoint(cam, queryKeyPoints[(size_t)(it->queryIdx)].pt.x, queryKeyPoints[(size_t)(it->queryIdx)].pt.y, x, y); + pt.set_x(x); + pt.set_y(y); + + estimated_pose.addPoint(pt); + } + + bool is_pose_estimated = false; + if(estimated_pose.npt >= 4) { + try { + unsigned int nb_inliers = (unsigned int) (0.6 * estimated_pose.npt); + estimated_pose.setRansacNbInliersToReachConsensus(nb_inliers); + estimated_pose.setRansacThreshold(0.01); + estimated_pose.setRansacMaxTrials(500); + estimated_pose.computePose(vpPose::RANSAC, cMo); + is_pose_estimated = true; + } catch(...) { + is_pose_estimated = false; + } + } + + if(opt_display) { + vpDisplay::display(I); + + Imatch.insert(I, vpImagePoint(0, Iref.getWidth())); + vpDisplay::display(Imatch); + for(std::vector<cv::DMatch>::const_iterator it = matches.begin(); it != matches.end(); ++it) { + vpImagePoint leftPt(trainKeyPoints[(size_t) it->trainIdx].pt.y, trainKeyPoints[(size_t) it->trainIdx].pt.x); + vpImagePoint rightPt(queryKeyPoints[(size_t) it->queryIdx].pt.y, queryKeyPoints[(size_t) it->queryIdx].pt.x + + Iref.getWidth()); + vpDisplay::displayLine(Imatch, leftPt, rightPt, vpColor::green); + } + + if(is_pose_estimated) { + tracker.setPose(I, cMo); + tracker.display(I, cMo, cam, vpColor::red); + vpDisplay::displayFrame(I, cMo, cam, 0.05, vpColor::none); + } + + vpDisplay::flush(Imatch); + vpDisplay::flush(I); + } + + //Click requested to process next image + if (opt_click_allowed && opt_display) { + if(opt_click) { + vpDisplay::getClick(I, button, true); + if(button == vpMouseButton::button3) { + opt_click = false; + } + } else { + //Use right click to enable/disable step by step tracking + if(vpDisplay::getClick(I, button, false)) { + if (button == vpMouseButton::button3) { + opt_click = true; + } + else if(button == vpMouseButton::button1) { + break; + } + } + } + } + } + + } catch(vpException &e) { + std::cerr << e.what() << std::endl; + return -1; + } + + std::cout << "testKeyPoint-4 is ok !" << std::endl; + return 0; +} +#else +int main() { + std::cerr << "You need OpenCV library." << std::endl; + + return 0; +} + +#endif diff --git a/modules/vision/test/key-point/testKeyPoint-5.cpp b/modules/vision/test/key-point/testKeyPoint-5.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f254cab82589b016f02c267d2acfc2b5c12c04d2 --- /dev/null +++ b/modules/vision/test/key-point/testKeyPoint-5.cpp @@ -0,0 +1,268 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test keypoints detection with OpenCV, specially the Pyramid implementation + * feature misssing in OpenCV 3.0. + * + * Authors: + * Souriya Trinh + * + *****************************************************************************/ + +#include <iostream> + +#include <visp3/core/vpConfig.h> + +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020301) + +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vision/vpKeyPoint.h> + +// List of allowed command line options +#define GETOPTARGS "cdh" + +void usage(const char *name, const char *badparam); +bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); + +/*! + + Print the program options. + + \param name : Program name. + \param badparam : Bad parameter name. + +*/ +void usage(const char *name, const char *badparam) +{ + fprintf(stdout, "\n\ +Test keypoints detection.\n\ +\n\ +SYNOPSIS\n\ + %s [-c] [-d] [-h]\n", name); + + fprintf(stdout, "\n\ +OPTIONS: \n\ +\n\ + -c\n\ + Disable the mouse click. Useful to automaze the \n\ + execution of this program without humain intervention.\n\ +\n\ + -d \n\ + Turn off the display.\n\ +\n\ + -h\n\ + Print the help.\n"); + + if (badparam) + fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); +} + +/*! + + Set the program options. + + \param argc : Command line number of parameters. + \param argv : Array of command line parameters. + \param click_allowed : Mouse click activation. + \param display : Display activation. + \return false if the program has to be stopped, true otherwise. + +*/ +bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display) +{ + const char *optarg_; + int c; + while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { + + switch (c) { + case 'c': click_allowed = false; break; + case 'd': display = false; break; + case 'h': usage(argv[0], NULL); return false; break; + + default: + usage(argv[0], optarg_); + return false; break; + } + } + + if ((c == 1) || (c == -1)) { + // standalone param or error + usage(argv[0], NULL); + std::cerr << "ERROR: " << std::endl; + std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; + return false; + } + + return true; +} + +/*! + \example testKeyPoint-5.cpp + + \brief Test keypoints detection with OpenCV, specially the Pyramid implementation + feature missing in OpenCV 3.0. +*/ +int main(int argc, const char ** argv) { + try { + std::string env_ipath; + bool opt_click_allowed = true; + bool opt_display = true; + + // Read the command line options + if (getOptions(argc, argv, opt_click_allowed, opt_display) == false) { + exit (-1); + } + + //Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value + env_ipath = vpIoTools::getViSPImagesDataPath(); + + if(env_ipath.empty()) { + std::cerr << "Please set the VISP_INPUT_IMAGE_PATH environment variable value." << std::endl; + return -1; + } + + vpImage<unsigned char> I; + + //Set the path location of the image sequence + std::string dirname = vpIoTools::createFilePath(env_ipath, "ViSP-images/Klimt"); + + //Build the name of the image files + std::string filename = vpIoTools::createFilePath(dirname, "/Klimt.png"); + vpImageIo::read(I, filename); + +#if defined VISP_HAVE_X11 + vpDisplayX display; +#elif defined VISP_HAVE_GTK + vpDisplayGTK display; +#elif defined VISP_HAVE_GDI + vpDisplayGDI display; +#else + vpDisplayOpenCV display; +#endif + + if(opt_display) { + display.init(I, 0, 0, "KeyPoints detection."); + } + + vpKeyPoint keyPoints; + + //Will test the different types of keypoints detection to see if there is a problem + //between OpenCV versions, modules or constructors + std::vector<std::string> detectorNames; + detectorNames.push_back("PyramidFAST"); + detectorNames.push_back("FAST"); + detectorNames.push_back("PyramidMSER"); + detectorNames.push_back("MSER"); + detectorNames.push_back("PyramidGFTT"); + detectorNames.push_back("GFTT"); + detectorNames.push_back("PyramidSimpleBlob"); + detectorNames.push_back("SimpleBlob"); + //In contrib modules +#if (VISP_HAVE_OPENCV_VERSION < 0x030000) || defined(VISP_HAVE_OPENCV_XFEATURES2D) + detectorNames.push_back("PyramidSTAR"); + detectorNames.push_back("STAR"); +#endif +#if (VISP_HAVE_OPENCV_VERSION >= 0x030000) + detectorNames.push_back("PyramidAGAST"); + detectorNames.push_back("AGAST"); +#endif + detectorNames.push_back("PyramidORB"); + detectorNames.push_back("ORB"); +#if (VISP_HAVE_OPENCV_VERSION >= 0x020403) + detectorNames.push_back("PyramidBRISK"); + detectorNames.push_back("BRISK"); +#endif +#if (VISP_HAVE_OPENCV_VERSION >= 0x030000) + detectorNames.push_back("PyramidKAZE"); + detectorNames.push_back("KAZE"); + detectorNames.push_back("PyramidAKAZE"); + detectorNames.push_back("AKAZE"); +#endif + +#if defined(VISP_HAVE_OPENCV_NONFREE) || defined(VISP_HAVE_OPENCV_XFEATURES2D) + detectorNames.push_back("PyramidSIFT"); + detectorNames.push_back("SIFT"); + detectorNames.push_back("PyramidSURF"); + detectorNames.push_back("SURF"); +#endif + + for(std::vector<std::string>::const_iterator itd = detectorNames.begin(); itd != detectorNames.end(); ++itd) { + keyPoints.setDetector(*itd); + + std::vector<cv::KeyPoint> kpts; + double elapsedTime; + keyPoints.detect(I, kpts, elapsedTime); + std::cout << "Nb keypoints detected: " << kpts.size() << " for " << *itd << " method." << std::endl; + if(kpts.empty()) { + std::cerr << "No keypoints detected with " << *itd << " and image: " << filename << "." << std::endl; + return -1; + } + + if (opt_display) { + vpDisplay::display(I); + + for(std::vector<cv::KeyPoint>::const_iterator it = kpts.begin(); it != kpts.end(); ++it) { + vpImagePoint imPt; + imPt.set_uv(it->pt.x, it->pt.y); + + vpDisplay::displayCross(I, imPt, 4, vpColor::red); + } + + vpDisplay::flush(I); + + if(opt_click_allowed) { + vpDisplay::getClick(I); + } + } + } + + } catch(vpException &e) { + std::cerr << e.what() << std::endl; + return -1; + } + + std::cout << "testKeyPoint-5 is ok !" << std::endl; + return 0; +} +#else +int main() { + std::cerr << "You need OpenCV library." << std::endl; + + return 0; +} + +#endif diff --git a/modules/vision/test/key-point/testKeyPoint-6.cpp b/modules/vision/test/key-point/testKeyPoint-6.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a042b1bd2ac8c67a619ff8119332a361fa882565 --- /dev/null +++ b/modules/vision/test/key-point/testKeyPoint-6.cpp @@ -0,0 +1,333 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test descriptor computation. + * + * Authors: + * Souriya Trinh + * + *****************************************************************************/ + +#include <iostream> + +#include <visp3/core/vpConfig.h> + +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020301) + +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vision/vpKeyPoint.h> + +// List of allowed command line options +#define GETOPTARGS "cdh" + +void usage(const char *name, const char *badparam); +bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); + +/*! + + Print the program options. + + \param name : Program name. + \param badparam : Bad parameter name. + +*/ +void usage(const char *name, const char *badparam) +{ + fprintf(stdout, "\n\ +Test keypoint descriptor extraction.\n\ +\n\ +SYNOPSIS\n\ + %s [-c] [-d] [-h]\n", name); + + fprintf(stdout, "\n\ +OPTIONS: \n\ +\n\ + -c\n\ + Disable the mouse click. Useful to automaze the \n\ + execution of this program without humain intervention.\n\ +\n\ + -d \n\ + Turn off the display.\n\ +\n\ + -h\n\ + Print the help.\n"); + + if (badparam) + fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); +} + +/*! + + Set the program options. + + \param argc : Command line number of parameters. + \param argv : Array of command line parameters. + \param click_allowed : Mouse click activation. + \param display : Display activation. + \return false if the program has to be stopped, true otherwise. + +*/ +bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display) +{ + const char *optarg_; + int c; + while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { + + switch (c) { + case 'c': click_allowed = false; break; + case 'd': display = false; break; + case 'h': usage(argv[0], NULL); return false; break; + + default: + usage(argv[0], optarg_); + return false; break; + } + } + + if ((c == 1) || (c == -1)) { + // standalone param or error + usage(argv[0], NULL); + std::cerr << "ERROR: " << std::endl; + std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; + return false; + } + + return true; +} + +/*! + Get the string OpenCV type. + + \param type : OpenCV type. + + \return The string OpenCV type. + +*/ +std::string getOpenCVType(const int type) { + std::string type_string = ""; + + switch(type) { + case CV_8U: + type_string = "CV_8U"; + break; + + case CV_8S: + type_string = "CV_8S"; + break; + + case CV_16U: + type_string = "CV_16U"; + break; + + case CV_16S: + type_string = "CV_16S"; + break; + + case CV_32S: + type_string = "CV_32S"; + break; + + case CV_32F: + type_string = "CV_32F"; + break; + + case CV_64F: + type_string = "CV_64F"; + break; + + default: + type_string = "Problem with type !"; + break; + } + + return type_string; +} + +/*! + \example testKeyPoint-6.cpp + + \brief Test descriptor extraction. +*/ +int main(int argc, const char ** argv) { + try { + std::string env_ipath; + bool opt_click_allowed = true; + bool opt_display = true; + + // Read the command line options + if (getOptions(argc, argv, opt_click_allowed, opt_display) == false) { + exit (-1); + } + + //Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value + env_ipath = vpIoTools::getViSPImagesDataPath(); + + if(env_ipath.empty()) { + std::cerr << "Please set the VISP_INPUT_IMAGE_PATH environment variable value." << std::endl; + return -1; + } + + vpImage<unsigned char> I; + + //Set the path location of the image sequence + std::string dirname = vpIoTools::createFilePath(env_ipath, "ViSP-images/Klimt"); + + //Build the name of the image files + std::string filename = vpIoTools::createFilePath(dirname, "/Klimt.png"); + vpImageIo::read(I, filename); + +#if defined VISP_HAVE_X11 + vpDisplayX display; +#elif defined VISP_HAVE_GTK + vpDisplayGTK display; +#elif defined VISP_HAVE_GDI + vpDisplayGDI display; +#else + vpDisplayOpenCV display; +#endif + + if(opt_display) { + display.init(I, 0, 0, "KeyPoints detection."); + } + + vpKeyPoint keyPoints; + + std::vector<std::string> descriptorNames; +#if defined(VISP_HAVE_OPENCV_NONFREE) || defined(VISP_HAVE_OPENCV_XFEATURES2D) + descriptorNames.push_back("SIFT"); + descriptorNames.push_back("SURF"); +#endif + descriptorNames.push_back("ORB"); +#if (VISP_HAVE_OPENCV_VERSION >= 0x020403) + descriptorNames.push_back("BRISK"); +#endif +#if defined(VISP_HAVE_OPENCV_XFEATURES2D) || (VISP_HAVE_OPENCV_VERSION < 0x030000) + descriptorNames.push_back("BRIEF"); +#if (VISP_HAVE_OPENCV_VERSION >= 0x020402) + descriptorNames.push_back("FREAK"); +#endif +#endif +#if defined(VISP_HAVE_OPENCV_XFEATURES2D) + descriptorNames.push_back("DAISY"); + descriptorNames.push_back("LATCH"); +// descriptorNames.push_back("LUCID"); //Problem +#endif +#if (VISP_HAVE_OPENCV_VERSION >= 0x030000) + descriptorNames.push_back("KAZE"); + descriptorNames.push_back("AKAZE"); +#endif + + std::string detectorName = "FAST"; + keyPoints.setDetector(detectorName); + std::vector<cv::KeyPoint> kpts; + double elapsedTime; + keyPoints.detect(I, kpts, elapsedTime); + std::cout << "Nb keypoints detected: " << kpts.size() << " for " << detectorName << " method." << std::endl; + if(kpts.empty()) { + std::cerr << "No keypoints detected with " << detectorName << " and image:" << filename << "." << std::endl; + return -1; + } + + for(std::vector<std::string>::const_iterator itd = descriptorNames.begin(); itd != descriptorNames.end(); ++itd) { + if(*itd == "KAZE") { + detectorName = "KAZE"; + keyPoints.setDetector(detectorName); + keyPoints.detect(I, kpts, elapsedTime); + std::cout << "Nb keypoints detected: " << kpts.size() << " for " << detectorName << " method." << std::endl; + if(kpts.empty()) { + std::cerr << "No keypoints detected with " << detectorName << " and image:" << filename << "." << std::endl; + return -1; + } + } else if(*itd == "AKAZE") { + detectorName = "AKAZE"; + keyPoints.setDetector(detectorName); + keyPoints.detect(I, kpts, elapsedTime); + std::cout << "Nb keypoints detected: " << kpts.size() << " for " << detectorName << " method." << std::endl; + if(kpts.empty()) { + std::cerr << "No keypoints detected with " << detectorName << " and image:" << filename << "." << std::endl; + return -1; + } + } + + keyPoints.setExtractor(*itd); + + double t = vpTime::measureTimeMs(); + cv::Mat descriptor; + keyPoints.extract(I, kpts, descriptor, elapsedTime); + t = vpTime::measureTimeMs() - t; + + std::cout << "Descriptor: " << descriptor.rows << "x" << descriptor.cols << " (rows x cols) ; type=" << + getOpenCVType(descriptor.type()) << " for " << *itd << " method in " << t << " ms." << std::endl; + if(descriptor.empty()) { + std::cerr << "No descriptor extracted with " << *itd << " and image:" << filename << "." << std::endl; + return -1; + } + + if (opt_display) { + vpDisplay::display(I); + + for(std::vector<cv::KeyPoint>::const_iterator it = kpts.begin(); it != kpts.end(); ++it) { + vpImagePoint imPt; + imPt.set_uv(it->pt.x, it->pt.y); + + vpDisplay::displayCross(I, imPt, 4, vpColor::red); + } + + vpDisplay::flush(I); + + if(opt_click_allowed) { + vpDisplay::getClick(I); + } + } + } + + } catch(vpException &e) { + std::cerr << e.what() << std::endl; + return -1; + } + + std::cout << "testKeyPoint-6 is ok !" << std::endl; + return 0; +} +#else +int main() { + std::cerr << "You need OpenCV library." << std::endl; + + return 0; +} + +#endif diff --git a/modules/vision/test/key-point/testKeyPoint-7.cpp b/modules/vision/test/key-point/testKeyPoint-7.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f9df3f17c44b3ad5840fa05329d37996d0b4fcc5 --- /dev/null +++ b/modules/vision/test/key-point/testKeyPoint-7.cpp @@ -0,0 +1,684 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test saving / loading learning files for vpKeyPoint class. + * + * Authors: + * Souriya Trinh + * + *****************************************************************************/ + +#include <iostream> +#include <iomanip> + +#include <visp3/core/vpConfig.h> + +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020301) + +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/vision/vpKeyPoint.h> +#include <visp3/core/vpException.h> + +// List of allowed command line options +#define GETOPTARGS "cdo:h" + +void usage(const char *name, const char *badparam, std::string opath, std::string user); +bool getOptions(int argc, const char **argv, std::string &opath, std::string user); + +/*! + + Print the program options. + + \param name : Program name. + \param badparam : Bad parameter name. + +*/ +void usage(const char *name, const char *badparam, std::string opath, std::string user) +{ + fprintf(stdout, "\n\ +Test save / load learning files for vpKeyPoint class.\n\ +\n\ +SYNOPSIS\n\ + %s [-c] [-d] [-h]\n", name); + + fprintf(stdout, "\n\ +OPTIONS: \n\ +\n\ + -o <output image path> %s\n\ + Set image output path.\n\ + From this directory, creates the \"%s\"\n\ + subdirectory depending on the username, where \n\ + learning files will be written.\n\ +\n\ + -h\n\ + Print the help.\n", + opath.c_str(), user.c_str()); + + if (badparam) + fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); +} + +/*! + + Set the program options. + + \param argc : Command line number of parameters. + \param argv : Array of command line parameters. + \param opath : Output image path. + \param user : Username. + \return false if the program has to be stopped, true otherwise. + +*/ +bool getOptions(int argc, const char **argv, std::string &opath, std::string user) +{ + const char *optarg_; + int c; + while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { + + switch (c) { + case 'c': break; //not used, to avoid error with default arguments ctest + case 'd': break; //not used, to avoid error with default arguments ctest + case 'o': opath = optarg_; break; + case 'h': usage(argv[0], NULL, opath, user); return false; break; + + default: + usage(argv[0], optarg_, opath, user); return false; break; + return false; break; + } + } + + if ((c == 1) || (c == -1)) { + // standalone param or error + usage(argv[0], NULL, opath, user); + std::cerr << "ERROR: " << std::endl; + std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; + return false; + } + + return true; +} + +/*! + Compare two vectors of cv::KeyPoint. + + \param keypoints1 : First vectors of cv::KeyPoint. + \param keypoints2 : Second vectors of cv::KeyPoint. + + \return True if the two vectors are identical, false otherwise. +*/ +bool compareKeyPoints(const std::vector<cv::KeyPoint> &keypoints1, const std::vector<cv::KeyPoint> &keypoints2) { + if(keypoints1.size() != keypoints2.size()) { + return false; + } + + for(size_t cpt = 0; cpt < keypoints1.size(); cpt++) { + if(!vpMath::equal(keypoints1[cpt].angle, keypoints2[cpt].angle, std::numeric_limits<float>::epsilon())) { + std::cerr << std::fixed << std::setprecision(9) << "keypoints1[cpt].angle=" << keypoints1[cpt].angle << + " ; keypoints2[cpt].angle=" << keypoints2[cpt].angle << std::endl; + return false; + } + + if(keypoints1[cpt].class_id != keypoints2[cpt].class_id) { + std::cerr << "keypoints1[cpt].class_id=" << keypoints1[cpt].class_id << " ; keypoints2[cpt].class_id=" << + keypoints2[cpt].class_id << std::endl; + return false; + } + + if(keypoints1[cpt].octave != keypoints2[cpt].octave) { + std::cerr << "keypoints1[cpt].octave=" << keypoints1[cpt].octave << " ; keypoints2[cpt].octave=" << + keypoints2[cpt].octave << std::endl; + return false; + } + + if(!vpMath::equal(keypoints1[cpt].pt.x, keypoints2[cpt].pt.x, std::numeric_limits<float>::epsilon())) { + std::cerr << std::fixed << std::setprecision(9) << "keypoints1[cpt].pt.x=" << keypoints1[cpt].pt.x << + " ; keypoints2[cpt].pt.x=" << keypoints2[cpt].pt.x << std::endl; + return false; + } + + if(!vpMath::equal(keypoints1[cpt].pt.y, keypoints2[cpt].pt.y, std::numeric_limits<float>::epsilon())) { + std::cerr << std::fixed << std::setprecision(9) << "keypoints1[cpt].pt.y=" << keypoints1[cpt].pt.y << + " ; keypoints2[cpt].pt.y=" << keypoints2[cpt].pt.y << std::endl; + return false; + } + + if(!vpMath::equal(keypoints1[cpt].response, keypoints2[cpt].response, std::numeric_limits<float>::epsilon())) { + std::cerr << std::fixed << std::setprecision(9) << "keypoints1[cpt].response=" << keypoints1[cpt].response << + " ; keypoints2[cpt].response=" << keypoints2[cpt].response << std::endl; + return false; + } + + if(!vpMath::equal(keypoints1[cpt].size, keypoints2[cpt].size, std::numeric_limits<float>::epsilon())) { + std::cerr << std::fixed << std::setprecision(9) << "keypoints1[cpt].size=" << keypoints1[cpt].size << + " ; keypoints2[cpt].size=" << keypoints2[cpt].size << std::endl; + return false; + } + } + + return true; +} + +/*! + Compare two descriptors. + + \param descriptors1 : First descriptor. + \param descriptors2 : Second descriptor. + + \return True if the two vectors are identical, false otherwise. +*/ +bool compareDescriptors(const cv::Mat &descriptors1, const cv::Mat &descriptors2) { + if(descriptors1.rows != descriptors2.rows || descriptors1.cols != descriptors2.cols || + descriptors1.type() != descriptors2.type()) { + return false; + } + + for(int i = 0; i < descriptors1.rows; i++) { + for(int j = 0; j < descriptors1.cols; j++) { + switch(descriptors1.type()) { + case CV_8U: + if(descriptors1.at<unsigned char>(i,j) != descriptors2.at<unsigned char>(i,j)) { + std::cerr << "descriptors1.at<unsigned char>(i,j)=" << descriptors1.at<unsigned char>(i,j) << + " ; descriptors2.at<unsigned char>(i,j)=" << descriptors2.at<unsigned char>(i,j) << std::endl; + return false; + } + break; + + case CV_8S: + if(descriptors1.at<char>(i,j) != descriptors2.at<char>(i,j)) { + std::cerr << "descriptors1.at<char>(i,j)=" << descriptors1.at<char>(i,j) << + " ; descriptors2.at<char>(i,j)=" << descriptors2.at<char>(i,j) << std::endl; + return false; + } + break; + + case CV_16U: + if(descriptors1.at<unsigned short>(i,j) != descriptors2.at<unsigned short>(i,j)) { + std::cerr << "descriptors1.at<unsigned short>(i,j)=" << descriptors1.at<unsigned short>(i,j) << + " ; descriptors2.at<unsigned short>(i,j)=" << descriptors2.at<unsigned short>(i,j) << std::endl; + return false; + } + break; + + case CV_16S: + if(descriptors1.at<short>(i,j) != descriptors2.at<short>(i,j)) { + std::cerr << "descriptors1.at<short>(i,j)=" << descriptors1.at<short>(i,j) << + " ; descriptors2.at<short>(i,j)=" << descriptors2.at<short>(i,j) << std::endl; + return false; + } + break; + + case CV_32S: + if(descriptors1.at<int>(i,j) != descriptors2.at<int>(i,j)) { + std::cerr << "descriptors1.at<int>(i,j)=" << descriptors1.at<int>(i,j) << + " ; descriptors2.at<int>(i,j)=" << descriptors2.at<int>(i,j) << std::endl; + return false; + } + break; + + case CV_32F: + if(!vpMath::equal(descriptors1.at<float>(i,j), descriptors2.at<float>(i,j), std::numeric_limits<float>::epsilon())) { + std::cerr << std::fixed << std::setprecision(9) << "descriptors1.at<float>(i,j)=" << descriptors1.at<float>(i,j) + << " ; descriptors2.at<float>(i,j)=" << descriptors2.at<float>(i,j) << std::endl; + return false; + } + break; + + case CV_64F: + if(!vpMath::equal(descriptors1.at<double>(i,j), descriptors2.at<double>(i,j), std::numeric_limits<double>::epsilon())) { + std::cerr << std::fixed << std::setprecision(17) << "descriptors1.at<double>(i,j)=" << descriptors1.at<double>(i,j) + << " ; descriptors2.at<double>(i,j)=" << descriptors2.at<double>(i,j) << std::endl; + return false; + } + break; + + default: + return false; + break; + } + } + } + + return true; +} + +/*! + \example testKeyPoint-7.cpp + + \brief Test saving / loading learning file. +*/ +int main(int argc, const char ** argv) { + try { + std::string env_ipath; + std::string opt_opath; + std::string username; + std::string opath; + std::string filename; + + //Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value + env_ipath = vpIoTools::getViSPImagesDataPath(); + + if(env_ipath.empty()) { + throw vpException(vpException::ioError, "Please set the VISP_INPUT_IMAGE_PATH environment variable value."); + } + + // Set the default output path +#if defined(_WIN32) + opt_opath = "C:/temp"; +#else + opt_opath = "/tmp"; +#endif + + // Get the user login name + vpIoTools::getUserName(username); + + // Read the command line options + if (getOptions(argc, argv, opt_opath, username) == false) { + throw vpException(vpException::fatalError, "getOptions(argc, argv, opt_opath, username) == false"); + } + + // Get the option values + if (!opt_opath.empty()) { + opath = opt_opath; + } + + // Append to the output path string, the login name of the user + opath = vpIoTools::createFilePath(opath, username); + + // Test if the output path exist. If no try to create it + if (vpIoTools::checkDirectory(opath) == false) { + try { + // Create the dirname + vpIoTools::makeDirectory(opath); + } + catch (...) { + usage(argv[0], NULL, opt_opath, username); + std::stringstream ss; + ss << std::endl << "ERROR:" << std::endl; + ss << " Cannot create " << opath << std::endl; + ss << " Check your -o " << opt_opath << " option " << std::endl; + throw vpException(vpException::ioError, ss.str().c_str()); + } + } + + vpImage<unsigned char> I; + + //Set the path location of the image sequence + std::string dirname = vpIoTools::createFilePath(env_ipath, "ViSP-images/Klimt"); + + //Build the name of the image files + std::string img_filename = vpIoTools::createFilePath(dirname, "/Klimt.ppm"); + vpImageIo::read(I, img_filename); + + vpKeyPoint keyPoints; + + //Test with binary descriptor + { + std::string keypointName = "ORB"; + keyPoints.setDetector(keypointName); + keyPoints.setExtractor(keypointName); + + keyPoints.buildReference(I); + + std::vector<cv::KeyPoint> trainKeyPoints; + keyPoints.getTrainKeyPoints(trainKeyPoints); + cv::Mat trainDescriptors = keyPoints.getTrainDescriptors(); + if(trainKeyPoints.empty() || trainDescriptors.empty() || (int) trainKeyPoints.size() != trainDescriptors.rows) { + throw vpException(vpException::fatalError, "Problem when detecting keypoints or when computing descriptors !"); + } + + //Save in binary with training images + filename = vpIoTools::createFilePath(opath, "bin_with_img"); + vpIoTools::makeDirectory(filename); + filename = vpIoTools::createFilePath(filename, "test_save_in_bin_with_img.bin"); + keyPoints.saveLearningData(filename, true, true); + + //Test if save is ok + if(!vpIoTools::checkFilename(filename)) { + std::stringstream ss; + ss << "Problem when saving file=" << filename; + throw vpException(vpException::ioError, ss.str().c_str()); + } + + //Test if read is ok + vpKeyPoint read_keypoint1; + read_keypoint1.loadLearningData(filename, true); + std::vector<cv::KeyPoint> trainKeyPoints_read; + read_keypoint1.getTrainKeyPoints(trainKeyPoints_read); + cv::Mat trainDescriptors_read = read_keypoint1.getTrainDescriptors(); + + if(!compareKeyPoints(trainKeyPoints, trainKeyPoints_read)) { + throw vpException(vpException::fatalError, "Problem with trainKeyPoints when reading learning file saved " + "in binary with train images saved !"); + } + + if(!compareDescriptors(trainDescriptors, trainDescriptors_read)) { + throw vpException(vpException::fatalError, "Problem with trainDescriptors when reading learning file saved in " + "binary with train images saved !"); + } + + + //Save in binary with no training images + filename = vpIoTools::createFilePath(opath, "bin_without_img"); + vpIoTools::makeDirectory(filename); + filename = vpIoTools::createFilePath(filename, "test_save_in_bin_without_img.bin"); + keyPoints.saveLearningData(filename, true, false); + + //Test if save is ok + if(!vpIoTools::checkFilename(filename)) { + std::stringstream ss; + ss << "Problem when saving file=" << filename; + throw vpException(vpException::ioError, ss.str().c_str()); + } + + //Test if read is ok + vpKeyPoint read_keypoint2; + read_keypoint2.loadLearningData(filename, true); + trainKeyPoints_read.clear(); + read_keypoint2.getTrainKeyPoints(trainKeyPoints_read); + trainDescriptors_read = read_keypoint2.getTrainDescriptors(); + + if(!compareKeyPoints(trainKeyPoints, trainKeyPoints_read)) { + throw vpException(vpException::fatalError, "Problem with trainKeyPoints when reading learning file saved in " + "binary without train images !"); + } + + if(!compareDescriptors(trainDescriptors, trainDescriptors_read)) { + throw vpException(vpException::fatalError, "Problem with trainDescriptors when reading learning file saved in " + "binary without train images !"); + } + + +#if defined(VISP_HAVE_XML2) + //Save in xml with training images + filename = vpIoTools::createFilePath(opath, "xml_with_img"); + vpIoTools::makeDirectory(filename); + filename = vpIoTools::createFilePath(filename, "test_save_in_xml_with_img.xml"); + keyPoints.saveLearningData(filename, false, true); + + //Test if save is ok + if(!vpIoTools::checkFilename(filename)) { + std::stringstream ss; + ss << "Problem when saving file=" << filename; + throw vpException(vpException::ioError, ss.str().c_str()); + } + + //Test if read is ok + vpKeyPoint read_keypoint3; + read_keypoint3.loadLearningData(filename, false); + trainKeyPoints_read.clear(); + read_keypoint3.getTrainKeyPoints(trainKeyPoints_read); + trainDescriptors_read = read_keypoint3.getTrainDescriptors(); + + if(!compareKeyPoints(trainKeyPoints, trainKeyPoints_read)) { + throw vpException(vpException::fatalError, "Problem with trainKeyPoints when reading learning file saved in " + "xml with train images saved !"); + } + + if(!compareDescriptors(trainDescriptors, trainDescriptors_read)) { + throw vpException(vpException::fatalError, "Problem with trainDescriptors when reading learning file saved in " + "xml with train images saved !"); + } + + + //Save in xml without training images + filename = vpIoTools::createFilePath(opath, "xml_without_img"); + vpIoTools::makeDirectory(filename); + filename = vpIoTools::createFilePath(filename, "test_save_in_xml_without_img.xml"); + keyPoints.saveLearningData(filename, false, false); + + //Test if save is ok + if(!vpIoTools::checkFilename(filename)) { + std::stringstream ss; + ss << "Problem when saving file=" << filename; + throw vpException(vpException::ioError, ss.str().c_str()); + } + + //Test if read is ok + vpKeyPoint read_keypoint4; + read_keypoint4.loadLearningData(filename, false); + trainKeyPoints_read.clear(); + read_keypoint4.getTrainKeyPoints(trainKeyPoints_read); + trainDescriptors_read = read_keypoint4.getTrainDescriptors(); + + if(!compareKeyPoints(trainKeyPoints, trainKeyPoints_read)) { + throw vpException(vpException::fatalError, "Problem with trainKeyPoints when reading learning file saved in " + "xml without train images saved !"); + } + + if(!compareDescriptors(trainDescriptors, trainDescriptors_read)) { + throw vpException(vpException::fatalError, "Problem with trainDescriptors when reading learning file saved in " + "xml without train images saved !"); + } +#endif + + std::cout << "Saving / loading learning files with binary descriptor are ok !" << std::endl; + } + + + //Test with floating point descriptor +#if defined(VISP_HAVE_OPENCV_NONFREE) || ( (VISP_HAVE_OPENCV_VERSION >= 0x030000) && defined(VISP_HAVE_OPENCV_XFEATURES2D) ) + { + std::string keypointName = "SIFT"; + keyPoints.setDetector(keypointName); + keyPoints.setExtractor(keypointName); + + keyPoints.buildReference(I); + + std::vector<cv::KeyPoint> trainKeyPoints; + keyPoints.getTrainKeyPoints(trainKeyPoints); + cv::Mat trainDescriptors = keyPoints.getTrainDescriptors(); + if(trainKeyPoints.empty() || trainDescriptors.empty() || (int) trainKeyPoints.size() != trainDescriptors.rows) { + throw vpException(vpException::fatalError, "Problem when detecting keypoints or when computing descriptors (SIFT) !"); + } + + //Save in binary with training images + filename = vpIoTools::createFilePath(opath, "bin_with_img"); + vpIoTools::makeDirectory(filename); + filename = vpIoTools::createFilePath(filename, "test_save_in_bin_with_img.bin"); + keyPoints.saveLearningData(filename, true, true); + + //Test if save is ok + if(!vpIoTools::checkFilename(filename)) { + std::stringstream ss; + ss << "Problem when saving file=" << filename; + throw vpException(vpException::ioError, ss.str().c_str()); + } + + //Test if read is ok + vpKeyPoint read_keypoint1; + read_keypoint1.loadLearningData(filename, true); + std::vector<cv::KeyPoint> trainKeyPoints_read; + read_keypoint1.getTrainKeyPoints(trainKeyPoints_read); + cv::Mat trainDescriptors_read = read_keypoint1.getTrainDescriptors(); + + if(!compareKeyPoints(trainKeyPoints, trainKeyPoints_read)) { + throw vpException(vpException::fatalError, "Problem with trainKeyPoints when reading learning file saved in " + "binary with train images saved !"); + } + + if(!compareDescriptors(trainDescriptors, trainDescriptors_read)) { + throw vpException(vpException::fatalError, "Problem with trainDescriptors when reading learning file saved in " + "binary with train images saved !"); + } + + + //Save in binary with no training images + filename = vpIoTools::createFilePath(opath, "bin_without_img"); + vpIoTools::makeDirectory(filename); + filename = vpIoTools::createFilePath(filename, "test_save_in_bin_without_img.bin"); + keyPoints.saveLearningData(filename, true, false); + + //Test if save is ok + if(!vpIoTools::checkFilename(filename)) { + std::stringstream ss; + ss << "Problem when saving file=" << filename; + throw vpException(vpException::ioError, ss.str().c_str()); + } + + //Test if read is ok + vpKeyPoint read_keypoint2; + read_keypoint2.loadLearningData(filename, true); + trainKeyPoints_read.clear(); + read_keypoint2.getTrainKeyPoints(trainKeyPoints_read); + trainDescriptors_read = read_keypoint2.getTrainDescriptors(); + + if(!compareKeyPoints(trainKeyPoints, trainKeyPoints_read)) { + throw vpException(vpException::fatalError, "Problem with trainKeyPoints when reading learning file saved in " + "binary without train images saved !"); + } + + if(!compareDescriptors(trainDescriptors, trainDescriptors_read)) { + throw vpException(vpException::fatalError, "Problem with trainDescriptors when reading learning file saved in " + "binary without train images saved !"); + } + + +#if defined(VISP_HAVE_XML2) + //Save in xml with training images + filename = vpIoTools::createFilePath(opath, "xml_with_img"); + vpIoTools::makeDirectory(filename); + filename = vpIoTools::createFilePath(filename, "test_save_in_xml_with_img.xml"); + keyPoints.saveLearningData(filename, false, true); + + //Test if save is ok + if(!vpIoTools::checkFilename(filename)) { + std::stringstream ss; + ss << "Problem when saving file=" << filename; + throw vpException(vpException::ioError, ss.str().c_str()); + } + + //Test if read is ok + vpKeyPoint read_keypoint3; + read_keypoint3.loadLearningData(filename, false); + trainKeyPoints_read.clear(); + read_keypoint3.getTrainKeyPoints(trainKeyPoints_read); + trainDescriptors_read = read_keypoint3.getTrainDescriptors(); + + if(!compareKeyPoints(trainKeyPoints, trainKeyPoints_read)) { + throw vpException(vpException::fatalError, "Problem with trainKeyPoints when reading learning file saved in " + "xml with train images saved !"); + } + + if(!compareDescriptors(trainDescriptors, trainDescriptors_read)) { + throw vpException(vpException::fatalError, "Problem with trainDescriptors when reading learning file saved in " + "xml with train images saved !"); + } + + + //Save in xml without training images + filename = vpIoTools::createFilePath(opath, "xml_without_img"); + vpIoTools::makeDirectory(filename); + filename = vpIoTools::createFilePath(filename, "test_save_in_xml_without_img.xml"); + keyPoints.saveLearningData(filename, false, false); + + //Test if save is ok + if(!vpIoTools::checkFilename(filename)) { + std::stringstream ss; + ss << "Problem when saving file=" << filename; + throw vpException(vpException::ioError, ss.str().c_str()); + } + + //Test if read is ok + vpKeyPoint read_keypoint4; + read_keypoint4.loadLearningData(filename, false); + trainKeyPoints_read.clear(); + read_keypoint4.getTrainKeyPoints(trainKeyPoints_read); + trainDescriptors_read = read_keypoint4.getTrainDescriptors(); + + if(!compareKeyPoints(trainKeyPoints, trainKeyPoints_read)) { + throw vpException(vpException::fatalError, "Problem with trainKeyPoints when reading learning file saved in " + "xml without train images saved !"); + } + + if(!compareDescriptors(trainDescriptors, trainDescriptors_read)) { + throw vpException(vpException::fatalError, "Problem with trainDescriptors when reading learning file saved in " + "xml without train images saved !"); + } +#endif + + std::cout << "Saving / loading learning files with floating point descriptor are ok !" << std::endl; + + + //Test vpKeyPoint::reset() + vpKeyPoint keypoint_reset; + + keypointName = "ORB"; + keypoint_reset.setDetector(keypointName); + keypoint_reset.setExtractor(keypointName); + + keypoint_reset.buildReference(I); + + //reset + keypoint_reset.reset(); + + keypointName = "SIFT"; + keypoint_reset.setDetector(keypointName); + keypoint_reset.setExtractor(keypointName); + + keypoint_reset.buildReference(I); + + std::vector<cv::KeyPoint> trainKeyPoints_reset; + keypoint_reset.getTrainKeyPoints(trainKeyPoints_reset); + cv::Mat trainDescriptors_reset = keypoint_reset.getTrainDescriptors(); + + //If reset is ok, we should get the same keypoints and the same descriptors + if(!compareKeyPoints(trainKeyPoints, trainKeyPoints_reset)) { + throw vpException(vpException::fatalError, "Problem with vpKeyPoint::reset() and trainKeyPoints !"); + } + + if(!compareDescriptors(trainDescriptors, trainDescriptors_reset)) { + throw vpException(vpException::fatalError, "Problem with vpKeyPoint::reset() and trainDescriptors !"); + } + + std::cout << "vpKeyPoint::reset() is ok with trainKeyPoints and trainDescriptors !" << std::endl; + } +#endif + + + } catch(vpException &e) { + std::cerr << e.what() << std::endl; + return -1; + } + + std::cout << "Saving / loading learning files are ok !" << std::endl; + std::cout << "testKeyPoint-7 is ok !" << std::endl; + return 0; +} +#else +int main() { + std::cerr << "You need OpenCV library." << std::endl; + + return 0; +} + +#endif diff --git a/modules/vision/test/key-point/testKeyPoint.cpp b/modules/vision/test/key-point/testKeyPoint.cpp new file mode 100644 index 0000000000000000000000000000000000000000..775d70709df95590ab3303719574d29c40057d14 --- /dev/null +++ b/modules/vision/test/key-point/testKeyPoint.cpp @@ -0,0 +1,248 @@ +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Test keypoint matching. + * + * Authors: + * Souriya Trinh + * + *****************************************************************************/ + +#include <iostream> + +#include <visp3/core/vpConfig.h> + +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020301) + +#include <visp3/vision/vpKeyPoint.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/io/vpParseArgv.h> + +// List of allowed command line options +#define GETOPTARGS "cdh" + +void usage(const char *name, const char *badparam); +bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display); + +/*! + + Print the program options. + + \param name : Program name. + \param badparam : Bad parameter name. + +*/ +void usage(const char *name, const char *badparam) +{ + fprintf(stdout, "\n\ +Test keypoints matching.\n\ +\n\ +SYNOPSIS\n\ + %s [-c] [-d] [-h]\n", name); + + fprintf(stdout, "\n\ +OPTIONS: \n\ +\n\ + -c\n\ + Disable the mouse click. Useful to automate the \n\ + execution of this program without human intervention.\n\ +\n\ + -d \n\ + Turn off the display.\n\ +\n\ + -h\n\ + Print the help.\n"); + + if (badparam) + fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); +} + +/*! + + Set the program options. + + \param argc : Command line number of parameters. + \param argv : Array of command line parameters. + \param click_allowed : Mouse click activation. + \param display : Display activation. + \return false if the program has to be stopped, true otherwise. + +*/ +bool getOptions(int argc, const char **argv, bool &click_allowed, bool &display) +{ + const char *optarg_; + int c; + while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { + + switch (c) { + case 'c': click_allowed = false; break; + case 'd': display = false; break; + case 'h': usage(argv[0], NULL); return false; break; + + default: + usage(argv[0], optarg_); + return false; break; + } + } + + if ((c == 1) || (c == -1)) { + // standalone param or error + usage(argv[0], NULL); + std::cerr << "ERROR: " << std::endl; + std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; + return false; + } + + return true; +} + +/*! + \example testKeyPoint.cpp + + \brief Test keypoint matching. +*/ +int main(int argc, const char ** argv) { + try { + std::string env_ipath; + bool opt_click_allowed = true; + bool opt_display = true; + + // Read the command line options + if (getOptions(argc, argv, opt_click_allowed, opt_display) == false) { + exit (-1); + } + + // Get the visp-images-data package path or VISP_INPUT_IMAGE_PATH environment variable value + env_ipath = vpIoTools::getViSPImagesDataPath(); + + if(env_ipath.empty()) { + std::cerr << "Please set the VISP_INPUT_IMAGE_PATH environment variable value." << std::endl; + return -1; + } + + vpImage<unsigned char> Iref, Icur, Imatch; + + //Set the path location of the image sequence + std::string dirname = vpIoTools::createFilePath(env_ipath, "ViSP-images/mbt/cube"); + + //Build the name of the image files + std::string filenameRef = vpIoTools::createFilePath(dirname, "image0000.pgm"); + vpImageIo::read(Iref, filenameRef); + std::string filenameCur = vpIoTools::createFilePath(dirname, "image%04d.pgm"); + + //Init keypoints + vpKeyPoint keypoints("ORB", "ORB", "BruteForce-Hamming"); + std::cout << "Build " << keypoints.buildReference(Iref) << " reference points." << std::endl; + + vpVideoReader g; + g.setFileName(filenameCur); + g.open(Icur); + g.acquire(Icur); + + Imatch.resize(Icur.getHeight(), 2*Icur.getWidth()); + Imatch.insert(Iref, vpImagePoint(0,0)); + +#if defined VISP_HAVE_X11 + vpDisplayX display; +#elif defined VISP_HAVE_GTK + vpDisplayGTK display; +#elif defined VISP_HAVE_GDI + vpDisplayGDI display; +#else + vpDisplayOpenCV display; +#endif + + if (opt_display) { + display.init(Imatch, 0, 0, "ORB keypoints matching"); + } + + bool opt_click = false; + vpMouseButton::vpMouseButtonType button; + while(!g.end()) { + g.acquire(Icur); + Imatch.insert(Icur, vpImagePoint(0, Icur.getWidth())); + + if(opt_display) { + vpDisplay::display(Imatch); + } + + //Match keypoints + keypoints.matchPoint(Icur); + //Display image with keypoints matched + keypoints.displayMatching(Iref, Imatch); + + if(opt_display) { + vpDisplay::flush(Imatch); + } + + //Click requested to process next image + if (opt_click_allowed && opt_display) { + if(opt_click) { + vpDisplay::getClick(Imatch, button, true); + if(button == vpMouseButton::button3) { + opt_click = false; + } + } else { + //Use right click to enable/disable step by step tracking + if(vpDisplay::getClick(Imatch, button, false)) { + if (button == vpMouseButton::button3) { + opt_click = true; + } + else if(button == vpMouseButton::button1) { + break; + } + } + } + } + } + + } catch(vpException &e) { + std::cerr << e.what() << std::endl; + return -1; + } + + std::cout << "testKeyPoint is ok !" << std::endl; + return 0; +} +#else +int main() { + std::cerr << "You need OpenCV library." << std::endl; + + return 0; +} + +#endif diff --git a/test/key-point/testSurfKeyPoint.cpp b/modules/vision/test/key-point/testSurfKeyPoint.cpp similarity index 88% rename from test/key-point/testSurfKeyPoint.cpp rename to modules/vision/test/key-point/testSurfKeyPoint.cpp index 502112a457f9262deb0410da01811e6de985cf2b..bb0477d58aa1428a501a76f2ab08b424af11fd5d 100644 --- a/test/key-point/testSurfKeyPoint.cpp +++ b/modules/vision/test/key-point/testSurfKeyPoint.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testSurfKeyPoint.cpp 5202 2015-01-24 09:29:06Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Test auto detection of dots. * @@ -39,28 +35,26 @@ * *****************************************************************************/ - - -#include <visp/vpDebug.h> -#include <visp/vpConfig.h> #include <stdlib.h> #include <stdio.h> #include <sstream> #include <iomanip> -#if ((defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_OPENCV_NONFREE) && (VISP_HAVE_OPENCV_VERSION < 0x030000)) // Require opencv >= 1.1.0 < 3.0.0 +#include <iostream> -#include <visp/vpKeyPointSurf.h> -#include <visp/vpImage.h> -#include <visp/vpImageIo.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayGDI.h> +#include <visp3/core/vpConfig.h> +#if (defined(VISP_HAVE_OPENCV_NONFREE) && (VISP_HAVE_OPENCV_VERSION < 0x030000)) // Require opencv >= 1.1.0 < 3.0.0 -#include <visp/vpCameraParameters.h> - -#include <visp/vpParseArgv.h> -#include <visp/vpIoTools.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/vision/vpKeyPointSurf.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/io/vpParseArgv.h> /*! \example testSurfKeyPoint.cpp @@ -180,7 +174,6 @@ main(int argc, const char ** argv) if (! env_ipath.empty()) ipath = env_ipath; - // Read the command line options if (getOptions(argc, argv, opt_ipath, opt_click_allowed, opt_display) == false) { @@ -236,11 +229,11 @@ main(int argc, const char ** argv) // exception readPGM may throw various exception if, for example, // the file does not exist, or if the memory cannot be allocated try{ - vpCTRACE << "Load: " << filenameRef << std::endl; + std::cout << "Load: " << filenameRef << std::endl; vpImageIo::read(Iref, filenameRef) ; - vpCTRACE << "Load: " << filenameCur << std::endl; + std::cout << "Load: " << filenameCur << std::endl; vpImageIo::read(Icur, filenameCur) ; } @@ -266,6 +259,8 @@ main(int argc, const char ** argv) vpDisplayGTK display[2]; #elif defined VISP_HAVE_GDI vpDisplayGDI display[2]; +#else + vpDisplayOpenCV display[2]; #endif if (opt_display) { @@ -311,11 +306,10 @@ main(int argc, const char ** argv) if(nbrRef < 1) { - vpTRACE("No reference point"); + std::cerr << "No reference point" << std::endl; exit(-1); } - unsigned int nbrPair; if (opt_display) { display[1].init(Icur, (int)(100+Iref.getWidth()), 100, "Current image") ; @@ -351,7 +345,7 @@ main(int argc, const char ** argv) if(nbrPair < 1) { - vpTRACE("No point matched"); + std::cout << "No point matched" << std::endl; } if (opt_display) @@ -367,7 +361,7 @@ main(int argc, const char ** argv) } return (0); } - catch(vpException e) { + catch(vpException &e) { std::cout << "Catch an exception: " << e << std::endl; return (1); } @@ -376,11 +370,7 @@ main(int argc, const char ** argv) int main() { -#if ( ! (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI)) ) - vpERROR_TRACE("You do not have X11, GTK or GDI display functionalities..."); -#else - vpERROR_TRACE("You do not have 1.1.0 <= OpenCV < 2.4.8 that contains opencv_nonfree component..."); -#endif + std::cerr << "You do not have 1.1.0 <= OpenCV < 2.3.0 that contains opencv_nonfree component..." << std::endl; } #endif diff --git a/test/pose/testFindMatch.cpp b/modules/vision/test/pose/testFindMatch.cpp similarity index 75% rename from test/pose/testFindMatch.cpp rename to modules/vision/test/pose/testFindMatch.cpp index 62223fb3846d66909081e4ebb57779d302cff051..86b500efb89b3c8ef243e77c516e627f90ee46ce 100644 --- a/test/pose/testFindMatch.cpp +++ b/modules/vision/test/pose/testFindMatch.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: testFindMatch.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Compute the pose of a 3D object using the Dementhon method. Assuming that * the correspondance between 2D points and 3D points is not done, we use @@ -41,10 +37,10 @@ * *****************************************************************************/ -#include <visp/vpPose.h> -#include <visp/vpPoint.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> #include <stdlib.h> #include <stdio.h> @@ -64,20 +60,18 @@ main() { try { std::cout << "Find Matches using Ransac" << std::endl; - unsigned int nb3D = 5; - unsigned int nb2D = 5; - std::vector<vpPoint> P(nb3D); - std::vector<vpPoint> p(nb2D); + std::vector<vpPoint> P; - P[0].setWorldCoordinates(-L,-L, 0 ) ; - P[1].setWorldCoordinates(L,-L, 0 ) ; - P[2].setWorldCoordinates(L,L, 0 ) ; - P[3].setWorldCoordinates(-L,L, 0 ) ; - P[4].setWorldCoordinates(-0,L/2., L ) ; + P.push_back( vpPoint(-L,-L, 0 ) ); + P.push_back( vpPoint(L,-L, 0 ) ); + P.push_back( vpPoint(L,L, 0 ) ); + P.push_back( vpPoint(-L,L, 0 ) ); + P.push_back( vpPoint(-0,L/2., L ) ); vpHomogeneousMatrix cMo_ref(0, 0.2, 1, vpMath::rad(3), vpMath::rad(-2), vpMath::rad(10)) ; - for(unsigned int i=0 ; i < nb3D ; i++) + std::vector<vpPoint> p( P.size() ); + for(unsigned int i=0 ; i < P.size() ; i++) { vpPoint pt = P[i]; pt.project(cMo_ref); @@ -88,7 +82,7 @@ main() unsigned int ninliers ; std::vector<vpPoint> inliers; double threshold = 1e-6; - unsigned int nbInlierToReachConsensus = nb3D; + unsigned int nbInlierToReachConsensus = (unsigned int)(P.size()); vpHomogeneousMatrix cMo ; diff --git a/test/pose/testPose.cpp b/modules/vision/test/pose/testPose.cpp similarity index 76% rename from test/pose/testPose.cpp rename to modules/vision/test/pose/testPose.cpp index 00b39226ca19ae6c0a80f90b5c79d481d7085f7b..00db7f7aff520fb57a7c43306ee72fec1253870f 100644 --- a/test/pose/testPose.cpp +++ b/modules/vision/test/pose/testPose.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testPose.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Compute the pose of a 3D object using the Dementhon, Lagrange and * Non-Linear approach. @@ -41,22 +37,18 @@ * *****************************************************************************/ -#include <visp/vpPose.h> -#include <visp/vpPoint.h> -#include <visp/vpMath.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpDebug.h> -#include <visp/vpParseArgv.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRxyzVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpDebug.h> #include <stdlib.h> #include <stdio.h> -// List of allowed command line options -#define GETOPTARGS "h" - #define L 0.035 /*! @@ -67,68 +59,10 @@ */ -void usage(const char *name, const char *badparam); -bool getOptions(int argc, const char **argv); void print_pose(const vpHomogeneousMatrix &cMo, const std::string &legend); int compare_pose(const vpPose &pose, const vpHomogeneousMatrix &cMo_ref, const vpHomogeneousMatrix &cMo_est, const std::string &legend); - -/*! - - Print the program options. - -*/ -void usage(const char *name, const char *badparam) -{ - fprintf(stdout, "\n\ -Compute the pose of a 3D object using the Dementhon, Lagrange and\n\ -Non-Linear approach.\n\ -\n\ -SYNOPSIS\n\ - %s [-h]\n", name); - - fprintf(stdout, "\n\ -OPTIONS: Default\n\ - -h\n\ - Print the help.\n"); - - if (badparam) - fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); -} -/*! - - Set the program options. - - \return false if the program has to be stopped, true otherwise. - -*/ -bool getOptions(int argc, const char **argv) -{ - const char *optarg_; - int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { - - switch (c) { - case 'h': usage(argv[0], NULL); return false; break; - - default: - usage(argv[0], optarg_); - return false; break; - } - } - - if ((c == 1) || (c == -1)) { - // standalone param or error - usage(argv[0], NULL); - std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; - return false; - } - - return true; -} - // print the resulting estimated pose void print_pose(const vpHomogeneousMatrix &cMo, const std::string &legend) { @@ -175,15 +109,9 @@ int compare_pose(const vpPose &pose, const vpHomogeneousMatrix &cMo_ref, const v return fail; } -int -main(int argc, const char ** argv) +int main() { try { - // Read the command line options - if (getOptions(argc, argv) == false) { - exit (-1); - } - vpPoint P[5] ; // Point to be tracked vpPose pose ; pose.clearPoint() ; @@ -193,7 +121,6 @@ main(int argc, const char ** argv) P[2].setWorldCoordinates(L,L, 0 ) ; P[3].setWorldCoordinates(-2*L, 3*L, 0 ) ; P[4].setWorldCoordinates(-L,L, 0.01 ) ; - //P[3].setWorldCoordinates(-L,L, 0 ) ; int test_fail = 0, fail = 0; vpPoseVector cpo_ref = vpPoseVector(0.01, 0.02, 0.25, vpMath::rad(5), 0,vpMath::rad(10)); diff --git a/test/pose/testPoseFeatures.cpp b/modules/vision/test/pose/testPoseFeatures.cpp similarity index 84% rename from test/pose/testPoseFeatures.cpp rename to modules/vision/test/pose/testPoseFeatures.cpp index 19d2a598ae999a5b2e6fd5fdb5761450bec79f72..b273caa5a0ab04bbaa8c4ee50ca6e38b0c63b3c1 100644 --- a/test/pose/testPoseFeatures.cpp +++ b/modules/vision/test/pose/testPoseFeatures.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testPoseFeatures.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Compute the pose from visual features by virtual visual servoing. * @@ -39,18 +35,16 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpPoint.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayX.h> -#include <visp/vpImage.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpPoseFeatures.h> -#include <visp/vpPose.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/vision/vpPoseFeatures.h> +#include <visp3/vision/vpPose.h> #include <iostream> #include <vector> -#include <visp/vpPose.h> +#include <visp3/vision/vpPose.h> #include <limits> /*! @@ -98,22 +92,22 @@ int main() vpPoseFeatures pose; - vpPoint pts[6]; + std::vector<vpPoint> pts; double val = 0.25; double val2 = 0.0; //2D Point Feature - pts[0].setWorldCoordinates(0.0,-val,val2); - pts[1].setWorldCoordinates(0.0,val,val2); - pts[2].setWorldCoordinates(-val,val,val2); + pts.push_back( vpPoint(0.0,-val,val2) ); + pts.push_back( vpPoint(0.0,val,val2) ); + pts.push_back( vpPoint(-val,val,val2) ); //Segment Feature - pts[3].setWorldCoordinates(-val,-val/2.0,val2); - pts[4].setWorldCoordinates(val,val/2.0,val2); + pts.push_back( vpPoint(-val,-val/2.0,val2) ); + pts.push_back( vpPoint(val,val/2.0,val2) ); //3D point Feature - pts[5].setWorldCoordinates(0.0,0.0,-1.5); + pts.push_back( vpPoint(0.0,0.0,-1.5) ); //Line Feature vpLine line; diff --git a/test/pose/testPoseRansac.cpp b/modules/vision/test/pose/testPoseRansac.cpp similarity index 74% rename from test/pose/testPoseRansac.cpp rename to modules/vision/test/pose/testPoseRansac.cpp index 70e8acca73cd532fa747da22f3dbc5585e6413fa..fc1537ce87955904a06777b150e4ab1458a6127f 100644 --- a/test/pose/testPoseRansac.cpp +++ b/modules/vision/test/pose/testPoseRansac.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testPoseRansac.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Compute the pose of a 3D object using the Dementhon method. Assuming that * the correspondance between 2D points and 3D points is not done, we use @@ -41,10 +37,10 @@ * *****************************************************************************/ -#include <visp/vpPose.h> -#include <visp/vpPoint.h> -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> +#include <visp3/vision/vpPose.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> #include <stdlib.h> #include <stdio.h> @@ -64,24 +60,21 @@ main() { try { std::cout << "Pose computation with matched points" << std::endl; - int size = 8; - vpPoint *P = new vpPoint [size] ; // Point to be tracked + std::vector<vpPoint> P; // Point to be tracked - P[0].setWorldCoordinates(-L,-L, 0 ) ; - P[1].setWorldCoordinates(L,-L, 0 ) ; - P[2].setWorldCoordinates(L,L, 0 ) ; - P[3].setWorldCoordinates(-L,L, 0 ) ; + P.push_back( vpPoint(-L,-L, 0 ) ); + P.push_back( vpPoint(L,-L, 0 ) ); + P.push_back( vpPoint(L,L, 0 ) ); + P.push_back( vpPoint(-L,L, 0 ) ); double L2 = L*3.0; - P[4].setWorldCoordinates(0,-L2, 0 ) ; - P[5].setWorldCoordinates(L2,0, 0 ) ; - P[6].setWorldCoordinates(0,L2, 0 ) ; - P[7].setWorldCoordinates(-L2,0, 0 ) ; + P.push_back( vpPoint(0,-L2, 0 ) ); + P.push_back( vpPoint(L2,0, 0 ) ); + P.push_back( vpPoint(0,L2, 0 ) ); + P.push_back( vpPoint(-L2,0, 0 ) ); - // P[4].setWorldCoordinates(-0,0, L ) ; - vpHomogeneousMatrix cMo_ref(0, 0.2, 1, 0, 0, 0) ; - for(int i=0 ; i < size ; i++) + for(size_t i=0 ; i < P.size(); i++) { P[i].project(cMo_ref) ; P[i].print() ; @@ -94,10 +87,10 @@ main() P[6].set_x(P[6].get_x() + error); vpPose pose; - for(int i=0 ; i < size ; i++) + for(size_t i=0 ; i < P.size() ; i++) pose.addPoint(P[i]); - unsigned int nbInlierToReachConsensus = (unsigned int)(75.0 * (double)size / 100.0); + unsigned int nbInlierToReachConsensus = (unsigned int)(75.0 * (double)(P.size()) / 100.0); double threshold = 0.001; pose.setRansacNbInliersToReachConsensus(nbInlierToReachConsensus); @@ -130,7 +123,6 @@ main() } std::cout << "Pose is " << (test_fail ? "badly" : "well") << " estimated" << std::endl; - delete [] P; return test_fail; } catch(vpException e) { diff --git a/modules/visual_features/CMakeLists.txt b/modules/visual_features/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..b826b5989cb032d092826973c48f2acc8b7907e6 --- /dev/null +++ b/modules/visual_features/CMakeLists.txt @@ -0,0 +1,42 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +vp_add_module(visual_features visp_core OPTIONAL visp_blob visp_me) +vp_glob_module_sources() +vp_module_include_directories() +vp_create_module() +vp_add_tests() diff --git a/src/visual-feature/vpBasicFeature.h b/modules/visual_features/include/visp3/visual_features/vpBasicFeature.h similarity index 88% rename from src/visual-feature/vpBasicFeature.h rename to modules/visual_features/include/visp3/visual_features/vpBasicFeature.h index 4f4d0550394b50f18ca00652c66ddbd6724ed82c..1a9c86b122ce2dd2066fde187c84e7ee853b9aa8 100644 --- a/src/visual-feature/vpBasicFeature.h +++ b/modules/visual_features/include/visp3/visual_features/vpBasicFeature.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpBasicFeature.h 5237 2015-01-30 13:52:04Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Visual feature. * @@ -50,18 +46,18 @@ \brief class that defines what is a visual feature */ -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpColVector.h> // Display Issue // Meter/pixel conversion -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpCameraParameters.h> //Color / image / display -#include <visp/vpColor.h> -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> // #define FEATURE_ALL 0xff @@ -77,6 +73,7 @@ /*! \class vpBasicFeature + \ingroup group_core_features \brief class that defines what is a visual feature */ class VISP_EXPORT vpBasicFeature @@ -84,7 +81,9 @@ class VISP_EXPORT vpBasicFeature public: // Public constantes static const unsigned int FEATURE_LINE [32]; - static const unsigned int FEATURE_ALL; + enum { + FEATURE_ALL = 0xffff + }; protected: //! State of the visual feature. diff --git a/src/tracking/feature-builder/vpFeatureBuilder.h b/modules/visual_features/include/visp3/visual_features/vpFeatureBuilder.h similarity index 74% rename from src/tracking/feature-builder/vpFeatureBuilder.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureBuilder.h index 004bc7b0327bf66e4680582873f3dc8d4efddd1e..7001bf44591cb346311b2588b828bfa73f3ee814 100644 --- a/src/tracking/feature-builder/vpFeatureBuilder.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureBuilder.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureBuilder.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Conversion between tracker and visual feature. * @@ -47,56 +43,62 @@ \file vpFeatureBuilder.h \brief class that defines conversion between tracker and visual feature */ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> // tracker -#include <visp/vpDot.h> -#include <visp/vpDot2.h> -#include <visp/vpMeLine.h> -#include <visp/vpMeEllipse.h> +#ifdef VISP_HAVE_MODULE_BLOB +# include <visp3/blob/vpDot.h> +# include <visp3/blob/vpDot2.h> +#endif +#ifdef VISP_HAVE_MODULE_ME +# include <visp3/me/vpMeLine.h> +# include <visp3/me/vpMeEllipse.h> +#endif // forward projection tracker -#include <visp/vpPoint.h> -#include <visp/vpLine.h> -#include <visp/vpSphere.h> -#include <visp/vpCircle.h> -#include <visp/vpCylinder.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpLine.h> +#include <visp3/core/vpSphere.h> +#include <visp3/core/vpCircle.h> +#include <visp3/core/vpCylinder.h> // visual feature -#include <visp/vpFeaturePoint.h> -#include <visp/vpFeaturePointPolar.h> -#include <visp/vpFeatureLine.h> -#include <visp/vpFeatureEllipse.h> -#include <visp/vpFeaturePoint3D.h> -#include <visp/vpFeatureThetaU.h> -#include <visp/vpFeatureTranslation.h> -#include <visp/vpFeatureVanishingPoint.h> -#include <visp/vpFeatureSegment.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/visual_features/vpFeaturePointPolar.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/visual_features/vpFeatureEllipse.h> +#include <visp3/visual_features/vpFeaturePoint3D.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/visual_features/vpFeatureTranslation.h> +#include <visp3/visual_features/vpFeatureVanishingPoint.h> +#include <visp3/visual_features/vpFeatureSegment.h> // others -#include <visp/vpImagePoint.h> +#include <visp3/core/vpImagePoint.h> //pixel / meter conversion -#include <visp/vpCameraParameters.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpMeterPixelConversion.h> +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/core/vpMeterPixelConversion.h> /*! \class vpFeatureBuilder - \ingroup VsFeatureBuilder + \ingroup group_visual_features_builder \brief Class that defines conversion between trackers and visual features. */ class VISP_EXPORT vpFeatureBuilder { public: // create vpFeaturePoint feature +#ifdef VISP_HAVE_MODULE_BLOB static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d) ; static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot2 &d) ; +#endif static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpImagePoint &t) ; static void create(vpFeaturePoint &s, const vpPoint &p) ; @@ -105,19 +107,23 @@ public: const vpCameraParameters &wrongCam, const vpPoint &p) ; +#ifdef VISP_HAVE_MODULE_BLOB static void create(vpFeatureSegment &s, const vpCameraParameters &cam, const vpDot &d1, const vpDot &d2 ) ; static void create(vpFeatureSegment &s, const vpCameraParameters &cam, const vpDot2 &d1, const vpDot2 &d2) ; +#endif static void create(vpFeatureSegment &s, const vpCameraParameters &cam, const vpImagePoint &ip1, const vpImagePoint &ip2); static void create(vpFeatureSegment &s, vpPoint& P1, vpPoint& P2); // create vpFeaturePointPolar feature - static void create(vpFeaturePointPolar &s, +#ifdef VISP_HAVE_MODULE_BLOB + static void create(vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpDot &dot) ; static void create(vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpDot2 &dot) ; +#endif static void create(vpFeaturePointPolar &s, const vpCameraParameters &cam, const vpImagePoint &iP) ; @@ -134,23 +140,29 @@ public: static void create(vpFeatureLine &s, const vpLine &l ) ; static void create(vpFeatureLine &s, const vpCylinder &c, const int line) ; +#ifdef VISP_HAVE_MODULE_ME static void create(vpFeatureLine &s, const vpCameraParameters &cam, const vpMeLine &mel) ; +#endif //! create vpFeatureEllipse feature static void create(vpFeatureEllipse &s, const vpCircle &c) ; static void create(vpFeatureEllipse &s, const vpSphere &sphere) ; +#ifdef VISP_HAVE_MODULE_BLOB static void create(vpFeatureEllipse &s, const vpCameraParameters &cam, const vpDot &d ) ; static void create(vpFeatureEllipse &s, const vpCameraParameters &cam, const vpDot2 &d ) ; +#endif + +#ifdef VISP_HAVE_MODULE_ME static void create(vpFeatureEllipse &s, const vpCameraParameters &cam, const vpMeEllipse &d ) ; - +#endif /*! create vpFeatureVanishingPoint feature from the 2D coordinates of a point @@ -167,15 +179,7 @@ public: lines are parallel in the image plane) */ static void create(vpFeatureVanishingPoint &s, const vpLine &l1, const vpLine &l2 ); - - - } ; #endif -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/visual-feature/vpFeatureDepth.h b/modules/visual_features/include/visp3/visual_features/vpFeatureDepth.h similarity index 91% rename from src/visual-feature/vpFeatureDepth.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureDepth.h index 7528ea08dd38423af204b660d5d346233bd14619..493578a4a721cb217541c4d9b2125cf4a91bb0f8 100644 --- a/src/visual-feature/vpFeatureDepth.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureDepth.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureDepth.h 5237 2015-01-30 13:52:04Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D point visual feature. * @@ -48,16 +44,16 @@ \brief Class that defines 3D point visual feature */ -#include <visp/vpMatrix.h> -#include <visp/vpBasicFeature.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/visual_features/vpBasicFeature.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRGBa.h> /*! \class vpFeatureDepth - \ingroup VsFeature3 + \ingroup group_visual_features \brief Class that defines a 3D point visual feature \f$ s\f$ which is composed by one parameters that is \f$ log( \frac{Z}{Z^*}) \f$ @@ -91,8 +87,8 @@ current feature \f$s\f$ is updated in the while() loop. \code -#include <visp/vpFeatureDepth.h> -#include <visp/vpServo.h> +#include <visp3/visual_features/vpFeatureDepth.h> +#include <visp3/vs/vpServo.h> int main() { @@ -136,9 +132,9 @@ int main() build the interaction matrix \f$L_s\f$. \code -#include <visp/vpFeatureDepth.h> -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> +#include <visp3/visual_features/vpFeatureDepth.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpColVector.h> int main() { diff --git a/src/visual-feature/vpFeatureEllipse.h b/modules/visual_features/include/visp3/visual_features/vpFeatureEllipse.h similarity index 81% rename from src/visual-feature/vpFeatureEllipse.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureEllipse.h index aea4547494e4a9f858ac7d526c5aee55711fcd85..1dfd20fc22f1206064391aa1d8fb9412d68f41d4 100644 --- a/src/visual-feature/vpFeatureEllipse.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureEllipse.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureEllipse.h 5237 2015-01-30 13:52:04Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D ellipse visual feature. * @@ -49,16 +45,16 @@ \brief Class that defines 2D ellipse visual feature */ -#include <visp/vpMatrix.h> -#include <visp/vpBasicFeature.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/visual_features/vpBasicFeature.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRGBa.h> /*! \class vpFeatureEllipse - \ingroup VsFeature2 + \ingroup group_visual_features \brief Class that defines 2D ellipse visual feature. */ class VISP_EXPORT vpFeatureEllipse : public vpBasicFeature @@ -113,11 +109,11 @@ public: */ // feature selection - inline static unsigned int selectX() { return FEATURE_LINE[0] ; } - inline static unsigned int selectY() { return FEATURE_LINE[1] ; } - inline static unsigned int selectMu20() { return FEATURE_LINE[2] ; } - inline static unsigned int selectMu11() { return FEATURE_LINE[3] ; } - inline static unsigned int selectMu02() { return FEATURE_LINE[4] ; } + static unsigned int selectX(); + static unsigned int selectY(); + static unsigned int selectMu20(); + static unsigned int selectMu11(); + static unsigned int selectMu02(); //! compute the interaction matrix from a subset a the possible features vpMatrix interaction(const unsigned int select = FEATURE_ALL); diff --git a/src/visual-feature/vpFeatureException.h b/modules/visual_features/include/visp3/visual_features/vpFeatureException.h similarity index 86% rename from src/visual-feature/vpFeatureException.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureException.h index f89311d14eaf446ac301243e2af301f1063b0ff0..1325cfc3d40505f94237a95fcdd36de48450c0e6 100644 --- a/src/visual-feature/vpFeatureException.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureException.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exception that can be emited by the vpFeature class and its derivates. * @@ -54,8 +50,8 @@ */ /* Classes standards. */ -#include <visp/vpConfig.h> -#include <visp/vpException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/core/vpException.h> #include <iostream> /* Classe std::ostream. */ #include <string> /* Classe string. */ @@ -65,7 +61,7 @@ /*! \class vpFeatureException - \ingroup Exception + \ingroup group_visual_features \brief Error that can be emited by the vpBasicFeature class and its derivates. */ class VISP_EXPORT vpFeatureException : public vpException diff --git a/src/visual-feature/vpFeatureLine.h b/modules/visual_features/include/visp3/visual_features/vpFeatureLine.h similarity index 82% rename from src/visual-feature/vpFeatureLine.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureLine.h index 5bb47d27451d897bceed4ac676ae15b8174dcc2b..92ee73f1b624e1727b9d5f87f441d1acf1ca276f 100644 --- a/src/visual-feature/vpFeatureLine.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureLine.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureLine.h 5237 2015-01-30 13:52:04Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D line visual feature. * @@ -48,17 +44,17 @@ \brief Class that defines 2D line visual feature */ -#include <visp/vpMatrix.h> -#include <visp/vpBasicFeature.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/visual_features/vpBasicFeature.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRGBa.h> /*! \class vpFeatureLine - \ingroup VsFeature2 + \ingroup group_visual_features \brief Class that defines a 2D line visual feature \f$ s\f$ which is composed by two parameters that are \f$ \rho \f$ and \f$ \theta \f$, @@ -100,8 +96,8 @@ loop. \code -#include <visp/vpFeatureLine.h> -#include <visp/vpServo.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/vs/vpServo.h> int main() { @@ -158,8 +154,8 @@ int main() If you want to build your own control law, this other example shows how to create a current (\f$s\f$) and desired (\f$s^*\f$) 2D line visual feature, compute the corresponding error vector \f$(s-s^*)\f$ and finally build the interaction matrix \f$L_s\f$. \code -#include <visp/vpFeatureLine.h> -#include <visp/vpMatrix.h> +#include <visp3/visual_features/vpFeatureLine.h> +#include <visp3/core/vpMatrix.h> int main() { @@ -242,41 +238,8 @@ public: public: - /*! - - Function used to select the \f$ \rho \f$ subset of the line visual feature. - - This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to \f$ \rho \f$. - - This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law: - - \code - vpFeatureLine s; - vpServo task; - ... - // Add the (rho) subset features from the 2D line - task.addFeature(s, vpFeatureLine::selectRho()); - \endcode - */ - inline static unsigned int selectRho() { return FEATURE_LINE[0] ; } - - /*! - - Function used to select the \f$ \theta \f$ subset of the line visual feature. - - This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to \f$ \theta \f$. - - This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law: - - \code - vpFeatureLine s; - vpServo task; - ... - // Add the (rho) subset features from the 2D line - task.addFeature(s, vpFeatureLine::selectTheta()); - \endcode - */ - inline static unsigned int selectTheta() { return FEATURE_LINE[1] ; } + static unsigned int selectRho(); + static unsigned int selectTheta(); vpMatrix interaction(const unsigned int select = FEATURE_ALL); @@ -289,8 +252,6 @@ public: vpFeatureLine *duplicate() const ; - -public: void display(const vpCameraParameters &cam, const vpImage<unsigned char> &I, const vpColor &color=vpColor::green, diff --git a/src/visual-feature/vpFeatureLuminance.h b/modules/visual_features/include/visp3/visual_features/vpFeatureLuminance.h old mode 100755 new mode 100644 similarity index 88% rename from src/visual-feature/vpFeatureLuminance.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureLuminance.h index e5958ab1192b5c91fbd3359151fdcab50a990367..3f976d6763b23f362076df00b0d23afa5cce9f11 --- a/src/visual-feature/vpFeatureLuminance.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureLuminance.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureLuminance.h 5098 2014-12-20 16:32:06Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,27 +10,25 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: - * Luninance based feature . + * Luminance based feature. * * Authors: * Eric Marchand @@ -42,9 +38,9 @@ #ifndef vpFeatureLuminance_h #define vpFeatureLuminance_h -#include <visp/vpMatrix.h> -#include <visp/vpBasicFeature.h> -#include <visp/vpImage.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/core/vpImage.h> /*! @@ -76,6 +72,7 @@ class VISP_EXPORT vpLuminance /*! \class vpFeatureLuminance + \ingroup group_visual_features \brief Class that defines the image luminance visual feature For more details see \cite Collewet08c. diff --git a/src/visual-feature/vpFeatureMoment.h b/modules/visual_features/include/visp3/visual_features/vpFeatureMoment.h similarity index 57% rename from src/visual-feature/vpFeatureMoment.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureMoment.h index fcf9bbef7f1859e23aaa637abbd61533f01b66ad..73723ba9b140d6044a053f08e1fc9c97c322d64a 100644 --- a/src/visual-feature/vpFeatureMoment.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureMoment.h @@ -1,43 +1,39 @@ /**************************************************************************** -* -* $Id: vpFeatureMoment.h 4714 2014-03-28 18:16:13Z mbakthav $ -* -* This file is part of the ViSP software. -* Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -* -* This software is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* ("GPL") version 2 as published by the Free Software Foundation. -* See the file LICENSE.txt at the root directory of this source -* distribution for additional information about the GNU GPL. -* -* For using ViSP with software that can not be combined with the GNU -* GPL, please contact INRIA about acquiring a ViSP Professional -* Edition License. -* -* See http://www.irisa.fr/lagadic/visp/visp.html for more information. -* -* This software was developed at: -* INRIA Rennes - Bretagne Atlantique -* Campus Universitaire de Beaulieu -* 35042 Rennes Cedex -* France -* http://www.irisa.fr/lagadic -* -* If you have questions regarding the use of this file, please contact -* INRIA at visp@inria.fr -* -* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -* -* -* Description: -* Base for all moment features -* -* Authors: -* Filip Novotny -* -*****************************************************************************/ + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Base for all moment features + * + * Authors: + * Filip Novotny + * + *****************************************************************************/ /*! \file vpFeatureMoment.h \brief Base class for moment features. @@ -47,9 +43,9 @@ Handles common system operations like selection, duplication. Functionality is c #ifndef __FEATUREMOMENT_H__ #define __FEATUREMOMENT_H__ -#include <visp/vpConfig.h> -#include <visp/vpBasicFeature.h> -#include <visp/vpException.h> +#include <visp3/core/vpConfig.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/core/vpException.h> #include <vector> class vpMomentObject; @@ -60,7 +56,7 @@ class vpMoment; /*! \class vpFeatureMoment -\ingroup VsFeature2 +\ingroup group_visual_features \brief This class defines shared system methods/attributes for 2D moment features but no functional code. It is used to compute interaction matrices for moment features. @@ -98,52 +94,50 @@ An object of order 6 should be sufficient for all classic implementations of vpF Here is an example of how to use a vpFeatureMoment (in this case vpFeatureMomentBasic). \code -#include <visp/vpPoint.h> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentBasic.h> -#include <visp/vpMomentDatabase.h> -#include <visp/vpFeatureMoment.h> -#include <visp/vpFeatureMomentBasic.h> +#include <visp3/core/vpPoint.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentBasic.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/visual_features/vpFeatureMoment.h> +#include <visp3/visual_features/vpFeatureMomentBasic.h> int main() { -vpPoint p; -std::vector<vpPoint> vec_p; // vector that contains the vertices - -p.set_x(1); p.set_y(1); // coordinates in meters in the image plane (vertex 1) -vec_p.push_back(p); -p.set_x(2); p.set_y(2); // coordinates in meters in the image plane (vertex 2) -vec_p.push_back(p); - -//////////////////////////////REFERENCE VALUES//////////////////////////////// -vpMomentObject obj(3); // Init object of order 3 because we need -// vpFeatureMomentBasic of order 2 which -// implies third-order moment primitives -obj.setType(vpMomentObject::DISCRETE); // Discrete mode for object -obj.fromVector(vec_p); - -vpMomentDatabase mdb; //database for moment primitives. This will -//only contain the basic moment. -vpMomentBasic bm; //basic moment (this particular moment is nothing -//more than a shortcut to the vpMomentObject) -bm.linkTo(mdb); //add basic moment to moment database - -vpFeatureMomentBasic fmb(mdb,0,0,1,NULL); - -//update and compute the vpMoment BEFORE doing any operations with -//vpFeatureMoment -bm.update(obj); -bm.compute(); - -fmb.update(0,0,1); //update the vpFeatureMoment with a plane -//configuration -std::cout << fmb.interaction(1,1) << std::endl; - -return 0; + vpPoint p; + std::vector<vpPoint> vec_p; // vector that contains the vertices + + p.set_x(1); p.set_y(1); // coordinates in meters in the image plane (vertex 1) + vec_p.push_back(p); + p.set_x(2); p.set_y(2); // coordinates in meters in the image plane (vertex 2) + vec_p.push_back(p); + + //////////////////////////////REFERENCE VALUES//////////////////////////////// + vpMomentObject obj(3); // Init object of order 3 because we need + // vpFeatureMomentBasic of order 2 which + // implies third-order moment primitives + obj.setType(vpMomentObject::DISCRETE); // Discrete mode for object + obj.fromVector(vec_p); + + vpMomentDatabase mdb; //database for moment primitives. This will + //only contain the basic moment. + vpMomentBasic bm; //basic moment (this particular moment is nothing + //more than a shortcut to the vpMomentObject) + bm.linkTo(mdb); //add basic moment to moment database + + vpFeatureMomentBasic fmb(mdb,0,0,1,NULL); + + //update and compute the vpMoment BEFORE doing any operations with vpFeatureMoment + bm.update(obj); + bm.compute(); + + fmb.update(0,0,1); //update the vpFeatureMoment with a plane + //configuration + std::cout << fmb.interaction(1,1) << std::endl; } \endcode */ -class VISP_EXPORT vpFeatureMoment : public vpBasicFeature{ +class VISP_EXPORT vpFeatureMoment : public vpBasicFeature +{ protected: const vpMoment* moment; const vpMoment& getMoment() const {return *moment;} @@ -156,6 +150,20 @@ protected: double C; char _name[255]; +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpFeatureMoment(const vpFeatureMoment &fm) +// : vpBasicFeature(), moment(NULL), moments(fm.moments), featureMomentsDataBase(NULL), +// interaction_matrices(), A(0), B(0), C(0) +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpFeatureMoment &operator=(const vpFeatureMoment &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: /*! Initializes the feature with information about the database of moment primitives, the object plane, feature database and matrix size. @@ -168,52 +176,48 @@ public: */ vpFeatureMoment(vpMomentDatabase& data_base,double A_=0.0, double B_=0.0, double C_=0.0, vpFeatureMomentDatabase* featureMoments=NULL,unsigned int nbmatrices=1) - : moment(NULL), + : vpBasicFeature(), moment(NULL), moments(data_base), featureMomentsDataBase(featureMoments), interaction_matrices(nbmatrices), - A(A_),B(B_),C(C_) {} - virtual ~vpFeatureMoment(); - - virtual void compute_interaction (void); - vpBasicFeature* duplicate () const; - void display (const vpCameraParameters &cam, const vpImage< unsigned char > &I, - const vpColor &color=vpColor::green, unsigned int thickness=1) const ; - void display (const vpCameraParameters &cam, const vpImage< vpRGBa > &I, - const vpColor &color=vpColor::green, unsigned int thickness=1) const ; - - int getDimension (unsigned int select=FEATURE_ALL) const; - void init (void); - vpMatrix interaction (const unsigned int select=FEATURE_ALL) ; - void linkTo(vpFeatureMomentDatabase& featureMoments); - - /*! + A(A_),B(B_),C(C_) + {} + + virtual ~vpFeatureMoment(); + + virtual void compute_interaction (void); + vpBasicFeature* duplicate () const; + void display (const vpCameraParameters &cam, const vpImage< unsigned char > &I, + const vpColor &color=vpColor::green, unsigned int thickness=1) const ; + void display (const vpCameraParameters &cam, const vpImage< vpRGBa > &I, + const vpColor &color=vpColor::green, unsigned int thickness=1) const ; + + int getDimension (unsigned int select=FEATURE_ALL) const; + void init (void); + vpMatrix interaction (const unsigned int select=FEATURE_ALL) ; + void linkTo(vpFeatureMomentDatabase& featureMoments); + + /*! Name of the moment corresponding to the feature. This allows to locate the moment associated with the feature in the provided database. */ - virtual const char* momentName() const = 0; - /*! + virtual const char* momentName() const = 0; + /*! Name of the feature used to locate it in the database of features. */ - virtual const char* name() const = 0; - void print (const unsigned int select=FEATURE_ALL) const ; + virtual const char* name() const = 0; + void print (const unsigned int select=FEATURE_ALL) const ; - void update (double A, double B, double C); - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - vpFeatureMoment& operator=(const vpFeatureMoment &){ - throw vpException(vpException::functionNotImplementedError,"Not implemented!"); - } -#endif + void update (double A, double B, double C); - friend VISP_EXPORT std::ostream& operator<<(std::ostream & os, const vpFeatureMoment& featM); - virtual void printDependencies(std::ostream& os) const; + friend VISP_EXPORT std::ostream& operator<<(std::ostream & os, const vpFeatureMoment& featM); + virtual void printDependencies(std::ostream& os) const; }; /*! \class vpMomentGenericFeature -\ingroup VsFeature2 +\ingroup group_visual_features \brief This class defines a generic feature used for moment feature duplication. diff --git a/src/visual-feature/vpFeatureMomentAlpha.h b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentAlpha.h similarity index 93% rename from src/visual-feature/vpFeatureMomentAlpha.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureMomentAlpha.h index 40faae3afd619c9552dbaae005d146eec8774a26..24e1402e25de5ee6ce6c905757b6595871e0f4ba 100644 --- a/src/visual-feature/vpFeatureMomentAlpha.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentAlpha.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.h 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -45,8 +41,8 @@ #ifndef __FEATUREMOMENTALPHA_H__ #define __FEATUREMOMENTALPHA_H__ -#include <visp/vpFeatureMoment.h> -#include <visp/vpColVector.h> +#include <visp3/visual_features/vpFeatureMoment.h> +#include <visp3/core/vpColVector.h> #ifdef VISP_MOMENTS_COMBINE_MATRICES @@ -54,7 +50,7 @@ class vpMomentDatabase; /*! \class vpFeatureMomentAlpha - \ingroup VsFeature2 + \ingroup group_visual_features \brief Functionality computation for in-plane rotation moment feature \f$ \alpha \f$. Computes the interaction matrix associated with vpMomentAlpha. @@ -102,7 +98,7 @@ class vpMomentDatabase; /*! \class vpFeatureMomentAlpha - \ingroup VsFeature2 + \ingroup group_visual_features \brief Functionality computation for in-plane rotation moment feature \f$ \alpha \f$: computes the interaction matrix associated with vpMomentAlpha. diff --git a/src/visual-feature/vpFeatureMomentArea.h b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentArea.h similarity index 86% rename from src/visual-feature/vpFeatureMomentArea.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureMomentArea.h index 1d95aac849c680f27100f3b04289e671f06ae4b0..3a32d44c423ffa63fc9dda36211828b852229527 100644 --- a/src/visual-feature/vpFeatureMomentArea.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentArea.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentArea.h 3317 2011-09-06 14:14:47Z mbakthav $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Definition of vpFeatureMomentArea associated to vpMomentArea * @@ -44,14 +40,14 @@ */ #ifndef __FEATUREMOMENTAREA_H__ #define __FEATUREMOMENTAREA_H__ -#include <visp/vpFeatureMoment.h> +#include <visp3/visual_features/vpFeatureMoment.h> class vpMomentDatabase; /*! \class vpFeatureMomentArea - \ingroup VsFeature2 + \ingroup group_visual_features \brief Surface moment feature. Computes the interaction matrix associated with vpMomentArea. diff --git a/src/visual-feature/vpFeatureMomentAreaNormalized.h b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentAreaNormalized.h similarity index 93% rename from src/visual-feature/vpFeatureMomentAreaNormalized.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureMomentAreaNormalized.h index 7004fe33a6ea1e4b1f9c4c2b19642fab8cdc0cb3..ce2afa548b2882a206e5b96129c780c217685445 100644 --- a/src/visual-feature/vpFeatureMomentAreaNormalized.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentAreaNormalized.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.h 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -44,14 +40,14 @@ */ #ifndef __FEATUREMOMENTAREANORMALIZED_H__ #define __FEATUREMOMENTAREANORMALIZED_H__ -#include <visp/vpFeatureMoment.h> +#include <visp3/visual_features/vpFeatureMoment.h> #ifdef VISP_MOMENTS_COMBINE_MATRICES class vpMomentDatabase; /*! \class vpFeatureMomentAreaNormalized - \ingroup VsFeature2 + \ingroup group_visual_features \brief Functionality computation for normalized surface moment feature. Computes the interaction matrix associated with vpMomentAreaNormalized. @@ -104,7 +100,7 @@ class vpMomentDatabase; /*! \class vpFeatureMomentAreaNormalized - \ingroup VsFeature2 + \ingroup group_visual_features \brief Functionality computation for normalized surface moment feature. Computes the interaction matrix associated with vpMomentAreaNormalized. diff --git a/src/visual-feature/vpFeatureMomentBasic.h b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentBasic.h similarity index 87% rename from src/visual-feature/vpFeatureMomentBasic.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureMomentBasic.h index 64df62c7161fa3254321a6ce9e7f8955c54b394d..b34393292ebbb8d630d9e0e1a5e89486bb0c22ee 100644 --- a/src/visual-feature/vpFeatureMomentBasic.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentBasic.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.h 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -45,14 +41,14 @@ #ifndef __FEATUREMOMENTBASIC_H__ #define __FEATUREMOMENTBASIC_H__ -#include <visp/vpFeatureMoment.h> -#include <visp/vpMomentCommon.h> -#include <visp/vpMomentObject.h> +#include <visp3/visual_features/vpFeatureMoment.h> +#include <visp3/core/vpMomentCommon.h> +#include <visp3/core/vpMomentObject.h> class vpMomentDatabase; /*! \class vpFeatureMomentBasic - \ingroup VsFeature2 + \ingroup group_visual_features \brief Functionality computation for basic moment feature. Computes the interaction matrix associated with vpMomentBasic. diff --git a/src/visual-feature/vpFeatureMomentCInvariant.h b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentCInvariant.h similarity index 94% rename from src/visual-feature/vpFeatureMomentCInvariant.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureMomentCInvariant.h index a9039cd52c6182ef1d2546a609d8b3114adaa58e..c35520d9f33305248c5fae9d3992bc648bc01427 100644 --- a/src/visual-feature/vpFeatureMomentCInvariant.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentCInvariant.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.h 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -44,12 +40,12 @@ */ #ifndef __FEATUREMOMENTCINVARIANT_H__ #define __FEATUREMOMENTCINVARIANT_H__ -#include <visp/vpFeatureMoment.h> +#include <visp3/visual_features/vpFeatureMoment.h> #ifdef VISP_MOMENTS_COMBINE_MATRICES /*! \class vpFeatureMomentCInvariant - \ingroup VsFeature2 + \ingroup group_visual_features \brief Functionality computation for 2D rotation/translation/scale non-symmetric invariant moment feature. Computes the interaction matrix associated with vpMomentCInvariant. @@ -167,7 +163,7 @@ class vpMomentDatabase; /*! \class vpFeatureMomentCInvariant - \ingroup VsFeature2 + \ingroup group_visual_features \brief Functionality computation for 2D rotation/translation/scale non-symmetric invariant moment feature. Computes the interaction matrix associated with vpMomentCInvariant. @@ -210,8 +206,10 @@ class VISP_EXPORT vpFeatureMomentCInvariant : public vpFeatureMoment{ \param featureMoments : Feature database. */ - vpFeatureMomentCInvariant(vpMomentDatabase& data_base,double A_, double B_, double C_,vpFeatureMomentDatabase* featureMoments=NULL) : - vpFeatureMoment(data_base,A_,B_,C_,featureMoments,16){LI.resize(16);} + vpFeatureMomentCInvariant(vpMomentDatabase& data_base,double A_, double B_, double C_, vpFeatureMomentDatabase* featureMoments=NULL) + : vpFeatureMoment(data_base,A_,B_,C_,featureMoments,16), LI(16) + {} + void compute_interaction(); /*! associated moment name diff --git a/src/visual-feature/vpFeatureMomentCentered.h b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentCentered.h similarity index 89% rename from src/visual-feature/vpFeatureMomentCentered.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureMomentCentered.h index bfb13abda7c9490d8e67536eb056938deee94c72..378129ee508811e4fa41b8d5f567e0f601d49572 100644 --- a/src/visual-feature/vpFeatureMomentCentered.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentCentered.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.h 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -44,13 +40,13 @@ */ #ifndef __FEATUREMOMENTCENTERED_H__ #define __FEATUREMOMENTCENTERED_H__ -#include <visp/vpFeatureMoment.h> -#include <visp/vpFeatureMomentBasic.h> +#include <visp3/visual_features/vpFeatureMoment.h> +#include <visp3/visual_features/vpFeatureMomentBasic.h> class vpMomentDatabase; /*! \class vpFeatureMomentCentered - \ingroup VsFeature2 + \ingroup group_visual_features \brief Functionality computation for centered moment feature. Computes the interaction matrix associated with vpMomentCentered. diff --git a/src/visual-feature/vpFeatureMomentCommon.h b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentCommon.h similarity index 88% rename from src/visual-feature/vpFeatureMomentCommon.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureMomentCommon.h index 4bb96ae9c8f86136038c3392110ebec44758f7a8..1dee1a481a1d49e2b41cf20a18ca701070151582 100644 --- a/src/visual-feature/vpFeatureMomentCommon.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentCommon.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentCommon.h 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pre-filled pseudo-database used to handle dependencies between common moment features. * @@ -46,23 +42,23 @@ #ifndef __FEATUREMOMENTCOMMON_H__ #define __FEATUREMOMENTCOMMON_H__ -#include <visp/vpFeatureMomentAlpha.h> -#include <visp/vpFeatureMomentGravityCenter.h> -#include <visp/vpFeatureMomentBasic.h> -#include <visp/vpFeatureMomentGravityCenterNormalized.h> -#include <visp/vpFeatureMomentCentered.h> -#include <visp/vpFeatureMomentCInvariant.h> -#include <visp/vpFeatureMomentCommon.h> -#include <visp/vpFeatureMomentAreaNormalized.h> -#include <visp/vpFeatureMomentDatabase.h> -#include <visp/vpFeatureMomentArea.h> +#include <visp3/visual_features/vpFeatureMomentAlpha.h> +#include <visp3/visual_features/vpFeatureMomentGravityCenter.h> +#include <visp3/visual_features/vpFeatureMomentBasic.h> +#include <visp3/visual_features/vpFeatureMomentGravityCenterNormalized.h> +#include <visp3/visual_features/vpFeatureMomentCentered.h> +#include <visp3/visual_features/vpFeatureMomentCInvariant.h> +#include <visp3/visual_features/vpFeatureMomentCommon.h> +#include <visp3/visual_features/vpFeatureMomentAreaNormalized.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> +#include <visp3/visual_features/vpFeatureMomentArea.h> class vpMomentDatabase; class vpServo; /*! \class vpFeatureMomentCommon - \ingroup VsFeature2 + \ingroup group_visual_features \brief This class allows to access common vpFeatureMoments in a pre-filled database. @@ -93,12 +89,12 @@ class vpServo; The following code demonstrates the construction of a 6x6 interaction matrix as described in [1]. \code -#include <visp/vpMomentObject.h> -#include <visp/vpMomentCommon.h> -#include <visp/vpPoint.h> -#include <visp/vpFeatureMoment.h> -#include <visp/vpFeatureMomentCommon.h> -#include <visp/vpServo.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentCommon.h> +#include <visp3/core/vpPoint.h> +#include <visp3/visual_features/vpFeatureMoment.h> +#include <visp3/visual_features/vpFeatureMomentCommon.h> +#include <visp3/vs/vpServo.h> #include <iostream> #include <vector> diff --git a/src/visual-feature/vpFeatureMomentDatabase.h b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentDatabase.h similarity index 86% rename from src/visual-feature/vpFeatureMomentDatabase.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureMomentDatabase.h index f7457c57d1f98144266ef8f302b331b9224c9fe2..f7910d596e3bc03ca43700d641b9168f32a6b686 100644 --- a/src/visual-feature/vpFeatureMomentDatabase.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentDatabase.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentDatabase.h 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pseudo-database used to handle dependencies between moment features. * @@ -47,7 +43,7 @@ #ifndef __FEATUREMOMENTDATABASE_H__ #define __FEATUREMOMENTDATABASE_H__ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <map> #include <iostream> #include <cstring> @@ -57,7 +53,7 @@ class vpMomentObject; /*! \class vpFeatureMomentDatabase - \ingroup VsFeature2 + \ingroup group_visual_features \brief This class allows to register all feature moments (implemented in vpFeatureMoment... classes) so they can access each other according to their dependencies. @@ -70,20 +66,20 @@ class vpMomentObject; All moment features in a database can access each other freely at any time. They can also verify if a moment feature is present in the database or not. This code illustrates the use of both databases to handle dependencies between moment primitives and moment features: \code -#include <visp/vpPoint.h> - -#include <visp/vpMomentObject.h> -#include <visp/vpMomentBasic.h> -#include <visp/vpMomentCInvariant.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentCInvariant.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentDatabase.h> - -#include <visp/vpFeatureMomentCInvariant.h> -#include <visp/vpFeatureMomentBasic.h> -#include <visp/vpFeatureMomentCentered.h> -#include <visp/vpFeatureMomentDatabase.h> +#include <visp3/core/vpPoint.h> + +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentBasic.h> +#include <visp3/core/vpMomentCInvariant.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentCInvariant.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentDatabase.h> + +#include <visp3/visual_features/vpFeatureMomentCInvariant.h> +#include <visp3/visual_features/vpFeatureMomentBasic.h> +#include <visp3/visual_features/vpFeatureMomentCentered.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> #include <iostream> #include <vector> diff --git a/src/visual-feature/vpFeatureMomentGravityCenter.h b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentGravityCenter.h similarity index 91% rename from src/visual-feature/vpFeatureMomentGravityCenter.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureMomentGravityCenter.h index e79af85c957a01e99e9e558bb721a45f1f8c28e0..14c9ac7e1cdd50f3513133bd8b0ef130f162c542 100644 --- a/src/visual-feature/vpFeatureMomentGravityCenter.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentGravityCenter.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.h 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -44,13 +40,13 @@ */ #ifndef __FEATUREMOMENTGRAVITYCENTER_H__ #define __FEATUREMOMENTGRAVITYCENTER_H__ -#include <visp/vpFeatureMoment.h> +#include <visp3/visual_features/vpFeatureMoment.h> #ifdef VISP_MOMENTS_COMBINE_MATRICES class vpMomentDatabase; /*! \class vpFeatureMomentGravityCenter - \ingroup VsFeature2 + \ingroup group_visual_features \brief Functionality computation for gravity center moment feature. Computes the interaction matrix associated with vpMomentGravityCenter. @@ -62,15 +58,15 @@ class vpMomentDatabase; The following code demonstrates a selection of \f$ L_{y_{g}} \f$: \code -#include <visp/vpMomentObject.h> -#include <visp/vpMomentBasic.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentDatabase.h> -#include <visp/vpPoint.h> -#include <visp/vpFeatureMoment.h> -#include <visp/vpFeatureMomentDatabase.h> -#include <visp/vpFeatureMomentGravityCenter.h> -#include <visp/vpFeatureMomentBasic.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentBasic.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpPoint.h> +#include <visp3/visual_features/vpFeatureMoment.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> +#include <visp3/visual_features/vpFeatureMomentGravityCenter.h> +#include <visp3/visual_features/vpFeatureMomentBasic.h> #include <iostream> #include <vector> @@ -183,7 +179,7 @@ class vpMomentDatabase; /*! \class vpFeatureMomentGravityCenter - \ingroup VsFeature2 + \ingroup group_visual_features \brief Functionality computation for gravity center moment feature. Computes the interaction matrix associated with vpMomentGravityCenter. diff --git a/src/visual-feature/vpFeatureMomentGravityCenterNormalized.h b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentGravityCenterNormalized.h similarity index 95% rename from src/visual-feature/vpFeatureMomentGravityCenterNormalized.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureMomentGravityCenterNormalized.h index f6a657e0670d1d75f7c463c6162a0bd3d191c1d2..a9d37ba81f3063eed058bb28b9e6917800cccf1d 100644 --- a/src/visual-feature/vpFeatureMomentGravityCenterNormalized.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureMomentGravityCenterNormalized.h @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.h 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -44,13 +40,13 @@ */ #ifndef __FEATUREMOMENTGRAVITYCENTERNORMALIZED_H__ #define __FEATUREMOMENTGRAVITYCENTERNORMALIZED_H__ -#include <visp/vpFeatureMoment.h> +#include <visp3/visual_features/vpFeatureMoment.h> #ifdef VISP_MOMENTS_COMBINE_MATRICES class vpMomentDatabase; /*! \class vpFeatureMomentGravityCenterNormalized - \ingroup VsFeature2 + \ingroup group_visual_features \brief Functionality computation for centered and normalized moment feature. Computes the interaction matrix associated with vpMomentGravityCenterNormalized. @@ -120,7 +116,7 @@ class vpMomentDatabase; /*! \class vpFeatureMomentGravityCenterNormalized - \ingroup VsFeature2 + \ingroup group_visual_features \brief Functionality computation for centered and normalized moment feature. Computes the interaction matrix associated with vpMomentGravityCenterNormalized. diff --git a/src/visual-feature/vpFeaturePoint.h b/modules/visual_features/include/visp3/visual_features/vpFeaturePoint.h similarity index 79% rename from src/visual-feature/vpFeaturePoint.h rename to modules/visual_features/include/visp3/visual_features/vpFeaturePoint.h index 932f08a80382fbd3d95342c7d0cff01610cd4811..7cf837b9d7aa481a298b96a5b6453f1aa17b6e71 100644 --- a/src/visual-feature/vpFeaturePoint.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeaturePoint.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeaturePoint.h 5237 2015-01-30 13:52:04Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D point visual feature. * @@ -48,17 +44,17 @@ \brief Class that defines 2D point visual feature */ -#include <visp/vpMatrix.h> -#include <visp/vpBasicFeature.h> -#include <visp/vpPoint.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/core/vpPoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRGBa.h> /*! \class vpFeaturePoint - \ingroup VsFeature2 + \ingroup group_visual_features \brief Class that defines a 2D point visual feature \f$ s\f$ which is composed by two parameters that are the cartesian coordinates \f$ @@ -92,8 +88,8 @@ loop. \code -#include <visp/vpFeaturePoint.h> -#include <visp/vpServo.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/vs/vpServo.h> int main() { @@ -147,8 +143,8 @@ int main() build the interaction matrix \f$L_s\f$. \code -#include <visp/vpFeaturePoint.h> -#include <visp/vpMatrix.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpMatrix.h> int main() { @@ -226,41 +222,8 @@ public: */ // feature selection - /*! - - Function used to select the \f$ x \f$ subset of the point visual feature. - - This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to \f$ x \f$. - - This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law: - - \code - vpFeaturePoint s; - vpServo task; - ... - // Add the (x) subset features from the 2D point - task.addFeature(s, vpFeaturePoint::selectX()); - \endcode - */ - inline static unsigned int selectX() { return FEATURE_LINE[0] ; } - - /*! - - Function used to select the \f$ y \f$ subset of the point visual feature. - - This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to \f$ y \f$. - - This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law: - - \code - vpFeaturePoint s; - vpServo task; - ... - // Add the (y) subset features from the 2D point - task.addFeature(s, vpFeaturePoint::selectY()); - \endcode - */ - inline static unsigned int selectY() { return FEATURE_LINE[1] ; } + static unsigned int selectX(); + static unsigned int selectY(); vpMatrix interaction(const unsigned int select = FEATURE_ALL); diff --git a/src/visual-feature/vpFeaturePoint3D.h b/modules/visual_features/include/visp3/visual_features/vpFeaturePoint3D.h similarity index 72% rename from src/visual-feature/vpFeaturePoint3D.h rename to modules/visual_features/include/visp3/visual_features/vpFeaturePoint3D.h index b398d3767f2c56767d1b7f86176cd3864081cfc1..5af21a6a9d18ab792b5053a5ae97f577f3c233ae 100644 --- a/src/visual-feature/vpFeaturePoint3D.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeaturePoint3D.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeaturePoint3D.h 5237 2015-01-30 13:52:04Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 3D point visual feature. * @@ -49,16 +45,16 @@ \brief class that defines the 3D point visual feature. */ -#include <visp/vpMatrix.h> -#include <visp/vpBasicFeature.h> -#include <visp/vpPoint.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/core/vpPoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRGBa.h> /*! \class vpFeaturePoint3D - \ingroup VsFeature3 + \ingroup group_visual_features \brief Class that defines the 3D point visual feature. A 3D point visual feature corresponds to a 3D point with \f$ @@ -104,17 +100,16 @@ \code #include <iostream> -#include <visp/vpFeaturePoint3D.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpServo.h> +#include <visp3/visual_features/vpFeaturePoint3D.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vs/vpServo.h> int main() { vpServo task; // Visual servoing task // Set the 3D point coordinates in the object frame: oP - vpPoint point; - point.setWorldCoordinates(0.1, -0.1, 0); + vpPoint point(0.1, -0.1, 0); vpHomogeneousMatrix cMo; // Pose between the camera and the object frame cMo.buildFrom(0, 0, 1.2, 0, 0, 0); @@ -175,15 +170,14 @@ int main() \code #include <iostream> -#include <visp/vpFeaturePoint3D.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMatrix.h> +#include <visp3/visual_features/vpFeaturePoint3D.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMatrix.h> int main() { // Set the 3D point coordinates in the object frame: oP - vpPoint point; - point.setWorldCoordinates(0.1, -0.1, 0); + vpPoint point(0.1, -0.1, 0); vpHomogeneousMatrix cMo; // Pose between the camera and the object frame cMo.buildFrom(0, 0, 1.2, 0, 0, 0); @@ -255,83 +249,10 @@ public: vpBasicFeature method instantiation */ - /*! - - Function used to select the \f$ X\f$ subset coordinate of the 3D point - visual feature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$ X\f$ feature. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - \code - vpFeaturePoint3D p; - vpServo task; - ... - // Add the (X,Y) subset coordinates features from a 3D point to the task - task.addFeature(p, vpFeaturePoint3D::selectX() | vpFeaturePoint3D::selectY()); - \endcode - - \sa selectY(), selectZ() - - */ - inline static unsigned int selectX() { return FEATURE_LINE[0] ; } - - /*! - - Function used to select the \f$ Y\f$ subset coordinate of the 3D point - visual feature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$ Y\f$ feature. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - \code - vpFeaturePoint3D p; - vpServo task; - ... - // Add the (X,Y) subset coordinates features from a 3D point to the task - task.addFeature(p, vpFeaturePoint3D::selectX() | vpFeaturePoint3D::selectY()); - \endcode - - \sa selectX(), selectZ() - - */ - inline static unsigned int selectY() { return FEATURE_LINE[1] ; } - - /*! + static unsigned int selectX(); + static unsigned int selectY(); + static unsigned int selectZ(); - Function used to select the \f$ Z\f$ subset coordinate of the 3D point - visual feature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$ Z\f$ feature. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - \code - vpFeaturePoint3D p; - vpServo task; - ... - // Add the (Z) subset coordinate feature from a 3D point to the task - task.addFeature(p, vpFeaturePoint3D::selectZ()); - \endcode - - \sa selectX(), selectY() - - */ - inline static unsigned int selectZ() { return FEATURE_LINE[2] ; } // compute the interaction matrix from a subset a the possible features vpMatrix interaction(const unsigned int select = FEATURE_ALL); // compute the error between two visual features from a subset diff --git a/src/visual-feature/vpFeaturePointPolar.h b/modules/visual_features/include/visp3/visual_features/vpFeaturePointPolar.h similarity index 82% rename from src/visual-feature/vpFeaturePointPolar.h rename to modules/visual_features/include/visp3/visual_features/vpFeaturePointPolar.h index dc3e8118a1a0f4d551f03065ece8ad4fef06ec86..9cfb67d284eea3659e375ed9b63006952dd6737a 100644 --- a/src/visual-feature/vpFeaturePointPolar.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeaturePointPolar.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeaturePointPolar.h 5237 2015-01-30 13:52:04Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D point with polar coordinates visual feature. * @@ -48,17 +44,17 @@ \brief Class that defines a 2D point visual feature with polar coordinates. */ -#include <visp/vpMatrix.h> -#include <visp/vpBasicFeature.h> -#include <visp/vpPoint.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/core/vpPoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRGBa.h> /*! \class vpFeaturePointPolar - \ingroup VsFeature2 + \ingroup group_visual_features \brief Class that defines 2D image point visual feature with polar coordinates \f$(\rho,\theta)\f$ described in \cite Corke09a. @@ -136,10 +132,10 @@ \f$s^*\f$ is initialized at the beginning. \code -#include <visp/vpPoint.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeaturePointPolar.h> -#include <visp/vpServo.h> +#include <visp3/core/vpPoint.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeaturePointPolar.h> +#include <visp3/vs/vpServo.h> int main() { @@ -237,8 +233,8 @@ int main() \f$(s-s^*)\f$ and finally build the interaction matrix \f$L_s\f$. \code -#include <visp/vpFeaturePointPolar.h> -#include <visp/vpMatrix.h> +#include <visp3/visual_features/vpFeaturePointPolar.h> +#include <visp3/core/vpMatrix.h> int main() { @@ -303,57 +299,9 @@ public: /* vpBasicFeature method instantiation */ + static unsigned int selectRho(); + static unsigned int selectTheta(); - /*! - - Function used to select the \f$\rho\f$ subset polar - coordinate of the image point visual feature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$\rho\f$ feature. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - \code - vpFeaturePointPolar p; - vpServo task; - ... - // Add only the rho subset coordinate feature from an image point to the task - task.addFeature(p, vpFeaturePointPolar::selectRho()); - \endcode - - \sa selectTheta() - */ - inline static unsigned int selectRho() { return FEATURE_LINE[0] ; } - - - /*! - - Function used to select the \f$\theta\f$ subset polar - coordinate of the image point visual feature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$\theta\f$ feature. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - \code - vpFeaturePointPolar p; - vpServo task; - ... - // Add only the theta subset coordinate feature from an image point to the task - task.addFeature(p, vpFeaturePointPolar::selectTheta()); - \endcode - - \sa selectRho() - */ - inline static unsigned int selectTheta() { return FEATURE_LINE[1] ; } // compute the interaction matrix from a subset a the possible features vpMatrix interaction(const unsigned int select = FEATURE_ALL); // compute the error between two visual features from a subset diff --git a/src/visual-feature/vpFeatureSegment.h b/modules/visual_features/include/visp3/visual_features/vpFeatureSegment.h similarity index 70% rename from src/visual-feature/vpFeatureSegment.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureSegment.h index 5463d2aeac4c3ae35ed539e7bace87691af7e22a..f8ba0924be21a25723e667b7d09f70172f924d52 100644 --- a/src/visual-feature/vpFeatureSegment.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureSegment.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureThetaU.h 3530 2012-01-03 10:52:12Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Segment visual feature. * @@ -49,15 +45,15 @@ \brief class that defines the Segment visual feature */ -#include <visp/vpMatrix.h> -#include <visp/vpPoint.h> -#include <visp/vpBasicFeature.h> -#include <visp/vpRGBa.h> -#include <visp/vpFeatureException.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpPoint.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/core/vpRGBa.h> +#include <visp3/visual_features/vpFeatureException.h> /*! \class vpFeatureSegment - \ingroup VsFeature2 + \ingroup group_visual_features \brief Class that defines a 2D segment visual features. This class allow to consider two sets of visual features: @@ -157,104 +153,10 @@ public: */ bool isNormalized() { return normalized_; }; - /*! - - Function used to select the \f$x_c\f$ or \f$x_n\f$ subfeature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$x_c\f$ or \f$x_n\f$ feature. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - \code - vpFeatureSegment s, s_star; // Current and desired visual feature - vpServo task; - ... - // Add only the xc subset feature from a segment to the task - task.addFeature(s, s_star, vpFeatureSegment::selectXc()); - \endcode - - \sa selectYc(), selectL(), selectAlpha() - */ - inline static unsigned int selectXc() { return FEATURE_LINE[0] ; } - - /*! - - Function used to select the \f$y_c\f$ or \f$y_n\f$ subfeature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$y_c\f$ or \f$y_n\f$ feature. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - \code - vpFeatureSegment s, s_star; // Current and desired visual feature - vpServo task; - ... - // Add only the yc subset feature from a segment to the task - task.addFeature(s, s_star, vpFeatureSegment::selectYc()); - \endcode - - \sa selectXc(), selectL(), selectAlpha() - */ - - inline static unsigned int selectYc() { return FEATURE_LINE[1] ; } - - /*! - - Function used to select the \f$l\f$ or \f$l_n\f$ subfeature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$l\f$ or \f$l_n\f$ feature. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - \code - vpFeatureSegment s, s_star; // Current and desired visual feature - vpServo task; - ... - // Add only the l subset feature from a segment to the task - task.addFeature(s, s_star, vpFeatureSegment::selectL()); - \endcode - - \sa selectXc(), selectYc(), selectAlpha() - */ - - inline static unsigned int selectL() { return FEATURE_LINE[2] ; } - - /*! - - Function used to select the \f$\alpha\f$ subfeature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$\alpha\f$ feature. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - \code - vpFeatureSegment s, s_star; // Current and desired visual feature - vpServo task; - ... - // Add only the alpha subset feature from a segment to the task - task.addFeature(s, s_star, vpFeatureSegment::selectAlpha()); - \endcode - - \sa selectXc(), selectYc(), selectL() - */ - - inline static unsigned int selectAlpha() { return FEATURE_LINE[3] ; } + static unsigned int selectXc(); + static unsigned int selectYc(); + static unsigned int selectL(); + static unsigned int selectAlpha(); /*! Set the king of feature to consider. diff --git a/src/visual-feature/vpFeatureThetaU.h b/modules/visual_features/include/visp3/visual_features/vpFeatureThetaU.h similarity index 77% rename from src/visual-feature/vpFeatureThetaU.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureThetaU.h index aa4a8b93269a76852ee9425642f5fdf2739ee339..0f9b365cb20eb068492f4be87c932ac6bc732e9f 100644 --- a/src/visual-feature/vpFeatureThetaU.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureThetaU.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureThetaU.h 5237 2015-01-30 13:52:04Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * ThetaU visual feature. * @@ -49,17 +45,17 @@ \brief class that defines the ThetaU visual feature */ -#include <visp/vpMatrix.h> -#include <visp/vpThetaUVector.h> -#include <visp/vpBasicFeature.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpThetaUVector.h> +#include <visp3/visual_features/vpBasicFeature.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRGBa.h> /*! \class vpFeatureThetaU - \ingroup VsFeature3 + \ingroup group_visual_features \brief Class that defines a 3D visual feature \f$ s\f$ from a \f$ \theta u \f$ axis/angle parametrization that represent the rotation between @@ -143,9 +139,9 @@ while() loop while \f$s^*\f$ is considered as zero. \code -#include <visp/vpFeatureThetaU.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpServo.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vs/vpServo.h> int main() { @@ -199,9 +195,9 @@ int main() vector \f$(s-s^*)\f$ and finally build the interaction matrix \f$L_s\f$. \code -#include <visp/vpFeatureThetaU.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMatrix.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMatrix.h> int main() { @@ -258,6 +254,7 @@ public: // Basic construction. void init() ; // Basic constructor. + vpFeatureThetaU() ; vpFeatureThetaU(vpFeatureThetaURotationRepresentationType r) ; vpFeatureThetaU(vpThetaUVector &tu, vpFeatureThetaURotationRepresentationType r) ; @@ -276,96 +273,27 @@ public: public: - void set_TUx(const double tu_x) ; void set_TUy(const double tu_y) ; void set_TUz(const double tu_z) ; - double get_TUx() const ; - double get_TUy() const ; - double get_TUz() const ; + void setFeatureThetaURotationType(const vpFeatureThetaURotationRepresentationType r); + + vpFeatureThetaURotationRepresentationType getFeatureThetaURotationType() const; + + double get_TUx() const; + double get_TUy() const; + double get_TUz() const; public: /* vpBasicFeature method instantiation */ + static unsigned int selectTUx(); + static unsigned int selectTUy(); + static unsigned int selectTUz(); - /*! - - Function used to select the \f$ \theta u_x\f$ subset of the \f$ - \theta u \f$ visual feature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$ \theta u_x\f$. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - \code - vpFeatureThetaU tu; - vpServo task; - ... - // Add the (ThetaU_x, ThetaU_y) subset features from the 3D ThetaU - // rotation to the task - task.addFeature(tu, vpFeatureThetaU::selectTUx() | vpFeatureThetaU::selectTUy()); - \endcode - - \sa selectTUy(), selectTUz() - */ - inline static unsigned int selectTUx() { return FEATURE_LINE[0] ; } - /*! - - Function used to select the \f$ \theta u_y\f$ subset of the \f$ - \theta u \f$ visual feature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$ \theta u_y\f$. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - \code - vpFeatureThetaU tu; - vpServo task; - ... - // Add the (ThetaU_x, ThetaU_y) subset features from the 3D ThetaU - // rotation to the task - task.addFeature(tu, vpFeatureThetaU::selectTUx() | vpFeatureThetaU::selectTUy()); - \endcode - - \sa selectTUx(), selectTUz() - */ - inline static unsigned int selectTUy() { return FEATURE_LINE[1] ; } - /*! - - Function used to select the \f$ \theta u_z\f$ subset of the \f$ - \theta u \f$ visual feature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$ \theta u_z\f$. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - \code - vpFeatureThetaU tu; - vpServo task; - ... - // Add the (ThetaU_z) subset feature from the 3D ThetaU - // rotation to the task - task.addFeature(tu, vpFeatureThetaU::selectTUz()); - \endcode - - \sa selectTUx(), selectTUy() - */ - inline static unsigned int selectTUz() { return FEATURE_LINE[2] ; } // compute the interaction matrix from a subset a the possible features vpMatrix interaction(const unsigned int select = FEATURE_ALL); // compute the error between two visual features from a subset diff --git a/src/visual-feature/vpFeatureTranslation.h b/modules/visual_features/include/visp3/visual_features/vpFeatureTranslation.h similarity index 69% rename from src/visual-feature/vpFeatureTranslation.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureTranslation.h index 4ecacd4250116d7f3b05261059da4f336db24cc0..f411f5ffd63599999d6285aeb70487761d6ea0ae 100644 --- a/src/visual-feature/vpFeatureTranslation.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureTranslation.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureTranslation.h 5237 2015-01-30 13:52:04Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 3D translation visual feature. * @@ -49,16 +45,16 @@ \brief class that defines the translation visual feature. */ -#include <visp/vpMatrix.h> -#include <visp/vpBasicFeature.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRGBa.h> /*! \class vpFeatureTranslation - \ingroup VsFeature3 + \ingroup group_visual_features \brief Class that defines the translation visual feature \f$s=(t_x,t_y,t_z)\f$. @@ -135,9 +131,9 @@ while \f$s^*\f$ is set to zero. \code -#include <visp/vpFeatureTranslation.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpServo.h> +#include <visp3/visual_features/vpFeatureTranslation.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vs/vpServo.h> int main() { @@ -191,9 +187,9 @@ int main() vector \f$(s-s^*)\f$ and finally build the interaction matrix \f$L_s\f$. \code -#include <visp/vpFeatureTranslation.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMatrix.h> +#include <visp3/visual_features/vpFeatureTranslation.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMatrix.h> int main() { @@ -227,9 +223,9 @@ int main() necessary equal to zero. \code -#include <visp/vpFeatureTranslation.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpServo.h> +#include <visp3/visual_features/vpFeatureTranslation.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vs/vpServo.h> int main() { @@ -300,7 +296,9 @@ public: // basic construction void init() ; - // basic constructor + // basic contructor + vpFeatureTranslation() ; + // basic constructor specifying the type of translation feature vpFeatureTranslation(vpFeatureTranslationRepresentationType r) ; // constructor : build from an homogeneous matrix // cdMc is the displacement that the camera has to realize @@ -316,145 +314,19 @@ public: void set_Ty(const double t_y) ; void set_Tz(const double t_z) ; + void setFeatureTranslationType(const vpFeatureTranslationRepresentationType r); + + vpFeatureTranslationRepresentationType getFeatureTranslationType() const; + double get_Tx() const ; double get_Ty() const ; double get_Tz() const ; - // feature selection - /*! - - Function used to select the \f$ t_x\f$ subset of the translation - visual feature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$ t_x\f$. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - - With the feature type cdMc: - \code - vpFeatureTranslation t(vpFeatureTranslation::cdMc); - vpServo task; - ... - // Add the (tx,ty) subset features from 3D translation to the task - task.addFeature(t, vpFeatureTranslation::selectTx() | vpFeatureTranslation::selectTy()); - \endcode - - - With the feature type cMcd: - \code - vpFeatureTranslation t(vpFeatureTranslation::cMcd); - vpServo task; - ... - // Add the (tx,ty) subset features from 3D translation to the task - task.addFeature(t, vpFeatureTranslation::selectTx() | vpFeatureTranslation::selectTy()); - \endcode - - - With the feature type cMo: - \code - vpFeatureTranslation t(vpFeatureTranslation::cMo); - vpFeatureTranslation t_star(vpFeatureTranslation::cMo); - vpServo task; - ... - // Add the (tx,ty) subset features from 3D translation to the task - task.addFeature(t, t_star, vpFeatureTranslation::selectTx() | vpFeatureTranslation::selectTy()); - \endcode - - \sa selectTy(), selectTz() - - */ - inline static unsigned int selectTx() { return FEATURE_LINE[0] ; } - /*! + static unsigned int selectTx(); + static unsigned int selectTy(); + static unsigned int selectTz(); - Function used to select the \f$ t_y\f$ subset of the translation - visual feature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$ t_y\f$. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - - With the feature type cdMc: - \code - vpFeatureTranslation t(vpFeatureTranslation::cdMc); - vpServo task; - ... - // Add the (tx,ty) subset features from 3D translation to the task - task.addFeature(t, vpFeatureTranslation::selectTx() | vpFeatureTranslation::selectTy()); - \endcode - - - With the feature type cMcd: - \code - vpFeatureTranslation t(vpFeatureTranslation::cMcd); - vpServo task; - ... - // Add the (tx,ty) subset features from 3D translation to the task - task.addFeature(t, vpFeatureTranslation::selectTx() | vpFeatureTranslation::selectTy()); - \endcode - - - With the feature type cMo: - \code - vpFeatureTranslation t(vpFeatureTranslation::cMo); - vpFeatureTranslation t_star(vpFeatureTranslation::cMo); - vpServo task; - ... - // Add the (tx,ty) subset features from 3D translation to the task - task.addFeature(t, t_star, vpFeatureTranslation::selectTx() | vpFeatureTranslation::selectTy()); - \endcode - - \sa selectTx(), selectTz() - */ - inline static unsigned int selectTy() { return FEATURE_LINE[1] ; } - /*! - - Function used to select the \f$ t_z\f$ subset of the translation - visual feature. - - This function is to use in conjunction with interaction() in order - to compute the interaction matrix associated to \f$ t_z\f$. - - See the interaction() method for an usage example. - - This function is also useful in the vpServo class to indicate that - a subset of the visual feature is to use in the control law: - - - With the feature type cdMc: - \code - vpFeatureTranslation t(vpFeatureTranslation::cdMc); - vpServo task; - ... - // Add the (tz) subset feature from 3D translation to the task - task.addFeature(t, vpFeatureTranslation::selectTz()); - \endcode - - - With the feature type cMcd: - \code - vpFeatureTranslation t(vpFeatureTranslation::cMcd); - vpServo task; - ... - // Add the (tz) subset feature from 3D translation to the task - task.addFeature(t, vpFeatureTranslation::selectTz()); - \endcode - - - With the feature type cMo: - \code - vpFeatureTranslation t(vpFeatureTranslation::cMo); - vpFeatureTranslation t_star(vpFeatureTranslation::cMo); - vpServo task; - ... - // Add the (tz) subset feature from 3D translation to the task - task.addFeature(t, t_star, vpFeatureTranslation::selectTz()); - \endcode - - \sa selectTx(), selectTy() - */ - inline static unsigned int selectTz() { return FEATURE_LINE[2] ; } // compute the interaction matrix from a subset a the possible features vpMatrix interaction(const unsigned int select = FEATURE_ALL); // compute the error between two visual features from a subset @@ -464,11 +336,9 @@ public: // print the name of the feature void print(const unsigned int select= FEATURE_ALL) const ; - //! Feature duplication vpFeatureTranslation *duplicate() const ; - void display(const vpCameraParameters &cam, const vpImage<unsigned char> &I, const vpColor &color=vpColor::green, diff --git a/src/visual-feature/vpFeatureVanishingPoint.h b/modules/visual_features/include/visp3/visual_features/vpFeatureVanishingPoint.h similarity index 84% rename from src/visual-feature/vpFeatureVanishingPoint.h rename to modules/visual_features/include/visp3/visual_features/vpFeatureVanishingPoint.h index d3c0169f749ef34fcfaed8ce2584311d514b6a77..8da9822a2b79f67ae5b9e2cb49c1fa4cf1893bce 100644 --- a/src/visual-feature/vpFeatureVanishingPoint.h +++ b/modules/visual_features/include/visp3/visual_features/vpFeatureVanishingPoint.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureVanishingPoint.h 5237 2015-01-30 13:52:04Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D vanishing point visual feature (Z coordinate in 3D space is infinity) * @@ -50,18 +46,18 @@ point visual feature (Z coordinate in 3D space is infinity) */ -#include <visp/vpMatrix.h> -#include <visp/vpBasicFeature.h> -#include <visp/vpPoint.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/core/vpPoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpRGBa.h> /*! \class vpFeatureVanishingPoint - \ingroup VsFeature2 + \ingroup group_visual_features \brief Class that defines 2D vanishing point visual feature (Z coordinate in 3D space is infinity). @@ -116,8 +112,8 @@ public: vpBasicFeature method instantiation */ // feature selection - inline static unsigned int selectX() { return FEATURE_LINE[0] ; } - inline static unsigned int selectY() { return FEATURE_LINE[1] ; } + static unsigned int selectX(); + static unsigned int selectY(); //! compute the interaction matrix from a subset a the possible features diff --git a/src/visual-feature/vpGenericFeature.h b/modules/visual_features/include/visp3/visual_features/vpGenericFeature.h similarity index 92% rename from src/visual-feature/vpGenericFeature.h rename to modules/visual_features/include/visp3/visual_features/vpGenericFeature.h index ffbccadcf24a89c4ab7fdf9a87a68ea9c355b2b0..94325b1f41847c72ce2ce07a0f484e105c4f933f 100644 --- a/src/visual-feature/vpGenericFeature.h +++ b/modules/visual_features/include/visp3/visual_features/vpGenericFeature.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpGenericFeature.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Generic feature (used to create new feature not implemented in ViSP). * @@ -50,22 +46,22 @@ feature not implemented in ViSP2 */ -#include <visp/vpMatrix.h> -#include <visp/vpBasicFeature.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/core/vpRGBa.h> #include <math.h> /*! \class vpGenericFeature - \ingroup VsFeatureGeneric + \ingroup group_core_features \brief Class that enables to define a feature or a set of features which are not implemented in ViSP as a specific class. It is indeed possible to create its own features, to use the corresponding interaction matrix, and to compute an error between the current and the desired feature. Moreover the created features can be mixed with features already implemented. The following example shows how to use the vpGenericFeature class to create and use the feature \f$ log(Z) \f$ where Z corresponds to the depth of a point whose 2D coordinates in the camera frame are \f$ x \f$ and \f$ y \f$. The interaction matrix corresponding to this feature is \f[ L = \left[\begin{array}{cccccc} 0 & 0 & -1/Z & -y & x & 0 \end{array}\right]\f]. \code -#include <visp/vpGenericFeature.h> -#include <visp/vpServo.h> +#include <visp3/core/vpGenericFeature.h> +#include <visp3/vs/vpServo.h> int main() { @@ -120,8 +116,8 @@ int main() The second example shows how to create and use a feature whose specificity is to have a desired feature fixed to zero. It is the case for the feature \f$ log( \frac{Z}{Z^*}) \f$. \code -#include <visp/vpGenericFeature.h> -#include <visp/vpServo.h> +#include <visp3/core/vpGenericFeature.h> +#include <visp3/vs/vpServo.h> int main() { diff --git a/src/tracking/feature-builder/vpFeatureBuilderEllipse.cpp b/modules/visual_features/src/feature-builder/vpFeatureBuilderEllipse.cpp similarity index 94% rename from src/tracking/feature-builder/vpFeatureBuilderEllipse.cpp rename to modules/visual_features/src/feature-builder/vpFeatureBuilderEllipse.cpp index e85ad42d378e55f28afecc31b543fc6bdbc6a6be..d4696ca4e6968e28c16278693c9db255063a2a8b 100644 --- a/src/tracking/feature-builder/vpFeatureBuilderEllipse.cpp +++ b/modules/visual_features/src/feature-builder/vpFeatureBuilderEllipse.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureBuilderEllipse.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Conversion between tracker and visual feature ellipse. * @@ -46,10 +42,8 @@ and visual feature Ellipse */ -#include <visp/vpFeatureBuilder.h> - - -#include <visp/vpMath.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/core/vpMath.h> @@ -151,6 +145,7 @@ void vpFeatureBuilder::create(vpFeatureEllipse &s, const vpSphere &t) } +#ifdef VISP_HAVE_MODULE_BLOB /*! Initialize an ellipse feature thanks to a vpDot and camera parameters. The vpFeatureEllipse is initialized thanks to the parameters @@ -208,11 +203,8 @@ void vpFeatureBuilder::create(vpFeatureEllipse &s, vpERROR_TRACE("Error caught") ; throw ; } - } - - /*! Initialize an ellipse feature thanks to a vpDot2 and camera parameters. The vpFeatureEllipse is initialized thanks to the parameters @@ -270,9 +262,10 @@ void vpFeatureBuilder::create(vpFeatureEllipse &s, vpERROR_TRACE("Error caught") ; throw ; } - } +#endif //#ifdef VISP_HAVE_MODULE_BLOB +#ifdef VISP_HAVE_MODULE_ME /*! Initialize an ellipse feature thanks to a vpMeEllipse and camera parameters. The vpFeatureEllipse is initialized thanks to the parameters @@ -333,10 +326,5 @@ void vpFeatureBuilder::create(vpFeatureEllipse &s, vpERROR_TRACE("Error caught") ; throw ; } - } -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +#endif //#ifdef VISP_HAVE_MODULE_ME diff --git a/src/tracking/feature-builder/vpFeatureBuilderLine.cpp b/modules/visual_features/src/feature-builder/vpFeatureBuilderLine.cpp similarity index 93% rename from src/tracking/feature-builder/vpFeatureBuilderLine.cpp rename to modules/visual_features/src/feature-builder/vpFeatureBuilderLine.cpp index 5093da249dc402bc81fafdc03f4daca2b3691655..73ad08f9c94640aec260310e3cf07bc613b1d950 100644 --- a/src/tracking/feature-builder/vpFeatureBuilderLine.cpp +++ b/modules/visual_features/src/feature-builder/vpFeatureBuilderLine.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureBuilderLine.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Conversion between tracker and visual feature line. * @@ -46,8 +42,8 @@ and visual feature Line */ -#include <visp/vpFeatureBuilder.h> -#include <visp/vpMath.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/core/vpMath.h> @@ -167,6 +163,7 @@ void vpFeatureBuilder::create(vpFeatureLine &s, } +#ifdef VISP_HAVE_MODULE_ME /*! Initialize a line feature thanks to a vpMeLine and the parameters of the camera. A vpFeatureLine contains the parameters \f$(\rho,\theta)\f$ which are expressed in meter. @@ -280,9 +277,4 @@ vpFeatureBuilder::create(vpFeatureLine &s, throw ; } } - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +#endif //#ifdef VISP_HAVE_MODULE_ME diff --git a/src/tracking/feature-builder/vpFeatureBuilderPoint.cpp b/modules/visual_features/src/feature-builder/vpFeatureBuilderPoint.cpp similarity index 95% rename from src/tracking/feature-builder/vpFeatureBuilderPoint.cpp rename to modules/visual_features/src/feature-builder/vpFeatureBuilderPoint.cpp index 815376dc5e9730ee148772c9fdd12a8a8adf3623..bf37d1fe90a096aaea20bde36e4c9b22f4864438 100644 --- a/src/tracking/feature-builder/vpFeatureBuilderPoint.cpp +++ b/modules/visual_features/src/feature-builder/vpFeatureBuilderPoint.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureBuilderPoint.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Conversion between tracker and visual feature point. * @@ -45,11 +41,11 @@ \brief conversion between tracker and visual feature Point */ -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureException.h> -#include <visp/vpException.h> - +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureException.h> +#include <visp3/core/vpException.h> +#ifdef VISP_HAVE_MODULE_BLOB /*! Create a vpFeaturePoint thanks to a vpDot and the parameters of the camera. The vpDot contains only the pixel coordinates of the point in an image. @@ -174,6 +170,7 @@ void vpFeatureBuilder::create(vpFeaturePoint &s, throw ; } } +#endif //#ifdef VISP_HAVE_MODULE_BLOB /*! @@ -335,13 +332,3 @@ vpFeatureBuilder::create(vpFeaturePoint &s, throw ; } } - - - - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/tracking/feature-builder/vpFeatureBuilderPoint3D.cpp b/modules/visual_features/src/feature-builder/vpFeatureBuilderPoint3D.cpp similarity index 80% rename from src/tracking/feature-builder/vpFeatureBuilderPoint3D.cpp rename to modules/visual_features/src/feature-builder/vpFeatureBuilderPoint3D.cpp index 2367d4337220f9ce6c6cfdd5a459a38ba7ee1421..0a6d796138520b30fa485a42bbc4845924e9e3fe 100644 --- a/src/tracking/feature-builder/vpFeatureBuilderPoint3D.cpp +++ b/modules/visual_features/src/feature-builder/vpFeatureBuilderPoint3D.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureBuilderPoint3D.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Conversion between tracker and visual feature 3D Point. * @@ -45,9 +41,9 @@ \brief conversion between tracker and visual feature 3D Point */ -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureException.h> -#include <visp/vpException.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureException.h> +#include <visp3/core/vpException.h> /*! diff --git a/src/tracking/feature-builder/vpFeatureBuilderPointPolar.cpp b/modules/visual_features/src/feature-builder/vpFeatureBuilderPointPolar.cpp similarity index 96% rename from src/tracking/feature-builder/vpFeatureBuilderPointPolar.cpp rename to modules/visual_features/src/feature-builder/vpFeatureBuilderPointPolar.cpp index fddd38933158912a8e8af8fc1212621c2e5aadf1..774974a2074b042c364f6093872baf8b63d17cc0 100644 --- a/src/tracking/feature-builder/vpFeatureBuilderPointPolar.cpp +++ b/modules/visual_features/src/feature-builder/vpFeatureBuilderPointPolar.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureBuilderPointPolar.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Conversion between tracker and visual feature point with * polar coordinates. @@ -47,10 +43,11 @@ \brief Conversion between tracker and visual feature point with polar coordinates. */ -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureException.h> -#include <visp/vpException.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureException.h> +#include <visp3/core/vpException.h> +#ifdef VISP_HAVE_MODULE_BLOB /*! Initialize a point feature with polar coordinates @@ -201,6 +198,7 @@ void vpFeatureBuilder::create(vpFeaturePointPolar &s, throw ; } } +#endif //#ifdef VISP_HAVE_MODULE_BLOB /*! diff --git a/src/tracking/feature-builder/vpFeatureBuilderSegment.cpp b/modules/visual_features/src/feature-builder/vpFeatureBuilderSegment.cpp similarity index 91% rename from src/tracking/feature-builder/vpFeatureBuilderSegment.cpp rename to modules/visual_features/src/feature-builder/vpFeatureBuilderSegment.cpp index 7901bf71ecdbee979732f840bd46ad98c349a547..3b1fc93dc47c53bb5f418f37086cef32b0c7c5d5 100644 --- a/src/tracking/feature-builder/vpFeatureBuilderSegment.cpp +++ b/modules/visual_features/src/feature-builder/vpFeatureBuilderSegment.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureBuilderLine.cpp 3530 2012-01-03 10:52:12Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Segment creation out of dots. * @@ -46,9 +42,10 @@ \brief Segment creation out of dots. */ -#include <visp/vpFeatureBuilder.h> -#include <visp/vpMath.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/core/vpMath.h> +#ifdef VISP_HAVE_MODULE_BLOB /*! Initialize a segment feature out of vpDots and camera parameters. @@ -123,6 +120,7 @@ void vpFeatureBuilder::create(vpFeatureSegment &s, const vpCameraParameters &cam s.setAlpha(atan2(y1-y2,x1-x2)); } +#endif //#ifdef VISP_HAVE_MODULE_BLOB /*! Initialize a segment feature out of image points and camera parameters. diff --git a/src/tracking/feature-builder/vpFeatureBuilderVanishingPoint.cpp b/modules/visual_features/src/feature-builder/vpFeatureBuilderVanishingPoint.cpp similarity index 88% rename from src/tracking/feature-builder/vpFeatureBuilderVanishingPoint.cpp rename to modules/visual_features/src/feature-builder/vpFeatureBuilderVanishingPoint.cpp index d3d8dbb09fc480708f3954ed70bb483a5683a1d6..a6bb0bbd30e479466c199ad719267c0136b8f5a4 100644 --- a/src/tracking/feature-builder/vpFeatureBuilderVanishingPoint.cpp +++ b/modules/visual_features/src/feature-builder/vpFeatureBuilderVanishingPoint.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureBuilderVanishingPoint.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Conversion between tracker and visual feature vanishing point. * @@ -45,9 +41,9 @@ \brief conversion between vpPoint and visual feature vanishing point. */ -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureException.h> -#include <visp/vpException.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureException.h> +#include <visp3/core/vpException.h> /*! diff --git a/src/visual-feature/vpBasicFeature.cpp b/modules/visual_features/src/visual-feature/vpBasicFeature.cpp similarity index 67% rename from src/visual-feature/vpBasicFeature.cpp rename to modules/visual_features/src/visual-feature/vpBasicFeature.cpp index 4029b5fa606d89b6f59ed0c6df8899ce0b41c433..ba032eb6385dc0bfbdf256a233ae87a71b25218b 100644 --- a/src/visual-feature/vpBasicFeature.cpp +++ b/modules/visual_features/src/visual-feature/vpBasicFeature.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpBasicFeature.cpp 5237 2015-01-30 13:52:04Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Visual feature. * @@ -42,28 +38,27 @@ -#include <visp/vpBasicFeature.h> +#include <visp3/visual_features/vpBasicFeature.h> const unsigned int vpBasicFeature::FEATURE_LINE [32] = { - (unsigned int)(1 << 0), (unsigned int)(1 << 1), - (unsigned int)(1 << 2), (unsigned int)(1 << 3), - (unsigned int)(1 << 4), (unsigned int)(1 << 5), - (unsigned int)(1 << 6), (unsigned int)(1 << 7), - (unsigned int)(1 << 8), (unsigned int)(1 << 9), - (unsigned int)(1 << 10), (unsigned int)(1 << 11), - (unsigned int)(1 << 12), (unsigned int)(1 << 13), - (unsigned int)(1 << 14), (unsigned int)(1 << 15), - (unsigned int)(1 << 16), (unsigned int)(1 << 17), - (unsigned int)(1 << 18), (unsigned int)(1 << 19), - (unsigned int)(1 << 20), (unsigned int)(1 << 21), - (unsigned int)(1 << 22), (unsigned int)(1 << 23), - (unsigned int)(1 << 24), (unsigned int)(1 << 25), - (unsigned int)(1 << 26), (unsigned int)(1 << 27), - (unsigned int)(1 << 28), (unsigned int)(1 << 29), - (unsigned int)(1 << 30), (unsigned int)(1 << 31) + (unsigned int)(1 << 0), (unsigned int)(1 << 1), + (unsigned int)(1 << 2), (unsigned int)(1 << 3), + (unsigned int)(1 << 4), (unsigned int)(1 << 5), + (unsigned int)(1 << 6), (unsigned int)(1 << 7), + (unsigned int)(1 << 8), (unsigned int)(1 << 9), + (unsigned int)(1 << 10), (unsigned int)(1 << 11), + (unsigned int)(1 << 12), (unsigned int)(1 << 13), + (unsigned int)(1 << 14), (unsigned int)(1 << 15), + (unsigned int)(1 << 16), (unsigned int)(1 << 17), + (unsigned int)(1 << 18), (unsigned int)(1 << 19), + (unsigned int)(1 << 20), (unsigned int)(1 << 21), + (unsigned int)(1 << 22), (unsigned int)(1 << 23), + (unsigned int)(1 << 24), (unsigned int)(1 << 25), + (unsigned int)(1 << 26), (unsigned int)(1 << 27), + (unsigned int)(1 << 28), (unsigned int)(1 << 29), + (unsigned int)(1 << 30), (unsigned int)(1 << 31) }; -const unsigned int vpBasicFeature::FEATURE_ALL = 0xffff; /*! \file vpBasicFeature.cpp @@ -132,22 +127,22 @@ vpBasicFeature::getDimension(unsigned int select) const //! Get the feature vector \f$\bf s\f$. vpColVector - vpBasicFeature::get_s(const unsigned int select) const +vpBasicFeature::get_s(const unsigned int select) const { - vpColVector state(0),stateLine(1); - // if s is higher than the possible selections (photometry), send back the whole vector - if(dim_s > 31) - return s; + vpColVector state(0), stateLine(1); + // if s is higher than the possible selections (photometry), send back the whole vector + if(dim_s > 31) + return s; - for(unsigned int i=0;i<dim_s;++i) - { - if(FEATURE_LINE[i] & select) - { - stateLine[0] = s[i]; - state.stackMatrices(stateLine); - } - } - return state ; + for(unsigned int i=0;i<dim_s;++i) + { + if(FEATURE_LINE[i] & select) + { + stateLine[0] = s[i]; + state.stack(stateLine); + } + } + return state ; } void vpBasicFeature::resetFlags() @@ -180,7 +175,7 @@ vpColVector vpBasicFeature::error(const vpBasicFeature &s_star, if(FEATURE_LINE[i] & select) { eLine[0] = s[i] - s_star[i]; - e.stackMatrices(eLine); + e.stack(eLine); //std::cout << "dim_s <= 31"<<std::endl; } } diff --git a/src/visual-feature/vpFeatureDepth.cpp b/modules/visual_features/src/visual-feature/vpFeatureDepth.cpp similarity index 94% rename from src/visual-feature/vpFeatureDepth.cpp rename to modules/visual_features/src/visual-feature/vpFeatureDepth.cpp index e8bc72c90370d29b91f050a2e469b8175f51d0ca..f25beeed987d4eabd9525be3af3b8d6796ad48ed 100644 --- a/src/visual-feature/vpFeatureDepth.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureDepth.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureDepth.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D point visual feature. * @@ -46,21 +42,20 @@ */ -#include <visp/vpBasicFeature.h> -#include <visp/vpFeatureDepth.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/visual_features/vpFeatureDepth.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpFeatureException.h> +#include <visp3/core/vpException.h> +#include <visp3/visual_features/vpFeatureException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> // math -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> -#include <visp/vpFeatureDisplay.h> +#include <visp3/core/vpFeatureDisplay.h> diff --git a/src/visual-feature/vpFeatureEllipse.cpp b/modules/visual_features/src/visual-feature/vpFeatureEllipse.cpp similarity index 87% rename from src/visual-feature/vpFeatureEllipse.cpp rename to modules/visual_features/src/visual-feature/vpFeatureEllipse.cpp index 8c864e16ef8721e8b5a261115bc47ad6542c8670..95762ce4d3fabbe21b1d8931415f055a038cf7d1 100644 --- a/src/visual-feature/vpFeatureEllipse.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureEllipse.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureEllipse.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D ellipse visual feature. * @@ -46,23 +42,22 @@ */ -#include <visp/vpBasicFeature.h> -#include <visp/vpFeatureEllipse.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/visual_features/vpFeatureEllipse.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpFeatureException.h> +#include <visp3/core/vpException.h> +#include <visp3/visual_features/vpFeatureException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> // math -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> -#include <visp/vpFeatureDisplay.h> +#include <visp3/core/vpFeatureDisplay.h> /* @@ -175,7 +170,7 @@ vpFeatureEllipse::interaction(const unsigned int select) H[0][5] = yc; - L = vpMatrix::stackMatrices(L,H) ; + L = vpMatrix::stack(L,H) ; } if (vpFeatureEllipse::selectY() & select ) @@ -190,7 +185,7 @@ vpFeatureEllipse::interaction(const unsigned int select) H[0][4] = -xc*yc - mu11; H[0][5] = -xc; - L = vpMatrix::stackMatrices(L,H) ; + L = vpMatrix::stack(L,H) ; } if (vpFeatureEllipse::selectMu20() & select ) @@ -204,7 +199,7 @@ vpFeatureEllipse::interaction(const unsigned int select) H[0][4] = -4*mu20*xc; H[0][5] = 2*mu11; - L = vpMatrix::stackMatrices(L,H) ; + L = vpMatrix::stack(L,H) ; } if (vpFeatureEllipse::selectMu11() & select ) @@ -218,7 +213,7 @@ vpFeatureEllipse::interaction(const unsigned int select) H[0][4] = -yc*mu20-3*xc*mu11; H[0][5] = mu02-mu20; - L = vpMatrix::stackMatrices(L,H) ; + L = vpMatrix::stack(L,H) ; } if (vpFeatureEllipse::selectMu02() & select ) @@ -231,7 +226,7 @@ vpFeatureEllipse::interaction(const unsigned int select) H[0][3] = 4*yc*mu02; H[0][4] = -2*(yc*mu11 +xc*mu02) ; H[0][5] = -2*mu11 ; - L = vpMatrix::stackMatrices(L,H) ; + L = vpMatrix::stack(L,H) ; } @@ -252,14 +247,14 @@ vpFeatureEllipse::error(const vpBasicFeature &s_star, vpColVector ex(1) ; ex[0] = s[0] - s_star[0] ; - e = vpMatrix::stackMatrices(e,ex) ; + e = vpColVector::stack(e,ex) ; } if (vpFeatureEllipse::selectY() & select ) { vpColVector ey(1) ; ey[0] = s[1] - s_star[1] ; - e = vpMatrix::stackMatrices(e,ey) ; + e = vpColVector::stack(e,ey) ; } if (vpFeatureEllipse::selectMu20() & select ) @@ -267,37 +262,27 @@ vpFeatureEllipse::error(const vpBasicFeature &s_star, vpColVector ex(1) ; ex[0] = s[2] - s_star[2] ; - e = vpMatrix::stackMatrices(e,ex) ; + e = vpColVector::stack(e,ex) ; } if (vpFeatureEllipse::selectMu11() & select ) { vpColVector ey(1) ; ey[0] = s[3] - s_star[3] ; - e = vpMatrix::stackMatrices(e,ey) ; + e = vpColVector::stack(e,ey) ; } if (vpFeatureEllipse::selectMu02() & select ) { vpColVector ey(1) ; ey[0] = s[4] - s_star[4] ; - e = vpMatrix::stackMatrices(e,ey) ; + e = vpColVector::stack(e,ey) ; } } - catch(vpMatrixException me) - { - vpERROR_TRACE("caught a Matrix related error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; + catch(...) { + throw; } - catch(vpException me) - { - vpERROR_TRACE("caught another error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; - } - return e ; @@ -481,9 +466,8 @@ vpFeatureEllipse *vpFeatureEllipse::duplicate() const return feature ; } - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +unsigned int vpFeatureEllipse::selectX() { return FEATURE_LINE[0] ; } +unsigned int vpFeatureEllipse::selectY() { return FEATURE_LINE[1] ; } +unsigned int vpFeatureEllipse::selectMu20() { return FEATURE_LINE[2] ; } +unsigned int vpFeatureEllipse::selectMu11() { return FEATURE_LINE[3] ; } +unsigned int vpFeatureEllipse::selectMu02() { return FEATURE_LINE[4] ; } diff --git a/src/visual-feature/vpFeatureLine.cpp b/modules/visual_features/src/visual-feature/vpFeatureLine.cpp similarity index 87% rename from src/visual-feature/vpFeatureLine.cpp rename to modules/visual_features/src/visual-feature/vpFeatureLine.cpp index 77d348d7276784f1ec4b3e6f9a882743948edcb8..b63aa551d6bcf729bd1552a76177c797662a0cd0 100644 --- a/src/visual-feature/vpFeatureLine.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureLine.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureLine.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D line visual feature. * @@ -46,32 +42,31 @@ */ -#include <visp/vpBasicFeature.h> -#include <visp/vpFeatureLine.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/visual_features/vpFeatureLine.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpFeatureException.h> +#include <visp3/core/vpException.h> +#include <visp3/visual_features/vpFeatureException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> // simple math function (round) -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> // Display Issue // Meter/pixel conversion -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpCameraParameters.h> //Color / image / display -#include <visp/vpColor.h> -#include <visp/vpImage.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> -#include <visp/vpFeatureDisplay.h> +#include <visp3/core/vpFeatureDisplay.h> /* @@ -273,7 +268,7 @@ vpFeatureLine::interaction(const unsigned int select) Lrho[0][4]= -co*(1.0 + rho*rho); Lrho[0][5]= 0.0; - L = vpMatrix::stackMatrices(L,Lrho) ; + L = vpMatrix::stack(L,Lrho) ; } if (vpFeatureLine::selectTheta() & select ) @@ -287,7 +282,7 @@ vpFeatureLine::interaction(const unsigned int select) Ltheta[0][4] = -rho*si; Ltheta[0][5] = -1.0; - L = vpMatrix::stackMatrices(L,Ltheta) ; + L = vpMatrix::stack(L,Ltheta) ; } return L ; } @@ -343,9 +338,7 @@ vpFeatureLine::error(const vpBasicFeature &s_star, vpColVector erho(1) ; erho[0] = s[0] - s_star[0] ; - - - e = vpMatrix::stackMatrices(e,erho) ; + e = vpColVector::stack(e,erho) ; } if (vpFeatureLine::selectTheta() & select ) @@ -357,25 +350,14 @@ vpFeatureLine::error(const vpBasicFeature &s_star, vpColVector etheta(1) ; etheta[0] = err ; - e = vpMatrix::stackMatrices(e,etheta) ; + e = vpColVector::stack(e,etheta) ; } } - catch(vpMatrixException me) - { - vpERROR_TRACE("caught a Matric related error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; - } - catch(vpException me) - { - vpERROR_TRACE("caught another error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; + catch(...) { + throw ; } - return e ; - } @@ -557,10 +539,38 @@ vpFeatureLine::display(const vpCameraParameters &cam, } } +/*! + Function used to select the \f$ \rho \f$ subset of the line visual feature. -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ + This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to \f$ \rho \f$. + + This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law: + + \code + vpFeatureLine s; + vpServo task; + ... + // Add the (rho) subset features from the 2D line + task.addFeature(s, vpFeatureLine::selectRho()); + \endcode +*/ +unsigned int vpFeatureLine::selectRho() { return FEATURE_LINE[0] ; } + +/*! + + Function used to select the \f$ \theta \f$ subset of the line visual feature. + + This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to \f$ \theta \f$. + + This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law: + + \code + vpFeatureLine s; + vpServo task; + ... + // Add the (rho) subset features from the 2D line + task.addFeature(s, vpFeatureLine::selectTheta()); + \endcode +*/ +unsigned int vpFeatureLine::selectTheta() { return FEATURE_LINE[1] ; } diff --git a/src/visual-feature/vpFeatureLuminance.cpp b/modules/visual_features/src/visual-feature/vpFeatureLuminance.cpp old mode 100755 new mode 100644 similarity index 81% rename from src/visual-feature/vpFeatureLuminance.cpp rename to modules/visual_features/src/visual-feature/vpFeatureLuminance.cpp index b40dbe57590acc55422f56b2854cc6dd218e8dd0..98935eafe135b095b640660f04dd8d9137baa553 --- a/src/visual-feature/vpFeatureLuminance.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureLuminance.cpp @@ -1,14 +1,50 @@ - - -#include <visp/vpMatrix.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpDisplay.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpImageConvert.h> -#include <visp/vpImageFilter.h> -#include <visp/vpException.h> - -#include <visp/vpFeatureLuminance.h> +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Luminance feature. + * + * Authors: + * Eric Marchand + * + *****************************************************************************/ + + +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/core/vpImageFilter.h> +#include <visp3/core/vpException.h> + +#include <visp3/visual_features/vpFeatureLuminance.h> /*! diff --git a/src/visual-feature/vpFeatureMoment.cpp b/modules/visual_features/src/visual-feature/vpFeatureMoment.cpp similarity index 91% rename from src/visual-feature/vpFeatureMoment.cpp rename to modules/visual_features/src/visual-feature/vpFeatureMoment.cpp index 9b92dee27f2949687a6440f0cc55fe2060d13972..3ee827051e78deed53d746e678ec2d97712754f0 100644 --- a/src/visual-feature/vpFeatureMoment.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureMoment.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMoment.cpp 5237 2015-01-30 13:52:04Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Base for all moment features * @@ -39,17 +35,16 @@ * *****************************************************************************/ -#include <visp/vpFeatureMoment.h> -#include <visp/vpMoment.h> -#include <visp/vpFeatureMomentDatabase.h> -#include <visp/vpMomentDatabase.h> -#include <visp/vpMath.h> +#include <visp3/visual_features/vpFeatureMoment.h> +#include <visp3/core/vpMoment.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpMath.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpFeatureException.h> +#include <visp3/core/vpException.h> +#include <visp3/visual_features/vpFeatureException.h> -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> #include <vector> class vpBasicFeature; @@ -195,7 +190,7 @@ vpMatrix vpFeatureMoment::interaction (unsigned int select){ for(unsigned int i=0;i<dim_s;++i){ if(vpBasicFeature::FEATURE_LINE[i] & select){ - L.stackMatrices(interaction_matrices[i]); + L.stack(interaction_matrices[i]); } } diff --git a/src/visual-feature/vpFeatureMomentAlpha.cpp b/modules/visual_features/src/visual-feature/vpFeatureMomentAlpha.cpp similarity index 86% rename from src/visual-feature/vpFeatureMomentAlpha.cpp rename to modules/visual_features/src/visual-feature/vpFeatureMomentAlpha.cpp index 9645e49e1fcc24321e618fbdf327f5c7b0611975..a560ee9c4680bc3ab817f4eae52cc69deaf34aab 100644 --- a/src/visual-feature/vpFeatureMomentAlpha.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureMomentAlpha.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.cpp 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for alpha moment features. * @@ -39,12 +35,12 @@ * *****************************************************************************/ -#include <visp/vpMomentObject.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpFeatureMomentAlpha.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpFeatureMomentCentered.h> -#include <visp/vpFeatureMomentDatabase.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/visual_features/vpFeatureMomentAlpha.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/visual_features/vpFeatureMomentCentered.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> #include <vector> #include <limits> @@ -149,16 +145,16 @@ void vpFeatureMomentAlpha::compute_interaction(){ } vpColVector vpFeatureMomentAlpha::error (const vpBasicFeature &s_star, const unsigned int /* select */){ - vpColVector e(0) ; - double err = s[0] - s_star[0] ; + vpColVector e(0) ; + double err = s[0] - s_star[0] ; - if (err < -M_PI) err += 2*M_PI ; - if (err > M_PI) err -= 2*M_PI ; + if (err < -M_PI) err += 2*M_PI ; + if (err > M_PI) err -= 2*M_PI ; - vpColVector ecv(1) ; - ecv[0] = err ; - e = vpMatrix::stackMatrices(e,ecv) ; + vpColVector ecv(1) ; + ecv[0] = err ; + e = vpColVector::stack(e,ecv) ; - return e; + return e; } #endif diff --git a/src/visual-feature/vpFeatureMomentArea.cpp b/modules/visual_features/src/visual-feature/vpFeatureMomentArea.cpp similarity index 84% rename from src/visual-feature/vpFeatureMomentArea.cpp rename to modules/visual_features/src/visual-feature/vpFeatureMomentArea.cpp index 175f9227b8ab32a64a791d694d7df57b4563e094..b0857cbd101f4128c555841f49741a546df767ac 100644 --- a/src/visual-feature/vpFeatureMomentArea.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureMomentArea.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentArea.cpp 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation of vpFeatureMomentArea associated to vpMomentArea * @@ -38,17 +34,17 @@ * Manikandan Bakthavatchalam * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <vector> #include <limits> #include <cassert> #include <limits> // numeric_limits -#include <visp/vpFeatureMomentArea.h> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentArea.h> -#include <visp/vpFeatureMomentDatabase.h> +#include <visp3/visual_features/vpFeatureMomentArea.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentArea.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> /*! Computes interaction matrix for the normalized surface moment. Called internally. diff --git a/src/visual-feature/vpFeatureMomentAreaNormalized.cpp b/modules/visual_features/src/visual-feature/vpFeatureMomentAreaNormalized.cpp similarity index 87% rename from src/visual-feature/vpFeatureMomentAreaNormalized.cpp rename to modules/visual_features/src/visual-feature/vpFeatureMomentAreaNormalized.cpp index 5150af6d8d99243ba9977c26404ad55799d89e64..7af7d5307e2302de8dcee44cedced6c2fa393fa9 100644 --- a/src/visual-feature/vpFeatureMomentAreaNormalized.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureMomentAreaNormalized.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.cpp 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -38,19 +34,19 @@ * Filip Novotny * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_MOMENTS_COMBINE_MATRICES #include <vector> #include <limits> -#include <visp/vpMomentObject.h> -#include <visp/vpFeatureMomentAreaNormalized.h> -#include <visp/vpFeatureMomentBasic.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentAreaNormalized.h> -#include <visp/vpFeatureMomentCentered.h> -#include <visp/vpFeatureMomentDatabase.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/visual_features/vpFeatureMomentAreaNormalized.h> +#include <visp3/visual_features/vpFeatureMomentBasic.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentAreaNormalized.h> +#include <visp3/visual_features/vpFeatureMomentCentered.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> /*! @@ -102,13 +98,13 @@ void vpFeatureMomentAreaNormalized::compute_interaction(){ #include <vector> #include <limits> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentAreaNormalized.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpFeatureMomentDatabase.h> -#include <visp/vpFeatureMomentAreaNormalized.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentAreaNormalized.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> +#include <visp3/visual_features/vpFeatureMomentAreaNormalized.h> /*! Computes interaction matrix for the normalized surface moment. Called internally. diff --git a/src/visual-feature/vpFeatureMomentBasic.cpp b/modules/visual_features/src/visual-feature/vpFeatureMomentBasic.cpp similarity index 92% rename from src/visual-feature/vpFeatureMomentBasic.cpp rename to modules/visual_features/src/visual-feature/vpFeatureMomentBasic.cpp index 08ef40ebf6732ac23cc9b15c4703f0aba228dc8a..b0b997ad4a9d764b50258520b582f7cacd103b4e 100644 --- a/src/visual-feature/vpFeatureMomentBasic.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureMomentBasic.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.cpp 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -41,9 +37,9 @@ -#include <visp/vpMomentObject.h> -#include <visp/vpFeatureMomentBasic.h> -#include <visp/vpFeatureMomentDatabase.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/visual_features/vpFeatureMomentBasic.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> #include <vector> #include <limits> /*! diff --git a/src/visual-feature/vpFeatureMomentCInvariant.cpp b/modules/visual_features/src/visual-feature/vpFeatureMomentCInvariant.cpp similarity index 97% rename from src/visual-feature/vpFeatureMomentCInvariant.cpp rename to modules/visual_features/src/visual-feature/vpFeatureMomentCInvariant.cpp index 10aa1ec9fa8ae0d40bad9936eb97ae44803a3e1b..3edaff40d9395a2704f0ba23c14e77f55081c18f 100644 --- a/src/visual-feature/vpFeatureMomentCInvariant.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureMomentCInvariant.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.cpp 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -38,15 +34,15 @@ * Filip Novotny * *****************************************************************************/ -#include <visp/vpMomentObject.h> +#include <visp3/core/vpMomentObject.h> #ifdef VISP_MOMENTS_COMBINE_MATRICES -#include <visp/vpFeatureMomentCInvariant.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentCInvariant.h> -#include <visp/vpFeatureMomentCentered.h> -#include <visp/vpFeatureMomentBasic.h> +#include <visp3/visual_features/vpFeatureMomentCInvariant.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentCInvariant.h> +#include <visp3/visual_features/vpFeatureMomentCentered.h> +#include <visp3/visual_features/vpFeatureMomentBasic.h> -#include <visp/vpFeatureMomentDatabase.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> #include <vector> #include <limits> @@ -183,13 +179,13 @@ void vpFeatureMomentCInvariant::compute_interaction(){ } #else -#include <visp/vpFeatureMomentCInvariant.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentCInvariant.h> -#include <visp/vpFeatureMomentCentered.h> -#include <visp/vpFeatureMomentBasic.h> +#include <visp3/visual_features/vpFeatureMomentCInvariant.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentCInvariant.h> +#include <visp3/visual_features/vpFeatureMomentCentered.h> +#include <visp3/visual_features/vpFeatureMomentBasic.h> -#include <visp/vpFeatureMomentDatabase.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> #include <vector> #include <iostream> diff --git a/src/visual-feature/vpFeatureMomentCentered.cpp b/modules/visual_features/src/visual-feature/vpFeatureMomentCentered.cpp similarity index 94% rename from src/visual-feature/vpFeatureMomentCentered.cpp rename to modules/visual_features/src/visual-feature/vpFeatureMomentCentered.cpp index e518fe27c158579a557ec40bbe7e9d74a5eeb7c5..8155ad62d5adb460868f4f99726a7ee496c8d693 100644 --- a/src/visual-feature/vpFeatureMomentCentered.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureMomentCentered.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.cpp 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -39,18 +35,18 @@ * Manikandan Bakthavatchalam *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <vector> #include <limits> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentObject.h> -#include <visp/vpFeatureMomentBasic.h> -#include <visp/vpFeatureMomentCentered.h> -#include <visp/vpFeatureMomentDatabase.h> -#include <visp/vpFeatureMomentGravityCenter.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/visual_features/vpFeatureMomentBasic.h> +#include <visp3/visual_features/vpFeatureMomentCentered.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> +#include <visp3/visual_features/vpFeatureMomentGravityCenter.h> /*! diff --git a/src/visual-feature/vpFeatureMomentCommon.cpp b/modules/visual_features/src/visual-feature/vpFeatureMomentCommon.cpp similarity index 86% rename from src/visual-feature/vpFeatureMomentCommon.cpp rename to modules/visual_features/src/visual-feature/vpFeatureMomentCommon.cpp index 7b4bf31653b49f55a721894db6543e592994153c..8eb0c06654eb01c02449810a720b78326abb3aa7 100644 --- a/src/visual-feature/vpFeatureMomentCommon.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureMomentCommon.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentCommon.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pre-filled pseudo-database used to handle dependencies between common moment features. * @@ -39,8 +35,8 @@ * *****************************************************************************/ -#include <visp/vpFeatureMomentCommon.h> -#include <visp/vpMomentDatabase.h> +#include <visp3/visual_features/vpFeatureMomentCommon.h> +#include <visp3/core/vpMomentDatabase.h> /*! Constructor which initializes and links all common features in the database diff --git a/src/visual-feature/vpFeatureMomentDatabase.cpp b/modules/visual_features/src/visual-feature/vpFeatureMomentDatabase.cpp similarity index 88% rename from src/visual-feature/vpFeatureMomentDatabase.cpp rename to modules/visual_features/src/visual-feature/vpFeatureMomentDatabase.cpp index be3943425084e7e0086befbd2929a7932057f681..af16de96a728a504319d528537bd5542f59a94f9 100644 --- a/src/visual-feature/vpFeatureMomentDatabase.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureMomentDatabase.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentDatabase.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Pseudo-database used to handle dependencies between moment features. * @@ -39,11 +35,11 @@ * *****************************************************************************/ -#include <visp/vpFeatureMomentDatabase.h> -#include <visp/vpFeatureMoment.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> +#include <visp3/visual_features/vpFeatureMoment.h> #include <typeinfo> #include <iostream> -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> /*! Add a moment and it's corresponding name to the database diff --git a/src/visual-feature/vpFeatureMomentGravityCenter.cpp b/modules/visual_features/src/visual-feature/vpFeatureMomentGravityCenter.cpp similarity index 85% rename from src/visual-feature/vpFeatureMomentGravityCenter.cpp rename to modules/visual_features/src/visual-feature/vpFeatureMomentGravityCenter.cpp index 425d757d60da20660ef89eaae6f016a6bdf098ef..fef4f28095f141b514e461c9c4d0f091aa753eaf 100644 --- a/src/visual-feature/vpFeatureMomentGravityCenter.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureMomentGravityCenter.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.cpp 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -39,17 +35,17 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_MOMENTS_COMBINE_MATRICES #include <vector> #include <limits> -#include <visp/vpMomentObject.h> -#include <visp/vpFeatureMomentGravityCenter.h> -#include <visp/vpFeatureMomentBasic.h> -#include <visp/vpFeatureMomentDatabase.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/visual_features/vpFeatureMomentGravityCenter.h> +#include <visp3/visual_features/vpFeatureMomentBasic.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> /*! @@ -83,12 +79,12 @@ void vpFeatureMomentGravityCenter::compute_interaction(){ #include <vector> #include <limits> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentDatabase.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpFeatureMomentGravityCenter.h> -#include <visp/vpMomentObject.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/visual_features/vpFeatureMomentGravityCenter.h> +#include <visp3/core/vpMomentObject.h> /*! diff --git a/src/visual-feature/vpFeatureMomentGravityCenterNormalized.cpp b/modules/visual_features/src/visual-feature/vpFeatureMomentGravityCenterNormalized.cpp similarity index 87% rename from src/visual-feature/vpFeatureMomentGravityCenterNormalized.cpp rename to modules/visual_features/src/visual-feature/vpFeatureMomentGravityCenterNormalized.cpp index 88b590576726bd64f8ac59b1842fe2eb7b43e08d..a974cf28180c544fd5943083f520a3490f9ac939 100644 --- a/src/visual-feature/vpFeatureMomentGravityCenterNormalized.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureMomentGravityCenterNormalized.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: vpFeatureMomentImpl.cpp 3317 2011-09-06 14:14:47Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Brngne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Implementation for all supported moment features. * @@ -39,21 +35,21 @@ * *****************************************************************************/ -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #ifdef VISP_MOMENTS_COMBINE_MATRICES #include <vector> #include <limits> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpMomentAreaNormalized.h> -#include <visp/vpMomentGravityCenter.h> -#include <visp/vpFeatureMomentGravityCenter.h> -#include <visp/vpFeatureMomentAreaNormalized.h> -#include <visp/vpFeatureMomentGravityCenterNormalized.h> -#include <visp/vpFeatureMomentDatabase.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/core/vpMomentAreaNormalized.h> +#include <visp3/core/vpMomentGravityCenter.h> +#include <visp3/visual_features/vpFeatureMomentGravityCenter.h> +#include <visp3/visual_features/vpFeatureMomentAreaNormalized.h> +#include <visp3/visual_features/vpFeatureMomentGravityCenterNormalized.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> /*! Computes interaction matrix for centered and normalized moment. Called internally. @@ -95,12 +91,12 @@ void vpFeatureMomentGravityCenterNormalized::compute_interaction(){ #include <vector> #include <limits> -#include <visp/vpMomentObject.h> -#include <visp/vpMomentCentered.h> -#include <visp/vpFeatureMomentDatabase.h> -#include <visp/vpFeatureMomentGravityCenterNormalized.h> -#include <visp/vpMomentAreaNormalized.h> -#include <visp/vpMomentGravityCenter.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentCentered.h> +#include <visp3/visual_features/vpFeatureMomentDatabase.h> +#include <visp3/visual_features/vpFeatureMomentGravityCenterNormalized.h> +#include <visp3/core/vpMomentAreaNormalized.h> +#include <visp3/core/vpMomentGravityCenter.h> /*! diff --git a/src/visual-feature/vpFeaturePoint.cpp b/modules/visual_features/src/visual-feature/vpFeaturePoint.cpp similarity index 87% rename from src/visual-feature/vpFeaturePoint.cpp rename to modules/visual_features/src/visual-feature/vpFeaturePoint.cpp index 0e216dac340e2c8808bf39f3851403c81f970eb0..e229e456ccc8f236f746667f57a57faab4d4924f 100644 --- a/src/visual-feature/vpFeaturePoint.cpp +++ b/modules/visual_features/src/visual-feature/vpFeaturePoint.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeaturePoint.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D point visual feature. * @@ -46,21 +42,20 @@ */ -#include <visp/vpBasicFeature.h> -#include <visp/vpFeaturePoint.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/visual_features/vpFeaturePoint.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpFeatureException.h> +#include <visp3/core/vpException.h> +#include <visp3/visual_features/vpFeatureException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> // math -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> -#include <visp/vpFeatureDisplay.h> +#include <visp3/core/vpFeatureDisplay.h> @@ -307,7 +302,7 @@ vpFeaturePoint::interaction(const unsigned int select) Lx[0][4] = -(1+x_*x_) ; Lx[0][5] = y_ ; - L = vpMatrix::stackMatrices(L,Lx) ; + L = vpMatrix::stack(L,Lx) ; } if (vpFeaturePoint::selectY() & select ) @@ -321,7 +316,7 @@ vpFeaturePoint::interaction(const unsigned int select) Ly[0][4] = -x_*y_ ; Ly[0][5] = -x_ ; - L = vpMatrix::stackMatrices(L,Ly) ; + L = vpMatrix::stack(L,Ly) ; } return L ; } @@ -369,27 +364,18 @@ vpFeaturePoint::error(const vpBasicFeature &s_star, vpColVector ex(1) ; ex[0] = s[0] - s_star[0] ; - e = vpMatrix::stackMatrices(e,ex) ; + e = vpColVector::stack(e,ex) ; } if (vpFeaturePoint::selectY() & select ) { vpColVector ey(1) ; ey[0] = s[1] - s_star[1] ; - e = vpMatrix::stackMatrices(e,ey) ; + e = vpColVector::stack(e,ey) ; } } - catch(vpMatrixException me) - { - vpERROR_TRACE("caught a Matrix related error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; - } - catch(vpException me) - { - vpERROR_TRACE("caught another error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; + catch(...) { + throw ; } @@ -549,9 +535,38 @@ vpFeaturePoint *vpFeaturePoint::duplicate() const return feature ; } +/*! -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ + Function used to select the \f$ x \f$ subset of the point visual feature. + + This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to \f$ x \f$. + + This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law: + + \code + vpFeaturePoint s; + vpServo task; + ... + // Add the (x) subset features from the 2D point + task.addFeature(s, vpFeaturePoint::selectX()); + \endcode +*/ +unsigned int vpFeaturePoint::selectX() { return FEATURE_LINE[0] ; } + +/*! + + Function used to select the \f$ y \f$ subset of the point visual feature. + + This function is to use in conjunction with interaction() in order to compute the interaction matrix associated to \f$ y \f$. + + This function is also useful in the vpServo class to indicate that a subset of the visual feature is to use in the control law: + + \code + vpFeaturePoint s; + vpServo task; + ... + // Add the (y) subset features from the 2D point + task.addFeature(s, vpFeaturePoint::selectY()); + \endcode +*/ +unsigned int vpFeaturePoint::selectY() { return FEATURE_LINE[1] ; } diff --git a/src/visual-feature/vpFeaturePoint3D.cpp b/modules/visual_features/src/visual-feature/vpFeaturePoint3D.cpp similarity index 83% rename from src/visual-feature/vpFeaturePoint3D.cpp rename to modules/visual_features/src/visual-feature/vpFeaturePoint3D.cpp index 3cea622347c2b44623289840797b226c226bec42..35ae5ae5a494a4187b21ca20a7863a64eddf2bb4 100644 --- a/src/visual-feature/vpFeaturePoint3D.cpp +++ b/modules/visual_features/src/visual-feature/vpFeaturePoint3D.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeaturePoint3D.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 3D point visual feature. * @@ -41,16 +37,15 @@ *****************************************************************************/ -#include <visp/vpBasicFeature.h> -#include <visp/vpFeaturePoint3D.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/visual_features/vpFeaturePoint3D.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpFeatureException.h> +#include <visp3/core/vpException.h> +#include <visp3/visual_features/vpFeatureException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> @@ -304,7 +299,7 @@ vpFeaturePoint3D::interaction(const unsigned int select) Lx[0][4] = -Z ; Lx[0][5] = Y ; - L = vpMatrix::stackMatrices(L,Lx) ; + L = vpMatrix::stack(L,Lx) ; } if (vpFeaturePoint3D::selectY() & select ) @@ -318,7 +313,7 @@ vpFeaturePoint3D::interaction(const unsigned int select) Ly[0][4] = 0 ; Ly[0][5] = -X ; - L = vpMatrix::stackMatrices(L,Ly) ; + L = vpMatrix::stack(L,Ly) ; } if (vpFeaturePoint3D::selectZ() & select ) { @@ -331,7 +326,7 @@ vpFeaturePoint3D::interaction(const unsigned int select) Lz[0][4] = X ; Lz[0][5] = 0 ; - L = vpMatrix::stackMatrices(L,Lz) ; + L = vpMatrix::stack(L,Lz) ; } return L ; } @@ -397,34 +392,25 @@ vpFeaturePoint3D::error(const vpBasicFeature &s_star, vpColVector ex(1) ; ex[0] = s[0] - s_star[0] ; - e = vpMatrix::stackMatrices(e,ex) ; + e = vpColVector::stack(e,ex) ; } if (vpFeaturePoint3D::selectY() & select ) { vpColVector ey(1) ; ey[0] = s[1] - s_star[1] ; - e = vpMatrix::stackMatrices(e,ey) ; + e = vpColVector::stack(e,ey) ; } if (vpFeaturePoint3D::selectZ() & select ) { vpColVector ez(1) ; ez[0] = s[2] - s_star[2] ; - e = vpMatrix::stackMatrices(e,ez) ; + e = vpColVector::stack(e,ez) ; } } - catch(vpMatrixException me) - { - vpERROR_TRACE("caught a Matrix related error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; - } - catch(vpException me) - { - vpERROR_TRACE("caught another error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; + catch(...) { + throw ; } return e ; @@ -623,9 +609,80 @@ vpFeaturePoint3D::display(const vpCameraParameters &/*cam*/, // to produce a failure } } +/*! -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ + Function used to select the \f$ X\f$ subset coordinate of the 3D point + visual feature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$ X\f$ feature. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + \code + vpFeaturePoint3D p; + vpServo task; + ... + // Add the (X,Y) subset coordinates features from a 3D point to the task + task.addFeature(p, vpFeaturePoint3D::selectX() | vpFeaturePoint3D::selectY()); + \endcode + + \sa selectY(), selectZ() + +*/ +unsigned int vpFeaturePoint3D::selectX() { return FEATURE_LINE[0] ; } + +/*! + + Function used to select the \f$ Y\f$ subset coordinate of the 3D point + visual feature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$ Y\f$ feature. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + \code + vpFeaturePoint3D p; + vpServo task; + ... + // Add the (X,Y) subset coordinates features from a 3D point to the task + task.addFeature(p, vpFeaturePoint3D::selectX() | vpFeaturePoint3D::selectY()); + \endcode + + \sa selectX(), selectZ() + +*/ +unsigned int vpFeaturePoint3D::selectY() { return FEATURE_LINE[1] ; } + +/*! + + Function used to select the \f$ Z\f$ subset coordinate of the 3D point + visual feature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$ Z\f$ feature. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + \code + vpFeaturePoint3D p; + vpServo task; + ... + // Add the (Z) subset coordinate feature from a 3D point to the task + task.addFeature(p, vpFeaturePoint3D::selectZ()); + \endcode + + \sa selectX(), selectY() + +*/ +unsigned int vpFeaturePoint3D::selectZ() { return FEATURE_LINE[2] ; } diff --git a/src/visual-feature/vpFeaturePointPolar.cpp b/modules/visual_features/src/visual-feature/vpFeaturePointPolar.cpp similarity index 87% rename from src/visual-feature/vpFeaturePointPolar.cpp rename to modules/visual_features/src/visual-feature/vpFeaturePointPolar.cpp index d6775f9839f82f456f403629eb4b0cf6b8d4d92f..74281e5a215ed6cb64a666305f7bf11185bf3abf 100644 --- a/src/visual-feature/vpFeaturePointPolar.cpp +++ b/modules/visual_features/src/visual-feature/vpFeaturePointPolar.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeaturePointPolar.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D point visual feature. * @@ -46,21 +42,20 @@ */ -#include <visp/vpBasicFeature.h> -#include <visp/vpFeaturePointPolar.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/visual_features/vpFeaturePointPolar.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpFeatureException.h> +#include <visp3/core/vpException.h> +#include <visp3/visual_features/vpFeatureException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> // math -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> -#include <visp/vpFeatureDisplay.h> +#include <visp3/core/vpFeatureDisplay.h> @@ -358,7 +353,7 @@ vpFeaturePointPolar::interaction(const unsigned int select) // printf("Lrho: rho %f theta %f Z %f\n", rho, theta, Z); // std::cout << "Lrho: " << Lrho << std::endl; - L = vpMatrix::stackMatrices(L,Lrho) ; + L = vpMatrix::stack(L,Lrho) ; } if (vpFeaturePointPolar::selectTheta() & select ) @@ -374,7 +369,7 @@ vpFeaturePointPolar::interaction(const unsigned int select) // printf("Ltheta: rho %f theta %f Z %f\n", rho, theta, Z); // std::cout << "Ltheta: " << Ltheta << std::endl; - L = vpMatrix::stackMatrices(L,Ltheta) ; + L = vpMatrix::stack(L,Ltheta) ; } return L ; } @@ -433,7 +428,7 @@ vpFeaturePointPolar::error(const vpBasicFeature &s_star, vpColVector erho(1) ; erho[0] = s[0] - s_star[0] ; - e = vpMatrix::stackMatrices(e,erho) ; + e = vpColVector::stack(e,erho) ; } if (vpFeaturePointPolar::selectTheta() & select ) @@ -449,20 +444,11 @@ vpFeaturePointPolar::error(const vpBasicFeature &s_star, vpColVector etheta(1) ; etheta[0] = err ; - e = vpMatrix::stackMatrices(e,etheta) ; + e = vpColVector::stack(e,etheta) ; } } - catch(vpMatrixException me) - { - vpERROR_TRACE("caught a Matrix related error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; - } - catch(vpException me) - { - vpERROR_TRACE("caught another error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; + catch(...) { + throw ; } @@ -638,9 +624,53 @@ vpFeaturePointPolar *vpFeaturePointPolar::duplicate() const return feature ; } +/*! -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ + Function used to select the \f$\rho\f$ subset polar + coordinate of the image point visual feature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$\rho\f$ feature. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + \code + vpFeaturePointPolar p; + vpServo task; + ... + // Add only the rho subset coordinate feature from an image point to the task + task.addFeature(p, vpFeaturePointPolar::selectRho()); + \endcode + + \sa selectTheta() +*/ +unsigned int vpFeaturePointPolar::selectRho() { return FEATURE_LINE[0] ; } + + +/*! + + Function used to select the \f$\theta\f$ subset polar + coordinate of the image point visual feature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$\theta\f$ feature. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + \code + vpFeaturePointPolar p; + vpServo task; + ... + // Add only the theta subset coordinate feature from an image point to the task + task.addFeature(p, vpFeaturePointPolar::selectTheta()); + \endcode + + \sa selectRho() +*/ +unsigned int vpFeaturePointPolar::selectTheta() { return FEATURE_LINE[1] ; } diff --git a/src/visual-feature/vpFeatureSegment.cpp b/modules/visual_features/src/visual-feature/vpFeatureSegment.cpp similarity index 80% rename from src/visual-feature/vpFeatureSegment.cpp rename to modules/visual_features/src/visual-feature/vpFeatureSegment.cpp index 7ba11dd8222d9e7c6e5e038a720be67d0cb9716e..f133a15fc37bff0de1c125451c589c1daccb5494 100644 --- a/src/visual-feature/vpFeatureSegment.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureSegment.cpp @@ -1,608 +1,696 @@ -/**************************************************************************** - * - * $Id: vpFeatureThetaU.cpp 3530 2012-01-03 10:52:12Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Segment visual feature. - * - * Authors: - * Filip Novotny - * Fabien Spindler - * - *****************************************************************************/ - - -#include <visp/vpBasicFeature.h> -#include <visp/vpFeatureSegment.h> -#include <visp/vpImagePoint.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpMath.h> -#include <visp/vpDisplay.h> -#include <cmath> - -// Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> - -// Debug trace -#include <visp/vpDebug.h> - - -/*! - \file vpFeatureSegment.cpp - \brief class that defines the vpFeatureSegment visual feature -*/ - -/*! - - Initialise the memory space requested for segment visual - feature. - -*/ -void -vpFeatureSegment::init() -{ - //feature dimension - dim_s = 4 ; - nbParameters = 6; - - // memory allocation - s.resize(dim_s) ; - if (flags == NULL) - flags = new bool[nbParameters]; - for (unsigned int i = 0; i < nbParameters; i++) flags[i] = false; -} - -/*! - Default constructor that builds an empty segment visual feature. - - \param normalized : If true, use normalized features \f${\bf s} = (x_n, y_n, l_n, \alpha)\f$. - If false, use non normalized features \f${\bf s} = (x_c, y_c, l_c, \alpha)\f$. -*/ -vpFeatureSegment::vpFeatureSegment(bool normalized) - : xc_(0), yc_(0), l_(0), alpha_(0), Z1_(0), Z2_(0), cos_a_(0), sin_a_(0), normalized_(normalized) -{ - init(); -} - -/*! - Compute and return the interaction matrix \f$ L \f$ associated to a - subset of the possible features \f${\bf s} = (x_c, y_c, l, \alpha)\f$ - or \f${\bf s} = (x_n, y_n, l_n, \alpha)\f$. - - The interaction matrix of the non normalized feature set is of the following form: - \f[ - {\bf L} = \left[ - \begin{array}{c} - L_{x_c} \\ - L_{y_c} \\ - L_{l} \\ - L_{\alpha} - \end{array} - \right] = - \left[ - \begin{array}{cccccc} - -\lambda_2 & 0 & \lambda_2 x_c - \lambda_1 l \frac{\cos \alpha}{4} & - x_c y_c + l^2 \frac{\cos \alpha \sin \alpha}{4} & - -(1 + {x_{c}}^{2} + l^2 \frac{\cos^2\alpha}{4}) & - y_c \\ - 0 & -\lambda_2 & \lambda_2 y_c - \lambda_1 l \frac{\sin \alpha}{4} & - 1 + {y_{c}}^{2} + l^2 \frac{\sin^2 \alpha}{4} & - -x_c y_c-l^2 \frac{\cos \alpha \sin \alpha}{4} & - -x_c \\ - \lambda_1 \cos \alpha & \lambda_1 \sin \alpha & - \lambda_2 l - \lambda_1 (x_c \cos \alpha + y_c \sin \alpha) & - l (x_c \cos \alpha \sin \alpha + y_c (1 + \sin^2 \alpha)) & - -l (x_c (1 + \cos^2 \alpha)+y_c \cos \alpha \sin \alpha) & - 0 \\ - -\lambda_1 \frac{\sin \alpha}{l} & \lambda_1 \frac{\cos \alpha}{l} & - \lambda_1 \frac{x_c \sin \alpha - y_c \cos \alpha}{l} & - -x_c \sin^2 \alpha + y_c \cos \alpha \sin \alpha & - x_c \cos \alpha \sin \alpha - y_c \cos^2 \alpha & - -1 - \end{array} - \right] - \f] - - with \f$ \lambda_1 = \frac{Z_1 - Z_2}{Z_1 Z_2}\f$ and \f$ \lambda_2 = \frac{Z_1 + Z_2}{2 Z_1 Z_2}\f$ - where \f$Z_i\f$ are the depths of the points. - - - \param select : Selection of a subset of the possible segment features. - - To compute the interaction matrix for all the four - subset features \f$(x_c \f$, \f$ y_c \f$, \f$ l \f$, \f$ \alpha)\f$ or - \f$(x_n \f$, \f$ y_n \f$, \f$ l_n \f$, \f$ \alpha)\f$ use vpBasicFeature::FEATURE_ALL. In - that case the dimension of the interaction matrix is \f$ [4 \times 6] \f$. - - To compute the interaction matrix for only one of the subset - use one of the following functions: - selectXc(), selectYc(), selectL(), selectAlpha(). In that case, the returned - interaction matrix is of dimension \f$ [1 \times 6] \f$ . - - \return The interaction matrix computed from the segment features. - - The code below shows how to compute the interaction matrix associated to - the visual feature \f${\bf s} = (x_c, y_c, l, \alpha)\f$. - \code -#include <visp/vpFeatureSegment.h> -#include <visp/vpPoint.h> - -int main() -{ - // Define two 3D points in the object frame - vpPoint p1, p2; - p1.setWorldCoordinates(.1, .1, 0.); - p2.setWorldCoordinates(.3, .2, 0.); - - // Define the camera pose wrt the object - vpHomogeneousMatrix cMo (0, 0, 1, 0, 0, 0); // Z=1 meter - // Compute the coordinates of the points in the camera frame - p1.changeFrame(cMo); - p2.changeFrame(cMo); - // Compute the coordinates of the points in the image plane by perspective projection - p1.project(); - p2.project(); - - // Build the segment visual feature - vpFeatureSegment s; - s.buildFrom(p1.get_x(), p1.get_y(), p1.get_Z(), p2.get_x(), p2.get_y(), p2.get_Z()); - - // Compute the interaction matrix - vpMatrix L = s.interaction( vpBasicFeature::FEATURE_ALL ); -} - \endcode - - In this case, L is a 4 by 6 matrix. - - It is also possible to build the interaction matrix associated to - one of the possible features. The code below shows how to modify the previous code to consider as - visual feature \f$s = (l, \alpha)\f$. - - \code - vpMatrix L = s.interaction( vpFeatureSegment::selectL() | vpFeatureSegment::selectAlpha() ); - \endcode - - In that case, L is a 2 by 6 matrix. -*/ -vpMatrix -vpFeatureSegment::interaction( const unsigned int select ) -{ - - vpMatrix L ; - L.resize(0,6) ; - - if (deallocate == vpBasicFeature::user) - { - for (unsigned int i = 0; i < nbParameters; i++) - { - if (flags[i] == false) - { - switch(i){ - case 0: - vpTRACE("Warning !!! The interaction matrix is computed but xc was not set yet"); - break; - case 1: - vpTRACE("Warning !!! The interaction matrix is computed but Yc was not set yet"); - break; - case 2: - vpTRACE("Warning !!! The interaction matrix is computed but l was not set yet"); - break; - case 3: - vpTRACE("Warning !!! The interaction matrix is computed but alpha was not set yet"); - break; - case 4: - vpTRACE("Warning !!! The interaction matrix is computed but Z1 was not set yet"); - break; - case 5: - vpTRACE("Warning !!! The interaction matrix is computed but Z2 was not set yet"); - break; - default: - vpTRACE("Problem during the reading of the variable flags"); - } - } - } - } - - //This version is a simplification - double lambda1 = (Z1_-Z2_)/(Z1_*Z2_); // -l * lambda - double lambda2 = (Z1_+Z2_)/(2*Z1_*Z2_); // 1/Zm - - if (normalized_) - { - // here var xc_ contains xc/l, yc_ contains yc/l and l_ contains 1/l - double xn = xc_; - double yn = yc_; - double ln = l_; - double lambda = -lambda1 * ln; - double Zn_inv = lambda2 * ln; - double lc = cos_a_ / ln; - double ls = sin_a_ / ln; - double xnalpha = xn*cos_a_+yn*sin_a_; - double lnc = cos_a_ * ln; - double lns = sin_a_ * ln; - - if (vpFeatureSegment::selectXc() & select ){ - vpMatrix Lxn(1,6); - Lxn[0][0] = -Zn_inv + lambda * xn * cos_a_; - Lxn[0][1] = lambda * xn * sin_a_ ; - Lxn[0][2] = lambda1 * (xn*xnalpha - cos_a_ /4.); - Lxn[0][3] = sin_a_*cos_a_/4/ln - xn*xnalpha*sin_a_/ln; - Lxn[0][4] = -ln*(1.+lc*lc/4.) + xn*xnalpha*cos_a_/ln ; - Lxn[0][5] = yn ; - L = vpMatrix::stackMatrices(L, Lxn) ; - } - - if (vpFeatureSegment::selectYc() & select ){ - vpMatrix Lyn(1,6); - Lyn[0][0] = lambda*yn*cos_a_ ; - Lyn[0][1] = -Zn_inv + lambda*yn*sin_a_ ; - Lyn[0][2] = lambda1 * (yn*xnalpha - sin_a_/4.); - Lyn[0][3] = ln*(1+ls*ls/4.)-yn*xnalpha*sin_a_/ln ; - Lyn[0][4] = -sin_a_*cos_a_/4/ln + yn*xnalpha*cos_a_/ln; - Lyn[0][5] = -xn ; - L = vpMatrix::stackMatrices(L, Lyn) ; - } - - if (vpFeatureSegment::selectL() & select ){ - vpMatrix Lln(1,6); - Lln[0][0] = lambda * lnc ; - Lln[0][1] = lambda * lns ; - Lln[0][2] = -(Zn_inv + lambda*xnalpha); - Lln[0][3] = -yn-xnalpha*sin_a_ ; - Lln[0][4] = xn + xnalpha*cos_a_ ; - Lln[0][5] = 0 ; - L = vpMatrix::stackMatrices(L, Lln) ; - } - if (vpFeatureSegment::selectAlpha() & select ){ - // We recall that xc_ contains xc/l, yc_ contains yc/l and l_ contains 1/l - vpMatrix Lalpha(1,6); - Lalpha[0][0] = -lambda1*sin_a_*l_ ; - Lalpha[0][1] = lambda1*cos_a_*l_ ; - Lalpha[0][2] = lambda1*(xc_*sin_a_-yc_*cos_a_); - Lalpha[0][3] = (-xc_*sin_a_*sin_a_+yc_*cos_a_*sin_a_)/l_; - Lalpha[0][4] = (xc_*cos_a_*sin_a_ - yc_*cos_a_*cos_a_)/l_ ; - Lalpha[0][5] = -1 ; - L = vpMatrix::stackMatrices(L,Lalpha) ; - } - } - else - { - if (vpFeatureSegment::selectXc() & select ){ - vpMatrix Lxc(1,6); - Lxc[0][0] = -lambda2 ; - Lxc[0][1] = 0. ; - Lxc[0][2] = lambda2*xc_ - lambda1*l_*cos_a_/4.; - Lxc[0][3] = xc_*yc_ + l_*l_*cos_a_*sin_a_/4. ; - Lxc[0][4] = -(1+xc_*xc_+l_*l_*cos_a_*cos_a_/4.) ; - Lxc[0][5] = yc_ ; - L = vpMatrix::stackMatrices(L,Lxc) ; - } - - if (vpFeatureSegment::selectYc() & select ){ - vpMatrix Lyc(1,6); - Lyc[0][0] = 0. ; - Lyc[0][1] = -lambda2 ; - Lyc[0][2] = lambda2*yc_ - lambda1*l_*sin_a_/4.; - Lyc[0][3] = 1+yc_*yc_+l_*l_*sin_a_*sin_a_/4. ; - Lyc[0][4] = -xc_*yc_-l_*l_*cos_a_*sin_a_/4. ; - Lyc[0][5] = -xc_ ; - L = vpMatrix::stackMatrices(L,Lyc) ; - } - - if (vpFeatureSegment::selectL() & select ){ - vpMatrix Ll(1,6); - Ll[0][0] = lambda1*cos_a_ ; - Ll[0][1] = lambda1*sin_a_ ; - Ll[0][2] = lambda2*l_-lambda1*(xc_*cos_a_+yc_*sin_a_); - Ll[0][3] = l_*(xc_*cos_a_*sin_a_ + yc_*(1+sin_a_*sin_a_)) ; - Ll[0][4] = -l_*(xc_*(1+cos_a_*cos_a_)+yc_*cos_a_*sin_a_) ; - Ll[0][5] = 0 ; - L = vpMatrix::stackMatrices(L,Ll) ; - } - if (vpFeatureSegment::selectAlpha() & select ){ - vpMatrix Lalpha(1,6); - Lalpha[0][0] = -lambda1*sin_a_/l_ ; - Lalpha[0][1] = lambda1*cos_a_/l_ ; - Lalpha[0][2] = lambda1*(xc_*sin_a_-yc_*cos_a_)/l_; - Lalpha[0][3] = -xc_*sin_a_*sin_a_+yc_*cos_a_*sin_a_; - Lalpha[0][4] = xc_*cos_a_*sin_a_ - yc_*cos_a_*cos_a_ ; - Lalpha[0][5] = -1 ; - L = vpMatrix::stackMatrices(L,Lalpha) ; - } - } - - return L ; -} - -/*! - Computes the error between the current and the desired visual features from a subset - of the possible features \f${\bf s} = (x_c, y_c, l, \alpha)\f$ - or \f${\bf s} = (x_n, y_n, l_n, \alpha)\f$. - - For the angular component \f$\alpha\f$, we define the error as - \f$\alpha \ominus \alpha^*\f$, where \f$\ominus\f$ is modulo \f$2\pi\f$ - substraction. - - \param s_star : Desired 2D segment feature. - - \param select : The error can be computed for a selection of a - subset of the possible segment features. - - To compute the error for all the four parameters use - vpBasicFeature::FEATURE_ALL. In that case the error vector is a 4 - dimension column vector. - - To compute the error for only one subfeature of - \f${\bf s} = (x_c, y_c, l, \alpha)\f$ or \f${\bf s} = (x_n, y_n, l_n, \alpha)\f$ feature set - use one of the following functions: selectXc(), selectYc(), selectL(), selectAlpha(). - - \return The error between the current and the desired - visual feature. - -*/ -vpColVector -vpFeatureSegment::error( const vpBasicFeature &s_star, const unsigned int select ) -{ - vpColVector e(0) ; - - if (vpFeatureSegment::selectXc() & select ){ - vpColVector exc(1) ; - exc[0] = xc_-s_star[0]; - e = vpMatrix::stackMatrices(e,exc) ; - } - - if (vpFeatureSegment::selectYc() & select ){ - vpColVector eyc(1) ; - eyc[0] = yc_ - s_star[1]; - e = vpMatrix::stackMatrices(e,eyc) ; - } - - if (vpFeatureSegment::selectL() & select ){ - vpColVector eL(1) ; - eL[0] = l_ - s_star[2]; - e = vpMatrix::stackMatrices(e,eL) ; - } - - if (vpFeatureSegment::selectAlpha() & select ){ - vpColVector eAlpha(1) ; - eAlpha[0] = alpha_ - s_star[3]; - while (eAlpha[0] < -M_PI) eAlpha[0] += 2*M_PI ; - while (eAlpha[0] > M_PI) eAlpha[0] -= 2*M_PI ; - e = vpMatrix::stackMatrices(e,eAlpha) ; - } - return e ; -} - -/*! - Print to stdout the values of the current visual feature \f$ s \f$. - - \param select : Selection of a subset of the possible segement features (\f$ x_c \f$,\f$ y_c \f$,\f$ l \f$,\f$ \alpha \f$). - - \code - s.print(); - \endcode - - produces the following output: - - \code - vpFeatureSegment: (xc = -0.255634; yc = -0.13311; l = 0.105005; alpha = 92.1305 deg) - \endcode - - while - \code - s.print( vpFeatureSegment::selectL() | vpFeatureSegment::selectAlpha() ); - \endcode - - produces the following output: - - \code - vpFeatureSegment: (l = 0.105005; alpha = 92.1305 deg) - \endcode -*/ -void -vpFeatureSegment::print( const unsigned int select ) const -{ - std::cout <<"vpFeatureSegment: ("; - if (vpFeatureSegment::selectXc() & select ) { - if (normalized_) - std::cout << "xn = "; - else - std::cout << "xc = "; - std::cout << s[0] << "; "; - } - if (vpFeatureSegment::selectYc() & select ) { - if (normalized_) - std::cout << "yn = "; - else - std::cout << "yc = "; - std::cout << s[1] << "; "; - } - if (vpFeatureSegment::selectL() & select ) { - if (normalized_) - std::cout << "ln = "; - else - std::cout << "l = "; - std::cout << s[2] << "; "; - } - if (vpFeatureSegment::selectAlpha() & select ) { - std::cout << "alpha = " << vpMath::deg(s[3]) << " deg"; - } - std::cout << ")" << std::endl; -} - -/*! - Create an object with the same type. - - \code - vpBasicFeature *s_star; - vpFeatureSegment s; - s_star = s.duplicate(); // s_star is now a vpFeatureSegment - \endcode - -*/ -vpFeatureSegment *vpFeatureSegment::duplicate() const -{ - vpFeatureSegment *feature; - - feature = new vpFeatureSegment(*this) ; - return feature ; -} - -/*! - - Displays a segment representing the feature on a greyscale image. - The two limiting points are displayed in cyan and yellow. - - \param cam : Camera parameters. - \param I : Image. - \param color : Color to use for the segment. - \param thickness : Thickness of the feature representation. - -*/ -void -vpFeatureSegment::display(const vpCameraParameters &cam , - const vpImage<unsigned char> & I, - const vpColor &color, - unsigned int thickness ) const -{ - double l, x, y; - if (normalized_) { - l = 1./l_; - x = xc_ * l; - y = yc_ * l; - } - else { - l = l_; - x = xc_; - y = yc_; - } - - double x1 = x - (l/2.)*cos_a_; - double x2 = x + (l/2.)*cos_a_; - - double y1 = y - (l/2.)*sin_a_; - double y2 = y + (l/2.)*sin_a_; - vpImagePoint ip1,ip2; - - vpMeterPixelConversion::convertPoint(cam, x1, y1, ip1); - vpMeterPixelConversion::convertPoint(cam, x2, y2, ip2); - vpDisplay::displayLine(I, ip1, ip2, color, thickness); - vpDisplay::displayCircle(I, ip1, 5, color, true); - vpDisplay::displayCircle(I, ip2, 5, vpColor::yellow, true); -} - -/*! - - Displays a segment representing the feature on a RGBa image. - The two limiting points are displayed in cyan and yellow. - - \param cam : Camera parameters. - \param I : Image. - \param color : Color to use for the segment. - \param thickness : Thickness of the feature representation. -*/ -void -vpFeatureSegment::display(const vpCameraParameters & cam , - const vpImage<vpRGBa> & I, - const vpColor &color, - unsigned int thickness ) const -{ - double l, x, y; - if (normalized_) { - l = 1./l_; - x = xc_ * l; - y = yc_ * l; - } - else { - l = l_; - x = xc_; - y = yc_; - } - - double x1 = x - (l/2.)*cos_a_; - double x2 = x + (l/2.)*cos_a_; - - double y1 = y - (l/2.)*sin_a_; - double y2 = y + (l/2.)*sin_a_; - vpImagePoint ip1,ip2; - - vpMeterPixelConversion::convertPoint(cam, x1, y1, ip1); - vpMeterPixelConversion::convertPoint(cam, x2, y2, ip2); - vpDisplay::displayLine(I, ip1, ip2, color, thickness); - vpDisplay::displayCircle(I, ip1, 5,vpColor::cyan, true); - vpDisplay::displayCircle(I, ip2, 5,vpColor::yellow, true); -} - -/*! - - Build a segment visual feature from two points and their Z coordinates. - - \param x1, y1 : coordinates of the first point in the image plane. - \param Z1 : depth of the first point in the camera frame. - - \param x2, y2 : coordinates of the second point in the image plane. - \param Z2 : depth of the second point in the camera frame. - - Depending on the feature set that is considered, the features \f${\bf s} = (x_c, y_c, l, \alpha)\f$ - or \f${\bf s} = (x_n, y_n, l_n, \alpha)\f$ are computed from the two points using the - following formulae: - \f[ x_c = \frac{x_1 + x_2}{2} \f] - \f[ y_c = \frac{y_1 + y_2}{2} \f] - \f[ l = \sqrt{{x_1 - x_2}^2 + {y_1 - y_2}^2} \f] - \f[ \alpha = arctan(\frac{y_1 - y_2}{x_1 - x_2}) \f] -*/ -void vpFeatureSegment::buildFrom(const double x1, const double y1, const double Z1, - const double x2, const double y2, const double Z2) -{ - double l = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); - double x_c = (x1+x2)/2.; - double y_c = (y1+y2)/2.; - double alpha = atan2(y1-y2,x1-x2); - - if (normalized_) { - setXc( x_c / l ); - setYc( y_c / l ); - setL( 1/l ); - setAlpha( alpha ); - - setZ1(Z1); - setZ2(Z2); - } - else { - setXc( x_c ); - setYc( y_c ); - setL( l ); - setAlpha( alpha ); - - setZ1(Z1); - setZ2(Z2); - } -} - - +/**************************************************************************** + * + * This file is part of the ViSP software. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * ("GPL") version 2 as published by the Free Software Foundation. + * See the file LICENSE.txt at the root directory of this source + * distribution for additional information about the GNU GPL. + * + * For using ViSP with software that can not be combined with the GNU + * GPL, please contact Inria about acquiring a ViSP Professional + * Edition License. + * + * See http://visp.inria.fr for more information. + * + * This software was developed at: + * Inria Rennes - Bretagne Atlantique + * Campus Universitaire de Beaulieu + * 35042 Rennes Cedex + * France + * + * If you have questions regarding the use of this file, please contact + * Inria at visp@inria.fr + * + * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE + * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Description: + * Segment visual feature. + * + * Authors: + * Filip Novotny + * Fabien Spindler + * + *****************************************************************************/ + + +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/visual_features/vpFeatureSegment.h> +#include <visp3/core/vpImagePoint.h> +#include <visp3/core/vpMeterPixelConversion.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpDisplay.h> +#include <cmath> + +// Exception +#include <visp3/core/vpException.h> + +// Debug trace +#include <visp3/core/vpDebug.h> + + +/*! + \file vpFeatureSegment.cpp + \brief class that defines the vpFeatureSegment visual feature +*/ + +/*! + + Initialise the memory space requested for segment visual + feature. + +*/ +void +vpFeatureSegment::init() +{ + //feature dimension + dim_s = 4 ; + nbParameters = 6; + + // memory allocation + s.resize(dim_s) ; + if (flags == NULL) + flags = new bool[nbParameters]; + for (unsigned int i = 0; i < nbParameters; i++) flags[i] = false; +} + +/*! + Default constructor that builds an empty segment visual feature. + + \param normalized : If true, use normalized features \f${\bf s} = (x_n, y_n, l_n, \alpha)\f$. + If false, use non normalized features \f${\bf s} = (x_c, y_c, l_c, \alpha)\f$. +*/ +vpFeatureSegment::vpFeatureSegment(bool normalized) + : xc_(0), yc_(0), l_(0), alpha_(0), Z1_(0), Z2_(0), cos_a_(0), sin_a_(0), normalized_(normalized) +{ + init(); +} + +/*! + Compute and return the interaction matrix \f$ L \f$ associated to a + subset of the possible features \f${\bf s} = (x_c, y_c, l, \alpha)\f$ + or \f${\bf s} = (x_n, y_n, l_n, \alpha)\f$. + + The interaction matrix of the non normalized feature set is of the following form: + \f[ + {\bf L} = \left[ + \begin{array}{c} + L_{x_c} \\ + L_{y_c} \\ + L_{l} \\ + L_{\alpha} + \end{array} + \right] = + \left[ + \begin{array}{cccccc} + -\lambda_2 & 0 & \lambda_2 x_c - \lambda_1 l \frac{\cos \alpha}{4} & + x_c y_c + l^2 \frac{\cos \alpha \sin \alpha}{4} & + -(1 + {x_{c}}^{2} + l^2 \frac{\cos^2\alpha}{4}) & + y_c \\ + 0 & -\lambda_2 & \lambda_2 y_c - \lambda_1 l \frac{\sin \alpha}{4} & + 1 + {y_{c}}^{2} + l^2 \frac{\sin^2 \alpha}{4} & + -x_c y_c-l^2 \frac{\cos \alpha \sin \alpha}{4} & + -x_c \\ + \lambda_1 \cos \alpha & \lambda_1 \sin \alpha & + \lambda_2 l - \lambda_1 (x_c \cos \alpha + y_c \sin \alpha) & + l (x_c \cos \alpha \sin \alpha + y_c (1 + \sin^2 \alpha)) & + -l (x_c (1 + \cos^2 \alpha)+y_c \cos \alpha \sin \alpha) & + 0 \\ + -\lambda_1 \frac{\sin \alpha}{l} & \lambda_1 \frac{\cos \alpha}{l} & + \lambda_1 \frac{x_c \sin \alpha - y_c \cos \alpha}{l} & + -x_c \sin^2 \alpha + y_c \cos \alpha \sin \alpha & + x_c \cos \alpha \sin \alpha - y_c \cos^2 \alpha & + -1 + \end{array} + \right] + \f] + + with \f$ \lambda_1 = \frac{Z_1 - Z_2}{Z_1 Z_2}\f$ and \f$ \lambda_2 = \frac{Z_1 + Z_2}{2 Z_1 Z_2}\f$ + where \f$Z_i\f$ are the depths of the points. + + + \param select : Selection of a subset of the possible segment features. + - To compute the interaction matrix for all the four + subset features \f$(x_c \f$, \f$ y_c \f$, \f$ l \f$, \f$ \alpha)\f$ or + \f$(x_n \f$, \f$ y_n \f$, \f$ l_n \f$, \f$ \alpha)\f$ use vpBasicFeature::FEATURE_ALL. In + that case the dimension of the interaction matrix is \f$ [4 \times 6] \f$. + - To compute the interaction matrix for only one of the subset + use one of the following functions: + selectXc(), selectYc(), selectL(), selectAlpha(). In that case, the returned + interaction matrix is of dimension \f$ [1 \times 6] \f$ . + + \return The interaction matrix computed from the segment features. + + The code below shows how to compute the interaction matrix associated to + the visual feature \f${\bf s} = (x_c, y_c, l, \alpha)\f$. + \code +#include <visp3/visual_features/vpFeatureSegment.h> +#include <visp3/core/vpPoint.h> + +int main() +{ + // Define two 3D points in the object frame + vpPoint p1(.1, .1, 0.), p2(.3, .2, 0.); + + // Define the camera pose wrt the object + vpHomogeneousMatrix cMo (0, 0, 1, 0, 0, 0); // Z=1 meter + // Compute the coordinates of the points in the camera frame + p1.changeFrame(cMo); + p2.changeFrame(cMo); + // Compute the coordinates of the points in the image plane by perspective projection + p1.project(); + p2.project(); + + // Build the segment visual feature + vpFeatureSegment s; + s.buildFrom(p1.get_x(), p1.get_y(), p1.get_Z(), p2.get_x(), p2.get_y(), p2.get_Z()); + + // Compute the interaction matrix + vpMatrix L = s.interaction( vpBasicFeature::FEATURE_ALL ); +} + \endcode + + In this case, L is a 4 by 6 matrix. + + It is also possible to build the interaction matrix associated to + one of the possible features. The code below shows how to modify the previous code to consider as + visual feature \f$s = (l, \alpha)\f$. + + \code + vpMatrix L = s.interaction( vpFeatureSegment::selectL() | vpFeatureSegment::selectAlpha() ); + \endcode + + In that case, L is a 2 by 6 matrix. +*/ +vpMatrix +vpFeatureSegment::interaction( const unsigned int select ) +{ + + vpMatrix L ; + L.resize(0,6) ; + + if (deallocate == vpBasicFeature::user) + { + for (unsigned int i = 0; i < nbParameters; i++) + { + if (flags[i] == false) + { + switch(i){ + case 0: + vpTRACE("Warning !!! The interaction matrix is computed but xc was not set yet"); + break; + case 1: + vpTRACE("Warning !!! The interaction matrix is computed but Yc was not set yet"); + break; + case 2: + vpTRACE("Warning !!! The interaction matrix is computed but l was not set yet"); + break; + case 3: + vpTRACE("Warning !!! The interaction matrix is computed but alpha was not set yet"); + break; + case 4: + vpTRACE("Warning !!! The interaction matrix is computed but Z1 was not set yet"); + break; + case 5: + vpTRACE("Warning !!! The interaction matrix is computed but Z2 was not set yet"); + break; + default: + vpTRACE("Problem during the reading of the variable flags"); + } + } + } + } + + //This version is a simplification + double lambda1 = (Z1_-Z2_)/(Z1_*Z2_); // -l * lambda + double lambda2 = (Z1_+Z2_)/(2*Z1_*Z2_); // 1/Zm + + if (normalized_) + { + // here var xc_ contains xc/l, yc_ contains yc/l and l_ contains 1/l + double xn = xc_; + double yn = yc_; + double ln = l_; + double lambda = -lambda1 * ln; + double Zn_inv = lambda2 * ln; + double lc = cos_a_ / ln; + double ls = sin_a_ / ln; + double xnalpha = xn*cos_a_+yn*sin_a_; + double lnc = cos_a_ * ln; + double lns = sin_a_ * ln; + + if (vpFeatureSegment::selectXc() & select ){ + vpMatrix Lxn(1,6); + Lxn[0][0] = -Zn_inv + lambda * xn * cos_a_; + Lxn[0][1] = lambda * xn * sin_a_ ; + Lxn[0][2] = lambda1 * (xn*xnalpha - cos_a_ /4.); + Lxn[0][3] = sin_a_*cos_a_/4/ln - xn*xnalpha*sin_a_/ln; + Lxn[0][4] = -ln*(1.+lc*lc/4.) + xn*xnalpha*cos_a_/ln ; + Lxn[0][5] = yn ; + L = vpMatrix::stack(L, Lxn) ; + } + + if (vpFeatureSegment::selectYc() & select ){ + vpMatrix Lyn(1,6); + Lyn[0][0] = lambda*yn*cos_a_ ; + Lyn[0][1] = -Zn_inv + lambda*yn*sin_a_ ; + Lyn[0][2] = lambda1 * (yn*xnalpha - sin_a_/4.); + Lyn[0][3] = ln*(1+ls*ls/4.)-yn*xnalpha*sin_a_/ln ; + Lyn[0][4] = -sin_a_*cos_a_/4/ln + yn*xnalpha*cos_a_/ln; + Lyn[0][5] = -xn ; + L = vpMatrix::stack(L, Lyn) ; + } + + if (vpFeatureSegment::selectL() & select ){ + vpMatrix Lln(1,6); + Lln[0][0] = lambda * lnc ; + Lln[0][1] = lambda * lns ; + Lln[0][2] = -(Zn_inv + lambda*xnalpha); + Lln[0][3] = -yn-xnalpha*sin_a_ ; + Lln[0][4] = xn + xnalpha*cos_a_ ; + Lln[0][5] = 0 ; + L = vpMatrix::stack(L, Lln) ; + } + if (vpFeatureSegment::selectAlpha() & select ){ + // We recall that xc_ contains xc/l, yc_ contains yc/l and l_ contains 1/l + vpMatrix Lalpha(1,6); + Lalpha[0][0] = -lambda1*sin_a_*l_ ; + Lalpha[0][1] = lambda1*cos_a_*l_ ; + Lalpha[0][2] = lambda1*(xc_*sin_a_-yc_*cos_a_); + Lalpha[0][3] = (-xc_*sin_a_*sin_a_+yc_*cos_a_*sin_a_)/l_; + Lalpha[0][4] = (xc_*cos_a_*sin_a_ - yc_*cos_a_*cos_a_)/l_ ; + Lalpha[0][5] = -1 ; + L = vpMatrix::stack(L,Lalpha) ; + } + } + else + { + if (vpFeatureSegment::selectXc() & select ){ + vpMatrix Lxc(1,6); + Lxc[0][0] = -lambda2 ; + Lxc[0][1] = 0. ; + Lxc[0][2] = lambda2*xc_ - lambda1*l_*cos_a_/4.; + Lxc[0][3] = xc_*yc_ + l_*l_*cos_a_*sin_a_/4. ; + Lxc[0][4] = -(1+xc_*xc_+l_*l_*cos_a_*cos_a_/4.) ; + Lxc[0][5] = yc_ ; + L = vpMatrix::stack(L,Lxc) ; + } + + if (vpFeatureSegment::selectYc() & select ){ + vpMatrix Lyc(1,6); + Lyc[0][0] = 0. ; + Lyc[0][1] = -lambda2 ; + Lyc[0][2] = lambda2*yc_ - lambda1*l_*sin_a_/4.; + Lyc[0][3] = 1+yc_*yc_+l_*l_*sin_a_*sin_a_/4. ; + Lyc[0][4] = -xc_*yc_-l_*l_*cos_a_*sin_a_/4. ; + Lyc[0][5] = -xc_ ; + L = vpMatrix::stack(L,Lyc) ; + } + + if (vpFeatureSegment::selectL() & select ){ + vpMatrix Ll(1,6); + Ll[0][0] = lambda1*cos_a_ ; + Ll[0][1] = lambda1*sin_a_ ; + Ll[0][2] = lambda2*l_-lambda1*(xc_*cos_a_+yc_*sin_a_); + Ll[0][3] = l_*(xc_*cos_a_*sin_a_ + yc_*(1+sin_a_*sin_a_)) ; + Ll[0][4] = -l_*(xc_*(1+cos_a_*cos_a_)+yc_*cos_a_*sin_a_) ; + Ll[0][5] = 0 ; + L = vpMatrix::stack(L,Ll) ; + } + if (vpFeatureSegment::selectAlpha() & select ){ + vpMatrix Lalpha(1,6); + Lalpha[0][0] = -lambda1*sin_a_/l_ ; + Lalpha[0][1] = lambda1*cos_a_/l_ ; + Lalpha[0][2] = lambda1*(xc_*sin_a_-yc_*cos_a_)/l_; + Lalpha[0][3] = -xc_*sin_a_*sin_a_+yc_*cos_a_*sin_a_; + Lalpha[0][4] = xc_*cos_a_*sin_a_ - yc_*cos_a_*cos_a_ ; + Lalpha[0][5] = -1 ; + L = vpMatrix::stack(L,Lalpha) ; + } + } + + return L ; +} + +/*! + Computes the error between the current and the desired visual features from a subset + of the possible features \f${\bf s} = (x_c, y_c, l, \alpha)\f$ + or \f${\bf s} = (x_n, y_n, l_n, \alpha)\f$. + + For the angular component \f$\alpha\f$, we define the error as + \f$\alpha \ominus \alpha^*\f$, where \f$\ominus\f$ is modulo \f$2\pi\f$ + substraction. + + \param s_star : Desired 2D segment feature. + + \param select : The error can be computed for a selection of a + subset of the possible segment features. + - To compute the error for all the four parameters use + vpBasicFeature::FEATURE_ALL. In that case the error vector is a 4 + dimension column vector. + - To compute the error for only one subfeature of + \f${\bf s} = (x_c, y_c, l, \alpha)\f$ or \f${\bf s} = (x_n, y_n, l_n, \alpha)\f$ feature set + use one of the following functions: selectXc(), selectYc(), selectL(), selectAlpha(). + + \return The error between the current and the desired + visual feature. + +*/ +vpColVector +vpFeatureSegment::error( const vpBasicFeature &s_star, const unsigned int select ) +{ + vpColVector e(0) ; + + if (vpFeatureSegment::selectXc() & select ){ + vpColVector exc(1) ; + exc[0] = xc_-s_star[0]; + e = vpColVector::stack(e,exc) ; + } + + if (vpFeatureSegment::selectYc() & select ){ + vpColVector eyc(1) ; + eyc[0] = yc_ - s_star[1]; + e = vpColVector::stack(e,eyc) ; + } + + if (vpFeatureSegment::selectL() & select ){ + vpColVector eL(1) ; + eL[0] = l_ - s_star[2]; + e = vpColVector::stack(e,eL) ; + } + + if (vpFeatureSegment::selectAlpha() & select ){ + vpColVector eAlpha(1) ; + eAlpha[0] = alpha_ - s_star[3]; + while (eAlpha[0] < -M_PI) eAlpha[0] += 2*M_PI ; + while (eAlpha[0] > M_PI) eAlpha[0] -= 2*M_PI ; + e = vpColVector::stack(e,eAlpha) ; + } + return e ; +} + +/*! + Print to stdout the values of the current visual feature \f$ s \f$. + + \param select : Selection of a subset of the possible segement features (\f$ x_c \f$,\f$ y_c \f$,\f$ l \f$,\f$ \alpha \f$). + + \code + s.print(); + \endcode + + produces the following output: + + \code + vpFeatureSegment: (xc = -0.255634; yc = -0.13311; l = 0.105005; alpha = 92.1305 deg) + \endcode + + while + \code + s.print( vpFeatureSegment::selectL() | vpFeatureSegment::selectAlpha() ); + \endcode + + produces the following output: + + \code + vpFeatureSegment: (l = 0.105005; alpha = 92.1305 deg) + \endcode +*/ +void +vpFeatureSegment::print( const unsigned int select ) const +{ + std::cout <<"vpFeatureSegment: ("; + if (vpFeatureSegment::selectXc() & select ) { + if (normalized_) + std::cout << "xn = "; + else + std::cout << "xc = "; + std::cout << s[0] << "; "; + } + if (vpFeatureSegment::selectYc() & select ) { + if (normalized_) + std::cout << "yn = "; + else + std::cout << "yc = "; + std::cout << s[1] << "; "; + } + if (vpFeatureSegment::selectL() & select ) { + if (normalized_) + std::cout << "ln = "; + else + std::cout << "l = "; + std::cout << s[2] << "; "; + } + if (vpFeatureSegment::selectAlpha() & select ) { + std::cout << "alpha = " << vpMath::deg(s[3]) << " deg"; + } + std::cout << ")" << std::endl; +} + +/*! + Create an object with the same type. + + \code + vpBasicFeature *s_star; + vpFeatureSegment s; + s_star = s.duplicate(); // s_star is now a vpFeatureSegment + \endcode + +*/ +vpFeatureSegment *vpFeatureSegment::duplicate() const +{ + vpFeatureSegment *feature; + + feature = new vpFeatureSegment(*this) ; + return feature ; +} + +/*! + + Displays a segment representing the feature on a greyscale image. + The two limiting points are displayed in cyan and yellow. + + \param cam : Camera parameters. + \param I : Image. + \param color : Color to use for the segment. + \param thickness : Thickness of the feature representation. + +*/ +void +vpFeatureSegment::display(const vpCameraParameters &cam , + const vpImage<unsigned char> & I, + const vpColor &color, + unsigned int thickness ) const +{ + double l, x, y; + if (normalized_) { + l = 1./l_; + x = xc_ * l; + y = yc_ * l; + } + else { + l = l_; + x = xc_; + y = yc_; + } + + double x1 = x - (l/2.)*cos_a_; + double x2 = x + (l/2.)*cos_a_; + + double y1 = y - (l/2.)*sin_a_; + double y2 = y + (l/2.)*sin_a_; + vpImagePoint ip1,ip2; + + vpMeterPixelConversion::convertPoint(cam, x1, y1, ip1); + vpMeterPixelConversion::convertPoint(cam, x2, y2, ip2); + vpDisplay::displayLine(I, ip1, ip2, color, thickness); + vpDisplay::displayCircle(I, ip1, 5, color, true); + vpDisplay::displayCircle(I, ip2, 5, vpColor::yellow, true); +} + +/*! + + Displays a segment representing the feature on a RGBa image. + The two limiting points are displayed in cyan and yellow. + + \param cam : Camera parameters. + \param I : Image. + \param color : Color to use for the segment. + \param thickness : Thickness of the feature representation. +*/ +void +vpFeatureSegment::display(const vpCameraParameters & cam , + const vpImage<vpRGBa> & I, + const vpColor &color, + unsigned int thickness ) const +{ + double l, x, y; + if (normalized_) { + l = 1./l_; + x = xc_ * l; + y = yc_ * l; + } + else { + l = l_; + x = xc_; + y = yc_; + } + + double x1 = x - (l/2.)*cos_a_; + double x2 = x + (l/2.)*cos_a_; + + double y1 = y - (l/2.)*sin_a_; + double y2 = y + (l/2.)*sin_a_; + vpImagePoint ip1,ip2; + + vpMeterPixelConversion::convertPoint(cam, x1, y1, ip1); + vpMeterPixelConversion::convertPoint(cam, x2, y2, ip2); + vpDisplay::displayLine(I, ip1, ip2, color, thickness); + vpDisplay::displayCircle(I, ip1, 5,vpColor::cyan, true); + vpDisplay::displayCircle(I, ip2, 5,vpColor::yellow, true); +} + +/*! + + Build a segment visual feature from two points and their Z coordinates. + + \param x1, y1 : coordinates of the first point in the image plane. + \param Z1 : depth of the first point in the camera frame. + + \param x2, y2 : coordinates of the second point in the image plane. + \param Z2 : depth of the second point in the camera frame. + + Depending on the feature set that is considered, the features \f${\bf s} = (x_c, y_c, l, \alpha)\f$ + or \f${\bf s} = (x_n, y_n, l_n, \alpha)\f$ are computed from the two points using the + following formulae: + \f[ x_c = \frac{x_1 + x_2}{2} \f] + \f[ y_c = \frac{y_1 + y_2}{2} \f] + \f[ l = \sqrt{{x_1 - x_2}^2 + {y_1 - y_2}^2} \f] + \f[ \alpha = arctan(\frac{y_1 - y_2}{x_1 - x_2}) \f] +*/ +void vpFeatureSegment::buildFrom(const double x1, const double y1, const double Z1, + const double x2, const double y2, const double Z2) +{ + double l = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); + double x_c = (x1+x2)/2.; + double y_c = (y1+y2)/2.; + double alpha = atan2(y1-y2,x1-x2); + + if (normalized_) { + setXc( x_c / l ); + setYc( y_c / l ); + setL( 1/l ); + setAlpha( alpha ); + + setZ1(Z1); + setZ2(Z2); + } + else { + setXc( x_c ); + setYc( y_c ); + setL( l ); + setAlpha( alpha ); + + setZ1(Z1); + setZ2(Z2); + } +} + +/*! + + Function used to select the \f$x_c\f$ or \f$x_n\f$ subfeature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$x_c\f$ or \f$x_n\f$ feature. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + \code +vpFeatureSegment s, s_star; // Current and desired visual feature +vpServo task; +... +// Add only the xc subset feature from a segment to the task +task.addFeature(s, s_star, vpFeatureSegment::selectXc()); + \endcode + + \sa selectYc(), selectL(), selectAlpha() +*/ +unsigned int vpFeatureSegment::selectXc() { return FEATURE_LINE[0] ; } + +/*! + + Function used to select the \f$y_c\f$ or \f$y_n\f$ subfeature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$y_c\f$ or \f$y_n\f$ feature. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + \code +vpFeatureSegment s, s_star; // Current and desired visual feature +vpServo task; +... +// Add only the yc subset feature from a segment to the task +task.addFeature(s, s_star, vpFeatureSegment::selectYc()); + \endcode + + \sa selectXc(), selectL(), selectAlpha() +*/ +unsigned int vpFeatureSegment::selectYc() { return FEATURE_LINE[1] ; } + +/*! + + Function used to select the \f$l\f$ or \f$l_n\f$ subfeature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$l\f$ or \f$l_n\f$ feature. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + \code +vpFeatureSegment s, s_star; // Current and desired visual feature +vpServo task; +... +// Add only the l subset feature from a segment to the task +task.addFeature(s, s_star, vpFeatureSegment::selectL()); + \endcode + + \sa selectXc(), selectYc(), selectAlpha() +*/ +unsigned int vpFeatureSegment::selectL() { return FEATURE_LINE[2] ; } + +/*! + + Function used to select the \f$\alpha\f$ subfeature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$\alpha\f$ feature. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + \code +vpFeatureSegment s, s_star; // Current and desired visual feature +vpServo task; +... +// Add only the alpha subset feature from a segment to the task +task.addFeature(s, s_star, vpFeatureSegment::selectAlpha()); + \endcode + + \sa selectXc(), selectYc(), selectL() +*/ + +unsigned int vpFeatureSegment::selectAlpha() { return FEATURE_LINE[3] ; } diff --git a/src/visual-feature/vpFeatureThetaU.cpp b/modules/visual_features/src/visual-feature/vpFeatureThetaU.cpp similarity index 81% rename from src/visual-feature/vpFeatureThetaU.cpp rename to modules/visual_features/src/visual-feature/vpFeatureThetaU.cpp index cfee61e418b6779bdc8c7ccfb0909e084c58bb9b..de6fea14adece88544701e53f489a61c53fc4123 100644 --- a/src/visual-feature/vpFeatureThetaU.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureThetaU.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureThetaU.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * ThetaU visual feature. * @@ -41,17 +37,16 @@ *****************************************************************************/ -#include <visp/vpBasicFeature.h> -#include <visp/vpFeatureThetaU.h> -#include <visp/vpMath.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/core/vpMath.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpFeatureException.h> +#include <visp3/core/vpException.h> +#include <visp3/visual_features/vpFeatureException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> /*! @@ -84,8 +79,22 @@ vpFeatureThetaU::init() for (unsigned int i = 0; i < nbParameters; i++) flags[i] = false; } +/*! + Constructor that builds a visual feature and initialize it to zero. + The rotation representation of the \f$ \theta u\f$ visual feature + will be vpFeatureThetaU::cdRc by default. Use the function + setFeatureThetaURotationType() to set the desired type of feature. + +*/ +vpFeatureThetaU::vpFeatureThetaU() + : rotation(vpFeatureThetaU::cdRc) +{ + //vpTRACE("0x%x", this); + init() ; +} + /*! - Default constructor that build a visual feature and initialize it to zero. + Constructor that builds a visual feature and initialize it to zero. \param r [in] : The rotation representation of the \f$ \theta u\f$ visual feature. @@ -260,6 +269,19 @@ vpFeatureThetaU::buildFrom(const vpHomogeneousMatrix &M) buildFrom(tu) ; } +/*! + + Set the type of rotation feature. + + \param r : type of feature. It can be vpFeatureThetaU::cdRc or vpFeatureThetaU::cRcd. + \sa getFeatureThetaURotationType() + +*/ +void vpFeatureThetaU::setFeatureThetaURotationType(const vpFeatureThetaURotationRepresentationType r) +{ + rotation = r; +} + /*! Initialise the \f$\theta u_x \f$ subset value of the 3D @@ -301,6 +323,19 @@ vpFeatureThetaU::set_TUz(const double tu_z) flags[2] = true; } +/*! + + Get the type of rotation feature. + + \return Type of rotation feature. It can be vpFeatureThetaU::cdRc or vpFeatureThetaU::cRcd. + \sa setFeatureThetaURotationType() + +*/ +vpFeatureThetaU::vpFeatureThetaURotationRepresentationType vpFeatureThetaU::getFeatureThetaURotationType() const +{ + return rotation; +} + /*! Return the \f$\theta u_x \f$ subset value of the visual feature @@ -439,7 +474,7 @@ vpFeatureThetaU::interaction(const unsigned int select) Lw = vpColVector::skew(u) ; /* [theta/2 u]_x */ vpMatrix U2(3,3) ; - U2.setIdentity() ; + U2.eye() ; double theta = sqrt(s.sumSquare()) ; if (theta >= 1e-6) { @@ -467,7 +502,7 @@ vpFeatureThetaU::interaction(const unsigned int select) for (int i=0 ; i < 3 ; i++) Lx[0][i+3] = Lw[0][i] ; - L = vpMatrix::stackMatrices(L,Lx) ; + L = vpMatrix::stack(L,Lx) ; } if (vpFeatureThetaU::selectTUy() & select ) @@ -477,7 +512,7 @@ vpFeatureThetaU::interaction(const unsigned int select) Ly[0][0] = 0 ; Ly[0][1] = 0 ; Ly[0][2] = 0 ; for (int i=0 ; i < 3 ; i++) Ly[0][i+3] = Lw[1][i] ; - L = vpMatrix::stackMatrices(L,Ly) ; + L = vpMatrix::stack(L,Ly) ; } if (vpFeatureThetaU::selectTUz() & select ) @@ -487,7 +522,7 @@ vpFeatureThetaU::interaction(const unsigned int select) Lz[0][0] = 0 ; Lz[0][1] = 0 ; Lz[0][2] = 0 ; for (int i=0 ; i < 3 ; i++) Lz[0][i+3] = Lw[2][i] ; - L = vpMatrix::stackMatrices(L,Lz) ; + L = vpMatrix::stack(L,Lz) ; } return L ; @@ -572,21 +607,21 @@ vpFeatureThetaU::error(const vpBasicFeature &s_star, { vpColVector ex(1) ; ex[0] = s[0] ; - e = vpMatrix::stackMatrices(e,ex) ; + e = vpColVector::stack(e,ex) ; } if (vpFeatureThetaU::selectTUy() & select ) { vpColVector ey(1) ; ey[0] = s[1] ; - e = vpMatrix::stackMatrices(e,ey) ; + e = vpColVector::stack(e,ey) ; } if (vpFeatureThetaU::selectTUz() & select ) { vpColVector ez(1) ; ez[0] = s[2] ; - e = vpMatrix::stackMatrices(e,ez) ; + e = vpColVector::stack(e,ez) ; } return e ; } @@ -698,8 +733,78 @@ vpFeatureThetaU::display(const vpCameraParameters &/* cam */, } } -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +/*! + + Function used to select the \f$ \theta u_x\f$ subset of the \f$ + \theta u \f$ visual feature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$ \theta u_x\f$. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + \code + vpFeatureThetaU tu; + vpServo task; + ... + // Add the (ThetaU_x, ThetaU_y) subset features from the 3D ThetaU + // rotation to the task + task.addFeature(tu, vpFeatureThetaU::selectTUx() | vpFeatureThetaU::selectTUy()); + \endcode + + \sa selectTUy(), selectTUz() +*/ +unsigned int vpFeatureThetaU::selectTUx() { return FEATURE_LINE[0] ; } +/*! + + Function used to select the \f$ \theta u_y\f$ subset of the \f$ + \theta u \f$ visual feature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$ \theta u_y\f$. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + \code + vpFeatureThetaU tu; + vpServo task; + ... + // Add the (ThetaU_x, ThetaU_y) subset features from the 3D ThetaU + // rotation to the task + task.addFeature(tu, vpFeatureThetaU::selectTUx() | vpFeatureThetaU::selectTUy()); + \endcode + + \sa selectTUx(), selectTUz() +*/ +unsigned int vpFeatureThetaU::selectTUy() { return FEATURE_LINE[1] ; } +/*! + + Function used to select the \f$ \theta u_z\f$ subset of the \f$ + \theta u \f$ visual feature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$ \theta u_z\f$. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + \code + vpFeatureThetaU tu; + vpServo task; + ... + // Add the (ThetaU_z) subset feature from the 3D ThetaU + // rotation to the task + task.addFeature(tu, vpFeatureThetaU::selectTUz()); + \endcode + + \sa selectTUx(), selectTUy() +*/ +unsigned int vpFeatureThetaU::selectTUz() { return FEATURE_LINE[2] ; } diff --git a/src/visual-feature/vpFeatureTranslation.cpp b/modules/visual_features/src/visual-feature/vpFeatureTranslation.cpp similarity index 70% rename from src/visual-feature/vpFeatureTranslation.cpp rename to modules/visual_features/src/visual-feature/vpFeatureTranslation.cpp index 7b7031b284fd309194ace4cacfea177878a5574d..7af9c8f51cd35e026c799764ef4d5c5c7a642688 100644 --- a/src/visual-feature/vpFeatureTranslation.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureTranslation.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureTranslation.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 3D translation visual feature. * @@ -41,18 +37,17 @@ *****************************************************************************/ -#include <visp/vpBasicFeature.h> -#include <visp/vpFeatureTranslation.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/visual_features/vpFeatureTranslation.h> -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpFeatureException.h> +#include <visp3/core/vpException.h> +#include <visp3/visual_features/vpFeatureException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> /*! @@ -86,8 +81,21 @@ vpFeatureTranslation::init() } +/*! + Default constructor that builds a visual feature and initialize it to zero. + The type of the translation feature will be vpFeatureTranslation::cdMc + by default. Use the function setFeatureTranslationType() to set the + desired type of feature. +*/ +vpFeatureTranslation::vpFeatureTranslation() + : f2Mf1(), translation(vpFeatureTranslation::cdMc) +{ + init() ; +} + + /*! - Default constructor that build a visual feature and initialize it to zero. + Default constructor that builds a visual feature and initialize it to zero specifying the type. \param r : Type of considered 3D translation feature. @@ -101,7 +109,7 @@ vpFeatureTranslation::vpFeatureTranslation(vpFeatureTranslationRepresentationTyp /*! - Constructor that build a 3D visual feature from an homogeneous + Constructor that builds a 3D visual feature from an homogeneous matrix \f$ ^{{\cal{F}}_2}M_{{\cal{F}}_1} \f$ that represent the 3D transformation between two frames \f${\cal{F}}_1\f$ and \f${\cal{F}}_2\f$. \param f2Mf1_ [in] : 3D displacement that the camera has to achieve to @@ -135,6 +143,20 @@ vpFeatureTranslation::buildFrom(const vpHomogeneousMatrix &f2Mf1_) flags[0] = true; } +/*! + + Set the type of translation feature. + + \param r : type of translation feature. It can be vpFeatureTranslation::cdMc, vpFeatureTranslation::cMcd + or vpFeatureTranslation::cMo. + \sa getFeatureTranslationType() + +*/ +void vpFeatureTranslation::setFeatureTranslationType(const vpFeatureTranslationRepresentationType r) +{ + translation = r; +} + /*! Initialise the \f$t_x \f$ subset value of the 3D @@ -176,6 +198,21 @@ vpFeatureTranslation::set_Tz(const double t_z) s[2] = t_z ; } + +/*! + + Get the type of translation feature. + + \return Type of translation feature. It can be vpFeatureTranslation::cdMc, vpFeatureTranslation::cMcd + or vpFeatureTranslation::cMo. + \sa setFeatureTranslationType() + +*/ +vpFeatureTranslation::vpFeatureTranslationRepresentationType vpFeatureTranslation::getFeatureTranslationType() const +{ + return translation ; +} + /*! Return the \f$t_x \f$ subset value of the visual feature \f$s\f$. @@ -322,7 +359,7 @@ vpFeatureTranslation::interaction(const unsigned int select) Lx[0][i] = f2Mf1[0][i] ; Lx[0][3] = 0 ; Lx[0][4] = 0 ; Lx[0][5] = 0 ; - L = vpMatrix::stackMatrices(L,Lx) ; + L = vpMatrix::stack(L,Lx) ; } if (vpFeatureTranslation::selectTy() & select ) { @@ -332,7 +369,7 @@ vpFeatureTranslation::interaction(const unsigned int select) Ly[0][i] = f2Mf1[1][i] ; Ly[0][3] = 0 ; Ly[0][4] = 0 ; Ly[0][5] = 0 ; - L = vpMatrix::stackMatrices(L,Ly) ; + L = vpMatrix::stack(L,Ly) ; } if (vpFeatureTranslation::selectTz() & select ) { @@ -342,7 +379,7 @@ vpFeatureTranslation::interaction(const unsigned int select) Lz[0][i] = f2Mf1[2][i] ; Lz[0][3] = 0 ; Lz[0][4] = 0 ; Lz[0][5] = 0 ; - L = vpMatrix::stackMatrices(L,Lz) ; + L = vpMatrix::stack(L,Lz) ; } } if (translation == cMcd) { @@ -352,7 +389,7 @@ vpFeatureTranslation::interaction(const unsigned int select) Lx[0][0] = -1 ; Lx[0][1] = 0 ; Lx[0][2] = 0 ; Lx[0][3] = 0 ; Lx[0][4] = -s[2] ; Lx[0][5] = s[1] ; - L = vpMatrix::stackMatrices(L,Lx) ; + L = vpMatrix::stack(L,Lx) ; } if (vpFeatureTranslation::selectTy() & select ) { @@ -360,7 +397,7 @@ vpFeatureTranslation::interaction(const unsigned int select) Ly[0][0] = 0 ; Ly[0][1] = -1 ; Ly[0][2] = 0 ; Ly[0][3] = s[2] ; Ly[0][4] = 0 ; Ly[0][5] = -s[0] ; - L = vpMatrix::stackMatrices(L,Ly) ; + L = vpMatrix::stack(L,Ly) ; } if (vpFeatureTranslation::selectTz() & select ) { @@ -368,7 +405,7 @@ vpFeatureTranslation::interaction(const unsigned int select) Lz[0][0] = 0 ; Lz[0][1] = 0 ; Lz[0][2] = -1 ; Lz[0][3] = -s[1] ; Lz[0][4] = s[0] ; Lz[0][5] = 0 ; - L = vpMatrix::stackMatrices(L,Lz) ; + L = vpMatrix::stack(L,Lz) ; } } @@ -379,7 +416,7 @@ vpFeatureTranslation::interaction(const unsigned int select) Lx[0][0] = -1 ; Lx[0][1] = 0 ; Lx[0][2] = 0 ; Lx[0][3] = 0 ; Lx[0][4] = -s[2] ; Lx[0][5] = s[1] ; - L = vpMatrix::stackMatrices(L,Lx) ; + L = vpMatrix::stack(L,Lx) ; } if (vpFeatureTranslation::selectTy() & select ) { @@ -387,7 +424,7 @@ vpFeatureTranslation::interaction(const unsigned int select) Ly[0][0] = 0 ; Ly[0][1] = -1 ; Ly[0][2] = 0 ; Ly[0][3] = s[2] ; Ly[0][4] = 0 ; Ly[0][5] = -s[0] ; - L = vpMatrix::stackMatrices(L,Ly) ; + L = vpMatrix::stack(L,Ly) ; } if (vpFeatureTranslation::selectTz() & select ) { @@ -395,7 +432,7 @@ vpFeatureTranslation::interaction(const unsigned int select) Lz[0][0] = 0 ; Lz[0][1] = 0 ; Lz[0][2] = -1 ; Lz[0][3] = -s[1] ; Lz[0][4] = s[0] ; Lz[0][5] = 0 ; - L = vpMatrix::stackMatrices(L,Lz) ; + L = vpMatrix::stack(L,Lz) ; } } @@ -484,21 +521,21 @@ vpFeatureTranslation::error(const vpBasicFeature &s_star, { vpColVector ex(1) ; ex[0] = s[0]-s_star[0] ; - e = vpMatrix::stackMatrices(e,ex) ; + e = vpColVector::stack(e,ex) ; } if (vpFeatureTranslation::selectTy() & select ) { vpColVector ey(1) ; ey[0] = s[1]-s_star[1] ; - e = vpMatrix::stackMatrices(e,ey) ; + e = vpColVector::stack(e,ey) ; } if (vpFeatureTranslation::selectTz() & select ) { vpColVector ez(1) ; ez[0] = s[2]-s_star[2] ; - e = vpMatrix::stackMatrices(e,ez) ; + e = vpColVector::stack(e,ez) ; } return e ; @@ -515,7 +552,7 @@ vpFeatureTranslation::error(const vpBasicFeature &s_star, corresponding function selectTx(), selectTy() or selectTz(). \code - vpHomogeneousMatrix cdMc; // Homogenous transformation between the desired camera frame and the current camera frame. + vpHomogeneousMatrix cdMc; // Homogeneous transformation between the desired camera frame and the current camera frame. // Creation of the current feature s vpFeatureTranslation s(vpFeatureTranslation::cdMc); @@ -610,8 +647,138 @@ vpFeatureTranslation::display(const vpCameraParameters &/* cam */, } } -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ +/*! + + Function used to select the \f$ t_x\f$ subset of the translation + visual feature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$ t_x\f$. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + - With the feature type cdMc: + \code + vpFeatureTranslation t(vpFeatureTranslation::cdMc); + vpServo task; + ... + // Add the (tx,ty) subset features from 3D translation to the task + task.addFeature(t, vpFeatureTranslation::selectTx() | vpFeatureTranslation::selectTy()); + \endcode + + - With the feature type cMcd: + \code + vpFeatureTranslation t(vpFeatureTranslation::cMcd); + vpServo task; + ... + // Add the (tx,ty) subset features from 3D translation to the task + task.addFeature(t, vpFeatureTranslation::selectTx() | vpFeatureTranslation::selectTy()); + \endcode + + - With the feature type cMo: + \code + vpFeatureTranslation t(vpFeatureTranslation::cMo); + vpFeatureTranslation t_star(vpFeatureTranslation::cMo); + vpServo task; + ... + // Add the (tx,ty) subset features from 3D translation to the task + task.addFeature(t, t_star, vpFeatureTranslation::selectTx() | vpFeatureTranslation::selectTy()); + \endcode + + \sa selectTy(), selectTz() + +*/ +unsigned int vpFeatureTranslation::selectTx() { return FEATURE_LINE[0] ; } + +/*! + + Function used to select the \f$ t_y\f$ subset of the translation + visual feature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$ t_y\f$. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + - With the feature type cdMc: + \code + vpFeatureTranslation t(vpFeatureTranslation::cdMc); + vpServo task; + ... + // Add the (tx,ty) subset features from 3D translation to the task + task.addFeature(t, vpFeatureTranslation::selectTx() | vpFeatureTranslation::selectTy()); + \endcode + + - With the feature type cMcd: + \code + vpFeatureTranslation t(vpFeatureTranslation::cMcd); + vpServo task; + ... + // Add the (tx,ty) subset features from 3D translation to the task + task.addFeature(t, vpFeatureTranslation::selectTx() | vpFeatureTranslation::selectTy()); + \endcode + + - With the feature type cMo: + \code + vpFeatureTranslation t(vpFeatureTranslation::cMo); + vpFeatureTranslation t_star(vpFeatureTranslation::cMo); + vpServo task; + ... + // Add the (tx,ty) subset features from 3D translation to the task + task.addFeature(t, t_star, vpFeatureTranslation::selectTx() | vpFeatureTranslation::selectTy()); + \endcode + + \sa selectTx(), selectTz() +*/ +unsigned int vpFeatureTranslation::selectTy() { return FEATURE_LINE[1] ; } + +/*! + + Function used to select the \f$ t_z\f$ subset of the translation + visual feature. + + This function is to use in conjunction with interaction() in order + to compute the interaction matrix associated to \f$ t_z\f$. + + See the interaction() method for an usage example. + + This function is also useful in the vpServo class to indicate that + a subset of the visual feature is to use in the control law: + + - With the feature type cdMc: + \code + vpFeatureTranslation t(vpFeatureTranslation::cdMc); + vpServo task; + ... + // Add the (tz) subset feature from 3D translation to the task + task.addFeature(t, vpFeatureTranslation::selectTz()); + \endcode + + - With the feature type cMcd: + \code + vpFeatureTranslation t(vpFeatureTranslation::cMcd); + vpServo task; + ... + // Add the (tz) subset feature from 3D translation to the task + task.addFeature(t, vpFeatureTranslation::selectTz()); + \endcode + + - With the feature type cMo: + \code + vpFeatureTranslation t(vpFeatureTranslation::cMo); + vpFeatureTranslation t_star(vpFeatureTranslation::cMo); + vpServo task; + ... + // Add the (tz) subset feature from 3D translation to the task + task.addFeature(t, t_star, vpFeatureTranslation::selectTz()); + \endcode + + \sa selectTx(), selectTy() +*/ +unsigned int vpFeatureTranslation::selectTz() { return FEATURE_LINE[2] ; } diff --git a/src/visual-feature/vpFeatureVanishingPoint.cpp b/modules/visual_features/src/visual-feature/vpFeatureVanishingPoint.cpp similarity index 84% rename from src/visual-feature/vpFeatureVanishingPoint.cpp rename to modules/visual_features/src/visual-feature/vpFeatureVanishingPoint.cpp index c3cd4c4a5829d348046e57bb24361c60fb48d970..a140974040baa6a5e3a286b0e5422407116a5345 100644 --- a/src/visual-feature/vpFeatureVanishingPoint.cpp +++ b/modules/visual_features/src/visual-feature/vpFeatureVanishingPoint.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpFeatureVanishingPoint.cpp 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * 2D vanishing point visual feature (Z coordinate in 3D space is infinity) * @@ -44,21 +40,20 @@ \brief Class that defines 2D vanishing point visual feature (Z coordinate in 3D space is infinity) */ -#include <visp/vpBasicFeature.h> -#include <visp/vpFeatureVanishingPoint.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/visual_features/vpFeatureVanishingPoint.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpFeatureException.h> +#include <visp3/core/vpException.h> +#include <visp3/visual_features/vpFeatureException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> // math -#include <visp/vpMath.h> +#include <visp3/core/vpMath.h> -#include <visp/vpFeatureDisplay.h> +#include <visp3/core/vpFeatureDisplay.h> void vpFeatureVanishingPoint::init() @@ -165,7 +160,7 @@ vpFeatureVanishingPoint::interaction(const unsigned int select) Lx[0][4] = -(1+x*x) ; Lx[0][5] = y ; - L = vpMatrix::stackMatrices(L,Lx) ; + L = vpMatrix::stack(L,Lx) ; } if (vpFeatureVanishingPoint::selectY() & select ) @@ -179,7 +174,7 @@ vpFeatureVanishingPoint::interaction(const unsigned int select) Ly[0][4] = -x*y ; Ly[0][5] = -x ; - L = vpMatrix::stackMatrices(L,Ly) ; + L = vpMatrix::stack(L,Ly) ; } return L ; } @@ -200,27 +195,18 @@ vpFeatureVanishingPoint::error(const vpBasicFeature &s_star, vpColVector ex(1) ; ex[0] = s[0] - s_star[0] ; - e = vpMatrix::stackMatrices(e,ex) ; + e = vpColVector::stack(e,ex) ; } if (vpFeatureVanishingPoint::selectY() & select ) { vpColVector ey(1) ; ey[0] = s[1] - s_star[1] ; - e = vpMatrix::stackMatrices(e,ey) ; + e = vpColVector::stack(e,ey) ; } } - catch(vpMatrixException me) - { - vpERROR_TRACE("caught a Matrix related error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; - } - catch(vpException me) - { - vpERROR_TRACE("caught another error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; + catch(...) { + throw ; } return e ; } @@ -318,3 +304,6 @@ vpFeatureVanishingPoint *vpFeatureVanishingPoint::duplicate() const vpFeatureVanishingPoint *feature = new vpFeatureVanishingPoint ; return feature ; } + +unsigned int vpFeatureVanishingPoint::selectX() { return FEATURE_LINE[0] ; } +unsigned int vpFeatureVanishingPoint::selectY() { return FEATURE_LINE[1] ; } diff --git a/src/visual-feature/vpGenericFeature.cpp b/modules/visual_features/src/visual-feature/vpGenericFeature.cpp similarity index 93% rename from src/visual-feature/vpGenericFeature.cpp rename to modules/visual_features/src/visual-feature/vpGenericFeature.cpp index 0144fb5f016fd1c5f4adeae35b7cd0742cc8fe04..39fd8b77e9b7259340dae91d5392cfa66b0cabd8 100644 --- a/src/visual-feature/vpGenericFeature.cpp +++ b/modules/visual_features/src/visual-feature/vpGenericFeature.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpGenericFeature.cpp 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Generic feature (used to create new feature not implemented in ViSP). * @@ -40,23 +36,22 @@ *****************************************************************************/ -#include <visp/vpGenericFeature.h> +#include <visp3/visual_features/vpGenericFeature.h> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpFeatureException.h> +#include <visp3/core/vpException.h> +#include <visp3/visual_features/vpFeatureException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> /*! \file vpGenericFeature.cpp - \brief class that defines what is a generic feature (used to create new - feature not implemented in ViSP2 + Class that defines what is a generic feature. This class could be used to create new + features not implemented in ViSP. */ vpGenericFeature::~vpGenericFeature() @@ -224,7 +219,7 @@ vpGenericFeature::error(const vpBasicFeature &s_star, vpColVector ex(1) ; ex[i] = err[i] ; - e = vpMatrix::stackMatrices(e,ex) ; + e = vpColVector::stack(e,ex) ; } } else @@ -237,22 +232,13 @@ vpGenericFeature::error(const vpBasicFeature &s_star, vpColVector ex(1) ; ex[0] = s[i] - s_star[i] ; - e = vpMatrix::stackMatrices(e,ex) ; + e = vpColVector::stack(e,ex) ; } } } - catch(vpMatrixException me) - { - vpERROR_TRACE("caught a Matric related error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; - } - catch(vpException me) - { - vpERROR_TRACE("caught another error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; + catch(...) { + throw; } return e ; @@ -325,7 +311,7 @@ vpGenericFeature::error( const unsigned int select) vpColVector ex(1) ; ex[i] = err[i] ; - e = vpMatrix::stackMatrices(e,ex) ; + e = vpColVector::stack(e,ex) ; } } else @@ -337,22 +323,13 @@ vpGenericFeature::error( const unsigned int select) vpColVector ex(1) ; ex[i] = s[i] ; - e = vpMatrix::stackMatrices(e,ex) ; + e = vpColVector::stack(e,ex) ; } } } - catch(vpMatrixException me) - { - vpERROR_TRACE("caught a Matric related error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; - } - catch(vpException me) - { - vpERROR_TRACE("caught another error") ; - std::cout <<std::endl << me << std::endl ; - throw(me) ; + catch(...) { + throw; } return e ; @@ -439,7 +416,7 @@ vpGenericFeature::interaction(const unsigned int select) for (int j=0 ; j < 6 ; j++) Lx[0][j] = L[i][j] ; - Ls = vpMatrix::stackMatrices(Ls,Lx) ; + Ls = vpMatrix::stack(Ls,Lx) ; } return Ls ; diff --git a/test/feature/testPoint.cpp b/modules/visual_features/test/feature/testPoint.cpp similarity index 70% rename from test/feature/testPoint.cpp rename to modules/visual_features/test/feature/testPoint.cpp index a16f39cdb45418986a75c8f744407cd180792b4b..960675f9722fb98691b9647ecb057f867abaf12d 100644 --- a/test/feature/testPoint.cpp +++ b/modules/visual_features/test/feature/testPoint.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testPoint.cpp 4658 2014-02-09 09:50:14Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Performs various tests on the point class. * @@ -46,89 +42,20 @@ \brief Performs various tests on the the point class. */ -// List of allowed command line options -#define GETOPTARGS "h" - -#include <visp/vpMath.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpPoint.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpFeatureException.h> -#include <visp/vpDebug.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpParseArgv.h> +#include <visp3/core/vpMath.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpPoint.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/visual_features/vpFeatureException.h> +#include <visp3/core/vpDebug.h> +#include <visp3/visual_features/vpFeatureBuilder.h> #include <stdlib.h> #include <stdio.h> - -void usage(const char *name, const char *badparam); -bool getOptions(int argc, const char **argv); - -/*! - - Print the program options. - -*/ -void usage(const char *name, const char *badparam) -{ - fprintf(stdout, "\n\ -Performs various tests on the point class.\n\ -\n\ -SYNOPSIS\n\ - %s [-h]\n", name); - - fprintf(stdout, "\n\ -OPTIONS: Default\n\ - -h\n\ - Print the help.\n"); - - if (badparam) - fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); -} -/*! - - Set the program options. - - \return false if the program has to be stopped, true otherwise. - -*/ -bool getOptions(int argc, const char **argv) -{ - const char *optarg_; - int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { - - switch (c) { - case 'h': usage(argv[0], NULL); return false; break; - - default: - usage(argv[0], optarg_); - return false; break; - } - } - - if ((c == 1) || (c == -1)) { - // standalone param or error - usage(argv[0], NULL); - std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; - return false; - } - - return true; -} - - -int -main(int argc, const char ** argv) +int main() { try { - // Read the command line options - if (getOptions(argc, argv) == false) { - exit (-1); - } - vpHomogeneousMatrix cMo ; cMo[0][3] = 0.1 ; cMo[1][3] = 0.2 ; diff --git a/modules/vs/CMakeLists.txt b/modules/vs/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..65d0fb72befbb360a50aabef4eea04a6c57d3be9 --- /dev/null +++ b/modules/vs/CMakeLists.txt @@ -0,0 +1,43 @@ +############################################################################# +# +# This file is part of the ViSP software. +# Copyright (C) 2005 - 2015 by Inria. All rights reserved. +# +# This software is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# ("GPL") version 2 as published by the Free Software Foundation. +# See the file LICENSE.txt at the root directory of this source +# distribution for additional information about the GNU GPL. +# +# For using ViSP with software that can not be combined with the GNU +# GPL, please contact Inria about acquiring a ViSP Professional +# Edition License. +# +# See http://visp.inria.fr for more information. +# +# This software was developed at: +# Inria Rennes - Bretagne Atlantique +# Campus Universitaire de Beaulieu +# 35042 Rennes Cedex +# France +# +# If you have questions regarding the use of this file, please contact +# Inria at visp@inria.fr +# +# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# Description: +# ViSP configuration file. +# +# Authors: +# Fabien Spindler +# +############################################################################# + +# visp_robot is optional to run testFeatureSegment.cpp +vp_add_module(vs visp_core visp_visual_features OPTIONAL visp_robot visp_io) +vp_glob_module_sources() +vp_module_include_directories() +vp_create_module() +vp_add_tests(DEPENDS_ON visp_blob visp_io visp_gui) diff --git a/src/servo/vpAdaptiveGain.h b/modules/vs/include/visp3/vs/vpAdaptiveGain.h similarity index 93% rename from src/servo/vpAdaptiveGain.h rename to modules/vs/include/visp3/vs/vpAdaptiveGain.h index 766cc8dc086195fe949255764191162ef963f0de..9d00ec290e6b0637deed27e699cb6713064a2717 100644 --- a/src/servo/vpAdaptiveGain.h +++ b/modules/vs/include/visp3/vs/vpAdaptiveGain.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpAdaptiveGain.h 4641 2014-02-05 12:42:03Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Adaptive gain. * @@ -46,14 +42,14 @@ #ifndef __VP_ADAPTIVE_GAIN_H #define __VP_ADAPTIVE_GAIN_H -#include <visp/vpConfig.h> +#include <visp3/core/vpConfig.h> #include <iostream> class vpColVector; /*! \class vpAdaptiveGain - \ingroup VsTask + \ingroup group_task \brief Adaptive gain computation. diff --git a/src/servo/vpServo.h b/modules/vs/include/visp3/vs/vpServo.h similarity index 86% rename from src/servo/vpServo.h rename to modules/vs/include/visp3/vs/vpServo.h index 9c80a30513d45a39e888bf9419b1c7d0a45a0f8f..4a37bf3f3ee6d51da5c2c59a5a7fe2c398310065 100644 --- a/src/servo/vpServo.h +++ b/modules/vs/include/visp3/vs/vpServo.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpServo.h 5219 2015-01-28 10:29:21Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Visual servoing control law. * @@ -52,17 +48,17 @@ #include <list> -#include <visp/vpMatrix.h> -#include <visp/vpVelocityTwistMatrix.h> -#include <visp/vpBasicFeature.h> -#include <visp/vpServoException.h> -#include <visp/vpAdaptiveGain.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/core/vpVelocityTwistMatrix.h> +#include <visp3/visual_features/vpBasicFeature.h> +#include <visp3/vs/vpServoException.h> +#include <visp3/vs/vpAdaptiveGain.h> /*! \class vpServo - \ingroup VsTask + \ingroup group_task Class required to compute the visual servoing control law descbribed in \cite Chaumette06a and \cite Chaumette07a. @@ -84,12 +80,12 @@ the current one obtained by pose estimation (see vpPose class). \code -#include <visp/vpColVector.h> -#include <visp/vpFeatureThetaU.h> -#include <visp/vpFeatureTranslation.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMatrix.h> -#include <visp/vpServo.h> +#include <visp3/core/vpColVector.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/visual_features/vpFeatureTranslation.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpMatrix.h> +#include <visp3/vs/vpServo.h> int main() { @@ -108,8 +104,8 @@ int main() s_tu.buildFrom(cdMc); // Build the desired visual feature s* = (0,0) - vpFeatureTranslation s_star_t(vpFeatureTranslation::cdMc); // Default initialization to zero - vpFeatureThetaU s_star_tu(vpFeatureThetaU::cdRc);// Default initialization to zero + vpFeatureTranslation s_star_t(vpFeatureTranslation::cdMc); // Default initialization to zero + vpFeatureThetaU s_star_tu(vpFeatureThetaU::cdRc);// Default initialization to zero vpColVector v; // Camera velocity double error; // Task error @@ -120,15 +116,15 @@ int main() // Visual servo task initialization // - Camera is monted on the robot end-effector and velocities are // computed in the camera frame - task.setServo(vpServo::EYEINHAND_CAMERA); + task.setServo(vpServo::EYEINHAND_CAMERA); // - Interaction matrix is computed with the current visual features s - task.setInteractionMatrixType(vpServo::CURRENT); + task.setInteractionMatrixType(vpServo::CURRENT); // - Set the contant gain to 1 task.setLambda(1); // - Add current and desired translation feature - task.addFeature(s_t, s_star_t); + task.addFeature(s_t, s_star_t); // - Add current and desired ThetaU feature for the rotation - task.addFeature(s_tu, s_star_tu); + task.addFeature(s_tu, s_star_tu); // Visual servoing loop. The objective is here to update the visual // features s = (c*_t_c, ThetaU), compute the control law and apply @@ -214,6 +210,24 @@ public: MINIMUM /*!< Same as vpServo::vpServoPrintType::ERROR_VECTOR. */ } vpServoPrintType; +//private: +//#ifndef DOXYGEN_SHOULD_SKIP_THIS +// vpServo(const vpServo &) +// : L(), error(), J1(), J1p(), s(), sStar(), e1(), e(), q_dot(), v(), servoType(vpServo::NONE), +// rankJ1(0), featureList(), desiredFeatureList(), featureSelectionList(), lambda(), signInteractionMatrix(1), +// interactionMatrixType(DESIRED), inversionType(PSEUDO_INVERSE), cVe(), init_cVe(false), +// cVf(), init_cVf(false), fVe(), init_fVe(false), eJe(), init_eJe(false), fJe(), init_fJe(false), +// errorComputed(false), interactionMatrixComputed(false), dim_task(0), taskWasKilled(false), +// forceInteractionMatrixComputation(false), WpW(), I_WpW(), P(), sv(), mu(4.), e1_initial() +// { +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// } +// vpServo &operator=(const vpServo &){ +// throw vpException(vpException::functionNotImplementedError, "Not implemented!"); +// return *this; +// } +//#endif + public: // default constructor vpServo(); @@ -284,6 +298,8 @@ public: return servoType; } + vpMatrix getLargeP() const; + vpMatrix getTaskJacobian() const; vpMatrix getTaskJacobianPseudoInverse() const; unsigned int getTaskRank() const; @@ -328,9 +344,13 @@ public: std::ostream &os = std::cout) ; // Add a secondary task. - vpColVector secondaryTask(const vpColVector &de2dt) ; + vpColVector secondaryTask(const vpColVector &de2dt, const bool &useLargeProjectionOperator = false) ; // Add a secondary task. - vpColVector secondaryTask(const vpColVector &e2, const vpColVector &de2dt) ; + vpColVector secondaryTask(const vpColVector &e2, const vpColVector &de2dt, const bool &useLargeProjectionOperator = false) ; + // Add a secondary task to avoid the joint limit. + vpColVector secondaryTaskJointLimitAvoidance(const vpColVector &q, const vpColVector &dq, const vpColVector & jointMin, + const vpColVector & jointMax, const double &rho=0.1, const double &rho1=0.3, const double &lambda_tune=0.7) const; + /*! Set a variable which enables to compute the interaction matrix at each iteration. @@ -455,6 +475,11 @@ public: //! Basic initialization. void init() ; + /*! + Compute the classic projetion operator and the large projection operator. + */ + void computeProjectionOperators(); + public: //! Interaction matrix vpMatrix L ; @@ -555,6 +580,25 @@ public: vpMatrix WpW ; //! Projection operators \f$\bf I-WpW\f$. vpMatrix I_WpW ; + /*! + New Large projection operator (see equation(24) in the paper \cite Marey:2010). This projection operator allows + performing secondary task even when the main task is full rank. + \f[ + {\bf P} =\bar{\lambda }\left ( \left \| {\bf e} \right \| \right ){\bf P}_{ \left \| {\bf e } \right \| } \left + ( 1 - \bar{\lambda }\left ( \left \| {\bf e } \right \| \right ) \right ) \left ( {\bf I-W^+W}\right ) + \f] + + with + + \f[ + {\bf P}_{\left \| {\bf e } \right \| } = I_{n} - \frac{1}{{\bf e }^\top {\bf J_{{\bf e }} } {\bf J_{{\bf e }}^\top } + {\bf e }}{\bf J_{{\bf e }}^\top }{\bf e }{\bf e }^\top{\bf J_{{\bf e }} } + \f] + + */ + vpMatrix P; + + //! Singular values from the pseudo inverse. vpColVector sv ; diff --git a/src/servo/vpServoData.h b/modules/vs/include/visp3/vs/vpServoData.h similarity index 86% rename from src/servo/vpServoData.h rename to modules/vs/include/visp3/vs/vpServoData.h index 1f5ab8a67558fe2b91e3a25ba7c3125be29b2bc1..f92bae72d87d9d2cbb2f1056cf1448348f90376d 100644 --- a/src/servo/vpServoData.h +++ b/modules/vs/include/visp3/vs/vpServoData.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpServoData.h 4632 2014-02-03 17:06:40Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Save data during the task execution. * @@ -50,13 +46,13 @@ // Servo -#include <visp/vpServo.h> +#include <visp3/vs/vpServo.h> #include <iostream> /*! \class vpServoData - \ingroup VsTask + \ingroup group_task \brief Save data during the task execution. */ class VISP_EXPORT vpServoData diff --git a/src/servo/vpServoDisplay.h b/modules/vs/include/visp3/vs/vpServoDisplay.h similarity index 79% rename from src/servo/vpServoDisplay.h rename to modules/vs/include/visp3/vs/vpServoDisplay.h index 130f8433836a7c921643e0c9b780af5466a71938..0af2ec6bca621ddaf640db36a35bb73bf101c478 100644 --- a/src/servo/vpServoDisplay.h +++ b/modules/vs/include/visp3/vs/vpServoDisplay.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpServoDisplay.h 4645 2014-02-05 17:44:06Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface with the image for feature display. * @@ -48,18 +44,18 @@ */ // Servo -#include <visp/vpServo.h> +#include <visp3/vs/vpServo.h> // Meter/pixel conversion -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpCameraParameters.h> //Color / image / display -#include <visp/vpColor.h> -#include <visp/vpImage.h> -#include <visp/vpRGBa.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpRGBa.h> /*! \class vpServoDisplay - \ingroup VsTask + \ingroup group_task \brief Interface with the image for feature display. */ class VISP_EXPORT vpServoDisplay diff --git a/src/servo/vpServoException.h b/modules/vs/include/visp3/vs/vpServoException.h similarity index 86% rename from src/servo/vpServoException.h rename to modules/vs/include/visp3/vs/vpServoException.h index f74fc67614a5ee2b4cc1fa9eaee9031452fda55f..258b645b41e961bc0ae711ae4a0f2207478abd9d 100644 --- a/src/servo/vpServoException.h +++ b/modules/vs/include/visp3/vs/vpServoException.h @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpServoException.h 4649 2014-02-07 14:57:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Exception that can be emited by the vpServo class and its derivates. * @@ -47,7 +43,7 @@ \brief error that can be emited by the vpServo class and its derivates */ -#include <visp/vpException.h> +#include <visp3/core/vpException.h> #include <iostream> /* Classe std::ostream. */ #include <string> /* Classe string. */ @@ -58,7 +54,6 @@ /*! \class vpServoException - \ingroup Exception \brief Error that can be emited by the vpServo class and its derivates. \author Eric Marchand (Eric.Marchand@irisa.fr) Irisa / Inria Rennes */ diff --git a/src/servo/vpAdaptiveGain.cpp b/modules/vs/src/vpAdaptiveGain.cpp similarity index 95% rename from src/servo/vpAdaptiveGain.cpp rename to modules/vs/src/vpAdaptiveGain.cpp index 6bc54f7c935bd9a12899938bb45aac44951c3dc9..68324d777d8bb38c326ef86708f0dfe8600c9f66 100644 --- a/src/servo/vpAdaptiveGain.cpp +++ b/modules/vs/src/vpAdaptiveGain.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpAdaptiveGain.cpp 5126 2015-01-05 22:07:11Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Adaptive gain. * @@ -43,9 +39,9 @@ */ /* --- VISP --- */ -#include <visp/vpColVector.h> -#include <visp/vpDebug.h> -#include <visp/vpAdaptiveGain.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpDebug.h> +#include <visp3/vs/vpAdaptiveGain.h> #include <iostream> #include <cmath> // std::fabs diff --git a/src/servo/vpServo.cpp b/modules/vs/src/vpServo.cpp similarity index 69% rename from src/servo/vpServo.cpp rename to modules/vs/src/vpServo.cpp index 04ebe2c7f0d1caddf6a39bd2dff1001d49dfa504..3ee40f3cb105aa3155cf115701b2afbeceb8443e 100644 --- a/src/servo/vpServo.cpp +++ b/modules/vs/src/vpServo.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpServo.cpp 5219 2015-01-28 10:29:21Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Visual servoing control law. * @@ -42,14 +38,15 @@ *****************************************************************************/ -#include <visp/vpServo.h> +#include <visp3/vs/vpServo.h> + +#include <sstream> // Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> +#include <visp3/core/vpException.h> // Debug trace -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> /*! \file vpServo.cpp @@ -74,7 +71,7 @@ vpServo::vpServo() interactionMatrixType(DESIRED), inversionType(PSEUDO_INVERSE), cVe(), init_cVe(false), cVf(), init_cVf(false), fVe(), init_fVe(false), eJe(), init_eJe(false), fJe(), init_fJe(false), errorComputed(false), interactionMatrixComputed(false), dim_task(0), taskWasKilled(false), - forceInteractionMatrixComputation(false), WpW(), I_WpW(), sv(), mu(4.) + forceInteractionMatrixComputation(false), WpW(), I_WpW(), P(), sv(), mu(4.), e1_initial() { } /*! @@ -96,7 +93,7 @@ vpServo::vpServo(vpServoType servo_type) interactionMatrixType(DESIRED), inversionType(PSEUDO_INVERSE), cVe(), init_cVe(false), cVf(), init_cVf(false), fVe(), init_fVe(false), eJe(), init_eJe(false), fJe(), init_fJe(false), errorComputed(false), interactionMatrixComputed(false), dim_task(0), taskWasKilled(false), - forceInteractionMatrixComputation(false), WpW(), I_WpW(), sv(), mu(4) + forceInteractionMatrixComputation(false), WpW(), I_WpW(), P(), sv(), mu(4), e1_initial() { } @@ -198,7 +195,7 @@ void vpServo::kill() (*it) = NULL ; } } - //desired list + //desired list for(std::list<vpBasicFeature *>::iterator it = desiredFeatureList.begin(); it != desiredFeatureList.end(); ++it) { if ((*it)->getDeallocate() == vpBasicFeature::vpServo) { delete (*it) ; @@ -248,176 +245,176 @@ void vpServo::setServo(const vpServoType &servo_type) \param os : Output stream. */ void - vpServo::print(const vpServo::vpServoPrintType displayLevel, std::ostream &os) +vpServo::print(const vpServo::vpServoPrintType displayLevel, std::ostream &os) { switch (displayLevel) { case vpServo::ALL: - { - os << "Visual servoing task: " <<std::endl ; + { + os << "Visual servoing task: " <<std::endl ; - os << "Type of control law " <<std::endl ; - switch( servoType ) - { - case NONE : - os << "Type of task have not been chosen yet ! " << std::endl ; - break ; - case EYEINHAND_CAMERA : - os << "Eye-in-hand configuration " << std::endl ; - os << "Control in the camera frame " << std::endl ; - break ; - case EYEINHAND_L_cVe_eJe : - os << "Eye-in-hand configuration " << std::endl ; - os << "Control in the articular frame " << std::endl ; - break ; - case EYETOHAND_L_cVe_eJe : - os << "Eye-to-hand configuration " << std::endl ; - os << "s_dot = _L_cVe_eJe q_dot " << std::endl ; - break ; - case EYETOHAND_L_cVf_fVe_eJe : - os << "Eye-to-hand configuration " << std::endl ; - os << "s_dot = _L_cVe_fVe_eJe q_dot " << std::endl ; - break ; - case EYETOHAND_L_cVf_fJe : - os << "Eye-to-hand configuration " << std::endl ; - os << "s_dot = _L_cVf_fJe q_dot " << std::endl ; - break ; - } + os << "Type of control law " <<std::endl ; + switch( servoType ) + { + case NONE : + os << "Type of task have not been chosen yet ! " << std::endl ; + break ; + case EYEINHAND_CAMERA : + os << "Eye-in-hand configuration " << std::endl ; + os << "Control in the camera frame " << std::endl ; + break ; + case EYEINHAND_L_cVe_eJe : + os << "Eye-in-hand configuration " << std::endl ; + os << "Control in the articular frame " << std::endl ; + break ; + case EYETOHAND_L_cVe_eJe : + os << "Eye-to-hand configuration " << std::endl ; + os << "s_dot = _L_cVe_eJe q_dot " << std::endl ; + break ; + case EYETOHAND_L_cVf_fVe_eJe : + os << "Eye-to-hand configuration " << std::endl ; + os << "s_dot = _L_cVe_fVe_eJe q_dot " << std::endl ; + break ; + case EYETOHAND_L_cVf_fJe : + os << "Eye-to-hand configuration " << std::endl ; + os << "s_dot = _L_cVf_fJe q_dot " << std::endl ; + break ; + } - os << "List of visual features : s" <<std::endl ; - std::list<vpBasicFeature *>::const_iterator it_s; - std::list<vpBasicFeature *>::const_iterator it_s_star; - std::list<unsigned int>::const_iterator it_select; + os << "List of visual features : s" <<std::endl ; + std::list<vpBasicFeature *>::const_iterator it_s; + std::list<vpBasicFeature *>::const_iterator it_s_star; + std::list<unsigned int>::const_iterator it_select; - for (it_s = featureList.begin(), it_select = featureSelectionList.begin(); it_s != featureList.end(); ++it_s, ++it_select) - { - os << "" ; - (*it_s)->print( (*it_select) ) ; - } + for (it_s = featureList.begin(), it_select = featureSelectionList.begin(); it_s != featureList.end(); ++it_s, ++it_select) + { + os << "" ; + (*it_s)->print( (*it_select) ) ; + } - os << "List of desired visual features : s*" <<std::endl ; - for (it_s_star = desiredFeatureList.begin(), it_select = featureSelectionList.begin(); it_s_star != desiredFeatureList.end(); ++it_s_star, ++it_select) - { - os << "" ; - (*it_s_star)->print( (*it_select) ) ; - } + os << "List of desired visual features : s*" <<std::endl ; + for (it_s_star = desiredFeatureList.begin(), it_select = featureSelectionList.begin(); it_s_star != desiredFeatureList.end(); ++it_s_star, ++it_select) + { + os << "" ; + (*it_s_star)->print( (*it_select) ) ; + } - os <<"Interaction Matrix Ls "<<std::endl ; - if (interactionMatrixComputed) - { - os << L << std::endl; - } - else - { - os << "not yet computed "<<std::endl ; - } + os <<"Interaction Matrix Ls "<<std::endl ; + if (interactionMatrixComputed) + { + os << L << std::endl; + } + else + { + os << "not yet computed "<<std::endl ; + } - os <<"Error vector (s-s*) "<<std::endl ; - if (errorComputed) - { - os << error.t() << std::endl; - } - else - { - os << "not yet computed "<<std::endl ; - } + os <<"Error vector (s-s*) "<<std::endl ; + if (errorComputed) + { + os << error.t() << std::endl; + } + else + { + os << "not yet computed "<<std::endl ; + } - os << "Gain : " << lambda <<std::endl ; + os << "Gain : " << lambda <<std::endl ; - break; - } + break; + } case vpServo::CONTROLLER: + { + os << "Type of control law " <<std::endl ; + switch( servoType ) { - os << "Type of control law " <<std::endl ; - switch( servoType ) - { - case NONE : - os << "Type of task have not been chosen yet ! " << std::endl ; - break ; - case EYEINHAND_CAMERA : - os << "Eye-in-hand configuration " << std::endl ; - os << "Control in the camera frame " << std::endl ; - break ; - case EYEINHAND_L_cVe_eJe : - os << "Eye-in-hand configuration " << std::endl ; - os << "Control in the articular frame " << std::endl ; - break ; - case EYETOHAND_L_cVe_eJe : - os << "Eye-to-hand configuration " << std::endl ; - os << "s_dot = _L_cVe_eJe q_dot " << std::endl ; - break ; - case EYETOHAND_L_cVf_fVe_eJe : - os << "Eye-to-hand configuration " << std::endl ; - os << "s_dot = _L_cVe_fVe_eJe q_dot " << std::endl ; - break ; - case EYETOHAND_L_cVf_fJe : - os << "Eye-to-hand configuration " << std::endl ; - os << "s_dot = _L_cVf_fJe q_dot " << std::endl ; - break ; - } - break; + case NONE : + os << "Type of task have not been chosen yet ! " << std::endl ; + break ; + case EYEINHAND_CAMERA : + os << "Eye-in-hand configuration " << std::endl ; + os << "Control in the camera frame " << std::endl ; + break ; + case EYEINHAND_L_cVe_eJe : + os << "Eye-in-hand configuration " << std::endl ; + os << "Control in the articular frame " << std::endl ; + break ; + case EYETOHAND_L_cVe_eJe : + os << "Eye-to-hand configuration " << std::endl ; + os << "s_dot = _L_cVe_eJe q_dot " << std::endl ; + break ; + case EYETOHAND_L_cVf_fVe_eJe : + os << "Eye-to-hand configuration " << std::endl ; + os << "s_dot = _L_cVe_fVe_eJe q_dot " << std::endl ; + break ; + case EYETOHAND_L_cVf_fJe : + os << "Eye-to-hand configuration " << std::endl ; + os << "s_dot = _L_cVf_fJe q_dot " << std::endl ; + break ; } + break; + } case vpServo::FEATURE_CURRENT: - { - os << "List of visual features : s" <<std::endl ; + { + os << "List of visual features : s" <<std::endl ; - std::list<vpBasicFeature *>::const_iterator it_s; - std::list<unsigned int>::const_iterator it_select; + std::list<vpBasicFeature *>::const_iterator it_s; + std::list<unsigned int>::const_iterator it_select; - for (it_s = featureList.begin(), it_select = featureSelectionList.begin(); it_s != featureList.end(); ++it_s, ++it_select) - { - os << "" ; - (*it_s)->print( (*it_select) ) ; - } - break; + for (it_s = featureList.begin(), it_select = featureSelectionList.begin(); it_s != featureList.end(); ++it_s, ++it_select) + { + os << "" ; + (*it_s)->print( (*it_select) ) ; } + break; + } case vpServo::FEATURE_DESIRED: - { - os << "List of desired visual features : s*" <<std::endl ; + { + os << "List of desired visual features : s*" <<std::endl ; - std::list<vpBasicFeature *>::const_iterator it_s_star; - std::list<unsigned int>::const_iterator it_select; + std::list<vpBasicFeature *>::const_iterator it_s_star; + std::list<unsigned int>::const_iterator it_select; - for (it_s_star = desiredFeatureList.begin(), it_select = featureSelectionList.begin(); it_s_star != desiredFeatureList.end(); ++it_s_star, ++it_select) - { - os << "" ; - (*it_s_star)->print( (*it_select) ) ; - } - break; - } - case vpServo::GAIN: + for (it_s_star = desiredFeatureList.begin(), it_select = featureSelectionList.begin(); it_s_star != desiredFeatureList.end(); ++it_s_star, ++it_select) { - os << "Gain : " << lambda <<std::endl ; - break; + os << "" ; + (*it_s_star)->print( (*it_select) ) ; } + break; + } + case vpServo::GAIN: + { + os << "Gain : " << lambda <<std::endl ; + break; + } case vpServo::INTERACTION_MATRIX: - { - os <<"Interaction Matrix Ls "<<std::endl ; - if (interactionMatrixComputed) { - os << L << std::endl; - } - else { - os << "not yet computed "<<std::endl ; - } - break; + { + os <<"Interaction Matrix Ls "<<std::endl ; + if (interactionMatrixComputed) { + os << L << std::endl; } + else { + os << "not yet computed "<<std::endl ; + } + break; + } case vpServo::ERROR_VECTOR: case vpServo::MINIMUM: - { - os <<"Error vector (s-s*) "<<std::endl ; - if (errorComputed) { - os << error.t() << std::endl; - } - else { - os << "not yet computed "<<std::endl ; - } - - break; + { + os <<"Error vector (s-s*) "<<std::endl ; + if (errorComputed) { + os << error.t() << std::endl; + } + else { + os << "not yet computed "<<std::endl ; } + + break; + } } } @@ -611,64 +608,64 @@ vpMatrix vpServo::computeInteractionMatrix() switch (interactionMatrixType) { case CURRENT: + { + try { - try - { - computeInteractionMatrixFromList(this ->featureList, - this ->featureSelectionList, - L); - dim_task = L.getRows() ; - interactionMatrixComputed = true ; - } + computeInteractionMatrixFromList(this ->featureList, + this ->featureSelectionList, + L); + dim_task = L.getRows() ; + interactionMatrixComputed = true ; + } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } + catch(vpException me) + { + vpERROR_TRACE("Error caught") ; + throw ; } + } break ; case DESIRED: + { + try { - try + if (interactionMatrixComputed == false || forceInteractionMatrixComputation == true) { - if (interactionMatrixComputed == false || forceInteractionMatrixComputation == true) - { - computeInteractionMatrixFromList(this ->desiredFeatureList, - this ->featureSelectionList, L); - - dim_task = L.getRows() ; - interactionMatrixComputed = true ; - } + computeInteractionMatrixFromList(this ->desiredFeatureList, + this ->featureSelectionList, L); + dim_task = L.getRows() ; + interactionMatrixComputed = true ; } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } + } + catch(vpException me) + { + vpERROR_TRACE("Error caught") ; + throw ; + } + } break ; case MEAN: + { + vpMatrix Lstar (L.getRows(), L.getCols()); + try { - vpMatrix Lstar (L.getRows(), L.getCols()); - try - { - computeInteractionMatrixFromList(this ->featureList, - this ->featureSelectionList, L); - computeInteractionMatrixFromList(this ->desiredFeatureList, - this ->featureSelectionList, Lstar); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - L = (L+Lstar)/2; - - dim_task = L.getRows() ; - interactionMatrixComputed = true ; + computeInteractionMatrixFromList(this ->featureList, + this ->featureSelectionList, L); + computeInteractionMatrixFromList(this ->desiredFeatureList, + this ->featureSelectionList, Lstar); + } + catch(vpException me) + { + vpERROR_TRACE("Error caught") ; + throw ; } + L = (L+Lstar)/2; + + dim_task = L.getRows() ; + interactionMatrixComputed = true ; + } break ; case USER_DEFINED: // dim_task = L.getRows() ; @@ -985,8 +982,7 @@ vpColVector vpServo::computeControlLaw() */ e1 = J1p*error ;// primary task - WpW.resize(J1.getCols(), J1.getCols()) ; - WpW.setIdentity() ; + WpW.eye(J1.getCols(), J1.getCols()) ; } else { @@ -1015,22 +1011,13 @@ vpColVector vpServo::computeControlLaw() vpMatrix I ; - I.resize(J1.getCols(),J1.getCols()) ; - I.setIdentity() ; + I.eye(J1.getCols(),J1.getCols()) ; + + computeProjectionOperators(); - I_WpW = (I - WpW) ; } - catch(vpMatrixException me) - { - vpERROR_TRACE("Caught a matrix related error") ; - std::cout << me << std::endl ; - throw me; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw me ; + catch(...) { + throw; } iteration++ ; @@ -1152,8 +1139,7 @@ vpColVector vpServo::computeControlLaw(double t) */ e1 = J1p*error ;// primary task - WpW.resize(J1.getCols(), J1.getCols()) ; - WpW.setIdentity() ; + WpW.eye(J1.getCols(), J1.getCols()) ; } else { @@ -1191,22 +1177,12 @@ vpColVector vpServo::computeControlLaw(double t) vpMatrix I ; - I.resize(J1.getCols(), J1.getCols()) ; - I.setIdentity() ; + I.eye(J1.getCols(), J1.getCols()) ; - I_WpW = (I - WpW) ; + computeProjectionOperators() ; } - catch(vpMatrixException me) - { - vpERROR_TRACE("Caught a matrix related error") ; - std::cout << me << std::endl ; - throw me; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw me ; + catch(...) { + throw; } iteration++ ; @@ -1327,8 +1303,7 @@ vpColVector vpServo::computeControlLaw(double t, const vpColVector &e_dot_init) */ e1 = J1p*error ;// primary task - WpW.resize(J1.getCols(), J1.getCols()) ; - WpW.setIdentity() ; + WpW.eye(J1.getCols(), J1.getCols()) ; } else { @@ -1366,36 +1341,70 @@ vpColVector vpServo::computeControlLaw(double t, const vpColVector &e_dot_init) vpMatrix I ; - I.resize(J1.getCols(), J1.getCols()) ; - I.setIdentity() ; + I.eye(J1.getCols(), J1.getCols()) ; - I_WpW = (I - WpW) ; - } - catch(vpMatrixException me) - { - vpERROR_TRACE("Caught a matrix related error") ; - std::cout << me << std::endl ; - throw me; + computeProjectionOperators(); } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw me ; + catch(...) { + throw; } iteration++ ; return e ; } +void vpServo::computeProjectionOperators() +{ + // Initialization + unsigned int n = J1.getCols(); + P.resize(n,n); + + vpMatrix I; + I.eye(n); + + //Compute classical projection operator + I_WpW = (I - WpW) ; + + // Compute gain depending by the task error to ensure a smooth change between the operators. + double e0_ = 0.1; + double e1_ = 0.7; + double sig = 0.0; + + double norm_e = error.euclideanNorm() ; + if (norm_e > e1_) + sig = 1.0; + else if (e0_ <= norm_e && norm_e <= e1_ ) + sig = 1.0 / (1.0 + exp(-12.0 * ( (norm_e-e0_)/((e1_-e0_))) + 6.0 ) ); + else + sig = 0.0; + + vpMatrix J1t = J1.transpose(); + + double pp = (error.t() * (J1 * J1t) * error); + + vpMatrix ee_t(n,n); + ee_t = error * error.t(); + + vpMatrix P_norm_e(n,n); + P_norm_e = I - (1.0 / pp ) * J1t * ee_t * J1; + + P = sig * P_norm_e + (1 - sig) * I_WpW; + + return; +} /*! - Compute and return the secondary task vector according to the projection operator \f${\bf I-W^+W}\f$. For more details, - see equation(7) in the paper \cite Marchand05b. + Compute and return the secondary task vector according to the classic projection operator \f${\bf I-W^+W}\f$ (see equation(7) in the paper \cite Marchand05b) + or the new large projection operator (see equation(24) in the paper \cite Marey:2010). \param de2dt : Value of \f$\frac{\partial {\bf e_2}}{\partial t}\f$ the derivative of the secondary task \f${\bf e}_2\f$. + \param useLargeProjectionOperator : if true will be use the large projection operator, if false the classic one (default). + + \return The secondary task vector. + + If the classic projection operator is used ( useLargeProjectionOperator = false (default value)) this function return: - \return The secondary task vector: \f[ + \f[ ({\bf I-W^+W})\frac{\partial {\bf e_2}}{\partial t} \f] @@ -1404,54 +1413,93 @@ vpColVector vpServo::computeControlLaw(double t, const vpColVector &e_dot_init) -\lambda {\bf W^+W {\widehat {\bf J}}_e^+({\bf s-s^*})} \f] - \warning computeControlLaw() must be call prior to this function since it updates the projection operator \f$ \bf W^+W \f$. + Otherwise if the new large projection operator is used ( useLargeProjectionOperator = true ) this function return: + + \f[ + {\bf P}\frac{\partial {\bf e_2}}{\partial t} + \f] + + where + + \f[ + {\bf P} =\bar{\lambda }\left ( \left \| {\bf e} \right \| \right ){\bf P}_{ \left \| {\bf e } \right \| } \left ( 1 - \bar{\lambda }\left ( \left \| {\bf e } \right \| \right ) \right ) \left ( {\bf I-W^+W}\right ) + \f] + + with + + \f[ + {\bf P}_{\left \| {\bf e } \right \| } = I_{n} - \frac{1}{{\bf e }^\top {\bf J_{{\bf e }} } {\bf J_{{\bf e }}^\top }{\bf e }}{\bf J_{{\bf e }}^\top }{\bf e }{\bf e }^\top{\bf J_{{\bf e }} } + \f] + + \warning computeControlLaw() must be call prior to this function since it updates the projection operators. + + The following sample code shows how to use this method to compute a secondary task using the classic projection operator: + \code + vpColVector v; // Velocity applied to the robot + vpColVector de2dt; + vpServo task; + ... + v = task.computeControlLaw(); // Compute the primary task + v += task.secondaryTask(de2dt) // Compute and add the secondary task using the classical projection operator + \endcode - The following sample code shows how to use this method: + The following sample code shows how to use this method to compute a secondary task using the large projection operator: \code vpColVector v; // Velocity applied to the robot vpColVector de2dt; vpServo task; ... v = task.computeControlLaw(); // Compute the primary task - v += task.secondaryTask(de2dt) // Compute and add the secondary task + v += task.secondaryTask(de2dt, true) // Compute and add the secondary task using the large projection operator \endcode \sa computeControlLaw() */ -vpColVector vpServo::secondaryTask(const vpColVector &de2dt) +vpColVector vpServo::secondaryTask(const vpColVector &de2dt, const bool &useLargeProjectionOperator) { - if (rankJ1 == J1.getCols()) - { - vpERROR_TRACE("no degree of freedom is free, cannot use secondary task") ; - throw(vpServoException(vpServoException::noDofFree, - "no degree of freedom is free, cannot use secondary task")) ; - } - else + vpColVector sec ; + + if (!useLargeProjectionOperator) { - vpColVector sec ; + if (rankJ1 == J1.getCols()) + { + vpERROR_TRACE("no degree of freedom is free, cannot use secondary task") ; + throw(vpServoException(vpServoException::noDofFree, + "no degree of freedom is free, cannot use secondary task")) ; + } + else + { #if 0 - // computed in computeControlLaw() - vpMatrix I ; + // computed in computeControlLaw() + vpMatrix I ; - I.resize(J1.getCols(),J1.getCols()) ; - I.setIdentity() ; - I_WpW = (I - WpW) ; + I.resize(J1.getCols(),J1.getCols()) ; + I.setIdentity() ; + I_WpW = (I - WpW) ; #endif - // std::cout << "I-WpW" << std::endl << I_WpW <<std::endl ; - sec = I_WpW*de2dt ; - - return sec ; + // std::cout << "I-WpW" << std::endl << I_WpW <<std::endl ; + sec = I_WpW*de2dt ; + } } + + else + sec = P*de2dt; + + return sec ; } /*! - Compute and return the secondary task vector according to the projection operator \f${\bf I-W^+W}\f$. For more details, - see equation(7) in the paper \cite Marchand05b. + Compute and return the secondary task vector according to the classic projection operator \f${\bf I-W^+W}\f$ (see equation(7) in the paper \cite Marchand05b) + or the new large projection operator (see equation(24) in the paper \cite Marey:2010). \param e2 : Value of the secondary task \f${\bf e}_2\f$. \param de2dt : Value of \f$\frac{\partial {\bf e_2}}{\partial t}\f$ the derivative of the secondary task \f${\bf e}_2\f$. + \param useLargeProjectionOperator: if true will be use the large projection operator, if false the classic one (default). + + \return The secondary task vector. + + If the classic projection operator is used ( useLargeProjectionOperator = false (default value)) this function return: - \return The secondary task vector: \f[ -\lambda ({\bf I-W^+W}) {\bf e_2} + ({\bf I-W^+W})\frac{\partial {\bf e_2}}{\partial t} \f] @@ -1461,9 +1509,28 @@ vpColVector vpServo::secondaryTask(const vpColVector &de2dt) -\lambda {\bf W^+W {\widehat {\bf J}}_e^+({\bf s-s^*})} \f] - \warning computeControlLaw() must be call prior to this function since it updates the projection operator \f$ \bf W^+W \f$. - The following sample code shows how to use this method: + Otherwise if the new large projection operator is used ( useLargeProjectionOperator = true ) this function return: + + \f[ + -\lambda {\bf P} {\bf e_2} + {\bf P}\frac{\partial {\bf e_2}}{\partial t} + \f] + + where + + \f[ + {\bf P} =\bar{\lambda }\left ( \left \| {\bf e} \right \| \right ){\bf P}_{ \left \| {\bf e } \right \| } \left ( 1 - \bar{\lambda }\left ( \left \| {\bf e } \right \| \right ) \right ) \left ( {\bf I-W^+W}\right ) + \f] + + with + + \f[ + {\bf P}_{\left \| {\bf e } \right \| } = I_{n} - \frac{1}{{\bf e }^\top {\bf J_{{\bf e }} } {\bf J_{{\bf e }}^\top }{\bf e }}{\bf J_{{\bf e }}^\top }{\bf e }{\bf e }^\top{\bf J_{{\bf e }} } + \f] + + \warning computeControlLaw() must be call prior to this function since it updates the projection operators. + + The following sample code shows how to use this method to compute a secondary task using the classical projection operator: \code vpColVector v; // Velocity applied to the robot vpColVector e2; @@ -1471,38 +1538,174 @@ vpColVector vpServo::secondaryTask(const vpColVector &de2dt) vpServo task; ... v = task.computeControlLaw(); // Compute the primary task - v += task.secondaryTask(e2, de2dt) // Compute and add the secondary task + v += task.secondaryTask(e2, de2dt) // Compute and add the secondary task using the classical projection operator \endcode + The following sample code shows how to use this method to compute a secondary task using the large projection operator: + \code + vpColVector v; // Velocity applied to the robot + vpColVector e2; + vpColVector de2dt; + vpServo task; + ... + v = task.computeControlLaw(); // Compute the primary task + v += task.secondaryTask(e2, de2dt, true) // Compute and add the secondary task using the large projection operator + \endcode + + \sa computeControlLaw() */ -vpColVector vpServo::secondaryTask(const vpColVector &e2, const vpColVector &de2dt) +vpColVector vpServo::secondaryTask(const vpColVector &e2, const vpColVector &de2dt, const bool &useLargeProjectionOperator) { - if (rankJ1 == J1.getCols()) + vpColVector sec ; + + if (!useLargeProjectionOperator) { - vpERROR_TRACE("no degree of freedom is free, cannot use secondary task") ; - throw(vpServoException(vpServoException::noDofFree, - "no degree of freedom is free, cannot use secondary task")) ; + if (rankJ1 == J1.getCols()) + { + vpERROR_TRACE("no degree of freedom is free, cannot use secondary task") ; + throw(vpServoException(vpServoException::noDofFree, + "no degree of freedom is free, cannot use secondary task")) ; + } + else + { + +#if 0 + // computed in computeControlLaw() + vpMatrix I ; + + I.resize(J1.getCols(),J1.getCols()) ; + I.setIdentity() ; + + I_WpW = (I - WpW) ; +#endif + + // To be coherent with the primary task the gain must be the same between + // primary and secondary task. + sec = -lambda(e1) *I_WpW*e2 + I_WpW *de2dt ; + + + } } else + sec = -lambda(e1) * P *e2 + P *de2dt ; + + + return sec ; +} + +/*! + Compute and return the secondary task vector for joint limit avoidance \cite Marey:2010b using the + new large projection operator (see equation(24) in the paper \cite Marey:2010). The robot avoids the + joint limits very smoothly even when the main task constrains all the robot degrees of freedom. + + \param q : Actual joint positions vector + \param dq : Actual joint velocities vector + \param qmin : Vector containing the low limit value of each joint in the chain. + \param qmax : Vector containing the high limit value of each joint in the chain. + \param rho : tuning paramenter \f${\left [ 0,\frac{1}{2} \right ]}\f$ used to define the safe configuration for the joint. When + the joint angle value cross the max or min boundaries (\f${ q_{l_{0}}^{max} }\f$ and \f${q_{l_{0}}^{min}}\f$) the secondary + task is actived gradually. + \param rho1 : tuning paramenter \f${\left ] 0,1 \right ]}\f$ to compute the external boundaries (\f${q_{l_{1}}^{max}}\f$ and + \f${q_{l_{1}}^{min}}\f$) for the joint limits. Here the secondary task it completely activated with the highest gain. + \param lambda_tune : value \f${\left [ 0,1 \right ]}\f$ used to tune the difference in magnitude between the absolute value of the + elements of the primary task and the elements of the secondary task. (See equation (17) \cite Marey:2010b ) + +\code +vpServo task; +vpColVector qmin; +vpColVector qmax; +vpColVector q; +vpColVector dq; +// Fill vector qmin and qmax with min and max limits of the joints (same joint order than vector q). +// Update vector of joint position q and velocities dq; +... +vpColVector v = task.computeControlLaw(); // Compute the velocity corresponding to the visual servoing +v += task.secondaryTaskJointLimitAvoidance(q, dq, qmin, qmax) // Compute and add the secondary task for the joint +limit avoidance using the large projection operator +\endcode + + */ +vpColVector vpServo::secondaryTaskJointLimitAvoidance(const vpColVector &q, const vpColVector &dq, + const vpColVector &qmin, const vpColVector &qmax, + const double &rho, const double &rho1, const double &lambda_tune) const +{ + unsigned int const n = J1.getCols(); + + if (qmin.size() != n || qmax.size() != n ) { - vpColVector sec ; -#if 0 - // computed in computeControlLaw() - vpMatrix I ; + std::stringstream msg; + msg << "Dimension vector qmin (" << qmin.size() << ") or qmax () does not correspond to the number of jacobian columns"; + msg << "qmin size: " << qmin.size() << std::endl; + throw(vpServoException(vpServoException::dimensionError,msg.str())) ; + } + if (q.size() != n || dq.size() != n ) + { + vpERROR_TRACE("Dimension vector q or dq does not correspont to the number of jacobian columns") ; + throw(vpServoException(vpServoException::dimensionError, + "Dimension vector q or dq does not correspont to the number of jacobian columns")) ; + } - I.resize(J1.getCols(),J1.getCols()) ; - I.setIdentity() ; + double lambda_l = 0.0; - I_WpW = (I - WpW) ; -#endif + vpColVector q2 (n); + + vpColVector q_l0_min(n); + vpColVector q_l0_max(n); + vpColVector q_l1_min(n); + vpColVector q_l1_max(n); + + // Computation of gi ([nx1] vector) and lambda_l ([nx1] vector) + vpMatrix g(n,n); + vpColVector q2_i(n); + + for(unsigned int i = 0; i < n; i++) + { + q_l0_min[i] = qmin[i] + rho *(qmax[i] - qmin[i]); + q_l0_max[i] = qmax[i] - rho *(qmax[i] - qmin[i]); + + q_l1_min[i] = q_l0_min[i] - rho * rho1 * (qmax[i] - qmin[i]); + q_l1_max[i] = q_l0_max[i] + rho * rho1 * (qmax[i] - qmin[i]); + + if (q[i] < q_l0_min[i] ) + g[i][i] = -1; + else if (q[i] > q_l0_max[i] ) + g[i][i] = 1; + else + g[i][i]= 0; + } + + for(unsigned int i = 0; i < n; i++) + { + if (q[i] > q_l0_min[i] && q[i] < q_l0_max[i]) + q2_i = 0 * q2_i; + + else + { + vpColVector Pg_i(n); + Pg_i = (P * g.getCol(i)); + double b = ( vpMath::abs(dq[i]) )/( vpMath::abs( Pg_i[i] ) ); + + if (b < 1.) // If the ratio b is big we don't activate the joint avoidance limit for the joint. + { + if (q[i] < q_l1_min[i] || q[i] > q_l1_max[i] ) + q2_i = - (1 + lambda_tune) * b * Pg_i; + + else + { + if (q[i] >= q_l0_max[i] && q[i] <= q_l1_max[i] ) + lambda_l = 1 / (1 + exp(-12 *( (q[i] - q_l0_max[i]) / (q_l1_max[i] - q_l0_max[i]) ) + 6 ) ); - // To be coherent with the primary task the gain must be the same between - // primary and secondary task. - sec = -lambda(e1) *I_WpW*e2 + I_WpW *de2dt ; + else if (q[i] >= q_l1_min[i] && q[i] <= q_l0_min[i]) + lambda_l = 1 / (1 + exp(-12 *( (q[i] - q_l0_min[i]) / (q_l1_min[i] - q_l0_min[i]) ) + 6 ) ); - return sec ; + q2_i = - lambda_l * (1 + lambda_tune)* b * Pg_i; + } + } + } + q2 = q2 + q2_i; } + return q2; } /*! @@ -1522,6 +1725,25 @@ vpMatrix vpServo::getI_WpW() const return I_WpW; } + +/*! + Return the large projection operator. This operator is updated + after a call of computeControlLaw(). + +\code + vpServo task; + ... + vpColVector v = task.computeControlLaw(); // Compute the velocity corresponding to the visual servoing + vpMatrix P = task.getP(); // Get the large projection operator +\endcode + \sa getP() + */ +vpMatrix vpServo::getLargeP() const +{ + return P; +} + + /*! Return the task jacobian \f$J\f$. The task jacobian is updated after a call of computeControlLaw(). diff --git a/src/servo/vpServoData.cpp b/modules/vs/src/vpServoData.cpp similarity index 84% rename from src/servo/vpServoData.cpp rename to modules/vs/src/vpServoData.cpp index 183bcc285fb03fffbd31c74dbdbe87fc0079382f..d9ce2f57f0bac6dace919ad12154bff5f2f2becb 100644 --- a/src/servo/vpServoData.cpp +++ b/modules/vs/src/vpServoData.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpServoData.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Save data during the task execution. * @@ -46,11 +42,11 @@ */ // Servo -#include <visp/vpServo.h> +#include <visp3/vs/vpServo.h> -#include <visp/vpServoData.h> -#include <visp/vpIoException.h> -#include <visp/vpIoTools.h> +#include <visp3/vs/vpServoData.h> +#include <visp3/core/vpIoException.h> +#include <visp3/core/vpIoTools.h> void vpServoData::open(const char *directory) diff --git a/src/servo/vpServoDisplay.cpp b/modules/vs/src/vpServoDisplay.cpp similarity index 87% rename from src/servo/vpServoDisplay.cpp rename to modules/vs/src/vpServoDisplay.cpp index b0f39606e5fac9b9e0cc1d2554e1621ad2a5fbea..37bfe0ac06ab1ae661ff5dd1d9262d4153eabea2 100644 --- a/src/servo/vpServoDisplay.cpp +++ b/modules/vs/src/vpServoDisplay.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: vpServoDisplay.cpp 4645 2014-02-05 17:44:06Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Interface with the image for feature display. * @@ -45,20 +41,20 @@ */ // Servo -#include <visp/vpServo.h> +#include <visp3/vs/vpServo.h> // Meter/pixel conversion -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpCameraParameters.h> //Color / image / display -#include <visp/vpColor.h> -#include <visp/vpImage.h> +#include <visp3/core/vpColor.h> +#include <visp3/core/vpImage.h> -#include <visp/vpDisplay.h> +#include <visp3/core/vpDisplay.h> -#include <visp/vpServoDisplay.h> +#include <visp3/vs/vpServoDisplay.h> -#include <visp/vpBasicFeature.h> +#include <visp3/visual_features/vpBasicFeature.h> /*! diff --git a/test/visual-feature/testFeature.cpp b/modules/vs/test/visual-feature/testFeature.cpp similarity index 76% rename from test/visual-feature/testFeature.cpp rename to modules/vs/test/visual-feature/testFeature.cpp index cd8a2cc8877fa99b69f51f174fbc2f8c28a5ab3f..f9ede734669f10a60de719043dbc373d4a8aa42e 100644 --- a/test/visual-feature/testFeature.cpp +++ b/modules/vs/test/visual-feature/testFeature.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testFeature.cpp 4574 2014-01-09 08:48:51Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Visual feature manipulation. * @@ -40,17 +36,17 @@ *****************************************************************************/ -#include <visp/vpColVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpServo.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpGenericFeature.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureThetaU.h> -#include <visp/vpDot2.h> -#include <visp/vpCameraParameters.h> +#include <visp3/core/vpColVector.h> +#include <visp3/core/vpTranslationVector.h> +#include <visp3/core/vpRotationMatrix.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vs/vpServo.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/visual_features/vpGenericFeature.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureThetaU.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/core/vpCameraParameters.h> #include <iostream> diff --git a/test/visual-feature/testFeatureMoment.cpp b/modules/vs/test/visual-feature/testFeatureMoment.cpp similarity index 91% rename from test/visual-feature/testFeatureMoment.cpp rename to modules/vs/test/visual-feature/testFeatureMoment.cpp index cfd2ada0b59199af3e3f87842068fbcfcfe7208a..dc8d788017d7c55cca9d5e84e9a0b6ce1fa7c791 100644 --- a/test/visual-feature/testFeatureMoment.cpp +++ b/modules/vs/test/visual-feature/testFeatureMoment.cpp @@ -1,9 +1,7 @@ /**************************************************************************** - * - * $Id: testFeatureMoment.cpp 3323 2011-09-13 15:23:56Z fnovotny $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. + * See http://visp.inria.fr for more information. * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr + * Inria at visp@inria.fr * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Example of visual servoing with moments using a polygon as object container * @@ -38,14 +34,14 @@ * Filip Novotny * *****************************************************************************/ -#include <visp/vpMomentObject.h> -#include <visp/vpMomentDatabase.h> -#include <visp/vpMomentCommon.h> -#include <visp/vpFeatureMomentCommon.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpServo.h> -#include <visp/vpDebug.h> -#include <visp/vpPlane.h> +#include <visp3/core/vpMomentObject.h> +#include <visp3/core/vpMomentDatabase.h> +#include <visp3/core/vpMomentCommon.h> +#include <visp3/visual_features/vpFeatureMomentCommon.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/vs/vpServo.h> +#include <visp3/core/vpDebug.h> +#include <visp3/core/vpPlane.h> #include <limits> #include <iostream> @@ -140,8 +136,7 @@ void initScene(const vpHomogeneousMatrix& cMo, const vpHomogeneousMatrix& cdMo, int nbpoints = 4; for (int i = 0 ; i < nbpoints ; i++){ - vpPoint p; - p.setWorldCoordinates(x[i],y[i],0.0); + vpPoint p(x[i],y[i],0.0); p.track(cMo) ; src_pts.push_back(p); } @@ -149,8 +144,7 @@ void initScene(const vpHomogeneousMatrix& cMo, const vpHomogeneousMatrix& cdMo, src.setType(vpMomentObject::DENSE_POLYGON); src.fromVector(src_pts); for (int i = 0 ; i < nbpoints ; i++){ - vpPoint p; - p.setWorldCoordinates(x[i],y[i],0.0); + vpPoint p(x[i],y[i],0.0); p.track(cdMo) ; dst_pts.push_back(p); } diff --git a/test/visual-feature/testFeatureSegment.cpp b/modules/vs/test/visual-feature/testFeatureSegment.cpp similarity index 83% rename from test/visual-feature/testFeatureSegment.cpp rename to modules/vs/test/visual-feature/testFeatureSegment.cpp index 855035acd587688110b8f1af23d375cebb89972f..9e9db762770031c11af6556608eda79aa365b75d 100644 --- a/test/visual-feature/testFeatureSegment.cpp +++ b/modules/vs/test/visual-feature/testFeatureSegment.cpp @@ -1,10 +1,8 @@ /**************************************************************************** - * - * $Id: testFeature.cpp 3530 2012-01-03 10:52:12Z fspindle $ * * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * + * Copyright (C) 2005 - 2015 by Inria. All rights reserved. + * * This software is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * ("GPL") version 2 as published by the Free Software Foundation. @@ -12,25 +10,23 @@ * distribution for additional information about the GNU GPL. * * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional + * GPL, please contact Inria about acquiring a ViSP Professional * Edition License. * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * + * See http://visp.inria.fr for more information. + * * This software was developed at: - * INRIA Rennes - Bretagne Atlantique + * Inria Rennes - Bretagne Atlantique * Campus Universitaire de Beaulieu * 35042 Rennes Cedex * France - * http://www.irisa.fr/lagadic * * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * + * Inria at visp@inria.fr + * * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * * Description: * Visual feature manipulation (segment). * @@ -44,21 +40,24 @@ #include <vector> #include <numeric> -#include <visp/vpConfig.h> -#include <visp/vpCameraParameters.h> -#include <visp/vpDisplay.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayX.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureSegment.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpImage.h> -#include <visp/vpMath.h> -#include <visp/vpParseArgv.h> -#include <visp/vpPlot.h> -#include <visp/vpPoint.h> -#include <visp/vpRobotCamera.h> -#include <visp/vpServo.h> //visual servoing task +#include <visp3/core/vpConfig.h> + +#ifdef VISP_HAVE_MODULE_ROBOT + +#include <visp3/core/vpCameraParameters.h> +#include <visp3/core/vpDisplay.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureSegment.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/core/vpImage.h> +#include <visp3/core/vpMath.h> +#include <visp3/io/vpParseArgv.h> +#include <visp3/gui/vpPlot.h> +#include <visp3/core/vpPoint.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/vs/vpServo.h> //visual servoing task /*! @@ -125,8 +124,10 @@ int main(int argc, const char **argv) display->init(I); #endif + vpHomogeneousMatrix wMo; // Set to indentity. Robot world frame is equal to object frame vpHomogeneousMatrix cMo (-0.5, 0.5, 4., vpMath::rad(10), vpMath::rad(20), vpMath::rad(90)); vpHomogeneousMatrix cdMo(0., 0., 1., vpMath::rad(0), vpMath::rad(0), vpMath::rad(0)); + vpHomogeneousMatrix wMc; // Camera location in the robot world frame vpPoint P[4]; // 4 points in the object frame P[0].setWorldCoordinates( .1, .1, 0.); @@ -198,15 +199,17 @@ int main(int argc, const char **argv) #endif //param robot - vpRobotCamera robot ; - float sampling_time = 0.010f ; // Sampling period in seconds - robot.setSamplingTime(sampling_time) ; - robot.setPosition(cMo) ; + vpSimulatorCamera robot; + float sampling_time = 0.010f; // Sampling period in seconds + robot.setSamplingTime(sampling_time); + wMc = wMo * cMo.inverse(); + robot.setPosition(wMc); int iter=0; - do{ + do { double t = vpTime::measureTimeMs(); - robot.getPosition(cMo); + wMc = robot.getPosition(); + cMo = wMc.inverse() * wMo; for (int i=0; i <4; i++) Pc[i].project(cMo); @@ -261,3 +264,12 @@ int main(int argc, const char **argv) return 1; } } + +#else +int main() +{ + std::cout << "Test empty since visp_robot module is not available.\n" << std::endl; + return 0; +} + +#endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index b1cd872d8c65a1d4ff9f99251bd24eb313eccf76..0000000000000000000000000000000000000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,133 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4971 2014-11-16 13:01:59Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# This file creates the ViSP library. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -#---------------------------------------------------------------------- -# Include project files -#---------------------------------------------------------------------- -# include all the ViSP project .cpp files -include(${VISP_SOURCE_DIR}/CMakeSourceFileList.cmake) -# include all the ViSP project .h files -include(${VISP_SOURCE_DIR}/CMakeHeaderFileList.cmake) - -#---------------------------------------------------------------------- -# Create rule to copy all the headers from src to include/visp -#---------------------------------------------------------------------- -# For each header, we create a rule -set(HEADER_IN_INCLUDE_DIR "") -foreach(header_ ${HEADER_ALL}) - get_filename_component(headerName ${header_} NAME) - add_custom_command( - OUTPUT ${VISP_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/visp/${headerName} - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${header_} ${VISP_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/visp/${headerName} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${header_} - ) - set(HEADER_IN_INCLUDE_DIR ${HEADER_IN_INCLUDE_DIR} ${VISP_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}/visp/${headerName} - ) -endforeach() - -#---------------------------------------------------------------------- -# Create a top level rule to copy all the headers from src to include/visp -#---------------------------------------------------------------------- -add_custom_target(header ALL - DEPENDS ${HEADER_IN_INCLUDE_DIR} - ) - -#---------------------------------------------------------------------- -# build rule for the library -#---------------------------------------------------------------------- - -if(POLICY CMP0042) - cmake_policy(SET CMP0042 NEW) -endif() - -add_library(${VISP_INTERN_LIBRARY} - ${SRC_ALL} - ${HEADER_ALL} ${VISP_INCLUDE_DIR}/vpConfig.h) - -# create the headers in include/visp before compiling the lib -add_dependencies(${VISP_INTERN_LIBRARY} header) - -# extra target -add_dependencies(visp_library ${VISP_INTERN_LIBRARY}) - -# Append the library version information to the library target -# properties. -set_target_properties(${VISP_INTERN_LIBRARY} PROPERTIES - VERSION ${VISP_VERSION} - SOVERSION ${VISP_VERSION_MAJOR}.${VISP_VERSION_MINOR} - PUBLIC_HEADER "${HEADER_ALL};${VISP_INCLUDE_DIR}/vpConfig.h" - OUTPUT_NAME "${VISP_INTERN_LIBRARY}${VISP_DLLVERSION}" - DEBUG_POSTFIX "${VISP_DEBUG_POSTFIX}" - RUNTIME_OUTPUT_DIRECTORY "${BINARY_OUTPUT_PATH}" - LIBRARY_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_PATH}" - ARCHIVE_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_PATH}" - ) -set_property(TARGET ${VISP_INTERN_LIBRARY} APPEND PROPERTY - INTERFACE_INCLUDE_DIRECTORIES ${VISP_EXTERN_INCLUDE_DIRS} -) -if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${VISP_INTERN_LIBRARY} PROPERTIES FOLDER "library") - set_target_properties(header PROPERTIES FOLDER "library") -endif() - - - -# Link with external libs especially under windows for winmm.lib -# needed to create visp.dll. Why ? Because for binaries, winmm.lib -# is considered in the link stage. Probably a CMake bug ! -#IF(WIN32 AND BUILD_SHARED_LIBS AND HAVE_LIBWINMM) -# TARGET_LINK_LIBRARIES(${VISP_INTERN_LIBRARY} "winmm") -#ENDIF(WIN32 AND BUILD_SHARED_LIBS AND HAVE_LIBWINMM) -target_link_libraries(${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - -#---------------------------------------------------------------------- -# customize install target -#---------------------------------------------------------------------- -install( - TARGETS ${VISP_INTERN_LIBRARY} - EXPORT VISPTargets - # install rule for all the headers - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/visp - # Destination is either lib or lib64 on Unix 64 bits architectures - RUNTIME DESTINATION ${VISP_BIN_INSTALL_PATH} COMPONENT libraries - LIBRARY DESTINATION ${VISP_LIB_INSTALL_PATH} COMPONENT libraries - ARCHIVE DESTINATION ${VISP_LIB_INSTALL_PATH} COMPONENT libraries - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE -) diff --git a/src/math/matrix/vpColVector.cpp b/src/math/matrix/vpColVector.cpp deleted file mode 100644 index 7f35664fb295f9b36eb062256898039f84e37a05..0000000000000000000000000000000000000000 --- a/src/math/matrix/vpColVector.cpp +++ /dev/null @@ -1,863 +0,0 @@ -/**************************************************************************** - * - * $Id: vpColVector.cpp 5218 2015-01-28 10:27:40Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Provide some simple operation on column vectors. - * - * Authors: - * Eric Marchand - * - *****************************************************************************/ - - -/*! - \file vpColVector.cpp - \brief Class that provides a data structure for the column vectors as well - as a set of operations on these vectors -*/ - -#include <visp/vpColVector.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpDebug.h> -#include <visp/vpRotationVector.h> - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <cmath> // std::fabs -#include <limits> // numeric_limits -#include <string.h> //EM gcc 4.3 -#include <math.h> //EM gcc 4.3 - - //! operator addition of two vectors -vpColVector -vpColVector::operator+(const vpColVector &m) const -{ - if (getRows() != m.getRows() ) { - throw(vpException(vpException::dimensionError, - "Bad size during vpColVector (%dx1) and vpColVector (%dx1) addition", - getRows(), m.getRows())) ; - } - vpColVector v(rowNum); - - for (unsigned int i=0;i<rowNum;i++) - v[i] = (*this)[i] + m[i]; - return v; -} - -//! operator dot product -double -vpColVector::operator*(const vpColVector &m) const -{ - double v = 0 ; - - for (unsigned int i=0;i<rowNum;i++) - v += (*this)[i] * m[i]; - return v; -} - -//! operator dot product -vpMatrix vpColVector::operator*(const vpRowVector &m) const -{ - - return (vpMatrix)*this*(vpMatrix)m; -} - - //! operator substraction of two vectors V = A-v -vpColVector vpColVector::operator-(const vpColVector &m) const -{ - if (getRows() != m.getRows() ) { - throw(vpException(vpException::dimensionError, - "Bad size during vpColVector (%dx1) and vpColVector (%dx1) substraction", - getRows(), m.getRows())) ; - } - vpColVector v(rowNum); - - for (unsigned int i=0;i<rowNum;i++) - v[i] = (*this)[i] - m[i]; - return v; -} - -vpColVector::vpColVector (vpColVector &m, unsigned int r, unsigned int nrows) -{ - if ( (r+nrows) > m.getRows() ) - { - vpERROR_TRACE("\n\t\t SubvpMatrix larger than vpMatrix") ; - throw(vpMatrixException(vpMatrixException::subMatrixError, - "\n\t\t SubvpMatrix larger than vpColVector")) ; - } - init(m, r, 0, nrows, 1); -} - - -vpColVector::vpColVector (const vpRotationVector &v){ - resize(v._size); - memcpy(data, v.r, v._size*sizeof(double)) ; -} - - - //! Operator A = -A -vpColVector vpColVector::operator-() const -{ - vpColVector A ; - try { - A.resize(rowNum) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - - double *vd = A.data ; double *d = data ; - - for (unsigned int i=0; i<rowNum; i++) - *(vd++)= - (*d++); - - return A; -} - -//! operator multiplication by a scalar V = A * x -vpColVector vpColVector::operator*(double x) const -{ - vpColVector v; - try { - v.resize(rowNum) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - - double *vd = v.data ; double *d = data ; - - for (unsigned int i=0;i<rowNum;i++) - *(vd++)= (*d++) * x; - return v; -} - -/*! - Copy from a matrix - \warning Handled with care m should be a 1 row matrix. -*/ -vpColVector &vpColVector::operator=(const vpMatrix &m) -{ - if (m.getCols() !=1) - { - vpTRACE(" m should be a 1 cols matrix ") ; - throw (vpException(vpException::dimensionError,"m should be a 1 cols matrix ")); - } - - try { - resize(m.getRows()); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - - memcpy(data, m.data, rowNum*sizeof(double)) ; - - /* - double *md = m.data ; double *d = data ; - for (int i=0;i<rowNum;i++) - *(d++)= *(md++) ; - */ - /* - for (int i=0; i<rowNum; i++) { - for (int j=0; j<colNum; j++) { - rowPtrs[i][j] = m.rowPtrs[i][j]; - } - }*/ - return *this; -} - - //! Copy operator. Allow operation such as A = v -vpColVector &vpColVector::operator=(const vpColVector &v) -{ - unsigned int k = v.rowNum ; - if (rowNum != k){ - try { - resize(k); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - } - // - - memcpy(data, v.data, rowNum*sizeof(double)) ; - /* - double *vd = m.data ; double *d = data ; - for (int i=0;i<rowNum;i++) - *(d++)= *(vd++) ; - - - for (int i=0; i<rowNum; i++) { - for (int j=0; j<colNum; j++) { - rowPtrs[i][j] = v.rowPtrs[i][j]; - } - } -*/ - return *this; -} - -/*! - Copy operator. - Allows operation such as A << v - \code -#include <visp/vpColVector.h> - -int main() -{ - vpColVector A, B(5); - for (unsigned int i=0; i<B.size(); i++) - B[i] = i; - A << B; - std::cout << "A: \n" << A << std::endl; -} - \endcode - In column vector A we get: - \code -A: -0 -1 -2 -3 -4 - \endcode - */ -vpColVector & vpColVector::operator<<(const vpColVector &v) -{ - *this = v; - return *this; -} - -/*! - Assigment operator. Allow operation such as A = *v - - The following example shows how to use this operator. - \code -#include <visp/vpColVector.h> - -int main() -{ - size_t n = 5; - vpColVector A(n); - double *B = new double [n]; - for (unsigned int i = 0; i < n; i++) - B[i] = i; - A << B; - std::cout << "A: \n" << A << std::endl; - delete [] B; -} - \endcode - It produces the following output: - \code -A: -0 -1 -2 -3 -4 - \endcode - */ -vpColVector & vpColVector::operator<<( double *x ) -{ - for (unsigned int i=0; i<rowNum; i++) { - for (unsigned int j=0; j<colNum; j++) { - rowPtrs[i][j] = *x++; - } - } - return *this; -} - -//! initialisation each element of the vector is x -vpColVector & vpColVector::operator=(double x) -{ - double *d = data ; - - for (unsigned int i=0;i<rowNum;i++) - *(d++)= x ; - /* - for (int i=0; i<rowNum; i++) { - for (int j=0; j<colNum; j++) { - rowPtrs[i][j] = x; - } - }*/ - return *this; -} - -/* - \brief Transpose the row vector A - - A is defined inside the class - - \return A^T -*/ -vpRowVector vpColVector::t() const -{ - vpRowVector v ; - try { - v.resize(rowNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - memcpy(v.data, data, rowNum*sizeof(double)) ; - /* - // premiere optimisation - double *vd = m.data ; double *d = data ; - for (int i=0;i<rowNum;i++) - *(d++)= *(vd++) ; - */ - - /* - // solution brute - for (int i=0;i<rowNum;i++) - v[i] = (*this)[i]; - */ - return v; -} -/*! - \relates vpColVector - \brief multiplication by a scalar Ci = x*Bi -*/ -vpColVector operator*(const double &x,const vpColVector &B) -{ - vpColVector v1 ; - v1 = B*x ; - return v1 ; -} - -vpColVector::vpColVector (const vpColVector &v) : vpMatrix(v) -{ -} - -vpColVector::vpColVector (vpMatrix &m, unsigned int j) : vpMatrix(m, 0, j, m.getRows(), 1) -{ -} - - -/*! - \relates vpColVector - \brief compute the dot product of two vectors C = a.b -*/ -double -vpColVector::dotProd(const vpColVector &a, const vpColVector &b) -{ - if (a.data==NULL) - { - vpERROR_TRACE("vpColVector a non initialized") ; - throw(vpMatrixException(vpMatrixException::notInitializedError)) ; - } - if (b.data==NULL) - { - vpERROR_TRACE("vpColVector b non initialized") ; - throw(vpMatrixException(vpMatrixException::notInitializedError)) ; - } - double *ad = a.data ; double *bd = b.data ; - - double c = 0 ; - for (unsigned int i=0 ; i < a.getRows() ; i++) - c += *(ad++)* *(bd++) ; - // vpMatrix c = (a.t() * b); - // return c[0][0]; - return c ; -} - -/*! - \relates vpColVector - \brief normalise the vector - - \f[ - {\bf x}_i = \frac{{\bf x}_i}{\sqrt{\sum_{i=1}^{n}x^2_i}} - \f] -*/ -// vpColVector &vpColVector::normalize(vpColVector &x) const -// { -// x = x/sqrt(x.sumSquare()); - -// return x; -// } - - -/*! - \relates vpColVector - \brief normalise the vector - - \f[ - {\bf x}_i = \frac{{\bf x}_i}{\sqrt{\sum_{i=1}^{n}x^2_i}} - \f] -*/ -vpColVector &vpColVector::normalize() -{ - - double sum_square = sumSquare() ; - - //if (sum != 0.0) - if (std::fabs(sum_square) > std::numeric_limits<double>::epsilon()) - *this /= sqrt(sum_square) ; - - // If sum = 0, we have a nul vector. So we return just. - return *this; -} - - - -vpColVector -vpColVector::invSort(const vpColVector &v) -{ - if (v.data==NULL) - { - vpERROR_TRACE("vpColVector v non initialized") ; - throw(vpMatrixException(vpMatrixException::notInitializedError)) ; - } - vpColVector tab ; - tab = v ; - unsigned int nb_permutation = 1 ; - unsigned int i = 0 ; - while (nb_permutation !=0 ) - { - nb_permutation = 0 ; - for (unsigned int j = v.getRows()-1 ; j >= i+1 ; j--) - { - if ((tab[j]>tab[j-1])) - { - double tmp = tab[j] ; - tab[j] = tab[j-1] ; - tab[j-1] = tmp ; - nb_permutation++ ; - } - } - i++ ; - } - - return tab ; -} - -vpColVector -vpColVector::sort(const vpColVector &v) -{ - if (v.data==NULL) { - vpERROR_TRACE("vpColVector a non initialized") ; - throw(vpMatrixException(vpMatrixException::notInitializedError)) ; - } - vpColVector tab ; - tab = v ; - unsigned int nb_permutation = 1 ; - unsigned int i = 0 ; - while (nb_permutation !=0 ) - { - nb_permutation = 0 ; - for (unsigned int j = v.getRows()-1 ; j >= i+1 ; j--) - { - if ((tab[j]<tab[j-1])) - { - double tmp = tab[j] ; - tab[j] = tab[j-1] ; - tab[j-1] = tmp ; - nb_permutation++ ; - } - } - i++ ; - } - - return tab ; -} - -/*! - Stack column vector with new element. - - \param b : Element to stack to the existing one. - - \code - vpColVector A(3); - double b = 3; - A.stack(b); // A = [A b]T - // A is now an 4 dimension column vector - \endcode - - \sa stack(const vpColVector &, const vpColVector &) - \sa stack(const vpColVector &, const vpColVector &, vpColVector &) - -*/ -void vpColVector::stack(const double &b) -{ - this->resize(rowNum+1,false); - (*this)[rowNum-1] = b; -} - -/*! - Stack column vectors. - - \param B : Vector to stack to the existing one. - - \code - vpColVector A(3); - vpColVector B(5); - A.stack(B); // A = [A B]T - // A is now an 8 dimension column vector - \endcode - - \sa stack(const vpColVector &, const double &) - \sa stack(const vpColVector &, const vpColVector &) - \sa stack(const vpColVector &, const vpColVector &, vpColVector &) - -*/ -void vpColVector::stack(const vpColVector &B) -{ - *this = vpColVector::stack(*this, B); -} - -/*! - Stack column vectors. - - \param A : Initial vector. - \param B : Vector to stack at the end of A. - \return Stacked vector \f$[A B]^T\f$. - - \code - vpColVector A(3); - vpColVector B(5); - vpColVector C; - C = vpColVector::stack(A, B); // C = [A B]T - // C is now an 8 dimension column vector - \endcode - - \sa stack(const vpColVector &) - \sa stack(const vpColVector &, const vpColVector &, vpColVector &) -*/ -vpColVector vpColVector::stack(const vpColVector &A, const vpColVector &B) -{ - vpColVector C; - vpColVector::stack(A, B, C); - return C; -} - -/*! - Stack column vectors. - - \param A : Initial vector. - \param B : Vector to stack at the end of A. - \param C : Resulting stacked vector \f$C = [A B]^T\f$. - - \code - vpColVector A(3); - vpColVector B(5); - vpColVector C; - vpColVector::stack(A, B, C); // C = [A B]T - // C is now an 8 dimension column vector - \endcode - - \sa stack(const vpColVector &) - \sa stack(const vpColVector &, const vpColVector &) -*/ -void vpColVector::stack(const vpColVector &A, const vpColVector &B, vpColVector &C) -{ - unsigned int nrA = A.getRows(); - unsigned int nrB = B.getRows(); - - if (nrA == 0 && nrB == 0) { - C.resize(0); - return; - } - - if (nrB == 0) { - C = A; - return; - } - - if (nrA == 0) { - C = B; - return; - } - - // General case - C.resize(nrA + nrB); - - for (unsigned int i=0; i<nrA; i++) - C[i] = A[i]; - - for (unsigned int i=0; i<nrB; i++) - C[nrA+i] = B[i]; -} - -/*! - \brief Compute the mean value of all the element of the vector -*/ -double vpColVector::mean(const vpColVector &v) -{ - if (v.data==NULL) - { - vpERROR_TRACE("vpColVector v non initialized") ; - throw(vpMatrixException(vpMatrixException::notInitializedError)) ; - } - double mean = 0 ; - double *vd = v.data ; - for (unsigned int i=0 ; i < v.getRows() ; i++) - mean += *(vd++) ; - - /* - for (int i=0 ; i < v.getRows() ; i++) - { - mean += v[i] ; - } - mean /= v.rowNum ; - return mean; - */ - return mean/v.getRows(); -} - -/*! - Compute the median value of all the element of the vector -*/ -double -vpColVector::median(const vpColVector &v) -{ - if (v.data==NULL) - { - vpERROR_TRACE("vpColVector v non initialized") ; - throw(vpMatrixException(vpMatrixException::notInitializedError)) ; - } - - unsigned int i,j; - unsigned int inf, sup; - unsigned int n = v.getRows() ; - vpColVector infsup(n) ; - - for (i=0;i<v.getRows();i++) - { - // We compute the number of element gretear (sup) than the current - // value and the number of element smaller (inf) than the current - // value - inf = sup = 0; - for (j=0;j<v.getRows();j++) - { - if (i != j) - { - if (v[i] <= v[j]) inf++; - if (v[i] >= v[j]) sup++; - } - } - // We compute then difference between inf and sup - // the median should be for |inf-sup| = 0 (1 if an even number of element) - // which means that there are the same number of element in the array - // that are greater and smaller that this value. - infsup[i] = fabs((double)(inf-sup)); //EM gcc 4.3 - } - - // seek for the smaller value of |inf-sup| (should be 0 or 1) - unsigned int imin=0 ; // index of the median in the array - // min cannot be greater than the number of element - double min = v.getRows(); - for (i=0;i<v.getRows();i++) - if (infsup[i] < min) - { - min = infsup[i]; - imin = i ; - } - - // return the median - return(v[imin]); - -} - -/*! - Compute the skew symmetric matrix \f$[{\bf v}]_\times\f$ of vector v. - - \f[ \mbox{if} \quad {\bf V} = \left( \begin{array}{c} x \\ y \\ z - \end{array}\right), \quad \mbox{then} \qquad - [{\bf v}]_\times = \left( \begin{array}{ccc} - 0 & -z & y \\ - z & 0 & -x \\ - -y & x & 0 - \end{array}\right) - \f] - - \param v : Input vector used to compute the skew symmetric matrix. -*/ -vpMatrix -vpColVector::skew(const vpColVector &v) -{ - - vpMatrix M ; - if (v.getRows() != 3) - { - vpERROR_TRACE("Cannot compute skew kinematic matrix," - "v has not 3 rows") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t Cannot compute skew kinematic matrix" - "v has not 3 rows")) ; - } - - - M.resize(3,3) ; - M[0][0] = 0 ; M[0][1] = -v[2] ; M[0][2] = v[1] ; - M[1][0] = v[2] ; M[1][1] = 0 ; M[1][2] = -v[0] ; - M[2][0] = -v[1] ; M[2][1] = v[0] ; M[2][2] = 0 ; - - - return M ; -} - -/*! - \brief Compute the cross product of two vectors C = a x b - - \param a : vpColVector - \param b : vpColVector -*/ -vpColVector vpColVector::crossProd(const vpColVector &a, const vpColVector &b) -{ - - if (a.getRows() != 3) - { - vpERROR_TRACE("Cannot compute cross product," - "a has not 3 rows") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t Cannot compute cross product" - "a has not 3 rows")) ; - } - if (b.getRows() != 3) - { - - vpERROR_TRACE("Cannot compute cross product," - "b has not 3 rows") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t Cannot compute cross product" - "b has not 3 rows")) ;; - } - - return vpColVector::skew(a) * b; -} - - -/*! - \brief reshape the colvector in a matrix - \param nrows : number of rows of the matrix - \param ncols : number of columns of the matrix - \return a vpMatrix -*/ -vpMatrix vpColVector::reshape(const unsigned int &nrows,const unsigned int &ncols){ - vpMatrix m(nrows,ncols); - reshape(m,nrows,ncols); - return m; -} - -/*! - \brief reshape the colvector in a matrix - \param m : the reshaped Matrix - \param nrows : number of rows of the matrix - \param ncols : number of columns of the matrix -*/ -void vpColVector::reshape(vpMatrix & m,const unsigned int &nrows,const unsigned int &ncols){ - if(dsize!=nrows*ncols) - { - vpERROR_TRACE("\n\t\t vpColVector mismatch size for reshape vpSubColVector in a vpMatrix") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpColVector mismatch size for reshape vpSubColVector in a vpMatrix")) ; - } - try - { - if ((m.getRows() != nrows) || (m.getCols() != ncols)) m.resize(nrows,ncols); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw ; - } - - for(unsigned int j =0; j< ncols; j++) - for(unsigned int i =0; i< nrows; i++) - m[i][j]=data[j*ncols+i]; -} - -/*! - Insert a column vector. - \param i : Index of the first element to introduce. This index starts from 0. - \param v : Column vector to insert. - - The following example shows how to use this function: - \code -#include <visp/vpColVector.h> - -int main() -{ - vpColVector v(4); - for (unsigned int i=0; i < v.size(); i++) - v[i] = i; - std::cout << "v:\n" << v << std::endl; - - vpColVector w(2); - for (unsigned int i=0; i < w.size(); i++) - w[i] = i+10; - std::cout << "w:\n" << w << std::endl; - - v.insert(1, w); - std::cout << "v:\n" << v << std::endl; -} - \endcode - It produces the following output: - \code -v: -0 -1 -2 -3 - -w: -10 -11 - -v: -0 -10 -11 -3 - \endcode - */ -void vpColVector::insert(unsigned int i, const vpColVector &v) -{ - if (i+v.size() > this->size()) - throw(vpException(vpException::dimensionError, "Unable to insert a column vector")); - for (unsigned int j=0; j < v.size(); j++) - (*this)[i+j] = v[j]; -} diff --git a/src/math/matrix/vpColVector.h b/src/math/matrix/vpColVector.h deleted file mode 100644 index b732f117e3237d40219071721dfa4b15de5a07cb..0000000000000000000000000000000000000000 --- a/src/math/matrix/vpColVector.h +++ /dev/null @@ -1,219 +0,0 @@ -/**************************************************************************** - * - * $Id: vpColVector.h 5185 2015-01-21 14:36:41Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Provide some simple operation on column vectors. - * - * Authors: - * Eric Marchand - * - *****************************************************************************/ - - - -#ifndef vpColVector_H -#define vpColVector_H - -#include <visp/vpMatrix.h> -#include <visp/vpRowVector.h> -#include <visp/vpMath.h> - -class vpMatrix; -class vpRotationVector; - -/*! - \file vpColVector.h - \brief definition of column vector class as well - as a set of operations on these vector -*/ - -/*! - \class vpColVector - \ingroup Matrix - \brief Class that provides a data structure for the column vectors - as well as a set of operations on these vectors. - - the vpColVector is derived from vpMatrix. - - \author Eric Marchand (Eric.Marchand@irisa.fr) Irisa / Inria Rennes - - \warning Note the vector in the class (*this) will be noted A in the comment -*/ -class VISP_EXPORT vpColVector : public vpMatrix -{ - friend class vpMatrix; -protected: - vpColVector (vpMatrix &m, unsigned int j); - vpColVector (vpColVector &m, unsigned int r, unsigned int nrows) ; - -public: - - //! Basic constructor. - vpColVector() : vpMatrix() {}; - //! Constructor of vector of size n. Each element is set to 0. - vpColVector(unsigned int n) : vpMatrix(n,1){}; - //! Constructor of vector of size n. Each element is set to \e val. - vpColVector(unsigned int n, double val) : vpMatrix(n, 1, val){}; - //! Copy constructor. - vpColVector (const vpColVector &v); - //! Constructor that initialize a vpColVector from a vpRotationVector. - vpColVector (const vpRotationVector &v); - - void insert(unsigned int i, const vpColVector &v); - - /*! Set the size of the column vector. - \param i : Column vector size. - \param flagNullify : If true, set the data to zero. - */ - void resize(const unsigned int i, const bool flagNullify = true) - { - vpMatrix::resize(i, 1, flagNullify); - } - - //! Access V[i] = x - inline double &operator [](unsigned int n) { return *(data + n); } - //! Access x = V[i] - inline const double &operator [](unsigned int n) const { return *(data+n); } - //! Copy operator. Allow operation such as A = v - vpColVector &operator=(const vpColVector &v); - // Copy from a matrix. - vpColVector &operator=(const vpMatrix &m); - //! Initialize each element of the vector to x - vpColVector &operator=(double x); - // Copy operator. Allow operation such as A << v - vpColVector &operator<<(const vpColVector &v); - // Assigment operator. Allow operation such as A = *v - vpColVector &operator<<(double *); - - //! Addition of two vectors V = A+v - vpColVector operator+(const vpColVector &v) const; - //! Substraction of two vectors V = A-v - vpColVector operator-(const vpColVector &v) const; - //! Operator A = -A - vpColVector operator-() const; - //! Dot product - double operator*(const vpColVector &x) const; - //! Dot product - vpMatrix operator*(const vpRowVector &x) const; - //! Multiplication by a scalar V = A * x - vpColVector operator*(const double x) const; - - vpColVector rows(unsigned int first_row, unsigned int last_row) - { - return vpColVector(*this, first_row-1, last_row-first_row+1); - } - - //! Reshape methods - void reshape(vpMatrix & m, - const unsigned int &nrows, const unsigned int &ncols); - vpMatrix reshape(const unsigned int &nrows, const unsigned int &ncols); - - void stack(const double &b); - void stack(const vpColVector &B); - static vpColVector stack(const vpColVector &A, const vpColVector &B); - static void stack(const vpColVector &A, const vpColVector &B, vpColVector &C); - - //! Transpose of a vector - vpRowVector t() const; - - //! Normalise the vector - vpColVector &normalize() ; - // normalise the vector - // vpColVector &normalize(vpColVector &x) const ; - - //! Compute the cross product of two vectors C = a x b - static vpColVector crossProd(const vpColVector &a, const vpColVector &b) ; - - // Compute the cross product of two vectors C = a x b - inline static vpColVector cross(const vpColVector &a, const vpColVector &b){ - return crossProd(a,b);} - - // Compute the skew matrix [v]x - static vpMatrix skew(const vpColVector &v); - //! Dot Product - - static double dotProd(const vpColVector &a, const vpColVector &b) ; - - //! sort the elements of vector v - static vpColVector sort(const vpColVector &v) ; - //! reverse sorting of the elements of vector v - static vpColVector invSort(const vpColVector &v) ; - //! compute the median - static double median(const vpColVector &v) ; - //! compute the mean - static double mean(const vpColVector &v) ; - - /*! - - Convert a column vector containing angles in radians into - degrees. - - */ - inline void rad2deg() { - double r2d = 180.0/M_PI; - - for (unsigned int i=0; i < rowNum; i++) - (*this)[i] *= r2d; - } - /*! - Convert a column vector containing angles in degrees into radians. - - */ - inline void deg2rad() { - double d2r = M_PI/180.0; - - for (unsigned int i=0; i < rowNum; i++) - (*this)[i] *= d2r; - } - - /*! - - Return the size of the vector in term of number of rows. - - */ - inline unsigned int size() const - { - return getRows(); - } - -}; - - -#endif - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/math/matrix/vpGEMM.h b/src/math/matrix/vpGEMM.h deleted file mode 100644 index 0360d0ea8556f25647ea1a7a3ec945154efc5a74..0000000000000000000000000000000000000000 --- a/src/math/matrix/vpGEMM.h +++ /dev/null @@ -1,364 +0,0 @@ -/**************************************************************************** - * - * $Id: vpGEMM.h 4574 2014-01-09 08:48:51Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Matrix generalized multiplication. - * - * Authors: - * Laneurit Jean - * - *****************************************************************************/ - - -#ifndef __VP_GEMM__ -#define __VP_GEMM__ - -#include <visp/vpMatrix.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpDebug.h> - -const vpMatrix null(0,0); - -/*! - \brief Enumeration of the operations applied on matrices in vpGEMM function. - - Operations are : - - VP_GEMM_A_T to use the transpose matrix of A instead of the matrix A - - VP_GEMM_B_T to use the transpose matrix of B instead of the matrix B - - VP_GEMM_C_T to use the transpose matrix of C instead of the matrix C - - \relates vpMatrix - */ -typedef enum { - VP_GEMM_A_T=1, //! Use A^T instead of A - VP_GEMM_B_T=2, //! Use B^T instead of B - VP_GEMM_C_T=4, //! Use C^T instead of C -} vpGEMMmethod; - - - - -template<unsigned int> inline void GEMMsize(const vpMatrix & /*A*/,const vpMatrix & /*B*/, unsigned int &/*Arows*/, unsigned int &/*Acols*/, unsigned int &/*Brows*/, unsigned int &/*Bcols*/){} - - template<> void inline GEMMsize<0>(const vpMatrix & A,const vpMatrix & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols){ - Arows= A.getRows(); - Acols= A.getCols(); - Brows= B.getRows(); - Bcols= B.getCols(); -} - - template<> inline void GEMMsize<1>(const vpMatrix & A,const vpMatrix & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols){ - Arows= A.getCols(); - Acols= A.getRows(); - Brows= B.getRows(); - Bcols= B.getCols(); -} - template<> inline void GEMMsize<2>(const vpMatrix & A,const vpMatrix & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols){ - Arows= A.getRows(); - Acols= A.getCols(); - Brows= B.getCols(); - Bcols= B.getRows(); -} - template<> inline void GEMMsize<3>(const vpMatrix & A,const vpMatrix & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols){ - Arows= A.getCols(); - Acols= A.getRows(); - Brows= B.getCols(); - Bcols= B.getRows(); -} - - template<> inline void GEMMsize<4>(const vpMatrix & A,const vpMatrix & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols){ - Arows= A.getRows(); - Acols= A.getCols(); - Brows= B.getRows(); - Bcols= B.getCols(); -} - - template<> inline void GEMMsize<5>(const vpMatrix & A,const vpMatrix & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols){ - Arows= A.getCols(); - Acols= A.getRows(); - Brows= B.getRows(); - Bcols= B.getCols(); -} - - template<> inline void GEMMsize<6>(const vpMatrix & A,const vpMatrix & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols){ - Arows= A.getRows(); - Acols= A.getCols(); - Brows= B.getCols(); - Bcols= B.getRows(); -} - - template<> inline void GEMMsize<7>(const vpMatrix & A,const vpMatrix & B, unsigned int &Arows, unsigned int &Acols, unsigned int &Brows, unsigned int &Bcols){ - Arows= A.getCols(); - Acols= A.getRows(); - Brows= B.getCols(); - Bcols= B.getRows(); -} - - - - template<unsigned int> inline void GEMM1(const unsigned int &/*Arows*/,const unsigned int &/*Brows*/, const unsigned int &/*Bcols*/, const vpMatrix & /*A*/, const vpMatrix & /*B*/, const double & /*alpha*/,vpMatrix &/*D*/){} - - template<> inline void GEMM1<0>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpMatrix & A, const vpMatrix & B, const double & alpha,vpMatrix &D){ - for(unsigned int r=0;r<Arows;r++) - for(unsigned int c=0;c<Bcols;c++){ - double sum=0; - for(unsigned int n=0;n<Brows;n++) - sum+=A[r][n]*B[n][c]*alpha; - D[r][c]=sum; - } -} - - template<> inline void GEMM1<1>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpMatrix & A, const vpMatrix & B, const double & alpha,vpMatrix &D){ - for(unsigned int r=0;r<Arows;r++) - for(unsigned int c=0;c<Bcols;c++){ - double sum=0; - for(unsigned int n=0;n<Brows;n++) - sum+=A[n][r]*B[n][c]*alpha; - D[r][c]=sum; - } -} - - template<> inline void GEMM1<2>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpMatrix & A,const vpMatrix & B, const double & alpha,vpMatrix &D){ - for(unsigned int r=0;r<Arows;r++) - for(unsigned int c=0;c<Bcols;c++){ - double sum=0; - for(unsigned int n=0;n<Brows;n++) - sum+=A[r][n]*B[c][n]*alpha; - D[r][c]=sum; - } -} - - template<> inline void GEMM1<3>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpMatrix & A,const vpMatrix & B, const double & alpha,vpMatrix &D){ - for(unsigned int r=0;r<Arows;r++) - for(unsigned int c=0;c<Bcols;c++){ - double sum=0; - for(unsigned int n=0;n<Brows;n++) - sum+=A[n][r]*B[c][n]*alpha; - D[r][c]=sum; - } -} - - template<unsigned int> inline void GEMM2(const unsigned int &/*Arows*/,const unsigned int &/*Brows*/, const unsigned int &/*Bcols*/, const vpMatrix & /*A*/,const vpMatrix & /*B*/, const double & /*alpha*/, const vpMatrix & /*C*/ , const double &/*beta*/, vpMatrix &/*D*/){} - - template<> inline void GEMM2<0>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpMatrix & A,const vpMatrix & B, const double & alpha, const vpMatrix & C , const double &beta, vpMatrix &D){ - - for(unsigned int r=0;r<Arows;r++) - for(unsigned int c=0;c<Bcols;c++){ - double sum=0; - for(unsigned int n=0;n<Brows;n++) - sum+=A[r][n]*B[n][c]*alpha; - D[r][c]=sum+C[r][c]*beta; - } -} - - template<> inline void GEMM2<1>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpMatrix & A,const vpMatrix & B, const double & alpha, const vpMatrix & C , const double &beta, vpMatrix &D){ - for(unsigned int r=0;r<Arows;r++) - for(unsigned int c=0;c<Bcols;c++){ - double sum=0; - for(unsigned int n=0;n<Brows;n++) - sum+=A[n][r]*B[n][c]*alpha; - D[r][c]=sum+C[r][c]*beta; - } -} - - template<> inline void GEMM2<2>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpMatrix & A,const vpMatrix & B, const double & alpha, const vpMatrix & C , const double &beta, vpMatrix &D){ - for(unsigned int r=0;r<Arows;r++) - for(unsigned int c=0;c<Bcols;c++){ - double sum=0; - for(unsigned int n=0;n<Brows;n++) - sum+=A[r][n]*B[c][n]*alpha; - D[r][c]=sum+C[r][c]*beta; - } -} - - template<> inline void GEMM2<3>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpMatrix & A,const vpMatrix & B, const double & alpha, const vpMatrix & C , const double &beta, vpMatrix &D){ - for(unsigned int r=0;r<Arows;r++) - for(unsigned int c=0;c<Bcols;c++){ - double sum=0; - for(unsigned int n=0;n<Brows;n++) - sum+=A[n][r]*B[c][n]*alpha; - D[r][c]=sum+C[r][c]*beta; - } -} - - - template<> inline void GEMM2<4>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpMatrix & A,const vpMatrix & B, const double & alpha, const vpMatrix & C , const double &beta, vpMatrix &D){ - for(unsigned int r=0;r<Arows;r++) - for(unsigned int c=0;c<Bcols;c++){ - double sum=0; - for(unsigned int n=0;n<Brows;n++) - sum+=A[r][n]*B[n][c]*alpha; - D[r][c]=sum+C[c][r]*beta; - } -} - - template<> inline void GEMM2<5>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpMatrix & A,const vpMatrix & B, const double & alpha, const vpMatrix & C , const double &beta, vpMatrix &D){ - for(unsigned int r=0;r<Arows;r++) - for(unsigned int c=0;c<Bcols;c++){ - double sum=0; - for(unsigned int n=0;n<Brows;n++) - sum+=A[n][r]*B[n][c]*alpha; - D[r][c]=sum+C[c][r]*beta; - } - -} - - template<> inline void GEMM2<6>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpMatrix & A,const vpMatrix & B, const double & alpha, const vpMatrix & C , const double &beta, vpMatrix &D){ - for(unsigned int r=0;r<Arows;r++) - for(unsigned int c=0;c<Bcols;c++){ - double sum=0; - for(unsigned int n=0;n<Brows;n++) - sum+=A[r][n]*B[c][n]*alpha; - D[r][c]=sum+C[c][r]*beta; - } -} - - template<> inline void GEMM2<7>(const unsigned int &Arows,const unsigned int &Brows, const unsigned int &Bcols, const vpMatrix & A,const vpMatrix & B, const double & alpha, const vpMatrix & C , const double &beta, vpMatrix &D){ - //vpMatrix &D = *dynamic_cast<double***>(Dptr); - for(unsigned int r=0;r<Arows;r++) - for(unsigned int c=0;c<Bcols;c++){ - double sum=0; - for(unsigned int n=0;n<Brows;n++) - sum+=A[n][r]*B[c][n]*alpha; - D[r][c]=sum+C[c][r]*beta; - } -} - - template<unsigned int T> inline void vpTGEMM(const vpMatrix & A,const vpMatrix & B, const double & alpha ,const vpMatrix & C, const double & beta, vpMatrix & D){ - - unsigned int Arows; - unsigned int Acols; - unsigned int Brows; - unsigned int Bcols; - -// std::cout << T << std::endl; - GEMMsize<T>(A,B,Arows,Acols,Brows,Bcols); -// std::cout << Arows<<" " <<Acols << " "<< Brows << " "<< Bcols<<std::endl; - - try - { - if ((Arows != D.getRows()) || (Bcols != D.getCols())) D.resize(Arows,Bcols); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw ; - } - - if (Acols != Brows) - { - vpERROR_TRACE("\n\t\tvpMatrix mismatch size in vpGEMM") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError,"\n\t\tvpMatrix mismatch size in vpGEMM")) ; - } - - if(C.getRows()!=0 && C.getCols()!=0){ - - if ((Arows != C.getRows()) || (Bcols != C.getCols())) - { - vpERROR_TRACE("\n\t\tvpMatrix mismatch size in vpGEMM") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError,"\n\t\tvpMatrix mismatch size in vpGEMM")) ; - } - - - GEMM2<T>(Arows,Brows,Bcols,A,B,alpha,C,beta,D); - }else{ - GEMM1<T>(Arows,Brows,Bcols,A,B,alpha,D); - } - -} - -/*! - \brief This function performs generalized matrix multiplication: - D = alpha*op(A)*op(B) + beta*op(C), where op(X) is X or X^T. - Operation on A, B and C matrices is described by enumeration vpGEMMmethod. - - For example, to compute alpha*A^T*B^T+beta*C we need to call : - \code - vpGEMM(A,B,alpha,C,beta, VP_GEMM_A_T + VP_GEMM_B_T); - \endcode - - If C is not used, vpGEMM must be called using an empty matrix \e null : - \code - vpGEMM(A,B,alpha,C, null,0); - \endcode - - \throw vpMatrixException::incorrectMatrixSizeError if the sizes of the matrices - do not allow the operations. - - \param A : a Matrix - \param B : a Matrix - \param alpha : a scalar - \param C : a Matrix - \param beta : a scalar - \param D : a Matrix - \param ops : a scalar describing operation applied on the matrices - - \relates vpMatrix - -*/ -inline void vpGEMM(const vpMatrix & A,const vpMatrix & B, const double & alpha ,const vpMatrix & C, const double & beta, vpMatrix & D, const unsigned int &ops=0){ - switch(ops){ - case 0 : - vpTGEMM<0>( A, B, alpha , C, beta, D); - break; - case 1 : - vpTGEMM<1>( A, B, alpha , C, beta, D); - break; - case 2 : - vpTGEMM<2>( A, B, alpha , C, beta, D); - break; - case 3 : - vpTGEMM<3>( A, B, alpha , C, beta, D); - break; - case 4 : - vpTGEMM<4>( A, B, alpha , C, beta, D); - break; - case 5 : - vpTGEMM<5>( A, B, alpha , C, beta, D); - break; - case 6 : - vpTGEMM<6>( A, B, alpha , C, beta, D); - break; - case 7 : - vpTGEMM<7>( A, B, alpha , C, beta, D); - break; - default: - vpERROR_TRACE("\n\t\tvpMatrix mismatch operation in vpGEMM") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError,"\n\t\tvpMatrix mismatch operation in vpGEMM")) ; - break; - } -} - -#endif diff --git a/src/math/matrix/vpMatrix.cpp b/src/math/matrix/vpMatrix.cpp deleted file mode 100644 index 99acb536dda66768535d5e12c0feee6c1a18d31a..0000000000000000000000000000000000000000 --- a/src/math/matrix/vpMatrix.cpp +++ /dev/null @@ -1,4349 +0,0 @@ -/**************************************************************************** -* -* $Id: vpMatrix.cpp 5238 2015-01-30 13:52:25Z fspindle $ -* -* This file is part of the ViSP software. -* Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -* -* This software is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* ("GPL") version 2 as published by the Free Software Foundation. -* See the file LICENSE.txt at the root directory of this source -* distribution for additional information about the GNU GPL. -* -* For using ViSP with software that can not be combined with the GNU -* GPL, please contact INRIA about acquiring a ViSP Professional -* Edition License. -* -* See http://www.irisa.fr/lagadic/visp/visp.html for more information. -* -* This software was developed at: -* INRIA Rennes - Bretagne Atlantique -* Campus Universitaire de Beaulieu -* 35042 Rennes Cedex -* France -* http://www.irisa.fr/lagadic -* -* If you have questions regarding the use of this file, please contact -* INRIA at visp@inria.fr -* -* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -* -* -* Description: -* Matrix manipulation. -* -* Authors: -* Eric Marchand -* -*****************************************************************************/ - - - -/*! -\file vpMatrix.cpp -\brief Definition of the vpMatrix class -*/ - -/* -\class vpMatrix - -\brief Provide simple Matrices computation - -\author Eric Marchand (Eric.Marchand@irisa.fr) Irisa / Inria Rennes -*/ - -#include <visp/vpMatrix.h> -#include <visp/vpMath.h> -#include <visp/vpHomography.h> -#include <visp/vpTranslationVector.h> - -// Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> - -// Debug trace -#include <visp/vpDebug.h> - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <vector> -#include <sstream> -#include <algorithm> -#include <assert.h> -#include <fstream> -#include <string> -#include <cmath> // std::fabs -#include <limits> // numeric_limits - -#ifdef VISP_HAVE_GSL -#include <gsl/gsl_linalg.h> -#endif - -#define DEBUG_LEVEL1 0 -#define DEBUG_LEVEL2 0 - - -//Prototypes of specific functions -vpMatrix subblock(const vpMatrix &, unsigned int, unsigned int); - -/*! -\brief initialization of the object matrix. -Number of columns and rows are zero. -*/ - -void -vpMatrix::init() -{ - - rowNum = 0 ; - colNum = 0 ; - - data = NULL ; - rowPtrs = NULL ; - - dsize = 0 ; - trsize =0 ; -} - -/*! -\brief basic constructor of the matrix class -Construction of the object matrix. -Number of columns and rows are zero. -*/ -vpMatrix::vpMatrix() - : rowNum(0), colNum(0), data(NULL), rowPtrs(NULL), dsize(0), trsize(0) -{ -} - - -/*! -Constructor. - -Initialize a matrix with 0. - -\param r : Matrix number of rows. -\param c : Matrix number of columns. -*/ -vpMatrix::vpMatrix(unsigned int r, unsigned int c) - : rowNum(0), colNum(0), data(NULL), rowPtrs(NULL), dsize(0), trsize(0) -{ - resize(r, c); -} - -/*! -Constructor. - -Initialize a matrix with \e val. - -\param r : Matrix number of rows. -\param c : Matrix number of columns. -\param val : Each element of the matrix is set to \e val. -*/ -vpMatrix::vpMatrix(unsigned int r, unsigned int c, double val) - : rowNum(0), colNum(0), data(NULL), rowPtrs(NULL), dsize(0), trsize(0) -{ - resize(r, c); - *this = val; -} - -vpMatrix::vpMatrix(const vpHomography& H) - : rowNum(0), colNum(0), data(NULL), rowPtrs(NULL), dsize(0), trsize(0) -{ - (*this) = H; -} - -/*! -\brief submatrix constructor -*/ -vpMatrix::vpMatrix(const vpMatrix &m, - unsigned int r, unsigned int c, - unsigned int nrows, unsigned int ncols) - : rowNum(0), colNum(0), data(NULL), rowPtrs(NULL), dsize(0), trsize(0) -{ - if (((r + nrows) > m.rowNum) || ((c + ncols) > m.colNum)) - { - vpERROR_TRACE("\n\t\t SubvpMatrix larger than vpMatrix") ; - throw(vpMatrixException(vpMatrixException::subMatrixError, - "\n\t\t SubvpMatrix larger than vpMatrix")) ; - } - - init(m,r,c,nrows,ncols); -} - -//! copie constructor -vpMatrix::vpMatrix(const vpMatrix& m) - : rowNum(0), colNum(0), data(NULL), rowPtrs(NULL), dsize(0), trsize(0) -{ - resize(m.rowNum,m.colNum); - - memcpy(data,m.data,rowNum*colNum*sizeof(double)) ; -} - - -/*! -Set the size of the matrix and initialize all the values to zero. - -\param nrows : number of rows -\param ncols : number of column -\param flagNullify : if true, then the matrix is re-initialized to 0 -after resize. If false, the initial values from the common part of the -matrix (common part between old and new version of the matrix) are kept. -Default value is true. - -\return OK or MEMORY_FAULT if memory cannot be allocated -*/ - -void vpMatrix::resize(const unsigned int nrows, const unsigned int ncols, - const bool flagNullify) -{ - - if ((nrows == rowNum) && (ncols == colNum)) - { - if (flagNullify && this->data != NULL) - { memset(this->data,0,this->dsize*sizeof(double)) ;} - } - else - { - const bool recopyNeeded = (ncols != this ->colNum); - double * copyTmp = NULL; - unsigned int rowTmp = 0, colTmp=0; - - vpDEBUG_TRACE (25, "Recopy case per case is required iff number of " - "cols has changed (structure of double array is not " - "the same in this case."); - if (recopyNeeded && this->data != NULL) - { - copyTmp = new double[this->dsize]; - memcpy (copyTmp, this ->data, sizeof(double)*this->dsize); - rowTmp=this->rowNum; colTmp=this->colNum; - } - - vpDEBUG_TRACE (25, "Reallocation of this->data array."); - this->dsize = nrows*ncols; - this->data = (double*)realloc(this->data, this->dsize*sizeof(double)); - if ((NULL == this->data) && (0 != this->dsize)) - { - if (copyTmp != NULL) delete [] copyTmp; - vpERROR_TRACE("\n\t\tMemory allocation error when allocating data") ; - throw(vpException(vpException::memoryAllocationError, - "\n\t\t Memory allocation error when " - "allocating data")) ; - } - - vpDEBUG_TRACE (25, "Reallocation of this->trsize array."); - this->trsize = nrows; - this->rowPtrs = (double**)realloc (this->rowPtrs, this->trsize*sizeof(double*)); - if ((NULL == this->rowPtrs) && (0 != this->dsize)) - { - if (copyTmp != NULL) delete [] copyTmp; - vpERROR_TRACE("\n\t\tMemory allocation error when allocating rowPtrs") ; - throw(vpException(vpException::memoryAllocationError, - "\n\t\t Memory allocation error when " - "allocating rowPtrs")) ; - } - - vpDEBUG_TRACE (25, "Recomputation this->trsize array values."); - { - double **t_= rowPtrs; - for (unsigned int i=0; i<dsize; i+=ncols) { *t_++ = this->data + i; } - } - - this->rowNum = nrows; this->colNum = ncols; - - vpDEBUG_TRACE (25, "Recopy of this->data array values or nullify."); - if (flagNullify) - { memset(this->data,0,this->dsize*sizeof(double)) ;} - else - { - if (recopyNeeded && this->rowPtrs != NULL) - { - vpDEBUG_TRACE (25, "Recopy..."); - const unsigned int minRow = (this->rowNum<rowTmp)?this->rowNum:rowTmp; - const unsigned int minCol = (this->colNum<colTmp)?this->colNum:colTmp; - for (unsigned int i=0; i<this->rowNum; ++i) - for (unsigned int j=0; j<this->colNum; ++j) - { - if ((minRow > i) && (minCol > j)) - { - (*this)[i][j] = copyTmp [i*colTmp+j]; - vpCDEBUG (25) << i << "x" << j << "<- " << i*colTmp+j - << "=" << copyTmp [i*colTmp+j] << std::endl; - } - else {(*this)[i][j] = 0;} - } - } - else { vpDEBUG_TRACE (25,"Nothing to do: already done by realloc.");} - } - - if (copyTmp != NULL) delete [] copyTmp; - } - -} - -/*! - Initialize the matrix from a part of an input matrix M. - - \param M : Input matrix used for initialization. - \param r : row index in matrix M. - \param c : column index in matrix M. - \param nrows : Number of rows of the matrix that should be initialized. - \param ncols : Number of columns of the matrix that should be initialized. - - The sub-matrix starting from M[r][c] element and ending on M[r+nrows-1][c+ncols-1] element - is used to initialize the matrix. - - The following code shows how to use this function: -\code -#include <visp/vpMatrix.h> - -int main() -{ - vpMatrix M(4,5); - int val = 0; - for(size_t i=0; i<M.getRows(); i++) { - for(size_t j=0; j<M.getCols(); j++) { - M[i][j] = val++; - } - } - M.print (std::cout, 4, "M "); - - vpMatrix N; - N.init(M, 0, 1, 2, 3); - N.print (std::cout, 4, "N "); -} -\endcode - It produces the following output: - \code -M [4,5]= - 0 1 2 3 4 - 5 6 7 8 9 - 10 11 12 13 14 - 15 16 17 18 19 -N [2,3]= - 1 2 3 - 6 7 8 - \endcode - */ -void -vpMatrix::init(const vpMatrix &M,unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols) -{ - unsigned int rnrows = r+nrows ; - unsigned int cncols = c+ncols ; - - if (rnrows > M.getRows()) - throw(vpException(vpException::dimensionError, - "Bad row dimension (%d > %d) used to initialize vpMatrix", rnrows, M.getRows())); - if (cncols > M.getCols()) - throw(vpException(vpException::dimensionError, - "Bad column dimension (%d > %d) used to initialize vpMatrix", cncols, M.getCols())); - resize(nrows, ncols); - - if (this->rowPtrs == NULL) // Fix coverity scan: explicit null dereferenced - return; // Noting to do - for (unsigned int i=r ; i < rnrows; i++) - for (unsigned int j=c ; j < cncols; j++) - (*this)[i-r][j-c] = M[i][j] ; -} - -/*! -\brief Destruction of the matrix (Memory de-allocation) -*/ -void -vpMatrix::kill() -{ - if (data != NULL ) - { - free(data); - data=NULL; - } - - if (rowPtrs!=NULL) - { - free(rowPtrs); - rowPtrs=NULL ; - } -} -/*! -\brief Destructor (Memory de-allocation) -*/ -vpMatrix::~vpMatrix() -{ - kill() ; -} - - -/*! -\brief Copy operator. -Allow operation such as A = B - -\param B : matrix to be copied. -*/ -vpMatrix & -vpMatrix::operator=(const vpMatrix &B) -{ - try { - resize(B.rowNum, B.colNum) ; - // suppress by em 5/12/06 - // *this = 0; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw ; - } - - memcpy(data,B.data,dsize*sizeof(double)) ; - - return *this; -} - -/*! -\brief Copy operator. -Allow operation such as A = H - -\param H : homography matrix to be copied. -*/ -vpMatrix & -vpMatrix::operator=(const vpHomography& H) -{ - init() ; - resize(3,3); - for(unsigned int i=0; i<3; i++) - for(unsigned int j=0; j<3; j++) - (*this)[i][j] = H[i][j]; - - return *this; -} - -//! set all the element of the matrix A to x -vpMatrix & -vpMatrix::operator=(double x) -{ - - // double t0,t1; - // - // t0=vpTime::measureTimeMicros(); - // for (int i=0;i<dsize;i++) - // { - // *(data+i) = x; - // } - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<< std::endl; - - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<rowNum;i++) - for(unsigned int j=0;j<colNum;j++) - rowPtrs[i][j] = x; - - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<" "; - - - - return *this; -} - - -/*! -\brief Assigment from an array of double -*/ -vpMatrix & -vpMatrix::operator<<( double *x ) -{ - - for (unsigned int i=0; i<rowNum; i++) { - for (unsigned int j=0; j<colNum; j++) { - rowPtrs[i][j] = *x++; - } - } - return *this; -} - - -//--------------------------------- -// Matrix operations. -//--------------------------------- - -/*! -Operation C = A * B. - -The result is placed in the third parameter C and not returned. -A new matrix won't be allocated for every use of the function -(Speed gain if used many times with the same result matrix size). - -\sa operator*() -*/ -void vpMatrix::mult2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) -{ - try - { - if ((A.rowNum != C.rowNum) || (B.colNum != C.colNum)) C.resize(A.rowNum,B.colNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw ; - } - - if (A.colNum != B.rowNum) - { - vpERROR_TRACE("\n\t\tvpMatrix mismatch in vpMatrix/vpMatrix multiply") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\tvpMatrix mismatch in " - "vpMatrix/vpMatrix multiply")) ; - } - - // 5/12/06 some "very" simple optimization to avoid indexation - unsigned int BcolNum = B.colNum; - unsigned int BrowNum = B.rowNum; - unsigned int i,j,k; - double **BrowPtrs = B.rowPtrs; - for (i=0;i<A.rowNum;i++) - { - double *rowptri = A.rowPtrs[i]; - double *ci = C[i]; - for (j=0;j<BcolNum;j++) - { - double s = 0; - for (k=0;k<BrowNum;k++) s += rowptri[k] * BrowPtrs[k][j]; - ci[j] = s; - } - } -} - -/*! -Operation C = A * B (A is unchanged). -\sa mult2Matrices() to avoid matrix allocation for each use. -*/ -vpMatrix vpMatrix::operator*(const vpMatrix &B) const -{ - vpMatrix C; - - vpMatrix::mult2Matrices(*this,B,C); - - return C; -} -/*! - Allows to multiply a matrix by an homography. - Operation M = K * H (H is unchanged). - -*/ -vpMatrix vpMatrix::operator*(const vpHomography &H) const -{ - if (colNum != 3) - throw(vpException(vpMatrixException::dimensionError, "Cannot multiply the matrix by the homography; bad matrix size")); - vpMatrix M(rowNum, 3); - - for (unsigned int i=0;i<rowNum;i++){ - for (unsigned int j=0;j<3;j++) { - double s = 0; - for (unsigned int k=0;k<3;k++) s += (*this)[i][k] * H[k][j]; - M[i][j] = s; - } - } - - return M; -} - -/*! -Operation C = A*wA + B*wB - -The result is placed in the third parameter C and not returned. -A new matrix won't be allocated for every use of the function -(Speed gain if used many times with the same result matrix size). - -\sa operator+() -*/ - -void vpMatrix::add2WeightedMatrices(const vpMatrix &A, const double &wA, const vpMatrix &B,const double &wB, vpMatrix &C){ - try - { - if ((A.rowNum != C.rowNum) || (B.colNum != C.colNum)) C.resize(A.rowNum,B.colNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw ; - } - - if ((A.colNum != B.getCols())||(A.rowNum != B.getRows())) - { - vpERROR_TRACE("\n\t\t vpMatrix mismatch in vpMatrix/vpMatrix addition") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t vpMatrix mismatch in " - "vpMatrix/vpMatrix addition")) ; - } - - double ** ArowPtrs=A.rowPtrs; - double ** BrowPtrs=B.rowPtrs; - double ** CrowPtrs=C.rowPtrs; - - for (unsigned int i=0;i<A.rowNum;i++) - for(unsigned int j=0;j<A.colNum;j++) - CrowPtrs[i][j] = wB*BrowPtrs[i][j]+wA*ArowPtrs[i][j]; - -} - -/*! -Operation C = A + B. - -The result is placed in the third parameter C and not returned. -A new matrix won't be allocated for every use of the function -(Speed gain if used many times with the same result matrix size). - -\sa operator+() -*/ -void vpMatrix::add2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) -{ - try - { - if ((A.rowNum != C.rowNum) || (B.colNum != C.colNum)) C.resize(A.rowNum,B.colNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw ; - } - - if ((A.colNum != B.getCols())||(A.rowNum != B.getRows())) - { - vpERROR_TRACE("\n\t\t vpMatrix mismatch in vpMatrix/vpMatrix addition") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t vpMatrix mismatch in " - "vpMatrix/vpMatrix addition")) ; - } - - double ** ArowPtrs=A.rowPtrs; - double ** BrowPtrs=B.rowPtrs; - double ** CrowPtrs=C.rowPtrs; - - // double t0,t1; - // t0=vpTime::measureTimeMicros(); - // for (int i=0;i<A.dsize;i++) - // { - // *(C.data + i) = *(B.data + i) + *(A.data + i) ; - // } - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<< std::endl; - - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<A.rowNum;i++) - for(unsigned int j=0;j<A.colNum;j++) - { - - CrowPtrs[i][j] = BrowPtrs[i][j]+ArowPtrs[i][j]; - } - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<" "; - - -} - -/*! -Operation C = A + B (A is unchanged). -\sa add2Matrices() to avoid matrix allocation for each use. -*/ -vpMatrix vpMatrix::operator+(const vpMatrix &B) const -{ - - vpMatrix C; - vpMatrix::add2Matrices(*this,B,C); - return C; -} - - -/*! -Operation C = A - B. - -The result is placed in the third parameter C and not returned. -A new matrix won't be allocated for every use of the function -(Speed gain if used many times with the same result matrix size). - -\sa operator-() -*/ -void vpMatrix::sub2Matrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) -{ - try - { - if ((A.rowNum != C.rowNum) || (A.colNum != C.colNum)) C.resize(A.rowNum,A.colNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw ; - } - - if ( (A.colNum != B.getCols())||(A.rowNum != B.getRows())) - { - vpERROR_TRACE("\n\t\t vpMatrix mismatch in vpMatrix/vpMatrix substraction") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t vpMatrix mismatch in " - "vpMatrix/vpMatrix substraction")) ; - } - - - - double ** ArowPtrs=A.rowPtrs; - double ** BrowPtrs=B.rowPtrs; - double ** CrowPtrs=C.rowPtrs; - - // double t0,t1; - // - // t0=vpTime::measureTimeMicros(); - // for (int i=0;i<A.dsize;i++) - // { - // *(C.data + i) = *(A.data + i) - *(B.data + i) ; - // } - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<< std::endl; - // - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<A.rowNum;i++) - for(unsigned int j=0;j<A.colNum;j++) - { - CrowPtrs[i][j] = ArowPtrs[i][j]-BrowPtrs[i][j]; - } - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<" "; - - -} - -/*! -Operation C = A - B (A is unchanged). -\sa sub2Matrices() to avoid matrix allocation for each use. -*/ -vpMatrix vpMatrix::operator-(const vpMatrix &B) const -{ - vpMatrix C; - vpMatrix::sub2Matrices(*this,B,C); - return C; -} - -//! Operation A = A + B - -vpMatrix &vpMatrix::operator+=(const vpMatrix &B) -{ - if ( (colNum != B.getCols())||(rowNum != B.getRows())) - { - vpERROR_TRACE("\n\t\t vpMatrix mismatch in vpMatrix += addition") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t vpMatrix mismatch in " - "vpMatrix += addition")) ; - - } - - - double ** BrowPtrs=B.rowPtrs; - - // double t0,t1; - // - // t0=vpTime::measureTimeMicros(); - // for (int i=0;i<dsize;i++) - // { - // *(data + i) += *(B.data + i) ; - // } - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<< std::endl; - - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<rowNum;i++) - for(unsigned int j=0;j<colNum;j++) - rowPtrs[i][j] += BrowPtrs[i][j]; - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<" "; - - - - - - return *this; -} - -//! Operation A = A - B - -vpMatrix & vpMatrix::operator-=(const vpMatrix &B) -{ - if ( (colNum != B.getCols())||(rowNum != B.getRows())) - { - vpERROR_TRACE("\n\t\t vpMatrix mismatch in vpMatrix -= substraction") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t vpMatrix mismatch in " - "vpMatrix -= substraction")) ; - - } - - double ** BrowPtrs=B.rowPtrs; - - // double t0,t1; - - // t0=vpTime::measureTimeMicros(); - // for (int i=0;i<dsize;i++) - // { - // *(data + i) -= *(B.data + i) ; - // } - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<< " " ; - - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<rowNum;i++) - for(unsigned int j=0;j<colNum;j++) - rowPtrs[i][j] -= BrowPtrs[i][j]; - - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<std::endl; - - - - return *this; -} - -/*! -Operation C = -A. - -The result is placed in the second parameter C and not returned. -A new matrix won't be allocated for every use of the function -(Speed gain if used many times with the same result matrix size). - -\sa operator-(void) -*/ -void vpMatrix::negateMatrix(const vpMatrix &A, vpMatrix &C) -{ - try - { - if ((A.rowNum != C.rowNum) || (A.colNum != C.colNum)) C.resize(A.rowNum,A.colNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw ; - } - - double ** ArowPtrs=A.rowPtrs; - double ** CrowPtrs=C.rowPtrs; - - - // std::cout << "negate" << std::endl; - // double t0,t1; - // - // t0=vpTime::measureTimeMicros(); - // for (int i=0;i<A.dsize;i++) - // { - // *(C.data + i) = -*(A.data + i) ; - // } - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<< " "; - - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<A.rowNum;i++) - for(unsigned int j=0;j<A.colNum;j++) - CrowPtrs[i][j]= -ArowPtrs[i][j]; - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<std::endl; - - -} - -/*! -Operation C = -A (A is unchanged). -\sa negateMatrix() to avoid matrix allocation for each use. -*/ -vpMatrix vpMatrix::operator-() const //negate -{ - vpMatrix C; - vpMatrix::negateMatrix(*this,C); - return C; -} - -double -vpMatrix::sumSquare() const -{ - double sum_square=0.0; - double x ; - - // double t0,t1; - // - // t0=vpTime::measureTimeMicros(); - // double *d = data ; - // double *n = data+dsize ; - // while (d < n ) - // { - // x = *d++ ; - // sum_square += x*x ; - // } - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<" "<< sum << " "; - // - - - // sum_square= 0.0; - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<rowNum;i++) - for(unsigned int j=0;j<colNum;j++) - { - x=rowPtrs[i][j]; - sum_square += x*x; - } - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<" "<< sum << std::endl; - - return sum_square; -} - -double -vpMatrix::sum() const -{ - double s=0.0; - for (unsigned int i=0;i<rowNum;i++) - { - for(unsigned int j=0;j<colNum;j++) - { - s += rowPtrs[i][j]; - } - } - - return s; -} - - -//--------------------------------- -// Matrix/vector operations. -//--------------------------------- - -/*! -Operation c = A * b (c and b are vectors). - -The result is placed in the second parameter C and not returned. -A new matrix won't be allocated for every use of the function -(Speed gain if used many times with the same result matrix size). - -\sa operator*(const vpColVector &b) const -*/ -void vpMatrix::multMatrixVector(const vpMatrix &A, const vpColVector &b, vpColVector &c) -{ - if (A.colNum != b.getRows()) - { - vpERROR_TRACE("vpMatrix mismatch in vpMatrix/vector multiply") ; - throw(vpMatrixException::incorrectMatrixSizeError) ; - } - - try - { - if (A.rowNum != c.rowNum) c.resize(A.rowNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw ; - } - - c = 0.0; - for (unsigned int j=0;j<A.colNum;j++) - { - double bj = b[j] ; // optimization em 5/12/2006 - for (unsigned int i=0;i<A.rowNum;i++) - { - c[i]+=A.rowPtrs[i][j] * bj; - } - } -} - -/*! -Operation c = A * b (A is unchanged, c and b are vectors). -\sa multMatrixVector() to avoid matrix allocation for each use. -*/ -vpColVector -vpMatrix::operator*(const vpColVector &b) const -{ - vpColVector c; - vpMatrix::multMatrixVector(*this,b,c); - return c; -} - -//! Operation c = A * b (A is unchanged, c and b are translation vectors). -vpTranslationVector -vpMatrix::operator*(const vpTranslationVector &b) const -{ - vpTranslationVector c; - - if (rowNum != 3 || colNum != 3) - { - vpERROR_TRACE("vpMatrix mismatch in vpMatrix::operator*(const vpTranslationVector)") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, "vpMatrix mismatch in vpMatrix::operator*()")) ; - } - - for (unsigned int j=0;j<3;j++) c[j]=0 ; - - for (unsigned int j=0;j<3;j++) { - { - double bj = b[j] ; // optimization em 5/12/2006 - for (unsigned int i=0;i<3;i++) { - c[i]+=rowPtrs[i][j] * bj; - } - } - } - return c ; -} - -//--------------------------------- -// Matrix/real operations. -//--------------------------------- - -/*! - \relates vpMatrix - Multiplication by a scalar Cij = x*Bij. -*/ -vpMatrix operator*(const double &x,const vpMatrix &B) -{ - // Modif EM 13/6/03 - vpMatrix C ; - - try { - C.resize(B.getRows(),B.getCols()); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw ; - } - // double t0,t1; - - unsigned int Brow = B.getRows() ; - unsigned int Bcol = B.getCols() ; - // t0=vpTime::measureTimeMicros(); - // - // for (int i=0;i<Brow; i++) - // { - // double *ci = C[i] ; - // double *Bi = B[i] ; - // for (int j=0 ; j < Bcol;j++) - // ci[j] = Bi[j]*x; - // } - // - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<" "; - - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<Brow;i++) - for(unsigned int j=0;j<Bcol;j++) - C[i][j]= B[i][j]*x; - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<std::endl; - - - - return C ; -} - -//! Cij = Aij * x (A is unchanged) -vpMatrix vpMatrix::operator*(double x) const -{ - vpMatrix C; - - try { - C.resize(rowNum,colNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw ; - } - // double t0,t1; - - double ** CrowPtrs=C.rowPtrs; - - // t0=vpTime::measureTimeMicros(); - // for (int i=0;i<dsize;i++) - // *(C.data+i) = *(data+i)*x; - // - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<" "; - // - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<rowNum;i++) - for(unsigned int j=0;j<colNum;j++) - CrowPtrs[i][j]= rowPtrs[i][j]*x; - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<std::endl; - - return C; -} - -//! Cij = Aij / x (A is unchanged) -vpMatrix vpMatrix::operator/(double x) const -{ - vpMatrix C; - - try { - C.resize(rowNum,colNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - - //if (x == 0) { - if (std::fabs(x) <= std::numeric_limits<double>::epsilon()) { - //vpERROR_TRACE("Divide by zero in method /(double x)") ; - throw vpMatrixException(vpMatrixException::divideByZeroError, "Divide by zero in method /(double x)"); - } - - double xinv = 1/x ; - - - // double t0,t1; - // - // t0=vpTime::measureTimeMicros(); - // for (int i=0;i<dsize;i++) - // *(C.data+i) = *(data+i)*xinv ; - // - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<" "; - // - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<rowNum;i++) - for(unsigned int j=0;j<colNum;j++) - C[i][j]=rowPtrs[i][j]*xinv; - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<std::endl; - - return C; - -} - - -//! Add x to all the element of the matrix : Aij = Aij + x -vpMatrix & vpMatrix::operator+=(double x) -{ - - // double t0,t1; - // - // t0=vpTime::measureTimeMicros(); - // for (int i=0;i<dsize;i++) - // *(data+i) += x; - // - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<" "; - // - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<rowNum;i++) - for(unsigned int j=0;j<colNum;j++) - rowPtrs[i][j]+=x; - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<std::endl; - - return *this; -} - - -//! Substract x to all the element of the matrix : Aij = Aij - x -vpMatrix & vpMatrix::operator-=(double x) -{ - - - // double t0,t1; - // - // t0=vpTime::measureTimeMicros(); - // for (int i=0;i<dsize;i++) - // *(data+i) -= x; - // - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<" "; - // - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<rowNum;i++) - for(unsigned int j=0;j<colNum;j++) - rowPtrs[i][j]-=x; - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<std::endl; - - return *this; -} - -//! Multiply all the element of the matrix by x : Aij = Aij * x -vpMatrix & vpMatrix::operator*=(double x) -{ - - - // for (int i=0;i<dsize;i++) - // *(data+i) *= x; - - for (unsigned int i=0;i<rowNum;i++) - for(unsigned int j=0;j<colNum;j++) - rowPtrs[i][j]*=x; - - return *this; -} - -//! Divide all the element of the matrix by x : Aij = Aij / x -vpMatrix & vpMatrix::operator/=(double x) -{ - //if (x == 0) - if (std::fabs(x) <= std::numeric_limits<double>::epsilon()) - throw vpMatrixException(vpMatrixException::divideByZeroError, "Divide by zero in method /=(double x)"); - - double xinv = 1/x ; - - // double t0,t1; - // - // t0=vpTime::measureTimeMicros(); - // for (int i=0;i<dsize;i++) - // *(data+i) *= xinv; - // - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<" "; - - // t0=vpTime::measureTimeMicros(); - for (unsigned int i=0;i<rowNum;i++) - for(unsigned int j=0;j<colNum;j++) - rowPtrs[i][j]*=xinv; - // t1=vpTime::measureTimeMicros(); - // std::cout<< t1-t0<<std::endl; - - return *this; -} - -//---------------------------------------------------------------- -// Matrix Operation -//---------------------------------------------------------------- - - -/*! - By default set the matrix to identity. - More generally set M[i][i] = val. -*/ -void -vpMatrix::setIdentity(const double & val) -{ - if (rowNum != colNum) - { - vpERROR_TRACE("non square matrix") ; - throw(vpMatrixException(vpMatrixException::matrixError)) ; - } - - unsigned int i,j; - for (i=0;i<rowNum;i++) - for (j=0;j<colNum;j++) - if (i==j) (*this)[i][j] = val ; else (*this)[i][j] = 0; -} - -/*! - Set an n-by-n matrix to identity. - - eye(n) is an n-by-n matrix with ones on the diagonal and zeros - else where. - -*/ -void -vpMatrix::eye(unsigned int n) -{ - try { - eye(n,n) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } -} -/*! - Set an m-by-n matrix to identity. - - eye(m,n) is an m-by-n matrix with ones on the diagonal and zeros - else where. - -*/ -void -vpMatrix::eye(unsigned int m, unsigned int n) -{ - try { - resize(m,n) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - - - for (unsigned int i=0; i<rowNum; i++) - for (unsigned int j=0; j<colNum; j++) - if (i == j) (*this)[i][j] = 1; - else (*this)[i][j] = 0; - -} - - -/*! - Compute and return the transpose of the matrix. -*/ -vpMatrix vpMatrix::t() const -{ - vpMatrix At ; - - try { - At.resize(colNum,rowNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - - unsigned int i,j; - for (i=0;i<rowNum;i++) - { - double *coli = (*this)[i] ; - for (j=0;j<colNum;j++) - At[j][i] = coli[j]; - } - return At; -} - - -/*! - Compute and return the transpose of the matrix. - - \sa t() -*/ -vpMatrix vpMatrix::transpose()const -{ - vpMatrix At ; - transpose(At); - return At; -} - -/*! - Compute \e At the transpose of the matrix. - \param At : Resulting transpose matrix. - \sa t() -*/ -void vpMatrix::transpose(vpMatrix & At )const{ - - try { - At.resize(colNum,rowNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - - size_t A_step = colNum; - double ** AtRowPtrs = At.rowPtrs; - - for( unsigned int i = 0; i < colNum; i++ ) - { - double * row_ = AtRowPtrs[i]; - double * col = rowPtrs[0]+i; - for( unsigned int j = 0; j < rowNum; j++, col+=A_step ) - *(row_++)=*col; - } -} - - -/*! - Computes the \f$AA^T\f$ operation \f$B = A*A^T\f$ - \return \f$A*A^T\f$ - \sa AAt(vpMatrix &) const -*/ -vpMatrix vpMatrix::AAt() const -{ - vpMatrix B; - - AAt(B); - - return B; -} - -/*! - Compute the AAt operation such as \f$B = A*A^T\f$. - - The result is placed in the parameter \e B and not returned. - - A new matrix won't be allocated for every use of the function. This - results in a speed gain if used many times with the same result - matrix size. - - \sa AAt() -*/ -void vpMatrix::AAt(vpMatrix &B)const { - - try { - if ((B.rowNum != rowNum) || (B.colNum != rowNum)) B.resize(rowNum,rowNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - - // compute A*A^T - for(unsigned int i=0;i<rowNum;i++){ - for(unsigned int j=i;j<rowNum;j++){ - double *pi = rowPtrs[i];// row i - double *pj = rowPtrs[j];// row j - - // sum (row i .* row j) - double ssum=0; - for(unsigned int k=0; k < colNum ;k++) - ssum += *(pi++)* *(pj++); - - B[i][j]=ssum; //upper triangle - if(i!=j) - B[j][i]=ssum; //lower triangle - } - } -} - - - -/*! - Compute the AtA operation such as \f$B = A^T*A\f$. - - The result is placed in the parameter \e B and not returned. - - A new matrix won't be allocated for every use of the function. This - results in a speed gain if used many times with the same result matrix - size. - - \sa AtA() -*/ -void vpMatrix::AtA(vpMatrix &B) const -{ - try { - if ((B.rowNum != colNum) || (B.colNum != colNum)) B.resize(colNum,colNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - - unsigned int i,j,k; - double s; - double *ptr; - double *Bi; - for (i=0;i<colNum;i++) - { - Bi = B[i] ; - for (j=0;j<i;j++) - { - ptr=data; - s = 0 ; - for (k=0;k<rowNum;k++) - { - s +=(*(ptr+i)) * (*(ptr+j)); - ptr+=colNum; - } - *Bi++ = s ; - B[j][i] = s; - } - ptr=data; - s = 0 ; - for (k=0;k<rowNum;k++) - { - s +=(*(ptr+i)) * (*(ptr+i)); - ptr+=colNum; - } - *Bi = s; - } -} - - -/*! - Compute the AtA operation such as \f$B = A^T*A\f$ - \return \f$A^T*A\f$ - \sa AtA(vpMatrix &) const -*/ -vpMatrix vpMatrix::AtA() const -{ - vpMatrix B; - - AtA(B); - - return B; -} - - -/*! - Stacks columns of a matrix in a vector. - \param out : a vpColVector. -*/ -void vpMatrix::stackColumns(vpColVector &out ){ - - try { - if ((out.rowNum != colNum*rowNum) || (out.colNum != 1)) out.resize(rowNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - - double *optr=out.data; - for(unsigned int j =0;j<colNum ; j++){ - for(unsigned int i =0;i<rowNum ; i++){ - *(optr++)=rowPtrs[i][j]; - } - } -} - -/*! - Stacks columns of a matrix in a vector. - \return a vpColVector. -*/ -vpColVector vpMatrix::stackColumns(){ - - vpColVector out(colNum*rowNum); - stackColumns(out); - return out; -} - -/*! - Stacks rows of a matrix in a vector - \param out : a vpRowVector. -*/ -void vpMatrix::stackRows(vpRowVector &out ){ - - try { - if ((out.rowNum != 1) || (out.colNum != colNum*rowNum)) out.resize(rowNum); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - - double *mdata=data; - double *optr=out.data; - for(unsigned int i =0;i<dsize ; i++){ - *(optr++)=*(mdata++); - } -} -/*! - Stacks rows of a matrix in a vector. - \return a vpRowVector. -*/ -vpRowVector vpMatrix::stackRows(){ - - vpRowVector out(colNum*rowNum); - stackRows(out ); - return out; -} - -/*! - Compute Kronecker product matrix. - \param m1 : vpMatrix; - \param m2 : vpMatrix; - \param out : The kronecker product : \f$ m1 \otimes m2 \f$ -*/ -void vpMatrix::kron(const vpMatrix &m1, const vpMatrix &m2 , vpMatrix &out){ - unsigned int r1= m1.getRows(); - unsigned int c1= m1.getCols(); - unsigned int r2= m2.getRows(); - unsigned int c2= m2.getCols(); - - - if (r1*r2 !=out.rowNum || c1*c2!= out.colNum ) - { - vpERROR_TRACE("Kronecker prodect bad dimension of output vpMatrix") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError,"Kronecker prodect bad dimension of output vpMatrix")); - } - - for(unsigned int r =0;r<r1 ; r++){ - for(unsigned int c =0;c<c1 ; c++){ - double alpha = m1[r][c]; - double *m2ptr = m2[0]; - unsigned int roffset= r*r2; - unsigned int coffset= c*c2; - for(unsigned int rr =0;rr<r2 ; rr++){ - for(unsigned int cc =0;cc<c2 ;cc++){ - out[roffset+rr][coffset+cc]= alpha* *(m2ptr++); - } - } - } - } - -} - -/*! - Compute Kronecker product matrix. - \param m : vpMatrix. - \param out : If m1.kron(m2) out contains the kronecker product's result : \f$ m1 \otimes m2 \f$. -*/ -void vpMatrix::kron(const vpMatrix &m , vpMatrix &out){ - kron(*this,m,out); -} - -/*! - Compute Kronecker product matrix. - \param m1 : vpMatrix; - \param m2 : vpMatrix; - \return The kronecker product : \f$ m1 \otimes m2 \f$ -*/ -vpMatrix vpMatrix::kron(const vpMatrix &m1, const vpMatrix &m2 ){ - - unsigned int r1= m1.getRows(); - unsigned int c1= m1.getCols(); - unsigned int r2= m2.getRows(); - unsigned int c2= m2.getCols(); - - vpMatrix out(r1*r2,c1*c2); - - for(unsigned int r =0;r<r1 ; r++){ - for(unsigned int c =0;c<c1 ; c++){ - double alpha = m1[r][c]; - double *m2ptr = m2[0]; - unsigned int roffset= r*r2; - unsigned int coffset= c*c2; - for(unsigned int rr =0;rr<r2 ; rr++){ - for(unsigned int cc =0;cc<c2 ;cc++){ - out[roffset+rr ][coffset+cc]= alpha* *(m2ptr++); - } - } - } - } - return out; -} - - -/*! -Compute Kronecker product matrix. -\param m : vpMatrix; -\return m1.kron(m2) The kronecker product : \f$ m1 \otimes m2 \f$ -*/ -vpMatrix vpMatrix::kron(const vpMatrix &m){ - return kron(*this,m); -} - -/*! - -Solve a linear system \f$ A X = B \f$ using Singular Value -Decomposition (SVD). - -Non destructive wrt. A and B. - -\param b : Vector\f$ B \f$. - -\param x : Vector \f$ X \f$. - -Here an example: -\code -#include <visp/vpColVector.h> -#include <visp/vpMatrix.h> - -int main() -{ -vpMatrix A(3,3); - -A[0][0] = 4.64; -A[0][1] = 0.288; -A[0][2] = -0.384; - -A[1][0] = 0.288; -A[1][1] = 7.3296; -A[1][2] = 2.2272; - -A[2][0] = -0.384; -A[2][1] = 2.2272; -A[2][2] = 6.0304; - -vpColVector X(3), B(3); -B[0] = 1; -B[1] = 2; -B[2] = 3; - -A.solveBySVD(B, X); - -// Obtained values of X -// X[0] = 0.2468; -// X[1] = 0.120782; -// X[2] = 0.468587; - -std::cout << "X:\n" << X << std::endl; -} -\endcode - -\sa solveBySVD(const vpColVector &) -*/ -void -vpMatrix::solveBySVD(const vpColVector &b, vpColVector &x) const -{ - x = pseudoInverse(1e-6)*b ; -} - - -/*! - -Solve a linear system \f$ A X = B \f$ using Singular Value -Decomposition (SVD). - -Non destructive wrt. A and B. - -\param B : Vector\f$ B \f$. - -\return Vector \f$ X \f$. - -Here an example: -\code -#include <visp/vpColVector.h> -#include <visp/vpMatrix.h> - -int main() -{ -vpMatrix A(3,3); - -A[0][0] = 4.64; -A[0][1] = 0.288; -A[0][2] = -0.384; - -A[1][0] = 0.288; -A[1][1] = 7.3296; -A[1][2] = 2.2272; - -A[2][0] = -0.384; -A[2][1] = 2.2272; -A[2][2] = 6.0304; - -vpColVector X(3), B(3); -B[0] = 1; -B[1] = 2; -B[2] = 3; - -X = A.solveBySVD(B); -// Obtained values of X -// X[0] = 0.2468; -// X[1] = 0.120782; -// X[2] = 0.468587; - -std::cout << "X:\n" << X << std::endl; -} -\endcode - -\sa solveBySVD(const vpColVector &, vpColVector &) -*/ -vpColVector vpMatrix::solveBySVD(const vpColVector &B) const -{ - vpColVector X(colNum); - - solveBySVD(B, X); - return X; -} - - -/*! - -Singular value decomposition (SVD). - -\f[ M = U \Sigma V^{\top} \f] - -\warning Destructive method wrt. to the matrix \f$ M \f$ to -decompose. You should make a COPY of that matrix if needed not to -CHANGE. - -\param w : Vector of singular values. \f$ \Sigma = diag(w) \f$. - -\param v : Matrix \f$ V \f$. - -\return Matrix \f$ U \f$. - -\warning If the GNU Scientific Library (GSL) third party library is used to compute the SVD -decomposition, the singular values \f$ \Sigma_{i,i} \f$ are ordered in decreasing -fashion in \e w. This is not the case, if the GSL is not detected by ViSP. - -Here an example of SVD decomposition of a non square Matrix M. - -\code -#include <visp/vpColVector.h> -#include <visp/vpMatrix.h> - -int main() -{ -vpMatrix M(3,2); -M[0][0] = 1; -M[1][0] = 2; -M[2][0] = 0.5; - -M[0][1] = 6; -M[1][1] = 8 ; -M[2][1] = 9 ; - -vpMatrix v; -vpColVector w; -vpMatrix Mrec; -vpMatrix Sigma; - -M.svd(w, v); -// Here M is modified and is now equal to U - -// Construct the diagonal matrix from the singular values -Sigma.diag(w); - -// Reconstruct the initial matrix M using the decomposition -Mrec = M * Sigma * v.t(); - -// Here, Mrec is obtained equal to the initial value of M -// Mrec[0][0] = 1; -// Mrec[1][0] = 2; -// Mrec[2][0] = 0.5; -// Mrec[0][1] = 6; -// Mrec[1][1] = 8 ; -// Mrec[2][1] = 9 ; - -std::cout << "Reconstructed M matrix: \n" << Mrec << std::endl; -} -\endcode - -*/ -void -vpMatrix::svd(vpColVector& w, vpMatrix& v) -{ -#if (DEBUG_LEVEL1 == 0) /* no verification */ - { - w.resize( this->getCols() ); - v.resize( this->getCols(), this->getCols() ); - -#if defined (VISP_HAVE_LAPACK) - svdLapack(w,v); -#elif (VISP_HAVE_OPENCV_VERSION >= 0x020101) // Require opencv >= 2.1.1 - svdOpenCV(w,v); -#elif defined (VISP_HAVE_GSL) /* be careful of the copy below */ - svdGsl(w,v) ; -#else - svdNr(w,v) ; -#endif - - //svdNr(w,v) ; - } -#else /* verification of the SVD */ - { - int pb = 0; - unsigned int i,j,k,nrows,ncols; - vpMatrix A, Asvd; - - A = (*this); /* copy because svd is destructive */ - - w.resize( this->getCols() ); - v.resize( this->getCols(), this->getCols() ); -#ifdef VISP_HAVE_GSL /* be careful of the copy above */ - svdGsl(w,v) ; -#else - svdNr(w,v) ; -#endif - //svdNr(w,v) ; - - nrows = A.getRows(); - ncols = A.getCols(); - Asvd.resize(nrows,ncols); - - for (i = 0 ; i < nrows ; i++) - { - for (j = 0 ; j < ncols ; j++) - { - Asvd[i][j] = 0.0; - for (k=0 ; k < ncols ; k++) Asvd[i][j] += (*this)[i][k]*w[k]*v[j][k]; - } - } - for (i=0;i<nrows;i++) - { - for (j=0;j<ncols;j++) if (fabs(A[i][j]-Asvd[i][j]) > 1e-6) pb = 1; - } - if (pb == 1) - { - printf("pb in SVD\n"); - std::cout << " A : " << std::endl << A << std::endl; - std::cout << " Asvd : " << std::endl << Asvd << std::endl; - } - // else printf("SVD ok ;-)\n"); /* It's so good... */ - } -#endif -} -/*! -\brief Compute the pseudo inverse of the matrix \f$Ap = A^+\f$ -\param Ap : The pseudo inverse \f$ A^+ \f$. -\param svThreshold : Threshold used to test the singular values. -\return Return the rank of the matrix A -*/ - -unsigned int -vpMatrix::pseudoInverse(vpMatrix &Ap, double svThreshold) const -{ - vpColVector sv ; - return pseudoInverse(Ap, sv, svThreshold) ; -} - -/*! -\brief Compute and return the pseudo inverse of a n-by-m matrix : \f$ A^+ \f$ -\param svThreshold : Threshold used to test the singular values. - -\return Pseudo inverse of the matrix. - -Here an example to compute the inverse of a n-by-n matrix. If the -matrix is n-by-n it is also possible to use inverseByLU(). - -\code -#include <visp/vpMatrix.h> - -int main() -{ -vpMatrix A(4,4); - -A[0][0] = 1/1.; A[0][1] = 1/2.; A[0][2] = 1/3.; A[0][3] = 1/4.; -A[1][0] = 1/5.; A[1][1] = 1/3.; A[1][2] = 1/3.; A[1][3] = 1/5.; -A[2][0] = 1/6.; A[2][1] = 1/4.; A[2][2] = 1/2.; A[2][3] = 1/6.; -A[3][0] = 1/7.; A[3][1] = 1/5.; A[3][2] = 1/6.; A[3][3] = 1/7.; - -// Compute the inverse -vpMatrix A_1; // A^-1 -A_1 = A.pseudoInverse(); -std::cout << "Inverse by pseudo inverse: \n" << A_1 << std::endl; - -std::cout << "A*A^-1: \n" << A * A_1 << std::endl; -} -\endcode - -\sa inverseByLU() - -*/ -vpMatrix -vpMatrix::pseudoInverse(double svThreshold) const -{ - vpMatrix Ap ; - vpColVector sv ; - pseudoInverse(Ap, sv, svThreshold) ; - return Ap ; -} - -/*! -\brief Compute the pseudo inverse of the matrix \f$Ap = A^+\f$ -\param Ap : The pseudo inverse \f$ A^+ \f$. -\param sv : Singular values. -\param svThreshold : Threshold used to test the singular values. -\return Return the rank of the matrix A -*/ -unsigned int -vpMatrix::pseudoInverse(vpMatrix &Ap, vpColVector &sv, double svThreshold) const -{ - vpMatrix imA, imAt ; - return pseudoInverse(Ap, sv, svThreshold, imA, imAt) ; -} - -/*! -\brief Compute the pseudo inverse of the matrix \f$Ap = A^+\f$ along with Ker A, Ker \f$A^T\f$, Im A and Im \f$A^T\f$ - -Pseudo inverse, kernel and image are computed using the SVD decomposition. - -A is an m x n matrix, -if m >=n the svd works on A other wise it works on \f$A^T\f$. - -Therefore if m>=n we have - -\f[ -{\bf A}_{m\times n} = {\bf U}_{m\times m} {\bf S}_{m\times n} {\bf V^\top}_{n\times n} -\f] -\f[ -{\bf A}_{m\times n} = \left[\begin{array}{ccc}\mbox{Im} {\bf A} & | & -\mbox{Ker} {\bf A^\top} \end{array} \right] {\bf S} -\left[ -\begin{array}{c} (\mbox{Im} {\bf A^\top})^\top \\ (\mbox{Ker}{\bf A})^\top \end{array}\right] -\f] -where -Im(A) is an m x r matrix (r is the rank of A) and -Im(A^T) is an r x n matrix - - -\param Ap : The pseudo inverse \f$ A^+ \f$. -\param sv : Singular values. -\param svThreshold : Threshold used to test the singular values. -\param imAt : Image A^T -\param imA: Image A -\return Return the rank of the matrix A - -*/ -unsigned int -vpMatrix::pseudoInverse(vpMatrix &Ap, - vpColVector &sv, double svThreshold, - vpMatrix &imA, - vpMatrix &imAt) const -{ - - unsigned int i, j, k ; - - unsigned int nrows, ncols; - unsigned int nrows_orig = getRows() ; - unsigned int ncols_orig = getCols() ; - Ap.resize(ncols_orig,nrows_orig) ; - - if (nrows_orig >= ncols_orig) - { - nrows = nrows_orig; - ncols = ncols_orig; - } - else - { - nrows = ncols_orig; - ncols = nrows_orig; - } - - vpMatrix a(nrows,ncols) ; - vpMatrix a1(ncols,nrows); - vpMatrix v(ncols,ncols) ; - sv.resize(ncols) ; - - if (nrows_orig >= ncols_orig) a = *this; - else a = (*this).t(); - - a.svd(sv,v); - - // compute the highest singular value and the rank of h - double maxsv = 0 ; - for (i=0 ; i < ncols ; i++) - if (fabs(sv[i]) > maxsv) maxsv = fabs(sv[i]) ; - - unsigned int rank = 0 ; - for (i=0 ; i < ncols ; i++) - if (fabs(sv[i]) > maxsv*svThreshold) rank++ ; - - - - /*------------------------------------------------------- */ - for (i = 0 ; i < ncols ; i++) - { - for (j = 0 ; j < nrows ; j++) - { - a1[i][j] = 0.0; - - for (k=0 ; k < ncols ; k++) - if (fabs(sv[k]) > maxsv*svThreshold) - { - a1[i][j] += v[i][k]*a[j][k]/sv[k]; - } - } - } - if (nrows_orig >= ncols_orig) Ap = a1; - else Ap = a1.t(); - - if (nrows_orig >= ncols_orig) - { - // compute dim At - imAt.resize(ncols_orig,rank) ; - for (i=0 ; i < ncols_orig ; i++) - for (j=0 ; j < rank ; j++) - imAt[i][j] = v[i][j] ; - - // compute dim A - imA.resize(nrows_orig,rank) ; - for (i=0 ; i < nrows_orig ; i++) - for (j=0 ; j < rank ; j++) - imA[i][j] = a[i][j] ; - } - else - { - // compute dim At - imAt.resize(ncols_orig,rank) ; - for (i=0 ; i < ncols_orig ; i++) - for (j=0 ; j < rank ; j++) - imAt[i][j] = a[i][j] ; - - imA.resize(nrows_orig,rank) ; - for (i=0 ; i < nrows_orig ; i++) - for (j=0 ; j < rank ; j++) - imA[i][j] = v[i][j] ; - - } - -#if (DEBUG_LEVEL1) - { - int pb = 0; - vpMatrix A, ApA, AAp, AApA, ApAAp ; - - nrows = nrows_orig; - ncols = ncols_orig; - - A.resize(nrows,ncols) ; - A = *this ; - - ApA = Ap * A; - AApA = A * ApA; - ApAAp = ApA * Ap; - AAp = A * Ap; - - for (i=0;i<nrows;i++) - { - for (j=0;j<ncols;j++) if (fabs(AApA[i][j]-A[i][j]) > 1e-6) pb = 1; - } - for (i=0;i<ncols;i++) - { - for (j=0;j<nrows;j++) if (fabs(ApAAp[i][j]-Ap[i][j]) > 1e-6) pb = 1; - } - for (i=0;i<nrows;i++) - { - for (j=0;j<nrows;j++) if (fabs(AAp[i][j]-AAp[j][i]) > 1e-6) pb = 1; - } - for (i=0;i<ncols;i++) - { - for (j=0;j<ncols;j++) if (fabs(ApA[i][j]-ApA[j][i]) > 1e-6) pb = 1; - } - if (pb == 1) - { - printf("pb in pseudo inverse\n"); - std::cout << " A : " << std::endl << A << std::endl; - std::cout << " Ap : " << std::endl << Ap << std::endl; - std::cout << " A - AApA : " << std::endl << A - AApA << std::endl; - std::cout << " Ap - ApAAp : " << std::endl << Ap - ApAAp << std::endl; - std::cout << " AAp - (AAp)^T : " << std::endl << AAp - AAp.t() << std::endl; - std::cout << " ApA - (ApA)^T : " << std::endl << ApA - ApA.t() << std::endl; - } - // else printf("Ap OK ;-) \n"); - - } -#endif - - // std::cout << v << std::endl ; - return rank ; -} - - - -/*! -\brief Compute the pseudo inverse of the matrix \f$Ap = A^+\f$ along with Ker A, Ker \f$A^T\f$, Im A and Im \f$A^T\f$ - -Pseudo inverse, kernel and image are computed using the SVD decomposition. - -A is an m x n matrix, -if m >=n the svd works on A other wise it works on \f$A^T\f$. - -Therefore if m>=n we have - -\f[ -{\bf A}_{m\times n} = {\bf U}_{m\times m} {\bf S}_{m\times n} {\bf V^\top}_{n\times n} -\f] -\f[ -{\bf A}_{m\times n} = \left[\begin{array}{ccc}\mbox{Im} {\bf A} & | & -\mbox{Ker} {\bf A^\top} \end{array} \right] {\bf S} -\left[ -\begin{array}{c} (\mbox{Im} {\bf A^\top})^\top \\ (\mbox{Ker}{\bf A})^\top \end{array}\right] -\f] -where -Im(A) is an m x r matrix (r is the rank of A) and -Im(A^T) is an r x n matrix - - -\param Ap : The pseudo inverse \f$ A^+ \f$. -\param sv : Singular values. -\param svThreshold : Threshold used to test the singular values. -\param imA: Image A -\param imAt : Image A^T -\param kerA : null space of A -\return Return the rank of the matrix A - -*/ -unsigned int -vpMatrix::pseudoInverse(vpMatrix &Ap, - vpColVector &sv, double svThreshold, - vpMatrix &imA, - vpMatrix &imAt, - vpMatrix &kerA) const -{ - - unsigned int i, j, k ; - - unsigned int nrows, ncols; - unsigned int nrows_orig = getRows() ; - unsigned int ncols_orig = getCols() ; - Ap.resize(ncols_orig,nrows_orig) ; - - if (nrows_orig >= ncols_orig) - { - nrows = nrows_orig; - ncols = ncols_orig; - } - else - { - nrows = ncols_orig; - ncols = nrows_orig; - } - - vpMatrix a(nrows,ncols) ; - vpMatrix a1(ncols,nrows); - vpMatrix v(ncols,ncols) ; - sv.resize(ncols) ; - - if (nrows_orig >= ncols_orig) a = *this; - else a = (*this).t(); - - a.svd(sv,v); - - // compute the highest singular value and the rank of h - double maxsv = 0 ; - for (i=0 ; i < ncols ; i++) - if (fabs(sv[i]) > maxsv) maxsv = fabs(sv[i]) ; - - unsigned int rank = 0 ; - for (i=0 ; i < ncols ; i++) - if (fabs(sv[i]) > maxsv*svThreshold) rank++ ; - - - - /*------------------------------------------------------- */ - for (i = 0 ; i < ncols ; i++) - { - for (j = 0 ; j < nrows ; j++) - { - a1[i][j] = 0.0; - - for (k=0 ; k < ncols ; k++) - if (fabs(sv[k]) > maxsv*svThreshold) - { - a1[i][j] += v[i][k]*a[j][k]/sv[k]; - } - } - } - if (nrows_orig >= ncols_orig) Ap = a1; - else Ap = a1.t(); - - if (nrows_orig >= ncols_orig) - { - // compute dim At - imAt.resize(ncols_orig,rank) ; - for (i=0 ; i < ncols_orig ; i++) - for (j=0 ; j < rank ; j++) - imAt[i][j] = v[i][j] ; - - // compute dim A - imA.resize(nrows_orig,rank) ; - for (i=0 ; i < nrows_orig ; i++) - for (j=0 ; j < rank ; j++) - imA[i][j] = a[i][j] ; - } - else - { - // compute dim At - imAt.resize(ncols_orig,rank) ; - for (i=0 ; i < ncols_orig ; i++) - for (j=0 ; j < rank ; j++) - imAt[i][j] = a[i][j] ; - - imA.resize(nrows_orig,rank) ; - for (i=0 ; i < nrows_orig ; i++) - for (j=0 ; j < rank ; j++) - imA[i][j] = v[i][j] ; - - } - - vpMatrix cons(ncols_orig, ncols_orig); - cons = 0; - - for (j = 0; j < ncols_orig; j++) - { - for (i = 0; i < ncols_orig; i++) - { - if (fabs(sv[i]) <= maxsv*svThreshold) - { - cons[i][j] = v[j][i]; - } - } - } - - vpMatrix Ker (ncols_orig-rank, ncols_orig); - k = 0; - for (j = 0; j < ncols_orig ; j++) - { - //if ( cons.row(j+1).sumSquare() != 0) - if ( std::fabs(cons.getRow(j).sumSquare()) > std::numeric_limits<double>::epsilon()) - { - for (i = 0; i < cons.getCols(); i++) - Ker[k][i] = cons[j][i]; - - k++; - } - } - kerA = Ker; - -#if (DEBUG_LEVEL1) - { - int pb = 0; - vpMatrix A, ApA, AAp, AApA, ApAAp ; - - nrows = nrows_orig; - ncols = ncols_orig; - - A.resize(nrows,ncols) ; - A = *this ; - - ApA = Ap * A; - AApA = A * ApA; - ApAAp = ApA * Ap; - AAp = A * Ap; - - for (i=0;i<nrows;i++) - { - for (j=0;j<ncols;j++) if (fabs(AApA[i][j]-A[i][j]) > 1e-6) pb = 1; - } - for (i=0;i<ncols;i++) - { - for (j=0;j<nrows;j++) if (fabs(ApAAp[i][j]-Ap[i][j]) > 1e-6) pb = 1; - } - for (i=0;i<nrows;i++) - { - for (j=0;j<nrows;j++) if (fabs(AAp[i][j]-AAp[j][i]) > 1e-6) pb = 1; - } - for (i=0;i<ncols;i++) - { - for (j=0;j<ncols;j++) if (fabs(ApA[i][j]-ApA[j][i]) > 1e-6) pb = 1; - } - if (pb == 1) - { - printf("pb in pseudo inverse\n"); - std::cout << " A : " << std::endl << A << std::endl; - std::cout << " Ap : " << std::endl << Ap << std::endl; - std::cout << " A - AApA : " << std::endl << A - AApA << std::endl; - std::cout << " Ap - ApAAp : " << std::endl << Ap - ApAAp << std::endl; - std::cout << " AAp - (AAp)^T : " << std::endl << AAp - AAp.t() << std::endl; - std::cout << " ApA - (ApA)^T : " << std::endl << ApA - ApA.t() << std::endl; - std::cout << " KerA : " << std::endl << kerA << std::endl; - } - // else printf("Ap OK ;-) \n"); - - } -#endif - - // std::cout << v << std::endl ; - return rank ; -} - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated. You should use getRow(). - - Return the i-th row of the matrix. - \warning notice row(1) is the 0th row. -*/ -vpRowVector -vpMatrix::row(const unsigned int i) -{ - vpRowVector c(getCols()) ; - - for (unsigned int j =0 ; j < getCols() ; j++) c[j] = (*this)[i-1][j] ; - return c ; -} - -/*! - \deprecated This method is deprecated. You should use getCol(). - - Return the j-th columns of the matrix. - \warning notice column(1) is the 0-th column. - \param j : Index of the column to extract. -*/ -vpColVector -vpMatrix::column(const unsigned int j) -{ - vpColVector c(getRows()) ; - - for (unsigned int i =0 ; i < getRows() ; i++) c[i] = (*this)[i][j-1] ; - return c ; -} -#endif - - -/*! - Extract a column vector from a matrix. - \warning All the indexes start from 0 in this function. - \param j : Index of the column to extract. If col=0, the first column is extracted. - \param i_begin : Index of the row that gives the location of the first element of the column vector to extract. - \param column_size : Size of the column vector to extract. - \return The extracted column vector. - - The following example shows how to use this function: - \code -#include <visp/vpColVector.h> -#include <visp/vpMatrix.h> - -int main() -{ - vpMatrix A(4,4); - - for(unsigned int i=0; i < A.getRows(); i++) - for(unsigned int j=0; j < A.getCols(); j++) - A[i][j] = i*A.getCols()+j; - - A.print(std::cout, 4); - - vpColVector cv = A.getCol(1, 1, 3); - std::cout << "Column vector: \n" << cv << std::endl; -} - \endcode -It produces the following output: - \code -[4,4]= - 0 1 2 3 - 4 5 6 7 - 8 9 10 11 - 12 13 14 15 -column vector: -5 -9 -13 - \endcode - */ -vpColVector -vpMatrix::getCol(const unsigned int j, const unsigned int i_begin, const unsigned int column_size) const -{ - if (i_begin + column_size > getRows() || j >= getCols()) - throw(vpException(vpException::dimensionError, "Unable to extract a column vector from the matrix")); - vpColVector c(column_size); - for (unsigned int i=0 ; i < column_size ; i++) - c[i] = (*this)[i_begin+i][j]; - return c; -} - -/*! - Extract a column vector from a matrix. - \warning All the indexes start from 0 in this function. - \param j : Index of the column to extract. If j=0, the first column is extracted. - \return The extracted column vector. - - The following example shows how to use this function: - \code -#include <visp/vpColVector.h> -#include <visp/vpMatrix.h> - -int main() -{ - vpMatrix A(4,4); - - for(unsigned int i=0; i < A.getRows(); i++) - for(unsigned int j=0; j < A.getCols(); j++) - A[i][j] = i*A.getCols()+j; - - A.print(std::cout, 4); - - vpColVector cv = A.getCol(1); - std::cout << "Column vector: \n" << cv << std::endl; -} - \endcode -It produces the following output: - \code -[4,4]= - 0 1 2 3 - 4 5 6 7 - 8 9 10 11 - 12 13 14 15 -column vector: -1 -5 -9 -13 - \endcode - */ -vpColVector -vpMatrix::getCol(const unsigned int j) const -{ - if (j >= getCols()) - throw(vpException(vpException::dimensionError, "Unable to extract a column vector from the matrix")); - unsigned int nb_rows = getRows(); - vpColVector c(nb_rows); - for (unsigned int i=0 ; i < nb_rows ; i++) - c[i] = (*this)[i][j]; - return c; -} - -/*! - Extract a row vector from a matrix. - \warning All the indexes start from 0 in this function. - \param i : Index of the row to extract. If i=0, the first row is extracted. - \return The extracted row vector. - - The following example shows how to use this function: - \code -#include <visp/vpMatrix.h> -#include <visp/vpRowVector.h> - -int main() -{ - vpMatrix A(4,4); - - for(unsigned int i=0; i < A.getRows(); i++) - for(unsigned int j=0; j < A.getCols(); j++) - A[i][j] = i*A.getCols()+j; - - A.print(std::cout, 4); - - vpRowVector rv = A.getRow(1); - std::cout << "Row vector: \n" << rv << std::endl; -} \endcode -It produces the following output: - \code -[4,4]= - 0 1 2 3 - 4 5 6 7 - 8 9 10 11 - 12 13 14 15 -Row vector: -4 5 6 7 - \endcode - */ -vpRowVector -vpMatrix::getRow(const unsigned int i) const -{ - if (i >= getRows()) - throw(vpException(vpException::dimensionError, "Unable to extract a row vector from the matrix")); - unsigned int nb_cols = getCols(); - vpRowVector r( nb_cols ); - for (unsigned int j=0 ; j < nb_cols ; j++) - r[j] = (*this)[i][j]; - return r; -} - -/*! - Extract a row vector from a matrix. - \warning All the indexes start from 0 in this function. - \param i : Index of the row to extract. If i=0, the first row is extracted. - \param j_begin : Index of the column that gives the location of the first element of the row vector to extract. - \param row_size : Size of the row vector to extract. - \return The extracted row vector. - - The following example shows how to use this function: - \code -#include <visp/vpMatrix.h> -#include <visp/vpRowVector.h> - -int main() -{ - vpMatrix A(4,4); - - for(unsigned int i=0; i < A.getRows(); i++) - for(unsigned int j=0; j < A.getCols(); j++) - A[i][j] = i*A.getCols()+j; - - A.print(std::cout, 4); - - vpRowVector rv = A.getRow(1, 1, 3); - std::cout << "Row vector: \n" << rv << std::endl; -} \endcode -It produces the following output: - \code -[4,4]= - 0 1 2 3 - 4 5 6 7 - 8 9 10 11 - 12 13 14 15 -Row vector: -5 6 7 - \endcode - */ -vpRowVector -vpMatrix::getRow(const unsigned int i, const unsigned int j_begin, const unsigned int row_size) const -{ - if (j_begin + row_size > getCols() || i >= getRows()) - throw(vpException(vpException::dimensionError, "Unable to extract a row vector from the matrix")); - vpRowVector r(row_size); - for (unsigned int j=0 ; j < row_size ; j++) - r[j] = (*this)[i][j_begin+i]; - return r; -} - -/*! -\brief Stack matrices. "Stack" two matrices C = [ A B ]^T - -\f$ C = \left( \begin{array}{c} A \\ B \end{array}\right) \f$ - -\param A : Upper matrix. -\param B : Lower matrix. -\return Stacked matrix C = [ A B ]^T - -\warning A and B must have the same number of column. -*/ -vpMatrix -vpMatrix::stackMatrices(const vpMatrix &A, const vpMatrix &B) -{ - vpMatrix C ; - - try{ - stackMatrices(A,B, C) ; - } - catch(vpMatrixException me) - { - vpCERROR << me << std::endl; - throw ; - } - - return C ; -} - -/*! -\relates vpMatrix -\brief stackMatrices. "stack" two matrices C = [ A B ]^T - -\f$ C = \left( \begin{array}{c} A \\ B \end{array}\right) \f$ - -\param A : Upper matrix. -\param B : Lower matrix. -\param C : Stacked matrix C = [ A B ]^T - -\warning A and B must have the same number of column -*/ -void -vpMatrix::stackMatrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) -{ - unsigned int nra = A.getRows() ; - unsigned int nrb = B.getRows() ; - - if (nra !=0) - if (A.getCols() != B.getCols()) - { - vpERROR_TRACE("\n\t\t incorrect matrices size") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t incorrect matrices size")) ; - } - - try { - C.resize(nra+nrb,B.getCols() ) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - - unsigned int i,j ; - for (i=0 ; i < nra ; i++) - for (j=0 ; j < A.getCols() ; j++) - C[i][j] = A[i][j] ; - - - for (i=0 ; i < nrb ; i++) - for (j=0 ; j < B.getCols() ; j++) - { - C[i+nra][j] = B[i][j] ; - - } - - -} - - - - - -/*! -\brief Insert matrix B in matrix A at the given position. - - -\param A : Main matrix. -\param B : Matrix to insert. -\param r : Index of the row where to add the matrix. -\param c : Index of the column where to add the matrix. -\return Matrix with B insert in A. - -\warning Throw exception if the sizes of the matrices do not allow the insertion. -*/ -vpMatrix -vpMatrix::insert(const vpMatrix &A, const vpMatrix &B, - const unsigned int r, const unsigned int c) -{ - vpMatrix C ; - - try{ - insert(A,B, C, r, c) ; - } - catch(vpMatrixException me) - { - vpCERROR << me << std::endl; - throw me; - } - - return C ; -} - -/*! -\relates vpMatrix -Insert matrix B in matrix A at the given position. - -\param A : Main matrix. -\param B : Matrix to insert. -\param C : Result matrix. -\param r : Index of the row where to insert matrix B. -\param c : Index of the column where to insert matrix B. - -\warning Throw exception if the sizes of the matrices do not -allow the insertion. -*/ -void -vpMatrix::insert(const vpMatrix &A, const vpMatrix &B, vpMatrix &C, - const unsigned int r, const unsigned int c) -{ - if( ( (r + B.getRows()) <= A.getRows() ) && - ( (c + B.getCols()) <= A.getCols() ) ){ - try { - C.resize(A.getRows(),A.getCols() ) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - for(unsigned int i=0; i<A.getRows(); i++){ - for(unsigned int j=0; j<A.getCols(); j++){ - if(i >= r && i < (r + B.getRows()) && j >= c && j < (c+B.getCols())){ - C[i][j] = B[i-r][j-c]; - } - else{ - C[i][j] = A[i][j]; - } - } - } - } - else{ - throw vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\tIncorrect size of the matrix to insert data."); - } -} - -/*! -Juxtapose to matrices C = [ A B ]. - -\f$ C = \left( \begin{array}{cc} A & B \end{array}\right) \f$ - -\param A : Left matrix. -\param B : Right matrix. -\return Juxtaposed matrix C = [ A B ] - -\warning A and B must have the same number of column -*/ -vpMatrix -vpMatrix::juxtaposeMatrices(const vpMatrix &A, const vpMatrix &B) -{ - vpMatrix C ; - - try{ - juxtaposeMatrices(A,B, C) ; - } - catch(vpMatrixException me) - { - vpCERROR << me << std::endl ; - throw ; - } - - return C ; -} - -/*! -\relates vpMatrix -Juxtapose to matrices C = [ A B ]. - -\f$ C = \left( \begin{array}{cc} A & B \end{array}\right) \f$ - -\param A : Left matrix. -\param B : Right matrix. -\param C : Juxtaposed matrix C = [ A B ] - -\warning A and B must have the same number of column -*/ -void -vpMatrix::juxtaposeMatrices(const vpMatrix &A, const vpMatrix &B, vpMatrix &C) -{ - unsigned int nca = A.getCols() ; - unsigned int ncb = B.getCols() ; - - if (nca !=0) - if (A.getRows() != B.getRows()) - { - vpERROR_TRACE("\n\t\t incorrect matrices size") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t incorrect matrices size")) ; - } - - try { - C.resize(B.getRows(),nca+ncb) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - - unsigned int i,j ; - for (i=0 ; i < C.getRows(); i++) - for (j=0 ; j < nca ; j++) - C[i][j] = A[i][j] ; - - - for (i=0 ; i < C.getRows() ; i++) - for (j=0 ; j < ncb ; j++) - { - C[i][nca+j] = B[i][j] ; - } -} - -/*! - -Create a diagonal matrix with the element of a vector. - -\param A : Vector which element will be put in the diagonal. - -\sa createDiagonalMatrix() - -\code -#include <iostream> - -#include <visp/vpColVector.h> -#include <visp/vpMatrix.h> - -int main() -{ -vpMatrix A; -vpColVector v(3); - -v[0] = 1; -v[1] = 2; -v[2] = 3; - -A.diag(v); - -std::cout << "A:\n" << A << std::endl; - -// A is now equal to: -// 1 0 0 -// 0 2 0 -// 0 0 3 -} -\endcode -*/ - -void -vpMatrix::diag(const vpColVector &A) -{ - unsigned int rows = A.getRows() ; - try { - this->resize(rows,rows) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - (*this) = 0 ; - for (unsigned int i=0 ; i< rows ; i++ ) - (* this)[i][i] = A[i] ; -} -/*! - -Create a diagonal matrix with the element of a vector \f$ DA_{ii} = A_i \f$. - -\param A : Vector which element will be put in the diagonal. - -\param DA : Diagonal matrix DA[i][i] = A[i] - -\sa diag() -*/ - -void -vpMatrix::createDiagonalMatrix(const vpColVector &A, vpMatrix &DA) -{ - unsigned int rows = A.getRows() ; - try { - DA.resize(rows,rows) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - vpCERROR << me << std::endl ; - throw ; - } - DA =0 ; - for (unsigned int i=0 ; i< rows ; i++ ) - DA[i][i] = A[i] ; -} - -//-------------------------------------------------------------------- -// Output -//-------------------------------------------------------------------- - - -/*! -\brief std::cout a matrix -*/ -VISP_EXPORT std::ostream &operator <<(std::ostream &s,const vpMatrix &m) -{ - std::ios_base::fmtflags original_flags = s.flags(); - - s.precision(10) ; - for (unsigned int i=0;i<m.getRows();i++) { - for (unsigned int j=0;j<m.getCols();j++){ - s << m[i][j] << " "; - } - // We don't add a \n char on the end of the last matrix line - if (i < m.getRows()-1) - s << std::endl; - } - - s.flags(original_flags); // restore s to standard state - - return s; -} - -/*! - -Pretty print a matrix. The data are tabulated. -The common widths before and after the decimal point -are set with respect to the parameter maxlen. - -\param s -Stream used for the printing. - -\param length -The suggested width of each matrix element. -The actual width grows in order to accomodate the whole integral part, -and shrinks if the whole extent is not needed for all the numbers. -\param intro -The introduction which is printed before the matrix. -Can be set to zero (or omitted), in which case -the introduction is not printed. - -\return -Returns the common total width for all matrix elements - -\sa std::ostream &operator <<(ostream &s,const vpMatrix &m) -*/ -int -vpMatrix::print(std::ostream& s, unsigned int length, char const* intro) -{ - typedef std::string::size_type size_type; - - unsigned int m = getRows(); - unsigned int n = getCols(); - - std::vector<std::string> values(m*n); - std::ostringstream oss; - std::ostringstream ossFixed; - std::ios_base::fmtflags original_flags = oss.flags(); - - // ossFixed <<std::fixed; - ossFixed.setf ( std::ios::fixed, std::ios::floatfield ); - - size_type maxBefore=0; // the length of the integral part - size_type maxAfter=0; // number of decimals plus - // one place for the decimal point - for (unsigned int i=0;i<m;++i) { - for (unsigned int j=0;j<n;++j){ - oss.str(""); - oss << (*this)[i][j]; - if (oss.str().find("e")!=std::string::npos){ - ossFixed.str(""); - ossFixed << (*this)[i][j]; - oss.str(ossFixed.str()); - } - - values[i*n+j]=oss.str(); - size_type thislen=values[i*n+j].size(); - size_type p=values[i*n+j].find('.'); - - if (p==std::string::npos){ - maxBefore=vpMath::maximum(maxBefore, thislen); - // maxAfter remains the same - } else{ - maxBefore=vpMath::maximum(maxBefore, p); - maxAfter=vpMath::maximum(maxAfter, thislen-p-1); - } - } - } - - size_type totalLength=length; - // increase totalLength according to maxBefore - totalLength=vpMath::maximum(totalLength,maxBefore); - // decrease maxAfter according to totalLength - maxAfter=std::min(maxAfter, totalLength-maxBefore); - if (maxAfter==1) maxAfter=0; - - // the following line is useful for debugging - //std::cerr <<totalLength <<" " <<maxBefore <<" " <<maxAfter <<"\n"; - - if (intro) s <<intro; - s <<"["<<m<<","<<n<<"]=\n"; - - for (unsigned int i=0;i<m;i++) { - s <<" "; - for (unsigned int j=0;j<n;j++){ - size_type p=values[i*n+j].find('.'); - s.setf(std::ios::right, std::ios::adjustfield); - s.width((std::streamsize)maxBefore); - s <<values[i*n+j].substr(0,p).c_str(); - - if (maxAfter>0){ - s.setf(std::ios::left, std::ios::adjustfield); - if (p!=std::string::npos){ - s.width((std::streamsize)maxAfter); - s <<values[i*n+j].substr(p,maxAfter).c_str(); - } else{ - assert(maxAfter>1); - s.width((std::streamsize)maxAfter); - s <<".0"; - } - } - - s <<' '; - } - s <<std::endl; - } - - s.flags(original_flags); // restore s to standard state - - return (int)(maxBefore+maxAfter); -} - - -/*! -\brief Print using matlab syntax, to be put in matlab later. - -Print using the following form: -[ a,b,c; -d,e,f; -g,h,i] -*/ -std::ostream & vpMatrix:: -matlabPrint(std::ostream & os) const -{ - - unsigned int i,j; - - os << "[ "; - for (i=0; i < this->getRows(); ++ i) - { - for (j=0; j < this ->getCols(); ++ j) - { - os << (*this)[i][j] << ", "; - } - if (this ->getRows() != i+1) { os << ";" << std::endl; } - else { os << "]" << std::endl; } - } - return os; -}; - -/*! -\brief Print using MAPLE matrix input format. - -Print using the following way so that this output can be directly copied into MAPLE: -([ -[0.939846, 0.0300754, 0.340272, ], -[0.0300788, 0.984961, -0.170136, ], -[-0.340272, 0.170136, 0.924807, ], -]) -*/ -std::ostream & vpMatrix:: -maplePrint(std::ostream & os) const -{ - unsigned int i,j; - - os << "([ " << std::endl; - for (i=0; i < this->getRows(); ++ i) - { os << "["; - for (j=0; j < this->getCols(); ++ j) - { - os << (*this)[i][j] << ", "; - } - os << "]," << std::endl; - } - os << "])" << std::endl; - return os; -}; - -/*! -\brief Print matrix in csv format. - -Print as comma separated values so that this output can be imported into any program which has a csv data import option: -0.939846, 0.0300754, 0.340272 -0.0300788, 0.984961, -0.170136 --0.340272, 0.170136, 0.924807 -*/ -std::ostream & vpMatrix:: -csvPrint(std::ostream & os) const -{ - unsigned int i,j; - - for (i=0; i < this->getRows(); ++ i) - { - for (j=0; j < this->getCols(); ++ j) - { - os << (*this)[i][j]; - if (!(j==(this->getCols()-1))) - os << ", "; - } - os << std::endl; - } - return os; -}; - - -/*! -\brief Print to be used as part of a C++ code later. - -Print under the following form: -vpMatrix A(6,4); -A[0][0] = 1.4; -A[0][1] = 0.6; ... - -\param os: the stream to be printed in. -\param matrixName: name of the matrix, "A" by default, to be used for -the line vpMatrix A(6,7) (see example). -\param octet: if false, print using double, if true, print byte per byte -each bytes of the double array. -*/ -std::ostream & vpMatrix:: -cppPrint(std::ostream & os, const char * matrixName, bool octet) const -{ - - unsigned int i,j; - const char defaultName [] = "A"; - if (NULL == matrixName) - { - matrixName = defaultName; - } - os << "vpMatrix " << defaultName - << " (" << this ->getRows () - << ", " << this ->getCols () << "); " <<std::endl; - - for (i=0; i < this->getRows(); ++ i) - { - for (j=0; j < this ->getCols(); ++ j) - { - if (! octet) - { - os << defaultName << "[" << i << "][" << j - << "] = " << (*this)[i][j] << "; " << std::endl; - } - else - { - for (unsigned int k = 0; k < sizeof(double); ++ k) - { - os << "((unsigned char*)&(" << defaultName - << "[" << i << "][" << j << "]) )[" << k - <<"] = 0x" <<std::hex<< - (unsigned int)((unsigned char*)& ((*this)[i][j])) [k] - << "; " << std::endl; - } - } - } - os << std::endl; - } - return os; -}; - - -/*! -Compute and return the Euclidean norm \f$ ||x|| = \sqrt{ \sum{x_{ij}^2}} \f$. - -\return The Euclidean norm if the matrix is initialized, 0 otherwise. - -\sa infinityNorm() -*/ -double -vpMatrix::euclideanNorm () const -{ - double norm=0.0; - double x ; - for (unsigned int i=0;i<dsize;i++) { - x = *(data +i); norm += x*x; - } - - return sqrt(norm); -} - - - -/*! - -Compute and return the infinity norm \f$ {||x||}_{\infty} = -max\left(\sum_{j=0}^{n}{\mid x_{ij} \mid}\right) \f$ with \f$i \in -\{0, ..., m\}\f$ where \f$(m,n)\f$ is the matrix size. - -\return The infinity norm if the matrix is initialized, 0 otherwise. - -\sa euclideanNorm() -*/ -double -vpMatrix::infinityNorm () const -{ - double norm=0.0; - double x ; - for (unsigned int i=0;i<rowNum;i++){ - x = 0; - for (unsigned int j=0; j<colNum;j++){ - x += fabs (*(*(rowPtrs + i)+j)) ; - } - if (x > norm) { - norm = x; - } - } - return norm; -} - -/*! -Compute the determinant of the matrix using the LU Decomposition. - -\return The determinant of the matrix if the matrix is square, 0 otherwise. - -See the Numerical Recipes in C page 43 for further explanations. -*/ - -double vpMatrix::detByLU() const -{ - double det_ = 0; - - // Test wether the matrix is squred - if (rowNum == colNum) - { - // create a temporary matrix that will be modified by LUDcmp - vpMatrix tmp(*this); - - // using th LUdcmp based on NR codes - // it modified the tmp matrix in a special structure of type : - // b11 b12 b13 b14 - // a21 b22 b23 b24 - // a21 a32 b33 b34 - // a31 a42 a43 b44 - - unsigned int * perm = new unsigned int[rowNum]; // stores the permutations - int d; // +- 1 fi the number of column interchange is even or odd - tmp.LUDcmp(perm, d); - delete[]perm; - - // compute the determinant that is the product of the eigen values - det_ = (double) d; - for(unsigned int i=0;i<rowNum;i++) - { - det_*=tmp[i][i]; - } - } - - else { - vpERROR_TRACE("Determinant Computation : ERR Matrix not squared") ; - throw(vpMatrixException(vpMatrixException::matrixError, - "\n\t\tDeterminant Computation : ERR Matrix not squared")) ; - - - } - return det_ ; -} - - - -/*! -Stack A at the end of the current matrix, or copy if the matrix has no dimensions : this = [ this A ]^T - -Here an example for a robot velocity log : -\code -vpMatrix Velocities; -vpColVector v(6); -for(unsigned int i = 0;i<100;i++) -{ - robot.getVelocity(vpRobot::ARTICULAR_FRAME, v); - Velocities.stackMatrices(v.t()); -} -\endcode -*/ -void vpMatrix::stackMatrices(const vpMatrix &A) -{ - if(rowNum == 0) - *this = A; - else - *this = vpMatrix::stackMatrices(*this, A); -} - - -/*! -Insert matrix A at the given position in the current matrix. - -\warning Throw vpMatrixException::incorrectMatrixSizeError if the -dimensions of the matrices do not allow the operation. - -\param A : The matrix to insert. -\param r : The index of the row to begin to insert data. -\param c : The index of the column to begin to insert data. -*/ -void vpMatrix::insert(const vpMatrix&A, const unsigned int r, - const unsigned int c) -{ - if( (r + A.getRows() ) <= rowNum && (c + A.getCols() ) <= colNum ){ - // recopy matrix A in the current one, does not call static function to avoid initialisation and recopy of matrix - for(unsigned int i=r; i<(r+A.getRows()); i++){ - for(unsigned int j=c; j<(c+A.getCols()); j++){ - (*this)[i][j] = A[i-r][j-c]; - } - } - } - else{ - throw vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\tIncorrect size of the matrix to insert data."); - } -} - - -/*! -Compute the eigenvalues of a n-by-n real symmetric matrix. - -\return The eigenvalues of a n-by-n real symmetric matrix. - -\warning This method is only available if the Gnu Scientific Library -(GSL) is detected as a third party library. - -\exception vpMatrixException::matrixError If the matrix is not -square or if the matrix is not symmetric. - -\exception vpMatrixException::notImplementedError If the GSL library -is not detected - -Here an example: -\code -#include <iostream> - -#include <visp/vpColVector.h> -#include <visp/vpMatrix.h> - -int main() -{ -vpMatrix A(3,3); // A is a symmetric matrix -A[0][0] = 1/1.; A[0][1] = 1/2.; A[0][2] = 1/3.; -A[1][0] = 1/2.; A[1][1] = 1/3.; A[1][2] = 1/4.; -A[2][0] = 1/3.; A[2][1] = 1/4.; A[2][2] = 1/5.; -std::cout << "Initial symmetric matrix: \n" << A << std::endl; - -// Compute the eigen values -vpColVector evalue; // Eigenvalues -evalue = A.eigenValues(); -std::cout << "Eigen values: \n" << evalue << std::endl; -} -\endcode - -\sa eigenValues(vpColVector &, vpMatrix &) - -*/ -vpColVector vpMatrix::eigenValues() -{ - if (rowNum != colNum) { - vpERROR_TRACE("Eigen values computation: ERR Matrix not square") ; - throw(vpMatrixException(vpMatrixException::matrixError, - "\n\t\tEigen values computation: ERR Matrix not square")) ; - } - -#ifdef VISP_HAVE_GSL /* be careful of the copy below */ - { - // Check if the matrix is symetric: At - A = 0 - vpMatrix At_A = (*this).t() - (*this); - for (unsigned int i=0; i < rowNum; i++) { - for (unsigned int j=0; j < rowNum; j++) { - //if (At_A[i][j] != 0) { - if (std::fabs(At_A[i][j]) > std::numeric_limits<double>::epsilon()) { - vpERROR_TRACE("Eigen values computation: ERR Matrix not symmetric") ; - throw(vpMatrixException(vpMatrixException::matrixError, - "\n\t\tEigen values computation: " - "ERR Matrix not symmetric")) ; - } - } - } - - - vpColVector evalue(rowNum); // Eigen values - - gsl_vector *eval = gsl_vector_alloc (rowNum); - gsl_matrix *evec = gsl_matrix_alloc (rowNum, colNum); - - gsl_eigen_symmv_workspace * w = gsl_eigen_symmv_alloc (rowNum); - gsl_matrix *m = gsl_matrix_alloc(rowNum, colNum); - - unsigned int Atda = m->tda ; - for (unsigned int i=0 ; i < rowNum ; i++){ - unsigned int k = i*Atda ; - for (unsigned int j=0 ; j < colNum ; j++) - m->data[k+j] = (*this)[i][j] ; - } - gsl_eigen_symmv (m, eval, evec, w); - - gsl_eigen_symmv_sort (eval, evec, GSL_EIGEN_SORT_ABS_ASC); - - for (unsigned int i=0; i < rowNum; i++) { - evalue[i] = gsl_vector_get (eval, i); - } - - gsl_eigen_symmv_free (w); - gsl_vector_free (eval); - gsl_matrix_free (m); - gsl_matrix_free (evec); - - return evalue; - } -#else - { - vpERROR_TRACE("Not implemented since the GSL library is not detected.") ; - throw(vpMatrixException(vpMatrixException::notImplementedError, - "\n\t\tEigen values Computation: Not implemented " - "since the GSL library is not detected")) ; - } -#endif -} - -/*! -Compute the eigenvalues of a n-by-n real symmetric matrix. -\return The eigenvalues of a n-by-n real symmetric matrix. - -\warning This method is only available if the Gnu Scientific Library -(GSL) is detected as a third party library. - -\param evalue : Eigenvalues of the matrix. - -\param evector : Eigenvector of the matrix. - -\exception vpMatrixException::matrixError If the matrix is not -square or if the matrix is not symmetric. - -\exception vpMatrixException::notImplementedError If the GSL library -is not detected - -Here an example: -\code -#include <iostream> - -#include <visp/vpColVector.h> -#include <visp/vpMatrix.h> - -int main() -{ -vpMatrix A(4,4); // A is a symmetric matrix -A[0][0] = 1/1.; A[0][1] = 1/2.; A[0][2] = 1/3.; A[0][3] = 1/4.; -A[1][0] = 1/2.; A[1][1] = 1/3.; A[1][2] = 1/4.; A[1][3] = 1/5.; -A[2][0] = 1/3.; A[2][1] = 1/4.; A[2][2] = 1/5.; A[2][3] = 1/6.; -A[3][0] = 1/4.; A[3][1] = 1/5.; A[3][2] = 1/6.; A[3][3] = 1/7.; -std::cout << "Initial symmetric matrix: \n" << A << std::endl; - -vpColVector d; // Eigenvalues -vpMatrix V; // Eigenvectors - -// Compute the eigenvalues and eigenvectors -A.eigenValues(d, V); -std::cout << "Eigen values: \n" << d << std::endl; -std::cout << "Eigen vectors: \n" << V << std::endl; - -vpMatrix D; -D.diag(d); // Eigenvalues are on the diagonal - -std::cout << "D: " << D << std::endl; - -// Verification: A * V = V * D -std::cout << "AV-VD = 0 ? \n" << (A*V) - (V*D) << std::endl; -} -\endcode - -\sa eigenValues() - -*/ -#ifdef VISP_HAVE_GSL /* be careful of the copy below */ -void vpMatrix::eigenValues(vpColVector &evalue, vpMatrix &evector) -#else -void vpMatrix::eigenValues(vpColVector & /* evalue */, vpMatrix & /* evector */) -#endif -{ - if (rowNum != colNum) { - vpERROR_TRACE("Eigen values computation: ERR Matrix not square") ; - throw(vpMatrixException(vpMatrixException::matrixError, - "\n\t\tEigen values computation: ERR Matrix not square")) ; - } - -#ifdef VISP_HAVE_GSL /* be careful of the copy below */ - { - // Check if the matrix is symetric: At - A = 0 - vpMatrix At_A = (*this).t() - (*this); - for (unsigned int i=0; i < rowNum; i++) { - for (unsigned int j=0; j < rowNum; j++) { - //if (At_A[i][j] != 0) { - if (std::fabs(At_A[i][j]) > std::numeric_limits<double>::epsilon()) { - vpERROR_TRACE("Eigen values computation: ERR Matrix not symmetric") ; - throw(vpMatrixException(vpMatrixException::matrixError, - "\n\t\tEigen values computation: " - "ERR Matrix not symmetric")) ; - } - } - } - - // Resize the output matrices - evalue.resize(rowNum); - evector.resize(rowNum, colNum); - - gsl_vector *eval = gsl_vector_alloc (rowNum); - gsl_matrix *evec = gsl_matrix_alloc (rowNum, colNum); - - gsl_eigen_symmv_workspace * w = gsl_eigen_symmv_alloc (rowNum); - gsl_matrix *m = gsl_matrix_alloc(rowNum, colNum); - - unsigned int Atda = m->tda ; - for (unsigned int i=0 ; i < rowNum ; i++){ - unsigned int k = i*Atda ; - for (unsigned int j=0 ; j < colNum ; j++) - m->data[k+j] = (*this)[i][j] ; - } - gsl_eigen_symmv (m, eval, evec, w); - - gsl_eigen_symmv_sort (eval, evec, GSL_EIGEN_SORT_ABS_ASC); - - for (unsigned int i=0; i < rowNum; i++) { - evalue[i] = gsl_vector_get (eval, i); - } - Atda = evec->tda ; - for (unsigned int i=0; i < rowNum; i++) { - unsigned int k = i*Atda ; - for (unsigned int j=0; j < rowNum; j++) { - evector[i][j] = evec->data[k+j]; - } - } - - - // { - // int i; - - // for (i = 0; i < rowNum; i++) - // { - // double eval_i - // = gsl_vector_get (eval, i); - // gsl_vector_view evec_i - // = gsl_matrix_column (evec, i); - - // printf ("eigenvalue = %g\n", eval_i); - // printf ("eigenvector = \n"); - // gsl_vector_fprintf (stdout, - // &evec_i.vector, "%g"); - // } - // } - - gsl_eigen_symmv_free (w); - gsl_vector_free (eval); - gsl_matrix_free (m); - gsl_matrix_free (evec); - } -#else - { - vpERROR_TRACE("Not implemented since the GSL library is not detected.") ; - throw(vpMatrixException(vpMatrixException::notImplementedError, - "\n\t\tEigen values Computation: Not implemented " - "since the GSL library is not detected")) ; - } -#endif -} - - -/*! -Function to compute the null space (the kernel) of the interaction matrix A which is not full rank. -The null space ( the kernel ) of a matrix A is defined as Null(A) = Ker(M) ={KerA : A*KerA =0}. - -\param kerA : The matrix to contain the null space (kernel) of A (A*KerA.t()=0) -\param svThreshold : Specify the used threshold in the svd(...) function (a function to compute the singular value decomposition) - -\return the rank of the matrix. -*/ -unsigned int -vpMatrix::kernel(vpMatrix &kerA, double svThreshold) -{ -#if (DEBUG_LEVEL1) - std::cout << "begin Kernel" << std::endl ; -#endif - unsigned int i, j ; - unsigned int ncaptor = getRows() ; - unsigned int ddl = getCols() ; - vpMatrix C ; - - if (ncaptor == 0) - std::cout << "Erreur Matrice non initialise" << std::endl ; - -#if (DEBUG_LEVEL2) - { - std::cout << "Interaction matrix L" << std::endl ; - std::cout << *this ; - std::cout << "signaux capteurs : " << ncaptor << std::endl ; - } -#endif - - C.resize(ddl,ncaptor) ; - unsigned int min ; - - if (ncaptor > ddl) min = ddl ; else min = ncaptor ; - - // ! the SVDcmp function inthe matrix lib is destructive - - vpMatrix a1 ; - vpMatrix a2 ; - - vpColVector sv(ddl) ; // singular values - vpMatrix v(ddl,ddl) ; - - if (ncaptor < ddl) - { - a1.resize(ddl,ddl) ; - } - else - { - a1.resize(ncaptor,ddl) ; - } - - a2.resize(ncaptor,ddl) ; - - for (i=0 ; i < ncaptor ; i++) - for (j=0 ; j < ddl ; j++) - { - a1[i][j] = (*this)[i][j] ; - a2[i][j] = (*this)[i][j] ; - } - - - if (ncaptor < ddl) - { - for (i=ncaptor ; i < ddl ; i++) - for (j=0 ; j < ddl ; j++) - { - a1[i][j] = 0 ; - } - a1.svd(sv,v); - } - else - { - a1.svd(sv,v); - } - - // compute the highest singular value and the rank of h - - double maxsv = 0 ; - for (i=0 ; i < ddl ; i++) - if (fabs(sv[i]) > maxsv) maxsv = fabs(sv[i]) ; - -#if (DEBUG_LEVEL2) - { - std::cout << "Singular Value : (" ; - for (i=0 ; i < ddl ; i++) std::cout << sv[i] << " , " ; - std::cout << ")" << std::endl ; - } -#endif - - unsigned int rank = 0 ; - for (i=0 ; i < ddl ; i++) - if (fabs(sv[i]) > maxsv*svThreshold) rank++ ; - -#if (DEBUG_LEVEL2) - { - - for (i = 0 ; i < ddl ; i++) - { - for (j = 0 ; j < ncaptor ; j++) - { - unsigned int k=0 ; - C[i][j] = 0.0; - - // modif le 25 janvier 1999 0.001 <-- maxsv*1.e-ndof - // sinon on peut observer une perte de range de la matrice - // ( d'ou venait ce 0.001 ??? ) - for (k=0 ; k < ddl ; k++) if (fabs(sv[k]) > maxsv*svThreshold) - { - C[i][j] += v[i][k]*a1[j][k]/sv[k]; - } - } - } - - // cout << v << endl ; - std::cout << C << std::endl ; - } -#endif - /*------------------------------------------------------- */ - if (rank != ddl) - { - // Compute the kernel if wanted - if (min < ddl) - { - vpMatrix ch(ddl,ddl) ; - ch = C*a2 ; - ch.svd(sv,v) ; - - } - // if (noyau == 1) - { - maxsv = 0 ; - for (i=0 ; i < ddl ; i++) - if (fabs(sv[i]) > maxsv) maxsv = fabs(sv[i]) ; - rank = 0 ; - for (i=0 ; i < ddl ; i++) - if (fabs(sv[i]) > maxsv*svThreshold) rank++ ; - vpMatrix cons(ddl,ddl) ; - - cons =0 ; - for (j = 0 ; j < ddl ; j++) - { - for (i = 0 ; i < ddl ; i++) - // Change Nicolas Mansard 23/4/04 - // was if (fabs(sv[i]) < maxsv*seuilvp) - if (fabs(sv[i]) <= maxsv*svThreshold) - { - cons[i][j] = v[j][i]; - } - } - - vpMatrix Ker(ddl-rank,ddl) ; - unsigned int k =0 ; - for (j = 0 ; j < ddl ; j++) - { - // cout << cons.Row(j+1) << " = " << cons.Row(j+1).SumSquare() << endl ; - - //if (cons.row(j+1).sumSquare() !=0) - if (std::fabs(cons.getRow(j).sumSquare()) > std::numeric_limits<double>::epsilon()) - { - for (i=0 ; i < cons.getCols() ; i++) - Ker[k][i] = cons[j][i] ; - // Ker.Row(k+1) = cons.Row(j+1) ; - k++; - } - } - kerA = Ker ; - } - } -#if (DEBUG_LEVEL1) - std::cout << "end Kernel" << std::endl ; -#endif - return rank ; -} - -/*! -Compute the determinant of a n-by-n matrix. - -\param method : Method used to compute the determinant. Default LU -decomposition methos is faster than the method based on Gaussian -elimination. - -\return Determinant of the matrix. - -\code -#include <iostream> - -#include <visp/vpMatrix.h> - -int main() -{ -vpMatrix A(3,3); -A[0][0] = 1/1.; A[0][1] = 1/2.; A[0][2] = 1/3.; -A[1][0] = 1/3.; A[1][1] = 1/4.; A[1][2] = 1/5.; -A[2][0] = 1/6.; A[2][1] = 1/7.; A[2][2] = 1/8.; -std::cout << "Initial matrix: \n" << A << std::endl; - -// Compute the determinant -std:: cout << "Determinant by default method : " << -A.det() << std::endl; -std:: cout << "Determinant by LU decomposition: " << -A.det(vpMatrix::LU_DECOMPOSITION ) << std::endl; -} -\endcode -*/ -double vpMatrix::det(vpDetMethod method) const -{ - double det_ = 0; - - if ( method == LU_DECOMPOSITION ) - { - det_ = this->detByLU(); - } - - return (det_); -} - - -/*! -Save a matrix to a file. - -\param filename : Absolute file name. -\param M : Matrix to be saved. -\param binary : If true the matrix is saved in a binary file, else a text file. -\param header : Optional line that will be saved at the beginning of the file. - -\return Returns true if no problem happened. - -Warning : If you save the matrix as in a text file the precision is -less than if you save it in a binary file. -*/ -bool -vpMatrix::saveMatrix(const char *filename, const vpMatrix &M, - const bool binary, const char *header) -{ - std::fstream file; - - if (!binary) - file.open(filename, std::fstream::out); - else - file.open(filename, std::fstream::out|std::fstream::binary); - - if(!file) - { - file.close(); - return false; - } - - else - { - if (!binary) - { - unsigned int i = 0; - file << "# "; - while (header[i] != '\0') - { - file << header[i]; - if (header[i] == '\n') - file << "# "; - i++; - } - file << '\0'; - file << std::endl; - file << M.getRows() << "\t" << M.getCols() << std::endl; - file << M << std::endl; - } - else - { - int headerSize = 0; - while (header[headerSize] != '\0') headerSize++; - file.write(header,headerSize+1); - unsigned int matrixSize; - matrixSize = M.getRows(); - file.write((char*)&matrixSize,sizeof(int)); - matrixSize = M.getCols(); - file.write((char*)&matrixSize,sizeof(int)); - double value; - for(unsigned int i = 0; i < M.getRows(); i++) - { - for(unsigned int j = 0; j < M.getCols(); j++) - { - value = M[i][j]; - file.write((char*)&value,sizeof(double)); - } - } - } - } - - file.close(); - return true; -} - -/*! - Save a matrix in a YAML-formatted file. - - \param filename : absolute file name. - \param M : matrix to be saved in the file. - \param header : optional lines that will be saved at the beginning of the file. Should be YAML-formatted and will adapt to the indentation if any. - - \return Returns true if success. - - Here is an example of outputs. -\code -vpMatrix M(3,4); -vpMatrix::saveMatrixYAML("matrix.yml", M, "example: a YAML-formatted header"); -vpMatrix::saveMatrixYAML("matrixIndent.yml", M, "example:\n - a YAML-formatted header\n - with inner indentation"); -\endcode -Content of matrix.yml: -\code -example: a YAML-formatted header -rows: 3 -cols: 4 -data: - - [0, 0, 0, 0] - - [0, 0, 0, 0] - - [0, 0, 0, 0] -\endcode -Content of matrixIndent.yml: -\code -example: - - a YAML-formatted header - - with inner indentation -rows: 3 -cols: 4 -data: - - [0, 0, 0, 0] - - [0, 0, 0, 0] - - [0, 0, 0, 0] -\endcode - - \sa loadMatrixYAML() -*/ -bool vpMatrix::saveMatrixYAML(const char *filename, const vpMatrix &M, const char *header) -{ - std::fstream file; - - file.open(filename, std::fstream::out); - - if(!file) - { - file.close(); - return false; - } - - unsigned int i = 0; - bool inIndent = false; - std::string indent = ""; - bool checkIndent = true; - while (header[i] != '\0') - { - file << header[i]; - if(checkIndent) - { - if (inIndent) - { - if(header[i] == ' ') - indent += " "; - else if (indent.length() > 0) - checkIndent = false; - } - if (header[i] == '\n' || (inIndent && header[i] == ' ')) - inIndent = true; - else - inIndent = false; - } - i++; - } - - if(i != 0) - file << std::endl; - file << "rows: " << M.getRows() << std::endl; - file << "cols: " << M.getCols() << std::endl; - - if(indent.length() == 0) - indent = " "; - - file << "data: " << std::endl; - unsigned int j; - for(i=0;i<M.getRows();++i) - { - file << indent << "- ["; - for(j=0;j<M.getCols()-1;++j) - file << M[i][j] << ", "; - file << M[i][j] << "]" << std::endl; - } - - file.close(); - return true; -} - - -/*! - Load a matrix from a file. - - \param filename : Absolute file name. - \param M : Matrix to be loaded. - \param binary : If true the matrix is loaded from a binary file, - else from a text file. - \param header : header of the file loaded in this parameter. - - \return Returns true if no problem happened. -*/ -bool -vpMatrix::loadMatrix(const char *filename, vpMatrix &M, const bool binary, - char *header) -{ - std::fstream file; - - if (!binary) - file.open(filename, std::fstream::in); - else - file.open(filename, std::fstream::in|std::fstream::binary); - - if(!file) - { - file.close(); - return false; - } - - else - { - if (!binary) - { - char c='0'; - std::string h; - while ((c != '\0') && (c != '\n')) - { - file.read(&c,1); - h+=c; - } - if (header != NULL) - strncpy(header, h.c_str(), h.size() + 1); - - unsigned int rows, cols; - file >> rows; - file >> cols; - - if (rows > std::numeric_limits<unsigned int>::max() - || cols > std::numeric_limits<unsigned int>::max()) - throw vpException(vpException::badValue, "Matrix exceed the max size."); - - M.resize(rows,cols); - - double value; - for(unsigned int i = 0; i < rows; i++) - { - for(unsigned int j = 0; j < cols; j++) - { - file >> value; - M[i][j] = value; - } - } - } - else - { - char c='0'; - std::string h; - while ((c != '\0') && (c != '\n')) - { - file.read(&c,1); - h+=c; - } - if (header != NULL) - strncpy(header, h.c_str(), h.size() + 1); - - unsigned int rows, cols; - file.read((char*)&rows,sizeof(unsigned int)); - file.read((char*)&cols,sizeof(unsigned int)); - M.resize(rows,cols); - - double value; - for(unsigned int i = 0; i < rows; i++) - { - for(unsigned int j = 0; j < cols; j++) - { - file.read((char*)&value,sizeof(double)); - M[i][j] = value; - } - } - } - } - - file.close(); - return true; -} - - -/*! - Load a matrix from a YAML-formatted file. - - \param filename : absolute file name. - \param M : matrix to be loaded from the file. - \param header : header of the file is loaded in this parameter. - - \return Returns true on success. - - \sa saveMatrixYAML() - -*/ -bool -vpMatrix::loadMatrixYAML(const char *filename, vpMatrix &M, char *header) -{ - std::fstream file; - - file.open(filename, std::fstream::in); - - if(!file) - { - file.close(); - return false; - } - - unsigned int rows = 0,cols = 0; - std::string h; - std::string line,subs; - bool inheader = true; - unsigned int i=0, j; - unsigned int lineStart = 0; - - while ( getline (file,line) ) - { - if(inheader) - { - if(rows == 0 && line.compare(0,5,"rows:") == 0) - { - std::stringstream ss(line); - ss >> subs; - ss >> rows; - } - else if (cols == 0 && line.compare(0,5,"cols:") == 0) - { - std::stringstream ss(line); - ss >> subs; - ss >> cols; - } - else if (line.compare(0,5,"data:") == 0) - inheader = false; - else - h += line + "\n"; - } - else - { - // if i == 0, we just got out of the header: initialize matrix dimensions - if(i == 0) - { - if(rows == 0 || cols == 0) - { - file.close(); - return false; - } - M.resize(rows, cols); - // get indentation level which is common to all lines - lineStart = (unsigned int)line.find("[") + 1; - } - std::stringstream ss(line.substr(lineStart, line.find("]") - lineStart)); - j = 0; - while(getline(ss, subs, ',')) - M[i][j++] = atof(subs.c_str()); - i++; - } - } - - if (header != NULL) - strncpy(header, h.substr(0,h.length()-1).c_str(), h.size()); - - file.close(); - return true; -} - -/*! - -Compute the exponential matrix of a square matrix. - -\return Return the exponential matrix. - -*/ -vpMatrix -vpMatrix::expm() -{ - if(colNum != rowNum) - { - vpTRACE("The matrix must be square"); - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "The matrix must be square" )); - } - else - { -#ifdef VISP_HAVE_GSL - size_t size_ = rowNum * colNum; - double *b = new double [size_]; - for (size_t i=0; i< size_; i++) - b[i] = 0.; - gsl_matrix_view m = gsl_matrix_view_array(this->data, rowNum, colNum); - gsl_matrix_view em = gsl_matrix_view_array(b, rowNum, colNum); - gsl_linalg_exponential_ss(&m.matrix, &em.matrix, 0); - //gsl_matrix_fprintf(stdout, &em.matrix, "%g"); - vpMatrix expA(rowNum, colNum); - memcpy(expA.data, b, size_ * sizeof(double)); - - delete [] b; - return expA; -#else - vpMatrix _expE(rowNum, colNum); - vpMatrix _expD(rowNum, colNum); - vpMatrix _expX(rowNum, colNum); - vpMatrix _expcX(rowNum, colNum); - vpMatrix _eye(rowNum, colNum); - - _eye.setIdentity(); - vpMatrix exp(*this); - - // double f; - int e; - double c = 0.5; - int q = 6; - int p = 1; - - double nA = 0; - for (unsigned int i = 0; i < rowNum;i++) - { - double sum = 0; - for (unsigned int j=0; j < colNum; j++) - { - sum += fabs((*this)[i][j]); - } - if (sum>nA||i==0) - { - nA=sum; - } - } - - /* f = */ frexp(nA, &e); - //double s = (0 > e+1)?0:e+1; - double s = e+1; - - double sca = 1.0 / pow(2.0,s); - exp=sca*exp; - _expX=*this; - _expE=c*exp+_eye; - _expD=-c*exp+_eye; - for (int k=2;k<=q;k++) - { - c = c * ((double)(q-k+1)) / ((double)(k*(2*q-k+1))); - _expcX=exp*_expX; - _expX=_expcX; - _expcX=c*_expX; - _expE=_expE+_expcX; - if (p) _expD=_expD+_expcX; - else _expD=_expD- _expcX; - p = !p; - } - _expX=_expD.inverseByLU(); - exp=_expX*_expE; - for (int k=1;k<=s;k++) - { - _expE=exp*exp; - exp=_expE; - } - return exp; -#endif - } -} - -double -vpMatrix::getMinValue() const -{ - double *dataptr = data; - double min = *dataptr; - dataptr++; - for (unsigned int i = 0; i < dsize-1; i++) - { - if (*dataptr < min) min = *dataptr; - dataptr++; - } - return min; -} - -double -vpMatrix::getMaxValue() const -{ - double *dataptr = data; - double max = *dataptr; - dataptr++; - for (unsigned int i = 0; i < dsize-1; i++) - { - if (*dataptr > max) max = *dataptr; - dataptr++; - } - return max; -} - - -/**************************************************************************************************************/ -/**************************************************************************************************************/ - - -//Specific functions - -/* -input:: matrix M(nCols,nRows), nCols > 3, nRows > 3 , nCols == nRows. - -output:: the complement matrix of the element (rowNo,colNo). -This is the matrix obtained from M after elimenating the row rowNo and column colNo - -example: -1 2 3 -M = 4 5 6 -7 8 9 -1 3 -subblock(M, 1, 1) give the matrix 7 9 -*/ -vpMatrix subblock(const vpMatrix &M, unsigned int col, unsigned int row) -{ - vpMatrix M_comp(M.getRows()-1,M.getCols()-1); - - for ( unsigned int i = 0 ; i < col ; i++) - { - for ( unsigned int j = 0 ; j < row ; j++) - M_comp[i][j]=M[i][j]; - for ( unsigned int j = row+1 ; j < M.getRows() ; j++) - M_comp[i][j-1]=M[i][j]; - } - for ( unsigned int i = col+1 ; i < M.getCols(); i++) - { - for ( unsigned int j = 0 ; j < row ; j++) - M_comp[i-1][j]=M[i][j]; - for ( unsigned int j = row+1 ; j < M.getRows() ; j++) - M_comp[i-1][j-1]=M[i][j]; - } - return M_comp; -} - -/*! - \return The condition number, the ratio of the largest singular value of the matrix to the smallest. - */ -double vpMatrix::cond() -{ - vpMatrix v; - vpColVector w; - - vpMatrix M; - M = *this; - - M.svd(w, v); - double min=w[0]; - double max=w[0]; - for(unsigned int i=0;i<M.getCols();i++) - { - if(min>w[i])min=w[i]; - if(max<w[i])max=w[i]; - } - return max/min; -} - -/*! - Compute \f${\bf H} + \alpha * diag({\bf H})\f$ - \param H : input Matrix \f${\bf H}\f$. This matrix should be square. - \param alpha : Scalar \f$\alpha\f$ - \param HLM : Resulting operation. - */ -void vpMatrix::computeHLM(const vpMatrix &H, const double &alpha, vpMatrix &HLM) -{ - if(H.getCols() != H.getRows()) - { - vpTRACE("The matrix must be square"); - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "The matrix must be square" )); - } - HLM.resize(H.getRows(), H.getCols()); - - for(unsigned int i=0;i<H.getCols();i++) - { - for(unsigned int j=0;j<H.getCols();j++) - { - HLM[i][j]=H[i][j]; - if(i==j) - HLM[i][j]+= alpha*H[i][j]; - } - } - -} - -#undef DEBUG_LEVEL1 -#undef DEBUG_LEVEL2 - -/* -* Local variables: -* c-basic-offset: 2 -* End: -*/ diff --git a/src/math/matrix/vpMatrix_covariance.cpp b/src/math/matrix/vpMatrix_covariance.cpp deleted file mode 100644 index c8490109a1c149316683090d92359ed2b74e7db3..0000000000000000000000000000000000000000 --- a/src/math/matrix/vpMatrix_covariance.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** - * - * $Id: vpMatrix_lu.cpp 3530 2012-01-03 10:52:12Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTb OF ANb KIND, INCLUDING THE - * WARRANTb OF DESIGN, MERCHANTABILITb AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Covariance matrix computation. - * - * Authors: - * Aurelien Yol - * - *****************************************************************************/ - -#include <limits> // numeric_limits -#include <cmath> // std::fabs() - -#include <visp/vpConfig.h> -#include <visp/vpMatrix.h> -#include <visp/vpColVector.h> -#include <visp/vpMatrixException.h> - - -/*! - Compute the covariance matrix of the parameters x from a least squares minimisation defined as: - Ax = b - - \param A : Matrix A from Ax = b. - - \param x : Vector x from Ax = b corresponding to the parameters to estimate. - - \param b : Vector b from Ax = b. -*/ -vpMatrix vpMatrix::computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b) -{ -// double denom = ((double)(A.getRows()) - (double)(A.getCols())); // To consider OLS Estimate for sigma - double denom = ((double)(A.getRows())); // To consider MLE Estimate for sigma - - if(denom <= std::numeric_limits<double>::epsilon()) - throw vpMatrixException(vpMatrixException::divideByZeroError, "Impossible to compute covariance matrix: not enough data"); - -// double sigma2 = ( ((b.t())*b) - ( (b.t())*A*x ) ); // Should be equivalent to line bellow. - double sigma2 = (b - (A * x)).t() * (b - (A * x)); - - sigma2 /= denom; - - return (A.t()*A).pseudoInverse(A.getCols()*std::numeric_limits<double>::epsilon())*sigma2; -} - -/*! - Compute the covariance matrix of the parameters x from a least squares minimisation defined as: - WAx = Wb - - \param A : Matrix A from WAx = Wb. - - \param x : Vector x from WAx = Wb corresponding to the parameters to estimate. - - \param b : Vector b from WAx = Wb. - - \param W : Diagonal weigths matrix from WAx = Wb. -*/ -vpMatrix vpMatrix::computeCovarianceMatrix(const vpMatrix &A, const vpColVector &x, const vpColVector &b, const vpMatrix &W) -{ - double denom = 0.0; - vpMatrix W2(W.getCols(),W.getCols()); - for(unsigned int i = 0 ; i < W.getCols() ; i++){ - denom += W[i][i]; - W2[i][i] = W[i][i]*W[i][i]; - } - - if(denom <= std::numeric_limits<double>::epsilon()) - throw vpMatrixException(vpMatrixException::divideByZeroError, "Impossible to compute covariance matrix: not enough data"); - -// double sigma2 = ( ((W*b).t())*W*b - ( ((W*b).t())*W*A*x ) ); // Should be equivalent to line bellow. - double sigma2 = (W * b - (W * A * x)).t() * (W*b - (W * A * x)); - sigma2 /= denom; - - return (A.t()*(W2)*A).pseudoInverse(A.getCols()*std::numeric_limits<double>::epsilon())*sigma2; -} diff --git a/src/math/matrix/vpRowVector.cpp b/src/math/matrix/vpRowVector.cpp deleted file mode 100644 index 2f8ca5e88319649b5a6553b1da9870adf16ea50b..0000000000000000000000000000000000000000 --- a/src/math/matrix/vpRowVector.cpp +++ /dev/null @@ -1,392 +0,0 @@ -/**************************************************************************** - * - * $Id: vpRowVector.cpp 5185 2015-01-21 14:36:41Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Operation on row vectors. - * - * Authors: - * Eric Marchand - * - *****************************************************************************/ - - -/*! - \file vpRowVector.cpp - \brief Definition of vpRowVector class member -*/ - - -#include <visp/vpMatrix.h> -#include <visp/vpMatrixException.h> -#include <visp/vpRowVector.h> -#include <visp/vpColVector.h> -#include <visp/vpDebug.h> -#include <string.h> -#include <stdlib.h> -//! Copy operator. Allow operation such as A = v -vpRowVector & vpRowVector::operator=(const vpRowVector &v) -{ - if (colNum==0) - resize(v.getCols()); - - for (unsigned int i=0; i<rowNum; i++) { - for (unsigned int j=0; j<colNum; j++) { - rowPtrs[i][j] = v.rowPtrs[i][j]; - } - } - return *this; -} - -/*! - \brief copy from a matrix - \warning Handled with care m should be a 1 column matrix -*/ -vpRowVector & vpRowVector::operator=(const vpMatrix &m) -{ - if (m.getCols() != colNum) - resize(m.getCols()); - - memcpy(data, m.data, colNum*sizeof(double)) ; - /* - for (int i=0; i<rowNum; i++) { - for (int j=0; j<colNum; j++) { - rowPtrs[i][j] = m.rowPtrs[i][j]; - } - }*/ - return *this; -} - -//! initialisation each element of the vector is x -vpRowVector & vpRowVector::operator=(double x) -{ - for (unsigned int i=0; i<rowNum; i++) { - for (unsigned int j=0; j<colNum; j++) { - rowPtrs[i][j] = x; - } - } - return *this; -} - -/*! - - Multiply a row vector by a column vector. - - \param x : Column vector. - - \warning The number of elements of the two vectors must be equal. - - \exception vpMatrixException::matrixError : If the number of elements of the - two vectors is not the same. - - \return A scalar. - -*/ -double vpRowVector::operator*(const vpColVector &x) const -{ - unsigned int nelements = x.getRows(); - if (getCols() != nelements ) { - throw(vpException(vpException::dimensionError, - "Bad size during vpRowVector (1x%d) by vpColVector (%dx1) multiplication", - colNum, x.getRows())) ; - } - - double scalar = 0.0; - - for (unsigned int i=0; i<nelements; i++) { - scalar += (*this)[i] * x[i]; - } - return scalar; -} -/*! - - Multiply a row vector by a Matrix. - - \param A : Matrix. - - \warning The number of elements of the rowVector must be equal to the number - of rows of the matrix. - - \exception vpMatrixException::matrixError : If the number of elements of the - rowVector is not equal to the number of rows of the matrix. - - \return A vpRowVector. - -*/ -vpRowVector vpRowVector::operator*(const vpMatrix &A) const -{ - vpRowVector c(A.getCols()); - - if (colNum != A.getRows()) - { - vpERROR_TRACE("vpMatrix mismatch in vpRowVector/matrix multiply") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "vpMatrix mismatch in vpRowVector/matrix multiply")) ; - } - - c = 0.0; - - for (unsigned int i=0;i<colNum;i++) { - { - double bi = data[i] ; // optimization em 5/12/2006 - for (unsigned int j=0;j<A.getCols();j++) { - c[j]+=bi*A[i][j]; - } - } - } - - return c ; -} - -//! Operator A = -A -vpRowVector vpRowVector::operator-() const -{ - vpRowVector A ; - try { - A.resize(colNum) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - - double *vd = A.data ; double *d = data ; - - for (unsigned int i=0; i<colNum; i++) - *(vd++)= - (*d++); - - return A; -} - -//! Substraction of two vectors V = A-v -vpRowVector vpRowVector::operator-(const vpRowVector &m) const -{ - if (getCols() != m.getCols() ) { - throw(vpException(vpException::dimensionError, - "Bad size during vpRowVector (1x%d) and vpRowVector (1x%d) substraction", - getCols(), m.getCols())) ; - } - - vpRowVector v(colNum) ; - - for (unsigned int i=0;i<colNum;i++) - v[i] = (*this)[i] - m[i]; - return v; -} - -//! Addition of two vectors V = A-v -vpRowVector vpRowVector::operator+(const vpRowVector &m) const -{ - if (getCols() != m.getCols() ) { - throw(vpException(vpException::dimensionError, - "Bad size during vpRowVector (1x%d) and vpRowVector (1x%d) substraction", - getCols(), m.getCols())) ; - } - - vpRowVector v(colNum) ; - - for (unsigned int i=0;i<colNum;i++) - v[i] = (*this)[i] + m[i]; - return v; -} - -/*! - Copy operator. - Allows operation such as A << v - \code -#include <visp/vpRowVector.h> - -int main() -{ - vpRowVector A, B(5); - for (unsigned int i=0; i<B.size(); i++) - B[i] = i; - A << B; - std::cout << "A: \n" << A << std::endl; -} - \endcode - In row vector A we get: - \code -A: -0 1 2 3 4 - \endcode - - */ -vpRowVector & vpRowVector::operator<<(const vpRowVector &v) -{ - *this = v; - return *this; -} - -/*! - \brief Transpose the row vector A - - A is defined inside the class - - \return A^T -*/ -vpColVector vpRowVector::t() const -{ - vpColVector tmp(colNum); - memcpy(tmp.data, data, colNum*sizeof(double)) ; - /* - for (int i=0;i<colNum;i++) - tmp[i] = (*this)[i]; - */ - return tmp; -} - -//! copy constructor -vpRowVector::vpRowVector (const vpRowVector &v) : vpMatrix(v) -{ -} - -//! Constructor (Take line i of matrix m) -vpRowVector::vpRowVector (vpMatrix &m, unsigned int i) : vpMatrix(m, i, 0, 1, m.getCols()) -{ -} - -/*! - \relates vpRowVector - \brief normalise the vector - - \f[ - {\bf x}_i = \frac{{\bf x}_i}{\sqrt{\sum_{i=1}^{n}x^2_i}} - \f] -*/ -vpRowVector &vpRowVector::normalize(vpRowVector &x) const -{ - x = x/sqrt(x.sumSquare()); - - return x; -} - - -/*! - \relates vpRowVector - \brief normalise the vector - - \f[ - {\bf x}_i = \frac{{\bf x}_i}{\sqrt{\sum_{i=1}^{n}x^2_i}} - \f] -*/ -vpRowVector &vpRowVector::normalize() -{ - double sum_square = sumSquare() ; - *this /= sum_square ; - - return *this; -} - -/*! - \brief reshape the row vector in a matrix - \param nrows : number of rows of the matrix - \param ncols : number of columns of the matrix - \return a vpMatrix -*/ -vpMatrix vpRowVector::reshape(const unsigned int &nrows,const unsigned int &ncols){ - vpMatrix m(nrows,ncols); - reshape(m,nrows,ncols); - return m; -} - -/*! - \brief reshape the row vector in a matrix - \param m : the reshaped Matrix - \param nrows : number of rows of the matrix - \param ncols : number of columns of the matrix -*/ -void vpRowVector::reshape(vpMatrix & m,const unsigned int &nrows,const unsigned int &ncols){ - if(dsize!=nrows*ncols) - { - vpERROR_TRACE("\n\t\t vpSubRowVector mismatch size for reshape vpSubColVector in a vpMatrix") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpSubRowVector mismatch size for reshape vpSubColVector in a vpMatrix")) ; - } - try - { - if ((m.getRows() != nrows) || (m.getCols() != ncols)) m.resize(nrows,ncols); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - std::cout << me << std::endl ; - throw ; - } - for(unsigned int i =0; i< nrows; i++) - for(unsigned int j =0; j< ncols; j++) - m[i][j]=data[i*nrows+j]; -} - -/*! - Insert a row vector. - \param i : Index of the first element to introduce. This index starts from 0. - \param v : Row vector to insert. - - The following example shows how to use this function: - \code -#include <visp/vpRowVector.h> - -int main() -{ - vpRowVector v(4); - for (unsigned int i=0; i < v.size(); i++) - v[i] = i; - std::cout << "v:\n" << v << std::endl; - - vpRowVector w(2); - for (unsigned int i=0; i < w.size(); i++) - w[i] = i+10; - std::cout << "w:\n" << w << std::endl; - - v.insert(1, w); - std::cout << "v:\n" << v << std::endl; -} - \endcode - It produces the following output: - \code -v: -0 1 2 3 -w: -10 11 -v: -0 10 11 3 - \endcode - */ -void vpRowVector::insert(unsigned int i, const vpRowVector &v) -{ - if (i+v.size() > this->size()) - throw(vpException(vpException::dimensionError, "Unable to insert a row vector")); - for (unsigned int j=0; j < v.size(); j++) - (*this)[i+j] = v[j]; -} diff --git a/src/math/matrix/vpRowVector.h b/src/math/matrix/vpRowVector.h deleted file mode 100644 index e16a36db12e657be6b38e5dc1ea992b82b7e03a8..0000000000000000000000000000000000000000 --- a/src/math/matrix/vpRowVector.h +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** - * - * $Id: vpRowVector.h 5185 2015-01-21 14:36:41Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Operation on row vectors. - * - * Authors: - * Eric Marchand - * - *****************************************************************************/ - - - - -#ifndef vpRowVector_H -#define vpRowVector_H - -#include <visp/vpMatrix.h> - -class vpMatrix; - -/*! - \file vpRowVector.h - \brief definition of row vector class as well - as a set of operations on these vector -*/ - -/*! - \class vpRowVector - - \ingroup Matrix - \brief Definition of the row vector class. - - vpRowVector class provides a data structure for the row vectors as well - as a set of operations on these vectors - - \author Eric Marchand (IRISA - INRIA Rennes) - - \warning Note the vector in the class (*this) will be noted A in the comment - - \ingroup libmath -*/ -class VISP_EXPORT vpRowVector : public vpMatrix -{ - friend class vpMatrix; - - -protected: - //! Constructor (Take line i of matrix m) - vpRowVector(vpMatrix &m, unsigned int i); - -public: - //! Basic constructor. - vpRowVector() : vpMatrix() {}; - //! Constructor of vector of size n. - vpRowVector(unsigned int n) : vpMatrix(1, n){}; - //! Constructor of vector of size n. Each element is set to \e val. - vpRowVector(unsigned int n, double val) : vpMatrix(1, n, val){}; - //! Copy constructor. - vpRowVector(const vpRowVector &v); - - void insert(unsigned int i, const vpRowVector &v); - - /*! Set the size of the row vector. - \param i : Column vector size. - \param flagNullify : If true, set the data to zero. - */ - inline void resize(const unsigned int i, const bool flagNullify = true) - { - vpMatrix::resize(1, i, flagNullify); - } - //! Access V[i] = x - inline double &operator [](unsigned int n) { return *(data+n); } - //! Access x = V[i] - inline const double &operator [](unsigned int n) const { return *(data+n) ; } - - //! Copy operator. Allow operation such as A = v - vpRowVector &operator=(const vpRowVector &v); - //! copy from a matrix - vpRowVector & operator=(const vpMatrix &m) ; - //! Initialize each element of the vector to x - vpRowVector& operator=(const double x); - - //!operator dot product - double operator*(const vpColVector &x) const; - //!operator dot product - vpRowVector operator*(const vpMatrix &A) const; - - //! Addition of two vectors V = A+v - vpRowVector operator+(const vpRowVector &v) const; - - //! Substraction of two vectors V = A-v - vpRowVector operator-(const vpRowVector &v) const; - - //! Operator A = -A - vpRowVector operator-() const; - // Copy operator. Allow operation such as A << v - vpRowVector &operator<<(const vpRowVector &v); - - //! Reshape methods. - void reshape(vpMatrix & m,const unsigned int &nrows,const unsigned int &ncols); - vpMatrix reshape(const unsigned int &nrows,const unsigned int &ncols); - - //! Transpose the vector. - vpColVector t() const; - - //! Normalise the vector. - vpRowVector &normalize() ; - //! Normalise the vector. - vpRowVector &normalize(vpRowVector &x) const ; - - /*! - - Return the size of the vector in term of number of columns. - - */ - inline unsigned int size() const - { - return getCols(); - } - -}; - - -#endif - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/math/matrix/vpSubColVector.cpp b/src/math/matrix/vpSubColVector.cpp deleted file mode 100644 index 4b93b5f0b0c9861a22fefb9002451c5df7f12b92..0000000000000000000000000000000000000000 --- a/src/math/matrix/vpSubColVector.cpp +++ /dev/null @@ -1,189 +0,0 @@ -/**************************************************************************** - * - * $Id: vpSubColVector.cpp 4632 2014-02-03 17:06:40Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Mask on a vpColVector . - * - * Authors: - * Laneurit Jean - * - *****************************************************************************/ - - -#include <visp/vpSubColVector.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpDebug.h> -#include <stdlib.h> - -vpSubColVector::vpSubColVector() - : pRowNum(0), parent(NULL) -{ -} - -/*! - \brief Constructor - \param v : parent col vector - \param offset : offset where subColVector start in the parent colVector - \param nrows : size of the subColVector -*/ -vpSubColVector::vpSubColVector(vpColVector &v, const unsigned int & offset, const unsigned int & nrows) - : pRowNum(0), parent(NULL) -{ - init(v,offset,nrows); -} - -/*! - \brief Initialisation of a the subColVector - \param v : parent col vector - \param offset : offset where subColVector start in the parent colVector - \param nrows : size of the subColVector -*/ -void vpSubColVector::init(vpColVector &v, - const unsigned int & offset, - const unsigned int & nrows){ - - if(!v.data){ - vpERROR_TRACE("\n\t\t vpSubColvector parent vpColVector has been destroyed"); - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpSubColvector parent vpColVector has been destroyed")) ; - } - - if(offset+nrows<=v.getRows()){ - data=v.data+offset; - - rowNum=nrows; - colNum = 1; - - pRowNum=v.getRows(); - parent=&v; - - if(rowPtrs){ - free(rowPtrs); - } - - rowPtrs=(double**)malloc( parent->getRows() * sizeof(double*)); - for(unsigned int i=0;i<nrows;i++) - rowPtrs[i]=v.data+i+offset; - - dsize = rowNum ; - trsize =0 ; - }else{ - vpERROR_TRACE("SubColVector cannot be contain in parent ColVector") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError,"SubColVector cannot be contain in parent ColVector")) ; - } -} - -vpSubColVector::~vpSubColVector(){ - data=NULL ; -} - - -/*! - \brief This method can be used to detect if the parent colVector - always exits or its size have not changed and throw an exception is not -*/ -void vpSubColVector::checkParentStatus(){ - if(!data){ - vpERROR_TRACE("\n\t\t vpSubColvector parent vpColVector has been destroyed"); - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpSubColvector parent vpColVector has been destroyed")) ; - } - if(pRowNum!=parent->getRows()){ - vpERROR_TRACE("\n\t\t vpSubColvector size of parent vpColVector has been changed"); - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError,"\n\t\t \n\t\t vpSubColvector size of parent vpColVector has been changed")) ; - } -} - -/*! - \brief Operation A = B - \param B : a subColvector -*/ -vpSubColVector & vpSubColVector::operator=(const vpSubColVector &B){ - - if ( rowNum != B.getRows()) - { - vpERROR_TRACE("\n\t\t vpSubColVector mismatch in operator vpSubColVector=vpSubColVector") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpSubMatrix mismatch in operator vpSubColVector=vpSubColVector")) ; - } - - for (unsigned int i=0;i<rowNum;i++) - data[i] = B[i]; - return *this; -} - -/*! - \brief Operation A = B - \param B : a rowVector -*/ -vpSubColVector & vpSubColVector::operator=(const vpColVector &B){ - if ( rowNum != B.getRows()) - { - vpERROR_TRACE("\n\t\t vpSubColVector mismatch in operator vpSubColVector=vpColVector") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpSubColVector mismatch in operator vpSubColVector=vpColVector")) ; - } - - for (unsigned int i=0;i<rowNum;i++) - data[i] = B[i]; - - return *this; -} - -/*! - \brief Operation A = B - \param B : a vpMatrix of size nrow x 1 -*/ -vpSubColVector & vpSubColVector::operator=(const vpMatrix &B){ - if ((B.getCols()!=1)||(rowNum != B.getRows())) - { - vpERROR_TRACE("\n\t\t vpSubColVector mismatch in operator vpSubColVector=vpMatrix") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpSubColVector mismatch in operator vpSubColVector=vpMatrix")) ; - } - - for (unsigned int i=0;i<rowNum;i++) - data[i] = B[i][1]; - return *this; -} - -/*! - \brief Operation A = x - \param x : a scalar value -*/ -vpSubColVector & vpSubColVector::operator=(const double &x){ - for (unsigned int i=0;i<rowNum;i++) - data[i] = x; - return *this; -} diff --git a/src/math/matrix/vpSubColVector.h b/src/math/matrix/vpSubColVector.h deleted file mode 100644 index 59cd355c284c03a7d7184e2eedc190a06e891754..0000000000000000000000000000000000000000 --- a/src/math/matrix/vpSubColVector.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** - * - * $Id: vpSubColVector.h 4574 2014-01-09 08:48:51Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Mask on a vpColVector . - * - * Authors: - * Laneurit Jean - * - *****************************************************************************/ - -#ifndef __VP_SUB_COL_VECTOR__ -#define __VP_SUB_COL_VECTOR__ - -#include <visp/vpColVector.h> - -/*! - \file vpSubColVector.h - - \brief Definition of the vpSubColVector class -*/ - -/*! - \class vpSubColVector - \ingroup vpMath - \brief Definition of the vpSubColVector - vpSubColVector class provides a mask on a vpColVector - all properties of vpColVector are available with - a vpSubColVector - - \author Jean Laneurit (IRISA - INRIA Rennes) - - \sa vpMatrix vpColvector vpRowVector -*/ -class VISP_EXPORT vpSubColVector : public vpColVector { - - private : - //!Copy constructor - vpSubColVector(const vpSubColVector& /* m */); - - protected : - - //!Number of row of parent vpColvector at initialization - unsigned int pRowNum; - //!Parent vpColvector - vpColVector *parent; - - public: - - //!Default constructor - vpSubColVector(); - //!Constructor - vpSubColVector(vpColVector &v, const unsigned int & offset,const unsigned int & nrows); - //!Destructor - ~vpSubColVector(); - - //! Initialisation of vpSubColVector - void init(vpColVector &v, const unsigned int & offset,const unsigned int & nrows); - - //!Check is partent vpColVector has changed since initialization - void checkParentStatus(); - - //! Operation such as subA = subB - vpSubColVector & operator=(const vpSubColVector &B); - //! Operation such as subA = B - vpSubColVector & operator=(const vpColVector &B); - //! Operation such as subA = matrix B with size of B(N,1) - vpSubColVector & operator=(const vpMatrix &B); - //! Operation such as subA = x - vpSubColVector & operator=(const double &x); - -}; - -#endif diff --git a/src/math/matrix/vpSubRowVector.cpp b/src/math/matrix/vpSubRowVector.cpp deleted file mode 100644 index 935f0cb27685f170005c84250a700f8fc3a2f5d0..0000000000000000000000000000000000000000 --- a/src/math/matrix/vpSubRowVector.cpp +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** - * - * $Id: vpSubRowVector.cpp 4632 2014-02-03 17:06:40Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Mask on a vpRowVector . - * - * Authors: - * Laneurit Jean - * - *****************************************************************************/ - - -#include <visp/vpSubRowVector.h> -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> -#include <visp/vpDebug.h> -#include <stdlib.h> - -vpSubRowVector::vpSubRowVector() - : pColNum(0), parent(NULL) -{ -} - -/*! - \brief Constructor - \param v : parent row vector - \param offset : offset where subRowVector start in the parent vector - \param ncols : size of the subRowVector -*/ -vpSubRowVector::vpSubRowVector(vpRowVector &v, const unsigned int & offset,const unsigned int & ncols) - : pColNum(0), parent(NULL) -{ - init(v, offset, ncols); -} - -/*! - \brief Initialisation of a the subRowVector - \param v : parent row vector - \param offset : offset where subRowVector start in the parent vector - \param ncols : size of the subRowVector -*/ -void vpSubRowVector::init(vpRowVector &v, const unsigned int & offset,const unsigned int & ncols){ - - if(!v.data){ - vpERROR_TRACE("\n\t\t vpSubColvector parent vpRowVector has been destroyed"); - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpSubColvector parent vpRowVector has been destroyed")) ; - } - - if(offset+ncols<=v.getCols()){ - data=v.data+offset; - - rowNum=1; - colNum = ncols; - - pColNum=v.getCols(); - parent=&v; - - if(rowPtrs) - free(rowPtrs); - - rowPtrs=(double**) malloc(1 * sizeof(double*)); - for(unsigned int i=0;i<1;i++) - rowPtrs[i]=v.data+i+offset; - - dsize = colNum ; - trsize =0 ; - }else{ - vpERROR_TRACE("SubRowVector cannot be contain in parent RowVector") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError,"SubRowVector cannot be contain in parent RowVector")) ; - } -} - -vpSubRowVector::~vpSubRowVector(){ - data=NULL ; -} - -/*! - \brief This method can be used to detect if the parent rowVector - always exits or its size have not changed and throw an exception is not -*/ -void vpSubRowVector::checkParentStatus(){ - if(!data){ - vpERROR_TRACE("\n\t\t vpSubColvector parent vpRowVector has been destroyed"); - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpSubColvector parent vpRowVector has been destroyed")) ; - } - if(pColNum!=parent->getCols()){ - vpERROR_TRACE("\n\t\t vpSubColvector size of parent vpRowVector has been changed"); - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpSubColvector size of parent vpRowVector has been changed")) ; - } -} - -/*! - \brief Operation A = B - \param B : a subRowvector -*/ -vpSubRowVector & vpSubRowVector::operator=(const vpSubRowVector &B){ - - if ( colNum != B.getCols()) - { - vpERROR_TRACE("\n\t\t vpSubRowVector mismatch in operator vpSubRowVector=vpSubRowVector") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpSubMatrix mismatch in operator vpSubRowVector=vpSubRowVector")) ; - } - - for (unsigned int i=0;i<rowNum;i++) - data[i] = B[i]; - - return *this; -} - -/*! - \brief Operation A = B - \param B : a rowVector -*/ -vpSubRowVector & vpSubRowVector::operator=(const vpRowVector &B){ - if ( colNum != B.getCols()) - { - vpERROR_TRACE("\n\t\t vpSubRowVector mismatch in operator vpSubRowVector=vpRowVector") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpSubMatrix mismatch in operator vpSubRowVector=vpRowVector")) ; - } - - for (unsigned int i=0;i<rowNum;i++) - data[i] = B[i]; - - return *this; -} - -/*! - \brief Operation A = B - \param B : a vpMatrix of size 1 x ncols -*/ -vpSubRowVector & vpSubRowVector::operator=(const vpMatrix &B){ - if ((B.getRows()!=1)||(colNum != B.getCols())) - { - vpERROR_TRACE("\n\t\t vpSubRowVector mismatch in operator vpSubRowVector=vpMatrix") ; - throw(vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "\n\t\t \n\t\t vpSubMatrix mismatch in operator vpSubRowVector=vpMatrix")) ; - } - - for (unsigned int i=0;i<rowNum;i++) - data[i] = B[i][1]; - return *this; -} -/*! - \brief Operation A = x - \param x : a scalar value -*/ -vpSubRowVector & vpSubRowVector::operator=(const double &x){ - for (unsigned int i=0;i<rowNum;i++) - data[i] = x; - return *this; -} diff --git a/src/math/matrix/vpSubRowVector.h b/src/math/matrix/vpSubRowVector.h deleted file mode 100644 index eb91bfaa420a8ac19b6b16389c4e6698b2f093b9..0000000000000000000000000000000000000000 --- a/src/math/matrix/vpSubRowVector.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** - * - * $Id: vpSubRowVector.h 4574 2014-01-09 08:48:51Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Mask on a vpRowVector . - * - * Authors: - * Laneurit Jean - * - *****************************************************************************/ - -#ifndef __VP_SUB_ROW_VECTOR__ -#define __VP_SUB_ROW_VECTOR__ - -#include <visp/vpRowVector.h> - - -/*! - \file vpSubRowVector.h - - \brief Definition of the vpSubRowVector class -*/ - -/*! - \class vpSubRowVector - \ingroup vpMath - \brief Definition of the vpSubRowVector - vpSubRowVector class provides a mask on a vpRowVector - all properties of vpRowVector are available with - a vpSubRowVector - - \author Jean Laneurit (IRISA - INRIA Rennes) - - \sa vpMatrix vpColvector vpRowVector -*/ - -class VISP_EXPORT vpSubRowVector : public vpRowVector { - - private : - //!Copy constructor unavaible - vpSubRowVector(const vpSubRowVector& /* m */); - - protected : - - //!Number of row of parent vpColvector at initialization - unsigned int pColNum; - //!Parent vpColvector - vpRowVector *parent; - - public: - - //!Default constructor - vpSubRowVector(); - //!Constructor - vpSubRowVector(vpRowVector &v, const unsigned int & offset,const unsigned int & ncols); - //!Destructor - ~vpSubRowVector(); - - //! Initialisation of vpSubRowVector - void init(vpRowVector &v, const unsigned int & offset,const unsigned int & ncols); - - //!Check is parent vpRowVector has changed since initialization - void checkParentStatus(); - - //! Operation such as subA = subB - vpSubRowVector & operator=(const vpSubRowVector &B); - //! Operation such as subA = B - vpSubRowVector & operator=(const vpRowVector &B); - //! Operation such as subA = matrix B with size of B(N,1) - vpSubRowVector & operator=(const vpMatrix &B); - //! Operation such as subA = x - vpSubRowVector & operator=(const double &x); - -}; - -#endif diff --git a/src/math/misc/vpMath.h b/src/math/misc/vpMath.h deleted file mode 100644 index 491fcf6a4aeeeea6d4bced41d78473309e1f31c3..0000000000000000000000000000000000000000 --- a/src/math/misc/vpMath.h +++ /dev/null @@ -1,380 +0,0 @@ -/**************************************************************************** - * - * $Id: vpMath.h 4604 2014-01-21 14:15:23Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Simple mathematical function not available in the C math library (math.h). - * - * Authors: - * Eric Marchand - * - *****************************************************************************/ - -/*! - \file vpMath.h - \brief Provides simple Math computation that are not available in - the C mathematics library (math.h) -*/ - - - -#ifndef vpMATH_HH -#define vpMATH_HH - -#include <visp/vpConfig.h> - -#include <math.h> - -#if defined(_WIN32) // Not defined in Microsoft math.h - -# ifndef M_PI -# define M_PI 3.14159265358979323846f -# endif - -# ifndef M_PI_2 -# define M_PI_2 (M_PI/2.f) -# endif - -# ifndef M_PI_4 -# define M_PI_4 (M_PI/4.f) -# endif - -#endif - - -/*! - \class vpMath - \ingroup MathTools - \brief Provides simple mathematics computation tools that are not - available in the C mathematics library (math.h) - - \author Eric Marchand (Eric.Marchand@irisa.fr) Irisa / Inria Rennes -*/ - -class VISP_EXPORT vpMath -{ - public: - - /*! - Convert an angle in radians into degrees. - - \param rad : Angle in radians. - \return Angle converted in degrees. - */ - static inline double deg(double rad) { return (rad*180.0)/M_PI ; } - - /*! - Convert an angle in degrees into radian. - \param deg : Angle in degrees. - \return Angle converted in radian. - */ - static inline double rad(double deg) { return (deg*M_PI)/180.0 ; } - - /*! - Compute x square value. - \return \f$ x^2 \f$. - */ - static inline double sqr(double x) { return x*x ; } - - // factorial of x - static inline double fact(unsigned int x) ; - - // combinaison - static inline long double comb(unsigned int n, unsigned int p) ; - - // round x to the nearest integer - static inline int round(const double x) ; - - // return the sign of x (+-1) - static inline int sign(double x) ; - - - // test if a number equals 0 (with threshold value) - static inline bool nul(double x, double s=0.001); - - // test if two numbers are equals (with a user defined threshold) - static inline bool equal(double x, double y, double s=0.001); - - // test if a number is greater than another (with a user defined threshold) - static inline bool greater(double x, double y, double s=0.001); - - - /*! - Find the maximum between two numbers (or other). - \param a : First number. - \param b : Second number. - \return The maximum of the two numbers. - */ - template <class Type> static Type maximum(const Type& a, const Type& b) - { - return (a > b) ? a : b; - } - - /*! - Find the minimum between two numbers (or other). - \param a : First number. - \param b : Second number. - \return The minimum of the two numbers. - */ - template <class Type> static Type minimum(const Type& a, const Type& b) - { - return (a < b) ? a : b; - } - - /*! - Find the absolute value of a number (or other). - \param x : The number. - \return The absolute value of x - */ - template <class Type> static Type abs(const Type& x) - { - return (x < 0) ? -x : x; - } - - - // sinus cardinal - static inline double sinc(double x) ; - static inline double sinc(double sinx, double x) ; - static inline double mcosc(double cosx, double x) ; - static inline double msinc(double sinx, double x) ; - - // sigmoid - static inline double sigmoid(double x, double x0=0.,double x1=1., double n=12.); - - /*! - Exchange two numbers. - - \param a First number to exchange. - \param b Second number to exchange - */ - template <class Type> static void swap(Type& a, Type& b) - { - Type tmp = b; - b = a; - a = tmp; - } - - private: - static const double ang_min_sinc; - static const double ang_min_mc; -}; - - - -//Begining of the inline functions definition - -/*! - Computes and returns x! - \param x : parameter of factorial function. -*/ -double vpMath::fact(unsigned int x) -{ - if ( (x == 1) || (x == 0)) return 1; - return x * fact(x-1); -} - -/*! - Computes the number of combination of p elements inside n elements. - - \param n : total number of elements. - \param p : requested number of elements. - - \return \f$ n! / ((n-p)! p!) \f$ -*/ -long double vpMath::comb(unsigned int n, unsigned int p) -{ - if (n == p) return 1; - return fact(n)/ (fact(n-p) * fact(p)); -} - - -/*! - Round x to the nearest integer. - - \param x : Value to round. - - \return Nearest integer of x. - -*/ -int vpMath::round(const double x) -{ - if (sign(x) > 0) - { - if ((x-(int)x) <= 0.5) return (int)x ; - else return (int)x+1 ; - } - else - { - if (fabs(x-(int)x) <= 0.5) return (int)x ; - else return (int)x-1 ; - } -} - -/*! - Return the sign of x. - - \return -1 if x is negative, +1 if positive. - -*/ -int vpMath::sign(double x) -{ - if (fabs(x) < 1e-15) return 0 ;else - { - if (x<0) return -1 ; else return 1 ; - } -} - -/*! - Compares \f$ | x | \f$ to \f$ s \f$. - \param x : Value to test. - \param s : Tolerance threshold - \return true if \f$ | x | < s \f$. - -*/ -bool vpMath::nul(double x, double s) -{ - return(fabs(x)<s); -} - -/*! - Compares \f$ | x - y | \f$ to \f$ s \f$. - \param x : x value. - \param y : y value. - \param s : Tolerance threshold. - \return true if \f$ | x - y | < s \f$. -*/ -bool vpMath::equal(double x, double y, double s) -{ - return( nul(x-y, s) ); -} - -/*! - Compares \f$ x \f$ to \f$ y - s \f$. - \param x : x value. - \param y : y value. - \param s : Tolerance threshold. - \return true if \f$ x > y - s \f$. -*/ -bool vpMath::greater(double x, double y, double s) -{ - return(x>(y-s)); -} - -/*! - - Compute sinus cardinal \f$ \frac{sin(x)}{x} \f$. - - \param x : Value of x. - - \return Sinus cardinal. - -*/ -double vpMath::sinc(double x) -{ - if (fabs(x) < ang_min_sinc) return 1.0 ; - else return sin(x)/x ; -} -/*! - - Compute sinus cardinal \f$ \frac{sin(x)}{x}\f$. - - \param sinx : Value of sin(x). - \param x : Value of x. - - \return Sinus cardinal. - -*/ -double vpMath::sinc(double sinx, double x) -{ - if (fabs(x) < ang_min_sinc) return 1.0 ; - else return (sinx/x) ; -} - -/*! - Compute \f$ (1-cos(x))/x^2 \f$ - - \param cosx : Value of cos(x). - \param x : Value of x. - - \return \f$ (1-cosx)/x^2 \f$ - -*/ -double vpMath::mcosc(double cosx, double x) -{ - if (fabs(x) < ang_min_mc) return 0.5 ; - else return ((1.0-cosx)/x/x) ; -} - -/*! - - Compute \f$ (1-sinc(x))/x^2 \f$ with \f$ sinc(x) = sinx / x \f$. - - \param sinx : value of sin(x). - \param x : Value of x. - - \return \f$ (1-sinc(x))/x^2 \f$ - -*/ -double vpMath::msinc(double sinx, double x) -{ - if (fabs(x) < ang_min_mc) return (1./6.0) ; - else return ((1.0-sinx/x)/x/x) ; -} - -/*! - - Sigmoid function between [x0,x1] with \f$ s(x)=0 if x\le x0\f$ and \f$ s(x)=1 if x \ge x1 \f$ - \param x : Value of x. - \param x0 : Lower bound (default 0). - \param x1 : Upper bound (default 1). - \param n : Degree of the exponential (default 12). - -\return \f$1/(1+exp(-n*((x-x0)/(x1-x0)-0.5)))\f$ - */ -double vpMath::sigmoid(double x, double x0,double x1, double n) -{ - if(x < x0) - return 0.; - else if(x > x1) - return 1.; - double l0 = 1./(1.+exp(0.5*n)); - double l1 = 1./(1.+exp(-0.5*n)); - return (1./(1.+exp(-n*((x-x0)/(x1-x0)-0.5)))-l0)/(l1-l0); -} - -#endif - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/math/transformation/vpPoseVector.cpp b/src/math/transformation/vpPoseVector.cpp deleted file mode 100644 index bb472e20a2e6758edfd759fa0ddc1b5438fde7f8..0000000000000000000000000000000000000000 --- a/src/math/transformation/vpPoseVector.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/**************************************************************************** - * - * $Id: vpPoseVector.cpp 4649 2014-02-07 14:57:11Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Pose object. A pose is a size 6 vector [t, tu]^T where tu is - * a rotation vector (theta u representation) and t is a translation vector. - * - * Authors: - * Eric Marchand - * Fabien Spindler - * - *****************************************************************************/ - - -/*! - \file vpPoseVector.cpp - \brief Pose vector. - -*/ - -#include <visp/vpPoseVector.h> -#include <visp/vpMath.h> -#include <visp/vpDebug.h> -#include <visp/vpMatrixException.h> -#include <visp/vpException.h> - -/*! - Set the size of the vector to 6. -*/ -void -vpPoseVector::init() -{ - resize(6) ; -} - -/*! - - Default constructor. - - Construct a 6 dimension pose vector \f$ [\bf t, \Theta \bf - u]^\top\f$ where \f$ \Theta \bf u\f$ is a rotation vector \f$[\Theta - u_x, \Theta u_y, \Theta u_z]^\top\f$ and \f$ \bf t \f$ is a - translation vector \f$[t_x, t_y, t_z]^\top\f$. - - The pose vector is initialized to zero. - -*/ -vpPoseVector::vpPoseVector() -{ - init() ; -} - -/*! - - Construct a 6 dimension pose vector \f$ [\bf{t}, \Theta - \bf{u}]^\top\f$ from 3 translations and 3 \f$ \Theta \bf{u}\f$ - angles. - - Translations are expressed in meters, while rotations in radians. - - \param tx,ty,tz : Translations \f$[t_x, t_y, t_z]^\top\f$ - respectively along the x, y and z axis (in meters). - - \param tux,tuy,tuz : Rotations \f$[\Theta u_x, \Theta u_y, \Theta - u_z]^\top\f$ respectively around the x, y and z axis (in radians). - -*/ -vpPoseVector::vpPoseVector(const double tx, - const double ty, - const double tz, - const double tux, - const double tuy, - const double tuz) -{ - init() ; - - (*this)[0] = tx ; - (*this)[1] = ty ; - (*this)[2] = tz ; - - (*this)[3] = tux ; - (*this)[4] = tuy ; - (*this)[5] = tuz ; -} - -/*! - - Construct a 6 dimension pose vector \f$ [\bf t, \Theta \bf - u]^\top\f$ from a translation vector \f$ \bf t \f$ and a \f$\Theta - \bf u\f$ vector. - - \param tv : Translation vector \f$ \bf t \f$. - \param tu : \f$\Theta \bf u\f$ rotation vector. - -*/ -vpPoseVector::vpPoseVector(const vpTranslationVector& tv, - const vpThetaUVector& tu) -{ - init() ; - buildFrom(tv,tu) ; -} - -/*! - - Construct a 6 dimension pose vector \f$ [\bf t, \Theta \bf - u]^\top\f$ from a translation vector \f$ \bf t \f$ and a rotation - matrix \f$ \bf R \f$. - - \param tv : Translation vector \f$ \bf t \f$. - - \param R : Rotation matrix \f$ \bf R \f$ from which \f$\Theta \bf - u\f$ vector is extracted to initialise the pose vector. - -*/ -vpPoseVector::vpPoseVector(const vpTranslationVector& tv, - const vpRotationMatrix& R) -{ - init() ; - buildFrom(tv,R) ; -} - -/*! - - Construct a 6 dimension pose vector \f$ [\bf t, \Theta \bf - u]^\top\f$ from an homogeneous matrix \f$ \bf M \f$. - - \param M : Homogeneous matrix \f$ \bf M \f$ from which translation - \f$ \bf t \f$ and \f$\Theta \bf u \f$ vectors are extracted to - initialize the pose vector. - -*/ -vpPoseVector::vpPoseVector(const vpHomogeneousMatrix& M) -{ - init() ; - buildFrom(M) ; -} - -/*! - Build a 6 dimension pose vector \f$ [\bf t, \Theta \bf u]^\top\f$ from - an homogeneous matrix \f$ \bf M \f$. - - \param M : Homogeneous matrix \f$ \bf M \f$ from which translation \f$ - \bf t \f$ and \f$\Theta \bf u \f$ vectors are extracted to initialize - the pose vector. - - \return The build pose vector. - -*/ -vpPoseVector -vpPoseVector::buildFrom(const vpHomogeneousMatrix& M) -{ - vpRotationMatrix R ; M.extract(R) ; - vpTranslationVector tv ; M.extract(tv) ; - buildFrom(tv,R) ; - return *this ; -} - -/*! - - Build a 6 dimension pose vector \f$ [\bf t, \Theta \bf u]^\top\f$ - from a translation vector \f$ \bf t \f$ and a \f$\Theta \bf u\f$ - vector. - - \param tv : Translation vector \f$ \bf t \f$. - \param tu : \f$\Theta \bf u\f$ rotation vector. - - \return The build pose vector. -*/ -vpPoseVector -vpPoseVector::buildFrom(const vpTranslationVector& tv, - const vpThetaUVector& tu) -{ - for (unsigned int i =0 ; i < 3 ; i++) - { - (*this)[i] = tv[i] ; - (*this)[i+3] = tu[i] ; - } - return *this ; -} - -/*! - - Build a 6 dimension pose vector \f$ [\bf t, \Theta \bf u]^\top\f$ - from a translation vector \f$ \bf t \f$ and a rotation matrix \f$ - \bf R \f$. - - \param tv : Translation vector \f$ \bf t \f$. - - \param R : Rotation matrix \f$ \bf R \f$ from which \f$\Theta \bf - u\f$ vector is extracted to initialise the pose vector. - - \return The build pose vector. -*/ -vpPoseVector -vpPoseVector::buildFrom(const vpTranslationVector& tv, - const vpRotationMatrix& R) -{ - vpThetaUVector tu ; - tu.buildFrom(R) ; - - buildFrom(tv,tu) ; - return *this ; -} - - - -/*! - - Prints to the standart stream the pose vector. - - \warning Values concerning the \f$ \Theta \bf u\f$ rotation are - converted in degrees. - - The following code - \code - // Create a pose vector - vpPoseVector r(1, 2, 3, M_PI, -M_PI, 0); - r.print(); - \endcode - produces the output: - - \code - 1 2 3 180 -180 0 - \endcode -*/ -void -vpPoseVector::print() -{ - for (unsigned int i =0 ; i < 6 ; i++) - if (i<3) std::cout << (*this)[i] <<" " ; - else std::cout << vpMath::deg((*this)[i]) <<" " ; - std::cout <<std::endl ; - -} - -/*! - - Save the pose vector in the output file stream. - - \param f : Output file stream. Should be open before entering in this method. - - \exception vpException::ioError : If the output stream is not open. - - \sa load() -*/ -void -vpPoseVector::save(std::ofstream &f) const -{ - if (! f.fail()) - { - f << *this ; - } - else - { - vpERROR_TRACE("\t\t file not open " ); - throw(vpException(vpException::ioError, "\t\t file not open")) ; - } -} - - -/*! - Read a pose vector from an input file stream. - - \param f : The input file stream..Should be open before entering in - this method. - - \exception vpException::ioError : If the input file stream is not open. - - \sa save() -*/ -void -vpPoseVector::load(std::ifstream &f) -{ - if (! f.fail()) - { - for (unsigned int i=0 ; i < 6 ; i++) - { - f >> (*this)[i] ; - } - } - else - { - vpERROR_TRACE("\t\t file not open " ); - throw(vpException(vpException::ioError, "\t\t file not open")) ; - } -} - - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/math/transformation/vpQuaternionVector.cpp b/src/math/transformation/vpQuaternionVector.cpp deleted file mode 100644 index f00cab04692f4468c6812f5e2082b1293a6830e4..0000000000000000000000000000000000000000 --- a/src/math/transformation/vpQuaternionVector.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** - * - * $Id: vpQuaternionVector.cpp 4649 2014-02-07 14:57:11Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Quaternion vector. - * - * Authors: - * Filip Novotny - * - *****************************************************************************/ - - -#include <visp/vpQuaternionVector.h> -#include <visp/vpMath.h> -#include <stdio.h> -#include <string.h> -#include <algorithm> - - -// minimum value of sine -const double vpQuaternionVector::minimum = 0.0001; - -/*! - \file vpQuaternionVector.cpp - \brief Defines a quaternion and common operations on it. -*/ - -//! Constructor from doubles. -vpQuaternionVector::vpQuaternionVector(const double x_, const double y_, - const double z_,const double w_) - : vpRotationVector(4) -{ - set(x_, y_, z_, w_); -} - -/*! - Constructs a quaternion from a rotation matrix. - - \param R : Matrix containing a rotation. -*/ -vpQuaternionVector::vpQuaternionVector(const vpRotationMatrix &R) - : vpRotationVector(4) -{ - buildFrom(R); -} - -/*! - Manually change values of a quaternion. - \param x_ : x quaternion parameter. - \param y_ : y quaternion parameter. - \param z_ : z quaternion parameter. - \param w_ : w quaternion parameter. -*/ -void vpQuaternionVector::set(const double x_, const double y_, - const double z_,const double w_) -{ - r[0]=x_; - r[1]=y_; - r[2]=z_; - r[3]=w_; -} - - -/*! - Quaternion addition. - - Adds two quaternions. Addition is component-wise. - - \param q : quaternion to add. -*/ -vpQuaternionVector vpQuaternionVector::operator+( vpQuaternionVector &q) -{ - return vpQuaternionVector(x()+q.x(), y()+q.y(), z()+q.z(), w()+q.w()); -} -/*! - Quaternion substraction. - - Substracts a quaternion from another. Substraction is component-wise. - - \param q : quaternion to substract. -*/ -vpQuaternionVector vpQuaternionVector::operator-( vpQuaternionVector &q) -{ - return vpQuaternionVector(x()-q.x(), y()-q.y(), z()-q.z(), w()-q.w()); -} - -//! Negate operator. Returns a quaternion defined by (-x,-y,-z-,-w). -vpQuaternionVector vpQuaternionVector::operator-() -{ - return vpQuaternionVector(-x(), -y(), -z(), -w()); -} - -//! Multiplication by scalar. Returns a quaternion defined by (lx,ly,lz,lw). -vpQuaternionVector vpQuaternionVector::operator*( double l) -{ - return vpQuaternionVector(l*x(),l*y(),l*z(),l*w()); -} - -//! Multiply two quaternions. -vpQuaternionVector vpQuaternionVector::operator* ( vpQuaternionVector &rq) { - return vpQuaternionVector(w() * rq.x() + x() * rq.w() + y() * rq.z() - z() * rq.y(), - w() * rq.y() + y() * rq.w() + z() * rq.x() - x() * rq.z(), - w() * rq.z() + z() * rq.w() + x() * rq.y() - y() * rq.x(), - w() * rq.w() - x() * rq.x() - y() * rq.y() - z() * rq.z()); -} - -/*! - Constructs a quaternion from a rotation matrix. - - \param R : Rotation matrix. -*/ -void vpQuaternionVector::buildFrom(const vpRotationMatrix &R) -{ - vpThetaUVector tu(R); - vpColVector u; - double theta; - tu.extract(theta, u); - - theta *= 0.5; - - double sinTheta_2 = sin(theta); - set( u[0] * sinTheta_2, u[1] * sinTheta_2, u[2] * sinTheta_2, cos(theta) ); -} diff --git a/src/math/transformation/vpRotationMatrix.cpp b/src/math/transformation/vpRotationMatrix.cpp deleted file mode 100644 index ee2dbdb78bca4e499fb58154fc9df4fe95f8b98d..0000000000000000000000000000000000000000 --- a/src/math/transformation/vpRotationMatrix.cpp +++ /dev/null @@ -1,757 +0,0 @@ -/**************************************************************************** - * - * $Id: vpRotationMatrix.cpp 4900 2014-09-11 09:16:21Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Rotation matrix. - * - * Authors: - * Eric Marchand - * - *****************************************************************************/ - -/*! - \file vpRotationMatrix.cpp - \brief Class that consider - the particular case of rotation matrix -*/ - - -#include <visp/vpMath.h> -#include <visp/vpMatrix.h> - -// Rotation classes -#include <visp/vpRotationMatrix.h> - - -// Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> - -// Debug trace -#include <visp/vpDebug.h> -#include <math.h> -const double vpRotationMatrix::threshold = 1e-6; -const double vpRotationMatrix::minimum = 0.00001; - -#define vpDEBUG_LEVEL1 0 - - -/*! - Initializes a 3x3 rotation matrix as identity -*/ -void -vpRotationMatrix::init() -{ - unsigned int i,j ; - - try { - resize(3,3) ; - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - for (i=0 ; i < 3 ; i++) - for (j=0 ; j < 3; j++) - if (i==j) - (*this)[i][j] = 1.0 ; - else - (*this)[i][j] = 0.0; - -} - -/*! - Initializes the rotation matrix as identity. - - \sa eye() -*/ -void -vpRotationMatrix::setIdentity() -{ - init() ; -} -/*! - Initialize the rotation matrix as identity. - - \sa setIdentity() -*/ -void -vpRotationMatrix::eye() -{ - init() ; -} - -/*! - Affectation of two rotation matrix. - - \param m : *this = m -*/ -vpRotationMatrix & -vpRotationMatrix::operator=(const vpRotationMatrix &m) -{ - for (unsigned int i=0; i<3; i++) - { - for (unsigned int j=0; j<3; j++) - { - rowPtrs[i][j] = m.rowPtrs[i][j]; - } - } - - return *this; -} - -/*! - Affectation of two rotation matrix - - \param m : *this = m -*/ -vpRotationMatrix & -vpRotationMatrix::operator=(const vpMatrix &m) -{ - - if ((m.getCols() !=3) &&(m.getRows() !=3)) - { - vpERROR_TRACE("m is not a rotation matrix !!!!! ") ; - throw(vpMatrixException(vpMatrixException::forbiddenOperatorError, - "m is not a rotation matrix !!!!!")); - } - - for (unsigned int i=0; i<3; i++) - { - for (unsigned int j=0; j<3; j++) - { - (*this)[i][j] = m[i][j]; - } - } - - if (isARotationMatrix() == false) - { - vpERROR_TRACE("m is not a rotation matrix !!!!! ") ; - throw(vpMatrixException(vpMatrixException::forbiddenOperatorError, - "m is not a rotation matrix !!!!!")); - } - - return *this; -} - -//! operation C = A * B (A is unchanged) -vpRotationMatrix -vpRotationMatrix::operator*(const vpRotationMatrix &B) const -{ - vpRotationMatrix p ; - - for (unsigned int i=0;i<3;i++) - for (unsigned int j=0;j<3;j++) - { - double s =0 ; - for (unsigned int k=0;k<3;k++) - s +=rowPtrs[i][k] * B.rowPtrs[k][j]; - p[i][j] = s ; - } - return p; -} -/*! - Operation C = A * B (A is unchanged). - Allows for example to multiply a rotation matrix by a skew matrix. - \code - vpRotationMatrix A; - vpTranslationVector t; - vpMatrix B = t.skew(); - vpMatrix C = A * B; - \endcode - - \exception vpMatrixException::incorrectMatrixSizeError : If B is not - a 3 by 3 dimension matrix. - -*/ -vpMatrix -vpRotationMatrix::operator*(const vpMatrix &B) const -{ - if (B.getRows() != 3 || B.getCols() != 3) { - vpERROR_TRACE("The matrix is not a 3 by 3 dimension matrix") ; - throw (vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "The matrix is not a 3 by 3 dimension matrix")); - } - vpRotationMatrix p ; - - for (unsigned int i=0;i<3;i++) - for (unsigned int j=0;j<3;j++) - { - double s =0 ; - for (unsigned int k=0;k<3;k++) - s +=(*this)[i][k] * B[k][j]; - p[i][j] = s ; - } - return p; -} - -/*! - - Operator that allows to multiply a rotation matrix by a 3 dimension - column vector. - - \param v : Three dimension column vector. - - \return The product of the rotation matrix by the column vector - - \exception vpMatrixException::incorrectMatrixSizeError If the column - vector \e v is not a 3 dimension vector. - - The code below shows how to use this operator. -\code -#include <visp/vpRotationMatrix.h> -#include <visp/vpColVector.h> - -int main() -{ - vpColVector p1(3), p2(3); - vpRotationMatrix R; - - p2 = R * p1; - - return 0; -} -\endcode - -*/ -vpColVector -vpRotationMatrix::operator*(const vpColVector &v) const -{ - if (v.getRows() != 3) { - vpERROR_TRACE("The column vector is not a 3 dimension vector") ; - throw (vpMatrixException(vpMatrixException::incorrectMatrixSizeError, - "The column vector is not a 3 dimension vector")); - } - vpColVector c; - vpMatrix::multMatrixVector(*this, v, c); - return c; -} - - -/*! overload + operator (to say it forbidden operation, throw exception) - - - \exception Cannot add two rotation matrices !!!!! - vpMatrixException::forbiddenOperatorError - */ -vpRotationMatrix -vpRotationMatrix::operator+(const vpRotationMatrix &/* B*/) const -{ - vpERROR_TRACE("Cannot add two rotation matrices !!!!! ") ; - throw(vpMatrixException(vpMatrixException::forbiddenOperatorError, - "Cannot add two rotation matrices !!!!!")); -} - -/*! overload - operator (to say it forbidden operation, throw exception) - - - \exception Cannot substract two rotation matrices !!!!! - vpMatrixException::forbiddenOperatorError - */ -vpRotationMatrix -vpRotationMatrix::operator-(const vpRotationMatrix &/* B */) const -{ - vpERROR_TRACE("Cannot substract two rotation matrices !!!!! ") ; - throw(vpMatrixException(vpMatrixException::forbiddenOperatorError, - "Cannot substract two rotation matrices !!!!!")); -} - -//! operation c = A * b (A is unchanged) -vpTranslationVector -vpRotationMatrix::operator*(const vpTranslationVector &mat) const -{ - vpTranslationVector p ; - - for (unsigned int j=0;j<3;j++)p[j]=0 ; - - for (unsigned int j=0;j<3;j++) { - for (unsigned int i=0;i<3;i++) { - p[i]+=rowPtrs[i][j] * mat[j]; - } - } - - return p; -} - -/*********************************************************************/ - -/*! - \brief test if the 3x3 rotational part of the rotation matrix is really a rotation matrix -*/ - -bool -vpRotationMatrix::isARotationMatrix() const -{ - unsigned int i,j ; - bool isRotation = true ; - - // test R^TR = Id ; - vpRotationMatrix RtR = (*this).t()*(*this) ; - for (i=0 ; i < 3 ; i++) - for (j=0 ; j < 3 ; j++) - if (i==j) - { - if (fabs(RtR[i][j]-1) > threshold) isRotation = false ; - } - else - { - if (fabs(RtR[i][j]) > threshold) isRotation = false ; - } - - // test if it is a basis - // test || Ci || = 1 - for (i=0 ; i < 3 ; i++) - if ((sqrt(vpMath::sqr(RtR[0][i]) + - vpMath::sqr(RtR[1][i]) + - vpMath::sqr(RtR[2][i])) - 1) > threshold) isRotation = false ; - - // test || Ri || = 1 - for (i=0 ; i < 3 ; i++) - if ((sqrt(vpMath::sqr(RtR[i][0]) + - vpMath::sqr(RtR[i][1]) + - vpMath::sqr(RtR[i][2])) - 1) > threshold) isRotation = false ; - - // test if the basis is orthogonal - return isRotation ; -} - - -/*! - \brief initialize a rotation matrix as Identity -*/ -vpRotationMatrix::vpRotationMatrix() : vpMatrix() -{ - init() ; -} - - -/*! - \brief initialize a rotation matrix from another rotation matrix -*/ -vpRotationMatrix::vpRotationMatrix(const vpRotationMatrix &M) : vpMatrix() -{ - init() ; - (*this) = M ; -} -/*! - Initialize a rotation matrix from an homogenous matrix. -*/ -vpRotationMatrix::vpRotationMatrix(const vpHomogeneousMatrix &M) : vpMatrix() -{ - init() ; - buildFrom(M); -} - -//! Construction from rotation (Theta U parameterization) -vpRotationMatrix::vpRotationMatrix(const vpThetaUVector &tu) : vpMatrix() -{ - init() ; - buildFrom(tu) ; -} -//! Construction from a pose vector. -vpRotationMatrix::vpRotationMatrix(const vpPoseVector &p) : vpMatrix() -{ - init() ; - buildFrom(p) ; -} - - -//! Construction from rotation (Euler parameterization, ie Rzyz parameterization) -vpRotationMatrix::vpRotationMatrix(const vpRzyzVector &euler) : vpMatrix() -{ - init() ; - buildFrom(euler) ; -} - - - -//! Construction from rotation Rxyz -vpRotationMatrix::vpRotationMatrix(const vpRxyzVector &Rxyz) : vpMatrix() -{ - init() ; - buildFrom(Rxyz) ; -} - -//! Construction from rotation Rzyx -vpRotationMatrix::vpRotationMatrix(const vpRzyxVector &Rzyx) : vpMatrix() -{ - init() ; - buildFrom(Rzyx) ; -} - -//! Construction from rotation (Theta U parameterization) -vpRotationMatrix::vpRotationMatrix(const double tux, - const double tuy, - const double tuz) : vpMatrix() -{ - init() ; - buildFrom(tux, tuy, tuz) ; -} - -//! Construct from rotation in quaternion representation -vpRotationMatrix::vpRotationMatrix(const vpQuaternionVector& q){ - init(); - buildFrom(q); -} - - -/*! - \brief transpose - R^T -*/ -vpRotationMatrix -vpRotationMatrix::t() const -{ - vpRotationMatrix Rt ; - - unsigned int i,j; - for (i=0;i<3;i++) - for (j=0;j<3;j++) - Rt[j][i] = (*this)[i][j]; - - return Rt; - -} - -/*! - \brief inverse the rotation matrix - - \f$ R^-1 = R^T \f$ -*/ -vpRotationMatrix vpRotationMatrix::inverse() const -{ - vpRotationMatrix Ri = (*this).t() ; - - return Ri ; -} - -/*! - \brief inverse the rotation matrix - - \f$ R^-1 = R^T \f$ -*/ -void -vpRotationMatrix::inverse(vpRotationMatrix &M) const -{ - M = inverse() ; -} - - -//! std::cout an rotation matrix [thetaU] -VISP_EXPORT std::ostream &operator <<(std::ostream &s,const vpRotationMatrix &R) -{ - for (unsigned int i=0; i<3; i++) - { - for (unsigned int j=0; j<3; j++) - std::cout << R[i][j] << " " ; - std::cout << std::endl ; - } - - return (s); -} - -//! Print the matrix as a vector [thetaU] -void -vpRotationMatrix::printVector() -{ - vpThetaUVector tu(*this) ; - - for (unsigned int i=0; i<3; i++) - std::cout << tu[i] << " " ; - - std::cout << std::endl ; -} - - -/* - \relates vpRotationMatrix - Transform a vector vpThetaUVector into a rotation matrix. - - Representation theta u (angle and axes of the rotation) is considered for - the rotation vector. - - The rotation is computed using : - \f[ - R = \cos{ \theta} \; {I}_{3} + (1 - \cos{ \theta}) \; v v^{T} + \sin{ \theta} \; [v]_\times - \f] -*/ -vpRotationMatrix -vpRotationMatrix::buildFrom(const vpThetaUVector &v) -{ - unsigned int i,j; - double theta, si, co, sinc, mcosc; - vpRotationMatrix R; - - theta = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); - si = sin(theta); - co = cos(theta); - sinc = vpMath::sinc(si,theta); - mcosc = vpMath::mcosc(co,theta); - - R[0][0] = co + mcosc*v[0]*v[0]; - R[0][1] = -sinc*v[2] + mcosc*v[0]*v[1]; - R[0][2] = sinc*v[1] + mcosc*v[0]*v[2]; - R[1][0] = sinc*v[2] + mcosc*v[1]*v[0]; - R[1][1] = co + mcosc*v[1]*v[1]; - R[1][2] = -sinc*v[0] + mcosc*v[1]*v[2]; - R[2][0] = -sinc*v[1] + mcosc*v[2]*v[0]; - R[2][1] = sinc*v[0] + mcosc*v[2]*v[1]; - R[2][2] = co + mcosc*v[2]*v[2]; - - for (i=0;i<3;i++) for (j=0;j<3;j++) (*this)[i][j] = R[i][j]; - -#if (vpDEBUG_LEVEL1) // test new version wrt old version - { - // old version - vpRotationMatrix R_old; // has to be replaced by (*this) if good version - double sinu,cosi,mcosi,u[3],ang; - - ang = sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); - if (ang > minimum) - { - for (i=0;i<3;i++) u[i] = v[i]/ang; - sinu = sin(ang); - cosi = cos(ang); - mcosi = 1-cosi; - R_old[0][0] = cosi + mcosi*u[0]*u[0]; - R_old[0][1] = -sinu*u[2] + mcosi*u[0]*u[1]; - R_old[0][2] = sinu*u[1] + mcosi*u[0]*u[2]; - R_old[1][0] = sinu*u[2] + mcosi*u[1]*u[0]; - R_old[1][1] = cosi + mcosi*u[1]*u[1]; - R_old[1][2] = -sinu*u[0] + mcosi*u[1]*u[2]; - R_old[2][0] = -sinu*u[1] + mcosi*u[2]*u[0]; - R_old[2][1] = sinu*u[0] + mcosi*u[2]*u[1]; - R_old[2][2] = cosi + mcosi*u[2]*u[2]; - } - else - { - for (i=0;i<3;i++) - { - for(j=0;j<3;j++) R_old[i][j] = 0.0; - R_old[i][i] = 1.0; - } - } - // end old version - // test the new version - - unsigned int pb = 0; - for (i=0;i<3;i++) - { - for(j=0;j<3;j++) - if (fabs(R_old[i][j] - R[i][j]) > 1.e-4) pb = 1; - } - if (pb == 1) - { - printf("vpRotationMatrix::buildFrom(const vpThetaUVector &v)\n"); - std::cout << " theta " << theta << std::endl; - std::cout << " R : " << std::endl << R << std::endl; - std::cout << " R_old : " << std::endl << R_old << std::endl; - } - - } - // end test -#endif - - return *this ; -} - -/*! - Build a rotation matrix from an homogenous matrix. -*/ -vpRotationMatrix -vpRotationMatrix::buildFrom(const vpHomogeneousMatrix &M) -{ - for (unsigned int i=0 ; i < 3 ; i++) - for (unsigned int j=0 ; j < 3; j++) - (*this)[i][j] = M[i][j] ; - - return *this ; -} - -/* - \relates vpRotationMatrix - Transform a pose vector into a rotation matrix. - - \sa buildFrom(const vpThetaUVector &) -*/ -vpRotationMatrix -vpRotationMatrix::buildFrom(const vpPoseVector &p) -{ - vpThetaUVector tu(p); - return buildFrom(tu); -} - -/*! - Transform a vector representing the euler angle - into a rotation matrix. - Rzyz = Rot(\f$ z,\phi \f$) Rot(\f$ y,\theta \f$) Rot(\f$ z,\psi \f$) - -*/ -vpRotationMatrix -vpRotationMatrix::buildFrom(const vpRzyzVector &v) -{ - double c0,c1,c2,s0,s1,s2; - - c0 = cos(v[0]); - c1 = cos(v[1]); - c2 = cos(v[2]); - s0 = sin(v[0]); - s1 = sin(v[1]); - s2 = sin(v[2]); - - (*this)[0][0] = c0*c1*c2 - s0*s2; - (*this)[0][1] = -c0*c1*s2 - s0*c2; - (*this)[0][2] = c0*s1; - (*this)[1][0] = s0*c1*c2+c0*s2 ; - (*this)[1][1] = -s0*c1*s2 + c0*c2 ; - (*this)[1][2] = s0*s1; - (*this)[2][0] = -s1*c2; - (*this)[2][1] = s1*s2; - (*this)[2][2] = c1; - - return (*this) ; -} - - -/*! - - Transform a vector representing the Rxyz angle into a rotation - matrix. - - Rxyz(\f$ \phi,\theta, \psi \f$) = Rot(\f$ x, \psi \f$) Rot(\f$ y, \theta \f$ - ) Rot(\f$ z,\phi \f$) - -*/ -vpRotationMatrix -vpRotationMatrix::buildFrom(const vpRxyzVector &v) -{ - double c0,c1,c2,s0,s1,s2; - - c0 = cos(v[0]); - c1 = cos(v[1]); - c2 = cos(v[2]); - s0 = sin(v[0]); - s1 = sin(v[1]); - s2 = sin(v[2]); - - (*this)[0][0] = c1*c2; - (*this)[0][1] = -c1*s2; - (*this)[0][2] = s1; - (*this)[1][0] = c0*s2+s0*s1*c2; - (*this)[1][1] = c0*c2-s0*s1*s2; - (*this)[1][2] = -s0*c1; - (*this)[2][0] = -c0*s1*c2+s0*s2; - (*this)[2][1] = c0*s1*s2+c2*s0; - (*this)[2][2] = c0*c1; - - return (*this) ; -} - - - -/*! - Transform a vector representing the Rzyx angle - into a rotation matrix. - - Rxyz(\f$ \phi, \theta , \psi \f$) - Rot(\f$ z, \psi \f$) Rot(\f$ y, \theta \f$)Rot(\f$ x, \phi \f$) -*/ -vpRotationMatrix -vpRotationMatrix::buildFrom(const vpRzyxVector &v) -{ - double c0,c1,c2,s0,s1,s2; - - c0 = cos(v[0]); - c1 = cos(v[1]); - c2 = cos(v[2]); - s0 = sin(v[0]); - s1 = sin(v[1]); - s2 = sin(v[2]); - - (*this)[0][0] = c0*c1 ; - (*this)[0][1] = c0*s1*s2 - s0*c2 ; - (*this)[0][2] = c0*s1*c2 + s0*s2 ; - - (*this)[1][0] = s0*c1 ; - (*this)[1][1] = s0*s1*s2 + c0*c2 ; - (*this)[1][2] = s0*s1*c2 - c0*s2 ; - - (*this)[2][0] = -s1 ; - (*this)[2][1] = c1*s2 ; - (*this)[2][2] = c1*c2 ; - - return (*this) ; -} - - - -//! Construction from rotation (theta U parameterization) -vpRotationMatrix -vpRotationMatrix::buildFrom(const double tux, - const double tuy, - const double tuz) -{ - vpThetaUVector tu(tux, tuy, tuz) ; - buildFrom(tu) ; - return *this ; -} - - -//! Construction from rotation (as quaternion) -vpRotationMatrix -vpRotationMatrix::buildFrom(const vpQuaternionVector& q){ - double a = q.w(); - double b = q.x(); - double c = q.y(); - double d = q.z(); - (*this)[0][0] = a*a+b*b-c*c-d*d; - (*this)[0][1] = 2*b*c-2*a*d; - (*this)[0][2] = 2*a*c+2*b*d; - - (*this)[1][0] = 2*a*d+2*b*c; - (*this)[1][1] = a*a-b*b+c*c-d*d; - (*this)[1][2] = 2*c*d-2*a*b; - - (*this)[2][0] = 2*b*d-2*a*c; - (*this)[2][1] = 2*a*b+2*c*d; - (*this)[2][2] = a*a-b*b-c*c+d*d; - return *this; -} -#undef vpDEBUG_LEVEL1 - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/math/transformation/vpRotationMatrix.h b/src/math/transformation/vpRotationMatrix.h deleted file mode 100644 index c45f0879d7df8ba71fd1296c212f7a4521e44084..0000000000000000000000000000000000000000 --- a/src/math/transformation/vpRotationMatrix.h +++ /dev/null @@ -1,184 +0,0 @@ -/**************************************************************************** - * - * $Id: vpRotationMatrix.h 5037 2014-12-05 19:06:41Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Rotation matrix. - * - * Authors: - * Eric Marchand - * - *****************************************************************************/ - - -#ifndef vpROTATIONMATRIX_H -#define vpROTATIONMATRIX_H - -/*! - \file vpRotationMatrix.h - \brief Class that consider the particular case of rotation matrix -*/ - -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpMatrix.h> -#include <visp/vpRxyzVector.h> -#include <visp/vpRzyxVector.h> -#include <visp/vpRzyzVector.h> -#include <visp/vpThetaUVector.h> -#include <visp/vpTranslationVector.h> -#include <visp/vpQuaternionVector.h> -#include <visp/vpPoseVector.h> - -/*! - \class vpRotationMatrix - - \ingroup RotTransformation - - \brief The vpRotationMatrix considers the particular case of - a rotation matrix. - - It is derived from vpMatrix. - - \author Eric Marchand (Eric.Marchand@irisa.fr) Irisa / Inria Rennes - -*/ -class VISP_EXPORT vpRotationMatrix : public vpMatrix -{ - friend class vpMatrix; - friend class vpHomogeneousMatrix; - friend class vpRxyzVector; - friend class vpRzyzVector; - friend class vpRzyxVector; - friend class vpThetaUVector; - friend class vpTranslationVector; - friend class vpPoseVector; -public: - //! Basic initialisation (identity) - void init() ; - - //! Basic initialisation (identity) - void setIdentity() ; - void eye(); - //! Default constructor. - vpRotationMatrix() ; - //! Copy constructor. - vpRotationMatrix(const vpRotationMatrix &R) ; - //! Copy constructor. - vpRotationMatrix(const vpHomogeneousMatrix &M) ; - //! Construction from rotation (theta U parameterization) - vpRotationMatrix(const vpThetaUVector &r) ; - //! Construction from a pose vector. - vpRotationMatrix(const vpPoseVector &p) ; - //! Construction from rotation (Euler parameterization) - vpRotationMatrix(const vpRzyzVector &r) ; - //! Construction from rotation Rxyz - vpRotationMatrix(const vpRxyzVector &r) ; - //! Construction from rotation Rzyx - vpRotationMatrix(const vpRzyxVector &r) ; - //! Construction from rotation (theta U parameterization) - vpRotationMatrix(const double tux, const double tuy, const double tuz) ; - - vpRotationMatrix(const vpQuaternionVector& q); - -// /*! -// Return the \f$\theta u\f$ vector that corresponds to tha rotation matrix. -// */ -// vpThetaUVector getThetaUVector() -// { -// vpThetaUVector tu; -// tu.buildFrom(*this); -// return tu; -// } - - //! copy operator from vpRotationMatrix - vpRotationMatrix &operator=(const vpRotationMatrix &R); - //! copy operator from vpMatrix (handle with care) - vpRotationMatrix &operator=(const vpMatrix &m) ; - //! operation c = A * b (A is unchanged) - vpTranslationVector operator*(const vpTranslationVector &mat) const ; - //! operation C = A * B (A is unchanged) - vpRotationMatrix operator*(const vpRotationMatrix &B) const ; - //! operation C = A * B (A is unchanged) - vpMatrix operator*(const vpMatrix &B) const ; - // operation v2 = A * v1 (A is unchanged) - vpColVector operator*(const vpColVector &v) const ; - //! overload + operator (to say it forbidden operation, throw exception) - vpRotationMatrix operator+(const vpRotationMatrix &B) const ; - //! overload - operator (to say it forbidden operation, throw exception) - vpRotationMatrix operator-(const vpRotationMatrix &B) const ; - - //! transpose - vpRotationMatrix t() const ; - - //! invert the rotation matrix - vpRotationMatrix inverse() const ; - //! invert the rotation matrix - void inverse(vpRotationMatrix &M) const; - - //! test if the matrix is an rotation matrix - bool isARotationMatrix() const ; - - //! Print the matrix as a vector [T thetaU] - void printVector() ; - friend VISP_EXPORT std::ostream &operator << (std::ostream &s, const vpRotationMatrix &m); - - //! Build a rotation matrix from an homogeneous matrix. - vpRotationMatrix buildFrom(const vpHomogeneousMatrix &M) ; - //! Transform a vector vpThetaUVector into a rotation matrix - vpRotationMatrix buildFrom(const vpThetaUVector &v) ; - //! Transform a pose vector into a rotation matrix - vpRotationMatrix buildFrom(const vpPoseVector &p) ; - //! Transform a vector reprensenting the euler (Rzyz) angle - //! into a rotation matrix - vpRotationMatrix buildFrom(const vpRzyzVector &v) ; - //! Transform a vector reprensenting the Rxyz angle into a rotation matrix - vpRotationMatrix buildFrom(const vpRxyzVector &v) ; - //! Transform a vector reprensenting the Rzyx angle into a rotation matrix - vpRotationMatrix buildFrom(const vpRzyxVector &v) ; - //! Construction from rotation (theta U parameterization) - vpRotationMatrix buildFrom(const double tux, - const double tuy, - const double tuz) ; - - vpRotationMatrix buildFrom(const vpQuaternionVector& q); -private: - static const double threshold; - static const double minimum; // useful only for debug - }; - -#endif - -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/math/transformation/vpRotationVector.cpp b/src/math/transformation/vpRotationVector.cpp deleted file mode 100644 index 5829b3ed209a8e8dd6ffc0f66a25b6ccd7ade41c..0000000000000000000000000000000000000000 --- a/src/math/transformation/vpRotationVector.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** - * - * $Id: vpRotationVector.cpp 4649 2014-02-07 14:57:11Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Generic rotation vector (cannot be used as is !). - * - * Authors: - * Eric Marchand - * - *****************************************************************************/ - -#include <visp/vpRotationVector.h> -#include <algorithm> -#include <math.h> -/*! - \file vpRotationVector.cpp - \brief class that consider the case of a generic rotation vector - (cannot be used as is !) -*/ - - - -/*! - Return the transpose of the rotation vector. - -*/ -vpRowVector vpRotationVector::t() const -{ - vpRowVector v(_size); - - for (unsigned int i=0; i< _size; i++) - v[i] = r[i]; - - return v; -} - -/*! - Size of the rotation vector: number of double values describing the rotation. - Common sizes are 4 for a quaternion and 3 for angle-based rotation vectors. -*/ -unsigned int vpRotationVector::size() const { - return _size; -} -/*! - - Print the values of the three angles on the output stream. Data are - formatted as a column vector. - - \code -#include <iostream> -#include <visp/vpRxyzVector.h> - -int main() -{ - vpRxyzVector r; // By default initialized to zero - - std::cout << "Rxyz rotation vector: " << std::endl << r << std::endl; -} - \endcode - - will lead to the following printing on the standart stream: - - \code -Rxyz rotation vector: -0 -0 -0 - \endcode -*/ -VISP_EXPORT std::ostream &operator <<(std::ostream &s,const vpRotationVector &m) -{ - std::ios::fmtflags original_flags( s.flags() ); - s.precision(10) ; - - for (unsigned int i=0; i < m.size(); i++) - s << m.r[i] << "\n"; - - s << std::endl; - - // Restore ostream format - s.flags(original_flags); - - return s; -} - - -void vpRotationVector::init(const unsigned int vector_size){ - this->_size = vector_size; - r = new double[this->_size]; - std::fill(r,r+this->_size,0.); -} - -vpRotationVector::~vpRotationVector(){ - delete[] r; -} diff --git a/src/math/transformation/vpThetaUVector.cpp b/src/math/transformation/vpThetaUVector.cpp deleted file mode 100644 index 3ceb8ed3948d269930292284f9ec866522b9bbf6..0000000000000000000000000000000000000000 --- a/src/math/transformation/vpThetaUVector.cpp +++ /dev/null @@ -1,325 +0,0 @@ -/**************************************************************************** -* -* $Id: vpThetaUVector.cpp 4792 2014-07-18 11:56:02Z fspindle $ -* -* This file is part of the ViSP software. -* Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -* -* This software is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* ("GPL") version 2 as published by the Free Software Foundation. -* See the file LICENSE.txt at the root directory of this source -* distribution for additional information about the GNU GPL. -* -* For using ViSP with software that can not be combined with the GNU -* GPL, please contact INRIA about acquiring a ViSP Professional -* Edition License. -* -* See http://www.irisa.fr/lagadic/visp/visp.html for more information. -* -* This software was developed at: -* INRIA Rennes - Bretagne Atlantique -* Campus Universitaire de Beaulieu -* 35042 Rennes Cedex -* France -* http://www.irisa.fr/lagadic -* -* If you have questions regarding the use of this file, please contact -* INRIA at visp@inria.fr -* -* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -* -* -* Description: -* Theta U parameterization for the rotation. -* -* Authors: -* Eric Marchand -* -*****************************************************************************/ - -/*! -\file vpThetaUVector.cpp -\brief class that consider the case of the Theta U parameterization for the -rotation -*/ - - - -#include <visp/vpThetaUVector.h> -#include <cmath> // std::fabs -#include <limits> // numeric_limits -#define vpDEBUG_LEVEL1 0 - -const double vpThetaUVector::minimum = 0.0001; - -/*! -Initialize a \f$\theta {\bf u}\f$ vector from an homogeneous matrix. -*/ -vpThetaUVector::vpThetaUVector(const vpHomogeneousMatrix& M) -{ - buildFrom(M) ; -} -/*! -Initialize a \f$\theta {\bf u}\f$ vector from a pose vector. -*/ -vpThetaUVector::vpThetaUVector(const vpPoseVector& p) -{ - buildFrom(p) ; -} -/*! -Initialize a \f$\theta {\bf u}\f$ vector from a rotation matrix. -*/ -vpThetaUVector::vpThetaUVector(const vpRotationMatrix& R) -{ - buildFrom(R) ; -} - -/*! -Initialize a \f$\theta {\bf u}\f$ vector from an Euler z-y-x -representation vector. -*/ -vpThetaUVector::vpThetaUVector(const vpRzyxVector& rzyx) -{ - buildFrom(rzyx) ; -} -/*! -Initialize a \f$\theta {\bf u}\f$ vector from an Euler z-y-z -representation vector. -*/ -vpThetaUVector::vpThetaUVector(const vpRzyzVector& rzyz) -{ - buildFrom(rzyz) ; -} -/*! -Initialize a \f$\theta {\bf u}\f$ vector from an Euler x-y-z -representation vector. -*/ -vpThetaUVector::vpThetaUVector(const vpRxyzVector& rxyz) -{ - buildFrom(rxyz) ; -} - -/*! -Converts an homogeneous matrix into a \f$\theta {\bf u}\f$ vector. -*/ -vpThetaUVector -vpThetaUVector::buildFrom(const vpHomogeneousMatrix& M) -{ - vpRotationMatrix R; - - M.extract(R); - buildFrom(R); - - return *this ; -} -/*! -Converts a pose vector into a \f$\theta {\bf u}\f$ vector. -*/ -vpThetaUVector -vpThetaUVector::buildFrom(const vpPoseVector& p) -{ - for(unsigned int i=0; i<3; i++) - r[i] = p[i+3]; - - return *this ; -} - -/*! -Converts a rotation matrix into a \f$\theta {\bf u}\f$ vector. -*/ -vpThetaUVector -vpThetaUVector::buildFrom(const vpRotationMatrix& R) -{ - double s,c,theta,sinc; - - s = (R[1][0]-R[0][1])*(R[1][0]-R[0][1]) - + (R[2][0]-R[0][2])*(R[2][0]-R[0][2]) - + (R[2][1]-R[1][2])*(R[2][1]-R[1][2]); - s = sqrt(s)/2.0; - c = (R[0][0]+R[1][1]+R[2][2]-1.0)/2.0; - theta=atan2(s,c); /* theta in [0, PI] since s > 0 */ - - // General case when theta != pi. If theta=pi, c=-1 - if ( (1+c) > minimum) // Since -1 <= c <= 1, no fabs(1+c) is required - { - sinc = vpMath::sinc(s,theta); - - r[0] = (R[2][1]-R[1][2])/(2*sinc); - r[1] = (R[0][2]-R[2][0])/(2*sinc); - r[2] = (R[1][0]-R[0][1])/(2*sinc); - } - else /* theta near PI */ - { - if ( (R[0][0]-c) < std::numeric_limits<double>::epsilon() ) - r[0] = 0.; - else - r[0] = theta*(sqrt((R[0][0]-c)/(1-c))); - if ((R[2][1]-R[1][2]) < 0) r[0] = -r[0]; - - if ( (R[1][1]-c) < std::numeric_limits<double>::epsilon() ) - r[1] = 0.; - else - r[1] = theta*(sqrt((R[1][1]-c)/(1-c))); - - if ((R[0][2]-R[2][0]) < 0) r[1] = -r[1]; - - if ( (R[2][2]-c) < std::numeric_limits<double>::epsilon() ) - r[2] = 0.; - else - r[2] = theta*(sqrt((R[2][2]-c)/(1-c))); - - if ((R[1][0]-R[0][1]) < 0) r[2] = -r[2]; - } - -#if (vpDEBUG_LEVEL1) // test new version wrt old version - { - // old version - int i; - // double s,c; - double ang; - double r2[3]; // has to be replaced by r below if good version - - s = (R[1][0]-R[0][1])*(R[1][0]-R[0][1]) - + (R[2][0]-R[0][2])*(R[2][0]-R[0][2]) - + (R[2][1]-R[1][2])*(R[2][1]-R[1][2]); - s = sqrt(s)/2.0; - c = (R[0][0]+R[1][1]+R[2][2]-1)/2.0; - ang=atan2(s,c); - if (ang > minimum) - { - if (s > minimum) - { - r2[0] = (R[2][1]-R[1][2])/(2*s); - r2[1] = (R[0][2]-R[2][0])/(2*s); - r2[2] = (R[1][0]-R[0][1])/(2*s); - } - else - { - r2[0] = (sqrt((R[0][0]-c)/(1-c))); - if ((R[2][1]-R[1][2]) < 0) r2[0] = -r2[0]; - r2[1] = (sqrt((R[1][1]-c)/(1-c))); - if ((R[0][2]-R[2][0]) < 0) r2[1] = -r2[1]; - r2[2] = (sqrt((R[2][2]-c)/(1-c))); - if ((R[1][0]-R[0][1]) < 0) r2[2] = -r2[2]; - } - for (i=0;i<3;i++) r2[i] = r2[i]*ang; - } - else - { - r2[0] = r2[1] = r2[2] = 0.0; - } - // end old version - // verification of the new version - int pb = 0; - - for (i=0;i<3;i++) - { - if (fabs(r[i] - r2[i]) > 1e-5) pb = 1; - } - if (pb == 1) - { - printf("vpThetaUVector::buildFrom(const vpRotationMatrix& R)\n"); - printf(" r : %lf %lf %lf\n",r[0],r[1],r[2]); - printf(" r2 : %lf %lf %lf\n",r2[0],r2[1],r2[2]); - printf(" r - r2 : %lf %lf %lf\n",r[0]-r2[0],r[1]-r2[1],r[2]-r2[2]); - } - // end of the verification - } -#endif - return *this ; -} -/*! -Build a \f$\theta {\bf u}\f$ vector from an Euler z-y-x -representation vector. -*/ -vpThetaUVector -vpThetaUVector::buildFrom(const vpRzyxVector& rzyx) -{ - vpRotationMatrix R(rzyx) ; - - buildFrom(R) ; - return *this ; -} -/*! -Build a \f$\theta {\bf u}\f$ vector from an Euler z-y-z -representation vector. -*/ -vpThetaUVector -vpThetaUVector::buildFrom(const vpRzyzVector& rzyz) -{ - vpRotationMatrix R(rzyz) ; - - buildFrom(R) ; - return *this ; -} -/*! -Build a \f$\theta {\bf u}\f$ vector from an Euler x-y-z -representation vector. -*/ -vpThetaUVector -vpThetaUVector::buildFrom(const vpRxyzVector& rxyz) -{ - vpRotationMatrix R(rxyz) ; - - buildFrom(R) ; - return *this ; -} - -/*! - -Initialize each element of the \f$\theta {\bf u}\f$ vector to the -same angle value \e v. - -\param v : Angle value to set for each element of the \f$\theta {\bf -u}\f$ vector. - -\code -#include <visp/vpMath.h> -#include <visp/vpThetaUVector.h> - -int main() -{ -vpThetaUVector tu; - -// Initialise the theta U rotation vector -tu = vpMath::rad( 45.f); // All the 3 angles are set to 45 degrees -} -\endcode -*/ -vpThetaUVector &vpThetaUVector::operator=(double v) -{ - for (int i=0; i< 3; i++) - r[i] = v; - - return *this; -} - -/*! - -Extract the rotation angle \f$ \theta \f$ and the unit vector -\f$\bf u \f$ from the \f$ \theta {\bf u} \f$ representation. - -\param theta : Rotation angle \f$ \theta \f$. - -\param u : Unit vector \f${\bf u} = (u_{x},u_{y},u_{z})^{\top} \f$ -representing the rotation axis. - -*/ -void -vpThetaUVector::extract(double &theta, vpColVector &u) const -{ - u.resize(3); - - theta = sqrt(r[0]*r[0] + r[1]*r[1] + r[2]*r[2]); - //if (theta == 0) { - if (std::fabs(theta) <= std::numeric_limits<double>::epsilon()) { - u = 0; - return; - } - for (unsigned int i=0 ; i < 3 ; i++) - u[i] = r[i] / theta ; -} - -#undef vpDEBUG_LEVEL1 diff --git a/src/math/transformation/vpTranslationVector.cpp b/src/math/transformation/vpTranslationVector.cpp deleted file mode 100644 index 00e7945ad3c5da7115cfaf4ef7abd5bf5d03a350..0000000000000000000000000000000000000000 --- a/src/math/transformation/vpTranslationVector.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/**************************************************************************** - * - * $Id: vpTranslationVector.cpp 5126 2015-01-05 22:07:11Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Translation vector. - * - * Authors: - * Eric Marchand - * Fabien Spindler - * - *****************************************************************************/ - - -#include <visp/vpTranslationVector.h> -#include <stdio.h> -#include <string.h> - -// Exception -#include <visp/vpException.h> -#include <visp/vpMatrixException.h> - -// Debug trace -#include <visp/vpDebug.h> - -/*! - \file vpTranslationVector.cpp - \brief Class that consider the case of a translation vector. -*/ - -//! initialize a size 3 vector -void vpTranslationVector::init() -{ - resize(3) ; -} - -/*! - Contruct a translation vector \f$ \bf t \f$ from 3 doubles. - - \param tx,ty,tz : Translation respectively along x, y and z axis. - -*/ -vpTranslationVector::vpTranslationVector(const double tx, - const double ty, - const double tz) -{ - init() ; - (*this)[0] = tx ; - (*this)[1] = ty ; - (*this)[2] = tz ; -} - -/*! - Copy constructor. - - \param tv : Translation vector to copy. - - \code - vpTranslationVector t1(1,2,3); // Create and initialize a translation vector - - vpTranslationVector t2(t1); // t2 is now a copy of t1 - \endcode - -*/ -vpTranslationVector::vpTranslationVector (const vpTranslationVector &tv) : vpColVector(tv) -{ -} - -/*! - Initialize a translation vector from 3 doubles. - - \param tx,ty,tz : Translation respectively along x, y and z axis. - -*/ -void -vpTranslationVector::set(const double tx, - const double ty, - const double tz) -{ - (*this)[0] = tx ; - (*this)[1] = ty ; - (*this)[2] = tz ; -} - -/*! - Operator that allows to add two translation vectors. - - \param tv : Translation vector to add. - - \return The sum of the current translation vector (*this) and the one to add. - \code - vpTranslationVector t1(1,2,3); - vpTranslationVector t2(4,5,6); - vpTranslationVector t3; - - t3 = t2 + t1; - // t1 and t2 leave unchanged - // t3 is now equal to : 5, 7, 9 - \endcode - -*/ -vpTranslationVector -vpTranslationVector::operator+(const vpTranslationVector &tv) const -{ - vpTranslationVector s; - - for (unsigned int i=0;i<3;i++) s[i] = (*this)[i]+tv[i] ; - - return s; -} - -/*! - Operator that allows to substract two translation vectors. - - \param tv : Translation vector to substract. - - \return The substraction of the current translation vector (*this) and the one to substract. - \code - vpTranslationVector t1(1,2,3); - vpTranslationVector t2(4,5,6); - vpTranslationVector t3; - - t3 = t2 - t1; - // t1 and t2 leave unchanged - // t3 is now equal to : 3, 3, 3 - \endcode - -*/ -vpTranslationVector -vpTranslationVector::operator-(const vpTranslationVector &tv) const -{ - vpTranslationVector sub ; - - for (unsigned int i=0;i<3;i++) sub[i] = (*this)[i]-tv[i] ; - - return sub; -} - - -/*! - Operator that allows to negate a translation vector. - - \return The negate translation. The current translation vector - (*this) is unchanged. - - \code - vpTranslationVector t1(1,2,3); - vpTranslationVector t2; - t2 = -t1; - // t1 is unchanged - // t2 is now equal to : -1, -2, -3 - \endcode -*/ -vpTranslationVector vpTranslationVector::operator-() const //negate -{ - vpTranslationVector tv ; - for (unsigned int i=0;i<dsize;i++) - { - *(tv.data + i) = -*(data + i) ; - } - - return tv; -} - -/*! - Operator that allows to multiply a translation vector by a scalar. - - \param x : The scalar. - - \return The translation vector multiplied by the scalar. The current - translation vector (*this) is unchanged. - - \code - vpTranslationVector t1(1,2,3); - t2 = t1 * 3; - // t1 is unchanged - // t2 is now equal to : 3, 6, 9 - \endcode -*/ -vpTranslationVector vpTranslationVector::operator*(const double x) const -{ - vpTranslationVector tv ; - for (unsigned int i=0;i<dsize;i++) - { - *(tv.data + i) = (*(data + i)) * x ; - } - - return tv; -} - -/*! - Copy operator. - \param tv : Translation vector to copy - \return A copy of t. - - \code - vpTranslationVector t1(1,2,3); - vpTranslationVector t2; - t2 = t1; - // t1 is unchanged - // t2 is now equal to t1 : 1, 2, 3 - \endcode -*/ -vpTranslationVector &vpTranslationVector::operator=(const vpTranslationVector &tv) -{ - - unsigned int k = tv.rowNum ; - if (rowNum != k){ - try { - resize(k); - } - catch(vpException me) - { - vpERROR_TRACE("Error caught") ; - throw ; - } - } - - memcpy(data, tv.data, rowNum*sizeof(double)) ; - - return *this; -} - -/*! - Initialize each element of a translation vector to the same value x. - - \param x : Value to set for each element of the translation vector. - - \code - vpTranslationVector t; - t = 3; - // Here t is set to 3,3,3 - \endcode -*/ -vpTranslationVector & vpTranslationVector::operator=(double x) -{ - - double *d = data ; - - for (int i=0;i<3;i++) - *(d++)= x ; - - return *this; -} - -/*! - \relates vpMatrix - - Compute the skew symmetric matrix \f$M\f$ of translation vector \f$t\f$ - (matrice de pre-produit vectoriel). - - \f[ \mbox{if} \quad {\bf t} = \left( \begin{array}{c} t_x \\ t_y \\ t_z - \end{array}\right), \quad \mbox{then} \qquad - M = \left( \begin{array}{ccc} - 0 & -t_z & t_y \\ - t_z & 0 & -t_x \\ - -t_y & t_x & 0 - \end{array}\right) - \f] - - \param t : Translation vector in input used to compute the skew symmetric - matrix M. - - \param M : Skew symmetric matrix of translation vector \f$t\f$. -*/ -void -vpTranslationVector::skew(const vpTranslationVector &t,vpMatrix &M) -{ - M.resize(3,3) ; - M[0][0] = 0 ; M[0][1] = -t[2] ; M[0][2] = t[1] ; - M[1][0] = t[2] ; M[1][1] = 0 ; M[1][2] = -t[0] ; - M[2][0] = -t[1] ; M[2][1] = t[0] ; M[2][2] = 0 ; -} - -/*! - - Compute the skew symmetric matrix \f$M\f$ of translation vector - \f$t\f$ (matrice de pre-produit vectoriel). - - \f[ \mbox{if} \quad {\bf t} = \left( \begin{array}{c} t_x \\ t_y \\ t_z - \end{array}\right), \quad \mbox{then} \qquad - M = \left( \begin{array}{ccc} - 0 & -t_z & t_y \\ - t_z & 0 & -t_x \\ - -t_y & t_x & 0 - \end{array}\right) - \f] - - \param t : Translation vector in input. - - \return Skew symmetric matrix \f$M\f$ of translation vector - \f$t\f$ - -*/ -vpMatrix -vpTranslationVector::skew(const vpTranslationVector &t) -{ - vpMatrix M(3, 3); - skew(t,M); - return M; -} - -/*! - - Compute the skew symmetric matrix \f$M\f$ of the translation vector (matrice - de pre-produit vectoriel), where - - \f[ M = \left( \begin{array}{ccc} - 0 & -t_z & t_y \\ - t_z & 0 & -t_x \\ - -t_y & t_x & 0 - \end{array}\right) - \f] - - and where \f$(t_x,t_y,t_z)\f$ are the coordinates of the translation - vector. - - \return Skew symmetric matrix \f$M\f$ of the translation vector. - -*/ -vpMatrix -vpTranslationVector::skew() const -{ - vpMatrix M(3, 3); - skew(*this,M); - return M; -} - - -/*! - - Return the cross product of two translation vectors \f$a \times b\f$. - - \param a,b : Translation vectors in input. - - \return The cross product of two translation vectors \f$a \times - b\f$. -*/ -vpTranslationVector -vpTranslationVector::cross(const vpTranslationVector &a, - const vpTranslationVector &b) -{ - vpMatrix skew_a = vpTranslationVector::skew(a) ; - return (vpTranslationVector)(skew_a * b); -} - -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ diff --git a/src/math/transformation/vpTranslationVector.h b/src/math/transformation/vpTranslationVector.h deleted file mode 100644 index 16c5d06f34de3a9fed58265f8a55afdb16eb22ef..0000000000000000000000000000000000000000 --- a/src/math/transformation/vpTranslationVector.h +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** - * - * $Id: vpTranslationVector.h 4574 2014-01-09 08:48:51Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Translation vector. - * - * Authors: - * Eric Marchand - * Fabien Spindler - * - *****************************************************************************/ - - - -#ifndef vpTRANSLATIONVECTOR_H -#define vpTRANSLATIONVECTOR_H - -/*! - \file vpTranslationVector.h - \brief Class that consider the case of a translation vector. -*/ - -#include <visp/vpColVector.h> - - -/*! - \class vpTranslationVector - - \ingroup TransTransformation - - \brief Class that consider the case of a translation vector. - - Let be \f$^{a}{\bf t}_{b} = [t_x,t_y,t_z]^\top\f$ be a translation - from frame \f$ a \f$ to frame \f$ b \f$. The representation of a - translation is a column vector of dimension 3. - - Translations are expressed in meters. - - The code below shows how to use a translation vector to build an - homogeneous matrix. - - \code -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpTranslationVector.h> - -int main() -{ - vpTranslationVector t; // Translation vector - - // Initialization of the translation vector - t[0] = 0.2; // tx = 0.2 meters - t[1] = -0.1; // ty = -0.1 meters - t[2] = 1.0; // tz = 1 meters - - // Construction of a rotation matrix - vpRotationMatrix R; // Set to identity by default - - // Construction of an homogeneous matrix - vpHomogeneousMatrix M(t, R); -} - \endcode - -*/ -class VISP_EXPORT vpTranslationVector : public vpColVector -{ -private: - //! initialize a size 3 vector - void init() ; - -public: - - /*! - Default constructor. - The translation vector is initialized to zero. - */ - vpTranslationVector() { init() ; } - // constructor from double in meter - vpTranslationVector(const double tx, const double ty, const double tz) ; - // copy constructor - vpTranslationVector(const vpTranslationVector &t); - void set(const double tx, const double ty, const double tz) ; - - // operators - - // translation vectors additions c = a + b (a, b unchanged) - vpTranslationVector operator+(const vpTranslationVector &t) const ; - // translation vectors substraction c = a - b (a, b unchanged) - vpTranslationVector operator-(const vpTranslationVector &t) const ; - // negate t = -a (t is unchanged) - vpTranslationVector operator-() const ; - // b = x * a (x=scalar) - vpTranslationVector operator*(const double x) const; - // Copy operator. Allow operation such as A = v - vpTranslationVector &operator=(const vpTranslationVector &t); - - vpTranslationVector &operator=(double x) ; - - - // Skew Symmetric matrix - vpMatrix skew() const ; - static vpMatrix skew(const vpTranslationVector &t) ; - static void skew(const vpTranslationVector &t, vpMatrix &M) ; - static vpTranslationVector cross(const vpTranslationVector &a, - const vpTranslationVector &b) ; -} ; - -#endif - -/* - * Local variables: - * c-basic-offset: 4 - * End: - */ diff --git a/src/simulator/wireframe-simulator/core/vpCgidefs.h b/src/simulator/wireframe-simulator/core/vpCgidefs.h deleted file mode 100755 index 7ed5c3b64294b4ded270aadc52c0ef90ba001fbd..0000000000000000000000000000000000000000 --- a/src/simulator/wireframe-simulator/core/vpCgidefs.h +++ /dev/null @@ -1,525 +0,0 @@ -/**************************************************************************** - * - * $Id: vpCgidefs.h 4574 2014-01-09 08:48:51Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * - * Authors: - * Jean-Luc CORRE - * - *****************************************************************************/ - -#ifndef vpCgidefs_H -#define vpCgidefs_H - -#include <visp/vpConfig.h> -#include <visp/vpCgiconstants.h> /* defines constants */ - -#ifndef DOXYGEN_SHOULD_SKIP_THIS - -typedef char Cchar; - -typedef float Cfloat; - -typedef int Cint; - -typedef enum -{ - ACTIVE, INACTIVE -} Cactstate; - -typedef enum -{ - CLEAR, NO_OP, RETAIN -} Cacttype; - - -typedef enum -{ - INDIVIDUAL, BUNDLED -} Casptype; - -typedef enum -{ - VALID_DATA, - TIMED_OUT, - DISABLED, - WRONG_STATE, - NOT_SUPPORTED -} Cawresult; - -typedef enum -{ - TRANSPARENT, OPAQUE -} Cbmode; - -typedef enum -{ - BITNOT, BITTRUE -} Cbitmaptype; - -typedef enum -{ - HOLLOW, SOLIDI, PATTERN, HATCH -} Cintertype; - -typedef enum -{ - STRING, CHARACTER, STROKE -} Cprectype; - -typedef enum -{ - SOLID, DOTTED, DASHED, DASHED_DOTTED, DASH_DOT_DOTTED, LONG_DASHED -} Clintype; - -typedef enum -{ - DOT, PLUS, ASTERISK, CIRCLE, X -} Cmartype; - -typedef struct -{ - Clintype line_type; - Cfloat line_width; - Cint line_color; - Cmartype marker_type; - Cfloat marker_size; - Cint marker_color; - Cintertype interior_style; - Cint hatch_index; - Cint pattern_index; - Cint fill_color; - Clintype perimeter_type; - Cfloat perimeter_width; - Cint perimeter_color; - Cint text_font; - Cprectype text_precision; - Cfloat character_expansion; - Cfloat character_spacing; - Cint text_color; -} Cbunatt; - -typedef struct -{ - unsigned char *ra; - unsigned char *ga; - unsigned char *ba; - Cint n; -} Ccentry; - -typedef enum -{ - OPEN, CLOSE -} Ccflag; - -typedef enum -{ - YES, NO -} Cchangetype; - -typedef enum -{ - NOCLIP, - CLIP, - CLIP_RECTANGLE -} Cclip; - -typedef enum -{ - CHORD, PIE -} Cclosetype; - -typedef enum -{ - REPLACE, AND, OR, NOT, XOR -} Ccombtype; - -typedef struct -{ - Cint x; - Cint y; -} Ccoor; - -typedef struct -{ - Ccoor *ptlist; - Cint n; -} Ccoorlist; - -typedef struct -{ - Ccoor *upper; - Ccoor *lower; -} Ccoorpair; - -typedef enum -{ - IC_LOCATOR, - IC_STROKE, - IC_VALUATOR, - IC_CHOICE, - IC_STRING, - IC_PICK -} Cdevoff; - -typedef enum -{ - E_TRACK, - E_ECHO, - E_TRACK_OR_ECHO, - E_TRACK_AND_ECHO -} Cechoav; - -typedef enum -{ - ECHO_OFF, ECHO_ON, TRACK_ON -} Cechostate; - -typedef enum -{ - NO_ECHO, PRINTERS_FIST, HIGHLIGHT, RUBBER_BAND_BOX, - DOTTED_LINE, SOLID_LINE, STRING_ECHO, XLINE, YLINE -} Cechotype; - -typedef struct -{ - Cint n; - Cechoav *elements; - Cechotype *echos; -} Cechotypelst; - -typedef struct -{ - Cechostate *echos; - Cint n; -} Cechostatelst; - -typedef struct -{ - int segid; /* segment */ - int pickid; /* pick id */ -} Cpick; - -typedef struct -{ - Ccoor *xypt; /* LOCATOR */ - Ccoorlist *points; /* STROKE devices */ - Cfloat val; /* VALUATOR device */ - Cint choice; /* CHOICE devices */ - Cchar *string; /* STRING device */ - Cpick *pick; /* PICK devices */ -} Cinrep; - -typedef struct -{ - Cinrep *echos; - Cint n; -} Cechodatalst; - -typedef enum -{ - NATURAL, POINT, BEST_FIT -} Cendstyle; - -typedef enum -{ - NO_OFLO, OFLO -} Ceqflow; - -typedef Cint Cerror; - -typedef enum -{ - INTERRUPT, NO_ACTION, POLL -} Cerrtype; - -typedef enum -{ - CLIP_RECT, VIEWPORT, VIEWSURFACE -} Cexttype; - -typedef enum -{ - OFF, ON -} Cflag; - -typedef struct -{ - Cintertype style; - Cflag visible; - Cint color; - Cint hatch_index; - Cint pattern_index; - Cint index; - Clintype pstyle; - Cfloat pwidth; - Cint pcolor; -} Cfillatt; - -typedef struct -{ - Cint n; - Cint *num; - Casptype *value; -} Cflaglist; - -typedef enum -{ - FREEZE, REMOVE -} Cfreeze; - -typedef struct -{ - Clintype style; - Cfloat width; - Cint color; - Cint index; -} Clinatt; - -typedef enum -{ - L_FALSE, L_TRUE -} Clogical; - -typedef struct pixrect Cpixrect; - -typedef enum -{ - RELEASE, NO_EVENTS, REQUEST_EVENT, RESPOND_EVENT, QUEUE_EVENT -} Clidstate; - -typedef struct -{ - Cmartype type; - Cfloat size; - Cint color; - Cint index; -} Cmarkatt; - -typedef enum -{ - NO_INPUT, ALWAYS_ON, SETTABLE, DEPENDS_ON_LID -} Cinputability; - -typedef struct -{ - Cint cur_index; - Cint row; - Cint column; - Cint *colorlist; - Ccoor *point; - Cint dx; - Cint dy; -} Cpatternatt; - -typedef enum -{ - PROMPT_OFF, PROMPT_ON -} Cpromstate; - -typedef enum -{ - ACK_ON, ACK_OFF -} Cackstate; - - -typedef struct -{ - Cint n; - Cdevoff *class; - Cint *assoc; -} Cassoclid; - -typedef struct -{ - Clidstate state; - Cpromstate prompt; - Cackstate acknowledgement; - Cinrep *current; - Cint n; - Cint *triggers; - Cechotype echotyp; - Cechostate echosta; - Cint echodat; -} Cstatelist; - -typedef struct -{ - Clogical sample; - Cchangetype change; - Cint numassoc; - Cint *trigassoc; - Cinputability prompt; - Cinputability acknowledgement; - Cechotypelst *echo; - Cchar *classdep; - Cstatelist state; -} Cliddescript; - -typedef enum -{ - SIMULTANEOUS_EVENT_FOLLOWS, SINGLE_EVENT -} Cmesstype; - -typedef enum -{ - RIGHT, LEFT, UP, DOWN -} Cpathtype; - -typedef enum -{ - LFT, CNTER, RGHT, NRMAL, CNT -} Chaligntype; - -typedef enum -{ - TOP, CAP, HALF, BASE, BOTTOM, NORMAL, CONT -} Cvaligntype; - -typedef enum -{ - NOT_VALID, EMPTY, NON_EMPTY, ALMOST_FULL, FULL -} Cqtype; - -typedef enum -{ - ABSOLUTE, SCALED -} Cspecmode; - -typedef enum -{ - NONE, REQUIRED_FUNCTIONS_ONLY, SOME_NON_REQUIRED_FUNCTIONS, - ALL_NON_REQUIRED_FUNCTIONS -} Csuptype; - -typedef struct -{ - Cint fontset; - Cint index; - Cint current_font; - Cprectype precision; - Cfloat exp_factor; - Cfloat space; - Cint color; - Cint height; - Cfloat basex; - Cfloat basey; - Cfloat upx; - Cfloat upy; - Cpathtype path; - Chaligntype halign; - Cvaligntype valign; - Cfloat hcalind; - Cfloat vcalind; -} Ctextatt; - -typedef enum -{ - NOT_FINAL, FINAL -} Ctextfinal; - -typedef struct -{ - Cchangetype change; - Cassoclid *numassoc; - Cint maxassoc; - Cpromstate prompt; - Cackstate acknowledgement; - Cchar *name; - Cchar *description; -} Ctrigdis; - -typedef struct -{ - Cactstate state; - Cassoclid *assoc; -} Ctrigstate; - -typedef enum -{ - INTEGER, REAL, BOTH -} Cvdctype; - -typedef struct -{ - Cint numloc; - Cint numval; - Cint numstrk; - Cint numchoice; - Cint numstr; - Cint numtrig; - Csuptype event_queue; - Csuptype asynch; - Csuptype coord_map; - Csuptype echo; - Csuptype tracking; - Csuptype prompt; - Csuptype acknowledgement; - Csuptype trigger_manipulation; -} Ccgidesctab; - -typedef struct -{ - Cchar screenname[DEVNAMESIZE]; /* physical screen */ - Cchar windowname[DEVNAMESIZE]; /* window */ - Cint windowfd; /* window file */ - Cint retained; /* retained flag */ - Cint dd; /* device */ - Cint cmapsize; /* color map size */ - Cchar cmapname[DEVNAMESIZE]; /* color map name */ - Cint flags; /* new flag */ - Cchar **ptr; /* CGI tool descriptor */ -} Cvwsurf; - - - -/* define abnormal function calls */ - -Cpixrect *inquire_device_bitmap(); -Clinatt *inquire_line_attributes(); -Cmarkatt *inquire_marker_attributes(); -Cfillatt *inquire_fill_area_attributes(); -Cpatternatt *inquire_pattern_attributes(); -Ctextatt *inquire_text_attributes(); -Cflaglist *inquire_aspect_source_flags(); - -/* define abnormal CGIPW function calls */ -Clinatt *cgipw_inquire_line_attributes(); -Cmarkatt *cgipw_inquire_marker_attributes(); -Cfillatt *cgipw_inquire_fill_area_attributes(); -Cpatternatt *cgipw_inquire_pattern_attributes(); -Ctextatt *cgipw_inquire_text_attributes(); -Cflaglist *cgipw_inquire_aspect_source_flags(); -#endif - -#endif \ No newline at end of file diff --git a/src/simulator/wireframe-simulator/scene/CMakeWireframeScenesList.cmake b/src/simulator/wireframe-simulator/scene/CMakeWireframeScenesList.cmake deleted file mode 100644 index 5b605fa34bd01ab1938b6231af8f965e11eb5c3c..0000000000000000000000000000000000000000 --- a/src/simulator/wireframe-simulator/scene/CMakeWireframeScenesList.cmake +++ /dev/null @@ -1,86 +0,0 @@ -############################################################################# -# -# $Id: CMakeWireframeScenesList.cmake 4574 2014-01-09 08:48:51Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# Default scenes used by the wireframe simulator -# -# Authors: -# Nicolas Melchior -# -############################################################################# - -SET(WIREFRAME_SCENES - 3pts.bnd - 3pts.sld - camera.bnd - camera.sld - circle.bnd - circle.sld - circles2.bnd - circles2.sld - circle_sq2.bnd - circle_sq2.sld - cube.bnd - cube.sld - cylinder.bnd - cylinder.sld - diamond.bnd - diamond.sld - line.bnd - line.sld - pipe.bnd - pipe.sld - plan.bnd - plan.sld - plate.bnd - plate.sld - plate_6cm.bnd - plate_6cm.sld - plate_8cm.bnd - plate_8cm.sld - point.bnd - point.sld - point_cloud.bnd - point_cloud.sld - rectangle.bnd - rectangle.sld - road.bnd - road.sld - sphere.bnd - sphere.sld - square10cm.bnd - square10cm.sld - tool.bnd - tool.sld - trapezoid.bnd - trapezoid.sld -) diff --git a/src/tracking/forward-projection/vpPoint.cpp b/src/tracking/forward-projection/vpPoint.cpp deleted file mode 100644 index 5c7e2dc4a99059046df677845bad454fa2a0e302..0000000000000000000000000000000000000000 --- a/src/tracking/forward-projection/vpPoint.cpp +++ /dev/null @@ -1,320 +0,0 @@ -/**************************************************************************** - * - * $Id: vpPoint.cpp 4620 2014-01-27 21:28:32Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Point feature. - * - * Authors: - * Eric Marchand - * - *****************************************************************************/ - - -#include <visp/vpPoint.h> -#include <visp/vpDebug.h> -#include <visp/vpFeatureDisplay.h> - -#include <visp/vpHomography.h> - -/*! - \file vpPoint.cpp - \brief class that defines what is a point -*/ - - - -void -vpPoint::init() -{ - p.resize(3) ; p = 0 ; p[2] = 1 ; - oP.resize(4) ; oP = 0 ; oP[3] = 1 ; - cP.resize(4) ; cP = 0 ; cP[3] = 1 ; - - //default value Z (1 meters) - set_Z(1) ; -} - -vpPoint::vpPoint() -{ - init() ; -} - -//! set the point world coordinates -void -vpPoint::setWorldCoordinates(const double ox, - const double oy, - const double oz) -{ - oP[0] = ox ; - oP[1] = oy ; - oP[2] = oz ; - oP[3] = 1 ; -} - - -void -vpPoint::setWorldCoordinates(const vpColVector &_oP) -{ - oP[0] = _oP[0] ; - oP[1] = _oP[1] ; - oP[2] = _oP[2] ; - oP[3] = _oP[3] ; - - oP /= oP[3] ; -} - -void -vpPoint::getWorldCoordinates(double& ox, - double& oy, - double& oz) -{ - ox = oP[0] ; - oy = oP[1] ; - oz = oP[2] ; -} - - -void -vpPoint::getWorldCoordinates(vpColVector &_oP) -{ - _oP[0] = oP[0] ; - _oP[1] = oP[1] ; - _oP[2] = oP[2] ; - _oP[3] = oP[3] ; -} - - -vpColVector -vpPoint::getWorldCoordinates(void) -{ - return this->oP; -} - - - -/*! - Compute the perspective projection of a point _cP. - - \param _cP : Three dimension vector that corresponds to the coordinates of the point in the camera frame. - \param _p : Coordinates of the point in the image plane obtained by perspective projection. -*/ -void -vpPoint::projection(const vpColVector &_cP, vpColVector &_p) -{ - _p.resize(3) ; - - _p[0] = _cP[0]/_cP[2] ; - _p[1] = _cP[1]/_cP[2] ; - _p[2] = 1 ; -} - -/*! - From the 3D coordinates of the point in the object frame set using for example - setWorldCoordinates() or set_oX(), set_oY(), set_oZ(), compute the 3D coordinates - of the point in the camera frame. - - \param cMo : Transformation from camera to object frame. - \param _cP : 3D coordinates of the point in the camera frame. -*/ -void -vpPoint::changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &_cP) -{ - - _cP.resize(4) ; - - _cP[0] = cMo[0][0]*oP[0]+ cMo[0][1]*oP[1]+ cMo[0][2]*oP[2]+ cMo[0][3]*oP[3] ; - _cP[1] = cMo[1][0]*oP[0]+ cMo[1][1]*oP[1]+ cMo[1][2]*oP[2]+ cMo[1][3]*oP[3] ; - _cP[2] = cMo[2][0]*oP[0]+ cMo[2][1]*oP[1]+ cMo[2][2]*oP[2]+ cMo[2][3]*oP[3] ; - _cP[3] = cMo[3][0]*oP[0]+ cMo[3][1]*oP[1]+ cMo[3][2]*oP[2]+ cMo[3][3]*oP[3] ; - - double d = 1/_cP[3] ; - _cP[0] *=d ; - _cP[1] *=d ; - _cP[2] *=d ; - _cP[3] *=d ; ; -} - -/*! - From the coordinates of the point in camera frame b and the transformation between - camera frame a and camera frame b computes the coordinates of the point in camera frame a. - - \param aMb : 3D transformation between camera frame a and b. - \param bP : 3D coordinates of the point in camera frame bP. - - \return A point with 3D coordinates in the camera frame a. The coordinates in the world or object - frame are set to the same coordinates than the one in the camera frame. -*/ -const vpPoint -operator*(const vpHomogeneousMatrix &aMb, const vpPoint& bP) -{ - vpPoint aP ; - - vpColVector v(4),v1(4) ; - - v[0] = bP.get_X() ; - v[1] = bP.get_Y() ; - v[2] = bP.get_Z() ; - v[3] = bP.get_W() ; - - v1[0] = aMb[0][0]*v[0] + aMb[0][1]*v[1]+ aMb[0][2]*v[2]+ aMb[0][3]*v[3] ; - v1[1] = aMb[1][0]*v[0] + aMb[1][1]*v[1]+ aMb[1][2]*v[2]+ aMb[1][3]*v[3] ; - v1[2] = aMb[2][0]*v[0] + aMb[2][1]*v[1]+ aMb[2][2]*v[2]+ aMb[2][3]*v[3] ; - v1[3] = aMb[3][0]*v[0] + aMb[3][1]*v[1]+ aMb[3][2]*v[2]+ aMb[3][3]*v[3] ; - - v1 /= v1[3] ; - - // v1 = M*v ; - aP.set_X(v1[0]) ; - aP.set_Y(v1[1]) ; - aP.set_Z(v1[2]) ; - aP.set_W(v1[3]) ; - - aP.set_oX(v1[0]) ; - aP.set_oY(v1[1]) ; - aP.set_oZ(v1[2]) ; - aP.set_oW(v1[3]) ; - - return aP ; -} - -/*! - From the coordinates of the point in image plane b and the homography between image - a and b computes the coordinates of the point in image plane a. - - \param aHb : Homography between image a and b. - \param bP : 2D coordinates of the point in the image plane b. - - \return A point with 2D coordinates in the image plane a. -*/ -const vpPoint -operator*(const vpHomography &aHb, const vpPoint& bP) -{ - vpPoint aP ; - vpColVector v(3),v1(3) ; - - v[0] = bP.get_x() ; - v[1] = bP.get_y() ; - v[2] = bP.get_w() ; - - v1[0] = aHb[0][0]*v[0] + aHb[0][1]*v[1]+ aHb[0][2]*v[2] ; - v1[1] = aHb[1][0]*v[0] + aHb[1][1]*v[1]+ aHb[1][2]*v[2] ; - v1[2] = aHb[2][0]*v[0] + aHb[2][1]*v[1]+ aHb[2][2]*v[2] ; - - // v1 = M*v ; - aP.set_x(v1[0]) ; - aP.set_y(v1[1]) ; - aP.set_w(v1[2]) ; - - return aP ; -} - -//! For memory issue (used by the vpServo class only). -vpPoint *vpPoint::duplicate() const -{ - vpPoint *feature = new vpPoint(*this) ; - return feature ; -} - -/*! - Display the point in the image. -*/ -void -vpPoint::display(const vpImage<unsigned char> &I, - const vpHomogeneousMatrix &cMo, - const vpCameraParameters &cam, - const vpColor &color, - const unsigned int thickness) -{ - - vpColVector _cP, _p ; - changeFrame(cMo,_cP) ; - - if(_cP[2] < 0) // no display if point is behind the camera - return; - - vpPoint::projection(_cP,_p) ; - vpFeatureDisplay::displayPoint(_p[0],_p[1], cam, I, color, thickness) ; -} - -/*! - Display the point in the image. -*/ -void -vpPoint::display(const vpImage<vpRGBa> &I, - const vpHomogeneousMatrix &cMo, - const vpCameraParameters &cam, - const vpColor &color, - const unsigned int thickness) -{ - vpColVector _cP, _p ; - changeFrame(cMo,_cP) ; - - if(_cP[2] < 0) // no display if point is behind the camera - return; - - vpPoint::projection(_cP,_p) ; - vpFeatureDisplay::displayPoint(_p[0],_p[1], cam, I, color, thickness) ; -} - -VISP_EXPORT std::ostream& operator<<(std::ostream& os, vpPoint& /* vpp */) -{ - return( os<<"vpPoint" ); -} - -vpPoint& -vpPoint::operator=(const vpPoint& vpp ) -{ - p = vpp.p; - cP = vpp.cP; - oP = vpp.oP; - cPAvailable = vpp.cPAvailable; - - return *this; -} - -/*! - Display the point in the image. -*/ -void -vpPoint::display(const vpImage<unsigned char> &I, - const vpCameraParameters &cam, - const vpColor &color, - const unsigned int thickness) -{ - vpFeatureDisplay::displayPoint(p[0], p[1], cam, I, color, thickness) ; -} -/* - * Local variables: - * c-basic-offset: 2 - * End: - */ diff --git a/src/tracking/forward-projection/vpPoint.h b/src/tracking/forward-projection/vpPoint.h deleted file mode 100644 index ebe0a836093d9c988bd84df0d7538bc8ca279222..0000000000000000000000000000000000000000 --- a/src/tracking/forward-projection/vpPoint.h +++ /dev/null @@ -1,211 +0,0 @@ -/**************************************************************************** - * - * $Id: vpPoint.h 4574 2014-01-09 08:48:51Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Point feature. - * - * Authors: - * Eric Marchand - * - *****************************************************************************/ - - -#ifndef vpPoint_H -#define vpPoint_H - -class vpHomography ; - -/*! - \file vpPoint.h - \brief class that defines what is a point -*/ - -#include <visp/vpMatrix.h> -#include <visp/vpHomogeneousMatrix.h> - -#include <visp/vpForwardProjection.h> - -class vpHomography; - -/*! - \class vpPoint - \ingroup TrackingFeature GeometryFeature - \brief Class that defines what is a point. -*/ -class VISP_EXPORT vpPoint : public vpForwardProjection -{ - -public: - //! Basic constructor. - vpPoint() ; - //! Destructor. - virtual ~vpPoint() { ; } - -public: - - // Compute the 3D coordinates _cP (camera frame) - void changeFrame(const vpHomogeneousMatrix &cMo, vpColVector &_cP) ; - - /*! - From the 3D coordinates of the point in the object frame set using for example - setWorldCoordinates() or set_oX(), set_oY(), set_oZ(), compute the 3D coordinates - of the point in the camera frame. - - \param cMo : Transformation from camera to object frame. - - */ - inline void changeFrame(const vpHomogeneousMatrix &cMo) { - double X = cMo[0][0]*oP[0]+ cMo[0][1]*oP[1]+ cMo[0][2]*oP[2]+ cMo[0][3]*oP[3] ; - double Y = cMo[1][0]*oP[0]+ cMo[1][1]*oP[1]+ cMo[1][2]*oP[2]+ cMo[1][3]*oP[3] ; - double Z = cMo[2][0]*oP[0]+ cMo[2][1]*oP[1]+ cMo[2][2]*oP[2]+ cMo[2][3]*oP[3] ; - double W = cMo[3][0]*oP[0]+ cMo[3][1]*oP[1]+ cMo[3][2]*oP[2]+ cMo[3][3]*oP[3] ; - - double d = 1/W ; - cP[0] =X*d ; - cP[1] =Y*d ; - cP[2] =Z*d ; - cP[3] =1 ; - } - - void display(const vpImage<unsigned char> &I, - const vpCameraParameters &cam, - const vpColor &color=vpColor::green, - const unsigned int thickness=1) ; - void display(const vpImage<unsigned char> &I, - const vpHomogeneousMatrix &cMo, - const vpCameraParameters &cam, - const vpColor &color=vpColor::green, - const unsigned int thickness=1) ; - void display(const vpImage<vpRGBa> &I, - const vpHomogeneousMatrix &cMo, - const vpCameraParameters &cam, - const vpColor &color=vpColor::green, - const unsigned int thickness=1) ; - vpPoint *duplicate() const ; - - // Get coordinates - //! Get the point X coordinate in the camera frame. - double get_X() const { return cP[0] ; } - //! Get the point Y coordinate in the camera frame. - double get_Y() const { return cP[1] ; } - //! Get the point Z coordinate in the camera frame. - double get_Z() const { return cP[2] ; } - //! Get the point W coordinate in the camera frame. - double get_W() const { return cP[3] ; } - - //! Get the point X coordinate in the object frame. - double get_oX() const { return oP[0] ; } - //! Get the point Y coordinate in the object frame. - double get_oY() const { return oP[1] ; } - //! Get the point Z coordinate in the object frame. - double get_oZ() const { return oP[2] ; } - //! Get the point W coordinate in the object frame. - double get_oW() const { return oP[3] ; } - - //! Get the point x coordinate in the image plane. - double get_x() const { return p[0] ; } - //! Get the point y coordinate in the image plane. - double get_y() const { return p[1] ; } - //! Get the point w coordinate in the image plane. - double get_w() const { return p[2] ; } - - //! Get the point world coordinates. We mean here the coordinates of the point in the object frame. - void getWorldCoordinates(double& ox, - double& oy, - double& oz) ; - //! Get the point world coordinates. We mean here the coordinates of the point in the object frame. - void getWorldCoordinates(vpColVector &_oP) ; - vpColVector getWorldCoordinates(void) ; - - //! Basic construction. - void init() ; - - friend VISP_EXPORT std::ostream& operator<<(std::ostream& os, vpPoint& vpp); - vpPoint& operator=(const vpPoint& vpp); - - //! Projection onto the image plane of a point. Input: the 3D coordinates in the camera frame _cP, output : the 2D coordinates _p. - void projection(const vpColVector &_cP, vpColVector &_p) ; - - /*! - Perspective projection of the point. - - Projection onto the //image plane of the point. Update the object - attribute p (2D //homogeneous coordinates) according to object - attribute cP (current //3D coordinates in the camera frame). - - */ - inline void projection() { - double d = 1/cP[2] ; - p[0] = cP[0]*d ; - p[1] = cP[1]*d ; - p[2] = 1 ; - } - - // Set coordinates - //! Set the point X coordinate in the camera frame. - inline void set_X(const double X) { cP[0] = X ; } - //! Set the point Y coordinate in the camera frame. - inline void set_Y(const double Y) { cP[1] = Y ; } - //! Set the point Z coordinate in the camera frame. - inline void set_Z(const double Z) { cP[2] = Z ; } - //! Set the point W coordinate in the camera frame. - inline void set_W(const double W) { cP[3] = W ; } - - //! Set the point X coordinate in the object frame. - inline void set_oX(const double X) { oP[0] = X ; } - //! Set the point Y coordinate in the object frame. - inline void set_oY(const double Y) { oP[1] = Y ; } - //! Set the point Z coordinate in the object frame. - inline void set_oZ(const double Z) { oP[2] = Z ; } - //! Set the point W coordinate in the object frame. - inline void set_oW(const double W) { oP[3] = W ; } - - //! Set the point x coordinate in the image plane. - inline void set_x(const double x) { p[0] = x ; } - //! Set the point y coordinate in the image plane. - inline void set_y(const double y) { p[1] = y ; } - //! Set the point w coordinate in the image plane. - inline void set_w(const double w) { p[2] = w ; } - - //! Set the point world coordinates. We mean here the coordinates of the point in the object frame. - void setWorldCoordinates(const double ox, - const double oy, - const double oz) ; - //! Set the point world coordinates. We mean here the coordinates of the point in the object frame. - void setWorldCoordinates(const vpColVector &_oP) ; -} ; - -const vpPoint VISP_EXPORT operator*(const vpHomogeneousMatrix &M, const vpPoint& p) ; -const vpPoint VISP_EXPORT operator*(const vpHomography &H, const vpPoint& p) ; - -#endif diff --git a/src/tracking/mbt/edge/vpMbtDistanceLine.cpp b/src/tracking/mbt/edge/vpMbtDistanceLine.cpp deleted file mode 100644 index 78adf27278059948a3b63baf061b7e2100389cf7..0000000000000000000000000000000000000000 --- a/src/tracking/mbt/edge/vpMbtDistanceLine.cpp +++ /dev/null @@ -1,634 +0,0 @@ -/**************************************************************************** - * - * $Id: vpMbtDistanceLine.cpp 5136 2015-01-08 10:09:04Z ayol $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Make the complete tracking of an object by using its CAD model - * - * Authors: - * Nicolas Melchior - * Romain Tallonneau - * Eric Marchand - * - *****************************************************************************/ -#include <visp/vpConfig.h> - -/*! - \file vpMbtDistanceLine.cpp - \brief Make the complete tracking of an object by using its CAD model. -*/ - -#include <visp/vpMbtDistanceLine.h> -#include <visp/vpPlane.h> -#include <visp/vpMeterPixelConversion.h> -#include <visp/vpFeatureBuilder.h> -#include <stdlib.h> - -void buildPlane(vpPoint &P, vpPoint &Q, vpPoint &R, vpPlane &plane); -void buildLine(vpPoint &P1, vpPoint &P2, vpPoint &P3, vpPoint &P4, vpLine &L); - -/*! - Basic constructor -*/ -vpMbtDistanceLine::vpMbtDistanceLine() - : name(), index(0), cam(), me(NULL), alpha(0), wmean(1), - featureline(), poly(), meline(NULL), line(NULL), p1(NULL), p2(NULL), L(), - error(), nbFeature(0), Reinit(false), hiddenface(NULL), Lindex_polygon(), - isvisible(false) -{ -} - -/*! - Basic destructor useful to deallocate the memory. -*/ -vpMbtDistanceLine::~vpMbtDistanceLine() -{ -// cout << "Deleting line " << index << endl ; - if (line != NULL) delete line ; - if (meline != NULL) delete meline ; - -} - -/*! - Project the line and the two points corresponding to its extremities into the image. - - \param cMo : The pose of the camera used to project the line into the image. -*/ -void -vpMbtDistanceLine::project(const vpHomogeneousMatrix &cMo) -{ - line->project(cMo) ; - p1->project(cMo) ; - p2->project(cMo) ; -} - -/*! - Build a 3D plane thanks to 3 points and stores it in \f$ plane \f$. - - \param P : The first point to define the plane - \param Q : The second point to define the plane - \param R : The third point to define the plane - \param plane : The vpPlane instance used to store the computed plane equation. -*/ -void -buildPlane(vpPoint &P, vpPoint &Q, vpPoint &R, vpPlane &plane) -{ - vpColVector a(3); - vpColVector b(3); - vpColVector n(3); - //Calculate vector corresponding to PQ - a[0]=P.get_oX()-Q.get_oX(); - a[1]=P.get_oY()-Q.get_oY(); - a[2]=P.get_oZ()-Q.get_oZ(); - - //Calculate vector corresponding to PR - b[0]=P.get_oX()-R.get_oX(); - b[1]=P.get_oY()-R.get_oY(); - b[2]=P.get_oZ()-R.get_oZ(); - - //Calculate normal vector to plane PQ x PR - n=vpColVector::cross(a,b); - - //Equation of the plane is given by: - double A = n[0]; - double B = n[1]; - double C = n[2]; - double D=-(A*P.get_oX()+B*P.get_oY()+C*P.get_oZ()); - - double norm = sqrt(A*A+B*B+C*C) ; - plane.setA(A/norm) ; - plane.setB(B/norm) ; - plane.setC(C/norm) ; - plane.setD(D/norm) ; -} - - -/*! - Build a line thanks to 4 points. - - The method is the following : Two plane are computed thanks to (P1,P2,P3) and (P1,P2,P4) (see the buildPlane method). Then the line equation is computed thanks to the intersection between the two planes. - - \param P1 : The first point to compute the line. - \param P2 : The second point to compute the line. - \param P3 : The third point to compute the line. - \param P4 : The fourth point to compute the line. - \param L : The instance of vpLine to store the computed line equation. -*/ -void -buildLine(vpPoint &P1, vpPoint &P2, vpPoint &P3, vpPoint &P4, vpLine &L) -{ - vpPlane plane1; - vpPlane plane2 ; - buildPlane(P1,P2,P3,plane1) ; - buildPlane(P1,P2,P4,plane2) ; - - L.setWorldCoordinates(plane1.getA(),plane1.getB(), plane1.getC(),plane1.getD(), - plane2.getA(),plane2.getB(), plane2.getC(),plane2.getD()) ; -} - - -/*! - Build a vpMbtDistanceLine thanks to two points corresponding to the extremities. - - \param _p1 : The first extremity. - \param _p2 : The second extremity. -*/ -void -vpMbtDistanceLine::buildFrom(vpPoint &_p1, vpPoint &_p2) -{ - line = new vpLine ; - poly.setNbPoint(2); - poly.addPoint(0, _p1); - poly.addPoint(1, _p2); - - p1 = &poly.p[0]; - p2 = &poly.p[1]; - - vpColVector V1(3); - vpColVector V2(3); - vpColVector V3(3); - vpColVector V4(3); - - V1[0] = p1->get_oX(); - V1[1] = p1->get_oY(); - V1[2] = p1->get_oZ(); - V2[0] = p2->get_oX(); - V2[1] = p2->get_oY(); - V2[2] = p2->get_oZ(); - - //if((V1-V2).sumSquare()!=0) - if(std::fabs((V1-V2).sumSquare()) > std::numeric_limits<double>::epsilon()) - { - { - V3[0]=double(rand()%1000)/100; - V3[1]=double(rand()%1000)/100; - V3[2]=double(rand()%1000)/100; - - - vpColVector v_tmp1,v_tmp2; - v_tmp1 = V2-V1; - v_tmp2 = V3-V1; - V4=vpColVector::cross(v_tmp1,v_tmp2); - } - - vpPoint P3; - P3.setWorldCoordinates(V3[0],V3[1],V3[2]); - vpPoint P4; - P4.setWorldCoordinates(V4[0],V4[1],V4[2]); - buildLine(*p1,*p2, P3,P4, *line) ; - } - else - { - vpPoint P3; - P3.setWorldCoordinates(V1[0],V1[1],V1[2]); - vpPoint P4; - P4.setWorldCoordinates(V2[0],V2[1],V2[2]); - buildLine(*p1,*p2,P3,P4,*line) ; - } -} - - -/*! - Set the moving edge parameters. - - \param _me : an instance of vpMe containing all the desired parameters -*/ -void -vpMbtDistanceLine::setMovingEdge(vpMe *_me) -{ - me = _me ; - if (meline != NULL) - { - meline->reset(); - meline->setMe(me) ; - } -} - - -/*! - Initialize the moving edge thanks to a given pose of the camera. - The 3D model is projected into the image to create moving edges along the line. - - \param I : The image. - \param cMo : The pose of the camera used to initialize the moving edges. - \return false if an error occur, true otherwise. -*/ -bool -vpMbtDistanceLine::initMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo) -{ - if(isvisible){ - p1->changeFrame(cMo); - p2->changeFrame(cMo); - - if(poly.getClipping() > 3) // Contains at least one FOV constraint - cam.computeFov(I.getWidth(), I.getHeight()); - - poly.computeRoiClipped(cam); - - if(poly.roiPointsClip.size() == 2){ //Les points sont visibles. - vpImagePoint ip1, ip2; - double rho,theta; - line->changeFrame(cMo); - line->projection(); - - vpMeterPixelConversion::convertPoint(cam,poly.roiPointsClip[0].first.get_x(),poly.roiPointsClip[0].first.get_y(),ip1); - vpMeterPixelConversion::convertPoint(cam,poly.roiPointsClip[1].first.get_x(),poly.roiPointsClip[1].first.get_y(),ip2); - - //rho theta uv - vpMeterPixelConversion::convertLine(cam,line->getRho(),line->getTheta(),rho,theta); - - while (theta > M_PI) { theta -= M_PI ; } - while (theta < -M_PI) { theta += M_PI ; } - - if (theta < -M_PI/2.0) theta = -theta - 3*M_PI/2.0; - else theta = M_PI/2.0 - theta; - - meline = new vpMbtMeLine ; - meline->setMe(me) ; - - // meline->setDisplay(vpMeSite::RANGE_RESULT) ; - meline->setInitRange(0); - - int marge = /*10*/5; //ou 5 normalement - if (ip1.get_j()<ip2.get_j()) { meline->jmin = (int)ip1.get_j()-marge ; meline->jmax = (int)ip2.get_j()+marge ; } else{ meline->jmin = (int)ip2.get_j()-marge ; meline->jmax = (int)ip1.get_j()+marge ; } - if (ip1.get_i()<ip2.get_i()) { meline->imin = (int)ip1.get_i()-marge ; meline->imax = (int)ip2.get_i()+marge ; } else{ meline->imin = (int)ip2.get_i()-marge ; meline->imax = (int)ip1.get_i()+marge ; } - - try - { - meline->initTracking(I,ip1,ip2,rho,theta); - } - catch(...) - { - //vpTRACE("the line can't be initialized"); - return false; - } - } - else{ - if (meline!=NULL) delete meline; - meline=NULL; - isvisible = false; - } - } -// trackMovingEdge(I,cMo) ; - return true; -} - - - -/*! - Track the moving edges in the image. - - \param I : the image. - \param cMo : The pose of the camera. -*/ -void -vpMbtDistanceLine::trackMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix & /*cMo*/) -{ - - if (isvisible) - { -// p1->changeFrame(cMo) ; -// p2->changeFrame(cMo) ; -// -// p1->projection() ; -// p2->projection() ; -// -// vpImagePoint ip1, ip2; -// -// vpMeterPixelConversion::convertPoint(*cam,p1->get_x(),p1->get_y(),ip1) ; -// vpMeterPixelConversion::convertPoint(*cam,p2->get_x(),p2->get_y(),ip2) ; -// -// int marge = /*10*/5; //ou 5 normalement -// if (ip1.get_j()<ip2.get_j()) { meline->jmin = ip1.get_j()-marge ; meline->jmax = ip2.get_j()+marge ; } -// else{ meline->jmin = ip2.get_j()-marge ; meline->jmax = ip1.get_j()+marge ; } -// if (ip1.get_i()<ip2.get_i()) { meline->imin = ip1.get_i()-marge ; meline->imax = ip2.get_i()+marge ; } -// else{ meline->imin = ip2.get_i()-marge ; meline->imax = ip1.get_i()+marge ; } - - try - { - meline->track(I) ; - } - catch(...) - { - meline->reset(); - Reinit = true; - } - nbFeature =(unsigned int) meline->getMeList().size(); - } -} - - -/*! - Update the moving edges internal parameters. - - \param I : the image. - \param cMo : The pose of the camera. -*/ -void -vpMbtDistanceLine::updateMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo) -{ - if(isvisible){ - p1->changeFrame(cMo); - p2->changeFrame(cMo); - - if(poly.getClipping() > 3) // Contains at least one FOV constraint - cam.computeFov(I.getWidth(), I.getHeight()); - - poly.computeRoiClipped(cam); - - if(poly.roiPointsClip.size() == 2){ //Les points sont visibles. - vpImagePoint ip1, ip2; - double rho,theta; - line->changeFrame(cMo); - line->projection(); - - vpMeterPixelConversion::convertPoint(cam,poly.roiPointsClip[0].first.get_x(),poly.roiPointsClip[0].first.get_y(),ip1); - vpMeterPixelConversion::convertPoint(cam,poly.roiPointsClip[1].first.get_x(),poly.roiPointsClip[1].first.get_y(),ip2); - - //rho theta uv - vpMeterPixelConversion::convertLine(cam,line->getRho(),line->getTheta(),rho,theta); - - while (theta > M_PI) { theta -= M_PI ; } - while (theta < -M_PI) { theta += M_PI ; } - - if (theta < -M_PI/2.0) theta = -theta - 3*M_PI/2.0; - else theta = M_PI/2.0 - theta; - - int marge = /*10*/5; //ou 5 normalement - if (ip1.get_j()<ip2.get_j()) { meline->jmin = (int)ip1.get_j()-marge ; meline->jmax = (int)ip2.get_j()+marge ; } else{ meline->jmin = (int)ip2.get_j()-marge ; meline->jmax = (int)ip1.get_j()+marge ; } - if (ip1.get_i()<ip2.get_i()) { meline->imin = (int)ip1.get_i()-marge ; meline->imax = (int)ip2.get_i()+marge ; } else{ meline->imin = (int)ip2.get_i()-marge ; meline->imax = (int)ip1.get_i()+marge ; } - - try - { - //meline->updateParameters(I,rho,theta) ; - meline->updateParameters(I,ip1,ip2,rho,theta) ; - } - catch(...) - { - Reinit = true; - } - nbFeature = (unsigned int)meline->getMeList().size(); - } - else{ - if (meline!=NULL) delete meline; - meline=NULL; - isvisible = false; - } - } -} - - -/*! - Reinitialize the line if it is required. - - A line is reinitialized if the 2D line do not match enough with the projected 3D line. - - \param I : the image. - \param cMo : The pose of the camera. -*/ -void -vpMbtDistanceLine::reinitMovingEdge(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo) -{ - if(meline!= NULL) - delete meline; - - if (initMovingEdge(I,cMo) == false) - Reinit = true; - - Reinit = false; -} - - -/*! - Display the line. The 3D line is projected into the image. - - \param I : The image. - \param cMo : Pose used to project the 3D model into the image. - \param camera : The camera parameters. - \param col : The desired color. - \param thickness : The thickness of the line. - \param displayFullModel : If true, the line is displayed even if it is not visible. -*/ -void -vpMbtDistanceLine::display(const vpImage<unsigned char> &I, const vpHomogeneousMatrix &cMo, - const vpCameraParameters &camera, const vpColor col, const unsigned int thickness, const bool displayFullModel) -{ - if(isvisible || displayFullModel){ - p1->changeFrame(cMo); - p2->changeFrame(cMo); - - vpImagePoint ip1, ip2; - vpCameraParameters c = camera; - if(poly.getClipping() > 3) // Contains at least one FOV constraint - c.computeFov(I.getWidth(), I.getHeight()); - - poly.computeRoiClipped(c); - - if( poly.roiPointsClip.size() == 2 && - ((poly.roiPointsClip[1].second & poly.roiPointsClip[0].second & vpMbtPolygon::NEAR_CLIPPING) == 0) && - ((poly.roiPointsClip[1].second & poly.roiPointsClip[0].second & vpMbtPolygon::FAR_CLIPPING) == 0) && - ((poly.roiPointsClip[1].second & poly.roiPointsClip[0].second & vpMbtPolygon::DOWN_CLIPPING) == 0) && - ((poly.roiPointsClip[1].second & poly.roiPointsClip[0].second & vpMbtPolygon::UP_CLIPPING) == 0) && - ((poly.roiPointsClip[1].second & poly.roiPointsClip[0].second & vpMbtPolygon::LEFT_CLIPPING) == 0) && - ((poly.roiPointsClip[1].second & poly.roiPointsClip[0].second & vpMbtPolygon::RIGHT_CLIPPING) == 0)){ - vpMeterPixelConversion::convertPoint(cam,poly.roiPointsClip[0].first.get_x(),poly.roiPointsClip[0].first.get_y(),ip1); - vpMeterPixelConversion::convertPoint(cam,poly.roiPointsClip[1].first.get_x(),poly.roiPointsClip[1].first.get_y(),ip2); - - vpDisplay::displayLine(I,ip1,ip2,col, thickness); - } - } -} - - -/*! - Display the line. The 3D line is projected into the image. - - \param I : The image. - \param cMo : Pose used to project the 3D model into the image. - \param camera : The camera parameters. - \param col : The desired color. - \param thickness : The thickness of the line. - \param displayFullModel : If true, the line is displayed even if it is not visible. -*/ -void -vpMbtDistanceLine::display(const vpImage<vpRGBa> &I, const vpHomogeneousMatrix &cMo, - const vpCameraParameters &camera, const vpColor col, - const unsigned int thickness, const bool displayFullModel) -{ - if(isvisible || displayFullModel){ - p1->changeFrame(cMo); - p2->changeFrame(cMo); - - vpImagePoint ip1, ip2; - vpCameraParameters c = camera; - if(poly.getClipping() > 3) // Contains at least one FOV constraint - c.computeFov(I.getWidth(), I.getHeight()); - - poly.computeRoiClipped(c); - - if( poly.roiPointsClip.size() == 2 && - ((poly.roiPointsClip[1].second & poly.roiPointsClip[0].second & vpMbtPolygon::NEAR_CLIPPING) == 0) && - ((poly.roiPointsClip[1].second & poly.roiPointsClip[0].second & vpMbtPolygon::FAR_CLIPPING) == 0) && - ((poly.roiPointsClip[1].second & poly.roiPointsClip[0].second & vpMbtPolygon::DOWN_CLIPPING) == 0) && - ((poly.roiPointsClip[1].second & poly.roiPointsClip[0].second & vpMbtPolygon::UP_CLIPPING) == 0) && - ((poly.roiPointsClip[1].second & poly.roiPointsClip[0].second & vpMbtPolygon::LEFT_CLIPPING) == 0) && - ((poly.roiPointsClip[1].second & poly.roiPointsClip[0].second & vpMbtPolygon::RIGHT_CLIPPING) == 0)){ - vpMeterPixelConversion::convertPoint(cam,poly.roiPointsClip[0].first.get_x(),poly.roiPointsClip[0].first.get_y(),ip1); - vpMeterPixelConversion::convertPoint(cam,poly.roiPointsClip[1].first.get_x(),poly.roiPointsClip[1].first.get_y(),ip2); - - vpDisplay::displayLine(I,ip1,ip2,col, thickness); - } - } -} - - -/*! - Enable to display the points along the line with a color corresponding to their state. - - - If green : The vpMeSite is a good point. - - If blue : The point is removed because of the vpMeSite tracking phase (constrast problem). - - If purple : The point is removed because of the vpMeSite tracking phase (threshold problem). - - If blue : The point is removed because of the robust method in the virtual visual servoing. - - \param I : The image. -*/ -void -vpMbtDistanceLine::displayMovingEdges(const vpImage<unsigned char> &I) -{ - if (meline != NULL) - { - meline->display(I); - } -} - -/*! - Initialize the size of the interaction matrix and the error vector. -*/ -void -vpMbtDistanceLine::initInteractionMatrixError() -{ - if (isvisible == true) - { - L.resize((unsigned int)meline->getMeList().size(),6) ; - error.resize((unsigned int)meline->getMeList().size()) ; - nbFeature = (unsigned int)meline->getMeList().size() ; - } - else - nbFeature = 0 ; -} - -/*! - Compute the interaction matrix and the error vector corresponding to the line. -*/ -void -vpMbtDistanceLine::computeInteractionMatrixError(const vpHomogeneousMatrix &cMo) -{ - - if (isvisible) - { - // feature projection - line->changeFrame(cMo) ; - line->projection() ; - - vpFeatureBuilder::create(featureline,*line) ; - - double rho = featureline.getRho() ; - double theta = featureline.getTheta() ; - - double co = cos(theta); - double si = sin(theta); - - double mx = 1.0/cam.get_px() ; - double my = 1.0/cam.get_py() ; - double xc = cam.get_u0() ; - double yc = cam.get_v0() ; - - double alpha_ ; - vpMatrix H ; - H = featureline.interaction() ; - - double x,y ; - vpMeSite p ; - unsigned int j =0 ; - for(std::list<vpMeSite>::const_iterator it=meline->getMeList().begin(); it!=meline->getMeList().end(); ++it){ - x = (double)it->j ; - y = (double)it->i ; - - x = (x-xc)*mx ; - y = (y-yc)*my ; - - alpha_ = x*si - y*co; - - double *Lrho = H[0] ; - double *Ltheta = H[1] ; - // Calculate interaction matrix for a distance - for (unsigned int k=0 ; k < 6 ; k++) - { - L[j][k] = (Lrho[k] + alpha_*Ltheta[k]); - } - error[j] = rho - ( x*co + y*si) ; - j++; - } - } -} - -/*! - Test wether the line is close to the border of the image (at a given threshold) - - \param I : the input image (to know its size) - \param threshold : the threshold in pixel - \return true if the line is near the border of the image -*/ -bool -vpMbtDistanceLine::closeToImageBorder(const vpImage<unsigned char>& I, const unsigned int threshold) -{ - if(threshold > I.getWidth() || threshold > I.getHeight()){ - return true; - } - if (isvisible){ - - for(std::list<vpMeSite>::const_iterator it=meline->getMeList().begin(); it!=meline->getMeList().end(); ++it){ - int i = it->i ; - int j = it->j ; - - if(i < 0 || j < 0){ //out of image. - return true; - } - - if( ((unsigned int)i > (I.getHeight()- threshold) ) || (unsigned int)i < threshold || - ((unsigned int)j > (I.getWidth ()- threshold) ) || (unsigned int)j < threshold ) { - return true; - } - } - } - return false; -} diff --git a/src/tracking/mbt/vpMbtPolygon.cpp b/src/tracking/mbt/vpMbtPolygon.cpp deleted file mode 100644 index fe779b3dcfbfbc8bfd53cc6b1abaf79f1c4ffdd6..0000000000000000000000000000000000000000 --- a/src/tracking/mbt/vpMbtPolygon.cpp +++ /dev/null @@ -1,844 +0,0 @@ -/**************************************************************************** - * - * $Id: vpMbtPolygon.cpp 4952 2014-11-12 14:04:40Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Make the complete tracking of an object by using its CAD model - * - * Authors: - * Nicolas Melchior - * Romain Tallonneau - * Eric Marchand - * Aurelien Yol - * - *****************************************************************************/ - -#include <limits.h> - -#include <visp/vpConfig.h> -/*! - \file vpMbtPolygon.cpp - \brief Implements a polygon of the model used by the model-based tracker. -*/ - -#include <visp/vpMbtPolygon.h> -#include <visp/vpPolygon.h> - -/*! - Basic constructor. -*/ -vpMbtPolygon::vpMbtPolygon() - : index(-1), nbpt(0), nbCornersInsidePrev(0), isvisible(false), isappearing(false), - p(NULL), roiPointsClip(), clippingFlag(vpMbtPolygon::NO_CLIPPING), - distNearClip(0.001), distFarClip(100.), - useLod(false), minLineLengthThresh(50.0), minPolygonAreaThresh(2500.0), name("") -{ -} - -vpMbtPolygon::vpMbtPolygon(const vpMbtPolygon& mbtp) - : index(-1), nbpt(0), nbCornersInsidePrev(0), isvisible(false), isappearing(false), - p(NULL), roiPointsClip(), clippingFlag(vpMbtPolygon::NO_CLIPPING), - distNearClip(0.001), distFarClip(100.), - useLod(false), minLineLengthThresh(50.0), minPolygonAreaThresh(2500.0), name("") -{ - *this = mbtp; -} - -vpMbtPolygon& vpMbtPolygon::operator=(const vpMbtPolygon& mbtp) -{ - index = mbtp.index; - nbpt = mbtp.nbpt; - nbCornersInsidePrev = mbtp.nbCornersInsidePrev; - isvisible = mbtp.isvisible; - isappearing = mbtp.isappearing; - roiPointsClip = mbtp.roiPointsClip; - clippingFlag = mbtp.clippingFlag; - distNearClip = mbtp.distNearClip; - distFarClip = mbtp.distFarClip; - useLod = mbtp.useLod; - minLineLengthThresh = mbtp.minLineLengthThresh; - minPolygonAreaThresh = mbtp.minPolygonAreaThresh; - name = mbtp.name; - - if (p) delete [] p; - p = new vpPoint [nbpt]; - for(unsigned int i = 0; i < nbpt; i++) - p[i] = mbtp.p[i]; - - return (*this); -} - -/*! - Basic destructor. -*/ -vpMbtPolygon::~vpMbtPolygon() -{ - if (p !=NULL) - { - delete[] p; - p = NULL; - } -} - -/*! - Get a reference to a corner. - - \throw vpException::dimensionError if the _index is out of range. - - \param _index : the index of the corner -*/ -vpPoint & -vpMbtPolygon::getPoint(const unsigned int _index) -{ - if(_index >= nbpt){ - throw vpException(vpException::dimensionError, "index out of range"); - } - return p[_index]; -} - -/*! - Set the number of points which are the corners of the polygon. - - \param nb : The number of corners. -*/ -void -vpMbtPolygon::setNbPoint(const unsigned int nb) -{ - nbpt = nb ; - if (p != NULL) - delete[] p; - p = new vpPoint[nb] ; -} - -/*! - Add a corner point to the list of polygon's corners. - - \param n : The index of the corner. - \param P : The point to add. -*/ -void -vpMbtPolygon::addPoint(const unsigned int n, const vpPoint &P) -{ - //if( p!NULL && n < nbpt ) - p[n] = P ; -} - -/*! - Project the 3D corner points into the image thanks to the pose of the camera. - - \param cMo : The pose of the camera. -*/ -void -vpMbtPolygon::changeFrame(const vpHomogeneousMatrix &cMo) -{ - for (unsigned int i = 0 ; i < nbpt ; i++) - { - p[i].changeFrame(cMo) ; - p[i].projection() ; - } -} - -/*! - Check if the polygon is visible in the image and if the angle between the normal - to the face and the line vector going from the optical center to the cog of the face is below - the given threshold. - To do that, the polygon is projected into the image thanks to the camera pose. - - \param cMo : The pose of the camera. - \param alpha : Maximum angle to detect if the face is visible (in rad). - \param modulo : Indicates if the test should also consider faces that are not oriented - counter clockwise. If true, the orientation of the face is without importance. - \param cam : Camera parameters (intrinsics parameters) - \param I : Image used to consider level of detail. - - \return Return true if the polygon is visible. -*/ -bool -vpMbtPolygon::isVisible(const vpHomogeneousMatrix &cMo, const double alpha, const bool &modulo, - const vpCameraParameters &cam, const vpImage<unsigned char> &I) -{ - // std::cout << "Computing angle from MBT Face (cMo, alpha)" << std::endl; - - changeFrame(cMo); - - if(nbpt <= 2) { - //Level of detail (LOD) - if(useLod) { - vpCameraParameters c = cam; - if(clippingFlag > 3) { // Contains at least one FOV constraint - c.computeFov(I.getWidth(), I.getHeight()); - } - computeRoiClipped(c); - std::vector<vpImagePoint> roiImagePoints; - getRoiClipped(c, roiImagePoints); - - if (roiImagePoints.size() == 2) { - double x1 = roiImagePoints[0].get_u(); - double y1 = roiImagePoints[0].get_v(); - double x2 = roiImagePoints[1].get_u(); - double y2 = roiImagePoints[1].get_v(); - double length = std::sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); -// std::cout << "Index=" << index << " ; Line length=" << length << " ; clippingFlag=" << clippingFlag << std::endl; -// vpTRACE("index=%d lenght=%f minLineLengthThresh=%f", index, length, minLineLengthThresh); - - if (length < minLineLengthThresh) { - isvisible = false; - isappearing = false; - return false; - } - } - } - - /* a line is always visible when LOD is not used */ - isvisible = true; - isappearing = false; - return true ; - } - - //Check visibility from normal - //Newell's Method for calculating the normal of an arbitrary 3D polygon - //https://www.opengl.org/wiki/Calculating_a_Surface_Normal - vpColVector faceNormal(3); - vpColVector currentVertex, nextVertex; - for(unsigned int i = 0; i<nbpt; i++) { - currentVertex = p[i].cP; - nextVertex = p[(i+1) % nbpt].cP; - - faceNormal[0] += (currentVertex[1] - nextVertex[1]) * (currentVertex[2] + nextVertex[2]); - faceNormal[1] += (currentVertex[2] - nextVertex[2]) * (currentVertex[0] + nextVertex[0]); - faceNormal[2] += (currentVertex[0] - nextVertex[0]) * (currentVertex[1] + nextVertex[1]); - } - faceNormal.normalize(); - - vpColVector e4(3) ; - vpPoint pt; - for (unsigned int i = 0; i < nbpt; i += 1){ - pt.set_X(pt.get_X() + p[i].get_X()); - pt.set_Y(pt.get_Y() + p[i].get_Y()); - pt.set_Z(pt.get_Z() + p[i].get_Z()); - } - e4[0] = -pt.get_X() / (double)nbpt; - e4[1] = -pt.get_Y() / (double)nbpt; - e4[2] = -pt.get_Z() / (double)nbpt; - e4.normalize(); - - double angle = acos(vpColVector::dotProd(e4, faceNormal)); - -// vpCTRACE << angle << "/" << vpMath::deg(angle) << "/" << vpMath::deg(alpha) << std::endl; - - if( angle < alpha || (modulo && (M_PI - angle) < alpha)) { - isvisible = true; - isappearing = false; - - if (useLod) { - vpCameraParameters c = cam; - if(clippingFlag > 3) { // Contains at least one FOV constraint - c.computeFov(I.getWidth(), I.getHeight()); - } - computeRoiClipped(c); - std::vector<vpImagePoint> roiImagePoints; - getRoiClipped(c, roiImagePoints); - - vpPolygon roiPolygon(roiImagePoints); - double area = roiPolygon.getArea(); -// std::cout << "After normal test ; Index=" << index << " ; area=" << area << " ; clippingFlag=" -// << clippingFlag << std::endl; - if (area < minPolygonAreaThresh) { - isappearing = false; - isvisible = false; - return false; - } - } - - return true; - } - - if (angle < alpha+vpMath::rad(1) ){ - isappearing = true; - } - else if (modulo && (M_PI - angle) < alpha+vpMath::rad(1) ){ - isappearing = true; - } - else { - isappearing = false; - } - - isvisible = false ; - return false ; -} - -/*! - Compute the region of interest in the image according to the used clipping. - - \warning If the FOV clipping is used, camera normals have to be precomputed. - - \param cam : camera parameters used to compute the field of view. -*/ -void -vpMbtPolygon::computeRoiClipped(const vpCameraParameters &cam) -{ - roiPointsClip.clear(); - std::vector<vpColVector> fovNormals; - std::vector<std::pair<vpPoint,unsigned int> > roiPointsClipTemp; - std::vector<std::pair<vpPoint,unsigned int> > roiPointsClipTemp2; - - if(cam.isFovComputed() && clippingFlag > 3) - fovNormals = cam.getFovNormals(); - - for(unsigned int i = 0 ; i < nbpt ; i++){ - p[i%nbpt].projection(); - roiPointsClipTemp.push_back(std::make_pair(p[i%nbpt],vpMbtPolygon::NO_CLIPPING)); - } - - if(clippingFlag != vpMbtPolygon::NO_CLIPPING) - for(unsigned int i = 1 ; i < 64 ; i=i*2) - { - if(((clippingFlag & i) == i) || ((clippingFlag > vpMbtPolygon::FAR_CLIPPING) && (i==1))) - { - for(unsigned int j = 0 ; j < roiPointsClipTemp.size() ; j++) - { - vpPoint p1Clipped = roiPointsClipTemp[j].first; - vpPoint p2Clipped = roiPointsClipTemp[(j+1)%roiPointsClipTemp.size()].first; - - unsigned int p2ClippedInfoBefore = roiPointsClipTemp[(j+1)%roiPointsClipTemp.size()].second; - unsigned int p1ClippedInfo = roiPointsClipTemp[j].second; - unsigned int p2ClippedInfo = roiPointsClipTemp[(j+1)%roiPointsClipTemp.size()].second; - - bool problem = true; - - switch(i){ - case 1: - problem = !(vpMbtPolygon::getClippedPointsDistance(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, - i, distNearClip)); - break; - case 2: - problem = !(vpMbtPolygon::getClippedPointsDistance(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, - i, distFarClip)); - break; - case 4: - problem = !(vpMbtPolygon::getClippedPointsFovGeneric(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, - fovNormals[0], vpMbtPolygon::LEFT_CLIPPING)); - break; - case 8: - problem = !(vpMbtPolygon::getClippedPointsFovGeneric(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, - fovNormals[1], vpMbtPolygon::RIGHT_CLIPPING)); - break; - case 16: - problem = !(vpMbtPolygon::getClippedPointsFovGeneric(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, - fovNormals[2], vpMbtPolygon::UP_CLIPPING)); - break; - case 32: - problem = !(vpMbtPolygon::getClippedPointsFovGeneric(p1Clipped, p2Clipped, p1Clipped, p2Clipped, p1ClippedInfo, p2ClippedInfo, - fovNormals[3], vpMbtPolygon::DOWN_CLIPPING)); - break; - } - - if(!problem) - { - p1Clipped.projection(); - roiPointsClipTemp2.push_back(std::make_pair(p1Clipped, p1ClippedInfo)); - - if(p2ClippedInfo != p2ClippedInfoBefore) - { - p2Clipped.projection(); - roiPointsClipTemp2.push_back(std::make_pair(p2Clipped, p2ClippedInfo)); - } - - if(nbpt == 2){ - if(p2ClippedInfo == p2ClippedInfoBefore) - { - p2Clipped.projection(); - roiPointsClipTemp2.push_back(std::make_pair(p2Clipped, p2ClippedInfo)); - } - break; - } - } - } - - roiPointsClipTemp = roiPointsClipTemp2; - roiPointsClipTemp2.clear(); - } - } - - roiPointsClip = roiPointsClipTemp; -} - -/*! - Get the clipped points according to a plane equation. - - \param cam : camera parameters - \param p1 : First extremity of the line. - \param p2 : Second extremity of the line. - \param p1Clipped : Resulting p1. - \param p2Clipped : Resulting p2. - \param p1ClippedInfo : Resulting clipping flag for p1. - \param p2ClippedInfo : Resulting clipping flag for p2. - \param A : Param A from plane equation. - \param B : Param B from plane equation. - \param C : Param C from plane equation. - \param D : Param D from plane equation. - \param flag : flag specifying the clipping used when calling this function. - - \return True if the points have been clipped, False otherwise -*/ -bool -vpMbtPolygon::getClippedPointsFovGeneric(const vpPoint &p1, const vpPoint &p2, - vpPoint &p1Clipped, vpPoint &p2Clipped, - unsigned int &p1ClippedInfo, unsigned int &p2ClippedInfo, - const vpColVector &normal, const unsigned int &flag) -{ - vpRowVector p1Vec(3); - p1Vec[0] = p1.get_X(); p1Vec[1] = p1.get_Y(); p1Vec[2] = p1.get_Z(); - p1Vec = p1Vec.normalize(); - - vpRowVector p2Vec(3); - p2Vec[0] = p2.get_X(); p2Vec[1] = p2.get_Y(); p2Vec[2] = p2.get_Z(); - p2Vec = p2Vec.normalize(); - - if((clippingFlag & flag) == flag){ - double beta1 = acos( p1Vec * normal ); - double beta2 = acos( p2Vec * normal ); - -// std::cout << beta1 << " && " << beta2 << std::endl; - - // if(!(beta1 < M_PI / 2.0 && beta2 < M_PI / 2.0)) - if(beta1 < M_PI / 2.0 && beta2 < M_PI / 2.0) - return false; - else if (beta1 < M_PI / 2.0 || beta2 < M_PI / 2.0){ - vpPoint pClipped; - double t = -(normal[0] * p1.get_X() + normal[1] * p1.get_Y() + normal[2] * p1.get_Z()); - t = t / ( normal[0] * (p2.get_X() - p1.get_X()) + normal[1] * (p2.get_Y() - p1.get_Y()) + normal[2] * (p2.get_Z() - p1.get_Z()) ); - - pClipped.set_X((p2.get_X() - p1.get_X())*t + p1.get_X()); - pClipped.set_Y((p2.get_Y() - p1.get_Y())*t + p1.get_Y()); - pClipped.set_Z((p2.get_Z() - p1.get_Z())*t + p1.get_Z()); - - if(beta1 < M_PI / 2.0){ - p1ClippedInfo = p1ClippedInfo | flag; - p1Clipped = pClipped; - } - else{ - p2ClippedInfo = p2ClippedInfo | flag; - p2Clipped = pClipped; - } - } - } - - return true; -} - -bool -vpMbtPolygon::getClippedPointsDistance(const vpPoint &p1, const vpPoint &p2, - vpPoint &p1Clipped, vpPoint &p2Clipped, - unsigned int &p1ClippedInfo, unsigned int &p2ClippedInfo, - const unsigned int &flag, const double &distance) -{ - // Since p1 and p1Clipped can be the same object as well as p2 and p2Clipped - // to avoid a valgrind "Source and destination overlap in memcpy" error, - // we introduce a two temporary points. - vpPoint p1Clipped_, p2Clipped_; - p1Clipped_ = p1; - p2Clipped_ = p2; - - p1Clipped = p1Clipped_; - p2Clipped = p2Clipped_; - - - bool test1 = (p1Clipped.get_Z() < distance && p2Clipped.get_Z() < distance); - if(flag == vpMbtPolygon::FAR_CLIPPING) - test1 = (p1Clipped.get_Z() > distance && p2Clipped.get_Z() > distance); - - bool test2 = (p1Clipped.get_Z() < distance || p2Clipped.get_Z() < distance); - if(flag == vpMbtPolygon::FAR_CLIPPING) - test2 = (p1Clipped.get_Z() > distance || p2Clipped.get_Z() > distance); - - bool test3 = (p1Clipped.get_Z() < distance); - if(flag == vpMbtPolygon::FAR_CLIPPING) - test3 = (p1Clipped.get_Z() > distance); - - if(test1) - return false; - - else if(test2){ - vpPoint pClippedNear; - double t; - t = (p2Clipped.get_Z() - p1Clipped.get_Z()); - t = (distance - p1Clipped.get_Z()) / t; - - pClippedNear.set_X((p2Clipped.get_X() - p1Clipped.get_X())*t + p1Clipped.get_X()); - pClippedNear.set_Y((p2Clipped.get_Y() - p1Clipped.get_Y())*t + p1Clipped.get_Y()); - pClippedNear.set_Z(distance); - - if(test3){ - p1Clipped = pClippedNear; - if(flag == vpMbtPolygon::FAR_CLIPPING) - p1ClippedInfo = p1ClippedInfo | vpMbtPolygon::FAR_CLIPPING; - else - p1ClippedInfo = p1ClippedInfo | vpMbtPolygon::NEAR_CLIPPING; - } - else{ - p2Clipped = pClippedNear; - if(flag == vpMbtPolygon::FAR_CLIPPING) - p2ClippedInfo = p2ClippedInfo | vpMbtPolygon::FAR_CLIPPING; - else - p2ClippedInfo = p2ClippedInfo | vpMbtPolygon::NEAR_CLIPPING; - } - } - - return true; -} - -/*! - Get the region of interest in the image. - - \warning Suppose that changeFrame() has already been called. - - \param cam : camera parameters. - - \return Image point corresponding to the region of interest. -*/ -std::vector<vpImagePoint> -vpMbtPolygon::getRoi(const vpCameraParameters &cam) -{ - std::vector<vpImagePoint> roi; - for (unsigned int i = 0; i < nbpt; i ++){ - vpImagePoint ip; - vpMeterPixelConversion::convertPoint(cam, p[i].get_x(), p[i].get_y(), ip); - roi.push_back(ip); - } - - return roi; -} - -/*! - Get the region of interest in the image. - - \param cam : camera parameters. - \param cMo : pose. - - \return Image point corresponding to the region of interest. -*/ -std::vector<vpImagePoint> -vpMbtPolygon::getRoi(const vpCameraParameters &cam, const vpHomogeneousMatrix &cMo) -{ - changeFrame(cMo); - return getRoi(cam); -} - -/*! - Get the 3D points of the clipped region of interest. - - \warning Suppose that changeFrame() and computeRoiClipped() have already been called. - - \param points : resulting points. -*/ -void -vpMbtPolygon::getRoiClipped(std::vector<vpPoint> &points) -{ - for(unsigned int i = 0 ; i < roiPointsClip.size() ; i++){ - points.push_back(roiPointsClip[i].first); - } -} - -/*! - Get the region of interest clipped in the image. - - \warning Suppose that changeFrame() and computeRoiClipped() have already been called. - - \param cam : camera parameters. - \param roi : image point corresponding to the region of interest. -*/ -void -vpMbtPolygon::getRoiClipped(const vpCameraParameters &cam, std::vector<vpImagePoint> &roi) -{ - for(unsigned int i = 0 ; i < roiPointsClip.size() ; i++){ - vpImagePoint ip; - vpMeterPixelConversion::convertPoint(cam,roiPointsClip[i].first.get_x(),roiPointsClip[i].first.get_y(),ip); -// std::cout << "## " << ip.get_j() << " - " << ip.get_i() << std::endl; - roi.push_back(ip); - } -} - -/*! - Get the region of interest clipped in the image. - - \param cam : camera parameters. - \param cMo : pose. - \param roi : image point corresponding to the region of interest. -*/ -void -vpMbtPolygon::getRoiClipped(const vpCameraParameters &cam, std::vector<vpImagePoint> &roi, const vpHomogeneousMatrix &cMo) -{ - changeFrame(cMo); - computeRoiClipped(cam); - getRoiClipped(cam, roi); -} - -/*! - Get the region of interest clipped in the image and the information to know if it's a clipped point. - - \warning Suppose that changeFrame() and computeRoiClipped() have already been called. - - \param cam : camera parameters. - \param roi : image point corresponding to the region of interest with clipping information. -*/ -void -vpMbtPolygon::getRoiClipped(const vpCameraParameters &cam, std::vector<std::pair<vpImagePoint,unsigned int> > &roi) -{ - for(unsigned int i = 0 ; i < roiPointsClip.size() ; i++){ - vpImagePoint ip; - roiPointsClip[i].first.projection(); - vpMeterPixelConversion::convertPoint(cam,roiPointsClip[i].first.get_x(),roiPointsClip[i].first.get_y(),ip); - roi.push_back(std::make_pair(ip, roiPointsClip[i].second)); - } -} - -/*! - Get the region of interest clipped in the image and the information to know if it's a clipped point. - - \param cam : camera parameters. - \param roi : image point corresponding to the region of interest with clipping information. - \param cMo : pose. -*/ -void -vpMbtPolygon::getRoiClipped(const vpCameraParameters &cam, std::vector<std::pair<vpImagePoint,unsigned int> > &roi, const vpHomogeneousMatrix &cMo) -{ - changeFrame(cMo); - computeRoiClipped(cam); - getRoiClipped(cam, roi); -} - - - -/*! - Static method to check the number of points of a region defined by the vector of image point that are inside the image. - - \param I : The image used for its size. - \param cam : The camera parameters. -*/ -unsigned int -vpMbtPolygon::getNbCornerInsideImage(const vpImage<unsigned char>& I, const vpCameraParameters &cam) -{ - unsigned int nbPolyIn = 0; - for (unsigned int i = 0; i < nbpt; i ++){ - if(p[i].get_Z() > 0){ - vpImagePoint ip; - vpMeterPixelConversion::convertPoint(cam, p[i].get_x(), p[i].get_y(), ip); - if((ip.get_i() >= 0) && (ip.get_j() >= 0) && (ip.get_i() < I.getHeight()) && (ip.get_j() < I.getWidth())) - nbPolyIn++; - } - } - - nbCornersInsidePrev = nbPolyIn; - - return nbPolyIn; -} - -//################################### -// Static functions -//################################### - -/*! - Static method to compute the clipped points from a set of initial points. - - \warning When using FOV clipping and personnal camera parameters, camera normals have to be computed before (see vpCameraParameters::computeFov()) - - \param ptIn : Input points - \param ptOut : Output points (result of the clipping). - \param cMo : Pose considered for the clipping. - \param clippingFlags: Clipping flag (see vpMbtPolygon::vpMbtPolygonClippingType). - \param cam : Camera parameters (Only used if clipping flags contain FOV clipping). - \param znear : Near clipping distance value (Only used if clipping flags contain Near clipping). - \param zfar : Far clipping distance value (Only used if clipping flags contain Far clipping). -*/ -void -vpMbtPolygon::getClippedPolygon(const std::vector<vpPoint> &ptIn, std::vector<vpPoint> &ptOut, const vpHomogeneousMatrix &cMo, const unsigned int &clippingFlags, - const vpCameraParameters &cam, const double &znear, const double &zfar) -{ - ptOut.clear(); - vpMbtPolygon poly; - poly.setNbPoint((unsigned int)ptIn.size()); - poly.setClipping(clippingFlags); - - if((clippingFlags & vpMbtPolygon::NEAR_CLIPPING) == vpMbtPolygon::NEAR_CLIPPING) - poly.setNearClippingDistance(znear); - - if((clippingFlags & vpMbtPolygon::FAR_CLIPPING) == vpMbtPolygon::FAR_CLIPPING) - poly.setFarClippingDistance(zfar); - - for(unsigned int i = 0; i < ptIn.size(); i++) - poly.addPoint(i,ptIn[i]); - - poly.changeFrame(cMo); - poly.computeRoiClipped(cam); - poly.getRoiClipped(ptOut); -} - -void -vpMbtPolygon::getMinMaxRoi(const std::vector<vpImagePoint> &iroi, int & i_min, int &i_max, int &j_min, int &j_max) -{ - // i_min_d = std::numeric_limits<double>::max(); // create an error under Windows. To fix it we have to add #undef max - double i_min_d = (double) INT_MAX; - double i_max_d = 0; - double j_min_d = (double) INT_MAX; - double j_max_d = 0; - - for (unsigned int i = 0; i < iroi.size(); i += 1){ - if(i_min_d > iroi[i].get_i()) - i_min_d = iroi[i].get_i(); - - if(iroi[i].get_i() < 0) - i_min_d = 1; - - if((iroi[i].get_i() > 0) && (i_max_d < iroi[i].get_i())) - i_max_d = iroi[i].get_i(); - - if(j_min_d > iroi[i].get_j()) - j_min_d = iroi[i].get_j(); - - if(iroi[i].get_j() < 0) - j_min_d = 1;//border - - if((iroi[i].get_j() > 0) && j_max_d < iroi[i].get_j()) - j_max_d = iroi[i].get_j(); - } - i_min = static_cast<int> (i_min_d); - i_max = static_cast<int> (i_max_d); - j_min = static_cast<int> (j_min_d); - j_max = static_cast<int> (j_max_d); -} - -/*! - Static method to check whether the region defined by the vector of image point - is contained entirely in the image. - - \param I : The image used for its size. - \param corners : The vector of points defining a region -*/ -bool -vpMbtPolygon::roiInsideImage(const vpImage<unsigned char>& I, const std::vector<vpImagePoint>& corners) -{ - double nbPolyIn = 0; - for(unsigned int i=0; i<corners.size(); ++i){ - if((corners[i].get_i() >= 0) && (corners[i].get_j() >= 0) && - (corners[i].get_i() < I.getHeight()) && (corners[i].get_j() < I.getWidth())){ - nbPolyIn++; - } - } - - if(nbPolyIn < 3 && nbPolyIn < 0.7 * corners.size()) - return false; - - return true; -} - -/*! - Set the flag to consider if the level of detail (LOD) is used or not. - When activated, lines and faces of the 3D model are tracked if respectively their - projected lenght and area in the image are significative enough. By significative, we mean: - - if the lenght of the projected line in the image is greater that a threshold set by - setMinLineLengthThresh() - - if the area of the projected face in the image is greater that a threshold set by - setMinPolygonAreaThresh(). - - \param use_lod : true if level of detail must be used, false otherwise. - - The sample code below shows how to introduce this feature: - \code -#include <visp/vpMbEdgeTracker.h> -#include <visp/vpImageIo.h> - -int main() -{ -vpImage<unsigned char> I; - -// Acquire an image -vpImageIo::read(I, "my-image.pgm"); - -std::string object = "my-object"; -vpMbEdgeTracker tracker; -tracker.loadConfigFile( object+".xml" ); -tracker.loadModel( object+".cao" ); - -tracker.setLod(true); -tracker.setMinLineLengthThresh(20.); -tracker.setMinPolygonAreaThresh(20.*20.); - -tracker.initClick(I, object+".init" ); - -while (true) { - // tracking loop -} -vpXmlParser::cleanup(); - -return 0; -} - \endcode - - \sa setMinLineLengthThresh(), setMinPolygonAreaThresh() - */ -void -vpMbtPolygon::setLod(const bool use_lod) -{ - this->useLod = use_lod; -} - -#ifdef VISP_BUILD_DEPRECATED_FUNCTIONS -/*! - \deprecated This method is deprecated since it is no more used since ViSP 2.7.2. \n - - Check if the polygon is visible in the image. To do that, the polygon is projected into the image thanks to the camera pose. - - \param cMo : The pose of the camera. - \param depthTest : True if a face has to be entirely visible (in front of the camera). False if it can be partially visible. - - \return Return true if the polygon is visible. -*/ -bool -vpMbtPolygon::isVisible(const vpHomogeneousMatrix &cMo, const bool &depthTest) -{ - changeFrame(cMo) ; - - if(depthTest) - for (unsigned int i = 0 ; i < nbpt ; i++){ - if(p[i].get_Z() < 0){ - isappearing = false; - isvisible = false ; - return false ; - } - } - - return isVisible(cMo, vpMath::rad(89)); -} -#endif - - diff --git a/test/camera/CMakeLists.txt b/test/camera/CMakeLists.txt deleted file mode 100644 index 3c36476c6b26900c2f6e2f6708651e4c6fcf1182..0000000000000000000000000000000000000000 --- a/test/camera/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testCameraParametersConversion.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - # Add test - add_test(${binary} ${binary}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() diff --git a/test/device/display/CMakeLists.txt b/test/device/display/CMakeLists.txt deleted file mode 100644 index abb24d27f4c4b6b4c4bd0e5479e182a38e6d0274..0000000000000000000000000000000000000000 --- a/test/device/display/CMakeLists.txt +++ /dev/null @@ -1,81 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testClick.cpp - testDisplayRoi.cpp - testDisplays.cpp - testMouseEvent.cpp - testVideoDevice.cpp - testVideoDeviceDual.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() - -# Add test -# To run some of these tests don't forget to set VISP_INPUT_IMAGE_PATH -# environment variable to the ViSP test sequences location. -# To get these sequence download ViSP-images.tar.gz from -# http://www.irisa.fr/lagadic/visp/visp.html - -add_test(testClick testClick -c ${OPTION_TO_DESACTIVE_DISPLAY}) -add_test(testDisplayRoi testDisplayRoi -c ${OPTION_TO_DESACTIVE_DISPLAY}) -add_test(testDisplays testDisplays -c ${OPTION_TO_DESACTIVE_DISPLAY}) -add_test(testMouseEvent testMouseEvent -c ${OPTION_TO_DESACTIVE_DISPLAY}) -add_test(testVideoDevice testVideoDevice -c ${OPTION_TO_DESACTIVE_DISPLAY}) -add_test(testVideoDeviceDual testVideoDeviceDual -c ${OPTION_TO_DESACTIVE_DISPLAY}) diff --git a/test/device/framegrabber/CMakeLists.txt b/test/device/framegrabber/CMakeLists.txt deleted file mode 100644 index 9a7a6db0ee3a81fdb2a9f66c7595f6b05ec183c9..0000000000000000000000000000000000000000 --- a/test/device/framegrabber/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - test1394TwoResetBus.cpp - test1394TwoGrabber.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() diff --git a/test/feature/CMakeLists.txt b/test/feature/CMakeLists.txt deleted file mode 100644 index 556fde323bf0cc104d0e00add841a784abfad155..0000000000000000000000000000000000000000 --- a/test/feature/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testPoint.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - # Add test - add_test(${binary} ${binary}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() diff --git a/test/homography/CMakeLists.txt b/test/homography/CMakeLists.txt deleted file mode 100644 index 7382083497657e8c49dd0b8065d1e6d6ac006716..0000000000000000000000000000000000000000 --- a/test/homography/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testDisplacement.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - # Add test - add_test(${binary} ${binary}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() diff --git a/test/image/CMakeLists.txt b/test/image/CMakeLists.txt deleted file mode 100644 index 3ac6c1069df7902d0f2e1e56c3706035550cde31..0000000000000000000000000000000000000000 --- a/test/image/CMakeLists.txt +++ /dev/null @@ -1,81 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testConversion.cpp - testCreateSubImage.cpp - testImagePoint.cpp - testIoPGM.cpp - testIoPPM.cpp - testUndistortImage.cpp - testReadImage.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() - -# Add test -# To run some of these tests don't forget to set VISP_INPUT_IMAGE_PATH -# environment variable to the ViSP test sequences location. -# To get these sequence download ViSP-images.tar.gz from -# http://www.irisa.fr/lagadic/visp/visp.html -add_test(testConversion testConversion) -add_test(testCreateSubImage testCreateSubImage) -add_test(testImagePoint testImagePoint) -add_test(testIoPGM testIoPGM) -add_test(testIoPPM testIoPPM) -add_test(testReadImage testReadImage) diff --git a/test/key-point/CMakeLists.txt b/test/key-point/CMakeLists.txt deleted file mode 100644 index 6f8bf19ac797e965362f7f5491148b1d17379a93..0000000000000000000000000000000000000000 --- a/test/key-point/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP overall configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testSurfKeyPoint.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() - -# Add test -add_test(testSurfKeyPoint testSurfKeyPoint -c ${OPTION_TO_DESACTIVE_DISPLAY}) diff --git a/test/math/CMakeLists.txt b/test/math/CMakeLists.txt deleted file mode 100644 index 0ad8f8421935d507bd1bc36c06a8d399b5c04974..0000000000000000000000000000000000000000 --- a/test/math/CMakeLists.txt +++ /dev/null @@ -1,75 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testColvector.cpp - testKalmanAcceleration.cpp - testKalmanVelocity.cpp - testMatrix.cpp - testMatrixException.cpp - testMatrixInverse.cpp - testRobust.cpp - testRotation.cpp - testSvd.cpp - testTwistMatrix.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - # Add test - add_test(${binary} ${binary}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() diff --git a/test/math/testColvector.cpp b/test/math/testColvector.cpp deleted file mode 100644 index 64ccecfcdb3a8a41ba683cb3bec6470629e0c5bb..0000000000000000000000000000000000000000 --- a/test/math/testColvector.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** - * - * $Id: testColvector.cpp 4658 2014-02-09 09:50:14Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Test some vpColVector functionalities. - * - * Authors: - * Eric Marchand - * - *****************************************************************************/ - -/*! - \example testColvector.cpp - - Test some vpColVector functionalities. -*/ - -#include <visp/vpColVector.h> -#include <visp/vpDebug.h> -#include <visp/vpParseArgv.h> - -#include <stdlib.h> -#include <stdio.h> - -// List of allowed command line options -#define GETOPTARGS "h" - -void usage(const char *name, const char *badparam); -bool getOptions(int argc, const char **argv); - -/*! - - Print the program options. - -*/ -void usage(const char *name, const char *badparam) -{ - fprintf(stdout, "\n\ -Test some vpColVector functionalities.\n\ -\n\ -SYNOPSIS\n\ - %s [-h]\n", name); - - fprintf(stdout, "\n\ -OPTIONS: Default\n\ - -h\n\ - Print the help.\n"); - - if (badparam) - fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); -} -/*! - - Set the program options. - - \return false if the program has to be stopped, true otherwise. - -*/ -bool getOptions(int argc, const char **argv) -{ - const char *optarg_; - int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { - - switch (c) { - case 'h': usage(argv[0], NULL); return false; break; - - default: - usage(argv[0], optarg_); - return false; break; - } - } - - if ((c == 1) || (c == -1)) { - // standalone param or error - usage(argv[0], NULL); - std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; - return false; - } - - return true; -} - - -int -main(int argc, const char ** argv) -{ - try { - // Read the command line options - if (getOptions(argc, argv) == false) { - exit (-1); - } - - vpColVector V(4) ; - V = 1.0; - - vpTRACE("------------------------"); - vpTRACE("call std::cout << V;"); - std::cout << V << std::endl; - - vpTRACE("------------------------"); - vpTRACE("call V.normalize();"); - V.normalize(); - - vpTRACE("------------------------"); - vpTRACE("call std::cout << V;"); - std::cout << V << std::endl; - return (0); - } - catch(vpException e) { - std::cout << "Catch an exception: " << e << std::endl; - return (1); - } -} diff --git a/test/math/testMatrixException.cpp b/test/math/testMatrixException.cpp deleted file mode 100644 index d9b8b88db1011e606bdcd88362a12fd7cf74c5e4..0000000000000000000000000000000000000000 --- a/test/math/testMatrixException.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/**************************************************************************** - * - * $Id: testMatrixException.cpp 4658 2014-02-09 09:50:14Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Test matrix exceptions. - * - * Authors: - * Eric Marchand - * Fabien Spindler - * - *****************************************************************************/ - -/*! - \example testMatrixException.cpp - \brief Tests matrix exception -*/ - -#include <visp/vpMath.h> -#include <visp/vpMatrix.h> -#include <visp/vpMatrixException.h> -#include <visp/vpDebug.h> - -#include <visp/vpParseArgv.h> - -#include <stdlib.h> -#include <stdio.h> - -// List of allowed command line options -#define GETOPTARGS "h" - -void usage(const char *name, const char *badparam); -bool getOptions(int argc, const char **argv); - -/*! - - Print the program options. - -*/ -void usage(const char *name, const char *badparam) -{ - fprintf(stdout, "\n\ -Test some vpMatrix functionalities.\n\ -\n\ -SYNOPSIS\n\ - %s [-h]\n", name); - - fprintf(stdout, "\n\ -OPTIONS: Default\n\ - -h\n\ - Print the help.\n"); - - if (badparam) - fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); -} -/*! - - Set the program options. - - \return false if the program has to be stopped, true otherwise. - -*/ -bool getOptions(int argc, const char **argv) -{ - const char *optarg_; - int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { - - switch (c) { - case 'h': usage(argv[0], NULL); return false; break; - - default: - usage(argv[0], optarg_); - return false; break; - } - } - - if ((c == 1) || (c == -1)) { - // standalone param or error - usage(argv[0], NULL); - std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; - return false; - } - - return true; -} - - -int -main(int argc, const char ** argv) -{ - try { - // Read the command line options - if (getOptions(argc, argv) == false) { - exit (-1); - } - - vpMatrix M ; - vpMatrix M1(2,3) ; - vpMatrix M2(3,3) ; - vpMatrix M3(2,2) ; - - vpTRACE("test matrix size in multiply") ; - - try - { - M = M1*M3 ; - } - catch (vpMatrixException me) - { - std::cout << me << std::endl ; - } - - - vpTRACE("test matrix size in addition") ; - - try - { - M = M1+M3 ; - } - catch (vpMatrixException me) - { - std::cout << me << std::endl ; - } - } - catch(vpException e) { - std::cout << "Catch an exception: " << e << std::endl; - return 1; - } -} diff --git a/test/math/testRotation.cpp b/test/math/testRotation.cpp deleted file mode 100644 index d87369fda53c734f2b66afff9176f1e5f4d31a4e..0000000000000000000000000000000000000000 --- a/test/math/testRotation.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** - * - * $Id: testRotation.cpp 4658 2014-02-09 09:50:14Z fspindle $ - * - * This file is part of the ViSP software. - * Copyright (C) 2005 - 2014 by INRIA. All rights reserved. - * - * This software is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * ("GPL") version 2 as published by the Free Software Foundation. - * See the file LICENSE.txt at the root directory of this source - * distribution for additional information about the GNU GPL. - * - * For using ViSP with software that can not be combined with the GNU - * GPL, please contact INRIA about acquiring a ViSP Professional - * Edition License. - * - * See http://www.irisa.fr/lagadic/visp/visp.html for more information. - * - * This software was developed at: - * INRIA Rennes - Bretagne Atlantique - * Campus Universitaire de Beaulieu - * 35042 Rennes Cedex - * France - * http://www.irisa.fr/lagadic - * - * If you have questions regarding the use of this file, please contact - * INRIA at visp@inria.fr - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * - * Description: - * Tests transformation from various representations of rotation. - * - * Authors: - * Eric Marchand - * Fabien Spindler - * - *****************************************************************************/ - - -/*! - \file testRotation.cpp - \brief Tests transformation within various representations of rotation. -*/ - - -#include <visp/vpMath.h> -#include <visp/vpRotationMatrix.h> -#include <visp/vpParseArgv.h> -#include <visp/vpQuaternionVector.h> - -#include <stdlib.h> -#include <stdio.h> -#include <cassert> -#include <limits> -// List of allowed command line options -#define GETOPTARGS "h" - -void usage(const char *name, const char *badparam); -bool getOptions(int argc, const char **argv); - -/*! - - Print the program options. - -*/ -void usage(const char *name, const char *badparam) -{ - fprintf(stdout, "\n\ -Tests transformation within various representations of rotation.\n\ -\n\ -SYNOPSIS\n\ - %s [-h]\n", name); - - fprintf(stdout, "\n\ -OPTIONS: Default\n\ - -h\n\ - Print the help.\n"); - - if (badparam) - fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam); -} -/*! - - Set the program options. - - \return false if the program has to be stopped, true otherwise. - -*/ -bool getOptions(int argc, const char **argv) -{ - const char *optarg_; - int c; - while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) { - - switch (c) { - case 'h': usage(argv[0], NULL); return false; break; - - default: - usage(argv[0], optarg_); - return false; break; - } - } - - if ((c == 1) || (c == -1)) { - // standalone param or error - usage(argv[0], NULL); - std::cerr << "ERROR: " << std::endl; - std::cerr << " Bad argument " << optarg_ << std::endl << std::endl; - return false; - } - - return true; -} - - -int -main(int argc, const char ** argv) -{ - try { - // Read the command line options - if (getOptions(argc, argv) == false) { - exit (-1); - } - vpRotationMatrix R; - for(int i=-10;i<10;i++){ - for(int j=-10;j<10;j++){ - vpThetaUVector tu(vpMath::rad(90+i), vpMath::rad(170+j), vpMath::rad(45)) ; - tu.buildFrom(vpRotationMatrix(tu)); //put some coherence into rotation convention - - std::cout << "Initialization " <<std::endl ; - - double theta; - vpColVector u; - tu.extract(theta, u); - - std::cout << "theta=" << vpMath::deg(theta) << std::endl ; - std::cout << "u=" << u << std::endl ; - - std::cout << "From vpThetaUVector to vpRotationMatrix " << std::endl ; - R.buildFrom(tu) ; - - std::cout << "Matrix R" ; - if (R.isARotationMatrix()==1) std::cout <<" is a rotation matrix " << std::endl ; - else std::cout <<" is not a rotation matrix " << std::endl ; - - std::cout << R << std::endl ; - - std::cout << "From vpRotationMatrix to vpQuaternionVector " << std::endl ; - vpQuaternionVector q(R); - std::cout << q <<std::endl ; - - R.buildFrom(q); - std::cout << "From vpQuaternionVector to vpRotationMatrix " << std::endl ; - - std::cout << "From vpRotationMatrix to vpRxyzVector " << std::endl ; - vpRxyzVector RxyzBuildFromR(R) ; - std::cout << RxyzBuildFromR <<std::endl ; - - - std::cout << "From vpRxyzVector to vpThetaUVector " << std::endl ; - std::cout << " use From vpRxyzVector to vpRotationMatrix " << std::endl ; - std::cout << " use From vpRotationMatrix to vpThetaUVector " << std::endl ; - - - vpThetaUVector tuBuildFromEu ; - tuBuildFromEu.buildFrom(R) ; - - std::cout << std::endl ; - std::cout << "result : should equivalent to the first one " << std::endl ; - - - double theta2; - vpColVector u2; - - tuBuildFromEu.extract(theta2, u2); - std::cout << "theta=" << vpMath::deg(theta2) << std::endl ; - std::cout << "u=" << u2 << std::endl ; - - assert(vpMath::abs(theta2-theta)<std::numeric_limits<double>::epsilon()*1e10); - assert(vpMath::abs(u[0]-u2[0])<std::numeric_limits<double>::epsilon()*1e10); - assert(vpMath::abs(u[1]-u2[1])<std::numeric_limits<double>::epsilon()*1e10); - assert(vpMath::abs(u[2]-u2[2])<std::numeric_limits<double>::epsilon()*1e10); - } - vpRzyzVector rzyz(vpMath::rad(180), vpMath::rad(120), vpMath::rad(45)) ; - std::cout << "Initialization vpRzyzVector " <<std::endl ; - std::cout << rzyz << std::endl ; - std::cout << "From vpRzyzVector to vpRotationMatrix " << std::endl ; - R.buildFrom(rzyz) ; - std::cout << "From vpRotationMatrix to vpRzyzVector " << std::endl ; - vpRzyzVector rzyz_final ; - rzyz_final.buildFrom(R) ; - std::cout << rzyz_final << std::endl ; - - - vpRzyxVector rzyx(vpMath::rad(180), vpMath::rad(120), vpMath::rad(45)) ; - std::cout << "Initialization vpRzyxVector " <<std::endl ; - std::cout << rzyx << std::endl ; - std::cout << "From vpRzyxVector to vpRotationMatrix " << std::endl ; - R.buildFrom(rzyx) ; - std::cout << R << std::endl ; - std::cout << "From vpRotationMatrix to vpRzyxVector " << std::endl ; - vpRzyxVector rzyx_final ; - rzyx_final.buildFrom(R) ; - std::cout << rzyx_final << std::endl ; - } - return 0; - } - catch(vpException e) { - std::cout << "Catch an exception: " << e << std::endl; - return 1; - } -} diff --git a/test/network/CMakeLists.txt b/test/network/CMakeLists.txt deleted file mode 100644 index 26f45ab28b38772b75b4c4dc46ed756c53421e1f..0000000000000000000000000000000000000000 --- a/test/network/CMakeLists.txt +++ /dev/null @@ -1,64 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP configuration file. -# -# Authors: -# Aurelien Yol -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testClient.cpp - testServer.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() diff --git a/test/pose/CMakeLists.txt b/test/pose/CMakeLists.txt deleted file mode 100644 index 6456016e1899b93179406d15bb48f77f6b57af3c..0000000000000000000000000000000000000000 --- a/test/pose/CMakeLists.txt +++ /dev/null @@ -1,69 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testPose.cpp - testPoseRansac.cpp - testFindMatch.cpp - testPoseFeatures.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - # Add test - add_test(${binary} ${binary}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() diff --git a/test/servo-afma4/CMakeLists.txt b/test/servo-afma4/CMakeLists.txt deleted file mode 100644 index abcac6cc6763eee3938c46977fd18755baee017c..0000000000000000000000000000000000000000 --- a/test/servo-afma4/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testAfma4.cpp - testRobotAfma4.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - # Add test - add_test(${binary} ${binary}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() diff --git a/test/servo-afma6/CMakeLists.txt b/test/servo-afma6/CMakeLists.txt deleted file mode 100644 index d0a19dc6ed0046f5748e80561ccaac161c92a0e1..0000000000000000000000000000000000000000 --- a/test/servo-afma6/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testAfma6.cpp - testRobotAfma6.cpp - testRobotAfma6Pose.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() - -# Add test -add_test(testAfma6 testAfma6) -add_test(testRobotAfma6 testRobotAfma6) - -# testRobotAfma6Pose cannot be run automaticlly, since human interaction is -# required to click on the dots for the pose computation -#add_test(testRobotAfma6Pose testRobotAfma6Pose) diff --git a/test/servo-viper/CMakeLists.txt b/test/servo-viper/CMakeLists.txt deleted file mode 100644 index 13f8ba559c9bf4cc2274a6d178debfefd54858ae..0000000000000000000000000000000000000000 --- a/test/servo-viper/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -SET (SOURCE - testViper850.cpp - testRobotViper850.cpp - testRobotViper850Pose.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() - -# Add test -add_test(testViper850 testViper850) -add_test(testRobotViper850 testRobotViper850) - -# testRobotViper850Pose cannot be run automaticlly, since human interaction is -# required to click on the dots for the pose computation -#add_test(testRobotViper850Pose testRobotViper850Pose.cpp) diff --git a/test/tools/convert/CMakeLists.txt b/test/tools/convert/CMakeLists.txt deleted file mode 100644 index 4a27cab28ecee3a93aebd914852d925b20766e08..0000000000000000000000000000000000000000 --- a/test/tools/convert/CMakeLists.txt +++ /dev/null @@ -1,68 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP overall configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testConvert.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - # Add test - add_test(${binary} ${binary}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() - - diff --git a/test/tools/geometry/CMakeLists.txt b/test/tools/geometry/CMakeLists.txt deleted file mode 100644 index bc22f008d61da8aef6f04385650b5453133e867a..0000000000000000000000000000000000000000 --- a/test/tools/geometry/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 2897 2010-11-04 11:17:58Z rtallonn $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP overall configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testPolygon.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - # Add test - add_test(${binary} ${binary} -c ${OPTION_TO_DESACTIVE_DISPLAY}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() diff --git a/test/tools/io/CMakeLists.txt b/test/tools/io/CMakeLists.txt deleted file mode 100644 index 6d3680715447ae3fbd848dc8d8bacffc390c57b8..0000000000000000000000000000000000000000 --- a/test/tools/io/CMakeLists.txt +++ /dev/null @@ -1,68 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP overall configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testIoTools.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - # Add test - add_test(${binary} ${binary}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() - - diff --git a/test/tools/time/CMakeLists.txt b/test/tools/time/CMakeLists.txt deleted file mode 100644 index 380fb6976ead677bf70182c2d047743fff772c32..0000000000000000000000000000000000000000 --- a/test/tools/time/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP overall configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testTime.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - # Add test - add_test(${binary} ${binary}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() diff --git a/test/tools/xml/CMakeLists.txt b/test/tools/xml/CMakeLists.txt deleted file mode 100644 index 1738304f178eb273127440ed1ed25915439d67af..0000000000000000000000000000000000000000 --- a/test/tools/xml/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP overall configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testXmlParser.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - # Add test - add_test(${binary} ${binary}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() diff --git a/test/tracking/CMakeLists.txt b/test/tracking/CMakeLists.txt deleted file mode 100644 index 9d1bec4e87443bd23855c30a21913ef9db9a6627..0000000000000000000000000000000000000000 --- a/test/tracking/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP overall configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testTrackDot.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - # Add test - add_test(${binary} ${binary} -c ${OPTION_TO_DESACTIVE_DISPLAY}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() diff --git a/test/visual-feature/CMakeLists.txt b/test/visual-feature/CMakeLists.txt deleted file mode 100755 index 203793e139061b0e5c3f4d0b974fd34bdbcea792..0000000000000000000000000000000000000000 --- a/test/visual-feature/CMakeLists.txt +++ /dev/null @@ -1,70 +0,0 @@ -############################################################################# -# -# $Id: CMakeLists.txt 4961 2014-11-14 13:06:26Z fspindle $ -# -# This file is part of the ViSP software. -# Copyright (C) 2005 - 2014 by INRIA. All rights reserved. -# -# This software is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# ("GPL") version 2 as published by the Free Software Foundation. -# See the file LICENSE.txt at the root directory of this source -# distribution for additional information about the GNU GPL. -# -# For using ViSP with software that can not be combined with the GNU -# GPL, please contact INRIA about acquiring a ViSP Professional -# Edition License. -# -# See http://www.irisa.fr/lagadic/visp/visp.html for more information. -# -# This software was developed at: -# INRIA Rennes - Bretagne Atlantique -# Campus Universitaire de Beaulieu -# 35042 Rennes Cedex -# France -# http://www.irisa.fr/lagadic -# -# If you have questions regarding the use of this file, please contact -# INRIA at visp@inria.fr -# -# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -# -# Description: -# ViSP overall configuration file. -# -# Authors: -# Fabien Spindler -# -############################################################################# - -# SOURCE variable corresponds to the list of all the sources to build binaries. -# The generate binary comes by removing the .cpp extension to -# the source name. -# -# If you want to add/remove a source, modify here -set(SOURCE - testFeature.cpp - testFeatureMoment.cpp - testFeatureSegment.cpp -) - -# rule for binary build -foreach(source ${SOURCE}) - # Compute the name of the binary to create - get_filename_component(binary ${source} NAME_WE) - - # From source compile the binary and add link rules - add_executable(${binary} ${source}) - target_link_libraries(${binary} ${VISP_INTERN_LIBRARY} ${VISP_EXTERN_LIBRARIES}) - - add_dependencies(visp_tests ${binary}) - if(ENABLE_SOLUTION_FOLDERS) - set_target_properties(${binary} PROPERTIES FOLDER "tests") - endif() -endforeach() - -add_test(testFeature testFeature) -add_test(testFeatureMoment testFeatureMoment) -add_test(testFeatureSegment testFeatureSegment ${OPTION_TO_DESACTIVE_DISPLAY} -normalized 0) -add_test(testFeatureSegment-norm testFeatureSegment ${OPTION_TO_DESACTIVE_DISPLAY} -normalized 1) diff --git a/tutorial/CMakeLists.txt b/tutorial/CMakeLists.txt index cf3e0ce07e29bf945fb0d4366c6e086f69854cb9..4fc11c12e29877525e9677cb9254e3abebf33ae0 100644 --- a/tutorial/CMakeLists.txt +++ b/tutorial/CMakeLists.txt @@ -2,6 +2,8 @@ project(ViSP-tutorial) cmake_minimum_required(VERSION 2.6) +find_package(VISP REQUIRED) + if(MSVC) if(NOT VISP_SHARED) foreach(flag_var @@ -23,22 +25,23 @@ if(MSVC) endif() endif() -add_subdirectory(computer-vision) -add_subdirectory(grabber) -add_subdirectory(detection/barcode) -add_subdirectory(detection/face) -add_subdirectory(detection/matching) -add_subdirectory(detection/object) -add_subdirectory(image) -add_subdirectory(robot/pioneer) -add_subdirectory(simulator/image) -add_subdirectory(trace) -#add_subdirectory(tracking/barcode) -add_subdirectory(tracking/blob) -add_subdirectory(tracking/keypoint) -add_subdirectory(tracking/model-based/edges) -add_subdirectory(tracking/model-based/hybrid) -add_subdirectory(tracking/model-based/keypoint) -add_subdirectory(tracking/template-tracker) -add_subdirectory(tracking/moving-edges) -add_subdirectory(visual-servo/ibvs) +visp_add_subdirectory(bridge/opencv REQUIRED_DEPS visp_core visp_io) +visp_add_subdirectory(computer-vision REQUIRED_DEPS visp_core visp_blob visp_vision visp_io visp_gui) +visp_add_subdirectory(grabber REQUIRED_DEPS visp_core visp_sensor visp_io visp_gui) +visp_add_subdirectory(detection/barcode REQUIRED_DEPS visp_core visp_detection visp_io visp_gui) +visp_add_subdirectory(detection/face REQUIRED_DEPS visp_core visp_detection visp_io visp_gui) +visp_add_subdirectory(detection/matching REQUIRED_DEPS visp_core visp_vision visp_io visp_gui) +visp_add_subdirectory(detection/object REQUIRED_DEPS visp_core visp_vision visp_mbt visp_io visp_gui) +visp_add_subdirectory(image REQUIRED_DEPS visp_core visp_io visp_gui) +visp_add_subdirectory(robot/pioneer REQUIRED_DEPS visp_core visp_robot visp_vs visp_gui) +visp_add_subdirectory(simulator/image REQUIRED_DEPS visp_core visp_robot visp_io visp_gui) +visp_add_subdirectory(trace REQUIRED_DEPS visp_core) +visp_add_subdirectory(tracking/blob REQUIRED_DEPS visp_core visp_blob visp_io visp_gui) +visp_add_subdirectory(tracking/keypoint REQUIRED_DEPS visp_core visp_vision visp_klt visp_io visp_gui) +visp_add_subdirectory(tracking/model-based/generic REQUIRED_DEPS visp_core visp_mbt visp_io visp_gui) +visp_add_subdirectory(tracking/model-based/edges REQUIRED_DEPS visp_core visp_mbt visp_io visp_gui) +visp_add_subdirectory(tracking/model-based/hybrid REQUIRED_DEPS visp_core visp_mbt visp_klt visp_io visp_gui) +visp_add_subdirectory(tracking/model-based/keypoint REQUIRED_DEPS visp_core visp_mbt visp_klt visp_io visp_gui) +visp_add_subdirectory(tracking/template-tracker REQUIRED_DEPS visp_core visp_tt visp_io visp_gui) +visp_add_subdirectory(tracking/moving-edges REQUIRED_DEPS visp_core visp_me visp_io visp_gui) +visp_add_subdirectory(visual-servo/ibvs REQUIRED_DEPS visp_core visp_robot visp_vs visp_blob visp_vision visp_io visp_gui) diff --git a/tutorial/bridge/opencv/CMakeLists.txt b/tutorial/bridge/opencv/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..8332b248c900aa874d38019bb79c6eb0d586021a --- /dev/null +++ b/tutorial/bridge/opencv/CMakeLists.txt @@ -0,0 +1,22 @@ +project(tutorial-bridge-opencv) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_io) + +set(tutorial_cpp + tutorial-bridge-opencv.cpp) + +list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/chessboard.pgm" ) + +foreach(cpp ${tutorial_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "tutorials") + endif() +endforeach() + +# Copy the data files to the same location than the target +foreach(data ${tutorial_data}) + visp_copy_data(tutorial-bridge-opencv.cpp ${data}) +endforeach() diff --git a/tutorial/bridge/opencv/chessboard.pgm b/tutorial/bridge/opencv/chessboard.pgm new file mode 100644 index 0000000000000000000000000000000000000000..3f4231e6d947379c72a351e5988d7e4eff5c79d0 --- /dev/null +++ b/tutorial/bridge/opencv/chessboard.pgm @@ -0,0 +1,4 @@ +P5 +640 480 +255 +MORSUW[^fkrwz|~‚ƒ„„…„„„„„„ƒ‚‚‚…††„‚‚„…†††‡ˆˆˆ‡‰‹Œ‹‹Œ‹‹‹‹ŒŒŽŽŽŽ‘‘‘‘’“”””••––————————––—˜˜—––—––––—˜™™™™ššš››ššššš™™™™™˜˜——––————˜š›œœœœœœœœœœœœœœœœœŸŸŸŸŸ ¡¢ŸŸŸŸŸžžž¡¡¡¡¡¡¡¡££¢¢¡¡ ŸŸ ¡¡¢¢¤£¢¡¡¡¡¢ŸŸ ¡¢£¤¤Ÿ ¢£¤¤¤¤¦¥¤¤¤¤¥¦¤¤¤¤¤¤¤¤¦¦¦§§§¨¨«ªª©¨¨§§¦¦§§¨¨©©¬«««ªª¨§©¯«©ª«¬©©ª«¬¬¬«¨©ª«¬¬««¬®®¬«¬®ª««¬®¯¯«¬¬ª©ª¯°±²´¶·¹¹¹¼¿ÂÃÄÇÉÆÊÎÎËËÏÓ×ØÙÚÛÛÛÛÝÞßàáãääççççççççççççççççæææççèèèççççççççèèèèèèèèééééééééêêêëëìììíììëëììíëëëëëëëëëëëëëëëëèèéêêéèèááàßàâãåæäßÚÔÏÊÈÁ¿½¼¾ÂÇÊÎÊÄÀ¿¿¿¾¿ÉÐÍÆÁ¼¸´´°ªª¬ª¦¡¥¯¿ÉÍÐÔÖ××ÖÔÒÏÎÏÉÀº¸¶³°³´¶·¹¾ÃȽ¸®¥¥©§¡·ÃÈú´±²¶½ÅÎØãêèçæåãâààÞÜÜÝÜØÏÈÁ¿¾ÄÌÑÐÍÏÐÒÒÐÍÉÆÎÑÕ×××××Õ×ÕÓØØŬŸŽƒ„…‡—«µ¬“rWF3"NPRTUX\`inuz}~€ƒ„……††……………„„ƒƒƒ†‡ˆ†„„†‡‡‡‡ˆˆˆ‰‰ˆŠŒŒŒŽŒŒŒŽŽŽ‘‘‘‘‘‘‘‘Ž‘‘““”””•••˜˜˜˜˜˜˜˜™™™™™™™™—˜˜˜˜˜˜—˜————˜™š™™šš››››š›››››››ššš™™˜˜˜™™™™š›œžžžžžžžž ¡¡¢¢¢¡¡¡¡¡¡¡¢¢¢¢¢¢¢¢¢¤¤¤££¢¢¢¡¡¡¢¢£££¥¥¤£££££¢££¤¤¥¦¦¢£¤¥¦§§§§¦¦¥¥¦¦§¦¦¦¦¦¦¦¦§§§¨¨¨©©««ªªªª©©¬¬¬¬®®®¬¬¬¬ª©«¯®¬«¬®®®¬¬¬¬¬®¯¯¯¯®®°±°®®¯°¬¬®¯¯°°°°±°¯¯²´¶¶¶··¸¸¸¼¿ÃÅÆÇÉËËÏÓÓÐÐÔØÙÚÛÝÝÞÞÞààáâäåææççççççççççççççççæææççèèèççççççççèèèèèèèèééééééééêêêëëìììíììëëììíëëëëëëëëììììììììééêëëêééèçæææçèééèåáÝÚ×ÕÏÎÌÌÍÐÓÕÓÏÊÆÅÅÄÄÂÌÓÑËÇÿ¼½»¸··³¥§±ÀËÏÒÕÔÕÖ×Ø×ÖÖÕÏÆÀ½»¸¶´¶·¸»¿Åʽ´¬¬®«¥±»ÇÍÉÁº·µ»ÄÎÖÞåêèèçåãâáàßÞÞßÞØÏǽººÁÌÑÏËÎÐÒÓÒÐÍËÏÒÖÙÙØØÙØÙ×ÕÚÛÊ´©—Š‰‰Š™º´ž|^J7'OQSUWZ_cmry~€ƒ„„…†‡‡‡‡‡‡††††………ˆ‰Š‰‡ˆŠŒˆ‰‰‰‰ŠŠŠ‰‹ŽŽŽŽŽŽ““““““““‘’“••–––———šššššš™™šššššššššššššššš™™™™™š›œšš›››œœœ››œœžžžœœœœ››››œœ››œŸŸŸŸŸŸŸŸ¡¡¡¡¡¡¡¡ ¡£¤¤¤£¢¢¢£¤¤¥¥¦¤¤¤¤¤¤¤¤¦¦¦¥¥¥¤¤££¤¤¤¥¥¥§§¦¥¤¥¥¥§§§§§§§§¥¦§¨©©©©©¨§§§§¨©©©©©©©©©©©©ªªª««««¬¬¬°°°°¯¯¯¯°¯¯¯¯®®®¯®¯°¯¯¯°°¯¯®®¯¯¯¯¯®®¯°°±±°°±²³³±±²³¯¯¯°±²²²³´´´²³µ·¸¸¹¹ºº»»ÁÄÇÈÉÉËÍÎÒÕÖÔÕØÜÜÝßàááááããäåæçèèççççççççççççççççççççèèèèççççççççèèèèèèèèééééééééêêêëëìììíììëëììíëëëëëëëëííííííííêëììììëêíìëëêëëìëêéèæåäãÞÞÝÝÝÞßàÚ×ÒÏÎÎÍÍÉÑØÖÑÏËÇÁÃÃÀ¿¾¹±«¬´ÂÍÑÓÖÓÔÕ×ØÙÙÙØÓÌÅ¿½¼¸¹º»½ÁÈÌÈž·¶·³¬´¾ÊÑÎÇÀ½¹ÁÌÖÞãæèéèçæäâááâááâáÚÏÇ»¶µ½ÊÑÐÊÎÏÒÔÕÔÒÑÏÓ×ÚÚÙÚÚÛÜÙ×ÜÞÑÀ´ŸŒ‹‹˜«¾¾‹hO<-!RSUWY]bfpu{€‚ƒ„……†‡ˆ‰‰‰‰ˆˆˆˆ‡‡‡‡ˆ‰ŠŠ‰‰ŒŽŠŠ‹‹‹‹‹‹‹‘‘‘’’’’••••••••’’‘‘’’“”••–––———šššš™™™™››››››››œœ››››œœ›››››œ››œœœœžŸ ¡¡žžžžžžžž ŸžžžžŸ¡¡¡¡¡¡¡¡¢¢¢¢¢¢¢¢¢£¥§§¦¤¢££¤¥¦§§¨¦¦¦¦¦¦¦¦¨¨§§§§§§¦¦¦¦¦¦§§¨§¦¥¥¥¦¦©©©¨¨¨¨¨§¨©ªªªªªªª©©©©ªªªªªªªªªªª«««¬¬¬¬¬®¯°°±°°°¯¯®®±±±±°°°°±±°°°°°¯²²²²±°®®¯°°°°°®¯°°°°¯¯±³´´³²´µ²²²³³´´´²³´´³³´¶¶·¸º½¿ÀÁÄÇÉËËËÌÎÎÑÔÕÕÖØÛÞßàáâãââääåæçèèéèèèèèèèèèèèèèèèèçèèèèèèèèèèèèèèèèèèèèèèèééééééééêêêëëìììíììëëììíììììììììîîîîîîîîììíîîíììîííìëëëëëêêêééééååææåääãáÞÚ×××ÖÕÒÙÝÛ×ÕÑÍÆÈÇý¶°¯µÂÍÑÓÖÕÖÖÖÖÕÕÕ×ÓÍÆÂÀ¿¾½½½½¿ÃÊÏÎÍÉÂÀÀ¼µ·ÀËÒÒÌÆ¿ÆÐÙßâåæêéèæåãâáäääåäÝÒɾ·²¸ÆÑÒÎÏÑÓÔÕÕÔÓÎÒÖÙÙÙÚÚÜÜÙØÜß×˹£‘‹Š–¨¾Äº™sV@2$ WXYZ\`fjrw}ƒƒƒ„…†ˆ‰ŠŠŠŠˆˆ‰‰‰‰‰‰ˆ‰ŠŠ‰‰‹ŽŒŒŒŒŒ‹‹‹‹Ž‘‘’’’’““”””––––––––”““““”•–———˜˜˜™™›››››ššš››››››››žœœœœžœœœœžŸžžŸŸžžŸ ¡¢¢ ¡¡ ŸŸŸ ¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¤¥§¨¨§¤£¢£¤¥¦§§¨¨¨¨¨¨¨¨¨©©©©©©©©¨¨¨¨¨¨¨¨¨§¦¥¥¥¥¦©©¨¨¨¨¨§¨¨©ªªª©©¬«ªªªª«¬ªªªªªªªª¬¬¬®®®®¯±²²³±±°¯¯®®®±±²²²²²²²³³²²±±²´´´³²°¯®ª«¯±±²²°±±²±±°°±²´´³²´¶´µµµµ¶¶¶²´µµ´´µ¶¶·¹»¾ÀÂÃÅÇÊËËËÍÎÏÑÓÕÖØÚÜÞßàâããããääåææççèèèèèèèèèèèèèèèèèéèèèèèèèèèèèèèèèèèèèèèèèééééééééêêêëëìììíììëëììíììììììììîîîîîîîîííîîîîííîîîííìëëìììëëêêêèèèèèæäãæãàÞÞÞÝÜÛàâßÛÙÕÐÐÐÍÇÆÇÄ¿µ²µÁÌÑÓÕ×ÖÖÕÕÔÔÔÕÒÍÈÃÁÂÃÂÂÁÀÀÄËÐÒÓÐÊÈÈľ¾ÅÎÕÖÓÍÊÉÎÕÚßâæéëêéçæäãâæåæçæàÖÎȾµ¸ÄÐÕÕÓÓÔÕÔÓÒÑÌÐÕ×ØØÙÚÛÚÙØÜÞÚÓ¿¨”ŽŒ–¦¸Åħ^F6)! ]]^^_cimtx~‚ƒƒƒ„…†‡‰Š‹‹‹ˆ‰‰‰‰ŠŠŠ‰Š‹Š‰‰‹ŒŒŒŒ‹‹‹‹ŒŽ‘‘’“““”””••––––––––••””•–——ššš››œœœœœžžžŸœœœœœœœœŸžœœžŸœœžžŸžžžŸŸŸ ŸŸŸ ¡¡¢¢¡¡¡¡¢¢¢¢¡¡ ¡¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¢¦¦§¨¨¦¥¤£¤¤¥¥¦¦§©©©©©©©©©©©ªªª««ªª©©©¨¨¨¨¨§¦¦¦¦¦¨¨¨¨¨¨¨¨¨©©ªª©©¨¬¬«ªª«¬¬ªªªªªªªª¬¬®®®®¯¯°±²³³²²²²²±±±±²²²²³³³±³´´²²³´´´´´³±°¯«¬®°±²²³³´´´´³²²°²³³³³´¶¶¶¶¶¶···´¶¹¹¸·¸¹»¼½¾¿ÀÁÁÅÇÊÌÌÍÎÐÒÓÕ×ÚÜÝÞßàáâããããääååææççééééééééééééééééééééèèèèééééééééèèèèèèèèééééééééêêêëëìììíììëëììíííííííííîîîîîîîîííîîîîííïïðððïîíðïïîîííìëëëëêéççéçåääåãâãææâßÞÚÕÕÔÏÉÇÉǺµ·ÁÍÒÓÔÖÕÔÔÓÔÔÕÔÓÏÊÆÅÇÉÇÆÄÁÁÄÊÏÓÕÓÎËÌÊÆÈÌÓØÚÙÕÓÕØÜßâæêíëëêèæåäãçææçèäÝÖÓÊÀ¿ÆÐ×ÚÖÖÖÕÔÓÒÑËÏÔ×ØØÙÚÙÙØÙÛÜÚØǯœ—”‘˜¥²ÄÊ´ŽkM:.%ccbabfkpv{€„„„„„„…‡ˆŠŠ‹‹ˆˆˆ‰‰ŠŠŠ‹ŒŒ‹‰‰ŠŒŒŒŒŒ‹‹ŠŠ‹’“““””•••–––––––––––––—˜˜šš›››œœœš›œžŸ Ÿžœ››œžŸœœžŸŸŸŸŸ ¡¡ ¡¡¡¡¡¢¢£££ ¡¢£¤¢¢¢¢¢¢¢¢££££££££§§§§¦¦¥¥¦¦¦¦¦¦¦¦©©©©©©©©©©©ªª«««ªªª©©¨¨¨ªª©¨§§¨¨§¨¨©©ªª«©ªª««ª©©¬¬«ªª«¬¬««««««««¬¬®®®¯°°±±²²³²²³³³³³´±±±²²³³³°²´´²²´¶³³³³³²°°°°±²²²²±´´´´´³²±±²´´´´¶·········µ¸º»º¹¹º¾¾¿ÀÂÃÄÅÅÈËÍÎÏÑÓÔÔÖØÛÞßààáâãääääååæææçççééééééééééééééééêêêééèèèééééééééèèèèèèèèééééééééêêêëëìììíììëëììíííííííííííííííííìíîîîîíìíîðññðïïñññððïïïïïîííìììíëééêêèçèêéåääáÛØØÕÏÎÎÊÄÀº¹ÃÎÓÕÖÕÓÑÏÍÍÍÍÒÑÏËÇÇÊÍËÊÆÂÁÃÈÍÒÕÓÎËÍÍËÎÐÔØÛÛÙ×ÜßâåçéìîìëêéçåääçååçéèãÞÛÕÎËÌÒØÜØØØ×ÖÕÔÔÌÐÕØÙÙÚÛÙØÙÛÜÛÛÛζ¢™“–¡ÃÏ¿yW@2)ffecdglqx|‚…†………„…†ˆ‰Š‹‹ˆˆˆ‰‰ŠŠŠŽŽŒŠ‰‹ŒŒŒŒ‹‹ŠŠŠ‹‘“““””•••––––––––——––——˜™˜˜˜™™™šš——™šœžŸŸŸŸŸŸŸŸŸŸžœ››œžŸœœœœžŸŸŸ ¡¡¡¡ ŸŸ¡¡¡¢¢£££ŸŸŸ ¡¢¤¤¢¢¢¢¢¢¢¢¤¤¤¤¤¤¤¤¨¨¦¥¥¥¥¥¨§§§§§§¦©©©©©©©©©©©ªª«««ªªª©©¨¨¨¬«ªª©©ªª§¨©©««¬««¬¬¬«ªª¬««ªª««¬¬¬¬¬¬¬¬¬¬¬¬®®®°°±±±²²²°±±²²³³´±±±²²³³³®±´´²²µ¸²²³³³²±°µµµ´³²±°±²²²±°¯¯±³µµµµ·¹········´·¹º¹¸¸¹¼½¿ÂÅÈÊËÅÈÌÎÏÑÓÕÓÓÔ×ÛÞßßáâãäåæååææççççèèééééééééééééééééêêêééèèèééééééééèèèèèèèèééééééééêêêëëìììíììëëììíííííííííííííííííìííîîííìëìîïðïïîððððððððñðïîîîîîïíììííìêéëêççèæáÞàßÛÙØÒÊļ»ÄÐÕÖ×ÕÒÎÊÆÃÁÁÎÎÍÉÆÆÊÎÎÌÇÃÀÂÇÌÑÔÒÍËÎÏÎÐÑÒÖØÙØ×ÝàåèéêëìììêéçæåäçåäæéêæãÞÜØÔÒÔØÜÙÙÙØØØØ×ÍÑÖÙÚÚÛÜÙÙÚÝÝÛÛÝÒº¥Ÿš‘’›¬ÃÓǧ‚^E4+ddcabgns|}€ƒ„„ƒ‚†‡ˆ‰Š‹ŠŠ‹‰ˆˆ‰‹ŒŽŒ‹Š‰‰‰Š‹ŒŒŠŠ‹ŒŽ‘’“““””•••—•“’‘“•–—––••––———˜™™š›››››œœœžŸŸŸŸžŸŸŸŸŸŸŸŸžžŸŸŸ¢¢¢¡¡ ¡¡¡¢¢¥¤£¢£¤¦§££££££££¢¢¢£¤¥§¨¥§§¥¢£§¬§§§§§§§§©©¨§§©ª¬¨¨¨©©ªªª¨©ª«¬®§¨ª««ª¨§¨¨¨¨¨¨¨¨§©««©©«®«©¨©«¬¬¬¬¬«ª©¨¯°¯¬¯¯¯¯°±³´µ±±±±±±±±´´´³³²²²¯±²²±±³µ³´´µ´³±°°°°°°±³³³³³³³³³³µµµ¶¶···¹¹¸¸¸¸¸··¹ºººº¼½¼½¾ÀÂÄÅÆÈÊÌÍÍÎÐÒÔÔÖÛàâàÝãããääåååääåææçèèééééééééèèèèèèèèééééééééééééééééééééééééêêêêêêêêììììììììëëëëëëëëëëëììíííííííííííîîîîîîîîîîîîîîîîððððððððððððððððîîîîîîîîììëêéçåäääâàßÝÛÛÏÊÇÊÑ×ØÖÒÏÉþ¼¼¼ÁÉÍÊÅÄÄÄÆÀ¼½½¾ÃÉÏÕÖÒÍËÇÃÇÍÔØØ×ØÙßàãæéêêêíììëéçåäãåçééèçåäâßÝÛÚÚÛÚÙÙØØÙÚÚÓÑÐÓ×ÚÙ×ÙÙØØÙÛÝÞÔ¯¤›“‘•¥ÂÏÓ¹‹kJ92$ eedcdhot|}€‚„„ƒ‚…†‡ˆ‰‰‰‰Œ‹‰ˆˆ‰‹ŒŽŒ‹Š‰‰‰Š‹ŒŒŠŠ‹ŒŽŽ‘’“““”””••–•“’’“•——––••––———˜˜™š›››››œœœœžžŸŸžžŸŸŸŸŸŸŸŸžžŸŸŸ¢¢¢¡¡ ¡¡¡¢¢¢¢¤¤£¢£¤¥¦££££££££££££¤¥¦§¦¦¦¤£¥¨ª§§§§§§§§©¨§§§¨ª«¨¨¨©©©ªª©©ª««¬¬©ª«¬¬«ª©©©©©©©©©¨©««©©«¬®«©©©«¬«¬¬¬¬««ª®¯¯¬¯²²±°°°±±±±²²²²±±¯°±²³´µµ±²´³²²³´´µµ¶µ´³²±°°°±±²³³³³³³³³³µµµ¶¶¶··¶¶¶······¸ºººº»½¼½¾ÀÂÄÅÆÈÊÌÍÍÎÐÒÕÕÖÚßáàÞãããääåååääåæççèèééééééééèèèèèèèèééééééééééééééééééééééééêêêêêêêêììììììììëëëëëëëëëëëììíííííííííííîîîîîîîîîîîîîîîîððððððððððððððððîîîîîîîîííííëêèçæåäâáßÞÝÖÒÏÑ×ÜÜÛÕÏƽ·µ·¸¾ÆÊÆÂÂÂÁ¿º·¹ºº¾ÄÏÔÖÒÎÌÉÄÃÉÑ×ÙÚÛÝáãæéëìììììëëéèæåäæèêêéèçæäâßÝÜÜÜØØ×ÖÖÖ××ÔÑÐÒ×ÚÙ×Ø×ÖÖ×ÙÛÜØȵ©Ÿ–”–¤ÀÎ×ÙwS=4&fffefjpu|}€‚ƒƒƒ‚ƒ„†‡ˆˆˆˆ‹Š‰ˆˆ‰ŠŒ‹Š‰‰‰ŠŠ‹ŒŒŠŠ‹ŒŽŽŽŽ‘’““““”””•”“’’“”–——––••––————˜™šš›››››œœœœœžŸŸžžžžžžžžžžŸŸŸŸŸŸŸŸžžŸŸŸ¡¡¡¡ ¡¡¡¢¢££££££¢£¤¥¦££££££££¥¤¤££¤¤¥¨¦¤£¥§¨¨¨¨¨¨¨¨¨¨¨¨§§¨¨ªª¨¨¨¨©©©ªªªª«««««ª«¬¬¬¬«ª©©©©©©©©¨ª««©©ª¬¬ª©©©ª«««¬¬¬¬®¯®¬®¯²±°°¯¯°°°±²³³²±°¯¯°±²´µµ³´µ´³²³´µµ¶¶¶µ´³±±±°±²²³³³³³³³³³µµµµ¶¶¶·´´´µ¶¶··¶¸ºº¹¹»½¼½¾ÀÂÄÅÆÈÊÌÍÍÎÐÒÖÕÖÙÝàáàãããääåååäååæçèèèééééééééèèèèèèèèééééééééééééééééééééééééêêêêêêêêììììììììëëëëëëëëëëëììíííííííííííîîîîîîîîîîîîîîîîððððððððððððððððîîîîîîîîîïïïîîíìéèçæäãâáßÜÙÚßââàÜÔȼµ´·ºÀÆÊÆÂÂÁ¿¹´²´µ¶ºÀÏÕ×ÔÑÐÍÉÄÉÐÕØÚÜÝâãæéëìììêêëëêéèèæçéêëêéèéçåãàßÞÞÚÙØ×ÖÖÖ×ÔÒÐÒ×ÚÚØÖÖÕÕÕ×ÙÚÜϾ°¤š–— ¹ÈØϪ…]D8(hhhghlrw|}‚‚‚‚„„†‡ˆˆˆˆŠ‰ˆˆˆ‰Š‹ŒŒ‹Š‰‰‰ŠŠ‹ŒŒŠŠ‹ŒŽŽŽŽŽ‘’’“““”””’’’’“•—˜—––••––—––—˜™™šššš›››œœœ›œžžžžžžžžžžžžžžžžžžžžžžŸŸŸ¡ ¡¡¢¢£££££¢¢££¤¤¥££££££££¦¥¤££££¤¨¥¢£§©¨¦¨¨¨¨¨¨¨¨©©©©©ªª«§§¨¨¨©©©«««ªªªªªª««««««ªªªªªªªªª©ª««©©ª«¬¬ª©©©ªªª«¬®«®®¬®¯®®®®¯°²²°±²´´²±°³³³³³³³³µ¶¶µ³²³´´´´´´´´³²²±±±²²³³³³³³³³³´´µµµ¶¶¶³³´µ¶·¸¸¶¸¹º¹¹»¼¼½¾ÀÂÄÅÆÈÊÌÍÍÎÐÒÖÖ×ÙÜßáâãããääåååååææçèééééééééééèèèèèèèèééééééééééééééééééééééééêêêêêêêêëëëëëëëëëëëëëëëëëëëììíííííííííííîîîîîîîîîîîîîîîîïïððððññððððððððïïïïïïïïîïïðððïïììëêéèççæäááäååäãÜÑÆÀ¿ÁÃÉÎÐËÆÅ¿¹²®®°²¸¿ÏÕÙÖÔÓÑÍÈËÐÕ×ÙÙÙàáäæèééèèèéêëêêêèéêëëëêêëêéæäãááßÞÜÛÙÙØØÕÒÐÒ×ÚÚÙ××ÖÕÖ×ÙÚÞÔŵ§—•š°¾ÕÖ¶dK<*hiiijnsw|}~€‚‚‚……‡ˆ‰‰‰‰ˆˆˆˆ‰‰Š‹‹‹Š‰‰‰‰ŠŠ‹ŒŒŠŠ‹ŒŽŽŽ‘’’’“““””’’’“”•–——––••––—––——˜™ššššš›››œœ›œžžžžžžžžžžžžžžžžžžžžŸŸŸŸ ¡¡¡¢¢£££¡¢¢££¤¤£££££££££§¦¥¤££££¨¥¢¤§©¨¥¨¨¨¨¨¨¨¨©ªª««¬¬¬§§§¨¨¨©©ªªªªª©©©ª©©©©©©ªªªªªªªªª©«¬«©¨©«««ª©©©©©ªª«¬ª¬¬¬®¯®®®¯°±¯°±²²±°¯³³³´´´´´µ¶¶µ³²³´²²²²²²²³³³²±±²²³³³³³³³³³´´´µµµ¶¶´´µ¶·¸¹¹¶·¹¹¸¹º¼¼½¾ÀÂÄÅÆÈÊÌÍÍÎÐÒÕÖØÙÛÞáããããääåååååæçèèééééééééééèèèèèèèèééééééééééééééééééééééééêêêêêêêêëëëëëëëëëëëëëëëëëëëììíííííííííííîîîîîîîîîîîîîîîîïïïððñññððððððððïïïïïïïïíîïðððïïïîîííììëéèææççæååáÛÕÐÏÎÏÔ××ÑËÈÄ¿»³«¨©¬´½ËÑÕÓÑÑÏËÈÊÎÓ×ÙÙÙßàãåççççæçèéêêêêééêëëëëëììëêèæåäãâàÝÛÚÙÙÖÓÐÒ×ÛÛÚÚÙØ××ØÚÛÜÖʹªž–’˜«·ÓÛÁœmS@,! hijjknsw|}~€‚ƒ…†‡ˆ‰‰‰‰†‡‡ˆ‰‰ŠŠŠŠ‰‰‰‰ŠŠŠ‹ŒŒŠŠ‹ŒŽŽ‘’’’““““’““””••–—––••––—•––—˜™™™™ššš››››››œžžŸŸŸŸŸŸŸ ¡¡¡¢¢ ¡¢£¤£££££££££££¦¦¤£££££¦¥¤¥§¨§¦§§§§§§§§©©ª«¬¬««¦§§§¨¨¨¨©©©©©ªªªª©¨¨¨¨©ª©©©©©©©©ª«¬«©¨©ªªªªª©©¨¨©ª«¬¬¬««©«¬¬®¯±°¯®¬¬¬¬¯¯¯¯¯¯¯¯®¯°²´¶·¸³´µ´³²³´±±°°°±²³´´³²²²²³³³³³³³³³³´´´µµµµµµ¶¶·¸¸¸µ·¹¹¸¸º¼¼½¾ÀÂÄÅÆÈÊÌÍÍÎÐÒÓÖÙÛÜÝàâãããääåååæææçèééêééééééééèèèèèèèèééééééééééééééééééééééééêêêêêêêêêêêêêêêêëëëëëëëëëëëììíííííííííííîîîîîîîîîîîîîîîîîîïððñòòððððððððððððððððîîïðððïïððððððïïììëêééèèæåãàÞÛÚÙÜßÝÖÑÎÈÁ¿µ¬§¦¨°¹ÅËÎÌËËÉÅÅÆÊÑ×ÜÝÝàáäæççççäåæèéééééééêêëëëììììëêèèåãáÞÛÙØØ×ÔÐÒÖÛÜÛÜÛÚÙÙÚÛÜÜÚо¡˜‘™©³ÑßË©|[E/%hijklosw}}}~‚ƒƒ„†‡ˆˆˆˆ…†‡ˆ‰ŠŠŠŠ‰‰ˆˆ‰ŠŠŠ‹ŒŒŠŠ‹ŒŽŽ‘‘’’’“““““””•”””—––••––—••–—˜˜™™™™ššš›››š›œœœœœœœœœœžžŸŸŸžžžŸŸ ŸŸŸŸ ¡¡ ¡¢£¤£¢¢££££££££¥¥¤£££¤¤£¥§§¦¦¦§¦¦¦¦¦¦¦¦¦§©ªªª©¨¦¦§§§¨¨¨§¨¨©©ª«««ª©¨¨©ª«©©©©©©©©ª«¬«©¨©ªªªªª©©¨¨©ªª«ªª©¨©ª¬¬¬¬®°±°¯¬«««°¯¬¬¯°¬¬®°²´µ¶±²´³²²³´²±±°±²³´µ´³²²²²²³³³³³³³³³³´´´µµµµµµµµ¶¶¶µ·¸¸¸¸º»¼½¾ÀÂÄÅÆÈÊÌÍÍÎÐÒÒÕÚÜÝÝßáãããääåååææççèéêêééééééééèèèèèèèèééééééééééééééééééééééééêêêêêêêêêêêêêêêêëëëëëëëëëëëììíííííííííííîîîîîîîîîîîîîîîîîîïððñòòððððððððððððððððððñññðïïññññòòòòïððïîìììêêèçåäãããåãÝÙ×ÑÊż´°¬°¶ÂÈÌÊÇÇÅÂÅÆÉÏ×ÜÞÝÞàâäåååäãäåæççççéééééêëëêëìííìëêèçäàÝÛÙÙØÔÑÑÖÛÜÜÜÛÚÙÙÚÛÜÞß×ų§”—¦¯ÎàÒµŠdK3)"gijklnsv}}}~€‚ƒ‚ƒ„…††††…†‡ˆ‰ŠŠŠ‰‰ˆˆˆ‰ŠŠŠ‹ŒŒŠŠ‹ŒŽŽŽ‘‘‘’’“““””•••”““—––••––—••–——˜™™™™™šš›››š›œœ››››››››žžŸŸŸžžžŸŸ žžžŸŸŸ Ÿ ¢£¤£¢¡££££££££¥¤¤££¤¤¥¢¥¨¨¥¤¦©¥¥¥¥¥¥¥¥¤¥§¨©¨§¦¦¦¦§§¨¨¨¦§§¨©ª«¬¬ª©©ª¬¨¨¨¨¨¨¨¨ª«¬«©¨©ª©ªªªª©¨§ªªªª©¨§¦¨ª¬¬¬¬®°¬¬¬®®°®«©©«®°®®¯°°°¯±²²±±³µ³²²±²³µ¶µµ´²²²²²³³³³³³³³³³³´´µµµµ´´´´´³³µ¶¸¸¸¸¹»¼½¾ÀÂÄÅÆÈÊÌÍÍÎÐÒÐÕÛÞÝÝßáãããääåååææçèèéêêééééééééèèèèèèèèééééééééééééééééééééééééêêêêêêêêêêêêêêêêëëëëëëëëëëëììíííííííííííîîîîîîîîîîîîîîîîîîïððñòòððððððððððððððððñòòòòñðïñòòòòóóóñóôóñðïððïíëééééèêèäáßÚÓÊýº¶²³·ÃÊÍÊÈÈÆÂÉÉÊÐÖÚÛÙÛÝßáââááããäåæææåéèèèèéêëéêìíîîíìíëèäáÞÝÜØÔÑÑÖÛÜÜÜÛÚÙØÙÛÛàãÜɸ¬¡˜“¢«ÊÞÔº“iO6,%eegimpsuyz|~€‚‚ƒƒƒƒƒƒƒƒ…††ˆ‰Š‹‹‰‰ŠŠŠ‹‹‹ŠŠ‰‰‰Š‹‹Ž‘““““““““””””””””•••––———––———˜˜˜˜˜˜™™ššššš›œœžžœ››šš››œžžœžžžžžžžžžžŸŸžžžŸ ¡ Ÿœ ¡¢££££¢¢££¤¤££¢Ÿ ŸŸ ¤§¥¥¦¦¦§§§¥¥£¢¢£¥¦¥¥¦¦¦§§§¥¨©¨¦¥§©§§§¨¨©©©««««««««©©©©©©©©¨¨¨¨¨¨¨¨ªªª©©¨¨¨ªªªªªªªª©¯®«¨¨ª¬®®¬¯¯¯®®¯¯¯°°±±²´´³²±±±²³²²±±²²³°°°±±±²²°±²³³³²²²²²³³´´´³´µ¶¶¶µµº¹¹¸¸¹ºº¿ÀÁÂÄÆÇÇÉÉÉÊÍÐÓÕÒÔ×ÛÝÞÞÞáâãäåæååååæççèééêêêêêêêêèèèèèèèèèèèèèèèèéééééééééééêêëëëêééèèééêééééééééììììììììììììììììììììììììííííííííîííííîïðïïïïïïïïðððïïîîîïððññððïððððððððñññòòóóóóóóóóóóóïïîíìëëêëêèæãáßÞÙÖÑËÆÂÀ¿ÁÉÒÓÍÈÈËÍÍÏÑÔØÛÜÛÜÝÞàáâãäåæççççæååæçèééêëëìììíííêìëåââßÛÜØÔÕÙÝÞÞßÞÛÚÚÛÞßàáÞÒÀ®¢ž”š«½ÏÜÈžxW>2#degjnrvxyz|~€‚‚‚‚‚‚‚‚„……‡ˆ‰ŠŠ‰‰‰ŠŠŠ‹‹Š‰‰‰‰Š‹ŒŒŽŽŽ‘’’’’’’’’””””””““””””••––•–––———˜˜˜˜™™ššššš›œœžžœœ››››œœœžžžžžžžžžžŸŸŸŸžžŸ ¡ ŸžŸŸ ¡¢¡¡¡¡¡¢¢¢¢¡¡Ÿ¡£¢¡ ¡££¤¤¤¥¥¥¥¦¥¤£¢£¤¥¥¥¥¦¦¦§§¥§©¨¦¥¦©¨¨¨©©ªªª««««««««©©©©©©©©¨¨¨¨¨¨¨¨©©©¨¨¨§§ªªªªªªªª¦©¬«ª«¬¬««««¬¬®®®¬¬¬¯¯¯°°°°°´³²±±±±±³²±±±±²³¯°°±²³³´±±²²²³³³²²²³³³´´²³´µµµµ´µµµµ¶¸¹º¾¿ÀÂÃÅÆÇÊÉÉÉËÍÏÑÕÕ×ÙÛÞàááâãäååååååææçèééêêêêêêêêèèèèèèèèèèèèèèèèéééééééééééêêêëëêééèèééêééééééééììììììììììììììììììììììììííííííííîííííîïðïïïïïïïïðððïïîîîïððññððïððððððððñññòòóóóóóóóóóóóóóòòñðïïíìëéçåäãâàÝØÔÑÎÍÍÒØØÕÑÐÑÕÕÕÕÖ×ÙÚÝÝÞßáâããääåæççææäååæçèèéëëëëììííëíìçääâÝÞÚÖÕØÝßààßÞÝÝÞßàáâßÔ𣜔™¨ºÌÜ̧^C5%dehkptxzyz|~€€€€€€€€€ƒƒ„…†‡ˆ‰ˆˆ‰‰‰ŠŠŠ‰‰‰‰‰Š‹Œ‹ŽŽŒŽ‘‘‘‘‘‘‘‘••””““’’’’““”””””•••–––—˜˜˜™™ššššš›œœžžœœ››œœ››œœžžžžžžžžžžžŸŸŸŸŸŸŸŸ ¡¡ ŸžžžŸ ŸŸ ŸŸ¢¥¥£¡ŸŸ¢¢¢¢£££¤¦¥¤£¢¢££¤¤¥¥¥¦¦¦¥§¨§¦¥¦¨¨©©©ªªªªªªªªªªªª¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨©©¨¨¨§§§©©©©©©©©¦¨ª«ªª«¬««©¨¨©««¬¬¬¬¯¯¯¯¯®®®²²±°°°°±²²±°°±²²°°±²³´´µ³²±±±³´µ²²²²³³³´²³´´µµ´´³³´µ¶¹º¼½¾¿ÀÂÃÅÅÊÉÉÈÉËÍÎ×ÖÖ×ÙÝáãááãäåååååååæçèèéêêêêêêêêèèèèèèèèèèèèèèèèééééééééééééêêêëêééèèééêééééééééììììììììììììììììììììììììííííííííîííííîïðïïïïïïïïðððïïîîîïððññððïððððððððñññòòóóóóóóóóóóóõõõôóóòòðïîíìëêêëëéæãàÝÜÛÜÝÞÝÛÙØ××ÖÕÕÖÖ×ÞßßàâããäãäåæææååäääåæçççêêêëëëìììïîéççåááÝØ×ÙÝàâáââããââáâãáØȵ¥›”–¢´ÇÛÓµhJ9'ghjmquxzyz|}€€‚ƒ„…†‡‡‡ˆˆˆ‰‰‰‰ˆˆˆˆ‰Š‹ŒŠ‹‹‹Ž••””“’’‘’“““”””•”””•••––˜˜˜™™ššš›››œœœœœœšš›œžžŸ ŸŸŸŸ ŸŸžžŸ ŸŸŸŸŸžžŸŸŸŸ¡¤¤¢¡¡¡¡¡¡¢¢£££¥¥¤££¢¢¢£¤¤¤¥¥¥¥¦¦§¦¦¦¦§§§¨¨¨©©©©©©©©©©©§§§§§§§§§§§§§§§§ªª©©¨¨¨¨¨¨¨¨¨¨¨¨ªªªª¨§§§¬«©§§©«¬¯¯¯®¬¬±°¯¯¯¯°°±±°°°°±±²²²²²³³³´³±°°²´¶±±²²²³³³³³´µ¶¶µµ¶¶¶·¸º»¼¼½¾¿ÁÂÄÄÉÉÈÈÉÌÎÏÖÖÖØÚÞàâàáâääååäääåæççèèééééééééèèèèèèèèèèèèèèèèèèèèèèèèèèéééêêêêééèèééêééééééééëëëëëëëëììììììììììììììììííííííííîííííîïðïïïïïïïïðððïïîîîïððññððïððððððððñññòòóóóóóóóóóóóôóóóòòññññðððïïïîîîíëéæäåâààââßÜÙÙØØÙÚÛÛßßààáâããããäåææååäääååæææééééêêëëíïïëéêéååáÜÙÚÝáããäæççæäãääãÜ먛•“¬ÀØÙĘqP=*kklnqtwxyz|}~€‚ƒ„…†‡‡‡‡‡ˆˆˆ‰‡‡‡‡ˆŠ‹Œ‰‹ŒŒ‹‹ŒŽ”””““’’‘“”””•••–”””•••––˜˜˜™™ššš››œœœœœœ››œœ™šš›œžž ŸžžžžŸ ŸŸžžžžžŸ ŸžžŸ Ÿ Ÿ £¦¡¡¡¢¢£££¤¤¤££¢¢¡££££¤¤¤¥¦¦¥¦¦¦¦¥¥¥¥¦¦¦§§©©©©©©©©§§§§§§§§§§§§§§§§««ªª©©©©¨¨¨¨¨¨¨¨ª©¨§§§¦¥«©¨¨©«®®®®®¬«««¯®®®®¯¯°°¯¯¯¯°°´³³²²±°°³²°¯¯±´µ±±±²²²³³´´µ¶··¶¶¸¸···¸¹º»¼½¿ÀÂÃÄÈÈÈÉËÎÑÒÒÔ×ÚÜÞÞßàáâãääääääååæçèèééééééééèèèèèèèèèèèèèèèèèèèèèèèèèèèéééêêêééèèééêééééééééëëëëëëëëììììììììììììììììííííííííîííííîïðïïïïïïïïðððïïîîîïððññððïððððððððñññòòóóóóóóóóóóóòòòòòñññññññññññîîïïîìêéìèääççåáâáàßßàààßßààáââããäåææææåäääååååæççèèééééìïïëëìëççåáÝÜÞáääæèêêèæäæåäßÔ¬ž—’˜¦¹ÓÜÏ£yVA.!llmoqsvwyz{}~~~~‚‚‚‚‚‚‚‚€‚ƒ„…†††††‡‡‡ˆˆ†††‡ˆŠ‹ŒŠ‹‹‹Ž’’’’’“““””””••––”•••–––—˜˜˜™™šššœœœœœœœœœ››šš››œššš›œœœœœœœœœœ ŸœœŸ ŸŸœœžŸ Ÿ ŸžžŸ žžŸ£¦ ¡¡¡¢¢¢¢¡¢££££¢¢¢¢¢£££¤¤§¥¤¥¦§¦¤¤¤¤¤¥¥¥¦¨¨¨¨¨¨¨¨¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ªªª©©©¨¨§§§§§§§§¦¥£¤¦¨¨¨¬«©©©©«¬¬¬¬¬¬¬¬«««««¬¬®¯°¯®®®®¯°³²²±±°¯¯±°¯¯¯°²³°±±±²²²²³´µ¶¶¶¶µ¶¶µ´´µ¶¶¼¼¾¿ÁÂÃÄÇÇÇÉËÏÒÔÐÒÖÚÜÝÝÜààâãääääãääåæçççèèèèèèèèèèèèèèèèèèèèèèèèçççççççççèèèééééêééèèééêééééééééêêêêêêêêììììììììììììììììííííííííîííííîïðïïïïïïïïðððïïîîîïððññððïððððððððñññòòóóóóóóóóóóóôôôôôóóóññññññññðñññðïîîïíêëííëèçæäâàÞÞÝáááââãããäåæççççæååååææææææçççèèèéííëêíìèéèæâßßâäåçéêêéçåçæäáÙȲ¡š’• ±ÌÛÕ°„]F2$jklnqtvxyz{}}~}}€€€€€€€€‚ƒ„…†‡……†††‡‡‡†††‡ˆŠ‹ŒŠŒŒŒ‘‘‘‘‘‘‘‘‘‘’’“””’’““””””•–––———˜˜˜˜™™šššœœœœœœœœšš™™™™šš›››››››œœœœœœœœœŸžœššœžŸžœ›š››œœœžžžžžŸœššœŸœžžŸ¡ŸŸŸŸ ¡Ÿ ¢£¤¤££¡¡¢¢¢£££§¥£¤¦§¦£¤¤¤¥¥¦¦¦§§§§§§§§¥¥¥¥¥¥¥¥¦¦¦¦¦¦¦¦¨¨§§§¦¦¦¦¦¦¦¦¦¦¦§¤¢¢¦¨¨§©©¨¨¨¨©©©©©ªª«««ªªªªª«««¬¬««¬®®¯¯®®¯¯®¯¯¯°°±±®®®®¯¯°°°°±±±²²²±²³³´´³³´´´´µ¶··¼½¾ÀÁÃÄÅÇÇÇÈÊÌÏÑÐÑÓÖØÚÜÝßàáããääãããäåææççèèèèèèèèèèèèèèèèèèèèèèèèççççççççççèèèéééêééèèééêééééééééêêêêêêêêììììììììììììììììííííííííîííííîïðïïïïïïïïðððïïîîîïððññððïððððððððñññòòóóóóóóóóóóóôôôôôôôôòòòòòòòòóóòñññññïîîïððîìëêèåãâááäääåååææåæçèèèèèççççææææååææçççççêëééìëèêêéæâàáäæçèééèçæéæãâÜÍ·¦“”«ÅØÖ¾fM6'hikmquxyyz{|}}}}‚ƒ…†‡‡………†††‡‡……††ˆŠ‹Œ‹ŒŽŽŒŽ‘‘‘‘‘‘‘‘‘“”••‘‘‘’’“““––———˜˜˜˜˜˜™™šššœœœœœœœœš™˜˜˜˜™šœ›››››ššœœœœœœœœž›™™›žœ›™™š››š›œœœœœš˜˜šœšŸ žœ››žžžŸŸŸ¡£¤¤¤£¡¡¡¢¢¢££§¤£¤¦§¥£¥¥¥¦¦§§§§§§§§§§§¥¥¥¥¥¥¥¥¦¦¦¦¦¦¦¦¦¦¥¥¥¤¤¤¦¦¦¦¦¦¦¦ª§£¢¤¦¤£¦§§¨¨§§¦¦§§§¨©©©¨©©ªª««««««««¬®¯®®®®¯ª«¬®°±³³¬®®¯¯®®°°°±±²²²¯°±±²²±±´´µ¶·¹»¼½¾¿ÀÂÃÅÅÈÈÇÇÈÊÌÍÒÑÑÒÕØÜÞßàáâããããããäååæççèèèèèèèèèèèèèèèèèèèèèèèèçççççççççççèèéééêééèèééêééééééééêêêêêêêêììììììììììììììììííííííííîííííîïðïïïïïïïïðððïïîîîïððññððïððððððððñññòòóóóóóóóóóóóòóóóóóóóôôóóóóòòôóòðððòòìíïððïîíñðïîîîïïçççççèèèæçèééééèèçççççççåååæææççåéêèèëëèêëìéäááãæççèèççæêæââÞк¨Ÿ”“›¨ÂÖÖȘlQ9)ijloswz|{{||||}}~~€‚ƒ„…†††ƒ„…†‡ˆ‡‡‰‰ŠŠŠ‹‹‹ŠˆˆŒŒ‹ŽŽŽ‘‘‘’’“““‘‘‘’’“““”””•••–––•–˜š›š™šššššššš››››››››™š›š™˜˜™˜—–—˜˜–”š™˜˜——˜˜˜˜˜———––———–––••˜˜————˜˜––——˜˜™™”•–˜šœžž ŸŸ ¡¢¡ ££¢¢¢£¤¥¥¥¤¤¤¤¤¤¡£¥§¨§¥¤¦¦¦¦¦¦¦¦¥¥¥¥¥¥¥¥¤¦©ª©§§§¤¢¡¡£¥¥¤¢¢¢££¤¤¤£££¤¤¤¤¤§¦¦¥¥¥¦¦¥¦§¨©©©©§©««ªª¬®¬¬¬¬©«®®®¯±³®¬«¬°±°®³³²±°°°±±°°¯¯°°±±²³³²±¯®´´´µ·¹»¼»¼½¾ÀÃÅÆÊÉÈÇÇÉÊËÐÐÑÓÕØÛÜÝßàßßàâääååææççèæææççèèèççççççççæççèèççæççççççççèèèèèèèèèèèèèèèèèèèééêêêééééééééëëëììíííêêêëëìììììììììììîîîîîîîîîîîîîîîîïïïïïïïïðððïïîîîððððððððñññòòóóóòòòòòòòòóóóóóóóóóóóóóóóóõõôóóòñññññððïïïíîîïïîîíééééééééééééééééééèèççççææåååæççççèèééêêèéêèæååæçëìéæèçäèáããÜÓÁ¦ š“–§ÀÓÛʨyT=+hiknrvy{{{||||}}~€€€‚ƒ„…………ƒ„…†‡ˆ‡‡ˆˆ‰‰ŠŠŠŠŒŠˆ‰ŒŽŽŒŽ‘‘‘’’’““‘‘‘’’“““”•••–––––•–—š›š˜šššššššš››››››››™™šš™˜˜™‘‘‘’‘ŽŽŽŽŽŽŒŒŒŒŽ‹‹ŒŒŽ‘”–˜šžžžŸ¡¡¡ ¡¡ ¡¢£¤££¤¤¤¤¤¤¢£¥§¨§¥¤¦¦¦¦¦¦¦¦¥¥¥¥¥¥¥¥¥¦§§¥¤¢¢›™™›œœ››››œœœœžžž ŸžžŸŸ ŸŸ¡¢££££¢¤¥¦¥¥§¨§§§§§§§§©«®®°±¯¬¯°¯±±°¯®®¯¯±°¯¯¯¯°±±±²²²±¯®³´´µ·¹»¼¼¼½¿ÁÃÅÆÊÉÉÉÊËÌÍÏÐÒÔÖÙÚÛÛÝàááâäæããäååæççæææçççèèççççççççæççèèççæççççççççèèèèèèèèèèèèèèèèèèèééêêêééééééééëëëìììííêêêëëìììììììììììîîîîîîîîîîîîîîîîïïïïïïïïðððïïîîîððððððððñññòòóóóòòòòòòòòóóóóóóóóóóóóóóóóõõôóóòñññññðððïïïðññññðïííííííííëëëëëëëëêêêééèèèèçææååååååææçççèæèéèæåæçèëìèæèçääÞáâÜÖÅ«¡›”–¤ºÏÚÑ°ƒ\B0!ghjnruxy{{{||}}}~€€€€‚ƒ„…………ƒ„…†‡ˆ‡‡‡‡ˆˆˆ‰‰‰ŒŠ‰Š‘‘‘‘‘‘‘’’’“‘‘‘’’“““•••––———–••—šš™—››››››››šššššššš™™˜—•’‹ŠˆˆŠŠˆ†‰‰ˆ‡‡‡‡‡‡‡‡†††……††………„„„ƒ‚‚ƒ‚‚‚ƒƒƒ„„‚ƒ„†‰‘“š›Ÿ žžžŸ ¡¢£¡¢¢£¤¤¥¥£¤¥§§¦¥¤¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¦¥¥£¡Ÿœ™–’‘“”•””””•••–––––——˜˜˜šš™™™™šš™š›žžž ¢¢¡¡£¥££££££¤¤¤§©ªªª¬°®®¯®¬¯®¬¬°°¯®®¯°°°±±±±°¯®³³³µ¶¸º»¼½¾ÀÂÄÆÆÇÈÉÊËÌÌÌÌÎÑÔÖØØØÖÚÞàáâäåââãääåææææææçççèççççççççæççèèççæççççççççèèèèèèèèèèèèèèèèèèèééêêêééééééééëëëëìììíêêêëëìììììììììììîîîîîîîîîîîîîîîîïïïïïïïïððïïïïîîððððððððñññòòóóóòòòòòòòòóóóóóóóóóóóóóóóóõõôóóòññññññðððïððññññððððððððððîîîîîîîîìììëëëêêééèçåääãââãããääääæççæåçèéëêçæèèäàÛßâÝÙʱ£ž—–Ÿ²ÉÙÙ¼‘hJ5%fhkosvxyzz{||}~~~€€€‚ƒ„„„„„ƒ„…†‡ˆ‡‡†††‡‡ˆˆˆ‹‹‹‹‘‘‘‘‘‘‘’’’‘‘‘’’“““••––————–••—™š˜—››››››››™™™™™™™™š˜•‘‰ƒ€}}~~}{}|{{zz{{zzzzyyyxyxxxwwwwuttssttuwwwwwwwwuuvy~„ŠŽ•˜œŸ ŸŸŸžžžžŸ¡££ ¡¢£¤¥¥£¤¥¦¦¥¥¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¥¤¢¡Ÿ™—’Ž‰††‡ˆˆˆˆˆ‰‰‰ŠŠ‹‹‹ŒŽŽŽŽŽ‘‘’“””””–˜šš™™›šš››œœ £¥¦¦¨©¯®¬«¬««¬¬¯¯®®®®¯¯¯°°°°¯¯¯²²³´µ·¹º¼½¿ÁÃÄÆÆÄÅÇÉËËÊÊÉËÏÓÖÖÖÖÓ×ÜßßßààáââäåææçååæææçççæææææææææççèèççæççççççççèèèèèèèèèèèèèèèèèèèééêêêééééééééêêëëëìììêêêëëìììììììììììííííííííîîîîîîîîïïïïïïïïïïïïïïïïððððððððñññòòóóóóóóóóóóóóóóóóóóóôôóóóóòòôôôóóòòòòòñññðððîîïïïïîîïïïïïïïïïïïïïïïïîîîîííìììëêéæäâáàáááááááâäåæååçééëéææèæâÞÙÝâßÜζ§¡š˜œ«ÄØÝÆžsQ:(gimquwyzzz{||}~~~€€~~‚ƒƒ„„ƒƒƒ„…†‡ˆ‡‡††††‡‡ˆˆ‹ŒŒŒŽ‘‘‘‘‘‘‘’’‘‘‘’’“““•••––———––•—™™—–šššššššš™™™™™™™™—”Œˆ‚{urpmlmmlklkjiiiijiihhhggggfffeeeedccbbccdeeddddddeegkr{ƒˆ•›ŸŸžžŸŸŸŸŸ ¡££ŸŸ ¡¢£¤¤£¤¤¤¤¤££¢¢¢¢¢¢¢¢¤¤¤¤¤¤¤¤¤¢ Ÿœ–’‡‚{vtuuvvvvwwwxxyyz{|}~~~~~~~€€‚ƒ„……„‡‰‹‹ŠŠŒŽŒŒŽ‘”˜¡£¥§©¬«ªªª¬¬«««¬¬®®®®¯®®®®¯¯¯±±²³µ·¸º»¼¾ÁÃÄÅÅÄÅÇÉÊÊÉÉÊÌÐÔÖ××ÖÕØÜÞÞÝÝÝááâäåæçèåååæææççæææææææææççèèççæççççççççèèèèèèèèèèèèèèèèèèèééêêêééééééééêêêëëëììêêêëëìììììììììììííííííííîîîîîîîîïïïïïïïïïïïïïïïïððððððððñññòòóóóóóóóóóóóóóóóóóóóôôôóóòòòôôóóóóòòòòòñññððîïïððïïîïïïïïïïïïïïïïïïïðððïïîîîîîíëéæãááááàààààáâäåäåçéèêèååçãÜÝ×ÜàÞÜиª£œ™›¦¾ÕÝͪ}W>*gjnrvxyzyzz{}~~~~}}‚ƒƒƒƒ‚‚ƒ„…†‡ˆ‡‡†††‡‡ˆˆˆ‹ŒŒ‹‹ŽŽŽ‘‘‘‘‘‘‘’’“““”””•••––—–•–˜˜—•˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜”‹ˆ„}tmeb_]^^^]]]\[ZZ[[ZZYYYXXXWWWVVVUUUUTTTTUUSSRRRQQQQRTZcoz€‹’šŸŸžŸ ŸŸŸ ¡¢ŸŸ ¡¢¢££¢¢¢¡¡¡¡¡¡¡¡¡¡¡¡£££££££££¡ŸŸž™‰€ypieeeeeefffgggiijklnnonnnnopqrrstuvvvvy{}}||~€~~€‚„……‰Ž–œ ¤§©©ª«ª¨§¨ª«ªªªª«¬¬®¬¬¬¬®®®¯°°±±²´¶¸¹¹»¾ÁÃÄÄÃÆÇÈÈÉÉÈÈËÍÐÓÕ××××ÚÝÞÝÜÝÞßàáâäåæçäåååææææååååååååæççèèççæççççççççèèèèèèèèèèèèèèèèèèèééêêêéééééééééêêêëëëëêêêëëìììììììììììììììììììîîîîîîîîïïïïïïïïîîïïïïððððððððððñññòòóóóôôôôôôôôóóóóóóóóõõôóóòññóóóóóóóóóòòòññññññòóóòññññññññññïïïïïïïïññðððïïïððïîëèåãããââââááàâääääæèçéçåååÞÕ×Ò×ÜÛÛй¬¢š™š£¹ÏÚѵ‰`D. fhmruwxxyyz{}~~}|‚ƒƒƒ‚‚ƒ„…†‡ˆ‡‡‡‡‡‡ˆˆˆ‰‹ŽŒ‰‰‹ŽŽ‘‘‘‘‘‘’’“““““““””••—–•–˜˜–”————————————————“Ž‡|rf]TPMKKLKKKKJIIIIIHHGGGFFFEEDDDCCCCBAAAABC@@@??>>>>?BITbow‡™Ÿžž Ÿžžžž ¡¡¢¡ ŸŸŸŸ £££££££££¡ Ÿ”ˆ~umaXSQQQQQQRRSSSUVWXYZ[\[[[[\]_`_`accddcfhjjiikmlmnprstuz€‰’˜¢¥¥§©¨¦¥§©¨¨¨¨¨©ª«¬««¬¬¬¬¯°°°±²³µ·¸·¹½ÀÂÂÂÂÅÅÄÃÃÃÃÄÇÈÊÌÏÑÒÓÓÖØÙÙÙÛÝÜÜÞßáãääääåååæææååååååååæççèèççæççççççççèèèèèèèèèèèèèèèèèèèééêêêééééééééééêêêëëëêêêëëìììììììììììììììììììîîîîîîîîïïïïïïïïîîîïïðððððððððððñññòòóóóôôôôôôôôóóóóóóóóõõôóóòññóóóóóóóóóóòòòññññòòóóòòñòòòòòòòòððððððððñññððïïïñññðîëçåææååäääãàâääããäææççååãÙÍÍÉÏÕ×ÙϺªž–—š ³ÈØÖ¿”iK5$dglqtvwwxyz{}~€}||‚‚ƒƒƒ‚ƒ„…†‡ˆ‡‡‡‡ˆˆˆ‰‰‰ŒŽŒˆ‡‰ŒŒŒŒŽŽ‘‘‘‘‘‘’’“““’’’“““””—–•–——–”––––––––————————•Ž„|sfWL@=9777778766556644433322111000//.--,,--./..--,,,126=JYgp…Ž™Ÿžœž Ÿžœœ›œœ ŸŸ¡ Ÿžžžžž ££££££££¤¢ Ÿ›ue\PE?==<<<<===>>@ABCEFGGFFFGHIJKKLMNOPOORSUUUUVXXYZ\^`abmt~ˆ–›ž¢¥§§¥¤§©¦¦¦¦¦§¨©¬¬««¬¬¬««¬¯°°°°±³µ·¸¶¸¼¿ÁÂÁÁÂÁ¿½¼½½¾ÁÁÂÄÇÊÌÍÍÏÑÒÓÕÙÜÙÚÛÝßàââäääååæææååååååååæççèèççæççççççççèèèèèèèèèèèèèèèèèèèééêêêéééééééééééêêëëëêêêëëìììììììììììììììììììîîîîîîîîïïïïïïïïîîîïïðððððððððððñññòòóóóôôôôôôôôóóóóóóóóõõôóóòññóóóóóóóóóóóòòñññïððññððïñññññññññññññññññññððïïïñòòòðìéæèèççææååáâääââãååççæåâÖÉÆÂÈÑÓ×Ϻ©›“•™ž¯ÃØÙÆœpQ9(hkqvxywvyz{|}~~}|}€€}|~~~€€€‚ƒ„…††††‰‰‰‰‰‰‰‰‰‰‰ŠŠ‹‹‹ŠŠŠ‹ŒŽ‘‘’’’”“’‘‘“•–’’‘’“•••••••••—––••””“™™™˜—–•”‘Ž…wk^M>2,)*)&%'########""""""""!.=Mbr‚Ž™›š›œ››››››››œžŸŸŸŸžŸŸŸŸŸŸŸŸžŸŸ ŸŸž££££££££œŸŸ™Žzh_N<2-(&'+++++,-.../001226666666666789::;<<=>?@AAEFGGGIMPYfs|‡”Ÿ£¤¥¥¥¥¥¦¦¥¥¦§¨ª¬«««ªªªªª¬¬¬¬¬¬¬®¯°±³´¶¶»¼½¾ÀÁÂÃÁÀ¾¹´±°°µµ¶¸º½¿ÁÁÄÇÈÉÊÍÏÑÒÕ×ÛÝàáääääååååääååæççèêèæåæçèèæçççææèêæææççèèèççççççççèèèèèèèèèèèééêêêèèèééêêêëëëëëëëëëëëëëëëëìììììììììììííîîîîîîîîîîîïïïïïïïïïïïððññññññòòóóóôôôôôôôôóóóóóóóóõõõôôóóóõõõôôóóóôôôóóòòòóòòññððïðññòòññððññòòññðòòòññððððñóõôñîìëêéçææææååååååååäããååÞÒÈÁÃÅÊÑÓɽ¬•—–—ªÃÕÞÊ°…XC,hkquxyxwwxyz{|{{}}}}€€€‚ƒ„††‡‡†‰‰‰‰‰‰‰‰‡ˆˆˆ‰‰‰‰‹ŠŠ‹ŒŽ‘‘‘’’‘’““””””’’’’’“””••••••••––••••””˜˜˜˜—–•”ŒrcUB3"(7I]m‚Ž™›š›œœ››››››››œœžŸŸžžŸŸŸŸŸŸŸŸžžŸ Ÿžž¢¢¢¢¢¢¢¢ ˜ygSA.#!!!!!!!!&&'()**+++,-.//0345557:>KYivƒ’¢¤¤¤¥¥¥¥¦¥¥¥¦§¨ª«©©©©©©©ª¬¬¬¬¬¬¬«®®¯±³´µ¶¶·¹¼¿ÂÄÅÁ¾¹²ª¤¡ ¢¢¤¦¨«®¯±´·¹º»¾ÁÃÄÆÊÍÐÓÔÙÙÚÚÛÜÝÝÞÞßàáââãæåäääåååèééèæåæçæææçççèèççççççççèèèèèèèèèèèéééêêèèèééêêêëëëëëëëëëëëëëëëëìììììììììììíííîîîîîîîîîîïïïïïïïïïïïðððñññññòòòóóôôôôôôôôóóóóóóóóõõõôôóóóõõõôôóóóôôôóóòòòòòñññññðñòóóóóòñðññòòññðòòòñññððòôö÷öóðîííëêééééææææææææçååææàÖÍÃÃÃÅÌÐËÁ°¡™š˜—§¾ÏÜϺ`H/ilquxyxwwxy{||||}~~~~}€€‚‚‚ƒƒ…†‡‡‡‡‰‰‰‰‰‰‰‰ˆˆ‰‰ŠŠŠŠ‹‹‹‹ŒŽ‘‘‘’‘“•–•“’’“””••””••••••••””••••––––———––•‘Œm\L8($4F[l‚Ž˜š™šœ››››››››››œžžžžžžžžžžžŸŸŸŸž Ÿ¡ —‹vdN;& "%(8H\m}›Ÿ£££¤¤¥¥¥¥¥¤¤¥¦§§¦¦¦§¨¨©©««««««««®¯°²´µµµ¶¸º½¿Á¾¹°¦›’Œ‰Ž‘”˜›œž ¤¦§ª°±³µ¹½ÁÄÅÊÊËÍÏÐÑÒÔÕÖ×ÙÚÛÜÞßàáââââãåççåäåæææææçççèççççççççèèèèèèèèèèèèéééêèèèééêêêëëëëëëëëëëëëëëëëììììììììììììíííîîîîîîîîîïïïïïïïïïïïïðððñññññòòòóóóóôôôôôóóóóóóóóõõôôôôóóõõõôôóóóôôôóóòòòññññòòòòòóôôôôóòññòòòòññòòòòñññðòôö÷öóðîðïîíììììééééééééëéçççãÜÕÍËÆÄÈÍÊô§™–£¶ÇÚÖÇžlP5jlquxyyxz{|}~~~~~~~~~~~~€€€€‚‚ƒ„…†‡‡‡‡‰‰‰‰‰‰‰‰‹‹ŒŒŒ‹‹‹‹‹ŒŽ‘‘‘‘’“”•”““’“•–—–•”••••••••“””••––—”••––––•’~kYH3#$5H^n‚Ž˜š™š›ššššššššššš›œœœžžžžžžžžžžžž ¢¡œ–‰taO;%*<Sfy‹˜œ¢¢¢£¤¤¥¥¥¤££££¤¤££¤¥¦§¨¨©©©©ªªªª¬®°±³´µ¸¹¹º»¼½½¹±¥˜Œ‚yuvwy{‚…‡‡‰’”˜›œ ¥©°²´µ·¹»¾¿ÀÃÄÅÇÉËÍÎÎÑÔÖ×××ØÙÜáãääæçååæææçççææææææææççççççççççèèèéééèèèééêêêêêêêêêêêêêêêêêêêëëëëëëëëëëìììíííííííííííîîîîîîîîîîïïïðððððñññòòòòóóóóôôôóóóóóóóóôôôôôôôôõõõôôóóóôôôóóòòòððññòóóóòòóôôóòòññòóóòññóóòòòñññðñóõôñîìðïîíííííììììììììîìêééçâßÛÙÒÍÍÎÊø«¡žš– ¯ÁØÚЪwY;kmquxyzyz{}~~~~~~~~~~~€€€€ƒ„…‡‡ˆˆ‡‰‰‰‰‰‰‰‰‹‹ŒŒŒŒŒ‹‹‹ŒŽ‘‘““’‘’“”•“”•———–•••••••••“””••––—“”••–••”‘Š|hVE2" %7J`q‚Ž˜š˜™š™šššššššš™™š›››››œœœœ¡¢¡œ•ˆr_L9# $7Ocw‰–š ¡¡¢£¤¥¥¤£¢¢¡¡¢¢¢¢£¤¥¦¦§§§¨¨©©ªª«¬¯°²³´¹¹º»»¼½½²©š‹~rhb\]^`cgjkmosvxz~‚„‡‹“–˜›œž¡¤¦¨©«¬®±´¶¸¹¸¼ÁÃÄÄÆÈÒÖÝáãäåæåååæææççææææææææçççççççççççèèèééèèèééêêêêêêêêêêêêêêêêêêêëëëëëëëëëëëìììííííííííííîîîîîîîîîîîïïïðððððñññòòñòòóóôôôóóóóóóóóôôôôôôôôõõõôôóóóôôôóóòòòñññòóóôôðñòòòòñðñòóóóóòñóóóòòòññðñóõôñîìîîíììììíííííííííïîìëëéçæäãàÚÙØÓ˽±¥ š—ž¨½ÕÙÕ´ƒbBlnquxyzzyy{|}}}}~~}}~~~~~€€„„†‡ˆˆˆˆ‰‰‰‰‰‰‰‰ˆˆ‰‰ŠŠŠŠŒŒ‹‹ŒŽ”“‘‘“•—“”•––––•••••••••””••••––“””••”““†wdRA/ %7J`q‚Ž˜™˜˜™˜™™™™™™™™—˜™šššš™œœœœœœœœ››œœ›› ¡ ›”‡q^K8# %7Ncv‰–šŸŸ ¡¢£¤¥£¢¢¡¡¡¢¢¢¢££¤¥¥¥¥¦¦§¨¨©©««¬®°±²³µ¶·¹»½¿À¯£‘oaTLEEFHKMPQUX[^_aegjknrvz|~„…‡Š’“”•˜›ž¢¤¥¥©®±±²¶ºÉÏ×Ýáâãääåååææææååååååååæææææææææçççèèèèèèèééêêêééééééééééééééééêêêêêêêêêëëëììììììììììììíííííííííîîîïïïïïðððñññññññòóóôôóóóóóóóóóóôôôôõõõõõôôóóóôôôóóòòòòòòòóóóóððñòòñððòòóóóóòòôóóóòòòòòôö÷öóðîìëëêêêëëííííííííîîíììëêêæèèåååàÚÈ»¬¢›˜œ£·ÏÖØ¿‘nKlnquwy{{yz{|}}}}}}}}€€€„…†‡ˆˆˆˆ‰‰‰‰‰‰‰‰‡ˆˆˆ‰‰‰‰ŒŒ‹‹ŒŒŽŽ’’’’““”•”””””•––••••••••––••••””””•””“‘‘Œ…vbP?,'9Lbs‚Ž˜™—˜˜˜™™™™™™™™–—˜™™™™™››››››››š›œœœœ›šŸ Ÿš”‡q^J9%%7Nbv‰—œžžŸ¡¢£¤¥¢¢¡¡¡¢££££¤¤¤¤¤¤¤¤¥¦§¨¨©ª«¬¯±²²´´¶¸º»½½¯ Šs_M=3//012568;=@BCEHJNOQUX[^_fgilnqstvxz~‚†ˆŠ‹•——™ ¥µ½ÈÓÚßâäääåååæææååååååååææææææææææçççèèèèèèééêêêééééééééééééééééêêêêêêêêêêëëëìììììììììììííííííííííîîîïïïïïðððñññððñòóóôôóóóóóóóóóóóôôõõõõõõôôóóóôôôóóòòòôóóóóóòòññòóóòññòóóôôóóòôôóóóòòòòôö÷öóðîêêéééêêëììììììììììííììììèëìééëéäÖǵ§˜›Ÿ®ÇÒÝÌ¡{Rmoqtwz{{{|}€€€}||}€€€€‚‚‚„…†‡ˆ‰ˆˆ‰‰‰‰‰‰‰‰‰‰‰ŠŠ‹‹‹Œ‹‹‹ŒŒŽŽŽ‘“••”“’•”“’’”•—••••••••—––••””“•••”“’‡wbP?, *<Odu‚Ž˜™—˜˜—™™™™™™™™–—˜˜™™˜˜››››››››š››œœ››šž žš“‡q^E5" %7NbvŠ™žžŸ ¢£¤¤¢¡¡¡¡¢£¤¥¥¤¤¤¤¤££¤¤¥¦§¨¨ªª¬¯°±²¶¶¶···¸¸° †lU@-!!"!#&((*-/3469<?ABHIKMPRTUXZ]`eikmquz{{† ©¹ÈÓÜáåäääååæææååååååååæææææææææææççèèèèèèééêêêééééééééééééééééêêêêêêêêêêêëëìììììììììììíííííííííííîîïïïïïïððñññïðññòóôôóóóóóóóóóóóôôõõõõõõôôóóóôôôóóòòòõôôóóòòñòóóôôóóòòóóôôóóòôôôóóòòòðñóõôñîìêêéééêêëëëëëëëëëêëíííìììíïîêéëêæàѼªž™š§ÁÐàÕ¬ƒWlosuvxz|{|}~~~~}€€€~€€‚ƒ„…†‡‡‡‡ŠŠŠŠŠŠŠŠŠ‰‰‰‰Š‹ŒŒŒ‘’‘‘’’’“’’’’“”•”••”’’”–—––––—˜™™—–”““”••”’’””’‘‹raO;');OduƒŒ””“”•“™™ššš›››˜™š››››š››››››››š›žž›š™šœœœœš™žœ›”ƒl\F5" $7Pcuˆ—žŸŸ ¡¡¢££¥¤¢ ¡¢£¥¤¢¡¡¢¤¥¥¥¤¥¦§¨©¨©ª¬®°±²¶¶¶¶·¸¹º¯Ÿ…kT>* !"#%&'(/02468::CDFIKNPQSVZ^^aly„š¯»ÈØáâãääååääãääääääääçççææåååæææææææææææççèèèêééèçççèêæåéëéèêééèêìííìéìîîíìíîííììëëêêìíïïïïñòïïïïïïïïîîîïïðððññòòòóóóóóóóóóóóôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôõõõôôóóóôóòóôóðíîêèêêèéíëëìíííììììììììììêëìíìëéèäÛǯŸš™—¦»ÍàÖ·”^mptvwxz|{|}}~~}}~~~~€€€€‚ƒ„…‡‡ˆˆ‡ŠŠŠŠŠŠŠŠŠŠŠ‰‰Š‹‹Ž‘‘‘‘’’’““’’““”••––•””•———––——˜™˜—•”““””•”’“””’‘‰p^L8%*<Pev†••”–—–˜™™™ššš›˜™š››››š››››››››››œœ››œžžžžœžœ›š“‚k[F4! $7Pcuˆ—žŸŸ ¡¡¢££¤£¢¢¡¡¡¢¥¤¢¡¡¢¤¥¦¦¦¦§¨©ª¨©ª¬®°±²µµµ¶¶·¸¹°Ÿ…kT>* "#%%)*+-/1338:>AACNZo‡¡³Ä×ãåãääååääãääääääääçççææåååæææææææææææçççèèèèèççææåäààäçåäæçæææçççæçéëëêéêëêêêêêëëëéëììëëíïîîîîîîîîîîîïïïððñññòòòóóóóóóóóóóôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôõõõôôóóóôóóóôóðííéèééçèìêëìíííììììììììììëëìíìëêéæÞ˳¢œš˜¢µÈßÚ¿gnquwxy{}{{|}~~}}}}}~~~~~€€€‚‚„„†‡ˆˆˆˆŠŠŠŠŠŠŠŠŒ‹ŠŠŠŠŠ‹ŒŽ‘‘‘’’’’““’’“”••–—˜—••—™——––—˜™™—–•”““““•”“”••’ˆ}m[H5" ,>Qfw‰‘–•”–˜˜—˜˜˜™™™š˜™š››››š››››››››››œœœœ››œžžœ›š˜‘€iYE4! $7Pcuˆ—žŸŸ ¡¡¢££¢£££¢¢¡ ¥¤¢¡¡¢¤¥§¦¦§§©ª«¨©ª¬®°±²´´´µ¶··¸°Ÿ…lU?*##&)()3>Xs’¨¾ÔáäããääääããääääääääææææååååææææææææææææçççèççççåãáàÞÚÛàäââãææææååååçéëëêêêìéêêëìííîëìîíììíîííííííííîîîîïïïðððñññòòòòòòóóóóóôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôõõõõôôôôôóóôôóðîíèçèèåæêêëìííííìììììììììëììììëêééâѹ§Ÿœ™¯ÁÜßʪtprvxxy{}z{|}}}}|}|||}}~~€€€€‚ƒ„…†‡ˆˆˆˆŠŠŠŠŠŠŠŠŒŒ‹ŠŠŠŠ‹Œ‘Ž‘‘‘’’’““”““““”•––—˜–••—˜˜————˜™š—–••”“““•””•–•“ˆ}kXE2! .@Shx‹’–”“–™™———˜˜˜™™˜™š››››šœœ››››šš›››œœ›››››››››››œš™—~gWD3 $7Pcuˆ—ž ¡¡¢¢¢¡¢£¤¤¢ Ÿ¤££¢¢££¤¦¥¥¦§¨©ª¨©ª¬®°±²²³´µ¶¶¶¶°Ÿ†lU?+%/Kgˆ¢¹ÐÝßâãääääãâääääääääæåååååååååååååååååæææççççççåâÜ×ÔÐÍÎÔØ××ÙÞßàáàáâããæèéèèéëèèééêëëìêìííëëìíììííííîîííîîîïïïïðððñññññòòòòóóóóóóóóóóóôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôõõõõõõõôôôóôõôñîìèæççäåèéêëìííííííííííííììììëëêêêæÖ¿«¡œ™›ªºØâÔ·‚psvxxy{|z{||}}||}||{|}~€€‚ƒ„…†ˆˆ‰‰ˆŠŠŠŠŠŠŠŠŒŒ‹ŠŠ‹‹ŒŽ‘‘Ž‘‘’’’“““””““””•–•–—–””–˜˜˜——˜˜™š———–•”““”””–—–“‰|iUC0 0CUjz‹’–”’•˜˜———˜˜˜™™˜™š››››šœœœ››ššš›››šš››››››››››››š™–}fUC2 $7Pcuˆ—ž ¡¡¡¡¢¢¡¢£¤¤¢ Ÿ££££££££¤¤¤¤¥¦§¨¨©ª¬®°±²²³´¶¶¶¶¶± †lU@+%Daƒž·ÏÜÞââãääãââäääääääääååååååååååååååååååæææççèèæâÚÐÆÀ¹¶¶»¿¿ÀÃÉÌÏÑÒÔ×ÚÚÝàââãåæåååææççççèééèèéêìììííîîïíííîîîïïïïïïðððñðññòòóóóóóóóóóóóôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôõõõõõõõöõôôôõôñîìèæçæãäçéêëìíîîîííííííííììëëêêêêêèÛÅ°£™œ¨¶ÔâÚÂpsvwwxz{zz{|||||}}|{|~€‚ƒƒ……‡ˆ‰‰‰‰ŠŠŠŠŠŠŠŠ‹‹‹‹‹ŒŽ’’’’“““””””””•––•––•””•—˜˜˜˜˜™šš˜˜˜˜—–•”””•—˜–“‰|hS@. 2EWl{‹’—•“•—–—˜˜˜™™™š˜™š››››šœ››š™™››šššš››žœœžœš™–Ž}fUB1 $7Pcuˆ—ž¡¡¡¡¡¡¡¡¢£££¢¢¡ ££££££££££££¤¥¦§¨©ª¬®°±²²³µ·¸··¶± ‡mV@,">[›µÏÞáââããããââääääääääääääååååäääääääääåååææææèçäÜξ°§¢œ›Ÿ¢¤¦«¯³¹¼¾ÁÆËÎÑÕØÙÛÞàááâãäåæææèêêééëíêêëììííîìíííîîîîîîîïïïðððððñòòóóòòòòòòòòôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôõõõõööööõôôõöôñïíéæçæãäçèéëìíîîîîîîîîîîîíìëêêêêëééàÊ´§Ÿšœ§²ÐßÜËpruvvwxzyz{||||{~}||}ƒ‚‚ƒ„…†‡ˆ‰‰‰‰ŠŠŠŠŠŠŠŠŠŠŠŠŒ‘’’’“““””•””””•–—–—˜—••—™™˜˜˜˜™š›™™šš™˜–•””•—˜—“‡zeO<*!3FYm}Œ”™˜–—˜–˜™™™ššš›˜™š››››šœ››š™™››š™™š››žžœœžž›™—}fUA1 $7Pcuˆ—ž¡¡¡¡¡¡¡¡¤£¢¢¡¡¡¢¢££¤¤££¢¤££¤¤¦§¨¨©ª¬®°±²²´¶¸¹¹·¶± ‡mV@,"<Y{—²ÌÜàáââããââáääääääääãããääåååääääääääääåååæææèæßÔÁ¬˜†|~„ˆ•›Ÿ ¤ª°µ¸½ÁÃÆÊÌÑÒÔÖÙÜÞßáãæææçêìççèéêêëëììíííîîîííîîîïïïïïðñòòóóòòòòòòòòôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôõõõöö÷÷÷õõôõöõòïîêçèçääçèéêìíîîîîîîîîîîîíìëêéêëëêìäк«¢žš¤°ÌÜÝÒªortvvvwyyz{||||{~}|}€‚„‚‚ƒ„…†‡ˆ‰Š‰‰ŠŠŠŠŠŠŠŠ‰‰‰ŠŒŽ‘’‘ŽŽ‘’’’““”””•””””•–—˜™™˜––˜š™˜˜˜˜™š›šš››š™—–””–˜™—“†xbL9(!4GZn}Œ•œ›™™™—™™ššš›››˜™š››››šœ››š™™œ›™˜˜™›œœœš™™šœœ›š—}fUA0$7Pcuˆ—ž¡¡¡¡¡¡¡¡¥¤¢ ¡¢£¢££¤¤££¢¥¥¤¥¦§¨©¨©ª¬®°±²³´·¹º¹¸·²¡‡mV@,!=Y{•®ÈØÜáââããââáääääääääãããääåååäääääääääääååæææçäÜι Š|le_adglrrx‚ƒ†“—› ¥¨¬°³¹»¾ÂÆÊÍÏÖØÛÜÜÞàâäååæçèééìììííîîîíííîîîïïîïððñòóóòòòòòòòòôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôôõõõöö÷÷÷öõôõöõòïïêèéçääèèéêìîîïïîîîîîîîîîíëêéêëìëîçÔ½®¥ ˜£®ÊÚÝײqrtwy{{|yz{||||{||}~€‚‚„ƒƒƒƒ„…†„…‡ˆˆ‡…„ˆ‰Š‹‹‹‹ŠŠŠ‹ŒŒŽŽ‘‘‘‘‘’“””•–“““““”•–•˜˜•–šœ™ššššš›™™›š––˜™›š˜™š”‹…vbO:& $4H^rŽ”—––™™—™˜˜˜˜™š›››››››››œ›™˜™›ž››››››››žœ™—~fT=-$8Qdvˆ–œ¡¢¤¥¤¢ ŸŸ ¡¡¢¢¢£££££££££¥¦¨¨§¦¤¥¨ª¬¬°²´µ¶·¸¸¸¸±¢‰qZC. #9Ty—±ÈÙâããããããããããããããããáãäæåäâàåååäääããââãäååæçèâÝ˪x_RKFHKNRWWZ^djptw{}†Œ‘•—ž¡¥©¬±·»¿ÂÆÉÌÐÔ×ÛÛàèëééëéëííìììíîîïïïðððïïïððñññóóóòòñññóóóóóóóóóóóóóóóóòòòóóóôôôôôôôôôôóôôõõôôóõöö÷÷ööõ÷÷÷÷÷öôôðíéçççæåèêìîïïïïïïïîîíííîíìëëëëìèêçÙÄ°¥¡Ÿ§»Ôá×Æqrtvyz{{yz{||||{||}~€‚‚„ƒƒƒƒ„…†††‡‡‡‡††‡ˆ‰‰ŠŠ‰‰ŠŠ‹ŒŽŽ‘‘‘‘‘’““““““”–—˜•˜˜––›œš›ššš››œ™™›š––™™›š˜™š“‹ƒs_L8$ &6J`t€•˜—–™š˜™™˜˜™šš›œœœœœœœœœ›š™™›ž›››››››››™–}eS=-$8Qdvˆ–œ¡¢£¤¤¢ Ÿ ¡¡¡¢¢££££££££££¦¦¥¥¦¦§§¨ª®®°²µ´µ¶¸¸¹¹¸²¢ŠqZC. #8Tx–°ÇÙâããããããããããããããããàáãååäâáåäääãããâââããäåææéãÝɦˆmR>5..0148;=AEJORT[]agmrvy~…‰’˜œ£§¬°³¸¼ÀÈÊÑÝäåçêéëííìëìíîîîïïïððïïïðððññóóóòòñññóóóóóóóóôôôôôôôôòóóóôôôôôôôôôôôôóôôõõôôóõöö÷÷ööõö÷÷÷÷öõôðíêèèèçæèêìîïïïïïïïîîíííîíìëëëëìéëéÝɶ©£žŸ¦¸ÑàÙËprtvxyzzyz{||||{||}~€‚‚„ƒƒƒƒ„…†‰ˆˆ‡‡ˆˆ‰†‡ˆ‰‰‰‰ˆŠ‹‹ŒŽŽŽ‘‘‘‘‘’’“““““”–˜™š–™™–—›œš›››š›œœš™›š—–™š›š˜™™“Š€p\I6" (9Mbv‚–™˜—šš˜š™™™™š›œœœœœœœœœœ›š™™›ž››››››››œš˜–{cR=-%8Qevˆ–œ¡¢£¤¤¢ Ÿ¢¢¢¢££££££££££££¨¦¥¤¤¦©ª¨ª®¯°³µµµ·¸¹¹¹¹³£‹r[D. "7Rv•®ÆØáããããããããããããããããßàâãääãâäãããâââáââããäåååçâÝÉ¥…gJ6+!"%&(+.135:<@FKQUW[_cglqw{€„‰Ž“˜ž¢©ºËØÞäééëííìëìíííîîîïïïïïïïðððñòòòòññññóóóóóóóóôôôôôôôôóóóôôõõõôôôôôôôôóôôõõôôóõõööööõõöö÷÷÷öõôñîëéééèçéêëíîïïïïïïîîíííîíìëëëëìêíìâѽ®¦ŸŸ£³ÌÞÝÔpqsuwxyyyz{||||{||}~€‚‚„ƒƒƒƒ„…†‹Šˆ‡‡ˆŠ‹‡ˆ‰ŠŠŠŠ‰‹‹ŒŒŽ‘‘‘’’“““””•••““”•—™›œ—šš—˜œ›œœ›››œœš™œ›——™š›š˜˜˜’‰~nZG4!):Ndxƒ’—›™˜››™ššššš›œœœœœœœœœœ››ššš›œœœœœœœœœ›š˜•‹xaQ=,%9Qew‰–œ¢¢£££¢¡ ££££££££¤¤¤¤¤¤¤¤¦¦¥¥¦§©ª¦©«¬®±³µ¶·¸¹¹¹¹´¤Œs[D. !6Qt“¬ÅØáããããããããääääääääÞßáâãäããããâââáááâââããääåäàÞͪ‹lN;." "#$%&(+/369;?CGKOTZ^`djpu{€…‰ ·ÊÖàèèêìíëëëíìíííîîîîîîïïïðððòñññññññòòòòòòòòòòòòòòòòóóôôõõõõôôôôôôôôóôôõõôôóôõööööõôõö÷÷÷öõõòïìêêêéèééëìíîïïïïïîîíííîíìëëëëìêìíæØų¨ Ÿ¡ÅÚàÜpqsuvwxxyz{||||{||}~€‚‚„ƒƒƒƒ„…†‹Š‰ˆˆ‰Š‹‰Š‹ŒŒŒ‹‹‹‹ŒŽŽ‘‘‘’’’”””””•••“””–—šœ˜šš˜™žœœ››œœžššœ›˜—šš›š—˜˜‘ˆ}mXF3!);Oex„”™œš™›œ™››šš›œœœœœœœœœ››››››››šššš››œœœœœœœœœšš™•Šw`Q<, %9Rew‰—££££¢¢¡ ££££££££¤¤¤¤¤¤¤¤£¥¦¨©©©¨§©¬¯±³µ¶·¹¹ºº¹¶¥t\E/ 4OrªÃ×àããããããããääääääääßàáâãäääããâââáááâââããããäâààЮpR;- !#$%')-037<?CGMRV[adjr†¡ºÌÛæèêììëêëìììììíííîîîîïïïðððñññññññòòòòòòòòòòòòòòòòóóóôôõõõôôôôôôôôóôôõõôôóôôõööõôôõõö÷÷÷öõôñíëëëêéééêëìíïïïïïîîíííîíìëëëëìêëìèÝË·ª¢ Ÿ¨½Ôàápqrtuvvvyz{||||{||}~€‚‚„ƒƒƒƒ„…†Š‰‰ˆˆ‰‰ŠŠ‹ŒŒŒŒŒŒŒŽ‘‘‘‘’’’“’’’’““““””••—™›œ˜››˜™žŸžžœœœœž›šœ˜—šš›™———‡{kVC1 *<Qfy…•›ž›šœœšœœ››œœž››››››››ššš››œœœš››–Šv`R<+ &:Rfw‰—£££¢¢¡¡¡££££¢¢¢¢¥¥¥¥¥¥¥¥¢¤§ª«ª©¨©¬®¯°±´¶¶¶¸¹ºººº·§Žt]E/!3MpŽ¨ÂÖàããããããããååååååååâââããäååäãããâââáâââââãããäâáÑ®ŽnP;,!"$(*+.269<@CMVkŠ¨ÀÕãçéììëêëìëëëìììíííîîîïïïïððððññññññññññññôôôôôôôôòòòóóóôôôôôôôôôôóôôõõôôóôôõõõõôôôõö÷÷÷ööõòîìììëêéééêëíîïïïïîîíííîíìëëëëìêêêèàм¤¡ž£¶ÎÝâoprsuuuuyz{||||{||}~€‚‚„ƒƒƒƒ„…†ˆˆ‰‰‰‰ˆˆ‰Š‹ŒŒŒŒ‹ŒŒŽ‘‘‘’’’““““““““““••••–—™š™œœ™šžŸŸžœœœœœž››œ˜˜šš›™———‡xhS@.,?Ti|‡–œŸœ››œœœœžŸžžžžžžžžœœœœœœœœ™š››œœœœ›œœ—Šv`R;+ &:RfxŠ—ž¤£¢¢¡¡¡¡££¢¢¡¡¡ ¥¥¥¥¥¥¥¥¤¥¦¨©ªª«ª¬®°°²´¶¶·¸¹ºººº¸¨u]E/!1LnŒ§ÁÕàããããããããååååååååääääääåååäääãããâââââââââçäãÒ¯pQ>. #!$%&'*,2;Rt—µÏàçéëìêêêìêêëëëìììííîîîïïïïïïððñññññññññññññññññññññññòòóóôôôôôôôôóôôõõôôóóôôõõôôóôõö÷÷÷÷ööóïíííìëééééêìîðïïïîîíííîíìëëëëììëêéãÔÀ±¥¢ž °ÈÚàoprstuuuyz{||||{||}~€‚‚„ƒƒƒƒ„…††‡‰ŠŠ‰‡†ˆ‰Š‹‹‹‹ŠŒŒŽŽ‘‘‘’’“““–••••••••••••–˜˜™œœ™šž ŸŸžœœœœœŸ››œ˜˜šš›™——–†vfQ>,.AVk~‰—Ÿœ›œœœžŸŸŸŸŸŸŸŸŸ™š›œœœœ››˜Šv`S;+ &:SfxŠ˜ž¤£¢¡¡¡¡¢¢¢¢¡¡ Ÿ¥¥¥¥¥¥¥¥§¦¥¥§©¬®¨ª¬®®¯²´¶·¸¹º»ºº¸¨u]F/!1Kn‹¦ÀÕßããããããããååååååååçæååäååååååäääããââââââââçåäÔ²“uW@/ "$ *BfŒ®Ëßçéëëêêêëêêêëëëììíííîîïïïïïïððñññññññññññííííííííðððñññòòôôôôôôôôóôôõõôôóóôôõõôôóôôö÷÷÷÷÷öóïîíííëééééêìîðïïïîîíííîíìëëëëìîìêêåØô¦£žŸÄ×ßpqstuvvvxyz{|}}}z{}‚‚‚ƒƒ„……†‡‡‰‰‰‰‰‰‰‰‹‹‹‹‹‹‹‹ŽŽŽŽŽŽŽŽŽ’’‘“““““““’––•–—˜™šš›œžŸŸ ŸŸŸžžžžžœœœ™šš™›™udO<+ !2DWkžžžžžžžžœœœžž ŸžžžžŸ ž›œŸ¡››œžŸŸœœœœœœœœœžœ”‰x`M;+%9RfxŠ˜Ÿ¢¢¢¡¡ Ÿ¤¤¢¡¡¡¡¡£¤¥¦¦¥£¢¦¦§¨ª«¬¬««®°±²³²´¶¸º»¼¼²¦u^I2!,Gj‰¤¾ÓÝâãäååååäååååååååååååååååååååååååããããããããâàáÓ³•vXB1! $(:Z§ÇÝâèìêêëëèêêêëëììììíîïïïïîîîîïïðððóïîñóñïíííìêêíïîðïïðòóóòóòðñòôôóñððñóôôóõôôõö÷øùöööööööööóîìëìëêêéèçèéêëîîîîîîîîìííííìëêíéíîæÞÍ´¨¥Ÿ¨½Óápqstuvvvxyz{|}}|z{|~‚ƒƒƒ„……†‡‡ˆ‰‰‰‰‰‰Š‹‹‹‹‹‹‹‹ŽŽ‘’’””””““““––––—˜™ššš››œŸŸŸžžžžžœœœš›š™›˜€sbM:) !3EXl‚žžžžžžžžžžžŸŸŸ ŸŸŸŸ ¡ŸœœŸ žžžœœœœœœœœœœœžœ”‰w`M;+%9Rfx‹™Ÿ¢¢¢¡¡¡ ¤£¢¢¡¡¡¢¢¢£££¢¢¡¦¦§¨©ª«¬«¬®°²³³´µ¶¸¹º»»´¨‘w`K4",Fjˆ£¾ÓÝâãäååååäååååååååååååååååååååååååããããããããäâãÕ¶˜y[C2" !%6W~£ÅÚâèìêéëëèêêêëëììììíîîïïîîîîîïïïððóñððïìèæèæãáâåççéééêìíííïîîîðñòòø÷÷÷÷÷ööõôôôõö÷øööööööööôñíêêêéèéèçççéëìîîîîîîîîìííííìëêíéíîçß϶¬§Ÿœ¥¹ÐÞpqstuvvvxyz{||||{{{{}‚ƒƒƒ„……†‡‡ˆˆˆ‰‰ŠŠŠ‹‹‹‹‹‹‹‹‹ŒŒ‘“’‘“•””””••••––––—˜šššš››››››ŸŸŸžžžžžœœœš››šš˜Œ€p_J7& "4GYnƒ‘žžžžžžžžŸŸŸ ¡¡¡¢¡¡ ¡¡¢¢¡Ÿœžž¡¡ Ÿœ›šœžœ”ˆw_L:*&:Rfx‹™Ÿ££¢¢¢¡¡¡¤££¢¡¢¢¢££¢¢¢££¤¥¦§¨©ª««¬¬¯±²³´¶¶·¸¹ºº»¶ª“xaL5#+Eh‡¢½ÒÝããäåååååååååååååååååååååååååååååããããããããæãäغœ}^E4" "2QxžÁ×áçëêéëëèêêêëëìììììíîïïîîîîîîïïïðòòòðîêæãâÝØÖØÛßáâãäæèêìíëììíîïðñððððððïïõõôôôõö÷ööööööööõòîëëêéèèçæåæéëíîîîîîîîîìííííìëêíéíîçáÒº°© ›¢´ËÛpqstuvvvyz{|||||{zyy{~„ƒƒ„……†‡‡‡‡ˆ‰‰Š‹‹‹‹‹‹‹‹‹‹Š‹Œ‘’“’‘‘‘’”•”••••–––—––——™š›œœœ›››››ŸŸŸžžžžžœœœ›œ›šš—‹o^H5% "5I[p…“ŸŸŸŸŸŸŸŸŸŸ ¡¡¡£¢¢¡¡¢¢££¡ ž¢¡ Ÿžœœžžžž›žœ”ˆw_L9)&:Sgy‹™Ÿ£££££¢¢¢¤££¢¢¢££§¦¥¤¤¥§¨¥¦§¨©ª«¬¬®°±³´µ¸¸¸¸¹¹º»¸«”ybM6$*Dg…¡¼ÒÝãäååææååååååååååååååååååååååååååääääääääæãåÙ½ €`G6$ .Lr™½ÔàçëééëëèêêêëëìììëìíîîîîíííîîîïïïïòóñðíèâÓÊÁÀÃÇÍÑÒÕÙÝàäèëæèêêêëìíðñóóóóõöööõõõõööõõöööö÷÷øõñïîíëêçæääåèìîííííííííìííííìëêíèìîèäÖÀ²©ŸšŸ®ÆÙpqstuvvvyz{|||{{{zyy{~„ƒƒ„……†‡‡ˆˆˆ‰‰ŠŠŠ‹‹‹‹‹‹‹‹Š‹Œ‘’‘’“”“’’”””••–––————˜™š›œœœŸŸŸžžžžžœœœœšš—Š}n]G4$#7K^r‡”ŸŸŸŸŸŸŸŸŸŸŸ ¡¡££¢¢¢¢££¢¢¡ŸžžŸŸŸŸŸŸŸŸ ŸŸžž››“‡v_K8(&:SgyŒš £££££¤¤¤¤££¢¢£¤¤§¦¥¥¥§¨ª¦§¨©ª«¬¬®¯±²´µ¶¹¸¸¸¸º»¼¸¬•ybL5#)BeƒŸ»ÑÝãäåææææåååååååååååååååååååååååååääääääääæãäÚ¿£‚aJ8% +Gm”¹ÐßæêééëëèêêêëëìììëìííîîíííííîîîïïîòóñðíâÖ¹«Ÿ ¤«²¶»ÂÈÍÓÚßÞáåæææèêìîððîîðòõõôôôõö÷õõõöö÷÷÷ùöóñðîëéçåãâäçëîííííííííìííííìëêíèìîéçÛų©žš©ÀÖpqstuvvvzz{||{{z{{{{}‚ƒƒƒ„……†‡‡‰‰‰‰‰‰‰‰‹‹‹‹‹‹‹‹‹ŒŒ‘Ž’””“‘“““”•–––————˜™››žžŸŸŸžžžžžœœœžžœšš–Š|l[E2#$8M`tˆ– ŸŸŸ ¡¡¡£¢¢¡¡¢¢£¡¡¡ ŸŸžžžžŸ ¡¢¢£¡¡ Ÿžž››“‡v^K7(';ThzŒš ££¤¤¤¥¥¥¤££££¤¥¥¤¤¤¤¥¦§¨¨¨©ª«¬®®¯°±³µ¶¶¹¸··¸º¼¾¹•zbM5#'AcºÑÝääåæççææååååååååååååååååååååååååååååååååæãäÜç…cL:& )CgŽ³ËÞåéèèëëéêêêëëìììëëìíííííìíííîîîîïòòïîéÖÁ¤‘{}~…•›¤«±¸ÁÇÏÕÛÞßáäèçêìëèçéìñññòòôõöôôõöö÷øø÷õòðïìéççåãáâæêíìììììììììííííìëêíèëîêéß˵ª œ›£¹Ðpqstuvvvz{{||{{zz{|~‚ƒƒƒ„……†‡‡‹‹Š‰‰ˆ‡‡‹‹‹‹‹‹‹‹ŽŽ‘‘‘‘‘‘’’“”••–˜——˜˜š›œ›››œžžŸŸŸžžžžžœœœžŸšš–‰|jXB0 %:NbvŠ— ¡¡¡¢¢¢£¢¢¡¡¡¡¢¢ ŸŸžŸŸ ¡¢££¢¢¡ Ÿžžšœš“‡v^K6'';ThzŒš¡¤¤¤¥¥¥¦¦£££££¤¥¦££¥¦§§§§©ªª¬®¯¯¯¯°²´µ¶·¸¸··¸»¾À»¯˜|dN7$'@b€œ¹ÑÝäåææççææååååååååååååååååååååååååååååååååèäæÞÆ«‰fN;' &>aˆÆÞäéèèëëéêêêëëìììêëìííííìììíííîîîïòðîïéϲ–~g_^\ainu†‹’›¢«³½ÃÇËÑÖàåéêèéíòìììíïñòôôôõöö÷øøøõóñïíéæèæãàáäèëìììììììììííííìëêíèëîëëâϹ£žš±Èpqstuvvv{{|||{zzz{}‚‚‚ƒƒ„……†‡‡ŒŒ‹Šˆ‡††‹‹‹‹‹‹‹‹ŽŽŽŽŽŽŽŽ‘ŽŽŽ’“‘‘’“”••˜˜˜˜™š›œ˜™™š›œžŸŸŸžžžžžœœœŸŸ›š•ˆ{hV@-%:OcwŠ˜ ¢¢£££¤¤¤¢¡¡ ¡¡¢ŸŸ ¡¡¡ ¡¡¢¢¢£¢¡¡ Ÿžžšœš’‡u^K6'';ThzŒ›¡¤¤¤¥¥¦¦§£££££¥¦¦¤¥¨©ªªª©ª««®¯°°¯°±²´µ··¸·¶·¹¼¿Á½±™~fP8&&@a›¸ÐÝäåæççççæååååååååååååååååååååååååååååååååéåçàÉ®ŒhO<' #:\ƒ©ÂÝäèèèëëéêêêëëìììêëìííííììììííîîîîðïïóîÑ°ŠoUKFBENMT]chnw~ƒŒ˜¡¦µ»ÁÇÎÒÓ×Þäçèèêìîðñôôõöö÷øøúøõôòðìééçãààãçêìììììììììííííìëêíèëîëìäѼ°¥ ™™«Ásstuuvww{{{{{{{{{|~€€‚„…††ˆˆˆˆˆˆˆˆŽŒ‹‹‹‹‰Š‹’’‘‘’‘’”••”“––—˜™™š›™™™šš›››››œžŸŸžžžŸŸ ¡ ›”…wfR:))>Sgz‹•ž ¢££¢¡¤¥¥¦¦¥¥¤¢¢¢££¤¤¤ŸŸ ¡¡ Ÿ¢¡¡ ¡¡¢ ŸŸŸžžžž›–Št[J6'(<Ui{Žœ¢§§§§§§§§¥¥¦¦¥¥¤££¥¨ªª¨¦¥©«¯±¯°²´¶¸ºº¹º»¼½¾½½¾´gP8'$;]}™´ÎßãåççåääåååååååååææææææææææææææææååååååååäåæâÒ³ŽtU<+#!#0Sz ÀØåçåëëèëêêêêêêêêëëëëëëëëîííííîïðòôíòíäÚ¶“pUG94649:=BIPW[emv}‚ˆ’™ž¦±ºÀÇÐØÚáèììíðôòô÷ø÷ö÷÷ööööóïìéææåãâãçêéêêëëêêéëëìíííììèëíëììæßŲ¤¡›˜¦¼sstuuvww{{{{{{{{{|~€‚„…†‡ˆˆˆˆˆˆˆˆˆ‹‹Š‰‰‰ŠŠ‰Š‹Ž‘‘‘‘‘‘‘‘‘’”••”””••–—˜™™™™™ššš››››œœžŸŸžžžŸŸŸ ¡Ÿœš”…vdQ9(*>Th{‹–žŸ¡¢£££¢¤¤¥¥¥¥¤¤¢¢¢££¤¤¤ ¡¡¢¡ ¢¡¡ ¡¡¢¡¡ ŸŸŸŸ Ÿœ•ˆsZJ6''<Ui{Žœ£¦¦¦¦¦¦¦¦§§§§§¦¥¥¦¦§§¨¨¨¨©«®°²°±²´¶¸º»¸¹¹º»»¼¼¾´ž‚hQ9("8Zz–±ËÝãåççåääåååååååååææææææææææææææææåååååååååååâÓµuV=,#"".OušºÖäæåëëçëêêêêêêêêëëëëëëëëîííííîïððóíóïèྙuYJ:45222247;?ACJSZ_enu~…˜ž§±¹ÁÈÓÝãçêëñô÷ø÷ö÷÷ö÷÷öóðìêåååãáâæèééêëëêééêëìíííììèìíëììçßʶ§¢›–¢¶sstuuvww{{{{{{{{{|~€‚ƒ„…†‡ˆˆˆˆˆˆˆˆˆˆŠ‰‰‰‰‰Š‹‰Š‹Ž‘’’‘‘’“”•””””••–——˜™™™™ššš››››œžžŸžžžžŸŸŸ Ÿœ™“„ubO8'+?Ui|Œ—Ÿ ¢£¤¤¤¤££¤¤¤¤££££££¤¤¤¤¡¢¢££¢¡¡¢¡¡ ¡¡¢¢¢¡¡¡ £ œ”†qYI5&';Ui|£¦¦¦¦¦¦¦¦¨©©©©¨§¦©¨§¦§¨ª«ª«®®®°²±²³µ·¹º»»º¹¹º¼½¿¿µŸ„jR;)4Uv“¯ÉÙãåççåääåååååååååææææææææææææææææåååååååååååãÕ¸’wY?-$"!+Jn“´ÒâæåëëçëêêêêêêêêëëëëëëëëíííííîïïîòíôñìèÇ¡|^M<43010/../12/4:?AFLQ[aiqx‹“ ¨¸ÌÞéëéðóöø÷ö÷÷÷÷÷÷ôðíêååäâàáäçèéêêêêéèêêëìííììéìíëëìçàн«£š”®sstuuvwwzzzzzzzz{|~€‚ƒƒ„…†‡‡‡‡ˆˆˆˆ‰‰‹ŠŠŠ‹ŒŽ‰Š‹ŽŽŽŽ‘““’Ž‘‘’“””••••––———˜˜˜™™™ššššš›œžžžžžŸŸŸŸ ž›˜‘‚s_L5%,AWk}Ž˜¡¡¢£¤¤¥¥¢££¤¤££¢£¤¤¤¤¤¤¤££¤¤¤£¢¡¢¡¡ ¡¡¢£££¢¢¡¡¡¥¢œ“…oXH4%';Ui|ž¤§§§§§§§§©©©©©¨§¦¨¨¨¨©ª«¬ª¬®¯®¯±³²³´¶·¹º»¿¾¼¼¼¿Áÿµ¡†lU<*2Rs‘®ÇØãåççåääåååååååååæææææææææææææææææææææææææååäؼ–{]C/%! (EiŽ°ÎßååëêçëêêêêêêêêëëëëëëëëííììííîïíñìóðíëͦbP=43/21000122146767:<BFKPV^hnzƒ—µÔéîìðòö÷÷ö÷ø÷øø÷õñíëæåäáßàâåèèééééèèééëììíììéììëëìèâÖ亂”›¨sstuuvwwzzzzzzzz{|~€‚‚‚ƒ„„……‡‡‡ˆˆ‰‰‰ŠŠŠŠŠ‹‰Š‹ŒŒŽ’“’‘‘’’“”••———˜˜˜˜˜˜˜˜™™™šššš››œžžžžžŸŸžŸ™—€q\I2#!.CXlš¡¢¢¢£¤¥¦¢££¤¤££¢¥¤¤¤¤¤¤¤¤¤¤¤¤£¢¡¢¡¡ ¡¡¢££££¢¢¡¡¥¢œ“„oWG3$';Uj}Ÿ¥©©©©©©©©¨¨©©¨§¦¦¦¨ª¬¬««¯°¯°²´´´µ·¸º»»À¿¾½¾ÀÃÄ¿¶¢ˆnW>,1Pq®È×ãåççåääåååååååååæææææææææææææææææææææææææåååÛÀš~aF2& &Be‹®ÉÜäåëéæëêêêêêêêêëëëëëëëëíììììíîïîñìñíëìЫ†fS?53/......//223210122468<BHLS[o”½Üéêïñõ÷öö÷øøùùøöòîìçæåâßßáäççèèèèççèèêëììììêììêëíêäÚdz¦œ—œ¥sstuuvwwyyyyyyyy{|~€‚‚‚ƒƒƒ„„††‡ˆˆ‰ŠŠˆˆˆ‡ˆˆ‰Š‰Š‹ŒŒŒŒŒŒ‘‘‘’’‘’“”•–˜˜˜˜˜˜˜˜—˜˜˜™™™™™šš›œœžžžžžžœ˜•ŽoXF0!"/DZn‘œ¡¡¡¡¢£¥¥££¤¤¤¤££¥¥¥¥¤¤¤¤¤¤¤¤¤¢¡ ¢¡¡ ¡¡¢£££¢¢¡¡¡£ ›“…oWF2#';Uj}‘ ¦ªªªªªªªª¨©©©©¨§¦¦¨¬¯°¯«¬®°°°±³´µµ¶¸¹º»¼¾¾½½¾¿ÁÂÀ·¤ŠqY@-0Mo®È×ãåççåääåååååååååææææææææææææææææçççççççççååæÞÄžeI4' #=_†ªÄÙäæêéæëêêêêêêêêëëëëëëëëììëëìíîîíñëïëéìÓ²ŒkWB74//..--,++-..//0110001358:=ASw¦Íãëîñôööö÷øùùúùöóïìéèæãàßáãææçèèçææçèéëììíìêììêëíëåß͸©Ÿš£sstuuvwwyyyyyyyy{|~€ƒƒƒ„„„„…††‡ˆˆ‰ŠŠ‰‰ˆ‡‡‡ˆˆ‰Š‹ŒŒŒŒ‹Ž‘‘’’‘‘’”•–——————————˜˜˜™™™™™š›œœœœžžžž›˜”}nVD.#1E[o‚’¡ ¡¢¤¥¤¤¥¥¥¥¤¤¦¦¦¥¥¤¤¤¤¤¤¤£¡ Ÿ¢¡¡ ¡¡¢¢¢¢¢¡¡¡ ¡Ÿ›”†pWF1#';Uj~‘ §ªªªªªªªªªªª«ª©¨¨¨©«¯¯¯¯¬®°±±±³µ¶¶·¸¹º»¼¾¾¾¿ÀÁÁÂÀ¸¥‹rZA..KlŽÇÖãåççåääåååååååååææææææææææææææææçççççççççååçàÇ¡„hL5' !8X£À×ãæêèåëêêêêêêêêëëëëëëëëììëëììíîìðêîêêðØ»•s]F95/0000/..----.01113223455478De“Àßííðôööö÷øúúúù÷óïíêêçäààáäåæççççæåæçéêììííêììêëîëæåÓ¼« ›œ sstuuvwwyyyyyyyy{|~€„„…………††††‡ˆˆ‰ŠŠŒ‹Š‰‰‰‰ŠŠ‹ŒŒŒ‹‹Ž‘’“’‘‘’”•—––––––––———˜˜™™™™™š››œœœœžžž›—”Œ}nUC-$1F\p‚“ ŸŸ ¡£¥¤¥¥¦¦¥¥¤¦¦¦¥¥¤¤¤¤¤¤£¢¡ŸŸ¢¡¡ ¡¡¢¢¢¡¡¡ Ÿž›•‡pWE1" ';Uj~‘ §©©©©©©©©«¬¬¬¬«ª©««««¯±²¯±±±±³µ¶·¸¹º»»¼¿ÀÁÃÄÄÄÃÀ¸¥Œs[B/-Ik¬ÆÕãåççåääåååååååååææææææææææææææææçççççççççååçáÉ£…jM6(!4Szž¾ÖãæêèåëêêêêêêêêëëëëëëëëìëëëëìíîëðêîëìóÜÛxaH:4.+,-/0000/.--./.-2112442154<X…µØêíðóõöö÷øúúûú÷ôðíëëèäáàâäåææççææåæçèêëìííêììêëîìçé×À¡œ›ttuvvwxxyxxwwxxy{|}€„„„……†††ˆˆˆ‰‰ŠŠŠ‹‹‹‹‹‹‹‹Š‹ŽŽŒŒŽ‘’“”‘’’’’’’’—––––—˜™™˜————˜™™™™šššš›››œœžžžŸžš•ŠwfQ?+ 3J^r†•œ¤¢ ¡¤¥£ ¤¤¥¥¦¦§§¦¦¥¤£¢¡¡¦¥¤££££££¢¡ ££¢¢¡¡ ¢£Ÿ’mVD/" ';Ti}‘¡©«««¬¬©©ªªªªªª¬¬®¯°°°±²³µ¶·¸·¹¼½½½¾ÀÀÀÁÂÄÅÆÆú§t]D1+HmŒ¤¿ÖáãææååæçççççççççäåçèèçåäååååååååææææææææäææåãÓˆmP8) 0Kq™ºÏäëèçéëéééêêëëëììììììììììììììììëîïíîïêä̤y`O>32.--,,--....//000//01123313:Ns¤Ñêêîóõôôöùùùùùú÷óðîìèåâààßåéêçæèêèççèéëìíííííììëëëêÙŶ¨œ˜œttuvwwxxyxxwwxxy|}~€‚‚‚„„………†††ˆˆ‰‰‰ŠŠŠ‹‹‹‹‹‹‹‹‹‹ŒŽŽŽŽŽ‘’“””“’‘ŽŽ””““”•––š™˜˜˜˜™š™™šš›œœœžžŸŸŸžžœ—‘†raN<( &8Nat‡–œ¥£¡¢¥¦¤¢¥¥¥¦¦§§§§§¦¦¥¤££¤££¢¡¡¢¢¡ ŸžžžžŸ¤¤¤££¢¢¢¥¦¢•ƒnVC/! ';Ti}‘¡©««¬¬¬¬¬¬«ªª©©®¯°±²²´´µµ¶¶··¸º½¾¾¾¿ÀÀÀÁÂÃÅÅÆû¨Žu]D2*Eh‡ ¾×áãææååæçççççççççååççççååååååååååææææææææäææäãÔ¯‹pS;+ /Io–¶ËáéçæèééééêêêëëììììììììììììììììëîïíîïëäЪdR@52.--,,--....///00//011233348Ik›ÊæéîóõôôöùùùùùúøôðîìèäááááäéëèæéêéçèéêëìíîíííììëëëëÛɹ«ž›tuuvwxxxyyxxxxyy}~‚ƒƒƒ„………††††ˆ‰‰‰ŠŠŠŠ‹‹‹‹‹ŒŒŒ‹‹‹ŒŽŒŽ‘‘’––•”“’‘‘•••••–—˜™™˜——˜™™˜˜™š›œœžžžžŸŸžžœ—‘†sbL:%):Pcv‰–œ¥£¢£¤¥¤¢¤¤¤¥¥¥¥¦§§¦¦¥¤¤¤§¦¥¥¤¤¥¥££¢¡¡¡¡¢¤££££¢¢¢£¥¡•„oVC/" ';Ti}‘¡©«¬¬¬¯¯®¬«ª©®¯°²³´µ········¸»¾¿¾¾ÀÁÀÀÁÂÃÅÅÆŽªw_E2 (Ac‚½×áãææååæçççççççççåææççææåååååååååææææææææäæåääÖ²tV>. -Ej‘°ÆÞæååçèééééêêêëëëëëëëëëììììììììëîîííïëåÖ²‡jVC62.--,,--.....///0//011233645B`Ž¿àçìòõôôöùùùùúúøôñðìçãàáâääéëèçêëéèèéêìíîîíííììëëëìßξ®¢žuuvvwxyyzyxxxxyz~‚ƒ„„„………†††‡‡‰‰‰ŠŠŠ‹‹‹‹‹ŒŒŒŒŒ‹‹ŒŽ‘ŒŒŽ‘‘’’“”””••””••–—˜—––––—˜––—˜™š›œœœœœœœš›˜”†tdL:%(9Nbv‹˜¤£££¤¤¤££££¤¤¤¤¤¥¥¥¤¤£££§§¦¥¥¥¥¥££¢¡¡¢¢£¢¢¢¢¡¡¡¡ ž“ƒoVC0#';Ti}‘¡©¬¬¬®®¯¯¯®¬¬®¯°²´µµ¶····¸¸¸¸º½¾¾¾¿ÁÀÁÁÃÄÅÆÆÇ¿¬“yaG3!'@cœ»Õáãææååæçççççççççææææææææææææææææææææææææäæåäåض”xZ@0 *@cŠªÁÚåååçèèèéééêêêêêêêêêêêëëëëëëëëëîîìíïìæÛºpYE71.--,,--.--.../////011233633<U€µÜäêñôôôöùùùùúûùõòñíçâßàâäãèëéèêëéèéêëìíîîíííììëëëëâÓÁ±¤Ÿžuuvwxxyyzzyxxyzz~ƒ„„…………†††‡‡‡‰‰ŠŠŠ‹‹‹‹‹‹ŒŒŽŽŒ‹‹ŽŽŽŒŒŽŽ‘‘‘‘’““—––••––—––—˜™™šš››››››››˜˜”‰€n^K8$(8MbxŽ›Ÿ¤¤¤¤¤£¤¤¤¤¤¤¤£££¤¤¤£££¢¢££¢¡¡¡¡¡ŸŸžžžŸŸ ¡¡¡¡¡¢¢¢Ÿ¡ž“‚nUB/! ';Ti}‘¡©¬¬®®®®®¯¯°°®¯°±³´´³´µ¶·¹ºº·º½¾½½¿ÀÁÂÃÄÅÆÇÈÉÁ¯–|cH4"%@dƒœ¹ÒáãææååæçççççççççææææææææææææææææææææææææäåääæÛ»š{\B1 ':\ƒ¤½ØäæçèéèèèéééêêêêêêêêêêëëëëëëëëëííëìïíçßÁ—u[G80.--,,--.---...////0112335219LsªÖâèðôôôöøùøùúûúöóñíçáÞßáâáçêèèêêèèèéêìíîîíííììëëëêä×IJ¦ vvvwxyyzzzyyyyzz~‚ƒ„„„††††‡‡‡ˆŠŠŠŠ‹‹‹Œ‹‹ŒŒŽŽŽŽŒŒŒŽŽŽ‘‘‘‘’““•”““““”••••––––—˜˜————––š™•Ž‡|jZH7%,;Ncy˜›Ÿ¡¢¡ Ÿ ¡¡¡¡ Ÿ ŸŸ¢¡ ŸŸŸŸ žžžžžŸ žŸŸŸŸ £¤Ÿ‘€kTA.! ';Ti}‘¡©®®®¯¬¬®¯°±²¯¯°±±²³³³³µ¶¸¹»»¸»½¾¾¾ÀÁÃÄÅÆÇÈÉÉËñ˜~dI5##?c‚›¸ÐáãææååæççççççççççææååææçççççççççææææææææäåääæÞ¿Ÿ~_E3!!%5V|ž¸ÕãæçéêçèèèééééééééééééêêêêêêêêëííêìïíèãÇŸz_J:0.--,,--.,---....//0112334117EfËßæïôôôöøùøùûüú÷ôñíçáÝÜÝÞÞåéèçééæççèéêìíííííììëëëéçÜȵ©¡vvwwxyzz{zzyyzz{}~€‚ƒ„„„†††‡‡‡ˆˆŠŠŠ‹‹‹ŒŒ‹‹ŒŒŽŽŒŠ‰Œ‹‹ŠŠ‰‰‰‹‹‹‹‹ŠŠŠŒŒŒŽŒŒ‹‹‹‹ŒŒŽŽŽŽŽŽŽŒŒ’’‡‚yhXH9*#!&2?O`s„“•—–”“•———––•••”––––––––›šš™˜˜™™™™˜˜™š›œ–———˜˜™™ž˜‹{iTC3%';Ti}‘¡©®®®¯¯®¯¯°°²²²²³³³³¶¶·¸¹º»»»½ÀÁÁÁÂÃÅÅÆÈÉÊËËÌųš€fJ5$"<^}—¶ÐáãææååæçççççççççççååååççççççççççææææææææäåãäçࣂcH5#!"1Qw˜³Ñáåæèèççèèèéééèèèèèèèèêêêêêêêêëíìêìïîéæͦ€cN>3.--,,--.,,---...//0112334127?ZŽ½Þåîóôôöøøøùûüû÷ôðíçáÝÚÙÙÜâçææèèåææçèéêëìíííììëëëêêá̸¬¤žvvwxxyzz{zzyyzz{}~‚ƒƒƒ†††‡‡ˆˆˆŠŠŠ‹‹ŒŒŒ‹‹ŒŽŽŽ‹‰‡……„„ƒ‚‚‚~~€‚ƒ„„‚‚ƒ„„ƒƒ‚‚ƒƒ„‡‡†……„ƒƒ……„„ƒƒ‚‚€€~zwqcTK=0++)((&&&&&&&&''''''''((((((((((((((((((((((((&##%%$(.5@N\lz€ˆŠŒ‹ˆ‡‰ŒŒŒ‹‹ŠŠ‰‰ŒŒŽŽŒŒŒŒŒŽŽŽŽ‘’ŽƒvgUF9,';Ti}‘¡©®®¯¯¯®®®®®®®®µµµ´´´³³ºººººººº½ÀÂÃÃÃÄÆÆÇÇÉÊËÌÌÍÆ´›gJ6$!8Yx”µÑáãææååæçççççççççèçåääåçèççççççççææææææææäåãäçáÄ¥…fK8%!!/Nt”¯ÎßãåçççççèèéééèèèèèèèèêêêêêêêêëíìêëïîêéѪƒfRA5.--,,--.,,,--...//0112334237;R„³ÜäíóôõöøøøùûüûøõïìçâÝÙ×ÖÚáææåççäååæçèêêëíííììëëëëíäÏ»¯¦Ÿtuwxyzzz}}|{{{||€€€‚ƒ…†ˆˆˆˆˆˆˆˆ‰‰Š‹‹Œ‘ŒŒŽ‘’‘‹†ƒ‚‚‚zvy{yxywwwwwwwwwwwvvvuuuuuuttsswwwwwwwwutttsssrqtrmki`UHC<64456235666545555555567778888776556777777777777653467=DO[fovz|{{zz{{|zzzzzzzz|||}}}~~~~~~~€€€€€€€€‚…ƒ~ui\QJ73,'%$$$$$###$$% *<Tixˆš§¦§©«¬««ª®®¯¯°±±±±²´´³²´µ´µ·¹º»¼¼¿ÁÃÄÄÄÇÉÄÅÈÊËÊÉÈÏǵœƒiM7$!6Vt±ÍßãåããæçäææææææææççççççççççççççççççççççççêäæèåâË©kN=)$-Hl±ÎÜæåãêèèèèèèèèééééééééèèèééêêêëëëëëëëëéÖ±ˆhSB61,*-.+)*+++,,---///001110555;Hs¨Ìïèóîùø÷üøöøüýùõõñéß×ÓÓÕÔÞççäååäåæèèçèéëéëííìììíêìçÙð¥¡tuwxyzzz}||{{||}€€‚„…†‡‡‡‡‡‡‡†‰‰ŠŠ‹ŒŽŒ‘‰„€~}xqlnpnlmkkkkkkkkjjjjiihhhhgggfffggggggggffffeedddgfba`YPNKGDBCCCABCCDDDCFFFFFFFFDDDEEEFFEEDDDDEEFFFFFFFFEEECBBBCFJPW\aeglkkjjkklllllllllllmmmnnnooooopqrppppqqrrqqrrrssswvrlcYQLB>:644443322233400000///.---,,,,*)))((('''&%%$##!"#!"%2AVgt›Ÿ ¢££¢¢£££¤¥¦¦¦ª¬®®®¯±²³µ·¹ººº½¿ÁÂÂÃÅÇÃÅÈÊÌÌËÊÌÅ´œ„jN8(4Ut‘³ÏàåçååèéæççççççççççççççççççççççççççççççççêäæèåâÍ«lO=)"*EiŠ¬ÉÙäåäëèèèèèèèèééééééééèèèéééêêëëëëëëëëè׶nWD61,*-.+)++++,,---///0001115448CjœÄéäñíøø÷ûøöøüýùõóïçÝÔÏÍÍÓÞççääãáàáâãäæèêéëííìëìíêëèÚŲ¦¡tuwxyzzz}||{{|}}€ƒ„……………………††‰‰‰Š‹ŒŒŽŒŽ‹†|wtkb]^_][\ZZZZZZZZZZYYXXXXWWVVUUUUTTTTTTTTTTTSSSRRSUUSTVSNSSTUUUUUVUUUVVWXYYYYYYYYVVVWWWXXYXWWWWXYZZZZZZZZXXXWVTSRQQPQQRSTVVUUUUVVXXXXXXXXXXXXYYZZ[[[[[\]^\\\\]]^^^^___```cb`]YTQNIHGFEEEFCCBBABBCAA@@??>>>===<<<;9999887766543322/00/--/0=HXdnw‚ŠŽ‘’“’’–——˜™š››Ÿ¡¢¢£¥§©ª¬®¯°±±´¶¸¹¹º½¿¼¾ÁÃÅÆÆÆÇÁ²œ„kP<) 2Rr±ÌÞäèææéêèççççççççççççççççççççççççççççççççéåçèæãЯ‘nQ?* (@dƒ¦ÄÖãåäëèèèèèèèèééééééééèèèèéééêëëëëëëëëçÙ¼—u[E61,*,-*)++++,,---////000136335<^Œ¹ááðì÷øøúøöøûüùöóïçÞÕÎÉÇÓÝæçåãàÜÙÙÚÜßãçééëííìëìíëëèÜɶ¨¢tuwxyzzz||{{{|}~~€‚ƒ„„……………††††ˆˆ‰Š‹‹ŒŒŒŽŽŒ‰…~vnh]UNNOLKLIIIIIIIIJJJJIIHHGGGFFEEECCCCCCCCDDCCCBBBCDDEINQQVZ`dffeehgfffgijhhhhhhhhhhhiiijjlkjjjjkllllllllljjiihea^XTOJHGFECCBBBBCCEEEEEEEEEEEFFFGGIIHHHIJKIIJJJKKKLLMMMNNNNNMMNOPQQSVWWWWXUUTSSSSTSRRQPONMNNNMMMLLLLLKKKJJHHGGFEDDBBBA@?@@HOXahov{|}~€€‡‡ˆ‰Š‹ŒŒ‹Ž’’”–™™šœžŸ ¡¡£¦¨©ª«°®°³¶¸º»»¿»®™ƒlS@.%0OoŒÆÛâçæåèéèèèèèèèèèççççççççççççççççççççççççéåèéæåÓµ•rUA+ &=_€¢ÁÔãæäêèèèèèèèèèèèèèèèèççèèèéééêêêêêêêêèÜÀ›y^H92-*,-**,+++,,---..///000252258T}®Ûßñìõö÷ùø÷ùûüú÷õñêâÛÔÍÉÒÜåçåãÞØÒÑÒÕÚáåèèêìíëëëíëëèßϼ¬¢tuwxyzzz{{{{{|}~~ƒ„„„„……††‡‡ˆˆˆˆ‰‰Š‹ŒŒŽŒŒŒˆƒ{pd[PG@@@>=>::::::::::9988887766555544444444433322222137=EOU[cmtvvvvzyxwxy{|yyyyyyyy{{{|||}}~~}}~~~~~~~~~~}||}|wpk`WLB<85311000011222222222233444466556788667788889:::;;;<<;<?DKQU^cjmnmnnlkjiiiiihhgfedccccccbbaaaaaa```_]]\\[ZZYYYXWWVTSSUY]bfikllmmnopprstuvxyyz}‚ƒ†‰‰ŠŒŽ‘‘‘”–˜š›œŸ¡¡¢¥§ª®¯±®¤’~kVG91+*(%%($$$#""!!""! -Lm‹«ÄÙâèçæèêêèèèèèèèèççççççççççççççççççççççççéæèéææ×»›wYD. $:[ ¾ÓãæãçèèèèèèèèèèèèèèèèçççèèèééêêêêêêêêêÞÞ{_J<3-)+,**,+++,,---...///00131367Mq£ÔÝñìóôõø÷øùûûúùõñëæáÛÔÏÓÜäæåäÞ×ÏÍÌÏ×ßäçèêììëêëììëéâÕ¯£tuwxyzzz{{{{|}~}ƒ„„„ƒ……††‡ˆˆˆ‡ˆˆ‰Š‹‹‹ŒŒŽŒŒ†€whXLA8100../++++++++'''&&&%%%%%$$$############"""!!!!!)2=LXgp}…ˆ‡‡ˆ‹ŠŠŠ‹‹ŒŽŽŽ‘‘‘‘‘‘‘‘‘‘‘‘‘Šyh\I9.'! !!""""##""#$$%##$$$%%%&&&'''((**,1;HT[iq{€€€}||{{|zzzyxxwwwwvvuuuusrrrqqqpoonmmlkklkiiiheb`^[ZZZXWZZZZ[\]^`abceghhgjlnnpsuwyz|~€€‚„‡‰‰‹Ž‘’“–™›ž›š“„vi[PD>;:844833210/../.-,*)('%%$#"! +KmŒ¬Å×áééçéëìççççççççççççççççççççççççççççççççéæééçèÛÀ |]H1"! "6V{»ÑãæãæèèèèèèèèççççççççæçççèèèèééééééééëáÈ£~bL?3-)++**-+++,,----...////121475Ff•ÊÙïêñóõö÷øùúúúúöñêæãßÙÔÔÛâäååàÙÐÌÊÍÕÞäæçéììëêëììëéäÚȲ¤tuwxyzzz{zz{|}~}~„……„ƒƒƒ„…†‡‡ˆ‡‡ˆ‰ŠŠ‹‹Œ‹ŒŽŒŽŠƒ|q`L>1( !*8K\r|Š’”””•——˜™™™™™šššššššššššš››œœœœ››œœŸŸŸŸŸŸŸŸ ŸŸ ™„o_H4&&5GWau‹’“‘‘‘ŽŒŒŒŒŒŠŠŠ‰‰‰ˆˆ†††………„„„ƒƒ‚€€€€~||}{wtoh^VQKD?CBBBCDFGKKLNPQSSQSVWWX[]_`bdegggilopqsvxyz{}ƒ…ƒulg`ZTQPQNJILIIHGEDCCCBA?=<::87653211,,+*)(''&&%$#"! ##0Mn‹ªÁÒÝææäåèéççççççççççççççççççççççççççççççççéæêêçéÞÅ¥aK3% 2Qu–¶Íâæãæèèèèèèèèççççççççææçççèèèééééééééêãͪ…fN?4-)*+)*-+++,,-----...///120472>Z…¾Òìèðòõõ÷ùúúúúûùóìçåâÜ×ÕÛáãåæâÛÔÎÊÌÕÞãåçéëìêêêììëéçÞ̵¤tuwxyzzzzzz{|}~|~„……„ƒ‚ƒƒ„…††‡‡ˆ‰‰Š‹‹Œ‹ŒŽ‹ˆym[E6&(7M`x‚™š™š›œŸ ŸžžŸŸŸ ¡¡ ¡¡¦¦¦¦¦¦¦¦§¦¦¨§ “ˆraI3% 1FZfƒŽ›££¡ ¢¡ žžžŸŸŸŸŸŸœœœ››››››šš™™™™™˜˜—–••”’‘‹†yo`TJ@6/10//02354568:;==@BDEEFHJJKMOPQRRTVY[\^acdeegikmnpsqkfec`gefhe``caa`^][ZYYXWUSQPONMLJIGFFCCB@>=<;:9875422/-7Qn‰¥»Ë×ááßàãäææææææææççççççççççççççççççççççççéæêêçéßǧƒcM5&!.Mo‘±ÊàçäçèèèèèèèèççççççççæææççèèèéééééééééäÒ±‹jO>4-)*+)*-+++,,------..///22036/8Rz¶Ìéæïó÷õ÷ùúúúûûÿ÷ïêèåßÚÖÛàâåçäÞÖÐËÌÕÞãåçéëëêêêëíëéèà϶¤stwyz{zzyyz{}~€€€‚‚‚ƒ„†…„„…‡‰‰ŠŠŠ‹‹‹Š‹ŒŽŠˆ€seT?-*:N`y†“—˜™š™Ÿ ¡ žžŸ ŸŸžžžžŸŸ ŸŸ£££¢¢¡¡¡¨¦¤£¤¦©«¥¦¥¤¤ “†uaG2#/D\nƒ“£¨§¦¦¥§¦¦¥¥¦¦§¤¥¦¦§§¦¦¥¨ª©§¦¨«¥¥¦¦¦¦¥¥§§§§¨¨©©£¥¥££¤ šˆu_N@1% %%%%%%%%**+-/01266789::;@@BDFHIJLMNOQRST[YZ^`ciqsz~|{}}z{ywusrsspppomkihhgda^]]]]\ZXUSQQONMKIGEECBK_v‹¢´¾ÉÔÙÚÛÜÜØÜáäääããççççèéêëéèæåååæçèèèéèèçæçäèçäèàʪ„eR:)",HmŽ®ÇßçåèèèèèèèèèèèèççæææèèèèèèèèééééééééêáÕ¸ŽpZD8/))+))*,,,--......//000102324=HpžÆéåòîóóõøùùùúüøõðëæâàßÜÝàãææäá×ÕÒÑÔÚàåæèêêééêëïëéêäÒº©suwyzzzzyyz|}~€€‚‚‚ƒ…††……†ˆˆ‰‰‰ŠŠŠ‹Š‹ŒŽŽ‰‡qcR=,+;Pay‡•™™››™œž ŸŸž ¢ ŸŸŸžžžžŸ ¡ £££¢¢¡¡¡£££¤¤¥¥¦¦§¦¥¥¡”†s^E0!0D\oƒ“£¨¦¦¦¥¦¦¥¥¥¥¦¦¦§¨¨©©¨¨§©«ª¨¨ª¬©ªª««ªª©«««¬¬¯¯®ª¤}dP>, !!"#$%%((*+-./0778:;<=>EDHQYbo{‡–——™™—•”‘ŽŽŽŽŒŒ‹‹‰‡†…ƒ‚€}{yxxsrqomkihhgec`][ZZY_m|‰˜¥µ¾ÃÅÅÆÇÇÊÎÑÒÒÓÔÚÚÚÛÜÞßàààßÞßàáâääåææææææäèçäèá̯‰iT:( !! -Hi‹«ÅÝåãçèèèèèèèèèèèççæææèèèèèèèèééééééééëãÙ½“t]F80))+))*++++,,--...///00101323;Ef•¿æãñîõóõøùùùúûøöñìçäâáßàãæééæäÞÜÙØÚßäèæèêêééêëîëêëæÔ¼ªtuwxyzzzyz{|}~€€‚‚‚‚…†ˆ‡††‡‰‡ˆˆˆ‰‰‰ŠŠ‹ŒŽŽŽŽˆ…|n`O:) -<Rcz‰—œœœœš›ŸŸŸŸ¡£ ŸŸŸžŸŸ ¡¡¡¡¡££¢¢¢¢¡¡ ¡£¤¤£¢¡§¨§¥¥¡”†p\B.0D]oƒ“¢§¥¥¦¥¦¥¥¤¤¥¥¦¨¨©ª««ªª¨ª««ªª«¬¬¬¬®®®¯¯¯®±±¯¯±¦–‚gQ=) !#$%%)*1?Pcx‰š¥¯³´··µ±°®¬«««¨¨¨¨¦¥¤£ŸŸžœ™–”“‘‹‰ˆ‡†…ƒ~|zyxvy€…‰•œ ¥ª«¬®±³·¹º¼¿ÁÆÆÇÈÊÍÏÐÒÒÓÓÕÖØÙÝÝÞàáâãääãçæãèâή‹lV<+$)Bd†§ÁÚãâæèèèèèèèèèèèèççççèèèèèèèèééééééééëæÞÅ›{aI:1*)*)(*))**++++....///01012117@Xˆ¶àáïí÷òõøùøøúûù÷óïêçåãââäçêêçåãáßÝÞâæéçéëëêééëìëëìçØÀuvwxyyzzzz{|}€‚‚‚ƒƒ†‡‰‰‡‡‰Š‡‡‡ˆˆˆ‰‰‹ŒŽŽŽŽŽ†ƒzk\K6%!.?Ug|Š™žžžœšœŸŸŸŸ¡¢¡¡ ŸŸŸŸ ¡¢¢¢¢¡¢¢¢¢¢¢¢¢¡¢¢£££¢¢¦§¦¤¤Ÿ’„nZA. 0E^pƒ“¢¦¥¥¦¥¥¥¤¤¤¤¥¥¨©ªª««ªª©ªª«ª««¬ª«¬¬¬¬«ª«¬¬¬®¬®¯¯«¥•gR>*"4Ke•¨¶ÄÉËÌÌÊÈÈÇÆÆÅÅÅÀÀÀÀÀ¿¾½¸¸¸·´±®¬««ª©§¦¥¤Ÿžœš™——’‘‹‹Œ‹‹‘‘’”—™›œž¡¥©©ª«°³¶¸º»¼¾ÁÃÅÆÊËÌÎÐÓÕÖÖÖÛÚ×ÜÙƦ‡mX@2-% %=_‚£¿ÙââæèèèèèèèèèèèèèèèçèèèèèèèèééééééééêæâË¢eK<2*)*((*)***+++,--...///1/02104;N|«ÚÞíìöòõ÷øøøùûúùöòîêèæââãæèéçäåãáààâåççéëëêééêêëììéÜűwwwwxyzzz{{}~€€‚‚‚ƒƒƒ†ˆ‰‰ˆˆ‰‹‡‡‡ˆˆˆ‰‰‹ŒŽŽŽ†‚xhXH3" #0BXj~Œšžžž›žŸ žžŸ ¡¡¡ ŸŸŸ ¡¢¢¢¢¡¢¢¢¢¢¢¢¢¦¥£¡¡¢¤¥¤¥¤¢¡‚mZA. 1F^qƒ“¡¥£¤¦¦¦¥¥¤¤¥¥¦§§¨©©©©©©©¨©ª««ªªª«¬¬«ªªª«««¬¬¬°°¯°±§•gR?+0If…œ¶ÅÕÛÛÜÜÚÜÜÜÜÜÜÛÛØÙÙÙÙÙØ×ÓÓÓÒÐÍÊÉÅÅÄÃÂÁÀÀ¼¼º¸¶³²±«¥œ”Œ†zrmpsrsvy{|~ƒˆ‹Š‹“–™›œž £¦©«¬¯°±³¶¹½¾¿¿ÅÅÁÇŵœƒn\G<80-,,+*)((%%$#""!!!!! !!!!"%:[~ ½ØâãèèèèèèèèèèèèèèèèéèèèèèèèèééééééééèæåШ…gL>4+)*((**+++,,,----...//1//22027IrŸÓÜìêôòô÷ø÷øùúûú÷ôñíëéåäåçéêèæçæäããäæçéêììêééêéëìëêáÌ·xwwwwxyzz{|}~€‚‚‚‚ƒƒƒ„†‡‰‰‡‡‰Š‡ˆˆˆ‰‰‰ŠŒŒŽŽŒ†‚wfVE1 $2D[m€™œœŸ ¡ žžŸ¢¡¡¡ ŸŸ ¡¡¡¡¡¡¡¢¢¢¢££©§¤¢¡£¥§¤¤£¡ ›Ž€lX?- 2G_rƒ’ ¤££¥¦§¦¦¥¥¦¦§¥¦§¨¨¨¨§©¨§¨ª««©¬¬¬¬¬¬¬®®®¬¯°®¯±®§˜ƒiS>*/Ge†¸ÉÚàààáàããäåååääåæçççççæääãâáàÞÝÛÛÛÚÚÙÙØÛÙ×ÔÐÍÊÉÊÈ¿®}ri[RTXVW[^`bcdgkopqsvy}€‚‚„‡ŠŽ’“––—™œ ¤§§©¯¯«²²£‘~pcRLI@?>=<:987321/-,*)('&%$#"!!!!!! !!!4VyœºÖâãèèèèèèèèèèèèèééééèèèèèèèèééééééééççæÓ«‰kO@6,*)''*++++,,--,---....1./33115Eh’ÉØëèññôö÷÷÷øúúúøöóïìëêééêìíìêêêéèèééêéëíìêééêéììêéäÒ½xxwvwxyz{{|}~€‚‚‚ƒƒƒ„„…‡ˆˆ‡‡ˆŠˆ‰‰‰ŠŠŠ‹ŒŽŽŒ†‚veUD/ %4F]o‚Ž˜ššœŸ žžŸ¡¢¢¡¡¡ žžŸ ¡ ¡¡¡¢¢£££§¦¥¤££¤¥¤¥¤¡ ›Ž€iU=+ 2G`s„’ £¢£¥¦¨¨§§§§¨¨¥¦§¨¨¨¨¨«©¨©¬¬ª¬®®®®¬¬¬®®®ª®®°¬¦™„iS?*,Ecƒ›´Æ×ÝÝßááàáãäåääãåæçèèèèèççæåååååæææåååååèèæäâàÞÝßàת‘xeWD79=;;@ACEFGILOSTVX[_bcdfimpsttyyy{~ƒ‡‰ŠŒ”“—˜‹upj__`WXWVTSQPOKJHEB?=<876420/.+++*))((#$!"%"4Qt˜·ÓàâçèèèèèèèèèèèééêêêèèèèèèèèééééééééèèéÖ¯ŒnRB7-))''*))**++++,,---...0./35324A^„¿Õëèïñóö÷÷÷øúúùø÷ôñíììëêëíîíëëëëìììììêìííëééêéíìèèç×Ãyxwvwxyz{{|}€‚‚‚ƒƒ„„„…†ˆ‡††ˆ‰‰‰ŠŠŠ‹‹‹ŽŽŽŒŒ‡‚veTC/ %4G^qƒŽ˜™˜›ž›ŸŸŸŸ¡£¢¢¢¡¡ žŸŸ ŸŸ¡¡¡¢¢£££¤¥¥¦¥¤¢¡¦¦¥¢¡œgS;) 2G`s„’ £¡£¥¦©©¨§§¨©©¦§¨¨©©¨¨«©«®¯««¬¬¬¬««««¬¬¬°°¯±²¯©–‚hS?,)B`™³Å×ÞÞàäæàâãåææåäãäåçççççèçæååæèéææææææææææççèééééìåд—w_D/ "&#$)&(+,,-/1779;>ADFGILPSUVW]\]^afjmnpxxt|~qrkmmjotlrqpnljihdc`]YVTRONLJGECB>==;:988./,-0)+<Nq•´ÑÞàæèèèèèèèèèèèééêêêèèèèèèèèééééééééêêêرqUC7-))'')((())***,,,--...0-/46434=Wz¸Òëèïñóö÷÷÷øùùùø÷ôñîìëéèéëìëéêêëìììëëêìîíëééêêîìæçèÚÆrtwz{{zyxwxz~€€‚ƒ„„„„ƒ…ˆŠˆ†„†‰‡ˆ‰Š‹‹‹‹‹ŒŽŒ†~rdR=' '6I`r…š›š›œœžŸŸŸŸž¡ ŸŸ ¡ŸŸŸŸŸŸŸŸŸ ¢£¤£¢¡¦¤¢¢£££¢¦¦¤££Œ|eQ:( "4H`r„’ ¤¥¦¦¤¨§¥¤¤¥§¨¨¨¨©©ªªª¬««ªª««¬««®¯¬¬°®¯®¯±¬¥•hS@,&D^z—¬ÇÕØàâßáââããããääåååææçççççççççççææææææææççççççççéææÙ¹›{[D- ""$%'()*-/147;=>@ACEHJLMQSVY[^be^fmqxƒŠŒŒŒŠˆ†„ƒ~{xuspljliea^[WTUSPNNLJHDB>;;>BE]yš´ÈÙãåååææçèèèççèèèèçæçççèèéééçéêêéèêëæéèÚ¼–q\D8-)(&'*)((((()),,,,,,,,--./01127Ks¥Ìâìññó÷ø÷÷÷øûúù÷õòïîëëëëëëëëìììííîîïííííííííñëìíèçßÌstwz{{zyxwxz~€€‚ƒ„„„„ƒ†ˆ‰ˆ†…‡‰‡ˆ‰‹‹ŒŒ‹‹ŒŽŽŒŒ†~qbQ<' )9Kbu†‘š›™›œœœžŸŸŸŸž¡ ŸŸ ¡ŸŸŸŸŸŸŸŸŸ ¢£££¢¢©¦£¢¢¢ Ÿ¥¥¤£¢œŒ{dQ9' "4I`r…“ ¤¥¦¦¥§§¦¥¥¦§§¨¨¨©©ªªª¬««ªª««¬ª«®¯¬¬¯¯®¯±¬¤•hS@,&C]y–«ÆÕ×ßáÞàâââãããääåååæææççççççççççææææææææççççççççèææÙºœ{\D- !#$&(('(*,.01268:<=@DGR_nz…”Ÿ¤¨¨¨¦¥£¡ŸŸœ˜”’‹‡ˆ…~|yurqnkjigeba^YURRSTl›¼ËÔÖÛÜÝÞßàáâáâäåæææææææææææææçéèççèêêìëßÄw`I=1,+)*-**)))*+++++++,,,-../01225FlžÈàêîðóöø÷÷÷øúúù÷õòïíëëëëëëëëëìììííîîííííííííðêììèèáÏtuwz{{zzxwxz~€€‚‚ƒ„„„„„†‡‰ˆ‡†‡‰ˆˆŠ‹ŒŒŒŒŒŽŽŒ‹…|o`N:%,<New‡’››™šœœœžŸŸŸŸž ŸŸŸŸ žžžŸŸŸŸŸ ¡¢££¢¢§¤¢¡¢¢¡ ¥¥¤£¢œŠybO8' "4I`s…“ ¤¤¦§¥§§¦¦¦¦§§¨¨¨¨©©©©««ªªªª««ª«®®¬¬¯®®¬¯±¬¤•hS@,%B\x•ªÅÓÖÞàÝßáâââããääååååæææçççççççççææææææææççççççççèåæÙ»}^E.!!#$%%'*-AVq†˜¬¼ÄÊÊÊÉÇÆÄÿ¼¸´²®ª§¦£Ÿ›™•’ŽŒ‰‡†„‚}zvqmkiiw…—¤°¼ÄÇÌÍÎÐÒÔÖ×ØÚÜßáãäåççæææææææèééèèêìèééàÉ¥}cJ=0+)'(+((((()*+**++,,--..//01123@a“ÁÝèêïòõ÷÷ö÷øùùùøõòïíìëêêêêëëëëëììììíìììíííííîéëìèéäÓuvxyz{zzxwxz~€€‚ƒ„„……„„‡‡ˆˆˆˆˆ‰ˆ‰Š‹ŒŒŒŒŒŽŽŒ‹„{l\K7#.>Pgy‰”œ›™šœœœžŸŸŸŸž ŸžžŸ žžžžŸŸŸ ¡¡¢¢¢¢¡ Ÿ £¥¦¥¤¤££¢›‰xaN7& #5Ias†” ¤¤¦§¦§§§¦¦§§§¨¨¨¨¨¨¨©««ª©©ª««¬¬¬¬¬¬¬¬ªª®®«¬¯®¬®°«¤–‚iT@,#@Zv“©ÃÒÕÜßÜÞàááâããääääåååæææææææææææææææææææææææææææçåæÚ¼ž`G0" "4Os¦¾ÒÜßßßßÞÜÛÚÓÑÎËÊÈÅ¿½º¸·¶³°«¨¥££¡ž›–•’Ž‹ˆ…„Š‘™ ¦«®¯³´¶¸»¾ÀÁÅÇÊÎÒÕ×ØÜÝÝÞàááââäæçæçéëäåäÝʧcJ>1+)&'**)))**+,*++,--..--..//002:V†¸Øåéîñôööö÷øøùùøöóïíìëêéééêëêêêëëëëëëììììíííìèëíèêç×wxxyzz{{xwxz~€€‚ƒ„…………„‡‡‡ˆ‰‰‰‰ˆ‰ŠŒŒŒŽŽ‹Š‚yiXG4!/?RhzŒ•œ›˜™œœœžŸŸŸŸž ŸžžžžŸ œžžŸŸŸ ¡¡¢¢ ŸžŸ£¥¦¥£¤£¢¢š‡u_L5% #5Jasˆ” ¤¤¦¨¨§§§¨¨§§§¨¨¨¨¨¨¨§«ª©©©©ª«¬¬¬¬¬¬¬¬¬©ª««®¬¬®°«£–‚iT@+!=Xt‘§ÂÐÓÛÝÚÜßààáâãäääääåååæææææææææææææææææææææææææææäæÚ½ cH1#-Kq‘¬ÅÚææçççæåäãäâàßàßÞÜÙ×ÕÔÔÓÑÏÊÇÅÄÿ½·¶³°©¦¤¥£¡ ˜’”•—›ž¡£¥ª¬°µ¹½¿ÁÄÅÇÊÍÐÒÓÖÙÛÝÞàâåæåãÛÇ¥~cNB61/,+-.-,,,,--***++,,,,----...36LzÑãéìïóõõõöø÷øùù÷óðííìêèèèéêêêêéééééêëëììíííëèìíèëéÛxyyyzz{{xwxz~€€ƒƒ„…††……ˆ‡†‡Š‹Š‰‰‰‹ŒŽŽ‹ŠwfUC1 0ATk|Ž—›˜™›œœžŸŸŸŸžŸŸžžžžŸŸœœœžžŸŸ ŸŸ ¡¢¢¤¢ ¡¢¢¡¢££¢¡™†t]J4$ $5Jbtˆ•¡¤¤¦©¨§§¨¨¨¨§§¨¨¨¨§§§§ªª©©©©ªª««««««««¬©©ª«®¬¬«®°«£—ƒiT@+ ;Vr¦ÀÏÒÙÛØÚßßàáâãääãäääååååååååååååææææææææåååååååååäæÛ¾¢„eJ2$+GlªÆÛåèèéééèççëéèéëëêéèæääååãâàÞÜÛÛÛÙ×ÓÒÏËÇÃÀ¿¶¬¢›“ˆ~zyz}€ƒ‡‰Š‘“—› £¦§¨ª±µ¹¼¾ÅÈÌÏÑÔØÛáàÝÓ¾Ÿ}fQG=:84120/.-,+,,,,++++++-------.43Dm Èßêëîòôõõö÷ö÷ùù÷ôðíîìéçççéêéééèèèèçêêêëììííëèíîèëêÞzyyyzz{{xwxz~€€ƒ„……††……ˆ‡†‡ŠŒ‹‰‰Š‹ŒŽŽŽŒŠ‰€udRA/#3DWm˜ž›—™›œœžŸŸŸŸžŸžžžžŸ››œžžŸŸ ŸŸŸ ¢£¤¢ ¡¡¡Ÿ¡££¢¡™…r[I3# $6Jbt‰•¡£¤¦©©§§¨©©¨§§¨¨¨§§¦¦¦ª©©¨¨©©ª««««««««¬©©¬ª«®¬¬«¯ª£—ƒiT@+:TqŽ¤¿ÎÐØÚ×ÙÞÞßàâãääããäääåååååååååååææææææææåååååååååãæÛ¿£…gK3%)Bd†¦ÅÚäçèééééèèêéèèêëêèéçæçèéçæèæååææåããáßÜÙØ×ÖÊ·¢“…uhc[]_behjkrtx|ƒ…†‹Œ“—›ž ¦ª¯³¶»¿ÃÆÇƾ”|l\SKJHC@?<;9765443322100/////////31>c“½Ûëêíñôôõö÷õ÷ùúøôðíîìéçæçèêéèèèççææééêëììííëéîîèëëàzzyyyz{{xwxz~€€ƒ„…††††…‰†…‡‹Œ‰‰Š‹ŒŽŽŽŽŒŠ‰€ucQ?.$5GZp™ž›—˜›œœžŸŸŸŸžŸžžžžŸš›œœžŸŸ¡ ŸžŸ ¢£¡ žŸ¡££¢¡¢£¢¡˜„q[H2" $6JbtŠ–¡£¤¦©ª¦§©ªª©§¦¨¨¨§§¦¦¦ª©©¨¨©©ª«««««««««©©¬ªª®«¬«¯ª£˜ƒjT@+9SpŽ¤¾ÍÐ×Ú×ÙÝÞßàâãääãããääåååååååååååææææææææååååååååäãæÛ¿¤†hK4%(>^€¤ÄÚãæçèéééèèëéèèééèæèçææèéèçëêéêëìëêêéèççèêëå˪w^MF?@BEHKMNUVZ]`cefprtx{‚†‰”˜¢¦¦ª©œ‹{qld^]\WRQPOMJHFFE<;;98766221111112/:\Š¶×êêíñóôôö÷õ÷ùúøõðíïìéæåæèêèèèççææåèéêêëìííìêïïèêëàyzz{{zzyz{}‚‚‚ƒ…………‡ˆ‡‡ˆ‹ŒŒ‰†‰‰ŠŠ‹ŒŽŽŒ‰†}p`P=)%6H[qƒ”™œššŸ˜ž›œ¡¡œŸŸŸžžžžžŸŸŸœŸ ¡ Ÿž¡¢¢££¢¢¡£¤¤¢ –n\H0! %7KbtŠ–¢¥¥¦§¦¦¨ª¬¬ª©§§§§§§§§ªªª©©©¨¨¨©ª««««ª©ª««©©ª«¨««ª¬¯§–‚iT@,7Pn¢µÊÔÖ×Ø×ÚÛÝßáâããääåääâáàääääääääçççæææåååååååååååäçݧˆiO5$"9]€ ½×çäæèèçæçèééééééééééééééééêêêêêêêêêêêééèèèèÒ²‘sV?2/-+,/3558:<@DHJLSTW[_cfhjlpu{€„†Š”‘Šƒ|xrpprrolledb_]ZXWSPKHGFDC@><<<<:887?X¯Óçéìðòóóõöôõöøù÷óïîéæææäæëååææååããåæèéëëëëíîíééëèãyzz{{zzyz{}‚‚‚‚„††……‡‰ˆ‡ˆŠŒŒŠ‡‰ŠŠ‹ŒŽŽŽŽŠ†}p_O<('8J]s…”šœ›šŸ› œœŸž™žžžžžœœžžŸŸŸžŸ ¡ ŸŸ¡¢¢££¢¢¡¡¢¢¡Ÿ•n[G0! %7KctŠ—¢¥¥¦§¦¥§©««ª©¨¨¨¨¨¨¨¨¨¨¨§§§¦¦¦¨©ªª««ªª©ª««©¨ª«©««ª««¥–‚iT@,6OmŒ¡µÉÓÖ×Ø×ÚÛÝßàáââããääããâáääääääääççæææååååååååååååãæÝè‰jP6%!7Y}ºÔäåçééèçèéééééééééééééééééêêêêêêêêêêêééèèèéÔ´“tW?1(%#"$&''()*,/12368:=ADFHOQTX]begkpuvuvy{‚„ˆŽ‹Š€}zwtqpmjeb`_\ZURNKIGC@B@E[Ñäéìðòóóõöõõöøøöòîîéåäãàáæåååääãããäåæèéêêêèëêéêîìçzz{{{{zzz|}‚ƒƒƒ…‡‡††ˆŠ‰ˆ‡‰‹‹‹‰Š‹‹ŒŽŽŽŠ‡|n]L:&);M`v‡•š››žŸŸ¡¡žœ›˜œžžž›šžžŸŸŸžŸ Ÿ¡¡¢¢¢¢¡¡Ÿ Ÿ”lYF/ %7LcuŠ—£¥¥¦§¦¥¦¨©©©§¦¨¨¨¨¨¨¨¨¨¨§§§¦¦¦¨¨©ª««ªª¨ª«ª©¨©«ª¬¬ªª¬ª¤–‚iT@,5Nl‹¡´ÉÓÕ××ÖÙÚÜÞßàááááâããããâääääääääæææåååäääääääääääâåÝÄ©‹kQ7%4Ux˜¶Ðàåçééèèéêééééééééééééééééêêêêêêêêêêééééèèêع—vY@1)%! !!!!!!!!$$&(*,./579<@CEGLPTW\gw„•Ÿ§«««ª¢ š–’ŽŠ‡‚~|yvsqniea]XTWRSe‡¯Ñäéìðòóóôööö÷øøõðìíçâàÜØÙÜáàßßßàáââãäæçèèèåèèæèìêæzz{||{zz{|~€‚ƒƒ…†ˆˆ‡‡ˆŠ‹‰‡ˆŠ‹‹‹‹‹ŒŽŽ‘‘Š†zlZI7$*=Obw‰–›ž››žŸ Ÿž›™›œžžœš™žžŸŸŸžžŸŸ ¡¢¢¢¢¡ žž›’}jWD- %8Mdv‹—£¥¥¦¦¥¦§¨©©¨§§©©©©©©©©ªªª©©©¨¨§¨©ªªªª©¨©«ª¨¨©ª«««ª¤–‚iT@,4Mj‰ ³ÈÒÔÖÖÕØÙÛÝÞßßßÞßàâããããããããããããååååäääãããããããããäáäÜŬŒlS9&1Ps”³ÍÝåçéêéèéêééééééééééééééééééééééééééééééééëÜ¿œy\B1+'#! !! #""! "##$&&'(((*,.01289:>EVqˆ–¥µ¿ÃÄÄÂÀ¿¼¸´°¬§¤Ÿ›™•‘Š…~zvrrljw•¸×çêíñóóóôõ÷÷÷ø÷ôïëëäÝÚÔÎÎÐÖÕÔÔÖÙÜßÞßáãäåååäæåãäæäßz{||||{z{|~€‚ƒƒ„…‡ˆˆ‡†ˆ‰‹‰ˆˆŠŒŒ‹‹‹ŒŽŽ‘’’‰…yjWF4"+>Qcx‰—œžœ›žŸžžžŸŸžž›œœš™žžŸŸŸžžžžŸŸ ¡¢¢¡ žžœš{hVB, &8Mew‹˜£¦¤¥¦¥¨©©©©¨¨¨©©©©©©©©ªªª©©©¨¨§¨©©ªª©©¨©ªª¨§©ª¬®®«¬®ª¥–‚iT@,3Lh‡Ÿ³ÇÑÔÕÕÔØÙÚÜÝÝÝÝÝÞßáâãããããããããããåäääãããããããããããããàâÜÆ®mU:'/Ln‘°ËÚäæèéèèéëééééééééééééééééééééééééééééééééêàÅ }`F3'$ """""###!!"##$%%)'(+2Fjˆ¥¹Î×ÚÜÜÙÜÛØÕÒÏÌËÈÅ¿½¹µ²«¨¤ œ˜”‘ˆ…Ž¦ÄÜéêíñóóòóôööö÷÷ôïëèáÙÔÍÆÄÆÇÇÇÈÌÐÔ×ÙÚÛÝÞßßßàââàáäâÝ{{||||{{|}‚ƒ„„…‡ˆ‡†…†ˆ‹‰‰ŠŒŒŠŠ‹‹ŒŽŽ‘’‘ŽˆƒxhUC1 ,@SezŠ˜Ÿœ›žŸ›œ ¡ŸŸ¡žœœœœžžŸŸŸŸžžžžŸ ¡ ¡¡¡¡ ŸŸžœ™ŽyeTA* &9NfxŒ˜¤¦¤¥¥¤ª©©©¨¨¨¨¨¨¨¨¨¨¨¨¨¨§§§¦¦¦§§¨©©©©©§©ª©¨§¨ª««¬®«¥–‚iT@,2Jg…Ÿ²ÇÐÓÔÕÔ×ØÙÛÛÜÜÜÜÝßàáâââââââââââääãããâââââââââââãßáÜÇ°nW<(-HjŒÈ×âäçèççéêééééééééééééééééèèèèèèèèèèééééêêéâÊ¥dI5'$ ! !!!!!! """"#####!"&-AhŒ®ÆÞåæééåéèçåãáàßàÞÛÚÙÖÒÏËǾº¶±®®§£©»Ðàèëîñóóòóôõõö÷÷ôïëèàØÑÊÁ¾À½½¾ÁÄÈËÎÐÑÓÔÖÖÖÖÖÙÚÚÝââÝ{||}}||{|}ƒ„„„…†‡†…„…‡‰‰Š‹‹‰‰ŠŠ‹ŒŽŽ‘‘†wgR@. /CVh|™ž œžžž›œ¡¢ŸŸ¢¡Ÿœ›œžžžŸŸŸŸŸžžŸ ¡Ÿ ¡¡ Ÿ¡¡ ™wcR?) &9NfyŒ™¤¦¤¥¥¤©©¨§§¦§§¨¨¨¨¨¨¨¨¨¨§§§¦¦¦¦§¨©©©©¨§¨ª©§§¨©§ªª¨ª¬ª¤–‚iT@,2Ie„ž±ÆÐÒÔÔÓ××ÙÚÛÛÛÚÝÞßàààààââââââââãããâââááááááááááãÞàÛȲ’oY=()Cdˆ©ÄÓàãæçææèéééééééééééééééééèèèèèèèèèèèééêêêèäΨ„hM7*'#!!""! !!""##""!!! $$$$$$$$$"#'+<dŠ«ÇàææéêçêéééèèççèçæææäáÞáÞÚØÕÓÏÌÎÇÂÅÑÝåèëîñóòòóóôôôö÷ôðìêâÙÒÊÁ½¿»¼½¿ÁÂÄÅÆÇÉËÌÌÍÍÌÏÐÐÔÙØÔ{||}}||{|}ƒ„„„„…††„ƒ„†‰‰ŠŽ‹ˆ‰‰ŠŠ‹ŒŽŽ‘Œ…€vfQ?-"1EXj™ž œžžŸ›œ¢¢ž¢£ ››œŸ žžŸŸŸ ŸžžŸ¡¢Ÿ ¡¡ Ÿ¢£¡˜vbR?) &9Ogy™¤¦¤¥¥£¨§¦¥¥¥¥¥§§§§§§§§ªªª©©©¨¨¦§¨©©©©¨§¨©©§§¨©¤§§¦¨«¨£–‚iT@,1Ieƒž±ÆÏÒÓÔÓÖ×ØÙÚÚÚÚÝÞßàààßßââââââââããâââáááááááááááâÝßÛɳ“pZ>('@a…§ÁÐßâåæææçéééééééééééééééééèèèèèèèèèèèééêêêçäϪ…jO9*&"""!!! !!!!! # !$%2X¨ÅßååéëèêëëëììííëêêëìëèæêèçæçæäãäÞØÙáèêêëîòóòòòóòóôö÷õñíìãÛÔ˾À½¾¿ÀÀÀÀ¿ÀÁÂÄÅÆÆÆÆÈÈÇÉÍÌÇ|{{{{|}~{}‚„†‡‡…†‡ˆˆˆ‡‡ŠŠŠ‹‹ŒŒŒŽŽŽ‘’‘’‡}sbM;*%4FYo„‘œžŸŸžž ŸŸžžŸŸ ŸžžžžŸ Ÿžž Ÿ¡ žž ¡žŸŸ ŸžžŸŸœ—ŒxeN;& '<RhxŒ—¡¥¦©©¨¥¥¥¦¦¦§§§¦¦¦¦§¨©ªª¨§§§§§©§§¨ª««©¥¦¦§§¨¨¨«ª©©ªª§¥–‚iT@,,Hj™ÂÌÏÑÒÑÔÖØÚÛÚØ×ÙÜßßÝÜÝßáâãáßÞÞàááãããáàÞàààààáááßâáØȯv]@*#:^€œ¸ÏÜãçåãåçæççççççççèééêêééèçççççççççççèèééééåÔµ‘oQ>.& !#! !!!!!!!!%# $.Ozš¿ÚãèèçìëëëëëëëëììììììììèèèèèèèèææååååææïïðñòóóôîðòôõôòñéäÞÙÕÑÍËÈÇÅÄÃÃÃÃÆÆÅÄÃÂÁÁÅÆÆÇÇÇÆÆ||{{||}~|~€‚„…††…†‡ˆˆˆˆ‡ŠŠ‹‹‹ŒŒŒŽŽŽ‘’‘‘‡|raL:)%5GZp…’žŸŸ ŸŸ¡ ŸŸ ¡ ŸŸŸŸ Ÿžž ¢¡ ŸŸŸŸ žžŸŸŸ ¢¡—ŠucM;& '<Rhy˜¢¤¥¨¨¦¥¥¦¦¦§§§§§¦¦§¨©©ª©¨¨§¨¨©©¨§¨ªªª¨¦¦§§¨¨¨©¬ª©ªªª§¥–‚iT@,,Hi€™¬ÂÌÏÑÒÒÔÕØÚÛÚÙØÙÜßßÝÜÝßÞßààßÞßááááááàßßàßßßßßßßßââÚʱv]@+ !8[}™¶ÍÛãçåãåçæççççççççççèèèèçççççççççççççèèèéééåÕ·“qS@.& !" !!!!!!!!%# $-Mw—¼ØáçèæëëëëëëëëëììììììììììììììììëëêêêêëëíîîïðññòïñóôõôòñîéãÞÛØÕÒÑÑÐÏÎÎÎÎÏÎÎÍÌËËÊÈÈÈÈÆÅÃÂ||{{|}~~~ƒ„………†‡ˆˆ‰‰ˆˆŠ‹‹‹ŒŒŒŒŽŽŽ’’‘‘†|p_J8'&6I\r†“ŸŸ ¡¢¢¡¡¡¡ ¡¡¢¡¡ ¡¡¢žž¡££¢Ÿ ¡¡ Ÿ ŸžžŸ ¢£¢¤¢–‰s`M:% (=SizŽ™¢¤¥¦¦¤¦¦¦§§§¨¨¨¨§§¨¨©ª©©©¨©©ª«ª©§¨©©¨§§¨¨¨¨©©©¬«ªª«ª¨¥–‚iT@,+Gh˜¬ÁÌÏÒÓÒÔÕ×ÙÚÚÙÙÚÜÞÞÝÝÝÞÛÝÞÞÞÞàáààßÞÞÞÞÞßßÞÞÝÜÜÜÞââÜÍ´’v^A+ 5Wx”²ÉÚâçåäåæåççççççççææççççææççççççççççççèèèééçØ»—uVB0'!!" !!!!!!!!$" $,Ir“¸ÔÞæèæêëëëëëëëëììììììììîîîîîîîîïîííííîïììíîîïðððñóôõôóòñíçãàÞÜÚÛÛÚÙÙÙÚÚØØ××ÖÕÕÔÐÐÏÍËÈÆÄ}||||}~€‚ƒ„………‡‡ˆ‰ŠŠ‰‰‹‹‹ŒŒŒ‘‘““‘‘…{m]G5%'8K_tˆ•¡¡¢£¤£££¡ ŸŸ ¡¢¢¡ ¡¢¢ Ÿž ¢£¢¡Ÿ ¡¢¢¡ Ÿ£¢ žžŸ¡££¤¢–‰s`L9$ (>Tj{š£¥¤¦¥£§§§§¨¨¨©©©¨¨©ª««ª©©©ª«¬«ª¨¨©©§¦©©©©©ªªª¬«ªª«ª¨¦–‚iT@,*Fg~˜¬ÁÌÐÒÓÓÔÕ×ÙÚÚÚÚÛÜÝÞÞÝÝÞÛÜÞÞÝÜÞßàßÝÜÛÜÝÞÞÞÝÜÛÚÙÙÝáâÝз”w_B,!2Tt‘¯ÇÙáçåäåæåææææææææææççççææææææææææææçççèèèéçÛ¿œzZE1(!!! $" #*EjŽ³ÐÜçéçëêêêêêêêêëëëëëëëëììììììììííììììííìíííîîïïðñòóôôóòïìçãâàÞÜÞÞÞÞÞßàáÞÞÝÝÜÜÛÛÚÚÙ×ÕÒÐÎ}}||}}~€‚„…………ˆˆ‰ŠŠŠŠŠ‹‹ŒŒŒ‘‘‘‘’””’‘Ž„zkZD2#(:Nbw‹—¢££¤¥¥¤¤ ŸŸŸŸ ¢¡ ¡¢¤¢¡¡¢¢ Ÿ ¡¢££¢¡ §¥¢ŸžŸ ¡¡£¢–ŠtaK8$ )?Ul|‘›¤¦¥¦¥£§¨¨¨©©©©ªªªªª«¬¬««ªª«¬®¬ª©©ªª¨§«««««ªªª«ª«««¨¦–‚iT@,)Ef}—«ÁÌÐÒÔÓÔÕÖØÙÚÛÛÜÜÜÝÞÞÞÝÝÞßÞÜÛÛÝßÞÜÛÛÛÜÝÝÜÜÛÚÙØØÝààÜѺ–y`C-!0QqŽÅ×àææäææåææææææææççèèèèççæææææææææææçççèèèèÝá~]H3)! #! #(@c‰®ÌÚçëéëêêêêêêêêëëëëëëëëêêêêêêêêíìëëëëìíîîîîîïïïðññòòóòòîëæãâáßÞÞÞßßàâãäãããâââââàààßÞÜÚÙ}}}}}~€‚„…†††ˆ‰Š‹‹‹‹ŠŒŒŒŒŽ‘‘‘’’’“•”’‘ƒxhWB/ *<Pdy™¢£¤¥¥¥¥¤¡¡ ¡¡¢¡¡ ¡¡¢¦¤¢¢¢¢ ž¡¢¢££¢¢¡§¥£¡ ¡¡£¢–ŠtaJ8# *@Vm~’¥§§¨§¥¨¨©©©ªªª¬««««¬®¬¬¬®®«ªª«¬ª©¬¬¬¬«««¬««¬«©§–‚iT@,(Dd{—«ÁÌÐÓÔÔÔÕÖ×ÙÚÛÜÜÜÛÝßßÞÜÞßàÞÜÚÛÜÞÞÝÜÛÛÜÜÛÛÛÚÙÙØØÝÞÞÚÑ»—zaD-".MmŠªÃÕßææäææäååååååååççèèèèççåååååååååæææççççæçÞÆ¥_I5+" "! #&;\„¨Æ×æëèêééééééééêêêêêêêêëëëëëëëëííììììííîîîîîîîîïïðððñññðìèåãâáßÞßßàâäæçèèèèèèèèâãããâáàß~}}}}~€~„†‡ˆˆ‰ŠŠ‹ŒŒ‹‹ŒŒŒŽŽ‘‘‘’’’““”–•’ƒxgU?-+=Rf{Ž›¢£¤¥¥¥¥¤¤££¢¢££¤££¢¢¢¢££¦¤¢¢££¢ ££¢¢¢¢££££££££££¤¥£ž–ˆr_I7" *@Wn“¦¨¨ª©§©©©ªªª««¬¬¬¬¬®¯¯¯®®«ª«®¬®®¬¬¬«¬««¬«©§–‚iT@,(Cdz–ªÀÌÐÓÕÔÔÕÕ×ØÚÜÝÝÛÛÜßàÞÛÝÞßÞÝÜÝÞÝÝÞÞÝÜÜÛÚÚÚÚÚÚÙÙÝÝÛØл™|aD."+Ii†¦¿ÔÞåæåææäååååååååææççççææååååååååååæææçççäæßȧƒaJ6+"" #%7V}¢ÁÒãéæèééééééééêêêêêêêêëëëëëëëëíìëëëëìíííííììììîîîîîïððïìçäãáàÞÝÝÞàâäçèêêêêêêêêææææåäãâ~}}}}~€}„†ˆ‰‰‰Š‹ŒŒŒŒ‹ŒŒŒŽŽŽ‘‘’’’“““”–•’‚wfT>,+>Sg|›¢£¤¥¥¥¥¤¦¦¥¤¤¥¦¦¥¤¤££¤¤¥¤¢¡¢¤¥¤¢¥¤¢¡¡¢¤¥Ÿ ¢£¥¥¦¦§§¥ž•‡p\I7" +AWn“ž§©ª««©©©ªªª«««¬¬®¯±°¯®¬«¬®°¯®¯®®¬¬¬¬««¬¬©§–‚iT@,'Bcz–ªÀÌÐÓÕÔÔÔÕÖØÚÜÝÝÛÚÜßàÞÛÛÝÞßÞÞßáÜÝÞßßÝÛÚÙÚÚÚÚÚÛÛÝÜÚÖλ™}bE."(Ffƒ£½ÔÝåæåææäååååååååäååææååäåååååååååååææçççãæßɨ„aJ7,"" #$5Syž½ÏáçäåééééééééêêêêêêêêêêêêêêêêêêééééêêëëëëëëëêîííííîïðíêåâàßÝÛÚÚÜÝàãåçééééééééêêêéèæä €€€€€€~€‚„‡ŠŒˆ‰Š‹ŽŽŽŽŽ‘’‘‘‘‘’“””—˜–”ŽudS<).BUj“œ£¥§§¦¥¦§¨§¥¦¨¨§¦¦§¨§¥¤¥¦¨¦¤¥§§£ž£¦¨§¤¢£¥¦¦§§§¦¥¤¤¥£”†p\G4 .BXo”ž¦¨¨ª«©ª«¬¬¬¬¬¬¬¬®¯²±¯®®®¯®¯±²°°®®°°¯ªªª«ª¨˜„jUA,'Bcz”ÀÉÔÕÓØ×ÖÖ××ÙÚÛÞÝÜÜÞÞÝÜÝÜÚÛÝÝÜÛÜÝÝÝÜÛÚÚÚÚÛÛÛÛÛÛÝÝÜ×Ï»š~bK0 (Bb‚¢·ÍÝâàåäâèåååääãããäååææååäååååååååååååååååæäâͦ„gL8," !"%"!#"0Lp–·ÌáéçèèèèèèèèèééééééééèèèééêêêéééêêëëëëëëëëëëëííííííííîìéäàÝÛÙÚÚÛÜÞáãäææçèèéêêèèçççææ怀€€€€€€‚„…‡‰‹‹‰ŠŠŒŽŽŽ‘’’‘‘’““”“–—•’ŒscQ;( /CVk‚”¤¦¨¨§¦§¨ª¨§¨©ª©§¦¨¨§¥¤¥§§¦¦¦§¦¤¡¤¦¨¨¥£¤¥¥¦¦§§§¦¦¥¦¤ž•‡p\G4 .CYp‚– ¨ªª¬«ª«¬¬®¯¯²±¯®®®¯°±°¯®¯°±²²±°¯¯°±²±®¬¬«ª˜„jUA,&Bcz”ÀÊÕÖÔÙ××××ØÙÚÛÞÝÛÜÞÞÝÜÞÜÛÜÝÞÝÛÝÝÝÝÝÜÛÚÜÜÜÜÛÛÛÛÜÝÜÙмš~cL1!(Ba‚ ¶ÌÝâáåäâèåååääãããäååææååäååååååååååååååååæäâΧ†hM9-" !!$! "!.Im“´ÊßèæçèèèèèèèèééééééééèèèéééêêéééêêêëëëëëëëëëëììììììììîìéäàÝÚÙÚÚÛÜÞáãäæççèééêêéèèèççç怀„…†‡ˆ‰ŠŠŠ‹ŒŽ‘’“’’’’“”•“––“‘Š}paO8&!1FXm„–Ÿ¤§©©¨§¨©¬ª©ª«¬«©¨©ª©§¦¦¨¥¦¨¨¦¥¥¦¥§¨¨¦¥¥¦¥¥§¨¨©¨¨§¨¥Ÿ–ˆq]F3 /DZr„˜¢ª¬¬®¯«¬®®®®®®®®®¯°±±°°°°±²²³³²±±±²²³³²²²²³³²°¯®¯¯¬™…kVA-&Aby“®ÁËÖ×ÔÙØØØØÙÚÛÜÞÜÛÜÞÞÝÜßÝÜÝÞßÞÜÝÞÞÞÞÝÜÜÞÞÞÝÜÜÛÛÛÝÞÛÓ¾œdM2"'A`€ž³ËÜâáåäâçååääääããäååææååäååååååååååååååååæäâϪ‰jN:-" ! #! ,EhŽ°ÆÜæäæèèèèèèèèééééééééèèèèéééêééééêêêëëëëëëëëëëëëëëëëëíëèåàÝÚØÚÛÛÝßáãåçççèéêêëêéééèèè瀀€€…†‡ˆ‰Š‹ŒŒŒŽ‘‘’’“““““”•••——”Š|o_L5$#4I\q‡™¡¥¨ªªª©ª«¬«ªª¬¬«ª©ª«ª¨§¨©¤§ª©¦¥§ª§¨©©¨§¦¦¥¦§©ªªªªªª§ —ˆq]E20E\t†™£«¯°®®¯¯¯¯¯°°¯¯°°±²°°±±²³´µµµ´´³²²²³³³³³³³³³±°°±°®¬š†lWB-&Aax“®ÁÌ×ØÕÚÙÙÙÙÚÛÜÝÞÝÜÜÞßÞÜàßÞÞàáßÞÞÞßßßßÞÝáààßÞÝÜÜÚÝßÞÖÁžfO3#%?^}›°ÊÛááååâçäääääääääååææååäååååååååååååååååæãâЬŒmP;.# !!)@cŠ¬ÃÚåäæççççççççèèèèèèèèççèèèéééèèéééêêêêêêêêêêêêêêêêêêêìëèåáÝÙ×ÚÚÛÝßáãåæççèéêêëêêêéééè耀‚……‡‰‹ŽŽŽ‘‘‘‘‘‘’““””““”•––˜š™•‘Š{n\I2"%6L_tŠ›£¦©«¬««¬®¬«ªª¬¬«ª«¬¬ª©ª«¦©«ª§¦©¬©©©©ª©§¦¦§¨ª««¬«««¨¡—ˆp\D11G^vˆ™£¬®°°®®®¯°±±°°²±±±±²³´±±²´µ¶¶¶¶¶¶µµ´³³³³³³³³³³²±°±²±®¬œˆmXC.%@aw“®ÂÍÙÚÖÛÚÚÚÚÛÜÞßàÞÝÞßàßÝâáßàââáàßßààáààßââáàßÞÞÝÛÞàßØà ƒhQ5$$<Zz™®ÈÚááæåâæäääääääääååææååäååååååååååååååååæãâÒ°pR=0# !&<_†©ÁÚååçççççççççèèèèèèèèçççèèèééèèèéééêêêêêêêêêêêêêêêêêêëêèåáÜØÖÙÚÚÜÞàâäææççèééêêêêéééè耀‚ƒƒ„…†ˆŠŒŽ‘‘‘’’’’‘‘’’“”••””••–—™›š–‘‰zlZF.(9Ocwž¥§ª¬®°«ª«¬¬ª¬®®«ª«¬ª««ª¨¨ª««ª©ª««©§¨©ª«¬¬¬¬¬¬¨¡—‡o[C02H_x‹š¤®¯±±¯¯°±±²²±±³³²²³´µµ²³´¶····µµ¶¶¶µ´´³³´´´´³³³²²²³²¯¬‰oXD.%?`w’®ÃÏÚÛ×ÜÜÛÛÜÜÞßàáàßßáâáßäâáâãäãáßàááââááããââáàààÜßáßÙÅ£‡jR6%!8Vw—ÇÙàáæåâæããääääååäååææååäååååååååååååååååæãâÓ³“sT>1$ "$9Z¥¿ØååèææææææææççççççççæçççèèèèçèèèééééééééééééêêêêêêêêêêèåáÜØÕØØÙÚÜßáâäååæççèèêéééèèè炃„……†ˆ‰Š‹ŒŽ‘‘‘‘’’’““’’’’“”•–••••–—˜™›š•‡xjXC,);Qez §¨«®®®°±¯¬®¯®¬¯°¯¬¬®¯¬ª©ªªª©«ª«¬¬ª§ª«¬¬¬¬«¬¬¨ –†nYB03IazŒœ¦¯±±³³²°°±²³³²²´´´´´µ¶¶´µ¶¸¸¸··³´µ¶·¶µ´´µ¶··¶µ´´´´µ¶´±®žŠoYD.$?_v’®ÃÐÛÜØÜÜÜÜÜÝÞàáãâááãäâáåãâãäåäâààáâããââããããââââÞàáßÙƦŠkS7%5Rt–ÅØàáæåáæãããääåååäååææååäååååååååååååååååçãâÔµ–uU?2$ ##6U}¡»ÕãäçææææææææççççççççææçççèèèççèèèéééééééééééëëëëëëëëééèåáÜ×ÕÖ××ÙÛÝßáããääåæççéèèèçççæ‚‚ƒ„…††‡‹‹ŒŒŒ‘’’’’’““““’’’“”•––•••–—˜™š™“Ž…vhWB**<Rf{‘¡§©«®¯¯¯±²°¯®®°±¯®®¯°¯¬®²©©«¬ª¨«ª«ª§¬¬¬««¬¬¨ •…mXB/3Jb{ž¨±³³µµ³°±²³³³³²µµ´´µµ¶·µ¶·¹¹¸·¶²³µ¶··¶µ¶¶¸¹¹¸¶¶¶¶¶·¸¶³°ŸŠpYD/$>_u’®ÄÐÜÜÙÜÝÝÝÝÞßàáäãââäåäâåäããåæäãàáâãããããããããããääßááßØƧŒlT8&2Pr•ÅØàáçåáåãããääåååäååææååäååååååååååååååååçãâÔ¶˜vV@2$ $#5Qyž¹ÓáãæææææææææççççççççæææççèèèçççèèéééééééééééëëëëëëëëééèåáÜ×ÔÕÖÖØÚÜßàââããäåææèèçççæææ……„„„…††‰Š‹Ž‘‘‘’’’““‘’’“”•–—–––———˜˜šš—“‡whT?(!,=Ui~“¢©©«¯°°¯®±°¯®®¯°±°°¯¯®®®®¬¬¬¬¯««®®¬©®®¬«««©¬ª¢–„lXC1!5KbzŒ£¬´µ´¶·¶µµµµµµµµ¶¶¶···¸¸¸··¹»»º¸¹¹¸¸¸¹ºº¶¶µµµµ¶¶¶¸¸µ¶¸µ¯£Žs\G1":]z”ªÃÒÙÝßßÝÝÝÞÞÞßßâââãããääääääääääääääääääããããããããàääßÚͯ’sT:(1Sr’±ÄÚãáåæäçäääääääääääååæææååååååååååååååååçáãÙ»šy\E0$!!!! '1Ou˜³ÐáãæççççççççææææææææççççççççèèèèèèèèééêêêëëëëëëëëëëëêêéçâÝØÕ×ÓÒ×ÛÛÜßààßßàâäåååääãääå……„„……†‡‰ŠŒŽ‘‘’’’“““””••––———˜˜˜™™™š™š˜“†udO;$$-?Wl€”¢¨«¬®¯°°°¯¯®®®®¯±±°°°¯¯¯°¯¯®®®®®±¯®¯°®¬®®®®¯¯¯¯¯¬¤—„kWA.!5Lc{¢«³´³¶¶µµµµµµµµµ¸¸¹¹ººººº¹¹º¼½»ºº¹¹¸¸¹ººº¹¹¸¸¹¹º·¹¹·¸¹¶±¥u^H2!"9]z”ªÃÓÙÞàßßßàààáááââãããäääääääääääääääääääããããããããâååáÝϱ”uW<*/Qp¯ÃÚãáåæäçääääääääääåååæææååååååååååååååååèãäÛ¾|^G1%! ! '0Ms–²ÏàãæççççççççææææææææççççççççèèèèèèèèèéééêêêëêêêêêêêêêêéæâÝØÕÕÑÑÖÚÚÜßßßÞÞßáãäääãââããä……………†‡ˆŠ‹Ž’’’“““””————————™™™šš›››™š˜”„q`K8""/BZp„—¤©¯°±²³³³²±±²²²²±±±±°°°¯¯¯±±°°¯¯®®²°¯¯°±¯®®®¯¯°±²²¯°£•‚iU?-!5Md}¡«²³³µ¶µ¶¶¶¶¶¶¶¶¹¹¹ºº»»»¼»»¼¾¿½»»ºº¹¹¹ºº¼¼»ºº»¼¼¹»»¹º¼¸³§’w`J3""9\y”ªÄÔÛßáàâââãããääãããäääååååååååååäääääääääääääääääçæâßÓ´–xY?--OnŽÂÚãáåçäçäääääääääåååææææååååååååååååååååêäæÞ¢€bI3&" ! &/Io“¯ÍÞâåççççççççææææææææççççççççèèèèèèèèçèèèéééêêêêêêêêêééèæâÝØÕÓÎÎÓ×ØÚÞÞÞÝÝÞßááâááàááâↅ……†‡ˆ‰ŒŽ‘‘‘‘““““”””•˜˜˜—————™™ššš›››™›™•ƒo\K8#"0D^u‰œ©¯¯°±±±²²±²³´´³²±±°°°¯¯¯¯±±±±°¯®²±±°±°°¯¯¯°°±±²²°°¬¡’fR?-!6Me~‘£¬´µ´¶·¶¸¸¸¸¸¸¸¸·¸¸¸¹¹¹º¼¼»½¿¿¾¼¼¼»ºººº»¼¼»ºº»¼¼»¾½»¼¾»µ§’w`J3""8[x”«ÅÕÝáâáããäääåååääääåååæææææææææååååååååååååååååäçåãáÕ¶—z[@.,MlŒ¬ÁÙãâæçåçåååååååååååæææççææææææææææææææææêäæàƦ„eL5'" " %-Dk¬ËÝáåççççççççççççççççèèèèèèèèèèèèèèèèçççèèèééééééééééééèæâÝØÕÏËÊÏÓÕ×ÛÜÜÜÝÝÞßßàßßßßààᆆ††‡ˆŠ‹Ž‘’’’’“”””••••—————–––™™™ššš›››œš•‚n[K7"$2F`wŒŸ¬°®®®®®®¯¯¯°±²²±°¯²²²±±°°°±²²³²±°¯³³³³²±±²´³³³²²±±±±¬¡’fS<+"7Nf‘¥®¶··¹º¸ºººººººº¸¸¹¹¹ººº¼»»½¿¿¾¼¾½¼»ºº»»¾½½¼¼½½¾½¿¿½½¿¼·§’w`I3!"8Zw”«Ç×ßãäããããääåååäåååææææææææææææååååååååååååååååäæäââ׸˜|]A.,MlŒ«ÀØãâçèåçååååååååååæææçççææææææææææææææææéãæáɪˆgO7)# " $,@gŒ©ÉÜáåççççççççççççççççèèèèèèèèèèèèèèèèçççèèèééééééééééééèçãÞÚ×ÎÉÈÌÐÒÕÙÛÜÜÝÝÝÝÝÞÝÝÝÞßàà†††‡ˆ‰‹Œ‘’“““’””•••–––————————™™™šš›››œš•Žƒo]I6!$5HavŠª®±±°°°±±²°°±±±±°°²²²±±±°°¯°±²²±°¯²³´³±°±²´´´³²±°°±±¬¡”jW:*#8Of‘¦°·¸¸º»¹»»»»»»»»»»¼¼½½½½½¼¼½¿À¾½¿¾½¼»»»»ÁÀÀ¿¿ÀÀÁ¾ÀÀ¾¾À½·¨“x`I2!"7Yv”¬ÈÙáäåäãããääåååååæææçççççççççççææææææææææææææææåæäãäÙº™~_C0+KjŠª¿ØããèèåçææææææææææææçççèççççççççççççççççêãæãͯŒjR:*# " #*<d‰¨ÉÜáæççççççççèèèèèèèèééééééééèèèèèèèèçèèèéééêêêêêêêêêêêêèäàÛÙÑÌÉÍÐÒÕÙÛÜÝÝÝÝÜÜÝÝÜÝÝÞàà††‡‡‰ŠŒ‘’““”“““•••–––————˜˜™™ššš›››œœœžžš”Žƒp`J6"(9J`s…–£§®¬««¬®¬¬¬¬¬¬¬«««ª¦¨ª¬¬«ª«¯«©«¬¬¬¬¬¬¬¬¬¨ž‘€iW<,$9Of‘¦¯·¸·ºº¹ºººººººº¼¼¼½½½¾¾¿¾¾¿ÁÂÀ¾À¿¾¼»»»»ÁÁÀ¿¿ÀÁÁ¾ÀÀ¾¿À½¸ª•ybK4"!6Yu”¬ÉÚâææåäääååææææææçççèèèèèèèèèèææææææææççççççççççåäæݽœaF2)Ihˆ¨¾×ããèéåçæææææææææææçççèèççççççççççççççççëåèæÑ´nT<+$ #!"):bˆ§ÈÝâçççççççççèèèèèèèèééééééééèèèèèèèèèéééêêêëêêêêêêêêëëëéæâÝÛ×ÐÍÐÓÔ×ÛÜÜÝÞÞÝÜÛÜÜÜÝÝßàᆆ‡ˆ‰‹Œ’’“”””““••–––————˜™š›œœœœžžžŸŸš”Ž„rbL9% !!"! !"! !$##*2<L`p€‘œ¡¡ žžŸ £¢ ŸŸ ¢£¥¥¥¤¤¤££Ÿ¡¤¥¥¤££¦§¦£¡£¥¢££¤¥¥¦¦¦§£™}gUA1!%9Of~¥®¶··¹¹¸¹¹¹¹¹¹¹¹ººº»»¼¼¼ÀÀÀÁÃÃÂÀÀÀ¾½¼»»»¿¾¾½½¾¾¿¾ÀÀ¾¿À½¸¬—{cM5#!6Xu”¬ÉÛãæçååååææçççææçççèèèèèèèèèèèææææææææççççççççéèææéß¿žƒdH4!'Gf†¦¾×ããèéåçæææææææææææççèèèççççççççççççççççíæéèÔ·“qV=,$ #!"(9a‡§ÈÝãèççççççççèèèèèèèèééééééééèèèèèèèèééêêêëëëëëëëëëëëìììêçãÞÜÛÔÑÓÕÖÙÝÜÝÞßßÞÜÛÜÜÜÝÞßàቊ‹ŠŠŒ’”““““”•––—™˜——™š—˜š›œœžžŸŸ šœ›“‹€qdO?/))(())))*****++++,,,,,---.../////.........///-031/05:DLZjz‡”’’’’’’’’”“’’’’“”••••••••”””•••––••–——–••’“”••”“’’”‘‡~tcRC8.+(#%*#$&((('&&&&&&&&&&%#"!"##"""!!! "!! !!"# !.=Pf|Š¤¬¯®¬°««¬®®¯¯²³³´µ¶¶¶¸¸¹¹ºººº¸····¸¹º»»¼¼¼»ºº¾¾¿ÁÂÀ»¸©“xcP9%!8Wo‘ªÈÚâçéèèèèèççççææçèèèèçëëêêéèèèèèèçççççççççççççéçìíæßÇ¥‡gJ3%Dc…¦¼ÖäãççäçççççççççççççççççççççççççççççççççåçèäÙ¿—w[A0' "%7U€¨ÈÝåäçççèèéééééééééééééééééééééééééééèèèééêêêêêêëëìììëëêéæãàÞÚÙ×Ö×ÙÛÝÝßààÞÜÜÝÞÞÝÝÞßá㊋‹‹‹Œ’””““”•–––˜™™˜—™š™™›œœœœžžžžžŸŸŸ›œ•Ž…wj[K<7777888889999;<<<<====>>>????@@@@????@@@@@@@@>ACB@@DGJPYepz€ƒ‚€€€€‚€€€€‚‚ƒƒƒƒƒƒƒƒ……‡‡‡‡……†‡ƒ{tmaTME>=:67;678999878888888898655566555544334432223321000012,2:FSdv“›œšœžžžŸ ¡¡¢¡¡¢£¤¤¥¥§§¨¨¨©©©««ªªª«¬®®¯¯¯®®±±²´µ³¯¬£ŽvcQ<* "9Yp’ªÇÙàäåäæææææåååææççèççæççææååääæææåååååææææååååæäéêåßɨ‹mP:$$B`‚£»ÖããççäçççççççççççççççççççççççççççççççççæèéæÜšz\C1' "%6S}¥ÅÛäãççèèèéééééééééééééééééééééééééééèèéééêêêêêëëëìììëëëéçãàÞÛÙØ××ÙÛÝÝßààÞÜÝÝàßßßàáãä‹ŒŒŒ‹“••””••–——˜š™˜˜™›››œœœ›ŸŸŸŸŸžžžŸž˜’Š~sdWJFFEEFFFFGGHHHLLMMMNNNOOOOPPQQQQQQQQQQRRRRRRRRQRTSRQQRRTX]bgjlooooooooonnmmnnonnnnnnnnmmmnnooorqpoopqrqqrrrrqqstpkgd^WTPNNMJJMJKKKKJJIJJJJJJJJLLKJIJJKJIIIHHHGHHFEEEEEEEDDDDEEEGKQXcnu~ƒ‰‹‰ˆŠŒŽŽ‘‘’‘‘’““”–––———˜˜œ››››œžžŸ ŸŸ¢¢£¥¦¥¡ž“ƒpaSC5/&&%$#$$$ !!! "9Xo•¬ÈÙàåæåçççèèèèèèèééééèççççççæææççççççççééèèçççæèåéêæãÏ°‹mR<&#>[}ŸºÕãäèèåçççççççççççççççççççççççççççççççççèéêçßÇŸ`F3) ! "$3Py¡ÂÙãäçèèèééééééééééééééééééééééééééééèéééêêêêêëëëììììììëêèäáàÜÛÙØØÚÜÝÝßáàÞÝÝÞááàáâãä匎‘”––••–—˜˜—™šš™™šœœžœ›¡¡¡ ŸŸžž ¢ š•Ž„ymbXVVUUVVVVWXXYY\]]^^_`````aaabbbbbbcccceeeddddccdddda^[YWVUUVXY\\\\\\\\\\[[[[\\^^^^^^^^]]]]^^^_ba^]]^ab\\]]]]\\^_^]]][YY[^``_^_____^]]\^^^^^^^^__^^^^^^]]]\\\[[]\[ZXXXXXXXXXXXXYYYZ]bgkqtwyxwxzzz{{|}}~~€‚‚‚„„……††††‰ˆˆˆˆ‰Š‹‹ŒŽ’““Žui`WLDB:98877884443333333210/..,,,,,+++**)))(((&&&&&&&&$$!!*@]r‘§ÀÑÚàãâäääåååååååææææååçççèèèèèæææçççççêéééèèèçêæééåãѳŒnR<&";Xz¸ÔãäèèåèççççççççèèèèèèèèèèèèèèèèèèèèèèèèéééçáʤƒdI5* !! "$2Nv¿ØãåèèèéééêêêêêêêêêêêêêêêêêêêêêêêêêêéééêêêëëëëëìììííìììëéæãáÞÜÚÙÙÛÝÞÞàááßÝÝÞáááââãä厎Ž“–—————˜™™˜š››šš›žžžžœ¢¢¡¡ ŸŸŸ¢¤¢œ—’‰{rkkkiikjjklmnnoppqqrsttttuuuvvvvvwwxxyy{{{zzyyxyxxyyumg]YSMIHIJFFFFFFFFGGFEEFGGHHHHHHHHGGHHIIIIKJGFFGJKIIIIIIIIJKMQTWZ]dkrvvvvvxwvvuuttvvvvvvvvuuuvvvvuttttsssrutsrqpppooppppooigdbaaaa`abbbbcdccddefgghiijkllmnooopppqrqqqqrsttuvwwwwwyxy{}}|zslea[SPRNMLKKKKLJJIIHHGGJJIHGFEEEEDDCCCB???>>>==;;;;;;;;8755=Phz‰›±ÀÊÒÖÖÖÖ××ØØØÙÚÛÜÝÝÝÝÜààááâãããááââãããäææææææææéåççãáϱ”tW?' 9Uy¶ÒâäééæèççççççççèèèèèèèèèèèèèèèèèèèèèèèèèèççâΨ‡iM8+ !"! "$0Kr™»ÖäçèèéééêêêêêêêêêêêêêêêêêêêêêêêêêêêééêêêëëëëëìììííííííìêèåãßÞÜÚÚÛÝßÞàâáßÞÞßßàáââãã㎔—™˜˜˜˜™š›™›œœ›šœžžŸŸŸžž¢¢¢¡¡¡¡¡¤¥£žš—ˆ…{||zz|{{|}€€€€‚ƒ„…†……††‡‡‡‡‡‡ˆ‰‰Š‹‹ŽŽŒ‹‹ŠŒ‰ˆŠŠ…zpb[PD<88944444444655445565555555544455566653333566655556677;CJQ[eoyƒ‡‰‹‹ŠŒŒ‹ŠŠŠŠ‹‹‹‹‹‹‹‹‹‰ŠŠ‹Œ‹‹‹Š‰‰‰ˆˆˆˆŠ‰ˆ‡††††……†‡‡†……zsle_YUPONNMNNOPPPQRSSTSSTUVVWWYYZZZ[[[^^]]]^_``abcddddedegijjhfcbb_\]bccba`aaaaa``_^^]^^]]\[[[[[[ZYXXXTTTSSRRROOOOOOOONNMMR^o{‡•¥¯·¿ÃÃÃÃÄÅÅÆÆÇËÌÎÏÑÑÒÒÓÔÔÕÖ×ØØÙÙÚÚÛÜÜÝßààáââããæâååáßί”tX@) 7SxµÑâåêêçéççççççççéééééééééééééééééééééééééçæçåÒ¬‹mQ:- !!""!!"$-Gm”·ÓâçééééêêêëëëëëëëëëëëëëëëëëëëëëëëëëêêêêëëëìììììíííîîîîíìéæåáßÝÛÛÜÞßßàâáßÞÞßßàáâãäãã‘‘•˜™™™™™š›œš›œ››œžœžŸ ¡¡¡¢¢¢¢¢£¥£ Ÿžš“ŒŠŠŠ‹ŒŽ‘’‘’“”––—————˜˜˜™˜™™š›œœ ŸŸžœœž›™›œ•ˆ|h]M;.'%%$$$$$$$$%$$##$$%$$$$$$$$###$$%%%$$$$$$$$$#""""#$&$'1<J^o}Š•™šžŸ ŸžžžŸ ¡ŸŸŸŸŸŸŸŸžŸ ¢¢¢¡ ŸŸžžžžœ›››œœœœžžžžœœš’…wj\OG=;977899::;;<=>><<=>>?@@BBBCCDDDGGFFGHIIIJKMNNNNONNPSUTSSU[begox~}||||}}}|{zyyxwwwwwwwwvvutssrroooonnmmkkkkkkkkkkjijox~ˆ‘™œŸ¤§¦¨©©ª«¬¬±²´¶¸º»»»¼½¾¿ÁÂÂÃÄÄÅÆÇÈÈÊËÌÎÏÑÒÓÔÑÕ×ÕÓÁ£‹pZI6-,&''&%%$###""! !! !6Pu›³ÐâåëëçéççççççççééééééééééééééééééééééééëèçèèÖ±pS<. !!!##"!"$)BhŽ±ÏàåéééêêêëëëëëëëëëëëëëëëëëëëëëëëëëëêêêëëëìììììíííîîîîïîìêèæâáÞÜÜÝßàßáââàÞÞßàáãäåååä‘‘’•˜šš™™šš›œš›œ›žœžŸ ¡¡¡ ¡¡¢¢££¤¢¤£¡¢¤¡›š™œšš›œžŸ ¡¢¡¡¢¤¥¦§¨§¨¨¨©©©ª©©ª«¬®®²²±°¯®¯¬©¬¦–‰k_K6%$2F`vŒ›§ª«°²°²±°°±²´µ²²²²²²²²²³µ¶··¶µ´´´³³²²²¯¯®®®¯°°±²³´´³²±®¤“€mYG<+($##$$$$$%%&''(''(()*++---...//00000122235677778779<>>=CHS`jr‹–•”““““”““’‘Ž’’’’’“““‘ŽŒŒ‹‹‹‹ŠŠ‰‰‡‡‡‡‡‡‡‡†‡†ƒ„ˆ‚ˆŠˆ‡‰Š‰Ž‘’’“”—šœžŸ ¡¡¢¤¥§¨©¨©©ª«¬°°²´¶¸º»º¸¾ÁÀ¿‡paWICB<;;:9877633210/....,+)('&'&%$#"!! #!5Ns˜³ÐâåëëçéççççççççééééééééééééééééééééééééìêèêêÙ´“rU=. !!!!##"""#%?dŠÌÝãéééêêëëëëëëëëëëëëëëëëëëëëëëëëëëëêêêëëììììììííîîîîïïïíëèçãáßÝÜÝßàßáââàÞßßáãåæççææ’’““”•––—˜šššš›ŸžœœžŸ ŸŸŸ ¡¡¡¢£¤¤¢¡ ¥¥¥¤¤££¢¤¤¤¥¥¥¦¦¤¥¦§©ª«¬§¨ª«¬®®®¯¯°°°°°±±²³´´´¸·²²·¸´´µ´²±ª›Œt]B/"#3Hcx’£´»»¼¾½½½½½½½½½¿½»ºº¼¾À¿¿¿ÀÀÀÁÁ¾¿ÀÁÀ¿½¼¼¾À¿½¼½½ÃÂÁÀ¿¿ÀÀ¿µ¡‰s^F4 !!!!!!!!''&&'()).=Qcq“ ¦§¨©©¨§¦ªª«««ªª©««««««¬¬«ªª¨§¦¥¥¨§¥££¥§¨¤¥¦¥¢¡¢£ ›œ›•Œ‡wspllprrsuvwxy{{}‚„……†‡‰‹ŽŽ‘“”––˜™šœž ¡¢¦¦§§§¢–‹zsjc]WUTRPOOOONLIIHGFDDCCBA?><;;86444420....-+*)*(&'5Ty”¹ËÜäèííêëëêêééèèçççèèèéééééééèçæêêêêêêêêëïïêèܼ›wY;-% """#####*>_‡¯ÏâèèêììëêëììììììììììììììììììììììììììììììììììììííîîîíîïïîìëéäáÝÚÚÝàããããâáàÞÝÝßâåçèèè““””•–———™ššššœŸžž ŸŸ ¡¡¡¡¢¢£££¢¢¥¥¥¤¤¤££¤¤¥¥¥¦¦¦§§¨¨©ªªª««¬¬¯¯°°°±±±²²³´µµ¶¶³··³³··³´µµ³±ªšŠr\A."$4Idy“¤µ¼¼½¾¾¾¾¾¾¾¾¾¾½½¼¼½¾ÀÁÀÁÁÁÂÂÂÃÂÂÂÂÂÁÀ¿ÀÂÄÃÂÁÂÃÃÃÃÄÄÄÄĸ¤Œu^D1&6OeyŽ¤²½¾ÀÁÁÀ¿¾ÂÃÃÃÃÃÂÂÃÃÄÄÅÅÆÆÂÂÁÀÀ¿¿¾¿¾¼»»¼¾¿½¾¿¾¼»¼½½º¸¸´¨—Œtg_XSSWVWXYZ\\]``bceghiijkmopqrrstvxz{||}~€‚ƒ……‰‰Š‹Œˆ€xtqmllmnpomkkkkigffecba`_[ZYWUTRRRPNMMLJHFFFEDB@?==<>Ib€–«¼ÍÖÜáãàâââââââââããäåæççççèèèèççççççèèèèèëéææܾžbC3) !! !" !!!""""!!!!""""##$$$$%%&9Z‚«ÌàèéëíîìììíëëëëëëëëìììììììììììììììììììììììììììííîîîîîïïîíëéåâÞÛÚÝàããããâáàÞÝÝßáäæçç甕•–——˜˜—™››ššœžžžžžžŸ ¡ ¡¡¡¢¢¡¡¡¡¢£¤¥¦¦¥¥¥¤¤¤¥¥¥¦¦¦§§ªªªªªªªª®®¯¯®¬¬°°±±±²²²²³³´µ¶¶·³¶·¶¶·¶³´¶µ³±©˜‰p[@-!$5Jez•¦¸¾¾¿ÀÀ¿¿¿¿¿¿¿¿½½¾¿ÀÁÂÂÂÂÂÃÃÄÄÄÅÅÄÃÃÃÃÄÂÄÅÆÅÅÆÈÄÅÆÈÉÉÈÇż¨v^B-0Lg˜°ÁÌÎÏÑÑÑÐÏÓÔÔÔÔÔÔÔÔÕÖ×ØÙÙÚÙÙÙÙÙÙÙÙÙØÖÕÕÖØÙ×ÙÚÙ×Ö×ØÙ×××ÒÀ¤ŽziUF;459;;<=>?@@CDEFHIJKKLMNPQRSSTVXZ\]^``acdefgkjkmonkinpty€ˆŽ‘ŽŒŠ‰‰‰‡…†…„‚€}}{zyvtrqpnljihgecaa`_][YWUUUW_o„’¢¯½ÆËÐÑÐÓÓÔÕÖÖ××ÚÛÜÝßáâââãäææççæåææççèééééççéßÁ¢}bE4*! ! !!!!!""###$%6U~§ÇÝçèêííìëìíëëëëëëëëìììììììììììììììììììììììììììííîîîîîïïïíëêåãßÜÛÝàããããâáßÝÜÜÞáãåæçæ––——˜™™š˜™››š›œžžžžŸ ¡¢¡¡¡¡¢¢¢£¢¡¡¡¢¤¦§¦¦¦¦¦¥¥¥¦¦¦¦§§§¨ªªª«««¬¬®®®®¬°°°°±±²²±±±²³´´µ³µ·¸¸·µ³µ·¶´°¨–†nX>+ %6Lg}˜©ºÀÀÁÁÁÀÀÀÀÀÀÀÀ¿ÀÁÁÂÁÁÁÂÂÃÃÃÄÄÄÇÆÅÄÃÄÆÇÁÂÄÄÃÄÆÈÆÇÉËËÊÈÇÄ»¨w]A+/Jf~˜±ÁÎÏÒÓÔÔÔÓ×××××ØÙÙÙÙÚÜÝÞààáááââãããååäããäååãäåäãâãääãäæäÒ±•{fK6)!"'''()**+,-./012233456788999;=?ABCFGGHIJKLONORTUX\hq}‡“ ¨««©§¦¦¥£¡£¢¡Ÿ›™™˜˜–”‘ŒŠˆ…„„ƒ€~||{ywtrqpoopt~ˆ¥²´¶¶¶º»¼¾¿ÁÂÃÆÇÉËÍÏÐÑÒÓÕÖØÙÚÚÛÜÝÞßàáâäããäæÚ»v_F7.'$&$$#!!!!! !!!!!"""###$(5R{£ÃÚçæèêëêêëììììììììììììììììììììììììììììììììììììííîîîîïððïíëêæäàÝÝÞáâãããâàÞÝÜÛÝßâäååå–——˜™šš›˜š›œ››žžžŸ ¡¢¢¢¡¢¢¢££££¢¢¡¡¢¤¦¨¦¦¦¦¦§§§¦§§§¨¨¨¨¨©©«¬®¯©ª¬®®®®®®¯¯°°°°±±²³´´µµ´µ·¹¹·µ´¶··´°§”ƒkV;)&8Nj™ª»ÁÁÁÂÁÀÀÀÀÀÀÀÀÂÃÃÃÂÁÀ¿ÂÂÂÃÃÃÄÄÆÆÄÃÃÅÆÇÁÂÃÃÃÄÆÉÈÉÊËÊÈÅÃÁ¸¥v]A+/Ke~–¯¿ÎÐÒÕÖ×ÖÖÚÚÙÙÚÛÜÝÜÝÞßáâãäááâããäååæææååæææåæççååæçæææççÙ¹›fG/! !!""##"#$%'()*,,--..//201678?Iar†–§¸ÁÃËÉÇÆÇÆÄÂÃÂÁ¿½¼»º¶µ´²°®¬«ª¨¥¤¤£¡Ÿœš˜•“’’ŒŽ‘“”–—˜™˜—˜šœŸ¡£¥¦§ªª¬®±³µ¶·¸»½¿ÁÁÂÅÅÇÉËÍÎÏÓÓÕØ×È©wfQD<64411/.-,,,**))((('%%%%%%%%%%%%%%%%&0LvŸ¿ÙêæèëëëëìíîîîîîîîîìììììììììììììììììììììììììììííîîîïïððïîìëçåâßÞßáâãããáàÞÜÚÚÛÞáãäää———˜™šš›˜šœœ››Ÿž ¢££££¢¢£££¤¤¤£¢¢££¤¥¦¦¦§§§¨¨¨§§¨¨¨©©©§§©ª¬¯¯¨©«®¯¯¯®®®¯¯¯°°´´µµ¶··¸¶µ¶¹¹¶µ¶¶¸¸µ°¦’hS9('9Plš«¼ÂÁÂÂÁÀÀÀÀÀÀÀÀÄÃÃÂÁÁÀÀÂÂÂÃÃÄÄÄÅÅÄÄÅÅÆÇÅÆÆÅÄÅÈËÉÊÊÉÈÅÃÁÀ·¤Œt]B-/Kf˜±ÂÍÏÑÔÖ×××ÛÚÙÙÚÜÞßÞßßàáâãäãããääååæååååååååæçééççèêéêèæåÚ¼ž€fF. ##",;Yq¥»ÐÚÚáßÝÝÞÞÜÛÛÚÚØ×ÖÕÕÓÒÑÐÎÍËËÆÄÂÁÂÁ¿½¼¼»º¸¶´³±®«©¨£œ–‘‹…‚}ƒ‚ƒ…‡‰‹Œ‘“–˜™šŸ¡£¥§¨¨ª«¯²´¶·»½ÀÄÁ²š‡xm_TNJGEDCB@>===;;987543..--,+**+**)((''(/Hr›»ÖêçéìíììíïîîîîîîîîìììììììììììììììììììììììììììííîîîïððñðîìëçæãàßàáâäããáßÝÛÚØÚÝàâããã–——˜™™šš™šœœœœŸž ¢¤¤¤¤£££¤¤¤¥¥££¤¤¥¤¤¤§§§¨¨¨©©¨¨¨©©©ªª¨¨©ª«¬«¬®¯¯¯®¯¯¯°°°±±´´µ¶¶·¸¸¹µµ¹¹µµ¹·¹¸µ°¥‘gQ8&(:Qmƒ›¬¼ÂÁÁÂÁ¿¿¿¿¿¿¿¿ÂÁÀÀÀÁÃÄÃÄÄÄÅÅÅÆÄÅÆÆÇÇÇÆÈÈÇÆÄÅÈËÉÉÈÇÆÅÄÄù¥‹t]C..Jf˜²ÂÌÍÐÓÕ×××ÛÚÙÙÚÜÞàßßààááââãäääääååäääååäääæçééèçéêéìëæãÙ¾¡‚gG/!$5Sq•°ÈÞèæèçææèèçæçæææååääåääãâááàÜÚÙÙÚÚÙ×ÖÖÖÕÔÒÐÏÏÌÊÈö¥—‹~qic^`fefgikmnoqqstvxyz€‚…†ˆ‰‰Š‹“–˜™›¡¥£˜‹‚wrkfeedaa_^[ZXXXVUSQNLJIEEDB@?>=<;:976447;Pvš¶ÐääæéêêêëíìììììììììììììììììììììììììììììììììììííîîîïðññðîìëèæäáààááäããáßÜÚÙØÙÜßáâââ––—˜˜™šš™›œœœœžŸž¡£¤¥¤¤££¤¤¤¥¥¥£¤¥¦¦¤£¢§§§¨¨©©ª¨¨©©©ªªªªªªªªªªª¯¯°°°¯®°°°±±²²²²²³³´µ¶¶ºµ´¸¸´µº·¹¹µ°¤~eP7&(;Rn„›«¼ÂÁÁÁÁ¿¿¿¿¿¿¿¿¿¾½¾¿ÂÆÈÅÅÆÆÆÇÇÇÄÅÇÈÉÉÈÇÈÈÇÄÃÃÆÉÈÈÇÆÆÆÇÇǼ¦Œt]C/.Id|•®¿ÎÐÓÖØÙÚÚÞÝÜÜÝßâãããããääääââââââââãääååääããåçæååçéåëìçãÚÀ£ƒiI1$ 3Pq˜´ÍâêçìêéêìíìëííííííííêêêéééèèìëêêìíëêéêêéèçåäæåäãÛÉ°‚q^RH@BHIJKLNPQRTUVWYZ[\bcegijjkmnptwz|~}ƒ‡…€{zxwww{€€~}|zwutssrpnkhecbba_][YXWTSRPMKJIKK[}œ³ÊÝßâäæåæçèêêêêêêêêìììììììììììììììììììììììììììííîîîïðññðïíëèçäâáàááäãâáßÜÚÙ×ÙÜÞááâá—˜™š››››žŸ ŸŸ££¢¡¢£¥¦¢¢¢£££¤¤¨¨§¦¦¦§§¦§©©©©§¦¤¥§©ª«¬¬¬¬¬¬¬¬¬¬¯®®®®³²°¯¯°±²·µ´´¶¶µ³¶·¸¹¹¹¹¸¸µº¹®¤“{dM3#+>Uq†œ½ÂÀÀÀ¿ÂÂÂÂÂÂÂÂÀÀ¿¿ÁÃÅÇÅÇÉËËÊÇÆÃÄÆÇÇÆÄÃÇÇÈÈÈÇÆÆÈÇÇÆÆÇÇÈù¤ŠrZ?+.Je~—°ÁÐÓÖØØ×ØÙÛÚÚÜÞààßáááââãããâââããäääåååææçççæææççèèèéåèéåßÇ¥‰iK5!!*Lq”°ÏáçëëëëììíííííííííííììììììììëëëëëëëëêêéééèèèéèêçâÞÅŸcK<-+.*-./12455:;<=?@ABIIJLNOPQSTVY\_abdfekrjeqr†ˆ”š› œ›˜•“‘Ž‹ˆ†…‚}}{xvvtqorpmjhgghbco†ž¯ÀÍÕÚàâäææåèèèèèèèèééêêëêêéêêëëêéèèëìííìíîðìíîíëìíïðñññðîìêçåãàßßáâãæåàÞßÝØÙØØÚÞààß—˜™››œœœŸŸŸŸŸ ¤££¢¢£¤¥¤¤¤¤¥¥¥¦§§§§§§§§§¨©ªª©¨§§¨©ªª«ªª¬¬¬¬¬¬¬¬®®¯¯°°³²±°°±²²¶µ´´¶·¶´¶·¸¹¹¹¹¸·´¹¸¬¢‘ycM2",?Vr‡®¾ÂÁÁÁÀÂÂÂÂÂÂÂÂÀÀÁÁÃÄÆÇÇÇÈÈÈÈÇÇÄÄÆÆÆÆÄÄÆÆÇÇÈÇÇÇÈÇÇÆÆÇÇÈŤŠrZ@+.Je~—°ÁÏÒÕÖÖÖÖ×ÛÚÚÛÞààßáááââãããââãããäääåååææçççæææççèèèéåèéåàȦŠjL6" *Hn‘ÌßæëëëëìììííííííííííììììììììììììììììììëëëêêêëéìéäáÉ£cI8($&! "#$%%&'()*,--/001345578:<?ACDFHGLTQUfq„‘›¬µ·½¶µ²°®¬¬«¬ª§¥¤¢Ÿœ›™–•”’ŽŽ‹ˆ…ƒ€€~„”¤¯ºÃÄÇËÍÏÑÓÓÕÕÖØÙÛÜÝàáâãäääääååææææåêêéèèéëìîïðïîîðòðñññðîìêçåãàßßàáàããàßàßÛØ××ÙÜßßÞ˜™š›œœœœ ŸžžŸ ¢£¦¥¤££¤¤¥¥¦¦¦§§§§¦§¨©©©§§¨¨©ªª©¨¨©ªª««ª©©¬¬¬¬¬¬¬¬®¯±²³³²²±±±²²³µ´³´·¸·¶¶·¸¹¹¹¹¸¶³·¶« vbK1"-@WsˆŸ¯¿ÃÂÂÂÁÂÂÂÂÂÂÂÂÀÁÃÄÅÆÆÆÈÇÆÅÅÆÇÈÄÅÅÆÆÅÅÄÅÆÆÇÇÈÈÉÈÈÇÇÇÇÈÈź¥‹s[@,-Id}—°ÀÍÐÔÕÕÔÕÖÛÚÙÛÞààßáááââãããâãããääääåååææçççæææççèèèéåèéæáʨŒkM7#)Ci‹¨ÈÝåëëëëëìììíííííííííììììììììììììììììîîííììììíëîìçåͨ…fJ6$ !!"""##%&()*+*-+-45AYr‹ ²ÈÒÔÚÔÓÒÐÏÎÎÎÎÌÉÈÇÆÃÁ»¹¶µµ´±¯°¯ª¦¢Ÿ œœ¡§©°®®°²´·¹»¼¿ÂÅÉËÍÑÒÔÖØÙÙÚÜÝßàâãããççççèêëìíîððïîðòðñññðîìêçåâàÞßàáÞáâßßáàÝ×ÖÖØÛÝÝÝ™™›œ¡ Ÿžž¡£¥§¦¦¥¥¥¥¥¦¦¦§§¨¨¨¥§©««ª¨§©©ªªªª©©©ªª«¬«««¯¯°°±²³³²²²²²³³´´³³´·¹¸·¶·¸¹¹¹¹¸·´¸¶ª Žu`J0!.AYtŠ¡°¿ÄÂÂÃÃÃÃÃÃÃÃÃÃÁÂÄÆÇÇÆÆÇÇÆÅÅÅÅÆÅÅÅÅÅÅÅÅÅÅÅÆÇÈÉÊÉÈÇÇÇÇÈÉÆ»¦‹s[@+-Hd|–¯ÀÎÐÔÕÕÕÕÖÚÙÙÛÞßßÞáááââããããããäääåååååææçççæææççèèèéåèéæâ̪ŽmO8#'?d‡¤ÅÜåìêêëëëìììììììììììììììììììííííííííîîíííìììíëîìéçѬ‹kN9& !!"!%""%%4Ps’ÄÚãâææåäããããäâàÝÝÝÜÙ×ÓÑÏÎÏÎÌÊÊÊÉÇÄÀ¼º½¹´±¬¦ ™”‘’•—šžŸ¡¥©°²µ¶¹¼¿ÁÂÃÉÊÍÐÓÕÖÖÙÛÞâçêêêéëíîííîïðñññðîìêèæâàÞÞßàÞáâßÞàßÜØ××ÙÜÞÝÝššœžžžž¢ ŸžŸ¢¤¦§§§§§§¦¦¦¦¦§§¨¨¨¦§ª¬¬«©¨««ªªªª««§¨ª¬®®®²±±±±±±±²²³³´´´´µ´³µ¸¹¹¸¶·¸¹¹¹¹¸¹µ¹·«Ÿu^H. /CZv‹¢±ÀÃÂÃÄÄÃÃÃÃÃÃÃÃÂÃÅÇÇÇÆÅÅÆÈÈÈÆÄÂÅÅÅÅÅÅÅÅÅÅÅÅÆÈÊËÉÉÈÇÇÈÉÉÆ»¦‹rZ?*,Hc|•®¿ÏÑÕÖÖÖÖ×ÚÙÙÚÝßßÞáááââãããããäääååååååææçççæææççèèèéåèéæãÎoQ:$%=b„ ÂÚåíêêêëëëììììììììììììììììììíííííííííìììëëëêëêíìééÔ°oQ;'!"#"!" .Jq“³ÌâéæêëëêêêêëìêèææææäãæäââââàÞßßàßÞÛÙ×ÚÖÏĶ¦•Šƒzstwwz€}~„‡ŠŽ’”—›ž¡£¤ª¬¯³¶¹»¼½ÁÉÔßåçæèëíîîíîïðñññðîìêèæâßÝÝÞßßãâßÝßÝÙÚÙÙÚÝßÞÝš›œžžŸŸž¡ ¡£¥§¦¦§¨©©¨¨§§§§¨¨¨©§¨ª«¬¬««¬¬«ªª«¬¬§¨ª¬®¯¯°®®®®®®®®²²²±±°°°±²´µµ¶µµ¶µ´µ¸¹¸·¶·¸¹¹¹¹¸º¶¹·ªŸŒs\F-0D\x¢±¿ÂÁÂÄÄÄÄÄÄÄÄÄÄÃÄÅÆÆÆÆÆÅÇÉÊÉÇÄÁÆÅÅÄÄÅÅÆÇÆÅÅÆÇÉÊÉÉÈÈÈÈÉÉÅ»¥ŠqY>)+Gb{”¾ÏÒÕÖÖÖÖ×ÙØØÚÝßÞÝáááââãããääääåååæåååææçççæææççèèèêåèéçäЯ“qS;%$;_€œ¿ØãìéêêêëëëëëëëëëëëëììììììììììììììììëëëêêêééêéìëéêÖ³’qR<'!!" ,Fk³ÎåìêîíììëëìííîìëëííìêìêééêêèçèèééééèèèèáÑ»¢†rk^UVXVX^bcegjlnotvy}„†‡‰‹“—šœžŸ¤¯ÀÓáèêéìðññðññðñññðîìêèæâßÝÝÝÞàââÞÝÞÝÙÛÚÚÛÝßÞÝ›œžŸŸŸŸ ¡¢£¥¦¦¤¦¨©«««ª¨©©©ªªªª¨©ªª«¬¬«ªª«¬©ª¬®¯¯®®®®®®®®®°°°°±±±±±²´¶··¶¶¸¶µ¶¸¸·¶¶·¸¹¹¹¹¸¹µ¸¶¨Šq[E, 1E]yŽ¢±¾ÁÀÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÅÆÈÉÉÉÈÇÅÄÆÆÄÄÄÄÆÆÉÈÆÅÅÆÈÊÊÉÉÈÈÉÉÊ変pW<'+Fbz”½ÍÐÔÕÕÔÕÖÙØØÚÝÞÞÝáááââãããäääåååææåååææçççæææççèèèêåèéçåѱ”sT<	\}˜ºÔàêééêêêëëëëëëëëëëëììììììììììììììììëëëêêêééêéìëêìÙ¶—uV>(!! !!!! +Ce‹¯ËãëêðííììëììíîìëìîïîíìêééëëêèêêéééêëëéíéØÀ¢eVG<>?:;AFGIKMOQRTVY]adfggimqvy{|€ƒŽ£½ÖæìèìðñññññðñññðîìêèæâßÝÜÝÝÝàáÞÝßÞÛÛÙÙÚÜÞÝÜ›œžŸ ŸŸ ¡£¥¥¦¦£¥§ª¬¬¬¬ªª«««¬¬¬ª©©ª«¬®®®««««®¬®®®®®®®®®®®®¯°²²³±²´¶···¶¹·¶¶¸¸·µ¶·¸¹¹¹¹¸¸´·´§›ˆoZD+ 1E]z¢°¾Á¿ÁÃÄÄÄÄÄÄÄÄÄÅÄÃÂÂÄÅÆÌËÉÇÆÆÇÇÇÆÄÃÃÄÆÇÊÈÆÅÄÆÈÉÊÉÉÈÈÉÉÊĹ£ˆoV;&*Faz“¬½ÌÏÒÔÓÓÔÕÙØØÚÜÞÞÝáááââãããäääååæææåååææçççæææççèèèêåèéçåÒ²•tU='"7Zz•·ÑÞçéééêêëëëëëëëëëëëììììììììëëëëëëëëììëëëêêêëéììëíÛ¸{ZA*"" !" *Acˆ¬ÈßççíîíìëëëììëêéêìíìëîíììîîíëîíìêêëíîéïïáÉ©ƒgK;011,+1,-/1468979<@DFHIJMPTY\^_egp†¥ÅÛææéíïïîïïðñññðîìêèæâßÜÜÜÝÚÞßÝÞààÝÙØØÙÛÜÜÚœœž ¢¤¥£¡ ¢¦¨§¥«¨§ªª§§ª«««¬¬«ªª«¬¬®®¯¬¬¬®®®®®¯¯¯±°®®°±¬®°±±²´¶±²³´¶·¸¹·¶µ¶¸¹¸·¶·¸¹¹¹¹¸·¹·²ª›„pUA) 1F^z¦²½¿¿ÁÂÂÄÄÅÅÅÆÆÆÄÃÁÀÁÂÅÆÊÉÇÇÇÇÉÊÅÄÃÁÁÂÃÃÅÅÆÆÆÅÄÄÉÉÉÉÉÉÉÉĹ£ˆpX>*(C_x©½ÎÔ×ÕÔÖÖÔÙÚÚÛÛÜÝÝÞßàâääååååæææåääååååååååçççèèééééåéêèçÖ¹—wZA)4Pv–²ÍáêèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëëëëëëëëëëèìíëìÝÀŸ{\G0#! !*5Y€§ÅÞèéïëììííììëììììììììììììììììììììììììëíìãÒ²‡eP<1.''*&))))))))*+,./123679;>@BCJKVo”ºØçåèìîîîïððïîïðïìéæàÝÞÝÙØÙÝÝÜÜÝÝÞßÛÙØÙÛÛÚÙžŸ¡£¤¥¤£¢¤§©©§ª§§««¨¨«««¬¬¬«««¬®®¬¬®®®®®¯¯¯°°¯®®¯°°¯±±±±³µ²²³´¶·¸¸¸¶µ¶¸¹¹···¸¹¹¹¸¸·¹·±©šƒoT@) 2G_{¦²½À¿ÁÂÂÄÄÄÅÅÅÆÆÆÅÃÂÃÄÆÈÉÈÇÆÆÇÈÉÇÆÅÄÃÄÄÅÄÄÅÅÆÅÅÅÉÉÉÉÉÉÉÉź£‰pX>*(B_wŽ¨½ÏÕØÖÕ×ØÕÙÙÚÚÛÜÜÝÞßáâãääääååææåääååååååååçççèèèéééåéêèç×¹˜xZB)1Ns”°ËßéèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëëëëëëëëëìèëìêëÞá}]H1$! !)4V|£ÂÜæçîêêëììëêêììììììììììììììììììììììììëíìäÓ´‰gQ=2.''*&))))))))((()**++()*,.02213?Y¬ÎàåèìíîîîððïîïðïìéæàÝÞÜØ×ÙÛÛÛÛÜÜÝÝÝÛÚÚÜÝÜÚžŸ ¢£¥¥¥¥¤¦©«ª©ª§§«¬©ª¬¬¬¬¬¬¬¬®®®®¬®®®®®®®®¯¯¯¯°°¯¯¯¯°°¯°²²±±²´²³³´¶··¸¸·¶·¹º¹¸¸¸¹¹¹¸··¸¹·±¨™mS>' 3G_{§³¾ÀÀÁÃÂÃÃÄÄÄÅÅÅÇÆÅÄÅÆÈÉÈÈÇÆÆÇÈÈÉÈÇÆÆÆÆÇÃÄÄÅÅÆÆÇÈÈÈÈÈÈÈÈź¤‰pX>*(B_wŽ¨¼ÍÓÖÔÔÖÖÔØØÙÚÛÛÜÜßàáâããââääååååääååååååååççççèèèééåèêçç׺™y\C).JpÈÝçèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëëëëëëëëëíéëëèëàȤ€`J2$! (2Qw½ÙäæìééêëëêééììììììììììììììììììììììììëíìåÖ¸kS?3/''*&))))))))&&&&&&&&$%%'()**%'2Lu£ÉßåèëíííîïðïîïðïìéæáÝÝÚÕÕØÙÙÚÛÛÛÛÛÜÚÙÙÚÛÛÚžŸ¡¢¤¥¥¥¥¥¦§©ª««ª¨¨¬¬ª«®¬¬¬¬¬®¯¯¯®¬¬®®®¯¯®¯¯¯¯¯¯¯°°°¯¯°°°°²³²±±²³³³´µµ¶··¸·¶·¹ºº¸¸¸¹¹¹¸·¶¸¹·°¦—~jP<&!4H`{¦³¾À¿ÁÃÂÂÃÃÃÄÄÄÄÆÆÅÅÅÆÇÈÇÇÆÆÆÆÇÇÈÈÇÇÆÆÆÆÃÃÃÄÅÆÇÈÇÇÇÇÇÇÇÇź¤‰pX>*'A^v§¼ÉÏÒÑÐÓÓÑ××ØÙÚÛÜÜààáâââááããäååååäååååååååææçççèèèéåèéççØ»›{]D*,HmŽ«ÇÜçèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëëëëëëëëëíéëéçëãͨƒcL3%!&/Mr˜¸ÖãæëéêëëëëêéììììììììëëëëëëëëììììììììëììçÚ½“pWB50''*&((((((((&&''''''))))**++*+2IpžÇßäçëíííîïðïîïðïìéæáÝÛ×ÑÑÕ×ØÚÛÜÛÚÙÚ×ÕÕ×ÙÙÙ ¡£¤¥¦¦¥¤¥§¨¨©ª«¬©©««®¬¬®¯°°°¯¯®®®®¯¯¯°¯¯¯¯¯¯¯°°°±±°°°±²³³²±²´³³´µµ¶··¸·¶·¹º¹¸·¸¸¹¹¸··¹¹¶¯¥”|gN:$"5Ia{¦²½¿¿ÀÂÁÂÂÂÂÃÃÃÄÄÄÃÄÄÅÅÆÅÅÆÆÆÆÅÅÆÆÆÆÆÅÄÄÃÃÃÃÄÆÈÉÇÇÇÇÇÇÇÇĹ£ˆoX=)&@]uŒ¦»ÈÎÑÐÏÒÓÑÕÖ×ØÙÛÛÜßàáââááàââãäåååäååååååååæææçççèèéåçèæçÙ¼}^E*+FkŒ©ÆÝèèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëëëëëëëëëíêëéæëæѬ‡fO5&!$-Im“´ÔãæìëëìííìëëììììììììëëëëëëëëììììììììëììèÞÙvZE71''*&((((((((%%&'(())((((((((++0Dh–ÁÛäçêìììíîðïîïðïìéæáÝÙÒËËÐÕ×ÙÜÜÛØ××ÕÓÓÖÙÚÚ¡¢¤¦§§¦¥¤¦¨©¨©«®««®®««®®¬¬¯°²¯¯¯¯®®®®®®®®¯¯¯°°°°°¯¯¯¯°°±±±±°°°²³³²²´µ´´´µµ¶¶¶·¶µ¶¸¹¸·¶·¸¹¹¹¹¸¹¹¶®£’ydL8""6Ja{¤°»¾½¿ÀÀÁÁÁÂÂÂÃÃÂÂÂÃÃÃÄÄÄÄÅÆÆÅÄÄÄÅÅÅÅÄÃÂÅÄÃÃÄÅÇÈÆÆÆÆÆÆÆÆø¡‡nV<(%?\t‹¥ºÉÏÓÒÒÔÕÓÔÔÖ×ÙÚÛÜÞßàáââááááãäåååäåååååååååæææççççéåççæçÙ¾Ÿ~`F+(Dh‰§ÅÜèèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëëëëëëëëëìéìêçìèÕ±‹iQ7&!"*Eh°ÒâæëëìííííìëììììììììêêêêêêêêìììììììììììêâÈž{^G92('*&''''''''$$%%&'((''''&&&&)(-?b½ØãæêìììíîðïîïðïìéçâÝÖÍÄÅÊÑÔØÛÛÙÖÔÕÒÑÑÕÙÛÜ¢£¥§¨¨¦¥¦¨««ªª¯°¬¯®ªª¬¯®¬¯²³®®¯¯¯¯¯°®®®¯¯¯°°±±±°°¯¯¯°°±²²±°°¯±³³³³µ·´´µµµµ¶¶¶´´µ·¸·¶´µ·¸¹ººº¹º¶®¢‘wbJ6!#6Kb{£¯º¼¼½¿¾ÀÀÁÁÁÂÂÂÁÁÂÃÃÃÃÃÃÄÅÆÆÅÄÃÄÅÅÆÅÄÃÂÇÆÄÃÃÄÆÈÅÅÅÅÅÅÅÅÁ¶ …lU:&%?\t‹¥¹ÉÏÓÒÒÕÖÔÓÔÕÖØÚÛÜÝÝßàáâââàáâãäåååååååååååååæææçççéäæçæçÚ¾ €aF+%@e†¤ÂÚæèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëëëëëëëëëêéìëçíé×´ŽlS8'!!)@cˆ«ÏáäêêëììììëêììììììììêêêêêêêêìììììììììììëåÍ¢`I:2('*&''''''''&&&&&&''((((((((*)->_Œ¸ÔãæêìììíîðïîïðïìéçâÜÔȾ¾ÄÍÐÕØÙÖÒÏÎÌÊÌÐÖÙÚ¢¤¦¨©¨§¥§ª«¬®±²®¯®ª©¬¯®¬¯²´®®¯¯°°±®®®¯¯°°°±±±°°¯¯¯¯°²³³²°¯®°²³³´¶¸´´µµµµ¶¶µ´³´¶·¶µ³´¶¸º»»»ºº¶¢vaI5 #7Lb{¢®¹»»¼¾½ÀÀÀÁÁÁÂÂÁÂÃÃÄÄÃÃÂÃÅÅÅÅÃÂÄÅÆÇÆÅÃÂÈÆÄÃÂÄÆÇÅÅÅÅÅÅÅÅÀµŸ„kT9%$>[tŠ¥¹ÇÍÑÐÐÓÔÓÒÓÔÖØÙÛÛÛÝÞàââããàáâãäååååååååååååååææçççéäæçåèÚ¿¡€aG,#>cƒ¢ÀØåèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëëëëëëëëëéèíìèíê×µmT8'! (=_„§ÌßãèéêêëëêêéììììììììêêêêêêêêììììììììììììæÏ¥bJ;3('*&''''''''+**)('&&'''''(((+*-;Z…°ÌãæêìììíîðïîïðïìéèãÜÓÅ»»ÁÊÍÒÖÖÔÏÌÇÅÃÆËÐÕÖ£¤§©««ª©«««¬¬¬¯¯®®®«¬®¯°°±±±±±±±±±²²²²±°¯°°°°°®¬®®®°´·²²²²²²²³³³³´´µµµ´µ·¹¹·µ´µµ·¸¸¸¸¸¹¹µ¬ s^H5 $8Lc|¦°¹»»½½»¿¾¾¾¿ÀÁÁÃÂÀ¿¾¿ÀÀÁÂÃÄÄÄÄÃÃÃÃÃÃÃÃÃÃÃÃÄÄÅÅÆÃÃÃÃÃÃÃÃÀ´‚jS:&#;Wq‰£·ÄÌÑÐÎÐÑÐÓÔÕÖØÙÚÚÛÜÝÞßàßßââááââãääåæççççæååååååååæäèéæçÚ¿ ~aK0$<_‚ ½ÖçæèêêéééêêêêêêêêêêêêêêêêêëëëëëëëëìëëêêëëìíçéëéìæÕ¹“pV9'!!;Y‚¦ÂÙåêèéêëëëëêëëëëëëëëêêêêêêêêììììììììêìëèåÔˆgM;2)),(&&&''(((''''''''((((((((&+*4W¬ÑÜåìììîïïñðïïððîìèÞÙͺ·¾½ÁÌÖ×ÕÒÍȺ´·ÃÎÔÕ¦¦¦§¨ª«¬««¬¬¬¯¯¯®®®¬¬®¯°°±±±±±±±±±±²²²²±°¯°°°°°¯®¬®®¯²´¯°°°±²²²³³³´´µµµ³´¶¸¸¶´³µ¶··¸¸¸·¸¸³ªž‹q\G4 $8Mc}¥¯¸ºº¼¼»¾¾¾¾¾¿ÀÁÂÁÀ¿¾¿¿À¿ÀÁÂÂÂÂÁÃÃÃÃÃÃÃÃÂÃÃÃÄÄÅÅÅÅÅÅÅÅÅÅÀ´žƒjS:'#;Wp‰£·ÂÊÐÏÎÑÓÒÔÔÕ×ØÙÚÚÝÞßàáááááááááâãäääåæççææååååååååæãçèæçÚ¿¡~aK0"9\ºÔåæèêêéèéêêêêêêêêêêêêêêêêêëëëëëëëëìëëêêëëììçéìéìçÖ»”qW:(!!6T}¡¾ÕãèèéêêëëêêëëëëëëëëêêêêêêêêììììììììêìëèåÕ®‰jP=3('*%&&&'''((''''''''((((((((&+)2S{¦ËÜåëìëîïïñðïïððîìëáÙ˶°µ³ÂÍØÚÙÖÏÉÀ¸±´¿ÌÓÕ¨§¦¦§ª¬®¬¬¬®®°°¯¯¯®®®®®¯°°±±±±±±±±±±²²²²±°¯¯°°°°¯®®®¯®¯±®¯°±²³³³³´´µµµ²³µ¶¶µ³²µ¶¶·¸···¶¶±¨œ‰oYE3#8Md~’¤®·¸¹»»¹¾½½½½¾¿¿ÁÀ¿¾¾¾¿¿½¾¿ÀÀÀ¿¿ÂÂÂÂÂÂÂÂÂÂÂÃÃÃÃÄÄÄÄÄÄÄÄÄÀ´žƒkT;'#:Vpˆ¢¶ÀÈÏÏÎÒÔÓÔÕÖ×ØÙÚÚÜÝÞßààààáààààáâããäååææååäääåååååæãçèåæÚ¿¡bK0 6Xz™¶Ñãæèêêéèéêêêêêêêêêêêêêêêêêëëëëëëëëëëêêêêëëìçêìèëç×½—tZ<)" 1Nw›¹ÑáçèèéêëëêêëëëëëëëëêêêêêêêêììììììììêìëéæÖ°ŒnS@4(&(#&&&&'''(''''''''((((((((&+(/MtŸÄÛäëëëîðïñïïðññïííâÚ̶°³¯ÀÌ×ÛÚ×ÏȽµ¯ºÈÒÖ¨¨§¨©«®®®®¯±°°°¯¯¯¯®®¯¯°°±±±±±±±±±±±²²²²±°¯¯°°±±°¯¯¯°°°®¯°®°±²³´³³³´´µµµ²³´´´´³²µ¶¶···¶¶µµ°§šˆmXC1#8Ne“£¶·¸ºº¸½½¼¼¼¼½¾¿¿¾¾¾¾¾¾½½¾¿¿¿¿¿ÁÁÁÁÁÁÁÁÁÁÁÂÂÂÂÂÁÁÁÁÁÁÁÁ¿´ƒkT;(#:Vo‡¡´ÁÉÏÎÎÑÓÒÔÕÕÖ×ØÙÙÙÙÛÜÝÝÝÝßßßßßàááââãäååääãääääåååæãæçäæÚÀ¢€bL14Uw•³ÏáåçéêèèèêééééééééééééééééêêêêêêêêëëêééêëëìçëìèëèÚÀšw]?+" -Iq•³ÎßççèéêêêêéêêêêêêêêêêêêêêêêëëëëëëëëêìëéçسoUA5)'(#%%&&&'''&&&&&&&&''''''''%*',Io›ÁÚãêëëîðïðïïðññïííâÛϽ¸»·¼ÈÓØÙÖÍÄ»´¬·ÆÒئ§©«¬¬¬®®®¯¯¯¯±±±±°°°¯°°°°±±±±±±±±±±±±±²²²²±°¯¯°°±±±°°°²³²°¯°±®¯°±²´µµ³³³´´µµµ²²³³³³²²µ¶¶··¶µµ¶µ±§š‡lW@/$8Nf€“£µ··¹º¸¼¼»»º»»¼½½¾¾¾¾¾¾½¾¿ÀÀÀÀÀ¿¿¿¿¿¿¿¿ÁÁÁÀÀÀÀÀÀÀÀÀÀÀÀÀ¾²œ‚jT;("9Un†Ÿ³ÂÊÐÏÍÏÐÏÔÔÕÕÖ××××ØÙÛÛÜÜÜÞÞÝÝÞßààááâãããããâããääåååæãææãåÙÀ£cL13St’±ÎàåçééèçèéééééééééééééééééêêêêêêêêëêééééêëìèììçêéÜÄž{`B-#+Fl¯ËÞççèééêêééêêêêêêêêêêêêêêêêëëëëëëëëëìëéèÚ¶“pUA6*(*$%%%&&&''&&&&&&&&''''''''#)&*Fl™ÁÙâêêëîðïðïïðòòðïíâÜÓÿ½¼ÆÑ×Ú×ÎÄ»´¶ÅÒÚ¦¨ª®®¬®®¯¯¯°°°²²²±±±°°±±±±±±±±±±±±±±±±±²²²²±°¯¯°°±²±±±°²´´²±±²¯°±²³´µµ³³³´´µµµ³³³³³³³³µ¶¶¶¶µ´´µµ°¦™†kU>-%9Oe“£¶··¹º¸¼»ºº¹¹ºº»¼½¾¾¾½½¾¿ÀÁÁÁÁÀ¾¾¾¾¾¾¾¾ÀÀÀ¿¿¿¿¾Â¼°š€iR:'"9Tm„ž²ÃËÐÎÌÎÏÎÒÓÓÓÔÔÕÕØÙÛÜÝÝÝÝÝÝÜÜÝÝÞßßàáââââáâââãääååçãååâåÙÀ¤‚dM11PpŽ®ÌßäæééèçèéèèèèèèèèèèèèèèèèééééééééêêééééêêëèììçêêÞÇ¡dD.$*Di‹«ÈÜæççèéééééééééééééêêêêêêêêêêêêêêêêëìëééܹ–qVB7+(*%$%%%&&&&%%%%%%%%&&&&&&&&#)&)Ci–¿ØáéêêîðïðïïðòóñïðäÝÔÅÁ¼¾ÇÑ×ÛÚÒÇ»µ®®¶ÄÑÙ¨©ª¬®®®¯¯¯°°°±±³³²²²±±±²²²²²²²²±±±±±±±±±²²²²±°¯¯°±±²²²±®°³³²±±±°°°±²²²³³³³´´µµµ´´³³³³´´¶¶¶¶¶µ´³´³®¤—ƒiS<+&:Oe~’¤®¶¸¸º»¹»»º¹¸¸¹¹º»¼½¾½½¼¾¿ÀÀÁÁÀÀ½½½½½½½½À¿¿¿¾¾½½ÁÁÁÁÁÁÁÁº¯™gQ9&"8Tl„±ÁÉÏÎÌÏÐÏÑÑÑÒÒÒÓÓØØÚÛÜÜÜÜÜÜÛÛÜÝÞÞÞßàáááááááâãääååçãåäáäÙÀ¥‚dM1.LlŠªÉÝäæèéçççéèèèèèèèèèèèèèèèèééééééééêééèèééêëèíìæêëàʤfF0$(Bf‡¦ÄÚäæçèééééèééééééééêêêêêêêêêêêêêêêêëìëêêÝ»™tYE8+'("$$%%%&&&%%%%%%%%&&&&&&&&%+'(?d‘º×áèêêîðïðïïñóóòðñåÞÖÇÄŽ¿ÇÏÕÚÛÓɺµ¯®µÂÏ׫ª©©«°±¯¯°°°±±±³³³²²²±±²²²²²²²²±±±±±±±±±²²²²±°¯¯¯±²²²²²¬¯±²±°°±¯°°°°°°°³³³´´µµµµ´´³³´´µ¶¶¶¶¶´³³²±¬¢•fQ;*&:Ne~‘¤®·¸¹»»¹»º¹¸¸¸¸¸¹º¼½¾½¼¼½¾¿ÀÀÀÀ¿½½½½½½½½¿¿¿¾¾½½¼¿¿¿¿¿¿¿¿¹˜~fP8%"8Tlƒ°¿ÇÍÍÍÐÒÑÐÐÐÑÑÑÑÑÕÖ×ØÙÙÙÙÜÛÛÛÛÜÝÞÞßààááàààáââãäååçãääáäÙÀ¥ƒdM1,Ii‡§ÆÛäæèèçççèèèèèèèèèèèèèèèèèééééééééêééèèééêëéíìæéëáË¥ƒgG0%'Ad„£Á×âæçèééééèééééééééêêêêêêêêêêêêêêêêëìëêêÞ¼šx\F9*&& $$$%%&&&%%%%%%%%&&&&&&&&',''=`Œµ×àèéêîðïðïïñóôòðñåßØËÉʽÄÌÑ×ØÑǹ´¯¯µÀÌÔª©¨ª¬¬¬®¯±²³³´´µµ´²°¯³³²²³µ·¸²²²²²²²²±±²²²±°¯²²³³³³³´±±±±±±±±²²²²²²²²´³³³³´µ¶´´³³³²²²²²²³´µ¶·²²¡“€gT:)';Pf’§°¶¶¶¹»»·¸¹º¼¼¼¼º»¼½½½½¼ÀÀ¿¾¾¿ÀÀ»»»»¼½¾¾½½¾¾¾¿¿¿»½¿¿¾¾¿À½®—gN5& 6Qkƒž²ÃÈÎÐÏÏÑÓÐÐÐÐÑÒÓÔÖÖÖÖ×ØÙÚÚÙÙØÙÚÜÝÜÜÝÞßßààÞàâãããäåäâææâãÙÁ¤‡eK5!+GjŒ©ÅÙäéìéçééæèèèééêêêééééééééééééééééééééééééìêéééèåã̪ƒfN6% %;]ƒ¥ÁØåæçèééééèèèèèèèèèèèèèèèèèèèèèèèèèççëëçâÆœ}\C8*$$ """##$$$$$$$$$$$###$$%%%$+''9X…±ÐéæéïìòíðððññòòòñèÞØÕÒÍɾÃÌÕÚ×Ðʽº¶´·ÀÌÕª©©ª®¬®®°±²³´´´µµ´²±°²²±±²´µ¶²²²²²²²²¯°±²²²²²´³³³³³³³³³³³³³³³²²²²²²²²³²²²²³´µ´´´³³³²²³³³³´µ¶·±±« ‘}eQ9)(=Rh•¦¯¶··¹»º·¸¹ºº»ººº»»¼½½¼¼¿¿¾½½¾¿¿ººººº»¼½¼¼½½¾¾¾¾»½¿¿¾¾¾¿¼®—gM5% 6Qkƒ±ÃÈÍÏÎÍÏÑÏÏÏÐÐÒÓÔÕÕÕÕÖ×ÙÚÚÚÙØØÙÛÜÜÜÜÝÞßßàÜÞáâááâãåäèçäåÛÃ¥ˆeL6!)Dgˆ¥ÁÕàæéçæééçèèèéééêêééééééééééééééééééééééééìêéééèåãά„hO6%%:\£À×äæçèééééèèèèèèèèèèèèèèèèèèèèèèèèèèçëëçãÇž^E9,&&""""##$$$$$$$$$$$###$$%%%#)&%7TÎèåéïìòîðððññòòòñêàÚ×ÔÐËÁÆÍÕÙ×ÒÍÆÄÀ½¾ÆÑÙ«ªª«¯®®¯°±²³´´´µµµ´³±±±±±±²³´µ³³³³³³³³®¯°²³´´´µµ´´³²²²´´´´´´´´²²²²²²²²²²±±²²³´µµ´´´³³³³³³³´µ¶·²²¬ ‘}eQ8()>Tk„—¥¯·¸¸ºº¸··¸¹¹¹¸¸¹º»¼¼¼¼»¾½¼¼¼¼½¾¹¹¹¸¹ºº»»»¼¼¼½½½»½¿¿¾½¾¿»–~fM5% 6Qj‚±ÂÇÌÎÌËÌÎÏÏÏÏÐÑÒÓÕÔÔÕÕ×ØÙÚÚÙØØØÙÙÛÛÜÜÝÞßßÛÝßàßßàáåãææâäÚÃ¥ˆfM7"%@c„¡½ÑÜâæååèéçèèèèéééêééééééééééééééééééééééééëéèèéèåãѯ‡jQ7%#8Y~ ¾ÖãæçèééééèèèèèèèèèèèèèèèèèèèèèèèèèèçëêçäÉ¡ƒaH;-''#"""##$$$$$$$$$$$###$$%%%"(%%4O{©ËæåéïìòîðððññòòòòìãÝÚØÓÐÈÊÏÕØØÔÐÌÊÆÂÂÈÐ׬««¬¯°¯®°°±²³´´µµµµ´´³³²²²²²³´´µ´´´´´´´´°°²³´´´´¶¶µ´³²²±²²²²²²²²³³³³³³³³³³²²²³´µ¶µµµ´´´´´´´´´µ¶·µµ¯¢“fR7')>Tl…™¥¯¸º¹º¹···¸¸¸·¶¶¹¹º»»»»»¼¼»ºº»¼¼ºº¹¹¹¹º»ººº»»¼¼¼»½¿¿½¼½¾º«•}eM5% 6Qj‚œ°ÁÆËÌÊÈÉËÎÎÎÎÏÐÒÒÓÓÓÓÔÕ×ØÚÙØØ××ÖÖÚÚÚÛÜÝÝÞÛÝßßÞÞÞàáßââÞáØÀ¦‰hN8"$>`€ºÎÜâæååèéçççèèèéééèèèèèèèèèèèèèèèèèèèèèèèèêéèèèèåãÔ²ŠmS8%!5Vzœ»ÔâæçèééééèèèèèèèèèèèèèèèèèèèèèèèèèéçêêèåÌ¥†cI;-&&""""##$$$###########$$%%%#(%%3Ju¥ÇääéîëòïðððññòòòóíçáÞÛØÕÏÐÒÕØÙ×ÕÒÐÌÈÇÉÏÔ®¬°±±°²²³³´µµµµµµ´´´´´´´µµµµµµ´´´´´´´´³³´´´´³²·¶¶µ´³²²²²²²²²²²³³³³³³³³µ´´´´µ¶·¶¶¶¶µµµ´µµ´´µµ¶·¶µ¯¢’}dP5&(>Tk…˜¥°¸º¹¹¹¶¶··¸··¶µ¸¸¹º»»ºº»»ºººº»»¼»ºººº»»ºººº»»¼¼»½¿¾½¼¼½¹ª”|eL4% 6Qi›¯ÀÅÊËÉÇÈÊÍÍÍÍÎÏÑÑÒÒÒÒÓÔÕÖØØ××ÖÖÕÔØÙÙÚÛÜÜÜÛÝßàÞÝÞßàÝààÝà×Á§ŠiP9##=^~›·ÌßåèæåçèåçççèèèééèèèèèèèèèèèèèèèèèèèèèèèèéèççèçåãÕ³ŒoU:&2Rv˜¸ÒáæçèééééèèèèèèèèèèèèèèèèèèèèèèèèèêèêêèçЩˆeI;,%%!"""##$$$###########$$%%%%)&'2Ep¢ÃâäéîëòððððññòòòòïêåáÞÛÚÖÕÕ×ÚÛÚØØ×ÔÑÎÏÓÖ¯®¯±²²±´´´µµµ¶¶¶µ´´´´µµµµ¶··¶¶µµµµµµµµµ´µµµµ´³²¶¶¶µ´´³³µµµµµµµµ´´´´´´´´¶µµµµ¶·¸···¶¶¶µµ¶¶µµµµ¶·³²¬žŽy`K4%)>Tk„—§°¸¹¸¹¹¶¶¶·¸¸····¸¹¹ºº¹¹»»ºººº»»¼¼»ºººº»ººº»»¼¼¼»½¿¾¼»»¼·©“{dL4% 6Pi€š®¾ÃÉÊÈÇÈÊÍÌÌÍÍÏÐÑÑÑÑÑÒÓÔÕÕÕÖÖÖÕÔÔ××ØÙÚÚÛÛÛÝßßÞÝÝÞáÞáàÝáÙç‹jQ;$#<\{˜µÊßåèæåççåæçççèèèèççççççççççççççççççççççççèçæçèçåãÔ³pV;'0Or•µÐàæçèééééèèèèèèèèèèèèèèèèèèèèèèèèèêèêéèéÓ‹gK;+$$!"""##$$$""""""""###$$%%%&)&(0@jžÀßãéíêóñðððññòòòñïìèäáÞÝÛÚÙÚÜÜÜÚØ×ÖÓÑÐÓÕ°¯®¯²³³²µµµµ¶¶¶·¶µ´³´´¶¶´µ¶·¶¶´´¶¶¶¶¶¶¶¶³´µµ¶µµµµµµµµµµ´µµµµµµµµ´´´´´´´´µµ´´µµ¶·¸¸···¶¶¶·¶¶µµµ¶·²±«Œw]I2$+@Ul…˜©±¸·¶¸¹·µ¶·¸¹¹¹¸¶·¸¹¹¹¹¸¼»ºººº»¼»»º¹¸¸¹¹»»»»¼¼¼½»½¿¾¼ºº»¶¨’{dK4$ 6Ph€™½ÂÈÊÉÈÉÌÌÌÌÌÍÎÏÐÐÐÐÐÑÒÓÔÒÓÕÖÖÕÔÔÖ××ØÙÚÚÚÚÜÝÝÜÚÛÜàÝàßÜàÙèŒkS;$":Zy–³ÇÛáåääæçåææçççèèèçççççççççççççççççççççççççæææèçåãÓ²ŒpW;'.Lo’³ÏàæçèééééèèèèèèèèèèèèèèèèèèèèèèèèèëèêééêÕ°ŽjM=,%%""""##$$$""""""""###$$%%%%'%'.;e™½ÞãéíêóòðððññòòòðïíêåâààßÝÜÜÞÞÝÛÕÕÕÔÒÑÒÔ°¯¯°²´³²µ¶¶¶¶¶··¶µ´³´µ¶·³´µ¶¶´³²¶¶¶¶¶¶¶¶±²´µ¶···´µµµµµ¶¶³³³³³³³³´´´´´´´´´³³³³´µ¶¸¸¸···¶¶··¶µµµ¶¶´³¬žx^J2#-BWm…˜ª²¸¶µ·¹¸µ¶·¸¹ººº¶·¸¹¹¹¸¸¼»»ºº»»¼º¹¸·····»»¼¼¼½½½»½¿¾¼ºº»¶§‘zcK4$ 6Ph™¼ÂÈÊÉÉÊÍÌËËÌÍÎÏÐÐÏÏÐÐÒÓÔÑÒÔÕÖÕÕÔÖÖ××ØÙÚÚØÚÜÜÚÙÙÚÞÛÝÜÙÝÖÀ¨ŒlS<%!8Xw”±Å×ÞâââæèææææççèèèçççççççççççççççççççççççççæåæççåãÒ±ŒpW;' ,Jm²ÎßæçèééééèèèèèèèèèèèèèèèèèèèèèèèèèëèêééëÖ²‘mO?.&'#"""##$$$""""""""###$$%%%$&$&,7a–»ÝãéíéóóðððññòòòïïîêæâááàßÞÞßßÝÜØÙÚÙ××ØÙ°±²³³³²²³´¶µ´´¶·µµ¶¶¶¶¶¶µµµµµµµµ¸¸·¶µ´´³µµ¶¸¸¸¸¸¸¹º¹·¶·¸¸·µ´´µ·¸¶¶¶¶¶¶¶¶µ´´¶¸¸·µ¶¶¶·¸¹»¼··¶¶¶µµµ´³ Žy^I0")?Ul†šª²¸·¶·¸··¸·¶´µ·º¹¹¹ºº»»»¹¼¾½º¸¹»¹¹¹¹¹¹¹¹¸º»ºº»½¿º»¼»¹¹»½¶¨’zcK3$ 5Ph€™¹ÁÇÆÅÈÊÉÇÊÌÍÌÌÎÐÍÍÎÎÐÒÓÔÓÓÔÔÔÕÕÕÕÕÕ×ÙÚÙ×ØÚÛÚ×ÕÕÕÛÞÞÜßáÔãˆhP:$!7XvÅØÝààâççäååååååååççççççççææææææææççççççççæççççæåäÕ²sT>-)DiŒ«ÇÚåæççææéëçèèééèèçèèèèèèèèèèèèèèèèéêäìëåÜ·“oQ@/&%!!!!!!!!!########$$$%%&&&&*((,6[³×áìðéððñññòòóóóñðîìêèæåãâáßÝÝÜÜÛÙÙÛØÔÕÙ±²³´´´´´³µ¶¶µ´¶···¶¶¶¶¶¶´´µµ¶¶¶¶º¹¹¸·¶¶µ·¸¸¸¸¸¸·¸¹º¹·¶·¸¶µ³²²³µ¶¶¶¶¶¶¶¶¶¶µµ¶¸¹·µ¶¶¶¶·¸¹¹···¶¶¶µµ´³¬Ÿw]H/"+@Wnˆ›ª²¹¸¶¸¸·¸¹º¹··¹»¹¹ººº»»»º¼¾½»¹¹»¹¹¹¹¹¹¹¹¸º»»º»½¿»¼½¼ºº¼½¶¨’zcK3$5Ph™¼ÄÊÉÇÊËÊÍÎÍÌÊÊËÍÎÎÎÏÐÒÓÔÒÓÓÓÔÔÔÕÕÔÕÖÙÚÙ×ÙÚÛÚ×Ö×ØÛÞÝÛÞßÓ¤ˆiQ;$5UtŽ«ÃÕÜááâåæäååååååååççççççççææææææææççççççççæççççæåäÕ³‘tU>.(Cg‹ªÆÙäæççæçéëçèèééèèçèèèèèèèèèèèèèèèèéêåìëåݹ–rTC1(&"!!!!!!!!########$$$%%&&&'*)(,4Y‰±ÖáëðéñðñññòòóóóñðîìêèæåãâáßÞÝÝÝÛÙÙÚ×ÒÓ׳³´µ¶¶µµ´µ·¶µµ¶¸¹¸¸·¶¶µµµµµ¶··¸¸»»º¹¹¸··¹¹¹¸¸¸¸·¸ºº¹·¶·¹·¶´³³´¶·¶¶¶¶¶¶¶¶¶µµ·¹¹¸¶¶¶¶¶¶¶¶¶¸¸···¶¶¶´³«‹u[F.!,BYp‰œ«³¹¸·¸¹¸¹»½½»º»¼¹ººº»»»»º¼¾½»ºº»ººº¹¹¹¹¹¹º»»ºº½¿¼½¾¾¼»½¾¶¨’zcK3$5Ph™½ÅÊÉÇÉÊÉÍÎÍËÉÉÌÎÎÎÎÏÐÑÓÔÑÒÒÒÓÓÓÔÕÔÔÖÙÙØ×ÚÛÚÙ××ÙÜÛÞÜÙÜÝÑÀ¥‰iR;%2RpŠ¨ÀÐÚããáâäãååååååååæææçççççææææææææççççççççæççççæåäÖ´“vV?.'Ae‰¨ÅÙäæççççéêçèèééèèçèèèèèèèèèèèèèèèèéëåíëæß½›vXF3)(#!!!!!!!!########$$$%%&&&(+))+2T‚¬ÓáêïéñðñññòòóóóñðïìêçæåãâáßÞÞÞÞÜÙØØÕÐÐÔ³³´µµµµµ´¶··¶¶·¹ºº¹¸·¶µµ¸¸¸·····»ººº¹¹¸¸·····¸¸¸¹º»º¸·¸¹º¹¸··¸¹º·········¶¶·¹º¸·¸¸¸¸··¶µ¹¸¸¸····µ³«œ‰tYE-!-CZp‰œ«´º¹¸¹º¸¹»¾¾½»»»ººº»»»¼¼¼¼½½¼»ºº»ºººº¹¹¹¹º»»ºº¼¾¼¾À¿¾½½¿¶¨’zcK3$5Og™¼ÄÉÇÅÆÇÆÈÊÌÌÌÌÎÐÎÎÎÏÐÑÒÓÑÑÑÒÒÒÓÓÔÔÔÖØÙØÖÛÛÚØ×ØÛÞÛÝÛØÚÜп¦ŠjR<%1Qn‰¦¿ÌÙããààâãääääääääåææææçççæææææææææææææææææççççæåäض•xXA/&?b†¦ÄØãåçèççèêçèèééèèçéééééééééééééééééëæíëæâžy[H5*(#""""""""########$$$%%&&&(+))+0Nz¥ÑàéíêñïñññòòóóóòñïìêçåäãâáßÞÞÞÞÜÙ××ÒÍÎÒ²²³´µ´´´µ·¸¸··¸º»»º¹¸·¶¶»»º¹¸·¶¶¹¹¹¹¹¸¸¸µµ´µ¶·¹º¹º»º¸·¸¹ººº¹¹ººº········¸··¸º»¹·ººººº¸·¶¹¹¹¹¸¸¸·¶´«›ˆrXD, -CZpˆ›¬µ»º¸º»¹¸º½½¼ººººº»»»¼¼¼½½½½½¼»º¼»»ºº¹¹¹º»¼»ºº¼¾¼¾ÀÀ¿½¾¾¶¨’zcK3$4Og~˜¬¼ÄÉÇÅÆÇÆÅÈÍÏÏÎÍÍÏÏÏÏÐÑÒÓÑÑÑÒÒÒÓÓÔÓÔÕØÙ×ÖÛÛÚØ×ØÛÞÛÝÚ×ÙÜÐÀ§ŒlS=&1Pnˆ¦¿ËØâãààâãäääääääääååææçççæææææææææææææææææççççæåäÙ¸—{[B0$<_‚¤Â×ãåèéèçèéçèèééèèçééééééééééééééééèìæíëçåÇ¢}]J5*'"""""""""########$$$%%&&&(*()+.IsžÎßèìêòîñññòòóóóóñïíéçåãááßÞÞÝÞÞÝÙ×ÕÑÌÌѲ²³´´´´´¶¸¹¹¸·¹º»»ºº¹¸¸·½¼»º¹¸··¹¹¹¹¹¹¹¹·¶µµ¶·¹»¹»¼»¹¸¸º¹¹¹¹¹¹¹¹¸¸¸¸¸¸¸¸¹¸¸¹»¼º¸ºº»¼»º¸·ººº¹¹¹¸¸¸µ«›ˆrXD+-D[qˆšµ»»¹»»º¸º¼»º¹¹º»»»»¼¼¼½¾½¼½¾¾¼º¼¼¼»ºº¹¹º»¼»¹¹»½»¾ÀÁ¿½½¾¶¨’zcK3$4Ng~˜¬½ÅÊÉÇÉÊÉÉÌÏÐÎËÊÉÐÏÏÏÏÐÑÒÑÒÒÒÓÓÓÔÔÓÓÕ×Ø×ÕÚÛÚÙ××ÙÜÚÜÙÖÙÜÒ©mT=&1Pmˆ¦¿ÍØàáàâääããããããããäääåææççææææææææååååååååæççççæåäÛ¹™}]D1#:\¡ÁÖâåèéèèèéçèèééèèçêêêêêêêêêêêêêêêêèìçíêèè˦€`L7*'!################$$$%%&&&')'(+-El˜ËßçëêòîñññòòóóóóòðíéæäãßßÞÝÜÜÝÝÝÙÖÔÐÌÍÒ³³´µ¶¶µµ·¸º¹¸¸¹»ºººººº¹¹ºº»»»»»»ºººº»»»»½»¹···¹ºº»¼»¹¸¹º¹¹ºººº¹¹¸¸¸¸¸¸¸¸¹¸¸º¼¼»¹¸¹º»»º¸¶»»ººº¹¹¹º·¬›ˆrXD+/F]rŠ›¶¼»º»¼ºº»»º¹¸º¼»»»¼¼¼½½¿½¼½¿¿¼¹½½¼»ºº¹¹»¼¼»¹¹»½º½ÀÀ¿½¼¼¶¨’zcK3$4Nf~˜«¼ÄÊÉÇÊËÊÌÍÎÍËÊËÍÐÐÏÏÏÐÑÒÒÓÓÓÔÔÔÕÓÓÓÕ×Ø×ÕÙÚÛÚ×Ö×ØÙÛÙÖÚÞÔŪŽmU>'0Nl†¥¾ÑØÞßàäæäããããããããããäåææççææææææææååååååååæççççæåäÜ»›^E2!8Y}ŸÀÖâåèêéèèèçèèééèèçêêêêêêêêêêêêêêêêèíèíêèêϪ„dO9,("################$$$%%&&&%(&(+,Ch“ÉßæêêóíñññòòóóóóòðíéæäãÝÝÜÛÛÛÛÜÝÙÖÔÐÌÎÔ´µ¶····¶·¸ºº¹¸º»ºººººº»»¸¸¹º¼½¾¿¼¼¼¼¼¼¼½ÂÀ½º¸·¸¹º»¼»¹¸¹º»¼½½½½¼»¸¸¸¸¸¸¸¸¹¹¸º¼¼»¹µ·¹ºº¹·¶»»»ººº¹¹»¸›ˆrXD*0H_t‹®¶¼¼º¼¼»»¼¼º¸¹»¾»»»¼¼½½½¿½¼½¿¿¼¹¾½¼¼»º¹¹»¼¼»¹¹»½¹¼¿À¿½¼¼¶¨’zcK3$3Nf~—«¹ÁÇÆÅÈÊÉÌËÊÈÈËÐÔÐÐÏÏÏÐÑÑÓÓÔÔÔÕÕÕÓÓÓÕ×Ø×ÕØÚÛÚ×ÕÕÕÙÛÙÖÛßÖǪŽnU>'/Mj…¤½ÓÙÜÝáæçåããããããããâãääåæççææææææææååååååååæççççæåäÝ»›€_F2!7X|ž¿ÖáåèêéèçèçèèééèèçêêêêêêêêêêêêêêêêèíèíêéëчfQ;.*$################$$$%%&&&$'%(+,BfÇÞæéêóíñññòòóóóôòðíéæäâÜÜÛÚÚÚÛÛÝØÕÔÑÍÏÕµ¶·¸¸¸···¹»»ºº»½½½»ººººººº»¼½½½½¼»»ºº»»¼½½¼¼»ººº¹¸·¹»½¼»º¼½¼º¸¸¸»ºº¹¹ºº»¹¹¹ººº»»ºº»¼¼»ºº¹»½¾¾½»¹¹¹–‚qX@+/G^v¢³¹¼»»½¾¼¹¹ºº»»»»»»¼½½½½½½½¾¿À¿¿¿¾¾¾¾½½½¼½¼¼¼»ºººº»¼½½½½¼¸¨w`I3%3Nh~–¨»ÂÆÆÇÊÊÈÍÍËËËÌÎÏÍÍÍÍÎÏÑÑÒÔÕÕÔÔÕ××ÖÔÓÔ×ÙÛÚÚÛÛÛÛÚÚÛÙÝÝÜáÛǬnU>',Lk†£ºÍÙäåãââàääääääääåååææçççèèèççææææååääååæçççææåååÙá~`G1$1Rv˜¹ÓáåéëêééêèèèèèèèèêêêêêêêêééééééééíçéëêíèصkU@3-%########$$$$$$$$###$$%%%#)('*+=\‰¼×êäðèðòòòóóôôôõôñìçâààÜÛÙÚÛÛÚØÚÙ×ÕÒÑÐе¶·¸¸¸¸··¹ºº¹¹º¼½¼»ºººº»»»¼½½½¼¼»»»»»»»¼»ºº¹¸¸¸¸·¶µ¶¹ºº¹º»¼»¹¸¹º¹¸¸··¸¸¹¹¹¹¹ººº»¹¹ºººº¹¹¸º»½½»º¸··¬–ƒpW@, 1H_v¡±·»¹¹»¼º»»¼¼½½½½º»¼½½½½¼¼¼½¾¾¾¾¾ÀÀ¿¿¾½½½¾¾½½¼¼¼»º»¼½½½½½ºª’yaI2#2Mf~—ªºÁÆÅÆÉÉÇÌÌËËËÌÍÎÌÌÌÌÍÏÐÑÑÓÔÔÓÒÔÕÕÕÔÔÕÖØÙÙÙÚÚÚÚÙÙØÖÚÚØÝ×î’pW?(,Ki„¢¹ÍÙâãààáàããããããããääåååæææççæææåååæååääååæçççææåååÚÄ¢€bH2$0Qu—¹Óáåéëêééêèèèèèèèèêêêêêêêêééééééééíçêëéíéغ’nXA3,#########$$$$$$$$##$$$%%%$)('*+<Y„¸ÕéåòêóòòòóóôôôõôñíçãàßÛÙ×ØÚÛÛÚÜÚØÖÕÕÕÖ¶·¸¸¹¹¸¸·¹ºº¸¸¹»½¼»ººº»»¼¼½½½¼»»»¼¼¼¼¼»»»º¹···¸¹·¶µ¶¹º¹¸¹ºº¹·¸»½¹¹¸··¸¹¹»»»»¼¼¼½º»¼¼¼¼»ºº»½¾¾½»ºµ´©–ƒoV@)!2Jaw¢³¹½»»½¾¼¼¼¼½½½¾¾»»¼½¾¾½½¿¿ÀÁÂÂÁÁÁÀ¿¿¾½¼¼¾¾¾½½½½¼º»¼½½½½¼¹ª“{cJ2"1Ke}—ª¼ÃÈÇÈËËÉÍÍÎÏÐÐÏÏÏÏÏÏÐÑÒÓÒÔÕÕÔÔÕ×Ö××ØÙÚÚÛÛÛÜÜÜÜÛÛÚÙÝÜÙÝØÄ®’qXA)+Hf‚¡¹ÒÝååââäãããããããããäääåååæææååååäääææååååææççææææååÛƤ‚dI3%/Os•¸ÒáåéëêééêèèèèèèèèêêêêêêêêééééééééíèêìéìéÚ¿—r[B3+"########$$$$$$$$#$$$%%%%$)''**9U}³ÑèæôíöòòòóóôôôôóñíèãßÜ×ÕÒÓÖÙÚÛÙ×ÔÒÒÓÖ×··¸¹ºº¹¹·¹º¹¸·¹º¼¼»ººº»¼½½½½¼»ºº»¼½¾½¼º¸·µ²°¯°±²±°¯°²³²±°°°¯®°´·³³²²²²³³µµµµ¶¶¶·¶¶····¶¶¶·¸¹¹¸·¶±¯¥”‚nUA* !2Jax¡²·»¹¹¼¼º¹¹ºº»»»»»»¼½½½½½¾¿ÀÁÁÁÀÀ¿¿¾½¼»ºº½½½½½½½½º»¼½½½½¼µ§’{dL4$!2Kc{•©¼ÂÇÇÇÊËÈËÌÎÐÐÐÏÎÏÎÎÏÏÑÒÓÑÓÔÔÓÓÔÖÖÖØÙÚÚÚÚÚÛÜÜÜÜÛÚÜÛàßÚÞÙƬ‘qYA*)Fd¡»ÓÝåäáâäåääääääääååååææççææååååååçæååååæçææææææææÝȧ…gK4&-Mp“¶ÑáåéëêééêééééééééêêêêêêêêêêêêêêêêíèëìèìêÜ™t\D3+"########%%%%%%%%$$$%%%&&%)''*)6Pw®ÎçåôíõòòòóóôôôóòðíèáÚÕÏÌÊÊÍÒÕÖÐÍÊÇÆÈËθ¸¹ººººº¸º»º¸¸¹º¼»ººº»¼¼½½½½¼»ºº»½¾¿½º¶´®ª¦¡ŸŸ ¢¢¡ ¡£££¡ ŸŸ¡¥¨¥¤¤££¤¤¥¤¤¥¥¦¦¦¦¨¨©©©©¨¨©©ªªªª©©©¥œŽ~kVE2)##$##%!!! #5LavŒ¨®±°°²³±³´´´µµµ¶µµ¶·¸¸··µ¶·¸¸¸¸·»ºº¹¸·¶¶ºººººººº¹ºº»¼¼»»±¤ycK4$!3Kd}—«¹ÀÄÄÅÈÈÆÇÉËÍÎÍÍÌÌÌÌÌÍÎÐÑÏÑÒÒÑÑÒÔÔÕÖ×ØØØØÙÚÚÛÛÚÚÙÚÛàßÙÝÙǯ“sZA('Dc¢¼ÏÙáàÞàâãååååååååææææççèèææççççççççæååæççææææææææà˪ˆjN6'+Jm´ÐáåéëêééêééééééééêêêêêêêêêêêêêêêêìèììèìëßÛv^E5-$########%%%%%%%%$$%%%&&&%)''*(2Kr©ËåäòëóòòòóóôôôóñîëæÝÒÊÃÀ¾¾ÁÅÈÉÄÁ½¹¸¹¼¾¸¹º»»»»ºº»¼»¹¸¹º»»ººº»¼½¼¼½½½¼»»¼½¿¿¼·²®¨£œ•‘‘’“’‘‘“”“‘’“”““”—š––••••––””•••–––™™šššš™™››šššš››˜”ŒƒwiXL;4000./2...--,,,,,++*))())))))))**)))((('''''''''&&%%&&')/=Pap‚‘ž£§¥¥§¨¦§§§¨¨¨©©¦¦§¨©©¨¨ª«¬¬¬¬¬¬¯¯¯¯°°°°¯¯°±²²±±©œˆtaL7) #5Nf~—©¸¿ÃÃÄÇÇÅÆÇÈÊËËÌÌÌÌÌÌÍÎÏÐÏÑÒÒÑÑÒÔÕÕÕÖ×ØÙÙÚÚÛÜÜÛÚÚØÚàßÙÝÚʱ•u\C)'Db ºÎÙâãâãææääääääääååæææçççæççççèèèççææææççååææææççâÍ‹lP8))GjŽ³ÏáåéëêééêêêêêêêêêêêêêêêêêëëëëëëëëìéììçëìáÇžyaH7/&########&&&&&&&&%%%%&&&'&)&'*'/Fj£ÇââñéñòòòóóôôôóñíéâÖǽµ³°°²´¶¶¶³°«¬¯¹ºº»¼¼»»»½½¼º¹º»»ºººº»¼½»»¼½½½¼¼¼¾¿¿»´© ›‘ˆ€€~~€€~€‚‚‚„„ƒƒ‚‚ƒƒ„‚‚‚ƒƒƒ…†‡‡‡‡†…ˆ‡‡‡‡‡‡ˆ„yupg\TKEBCB@ADAAA@@???CCBA@@??========<<<;;;::<<<<<<<<:998899:>AKW`hu’–””——•’“““”””•‘’“”””””™™š›››››————˜˜˜˜šš›››œœœšš›œœœœ—Œ{l_QB71.+*+,+*((((((((&&&&&&&&%%%%%%%%$$$$$$$$""""!! ##""!!! '.>SgyŽž´¸¸¸»¼ººº»¼½¿ÀÁÁÁÁÁÂÃÄÅÅÇÈÈÇÇÈÊËËÊÊËÍÎÐÑÑÒÒÒÒÑÑÎÐØ×ÑÖÔĪ‘s]H1# )Eb}œ´ÊÖáããäææââââââââãããäääååååæææçççèççææççèåååææçççäϯnR9)(EhŒ²ÎáåéëêééêêêêêêêêêêêêêêêêêëëëëëëëëìéíìçëíãÏ¥eK90&########&&&&&&&&%%%&&&''&)&'+&-Bb›ÁßáñêñòòòóóôôôôðìæÞϽ°¨¦¤£¤¥¤£¥£¢ ¡¢¹º»¼¼¼¼»¼¾¾½»º»¼ººººº»½½ºº»¼½½½½½¾À¿º³«¦”ƒxpmmnlkjjklkihjllkjklpoonnoopnnnoooppqqrssrqqtsrrrrstupllke^Z_YVWWTVYVVVUUUTTVVUTSSRQSSSSSSSSQQQPPOOONNNNNNNNPOONNOOPNPU\`ckty‚€ƒƒ‚‚‚ƒƒƒƒƒ„……………„…†‡‡‡‡†ƒ„„…††‡‡ˆˆ‰‰ŠŠ‹‹†‡ˆ‰‰‰‰‰†|pf`XNGCA=<=>>=????????<<<<<<<<;;;;;;;;9999999977766555666554444:GXfsƒš ¥¥¥¨©¦§§¦¦¨ª¬®®®®®¯°±²³µ¶¶µ´¶·º¸·¶·¹¼¾¾¿ÀÀÀÀ¿¾½ÁÉÈÂÇƶ¡‰o^M:/.))))))))$$$$$$$$$$$$$$$$""""""""+Fb{˜°¿ÌØÛÛÝÞÝààààààààáááâââããäääååæææèççææççèåååææçççåаpS:*'Dg‹±ÎáåéëêééêêêêêêêêêêêêêêêêêëëëëëëëëìéíìæëíäÕ«„iN;0&########&&&&&&&&%%%&&'''&)&'+&+?\–¾ÝáñëóòòòóóôôôôðëåÛË·©¡Ÿœœ›™——————˜™š¹º»¼½¾¾¾¹º¼½½¼º¹»ºº¹¹ºº»º»½¾¿¾½¼¾¾¼¹¸´¨œ•„qga[XWZZZYYYXXZZZZZZZZ\\\\\\\\]]]]]]]]__```aaa``aaabbbb_`cdceicjnkhikjiiiiiiiigijihghjiiiihgeeddeeeedcbbbbbbbb```___^^``_`bcdeljhijlkjoooooooojjklmnooqqqqqqqqqqqqqqqqtttttttttuwxyxwvrkeb^WTUSTTRPPQSRRSSSTTTSRRQPPQQONMNPRQPQPPONMLLKKKJJJIIIIIIIIIIHMVbluz|‹‘’’”•“””•–—˜˜–—˜™šœžŸŸ ¡¢£££££¤¤¤¥¥¨©©ª«¬ª¯±±³µ®¤€ocWJCC=<<<;:::8887776686556643764211232222210/.....-,++-:Qi}’¢·ÄÎÍËÎÑÑÑÑÒÒÓÓÓÓÓÓÔÖ×ØÙÚÙÚÚÛÜÜÝÝáàßÞßàâãââááâãåçâÊ©ŒpT=1# ! '?b‰ÅÞæêçæëíëëëëëêêêêëëëêêêééêêêëëëëëíëëëììêç×·lS?1+%#""#$$#$$%%&&''''(((((('&()'&-7]‰²ÜàñìòñññòòóóóôòïçÙƳ¦›™––––•”“”“’‘‘”–¹º»¼½¾¾½º»»¼¼»»º»ºº¹¹ºº»¼½¾¿À¿¿¾¾¿½º¸³¦˜ˆvaUNGDEFFFEEEDDFFFFFFFFHHHHHHHHIIIIIIIIKKKKLLMMLLLLMMNNRQTZ_ciqu|‚€~~}~~~~~~~~~€€~~€~~~}|{zyzz{{zzyyyyyyyyywwvvvuuupmid`]ZXXVUUWXWVXXXXXXXXVVWXYZZ[\\\\\\\\\\\\\\\\]]]]]]]]]^`aaa`_a]\_a`bejklkiikmhhhiiijjhhgfffffedcdefedeeddcbaaaa```___________]_bgloppwy{|}~€~€‚‚ƒ‚ƒ„…‡ˆˆˆˆ‰Š‹ŒŒŒŒŽŽŽ’’“”•––—“—™˜›—ƒyojcYTTSSSRRQQQRRQQPPPPQONNOONLPOMKKKKLHIIIIHGFFFFGFEDDDEN`q›¥°¸·¶¹»»»»»¼¼¼½½½½¾¿ÁÂÃÃÄÄÅÆÇÈÉÉÎÍÌÌÌÎÏÐÐÐÏÏÐÒÓÕÍ·œ…q[JB41..00/-..----,,.--,+**)**++*)(())(((()*(&.Ff‰«ÁØàæååéêèèèééééééêêêêêêêêêêêëëëììëéééêêèæ׸ŽmT@2,(&$$&''&''(()))*))))))))+*,-+*09X„¯ÛàñìñññòòòóóóóñíåØƳ§œš—–––”“”••”““”–¹º»¼½½½½¼¼»»»»¼¼»»ºººº»»½¾¿ÀÀÀÀ¿¾¿¾»¹²¢“€lUE<634443332223333333355555555666666667788899988999:::==CNYcq|„••“”“‘““““““““’”•”“’“•””””“’ŽŽŽŽŒŒ„~tj`VNHECAACDCBCCCCCCCCBCCDDEFFFFFFFFFFGGGGGGGGHHHHHHHHHIJKKKKJMLQ[ciqx‚‚‚‚ƒ…‚‚ƒƒƒ„„„‚‚€€€€€~~€~}~}}|{{|{{{zzzyzzzzzzzzwtqnlieb``abcdeeeeefgghhhiijlmmnmmnoopqqqqqqrrrswwxxyzz{xz{z|~|wrpprqmlnqqpppooommlllkkkljiijkihjihgffffcddddcbaabbbba`_`_dmv}„‹“› Ÿž ¢¢¢¢¢££¤¤¤¤¥¥¦¨©©ª«¬®°±²²¶µµµµ¶·¸¹¹¹¹º»½½¹¦~oaVRJHFFFFECBBBBBCCCBBA@??>><====<;:<;;:::;;<;AUo‹¦¸Ï×ÞàâääâââãääåæææççèééêêéééêêëëëêéééëêèæѳoXE95-,**+-,+----....---,++**-,-/-,19S€¬ÙßðìññòòòóóóóôòîçÜ̼±¥£ žž›™™›œœš™š›º»¼½½½½½½¼»ºº»¼½¼»ºººº»¼½¾¾¿¿¿¿¿¾¿¿¼¹°žŽ}gL:/(&'&&&%%$$$%%%%%%%%&&&&&&&&''''''''((()))**)))***+++.6ETdxˆ’œ¦§§§¦£¦¦¦¦¦¦¦¦£¤¦¥££¤¥¦¦§¦¥¤£¢ ¡¢£££¢¢£££££££££¢¢¢¡¡¡ –~o`RD<42001210111111110011223322222222444444446666666677899999;>GWdo{†‘“–—–—˜š˜˜™™™ššš——˜——––•—–””••”’”””““’’’’’’’‘‘‡}tld\VNMLLNOONOOPPQQQRRSSTUVWWWWXXYYZZZZZ[[[\\``aabbccccccdffechov{„‰ŠŠŠŠŠŠŠŠ††……„„„„„ƒ‚ƒ„ƒƒ‚€~~~~}|||}}}|{zyxy|}}}~ƒ…‡††‡ˆˆŠŠŠ‹‹‹ŒŒŒŽ‘‘’“”•—˜™ššššš››œœžžŸŸ ¡¢¢ ‘wpjffdccbba`_]]^^__``]]\\[ZZYXXXXXWVVWWVUUUUVXVZi| ¿ÄÊÏÑÓÒÐÐÐÑÓÔÕÖ×Ö×ØÙÛÜÝÝÝÝÝÞßßààâáàáããáß©Šr`RIG?=;;=>>=========<;;:98767668759@WƒÙÞðìñòòòóóóôôöôñìåÙÌŶ³±°¯«¦©««©§§§º»¼½½½¼¼¾½¼»»¼½¾¼¼»ºº»¼¼½½½½½¾¾¿¾¿¿¼¸®›Šv^B.""%0@Re}¢·ººº¹¶¹¹¹¹¹¹¹¹·¸º¹··¸¹¹¹¹¹¸·µµ²³´µ¶¶µµ¶¶¶¶¶¶¶¶¶¶¶¶µµ´´¨›ˆs`L:." !!!!!!!!#""##$$%*0?Seu†”¨ª®¯¯¯°²®®®¯¯¯°®®®««®¬ªª««ª¨««ªªªª©©©©©¨¨¨§§¥¥¥¥¥¥¥¥£™Š{m`RI<:779:989::::;;;<<=>>??@ABBBBCCCCCCDDEEEIIIIJJJJLKKLLMPRWanx‚š¢¢¢¢£££££££¢¢¡¡¡¡ ŸžŸ ¡ Ÿ ŸŸžœ›œœ›š™™™™™˜—–““’Žˆƒ}xqmkjkkkkoooopppqrrsstuuuuvwxy{{|||}~~~~~€‚ƒƒ„„„ƒyqqtvz}~~}||{{||}~~~|{{zyxxwwxxxxwvuwvutttttqor~Š“¤¬¬°´··¶¶´µ¶¸¹»¼¼¼½¾¿ÁÂÄÄÆÆÇÇÈÉÊÊÌËÊÌÍÎÌʱž‡wkb\\ZXVVXYXWVVVVVUUUTSRQPOONNKKNMKMRh‘¶ÝßïìòòòóóóôôôöôòðìåÜÖÎËÈÆÅÄÂÀ»½¿¿½»ºº»»¼½½¼¼»½½¼¼¼¼½½¼¼»»»»¼¼½¼¼¼¼½¾¿¾¿¾º¶¬š‰s[>*".@Rg–«¶ÀÂÂÿÂÂÂÂÂÂÂÂÃÅÆÅÄÃÄÆÂÃÃÂÂÀ¿¾¼¼½¿¿À¿¿¿¿¿¿¿¿¿¿ÀÀÀÀ¿¿¿¾·§v_G0"$8Qh~”¥º½ÀÂÂÁÂÃÂÂÂÃÃÃÄÄÂÃÄÄÄÃÁÀÂÁ¿ÀÁÂÀ¿ÁÁÁÁÁÁÁÁÀÀ¿¿¾¾¾¾¼¼¼¼¼¼¼¼º¬˜ƒp[G9+'""$%#!$$$$%%%%&&&''(((++++++++++,,,---000000002114436<J[o}‹ž°º¼½½½½¾¾¾½½½½¼¼»»»¹¹¹»¼»º»»¼»»¹¸·¶····¶µ´²²³³²±±°«¬§œƒuk`XRQSQQRUUUVVWWWYYYZZ[[[[[\]]^__bcdeeeedfghijjjjnignu|„‹’”—˜—••–––––————––•””“’’““””“’‘‘“’‘Œ‰‹“˜™šŸš˜šœ››œš›œž ¡¡¢¢£¥¦§¨©¬¬®¯°±±±°°±³³²°ž‘„~yusttrpprsrqppooonnnlllkjjiijgfiighkƒ§ÄäáïìòóóóóôôôõôóñðîêåáÝÚ×ÖÕÕÓÑÐÑÒÒÏÎÎλ¼¼½½¼¼»¼½½¾¾½½¼½¼¼»»¼¼½¾½½¼½¾¿À¾¾½¹´«™‰r[?+ .ASi„š·ÀÂÁÂÂÀÂÂÂÂÂÂÂÂÅÆÈÇÅÅÆÇÅÅÅÅÄÃÂÁ¾¿ÀÁÂÂÂÂÁÁÁÁÁÁÁÁÃÃÃÂÂÁÁÁ¼«‘w_F. 6Sm…ž±ÂÅÉËÊÉÉÊÍÍÎÎÎÏÏÏÎÏÑÒÑÐÎÌÎÍÌÌÎÏÎÍÏÏÏÐÐÐÐÐÍÍÍÌÌÌËËËËËËËËËËɺ£‹t[A0!""#*<Tp†™±ÆÑÔÕÕÕÖÖ××ÕÕÔÔÓÓÓÓÒÐÐÑÓÔÓÒÔÔÕÕÔÒÑÏÏÏÐÐÏÏÎÍÌÌÌÍÌËÊÊÇǽª”€k[NB99;979::;;;<<<>>???@@@AABBBBBBFGIJJJIHIJLMNNNMTTZhx„‘›±µ¶µ´µ¶¶¶¶µµµµµ¶¶µ´³³²²³³³³³²±±³²±¯®®®®°¬ª«§ž–“…}||z{||}~€ƒƒ„…†‡ˆˆŠ‹ŒŽ‘‘“”’†€~‚‡ŠŒ’ŽŽ‘‘ŽŽŒŒŒŒ‹‹‹‹‰ˆ‹Œ‰‰‹Ÿ¾ÓëâîìóóóóôôôõõöôòðïíêçæãàßßßÞÜßààÞÜÛÜݼ¼½½½¼»»»¼¾¿¿¾¼»½¼¼»»¼¼½À¿¾½¾¿Á¾¾¼·³ª™‰oX=).ATj…›°ºÂÃÂÄÄÂÃÃÃÃÃÃÃÃÅÇÈÇÅÅÆÇÉÉÉÉÈÇÅÅÁÂÃÅÆÆÆÆÄÄÄÄÄÄÄÄÆÆÆÆÅÅÅĺ©w`H0 !9Uoˆ¢µÈËÎÐÏÎÍÎÏÏÏÐÐÑÑÑÑÒÔÕÔÓÐÏÐÏÎÏÑÓÒÑÓÓÓÓÔÔÔÔÐÐÐÐÏÏÎÎÐÐÐÐÐÐÐÐÏ¿¨x]B/ #2Or¤¿ÕàââããääååçççææåååäãâãåææäççèèçæäãåååååäãããããããâááàßÒ¸œ‚hT<.##%#!#"###$$$$''''((((+++***)),./010//.013443249Hb|’¦´ÉÎÓÕÔÔÕÖÕÕÔÔÓÓÒÒÕÔÔÓÒÒÑÑÑÑÒÒÑÑÐÏÑÐÏÍÌÌÌÌÏÉþ²¡’‹{nb_^\^c__`aabcceeffghhijklmnpqqsrrtvwussqw„‘™ ¦¯««®®®®¬¬¬«««««¬¬¬¬¨§ª«¨§©±ÌÝïãîìôóóóôôõõõù÷ôòñïìéêèæåååäãççæäááâ常¹º»»»º½½½¼¼»»»½½½½½½½½¿½º¼¿ÁÀ¾»¼¼¸´©•ƒlT8' .CYq‹Ÿµ¾ÅÆÅÇÈÆÅÆÇÇÆÅÃÂÅÈÊÈÆÄÆÉÍÌËÉÇÅÄÃÂÂÃÄÅÆÇÈÄÅÆÆÇÇÆÆÆÅÅÃÁÂÃź©v]E.$;Vpˆ£·ÆÌÎÌÌÏÐÎÑÑÑÑÑÑÑÑÒÓÓÔÕÕÔÔÓÓÔÕÕÔÓÓÖÖ×Ø×ÖÔÓ×ÖÔÔÕÕÔÒÑÔÔÑÑÔÔÑÏÑw^C/0Jm‹§ÂØäèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèêééèèççææãÝÅ¡…iK8% ',?_}—³ÉÛáäâáããáââââââââãâáààáâãààààààààßßßßßßßßããÝпª‘}lVIE@CHDGGFFGHIIJKKLMNOOOOPQRTTUVVWWWXXXWey‹š¨µ¾ÅÇÉÊÉÈÉÊÌÌËËÊÉÉÉÉÉÉÉÉÉÉÉÈÈÉÉÉÊÊÊÖÛâçêîóøóóóôôõõõ÷öõóñïîíêéçæåäääçççææåå庻¼¼½½½¼¿¾¾¾½½¼¼¾½½¼¼½½¾¿¼º»½¿¾¼»½¼¸³¨”ƒkT8& .CZqŒ µ¾ÆÆÅÇÈÆÆÆÇÈÈÇÅÄÆÈÉÈÆÅÇÉÌÌÊÉÇÅÄÃÅÅÅÅÅÆÆÆÅÆÆÇÈÈÇÇÇÆÆÄÃÃÄƺ©v]E.$;Vpˆ£·ÇÍÐÏÏÑÒÏÒÒÒÒÒÒÒÒÓÔÕÕÖÖÕÕÔÕÕÖÖÕÕÔÖ×ØØØ×ÖÕ×ÖÔÕ××ÖÕÒÕÕÒÒÕÕÒÐÄ‘w_D/1Km‹§ÃÙäèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèééèèèèèçèåßȤ‰lN9%$9\~›¹ÑàæéçæééçèèèèèèèèëêéèèéêëêêêêêêêêêêêêêêêêèêçÛɯw^G83,.2-..--./000112345555667889999:::;;EWqŒ¤¸ÉÓÞàããâáâãääääããããââââââââââââãããäÞâèëìïòöóóóôôõõõ÷öõóñïîíêéçæåäääçççææååå¼½¾¿¿¿¾¾¿¿¿¿¾¾¾¾¿¾¼»»¼¾¿¾¼ºº¼¼¼»»½¼¸²§“jR6% .DZr¡µ¾ÆÆÆÇÈÆÆÇÈÈÉÈÈÇÆÇÉÈÇÆÇÉËËÉÈÇÅÄÄÇÇÇÆÆÆÅÅÆÇÈÉÉÉÉÉÉÈÇÆÆÆÆǺ©u]D-$;Wp‰¤¸ÈÏÔÓÓÕÔÑÔÔÔÔÔÔÔÔÕÕÖ×ØØ××Ö××ØØ××Ö×ØÙÙÚÙÙØØ×Ö×ÙÙØ×Ô××ÔÔ××ÔÑƯ“y`E0 1KnŒ¨ÄÚåèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèééééêèãÌ©pQ9%5X|›¼ÕãéìëêìíêìììììììììëëêêëëìììììììììííííííííëïïçÖ¸’uY@0)!!# !! !!"##$$%%%%%%%%$%%%&&&'3Hk¯ÈÜçáãææåäåæææææççççææææææææååæææçççéëîðððòóóóóôôõõõ÷÷öôòðîìêéçæåäääççææææåå¾¾¿¿À¿¿¾¿¿¿¿¾¾¾¾¿¾¼»»¼¾¿¿¾¼¼»¼»»»½»·±¦’gP5$ /D[sŽ¢¶¿ÆÇÆÈÈÇÆÆÇÇÈÉÉÉÇÇÈÈÈÈÈÉÊÊÉÈÇÆÅÅÈÈÇÇÇÇÇÇÈÈÉÊËËÊÊËÉÈÈÉÉÈǹ©u\D-$;WqŠ¤¹ÊÑ×××Ø×ÔÖÖÖÖÖÖÖÖ××ØÙÚÙÙÙØÙÚÚÚÚÙØÙÙÚÛÛÜÜÜÜÚÙÙÚÚÙ×ÕØØÕÕØØÕÓȱ”zaF1 1KnŒ¨ÄÛæééééééééééééééééééééééééééééééééééééééééççèèéêêêêéåБsT:%3Ux—¸ÒâèëêéììêëëëëëëëëêêééééêêêêêêêêêêëëëëëëëëêîðëÝÁ˜w\C2) " !""!!!""###$$$##"""""""##$$,Ch³Ïâìèêìíëëëíìììííîïïíííííííííííîîîïïïðñòòòñòóóóôôõõõ÷÷öõóðîìêéçæåäääææææææææ½¾¾¿¾¾½½½½½½¾¾¾¾¾¾¼¼¼¼¾¾À¿¿½¼¼½½¼½»·°¤~eN3"!/E\t£¶¿ÇÇÆÈÉÇÅÅÅÆÇÇÈÈÇÇÇÈÉÉÉÉÊÊÉÉÈÇÇÇÆÇÇÈÉÊËËÉÉÊËÌËËËÌÊÉÉËËÉǹ¨t\C-$;WqŠ¥ºËÒØÙÙÚÙÖ××××××××ØÙÙÚÛÛÚÚÚÛÛÜÜÛÛÚÚÛÛÛÜÝÝÞàÞÜÛÛÚØÖØÛÛØØÛÛØÖʳ–|bG2 0JmŒ¨ÄÛæééééééééééééééééééééééééééééééééééééééééèèèéêêëëéèæÒ¯“uU<&1Rt“´ÎáçêééììêëëëëëëëëííííííííììììììììííííííííëííêßÄ›y[A0'! !" !!!#""! !!!""*@d±Íàéëíïïîíîïîîïïðñññððððððððððñññòòòððñòóóòñóóóôôõõõö÷÷öôñîìêéçæåäääææææææææ½½¾¾½½¼»½½½½¾¾¾¾½½½½½½½½¿¿À¾½¼¾À¼½»¶¯£Ž|cL1!!0F]u¥¶ÀÇÈÇÉÉÈÇÆÆÅÆÆÇÈÈÇÆÇÊËÊÉÊÊÊÊÊÉÉÉÇÇÈÉÊÌÍÍÉÉÊËÌÌËËÍÊÈÊÌÍÊƸ¨Žt[C,$;Xr‹¦»ÌÓØØØÛÚØ××××××××ØÙÚÛÛÛÛÚÛÜÜÝÝÜÜÛÜÜÜÛÛÜÝÞàÞÜÛÛÚØÖÙÜÜÙÙÜÜÙØÌ´˜}cH3!.Il‹§ÃÚæêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêééééêêêêèèçÔ²•vV>(.Nq‘´ÏâèëêêíîìííííííííìííîîííìììììììììììììììììïîìèßÅœy\B0'" ';]†¬ÊÞçåèêêéèéêêêêêëëëëëëëëëëëëììììííîîðïïñóôòñóóóôôõõõö÷ø÷õòîìêéçæåäääååææææçç¾¾¾¾¾½¼»½¾¾¾¿¿ÀÀ»¼¾¿¿¾¼»¼½¿½»»¾À¼½»¶¯¢zaJ0 !0F^v‘¦·ÀÇÈÇÉÉÈÊÉÇÆÆÇÈÈÈÇÆÇÊÌËÉËËËËËËÌÌÉÉÊÊËËÌÌÈÉÊËËËËËÍÊÈÊÍÎÉŸ¨Žt[C,$;Xr‹§¼ÌÒÖÖÖÙÛÙ××××××××ØÙÚÛÛÛÛÚÛÜÜÝÝÜÜÛÞÝÜÛÛÛÜÝÝÜÚÛÜÜÛÙÛÞÞÛÛÞÞÛÙͶ™~dI4!-Gj‰¦ÂÙåêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêëêêêêêééèéé×µ˜xW@*,Ln²ÎáçëêêíîìííííííííéêëììëêéêêêêêêêêêêêêêêêêîíëéãÌ¢~bG4* # !!&7W~¦ÆÜçìîððïîïðñññññðððòòòòòòòòòóóóôôôôñðïñôôòðóóóôôõõõö÷øøöòîìêéçæåäääåååææççç¿¿¿¿¾½¼¼¿¿¿ÀÀÁÁÁº¼¾ÀÀ¾¼º¹»½¼ºº½À¼½»µ®¡Œy`I/!0F^w’¦·ÀÇÈÇÉÊÈÌËÉÈÇÇÈÉÉÆÅÇËÍÌÉËÌÌÌÌÍÍÍÌÌÌËËËÊÊÈÉÊËËËÊÊÍÉÇÊÍÎÉĸ§Žt[C,$;XrŒ§¼ÌÒÕÔÔØÛÙ××××××××ØÙÚÛÛÛÛÚÛÜÜÝÝÜÜÛßÞÜÛÚÚÛÜÚÙØÚÜÞÝÜÜßßÜÜßßÜÚηšeI4!+Fiˆ¥ÂÙäêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêìëëêêééèèêëØ·šzYA+,KlŒ¯ÊßåéèèëìêëëëëëëëëêëííííëêííííííííììììììììêééìéÓ©…dI5*! '7Tz¢ÄÛæçéëëêéêëíííìëëêêííííííííîîîïïïððóñðñôôòïóóóôôõõõö÷øøöòîìêéçæåäääåååææçççÃÁ¿½¼¼¼½¾¿ÁÂÂÁÀ¿¼½¾¿¾½»º½¼¼»»¼¼½¼»·²¡‹w]G-$4J`w’¨¹ÃÊÈÄÅÈÊÆÇÉÉÇÇÉÊÌËËÊÊËËÌÊÆÇÌÌÉÉÎÊÊÊÊÊÊÊÊËÌÌÌÌÌÍÍÏÎÍÎÎÌÈź¥Šs]C, #:Vq‹§¼ÊÑÖ××ÙÙ×Ö×ÙÙ××ÙÚÙÙÙÚÚÚÛÛÝÝÝÜÜÛÛÚÞÝÝÜÜÝÝÞÛÛÜÝÝÜÜÛßÞÞÝÝÞÞßÛÓ¼›~fK4#(Di‡£¿×äêêêêêêêêêêêêêêêêêêêêêêêêééééééééééééééééêêêêêêêêìçå×¹›zYD*)DfŠ¬ÃÛëîêìêèíëëëëëëëëííííííííììììììììììììììììêììêçÔ«…hJ5, !"#0Nw¼Õåçêíîíìíîííííííííîîîïïðððïïïððññññññòòóóóóóóôôõõõ÷÷ö÷öôïìêéçåãâââäãâäæèçæÁÀ¾½¼¼½½¾¿ÀÁÁÀ¿¿¾¾¾¾¾½¼¼½½¼¼¼¼½½¼»·²¬ Šw\F-$5J`x“¨¹ÃÊÈÄÅÈÉÆÇÉÉÇÇÉÊÌËËÊÊËËÌÍÉÉÍÌÉÈÌËËËËËËËËÌÌÌÌÌÌÌËÏÎÌÍÍÌÉǺ¤‰r[A*#:VpŠ¦»ÊÑÖ××ÙÙ×Ö×ÙÙ××ÙÚÛÛÜÜÜÝÝÝÞÞÝÝÜÜÜÛÞÝÝÜÜÝÝÞÝÞÞÞÞÝÝÜÞÞÞÞÞÞÞÞÜÕ¾€hL5#(Dh‡¢¾×äêêêêêêêêêêêêêêêêêêêêêêêêééééééééééééééééêêêêêêêêíèçÙ»ž}\E*)Ceˆ«ÂÚêíéìêèíëëëëëëëëììììììììììììììììììììììììêììêçÕ‡iK6,! !!!.Ksš¹Òãçêíîíìííííííííííîîîïïðððïïïððññññññòòóóóóóóôôõõõ÷öö÷öôðìêéçåãâââäãâäæçç濾½½½½¾¾¿¿ÀÀÀ¿¿¾À¿¾¾½½½¾¾½½¼¼½½¾»º·²¬Ÿ‰u[E,$5Kax”©¹ÃÉÇÄÆÈÉÆÇÉÉÇÇÉÊÌËËÊÊËËÌÏÌÌÎÍÉÉËËËËËËËËËÍÍÍÌËËÊÊÎÍËËÌÌËɺ¤‰qZ?(#9Up‰¥ºÊÑÖ××ÙÙ×Ö×ÙÙ××ÙÚÛÛÜÜÜÝÝÝÞÞÞÞÝÝÝÝÞÝÝÜÜÝÝÞàààààßÝÝÝÞßààßÞÝÞÖÀŸ‚jN7#'Cg…¡½ÖäêêêêêêêêêêêêêêêêêêêêêêêêééééééééééééééééêêêêêêêêîééÜ¿¡€_G,'Ab†©ÁÙèìéìêèíëëëëëëëëëëëëëëëëììììììììììììììììêììêèÖ¯‰kL7-! ,Ho•µÏàçéìîíììíííííííííîîîïïðððïïïððññññññòòóóóóóóôôõõõ÷ööööôðìêéçåäãââäãâãæççå¼¼¼½½¾¾¿¿¿¿¿¿¾¾½ÁÀ¾½¼½¾¿¾¾½½½½¾¾º¹¶±«ž‡sYC*%5Lby•ªºÃÈÇÅÇÈÈÆÇÉÉÇÇÉÊÌËËÊÊËËÌÏÎÍÎÍÌËÌÌÌÌÌÌÌÌÌÎÍÍÌËÊÉÉÍÌÊÊÌÌËÊ»¥‰qZ?'#9Uoˆ¤¹ÊÑÖ××ÙÙ×Ö×ÙÙ××ÙÚÙÙÙÚÚÚÛÛÞÞÞÞÞÞÞÞÞÝÝÜÜÝÝÞàááààßÝÝÝßáââáßÝÞ×Á ƒjN7#&AeƒŸ¼ÖäêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêëëëëëëëëíééÞÁ¤‚aJ.%=^‚¦¾ÖæëéìëèíëëëëëëëëëëëëëëëëììììììììììììììììêììëèرŒmN9.! *Ek‘²Íßæéìíìììíííííííííîîîïïðððïïïððññññññòòóóóóóóôôõõõöööö÷ôðíëêèæäããâãââãåçæå»»¼½½¾¾¾¿¿¾¾½½½½ÁÀ¾¼¼½¾¿¾½½¼¼½½¾¹¸µ±ª…pWA)%6Lc{–¬»ÂÇÆÅÈÉÇÆÇÉÉÇÇÉÊÌËËÊÊËËÌÌÍÍÍÍÎÏÎÌÌÌÌÌÌÌÌÍÍÌËÊÉÉÈÌËÊÊÌÌËɼ¦Šr[@("8Tn‡£¸ÊÑÖ××ÙÙ×Ö×ÙÙ××ÙÚÙÙÙÚÚÚÛÛÞÞÞÞÞÞÞÞÞÝÝÜÜÝÝÞßßààßÞÝÝÞßáããáßÞÝÖÁ¡„kN6#%@c»ÕäêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêëëëëëëëëëèéßÃ¥„cL0":Z£¼ÔäêèìëçìëëëëëëëëííííííííììììììììììììììììêììëéÚ´pQ:0" *Bg¯Ëßæéìíìëììííííííííîîîïïðððïïïððññññññòòóóóóóóôôõõõöõõö÷õñîëêèæåäãããâáãåææ庻¼½¾¾½½À¿½¼¼»¼¼¿¾½¼¼¼¼½½¼¼»»¼¼½··µ°ªœƒnU@'%6Mc|˜¼ÂÇÆÆÈÉÆÆÇÉÉÇÇÉÊÌËËÊÊËËÌÊÍÍËÌÐÐÎËËËËËËËËÌÌËËÊÉÉÉËËËÌÍÌÉÆ»¥Šr[@)"8Sm†¡¶ÊÑÖ××ÙÙ×Ö×ÙÙ××ÙÚÛÛÜÜÜÝÝÝÝÝÝÝÞÞÞÞÞÝÝÜÜÝÝÞÞÞßààßßÞàáâããâáàÝ×¢…kN6#$?b€œºÕäêêêêêêêêêêêêêêêêêêêêêêêêëëëëëëëëëëëëëëëëììììììììêèêàŨ‡fO2 7W{ ºÑãéèìëçìëëëëëëëëííííííííììììììììììììììììêììëêÜ·“rS<1"(?c‰«ÉÝæèëììëëìííííííííîîîïïðððïïïððññññññòòóóóóóóôôõõõõõõö÷õñîìêéçåäãããááâåæå亻¼½¾½¼»À¿½»ºº»»¼¼½½¼»ºº»»ºººº»»¶·´°©›‚lT>&%7Md|˜®¼ÂÆÆÆÉÉÆÆÇÉÉÇÇÉÊÌËËÊÊËËÌÊÎÎÊËÏÏËËËËËËËËËËÊÊÊÊÊÊÊÊËÌÎÎËÇø£ˆqZ@)"8Sl…¡µÊÑÖ××ÙÙ×Ö×ÙÙ××ÙÚÛÛÜÜÜÝÝÝÛÜÜÜÝÝÞÞÞÝÝÜÜÝÝÞÞßàáââââââââââââÞØĤ‡mP7##>`~š¹ÕäêêêêêêêêêêêêêêêêêêêêêêêêëëëëëëëëëëëëëëëëììììììììëéìãÈ«ŠiQ3!4Tyž¸Ïáèèìëçìëëëëëëëëììììììììììììììììììììììììêììëëݹ–tT=1#&<^„§ÆÛåèëìëëëìííííííííîîîïïðððïïïððññññññòòóóóóóóôôõõõõôõö÷õòîìëéçåäääâááâäæåä»»½¾¾½»ºÀ¿½»ººº»º»¼½¼»¹¸»º¹¹¹¹º»¶¶´°©škS>%&7Nd}™¯½ÂÆÅÇÉÉÆÆÇÉÉÇÇÉÊÌËËÊÊËËÌËÐÏÊÉÍÍÈÊÊÊÊÊÊÊÊÉÉÊÊÊÊÊËÊËÍÏÏËÅÀ¶¡†oY?("7Rl… µÊÑÖ××ÙÙ×Ö×ÙÙ××ÙÚÙÙÙÚÚÚÛÛÚÛÛÜÜÝÝÝÞÝÝÜÜÝÝÞÞßáâääääãââááââãàÚƦ‰oR9#"=`}š¹ÔäêêêêêêêêêêêêêêêêêêêêêêêêëëëëëëëëëëëëëëëëìììììììììëîåÊ®kR4"3Rw·ÎàççìëçìëëëëëëëëëëëëëëëëììììììììììììììììêììëëÞº—uU>2#$9[€¤ÄÙåèëìëêëìííííííííîîîïïðððïïïððññññññòòóóóóóóôôõõõôôõö÷õòïìëéçåäääâáàâäæå亻»¼¼»»º¸¹¹ºº¹¹¸¶¸º¼¼º¸¶¹¹¹¹¹¹¹¹¶µ±¬¤–~iQ<%&9Qh™»ÀÂÂÄÈÈÄÉÈÇÅÆÈÊÌÈÉÊËËËËÊÍÎÎÍÊÊËÌÐÎÊÇÆÇÉÊËËÉÈÈÉËËÊÊËÌÌÊÅÁµ¡‡oW<&$9Sl…¡¶ÅÎÔÔÔÖ×ÖÕÕÕÖÖ×××ØØØÙÙÚÚÚØÚÜÞßÞÜÛÜÛÚÚÚÜÞßßààßÝÝßáááâââãããà×ĨŒpS=%%?_z—·ÒÞèéêëëëëêëëëëëëëëêêêêêêêêììììììììêêêêêêêêêêêêêêêêìíëãÒ´mS6$-Qr”´ÊáéæéêèëëëëëëëëëêêêëëìììëëëëëëëëëëëëëëëëìëïíèáØ}Z?1" "3V{žÂÜãèìêêííëìììììììììììííîîîîîîïïðððñññòòóóóòòòóóôôôø÷÷÷ø÷ôñîëéçççåããããääååå¹¹ºººº¹¹¸¸¹ºº¹¸¸¶¸º¼¼º¸¶········¶µ±«¤•}hO;$&9Qh™½ÁÃÃÄÈÇÄÉÈÆÅÆÇÊËÇÇÈÉÊÊÉÉÇÊÍÍÌÊÊÊÏÍÊÈÈÊÌÍÌËÊÉÉÊËÌËËÊËÌÊÆõ¡‡oW<	Sl…¡¶ÆÏÕÔÒÔÔÓÕÕÕÖÖ×××ØØÙÙÙÙÙÙÙÛÝÞßÞÜÛÝÜÜÜÜÝÝÞÞßàßÞÝßáààááââââáØĨŒpR=%#<\x•µÐÞèéêêëëêêëëëëëëëëêêêêêêêêììììììììêêêêêêêêêêêêêêêêëíëãÒµnT7$+Np‘²ÉàéæéëèëëëëëëëëëêêêëëìììëëëëëëëëëëëëëëëëìëïíèâÄš[@2# 1Sxœ¿Úâèìêêìíëìììììììììììííîîîîîîïïðððñññòòòóóòòòóóôôôø÷÷÷ø÷ôñîìéçççåäããäääååå·¸¸¹¹¸¸··¸¹¹¹¹¸·¶¸º»»º¸¶¶¶¶¶¶¶¶¶µ´°ª¢”|fM8"&9Rh™¾ÃÅÄÅÈÇÃÈÇÆÅÆÇÉÊÆÆÇÈÈÈÈÈÂÆËÍÍËÉÈÍÌÊÉÊËÎÏÌÌËËËËÌÌÍËÊÊËÉÇĵ¡‡oV;%#9Tm…¡µÇÏÕÓÑÑÑÐÕÕÕÖÖ×××ÙÙÙÙÙØØØÚÛÝÞßÞÝÜÝÞÞÞÞÝÝÜÝßàßÞÝÞàßßàààáááâÙÅ©ŒoQ<% 8Xu“³ÎÞèèéêëëêêëëëëëëëëêêêêêêêêììììììììêêêêêêêêêêêêêêêêëíëãÓ¶pV8% )KlŽ¯ÈßèæêëèëëëëëëëëëêêêëëìììëëëëëëëëëëëëëëëëìëîíèãÇ^B3$.Ot˜¼×âèëêêìíëìììììììììììííîîîîîîïïðððññññòòòóòòòóóôôô÷÷ö÷ø÷ôñïìéèèèæäãäääåååå··¸¹¹¸····¸¸¸¸··¶·¹ºº¹·¶¸¸¸¸¸¸¸¸´³¯¨¡’zdJ6 ':Rh™®ÀÄÆÄÅÇÆÃÇÆÅÅÅÇÈÉÆÆÇÈÉÈÈÈÃÇËÌËÉÈÈÍÌÊÉÉÊÌÍÌÌÌÌÌÌÌÌÎÌÊÊÊÉÇƵ¡†oV;%#9Tm† µÅÍÓÒÐÑÑÐÕÕÕÖÖ×××ÙÙÙØØØØ×ÚÛÜÝÞÞÝÜÞßàààÞÜÛÝÞàßÞÝÞßÞÞÞßßàààâÙÅ©ŒoQ<%5Ut’±ÍßçèéêêêêéêêêêêêêêêêêêêêêêëëëëëëëëêêêêêêêêêêêêêêêêêìëäÔ¸‘sX:& (Hh‹ÆÝèæêëéëêêêêêêêêêêêëëìììëëëëëëëëëëëëëëëëíëîìéåÊ¢„aD5%,Lq”¹Õâèëêéììêìììììììììììííîîîîîîïïðððððñññòòòòòòóóôôô÷öö÷ø÷ôòðíêééèçåäääåååææ·¸¹¹¹¹¸·¶¶····¶¶¶·¸¹¹¸·¶········³²§ŸwbG4':Ri€š®¿ÃÅÄÄÇÆÂÅÅÅÅÅÆÇÇÇÇÈÉÉÉÉÉÉËËËÈÇÈÉÍÌÊÈÇÇÈÈÌÌÌÌÌÌÌÌÏÍËÊÊÊÈÆ´ †nU;%#9Un† ´ÂËÑÑÐÒÓÒÕÕÕÖÖ×××ØØØØØØØØÚÛÛÜÜÝÜÜÞßàààÞÜÛÛÞààÞÝÝÞÞÞÞÞßßààâÙÅ©ŒoR<% 4Ss‘¯ÌàçèééêêééêêêêêêêêêêêêêêêêëëëëëëëëêêêêêêêêêêêêêêêêéëëäÕº“u[<' (Fe‰¬ÄÜçæëìéëêêêêêêêêêêêëëìììëëëëëëëëëëëëëëëëíëíìéçΦ‡dG7&+Jn’·Ôáçëééëìêìììììììììììííîîîîîîïïððððððñññòòòòòóóôôôööö÷øøõòñîëêêéçæääåååæææ·¸¸¹¹¸¸·µµ¶··¶µµ··¸¸¸¸··´´´´´´´´²±¬¥Žv`E2';Si€š®½ÂÄÃÃÆÆÂÄÄÄÅÅÅÆÆÇÇÈÉÊÊÉÉËËËÉÇÆÇÉÌËÊÈÇÆÆÆËËÌÌÌÌËËÎÍËËÌËÈÅ´ †nU:$":Un† ³ÁÊÑÑÐÓÔÓÕÕÕÖÖ×××ÖÖ××ØØØÙÙÙÚÚÚÛÛÛÝÞÞÞÞÝÝÜÛÝààÞÝÜÝÞÞÞßßàààà×ĨŒpS>%!2Qs¬ÉßççèéééééééééééééêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêèëëåÖ»–w]>(!&Cb‡«ÂÚææëìéëééééééééêêêëëìììëëëëëëëëëëëëëëëëíëíìêéÑ«‹fI9()GjµÒáçêéèëìêìììììììììììííîîîîîîïïðððïðððññññòòòóóôôôöõõ÷øøõóñïìêêêèçååååæææ綶····¶¶´µ¶¶¶¶µ´········³³³³³³³³±°«¤œt^D2(;Sj€š¯»¿ÂÁÃÆÆÂÃÃÄÅÅÅÅÅÅÆÇÈÈÈÈÈÆÈÊÉÈÆÆÇËÊÊÉÈÈÈÈÉÊËÌÌËÊÉÍÌÌÍÍËÈijŸ…nU:$":Vo† ³ÄÌÓÒÑÒÓÒÕÕÕÖÖ×××ÔÕÕ×ØÙÚÚØØØØØÙÚÚÝÜÜÜÜÝÝÞÚÝßàßÝÜÜßßßßàààáÞÖèŒqT?%!1NqŽ¨ÅÜæçèééééèééééééééêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêèêëå×½—y_?)!$?^ƒ¨ÀÙåæëíéëééééééééêêêëëìììëëëëëëëëëëëëëëëëíëìëêêÔ®iK:) &Cf‹±Ïáçêèèëëéìììììììììììííîîîîîîïïðððïïðððñññòòòóóôôôõõõ÷øøöóòïìëëêéçåååæææçç´µµ¶¶µµ´´µµ¶¶µµ´········µµµµµµµµ±¯«¤›Œs^D2(;Sj›¯¹¾ÀÀÂÆÆÂÂÃÄÄÅÅÄÄÄÅÆÇÇÇÆÆ¿ÃÈÊÉÇÆÅÉÉÊÊÊÊËËÈÉËËËËÉÈÌÌÍÎÏÌÇóŸ…mU:$":Vo† ³ÇÏÔÓÑÑÒÐÕÕÕÖÖ×××ÓÔÕÖØÙÚÛØ××××ØÙÚÜÛÚÚÚÜÞßÙÜßàßÝÜÜßßàààáááÝÕ¨rU@% /Lo‹¥ÂÚæçèééééèééééééééêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêçêëåؽ˜z`@*!"=[¦¿ØåæìíéëééééééééêêêëëìììëëëëëëëëëëëëëëëëíêìëêëÕ°ŽjL;) #@cˆ¯Ìáæêèèëëéìììììììììììííîîîîîîïïðððïïïððñññòòòóóôôôõõõ÷øøöôòðíëëëéèåååææççç³´µ¶¶¶¶µ´³²±±³´¶µ¶····¶µ´´³´µ´±®²°«¢™Šq\D1 )=Ukš®¹»½ÀÁÂÂÁÀÀÁÂÄÅÆÇÅÄÃÂÂÄÆÇÅÆÇÈÈÇÅÄÄÄÄÅÆÇÉÊÊËÍÍËÊÊËÍËÊÌÎÌÇ´Ÿ„kR8##:Un…°ÃÌÓÔÔÕÒÎØ×ÕÓÒÒÒÓÔÔÔÕÖ×ÙÚÖÖ×ØÙÚÚÛÛÙ×ÙÝßÞÛÙÙÚÛÜÞßàÜÜÝÞÞßààÛ×ŨsU<(.Mo‹¥ÂØçéêêèèéëêêêêêêêêêêêêêêêêêééèèééêìììëëêêêêêêêêêêêèéèãØ¿™{^A+ <[€£ºÕäåêëèëêêêêêêêêêêêêêêêêìììëëêêêëëëëëëëëìïçìëçܳ‘nP=)!7bˆ«ÉÝåëëéëëêëììííììëììììììììíííîîïïïïïïððñññóóóôôõõõõõôöøø÷õôñíëëìëêææææææææ³´´µ¶¶µµ³³³³³´µµ´´´´´´´´²²²³µµ³±²°ª¢™Šq\C1 )=Ukš®¼½¿ÀÁÁÀ¿¾¿ÀÁÂÃÄÅÂÃÃÄÄÅÄÄÄÄÆÇÇÆÅÄÆÆÅÅÅÆÇÇÉËÌÌËÊÊËÌÊÉÊÌËÅÁ´ŸƒkR8#"9Un…ž±ÄÌÒÓÓÔÓÏÒÑÑÒÓÕ×ØÖÕÕÕÕÖÖ×××ØØÙÙÚÚ××Ö×ÚÛÛÚÛÛÚÚÚÚÛÜÛÜÜÝÞßààÛ×ŨsU<(.Mo‹¥ÂØåçééççèéêêêêêêêêêêêêêêêêêééèèééêììëëëêêêêêêêêêêêèéèãØÀš|_B+ ;Z~¢¹ÔäåêëèëêêêêêêêêêêêêêêêêìììëëêêêëëëëëëëëìïçìëèÝ´“oQ>)!6`†©ÈÛäëêéëëêëììííììëììììììììíííîîïïïïïïððñññóóóôôôõõõõôöøø÷õôñíëëëêéæææææååå²³´µµµµ´³³´µµµµµ´³²±±²³´±°°²µ¶´³²°ª¢™Šq[C0 )=Ukš®¾¿ÀÁÁÀ¿¾½¾¾¿ÁÂÂÃÀÁÄÅÆÅÃÂÂÂÄÅÅÅÅÅÇÆÅÅÄÄÅÅÈÊËËÊÉÉÊÊÈÇÈÊÉÄ¿³žƒjQ7#!8Tm…Ÿ³ÆÌÑÐÐÓÓÐÏÏÐÑÓÖØÙÖÖÖÕÕÕÔÔØØØØØØØØÕÖØØ×ØÙÛÝÜÛÙØ×××ÚÚÛÜÞßàáÛ×ŨtV=(.LmŠ¥Á×ãåçèçæçèêêêêêêêêêêêêêêêêêééèèééêìëëëêêêêêêêêêêêêèéèäÙÁ›}`C, 9W{Ÿ·ÓãåêëèëêêêêêêêêêêêêêêêêììëëëëêêëëëëëëëëëïèìëèÞ·•qS?* 4]‚¦ÅÚãêêéëëêëììííììëììììììììíííîîïïïïïïððñññóóóóôôôõõõôöøø÷õôñíëëëêéçææååäää²²³´´´´´²´µ··¶µ´µ³±°°±³µ²±°²´´³²±°ª¢™‰p[B/ )=Ukš®¼½¿ÀÁÀ¿¾½¾¾¿ÀÁÂÂÀÁÂÄÄÄÃÂÀÁÂÃÄÅÅÅÅÅÄÄÄÄÅÅÆÈÊÊÉÈÉÊÊÈÇÈÊÉÄ¿²iQ7" 7Sl… ´ÇÌÏÎÎÑÓÑÒÒÒÒÒÒÓÓÔÔÕÕÕÕÔÔ×ÖÖÖÖÖÕÕÔØÚÚØ×ÚÝÝÜÛÙØØ×ØØÙÚÜÝßààÛ×Å©ŽtW>(-Jk‰¤ÀÕâåçèçççèééééééééééééééééêééèèééêëëëêêêééééééééééçééäÚÂaD-!6Swœ´ÑâäêëèëêêêêêêêêêêêêêêêêëëëëëëëëëëëëëëëëëïéíëèຘtUA+ 2X}¡Â×áéêéëëéëììííììëììììììììíííîîïïïïïïððñññòòóóóôôôõõôöøø÷õôñíëêêéèææååäããã±±²³´´³³²´µ··¶µ´¶µ²±±²µ¶´³±±²²±°±¯©¡˜‰p[A. )=Ukš®¹º¼¿ÀÀÀ¿¿¿¿ÀÁÁÂÂÂÁÀÀÀÂÃÄÀÁÁÂÃÄÅÆÂÂÂÂÃÅÆÇÄÆÈÉÈÇÈÉÊÈÇÉËÉÄ¿°›€hP6"6Rk„Ÿ´ÆÌÎÌÍÐÒÑÓÓÓÒÒÑÐÏÐÑÓÔÕÕÕÕÔÔÔÔÔÓÓÓÓÖÙÙÖÖÙÜÜÛÚÚÚÚÛÛØÙÚÛÜÞÞßÛ×Å©ŽuX?(,Gh‡¢¾ÒâåèêéèèéééééééééééééééééêééèèééêëëêêêéééééééééééçééåÛßcE."3Ns˜²Ïáäêëèêêêêêêêêêêêêêêêêêëëëëëëëëëëëëëëëëêðêíëèâ½›wXC-!/Txœ¾Õßèééëëéëììííììëììììììììíííîîïïïïïïððñññòòòóóóôôõõôöøø÷õôñíêêéèçååääããââ°±²²³³²²³³´µµµµµ¶µ´³³´µ¶¶³±°±±°¯±¯©¡˜ˆpZ@. )=Ukš®¶·º½¾¿¿¾¿¿¿ÀÀÁÁÁÂÁ¿¾¿ÀÃÄÂÂÂÂÂÄÅÆÀÀÁÁÃÄÆÇÂÅÇÇÇÆÇÈÊÈÇÉÊÉÄ¿¯šgO6" 6QjƒŸ³ÅËÎÌÌÐÑÐÏÐÑÒÒÒÑÑÎÏÒÔÕÕÕÔÓÓÓÓÓÓÓÔÑÓÔÔÔÔÖ×ÚÚÙÚÚÛÜÝÙÙÚÚÛÜÜÝÛ×Å©vX@(*Ce„ »ÏáäèêêéééèèèèèèèèèèèèèèèèêééèèééêêêêêéééèèèèèèèèèçééæÜÅ¡ƒdG/"0Jo•¯ÍßäêëèêêêêêêêêêêêêêêêêêêêëëëëììëëëëëëëëêðêîëèäÀŸzZE." -Ps˜ºÒÝæééëëéëììííììëììììììììíííîîïïïïïïððññññòòòóóóóõõôöøø÷õôñíêééçæããããããã㯰±²²²²±³³³³³´µµµµµµµµµµ´²¯¯°²²±°®©¡˜ˆoZ?- )=Ukš®¶·¹»¼¼»»¾¾¾¾¿¿¿¿ÀÀ¿ÀÀÁÁÂÅÄÃÂÂÃÄÅÂÁÁÁÂÃÄÅÁÃÆÆÆÆÇÈÈÇÅÇÉǾ®™~gO6"!6Pi‚²ÄÊÎÍÍÏÐÎÌÎÏÑÒÒÒÑÏÐÒÔÕÔÓÒÓÓÔÔÕÕÖÖÒÑÑÒÔÖÕÔÙÙØØÙÚÛÛÚÚÚÚÚÚÚÚÛ×ŪvY@((@až¹ÌßãçééèèèèèèèèèèèèèèèèèèèêééèèééêêêêéééèèèèèèèèèèæèéæÝÆ¢„eG0#.Gl“®Ìßãêëèêêêêêêêêêêêêêêêêêêêêëëìììëëëëëëëëêðëîêéåá|\F/" +Lo•¸ÐÛæééëëéëììííììëììììììììíííîîïïïïïïððñññññòòòóóóõõôöøø÷õôñíêéèçåàááâããä䯰±²²²±±´³²±±³´¶³´´µµ´´³²°®®±³³³°®¨ —ˆoZ?- )=Ukš®·¸¹ººº¸·¼¼½½½½½¾½¾ÀÂÂÁÀ¿ÆÅÄÃÂÃÄÅÄÃÂÁÁÁÂÂÀÃÅÆÅÅÆÈÇÅÄÅÇÆÁ¼™~fN5!"6Piœ±ÂÉÎÍÍÏÐÍÍÎÐÑÒÑÐÏÐÒÓÔÔÒÐÏÓÔÕÖ×ØØÙÕÓÑÓ×Ù×ÕÙØØ×××ØØÛÛÚÚÚÙÙÙÛ×ƪwYA(&?_€œ·ÊÝáæèèçææèèèèèèèèèèèèèèèèêééèèééêêêêééèèèèèèèèèèèæèéæÝÆ¢…fH0#-Fj‘ËÞãêëèêêêêêêêêêêêêêêêêêêêêëëìììëëëëëëëëéðëîêéæÄ¢}]G/" *Km“¶ÏÛåèéëëèëììííììëììììììììíííîîïïïïïïððññññññòòóóóõõôöøø÷õôñíêéèæåßßàáãääå°°°±±²²²²µ·¶³²´¶´´´´´´´´³³³²²±±±°¯ª¡•…mX<++@Ukƒ›ª¶·¸¹º»»º¼¼¼»»ººº¿¿ÀÀÀÁÁÁÁ¿¼¼ÀÄÂÃÃÄÄÃÃÂÃÃÃÃÃÃÃÃÂÅÆÄü´ª–{dM4!#8Qi›¯ÁÈÍÎÎÑÐÎÌÌÌÍÍÎÎÎÍÎÏÏÐÑÒÒÑÑÒÒÒÓÓÓÒÒÒÓÓÔÔÕÕÖÙÚÛÚØ×ÙÙØØÙÙÚÛÜ×ÇsU@*%?_{—³ÉÝäéæäæçççççèèéééèèèèèèèèëêèèèèêëééééééééèééééèçæëéèæÝá‡gO3!.Fh¨ÀÙæèééèéééééééééééêêëëëéééêêëëëëëëëëëëëêîéïëçæɦ€_I2$ )Ij°ÉÞæåìîêêëëëëëëëëììììììììííííííííîîîïïðððñññòòóóóóôõö÷ø÷÷õòîëéèåãáàßàâãâᯯ¯¯°°±±²´µ´²±³µ´´´´´´´´³³³²²±±±°¯ª •„lX<++@Ukƒšª¶·¸¹ºººº¼¼¼»»ººº¾¿¿¿ÀÀÀÁÀÁÂÀ¾¾ÀÃÂÃÄÄÄÄÃÂÄÄÄÃÃÃÃÃÂÄÅÃÃÿ¸ª–|dM5!"8Rjš®ÀÈÍÍÎÐÐÍÌÌÍÍÍÎÎÎÎÎÏÐÑÑÒÒÑÑÑÑÒÒÓÓÑÒÒÒÓÓÔÔÓÕ×ØÙØÖÕ××ÖÖ××ØÙÜÖÆsUA*%?^{–³ÈÛâçåãåçæææææççççèèèèèèèèêéèççèéêèèèèèèèèêêëëêêéèêèçæÜá‡gO3!,DfŠ¦¾Øäçèèçéééééééééééêêêëëéééêêêëëëëëëëëëëêíéîëçæɨ‚`J3% 'Fg‹ÈÝæåìîêêëëëëëëëëììììììììííííííííîîîïïïððñññòòòóóóôõö÷÷÷÷õòîëéçåâßÞÞßâããâ®®¯¯¯¯±²³³±±²³´´´´´´´´³³³²²±±±°¯ª •„lW<++?Uk‚š©µ¶·¹¹ºº¹¼¼¼»»»»º½½¾¾¿¿¿¿¾ÀÂÂÀ¿ÀÁÂÃÄÄÄÄÃÂÄÄÄÄÄÄÄÄÂÄÄÂÃÅÁ¼ª–|eN5"!8Sk™¬¿ÆÌÌÌÏÏÌÍÍÍÍÎÎÏÏÎÏÏÐÑÑÒÒÐÐÐÑÑÑÒÒÑÑÑÒÒÒÒÓÑÓÔÖÖÕÔÓÕÔÔÔÕÖ××ÚÕŬsVA*$=\y”±ÇØàåäãåçæååååååååççççççççééèççèééææææææææêêêêêéèçêèçæÜá‡gO3"*Ac‡¤»ÕãæçççééééééééééééêêêëééééêêêëëëëëëëëëêíèîëèçÊ«„cL5'"$Bc‡ªÅÜååëíéêëëëëëëëëììììììììííííííííîîîîïïïðññññòòòóóóõö÷÷÷÷õòîëéçäâÝÜÜÞáããâ®®®¯¯¯°±±²±±±±±³³³³³³³³³³³²²±±±°¯ª ”ƒkV<++?Uj‚™¨µµ·¸¹¹¹¹»»»»»»ºº¼¼¼½½½¾¾¼¾ÁÂÂÁ¿¿ÂÂÃÄÄÃÂÂÄÄÄÄÄÅÅÅÄÆÄÁÂÄÁ¼ª•{dN5" 7Sk€˜ª¾ÅÊÊËÍÍÊÍÍÍÍÎÎÎÏÎÏÏÏÐÑÑÑÏÏÏÏÐÐÑÑÐÐÐÑÑÑÑÑÑÒÓÔÔÔÔÓÓÓÓÓÔÕÖ×ØÓÄ«sVA*$<Zw’°ÅÖÞåäãåçææååååäääææææææææèèççççèèçççççççççççççæåäéçæåÜá‡hP4"(?`„¡¹ÔâåçèèèèèèèèèèèèéééêêêèèéééêêêêêêêêêêêêíèíêèèˇeN6("#@_„¨ÂÚåäêìèêêêêêêêêêëëëëëëëëììììììììííîîîïïïððñññòòòòóôöö÷÷öõòîêèæãáÚÙÙÜàâã⮯¯¯°°°±±±°°±±±°³³³³³³³³³³³²²±±±°¯ª ”‚jU<++?Uj˜§´´¶·¸¸¸¸¹¹¹¹ºººººº»»»¼¼¼»¼¾ÁÂÁ¿½ÁÁÂÂÂÂÁÁÃÃÃÄÄÅÅÅÆÇÅÁÁ¿¹¨”zcM5"7Rj€—©¼ÃÈÉÉÌËÉÌÌÌÍÍÍÎÎÎÎÎÎÏÏÏÏÍÍÎÎÏÏÏÏÐÐÐÏÏÏÏÏÑÒÒÓÔÔÔÓÒÒÒÓÔÕÖ×ÖÒêŽrVA*#:Xt®ÄÕÞäåäåæåææååååååææææææææææççççææççççççççæææææåääèæååÜá‡hP4"(>^‚Ÿ·ÒáåçééèèèèèèèèèèèéééêêèèèéééêêêêêêêêêêêíçìêèèÌ°‰gP7(##=\¦¾×ääéêèêêêêêêêêêëëëëëëëëììììììììíííîîîïïðððñññòòòóôõööööõòîêèåâà×××ÚÞáâᯯ¯¯°°±±²±°°²²±°²²²²²²²²³³³²²±±±°¯ªŸ“‚iU<++?Ti€—¦³´µ¶·······¸¸¸¸¹¹¹¹¹ºº»»ºº»¾ÀÀ¾»¿¿ÀÁÁÀ¿¿ÁÁÂÃÃÄÄÅÅÇÅÂÁÁ½¶¦’xbL4! 5Ph~—ª»ÂÇÇÈÊÊÇÊÊËËËÌÌÌÍÍÍÍÍÍÍÍÌÌÍÍÍÎÎÎÏÏÏÎÎÎÎÍÑÑÑÒÒÒÓÓÑÑÑÑÓÔÖ×ÕÐÁ©ŽrVB*"9VrŽ¬ÂÔÝääâääâäääååæææååååååååååæççæååèèèèèèèèççèèèçæåçååäÛá‡iQ4#&<\€›´ÏÞãæèèçççççççççèèèééééçèèèééééééééééééêíæìéèéͱŠhP8("":X~¤ºÕãäèéçêééééééééêêêêêêêêëëëëëëëëìíííîîîîïðððññññòòôõöööööòíêçåáßÖÖÖÙÝßàß®®¯¯¯¯³±°°³´²°²²²²²²²²³³³²²±±±±¯©Ÿ“hT<++?Ti€—¦²³´¶¶···µµµ¶¶····¸¸¸¹¹¹º¹¸¸»¾¿½º½¾¾¿¿¾¾½¿ÀÀÁÂÃÄÄÁÃÄÁÁÁ¼µ¤w`J3 4Of}—ª¹ÀÆÆÆÉÉÆÉÉÉÊÊÊËËËËËËËËËËËËÌÌÍÍÍÍÏÎÎÎÍÍÌÌÏÏÏÏÏÐÑÑÎÎÏÏÑÒÔÕÓÏÀ¨rVB*!8TpŒ«ÁÑÚááßàßÝááâãäåææäääääääääåæççæåäææææææææçççççæååæäääÛá‡iQ5#$9Y|—¯ËÛàäææççççççççççèèèéééççèèèéééééééééééêíæëéèêβ‹hQ8(" 7Tz¡¸ÔãäèèæêééééééééêêêêêêêêëëëëëëëëììíííîîîïïðððññññòóõõööõöòíêçäáÞÖÕÕØÛÞÞݬ¬¬®®®´²°±³´³°²²²²²²²²³³³²²±±±±¯©Ÿ“hS<++?Ti–¥²³´µ¶¶¶¶³´´´µ¶¶¶···¸¸¸¹¹¹·¶¹¼¾¼º¼¼½¾¾½¼¼¾¿¿ÀÁÂÃýÀÂÁ½¶£v_I2 4Me}—«¹ÀÅÅÆÈÈÅÈÈÈÉÉÉÊÊÊÊÊÊÊÊÉÉËËËÌÌÌÍÍÎÎÎÍÍÌÌËÎÍÍÍÍÎÏÐÌÌÌÍÏÐÒÓÒÎÀ¨rVB*!7ToŒªÁÏÙßßÝÝÜÙÞÞàáãäåæääääääääãäææææäãååååååååääååääãâæäääÛá‡iQ5#"7Vz“¬ÈØÞáääçççççççççççèèéééçççèèéééééééééééêìæëéèêϲ‹hP7'!4QxŸ¶ÓãäçèæêééééééééêêêêêêêêëëëëëëëëìììííîîîïïïððññññòóôõõõõöòíêçäàÞÖÕÕ×ÚÝÝÜ®¯°°°°¯±±°°°±²³³³³²²±±±´´´³³²²²²°©ž’€hT;* ,?Uk‚—¤³´´²°°²³³´µ¶¶¶¶µ¶µµµ¶¸º¼¹¹¹ºº»¼¼»»¼¼¼½½½¿¿ÀÀÀÁÁÁ¾ÁÂÁÁ¾·£v_J24Md{•¨·¾ÃÃÃÅÄÂÆÈÉÈÆÆÇÈÊÈÆÅÅÆÈÊÉÉÈÈÉÉÊËÉÉÉÊÊËËÌËËÌÌÌÍÍÍÊËÌÍÎÏÏÐÐÊ»¥sVA)4Qn‰¦ºÊØÛØÞÝÛßÝÞßáâäåæââãäåææçåääããâââãääãâáãååååååäãâåæåáÙÄ£‡jR6$3Vt–¬ÆÕÜáääãäåäããåçææååææçèçççççççççèèééèèççæééåéäвkR7'! 2Py—³ÐáäéêæéèèèèèèèèêêêêêêêêëëëëëëëëëëëìììííîîïðññòòòòóôôõöööóïëèåáÞÒÒÓÖÚÝÞÞ®¯°°°°¯¯¯¯¯°±²³³³³²²±±±´´³³³²²²²°©ž’€hT;* ,?Uk‚—¤¯±²±²´¶´µ¶¶··¶¶··¶µµ¶¸¹¹¹¹¹ººººº»»»¼¼¼¼½½¾¾¾¿¿¿½ÀÀ¾¿¿º³£u_I23Ldz”¨¶½ÂÂÂÄÃÀÄÆÇÆÄÄÅÆÉÇÆÄÄÆÇÉÈÈÇÇÈÉÊÊÊÊÊÊÉÉÉÉÊËËËÌÌÌÍÊÊËËÌÍÍÎÎȺ£‹qU@)4Qm‰¤¹É×ÚØÝÝÚÞÜÜÛÛÜÝÞßààááâãäääãããââááàáâáßßáãäååååäãâäååáÙÄ£‡jR6$3Vt‘¨ÂÒÚàãäâãäãâãåçåååååæçèççççççççççèééèçççæéèåéäϲkS8'!0Nv•²ÏàãéêæéççççççççééééééééêêêêêêêêììíííîîîîîïïðñòòòòóóôõöööóïìéæâßÔÓÔÖÛÞßß®®¯°°°°°¯¯¯°±²´´³³³³²²²²´³³³²²²²²°©ž’€hT;* ,?Uk–£«±²²±²³´´µ¶·¶¶¶¸·¶µµµµ¶¹¹¹¸¸¸¸¸¹¹¹ºº»»»»»»¼¼¼½½»¾¾¼»»¶¯¢Žt^I23Lcz“§µ¼ÁÀÀ¿ÂÃÄÄÂÂÃÅÇÆÅÄÄÅÆÇÇÆÆÆÆÇÈÉÊÊÉÈÈÇÆÆÉÉÊÊËËËËÊÊÊËËËËËÌǸ¢ŠpT?)3Pl‡£·ÈÖØÖÛÛØÝÝÜÙ×Ö×ÙÚÝÝÞßßààáââáááàààÞàààßßâäãääääãââãääàØÄ£‡jR6$2UrŒ£½ÎØÞâãáãããáâäæåääääåæçæææææææææçèèèèçæçåéèäéãϲŒkS8'!-Ks“±Îßâèéæéççççççççééééééééééééééééììììíííîííîïððññòòòóôõõö÷ôðíêçãàÕÔÔÖÚÞßß®¯°°±±°°±±±±³´¶·³³³³³³³²³³³²²²±±²°©ž’€hT;* ,?Tj•¢¬¯²²°®²²³´µ´´´µµµ´´´µµ¸¸¸·¶¶µµ···¸¸¹¹¹¹¹ºº»»»»º½½º¹¹´¬ s^H13Kbx’¦´»ÀÀÀ¿ÀÂÃÃÁÁÂÄÅÄÃÃÃÃÄÅÅÄÄÄÄÅÆÇÇÆÆÆÆÆÆÆÈÈÈÉÉÉÊÊËËËÊÊÊÊÊËÆ·¡‰pT?)2Nj… ´ÆÔÖÔÙÙÖÛÞÜÙÖÖ×ÙÛÛÜÜÜÝÞÞÞßßßßßßßßßàááàáãåââãããââááãâßØÄ£‡jR6$0Sp‹¡¼ÍÖÜàáàáâáààãåãããããäååååååååååææççççæææåéèäéãϱŒkT9'!,Hq‘¯ÌÞáèéçéèèèèèèèèêêêêêêêêêêêêêêêêêêêëëëìììííîïðððññòóôôõõ÷ôðíëèäáÖÕÔÕÙÜÝÝ®¯°±±±±°°°°°±²´µ³³³³³³³´³³²²²±±±²°©ž’€hT<+ ,?Tj€”¡ª°±¯¬««¯¯°±²±±±±±²³´µµµ··¶¶µ´´´µµµ¶¶···¹¹¹¹ºº»»º¼¼º¹¹³¬Ÿ‹r]G12Kaw‘¤´»ÀÀÀÂÁ¿¿ÁÃÂÁÁÃÄÃÂÂÂÂÂÂÃÃÂÂÂÂÃÄÅÁÂÃÃÄÅÆÇÆÆÇÇÇÈÈÈËÊÊÊÊÊÊÉËƸ¢ŠqU@)1Mhƒž²ÄÒÔÒ××ÔÙÛÙ×ÕÕØÛÝÛÛÛÛÛÜÜÜÝÝÝÝÝÝÝÝÞßàßÞÞàãßßàáááààßááÞ×Ä£ˆjR6$/QnŒ£½ÍÕÛÞßßàáàßßáãââááâãääååååååååååææææååæäèçäèâαŒlT9(!+Go‘ÊÜàçéçêêêêêêêêêëëëëëëëëêêêêêêêêêêëëëììììììíîïïðññòòóôõõöôðíëèåâ×ÕÓÔ×ÚÜܯ¯°±²²±±¯®®®®¯°°³³³³´´´´²²²²±±±°²°©ž’€hT<+ ,?Ti“ ¦©¬®®¯¯¯¯¯®¯±²´´µµ´´´´´³³³³³³´´µµµ··¸¸¸¹¹¹¹»¼¹¹¹´žŠq\G02J`v£²¹¾¾¾ÀÀ½¾ÀÁÁÀÁÂÄÁÁÁÁÁÁÁÁÁÁÀÀÀÁÂþ¿ÀÁÃÄÅÆÅÅÅÅÆÆÇÇÈÈÈÈÈÉÉÉËÅ·¡ŠqU@)1Lf€›¯ÂÐÒÐÕÕÒ×ÕÔÓÓÔÖÙÛÙÙÙÙÙÙÙÙÚÚÛÛÛÜÜÜÚÛÜÚÙÙÚÜÜÜÝÞßÞÞÞÝßßÝ×ãˆjR6$-OmŒ£½ÍÕÛÞÞÞßàßÞÞàâááààááâãääääääääääåææåääåäèçãèâΰŒlU:( *Dm«ÉÛßçéçêêêêêêêêêêêêêêêêêêêêêêêêêììììííîîëëììíîïïðññòóôôôõòïìëèåâÙ×ÔÔ×ÚÛܯ°±±²²±±±±°¯¯¯¯°³³³´´µµµ²²²±±±°°²°©ž’€hT<, ,?Ti“Ÿ¦¨ª«ª«®¬®¯¯¯¯®¯°±²³³²±²²²²³³³³²²²²³³³´µµµ¶¶¶··¶¹º¸¸¸´‰p[F01I`uŽ¢¯¶»»»½½º»½¿¿¾¿À¿¿ÀÀÀÀ¿¿¿¿¿¿¿ÀÁÁ¾¾¿ÀÁÂÃÃÃÄÄÄÅÅÅÆÄÄÄÅÆÆÇÇÉõ ˆpT?)0Ke™ÀÎÑÏÔÔÑÕÓÓÓÓÔÕÖ×ÖÖÖÖÖÖÖÖØÙÙÙÚÚÛÛÚÚÚØÖÕÖØÙÚÛÜÜÜÜÜÜÞÞÝÖãˆjR6$,Nk‰ ºËÔÛÞßÝÞßÞÝÝßáààßßàáââãããããããããäååååäãåäèçãçâίŒlU:( 'AjªÇÚßæéçêèèèèèèèèèèèèèèèèççççççççééêêêëëëêêëìííîîððñòóóôôôñîëêçäáÝÚ×ÖØÛÝÞ¯°±²²²²±¶µ´³²²²²³³³´´µµµ²²²±±°°°²°©ž’€hT=, ,?Ti~’Ÿª««ª¨¨©«®¯¯°°¯¯°±²³²±°¯°°±²²³³³±±±²²²³³³³³´´´µµ´·¸¶·¸³¬œ‰p[F01I_uŽ¡´¹¸¸ºº·¹»½½½½¿À¾¿¿ÀÀ¿¿¾¿¾¾¾¾¿ÀÁ¿¿¿ÀÀÀÀÀÃÃÃÄÄÄÅÅÀÀÁÂÃÄÅÅdzž‡nR>)/Jd~˜¬¿ÎÐÎÓÓÐÕÔÔÕÕÕÖÖÖÔÔÔÔÔÓÓÓ×ØØÙÙÚÚÚÛÜÜÙ×ÕÖØ×ØÙÚÛÛÛÚÛÝÞÜÖãˆjR6$,Mj…œ¸ÉÓÛßàÜÞÞÞÜÝßáàßßßßàáâãããããããããääååääãåäççãçâί‹lV;( %>hŠ©ÇÙÞæéçêææææææææææææææææååååååååååååææççêêëëìíîîððñòòóôôóðíëéçãáßÜÙØÚÝß௰±²²²²±´´´´´²±±°±²²±±³µ³³³²²±±±¯®©Ÿ“‚jU8)+>Si”¡«¬¬«ª«¬¯°±°¬®²²²±°°¯¯¯¯¯¯¯¯¯¯¶´³±±±²³µ³±±²³³²²µ¶µ¶·³¬Ÿ‹q[F0 2J_s‹ª´»¹´µ¸¹»»»»¼¼½½½½¾¾¿¿ÀÀ¾¾½½¼¼»»¿¿¿¿ÀÂÃÄÂÂÂÂÃÃÄÄÃÂÀ¿¿ÁÃÅ¿³Ÿ‡nTA,2Le~—©¿ÈÎÎÍÏÐÎÕÓÑÏÏÒÕ×ÖÕÕÕÔÔÔÔ×××××××××××××ØÙÚÔÙÜÛÖÔÕÙÚÞàÞÕÁ¢ˆhR7&(Hi…ŸºÇÐÜàÜßÞÛÚÚÛÞßààááááááââáááâããââáãååäââçæâæéÞ̯iSA,!,FlŠª½ÑÚÞãäáààààßßßßÝÜÛÜÞßÞÝÜÛÚÚÜÝÜÚÔÛØÖØÕÕáåèåçòðëðîîïðññòóòòðìèæååÜÙØÚÞáßÝ®¯¯°°¯¯²²²³²²±°°²²²±±³µ³³³²²²±±¯®¨Ÿ“hS:+!,?Ti“Ÿ«¬¬«ª«¯°±°®¬®®®®®°°°°°°°°µ´²±±±²²µ³±±²³³²¯²³²²³¯¨Ÿ‹q[F/0I^s‹ž©³º·³´¶¸¹¹ººº»»»¼¼¼½½¾¾¾¼¼¼»»ººº¼¼¼¼½¿ÀÁ½½¾¾¾¿¿¿ÀÀ¿¿¿ÀÁÂÃÀ´ ‡mR>,.Hc|—ª¼ÄËÊÉËÌËÎÍÌÌÍÏÒÔÖÕÕÕÔÔÔÓÒÒÒÓÓÓÓÓÓÓÒÒÓÔÕÖÕØÛÙÕÓÕÙÔ×Ø×ѾžƒhQ6$*Iiƒ·ÄÍØÛ×ÝÝÜÛÛÜÝÝÝÝÞÞÞÞÞÞÞÞÝÝÝÞÞßäãâãååãáàäãàâåÚÊ«ŒiSB.! !"""&&&'''((,,-../00/025?Ts‹œ½ÄÈÌÎÌÊÊÊÉÉÉÈÈÇÅÄÅÆÇÆÄÁÀ¿¿ÁÂÁ¿¾ÃÁ¿Á¾¿ÌÙáãæïíéïíîîïðñòòòòðíêçååâßÜÝàáßÝ®¯¯°°¯¯¯°±±²±±±±²³²±±³µ³³³³²²²±®¨ž’€fQ8)".@Ti’Ÿ©ª¬«ª©ª¬®¯®¬«¬®®¯°°±±¯¯¯¯¯¯¯¯²²±°°°°±³±¯¯±²²±²µµ³³´¯¨›ˆoZE/0H]q‰œ«´º¸µ¶¸¸ººº»»¼¼¼½½½½¾¾¾¾½½¼¼¼¼»»¼¼¼¼½¾¿À¾¾¾¾¿¿ÀÀÀÁÁÂÃÃÂÂÀ¾³ž†mQ=)-Ga{–ª½ÆÌÌÊÌÍÌÌÌÌÍÏÑÓÔÔÓÓÓÒÒÒÒÑÒÒÓÓÔÔÔÓÓÓÒÓÔÔÕÕ××ÕÑÑÔ×ÔÕÖÖÒÀ „iR6#*He„›´ÁËÔ×Ó××ØØØØ××ØØØØØØ×××ÖÖÕÕÕÖ×ÙØ××ØØÕÓÔ×ÖÒÔÖ̾¢‡jWI910)+---.0211234566999:::;;AABCCDEEEHKNUez‰“§¬®²´´°°°¯¯®®®¬ªª«ª©§¤£¡¢£¤£¡ž£ Ÿ¢ž¡±ÆÖàåíêçîíîîïððññòòñïìèåãÞÚ×ØÛÞÝÛ¯°±²²²²±¯°±²²³²²±²³²°°²´´´³³³²²²®¨Ÿ“hS<-!-@Ti“Ÿ§¨ª©¨¨©ª«¬¬«ª«¬®®®¯¯°°°°¯¯¯¯¯¯¯±¯®®°±±°³µ¶³³³®§–„lYE00G[o†™ª²¸¶³µ¶¶¸¸¸¹¹¹ºº»»»»»»»»ºººººººº»»ºº»¼½¾¿¿¿¿ÀÀÁÁ¾ÀÂÃÄÃÁÀ¾¼±…lQ>(.G`y”¨½ÆÌÌËÍÎÌÌÌÍÎÏÐÐÑÐÐÏÏÎÎÎÎÏÐÐÑÑÒÓÓÒÑÑÐÑÑÒÒÓÓÓÐÍÎÑÔÕÕÔÓÐÀ¡…jT9&!1Me’¨·ÀÈÊÈÄÅÇÈÈÇÅÄÇÇÇÇÇÆÆÆÅÄÃÃÂÂÃÃÃÁÀ¿À¿¼¹¾À¾¼¼½µª”k^UMIJCEGHGHJLKKMNOQRRSTTUUVWWZZ[\]^__aeghny„Š‘””•—™š––•””““’“‘ŽŽŽŒŠ‰ˆ†‡ˆˆ‡…„„€†š°ÊÜäëéçîííîîïïððòññðíéãßÏËÉËÐÕ×ׯ°±²²²²±°±²³´´´³²³³²°°²´´´´³³³²²¯®© •…nZF8*%$"!""""!! #.@Th}œ£¥¦¦¥¥§¨§©ªª¨¨©ªªªª©©©¨¨««««««««¬¯¬¬®°°¯®°±®®®©¢•ƒlYF0/F[o‡™§®³±°²³±´´´´µµ¶¶···¶¶¶¶¶µµµ¶¶¶¶¶¸¸···¸¹º»»¼¼½½½½»½¿ÁÂÀ¾½Â¾²…lQ>).G_w‘¤·ÀÆÆÅÆÇÆÇÇÇÇÇÇÆÆÉÉÉÈÈÈÇÇÇÇÇÈÈÉÉÉÉÈÈÇÇÇÈÈÍÌËÉÇÈÊÍËËÉÇô˜~gT=,! !!""##$$#$%&''&&((())***,)(+3BXju„–£«²´³¬°±±°¬¯¯¯®®««ª©¨¨¨©«ª¨¨¨§¤¡¦§¥£££–…zngb``babdcbbdefghiklmnqrrstuvvwwxz{|}~‚…„ƒˆ‘Ž‰…|{z{|xxwvuuttuspppoljkihhiigfegdegcl„¾×âééèïííííîîîîñððïíçÞØÆ¿ÁÇÎÑÑ®¯¯°°¯¯²²³´´´³³²³´²°°±³µ´´´³³³³²°ª¡˜‹weQC621/.//..-,,++++**)(('(((''&&&%$$#""!!!!! !#,6EUdu…™›œœž Ÿ ŸŸ ¡¤££¢¡ Ÿ¢¢¢¢¢¢¢¢£¤¥¦¦¦¥¥§¥¤¥§©©¨§©ª¨¨¨¤’kYG2 0G[o†˜¥¬°¯¯±±®±±²²²³³³´´´´³³³³²²³³³´´´¶¶µµµ¶¶·¶¶···¸¸¸¸¹¼¾¾½»ºÁ¼®˜jR@( 1H^s‰š¶¼¼»¼½¼¿¾¼»ººº»»»»ººº¹¹»»»»»»»»¼»ºº¹¹ºº¼»º¹¸¹ºº¹º¸µ°£ycUD90)(+(())*++,00000000222344556789::::;;<<=>>>?>>@FQ_is|‡‘—šœœ™›žž›™™™˜˜—––••”“’‘‘‘‘”“‘‘‘‹Œ‹ŠŠ‰…‚vtqpprux}~€~~€ƒƒ„…†‡ˆˆ‹ŒŒ‘’“”•—˜™šž¡Ÿœž¡˜‹†{oiea_`^]][ZYXXZXUUUTRPOMLLMMKIIIFHJEQnŒ²ÏÜçêêïííííííííðïîîìäØÏÅÀ»¼ÁÇËÌ®¯¯°°¯¯²²³³³²±±³´´²°°±³µµ´´´³³³´²¬£œ’q_RFBCA@AAA@?>==<??>=<<;;99988777665443224444332201210024;BMV`jv~‡‰Š‹ŠŠŒŽ‹ŒŽŽŒŽ““’’’’’’’“”–––•”–”“”—™™˜—š›šš›—†veXK:+$ (7JYi|š £¢£¥¥¡¥¥¥¦¦¦§§¨¨¨§§¦¦¦¦¦¦§§§¨¨©©¨§§¨¨©§¨¨¨©©©ªª«¬®¬¬¯«ž‹xfSD2' !!!!!!!!""""""""$$$$$$$$$$$%%&&&)0>P`m~‹š¢©¨§©ª©ª©§¥¥¦¨©¤¤¤¤££¢¢¦¦¥¥¤££¢¥¥¤£¢¢££¡ ŸŸŸŸžžž¡¡˜ŽqbYQLHCBEBCCDEFGGIIIIIIIIJJKLMNNOPPRSTTTTTTUVVWXXYYYZ]bgiruz€€ƒ„„ƒ~~}|{{zzzxwvvvvvutttsqoonmnnljjhmt{‰“™›žž ¡¤¤¥¥¦¦§§©©ª¬®¯°°±²´µ·¸¹»¿½¹¸´ Šn^VPIDDDDCA@?>>?=<;<;988644543110-/2-;Z§ÇÖäêêíììììììììîíììéàÒǽ¸²³¹ÀÅƯ°±²²²²±²²²²±°¯¯³´´²°¯±³µµµ´´³³³¶³¬¤ž–‡yqdXVVUTUUUTSRRQPPPONMLLKMMLLLKKKKKJIHGGFFFEEDDCC@ABA@@BDGLSX\bjpvxzzyz{}z|}}||~}}}~€€€€€€€€€€€‚ƒ…†‡†……†…„…‡‰Š‰„‡ˆ‡ˆ‰…~xk]VNB8200///...........,,,,,,,,,,,,,,,,,,,,,,,,))))))))********.4@MWbq€†ŒŽ’‘‘‘‘’’’““”””““’’‘‘’’““””””““’’’““”””•••––””•–––––™–Œ}ocUIE:11320033333333444444446666666677777777:::::::::;;;<<<<>BMZbit~ƒ‹’‘’“’’ŽŒ“•‘‘‘ŽŒ‹Š‰‰Œ‹Š‰‰ŠŠŠ‰ˆ‰Š‰‡†…‰‹‡zoee`\][XWZYYZ[\]^^bbbbbbbbcddefghhijklmnnnmmnoopqqsttstutqkjklkhgheeffffeeddcba`__`_^\[[[[\[ZZ[ZXVXVUWWUUV^hvƒœ¦«¯±´µ¶·º¼¾¾¾¾¿¿¿¿ÆÇÈÉÊÌÍÍÌÍÎÏÑÓÔÕÔÚÙÔÑÈs`MC<3-,.-,+*('')'%%&&$"&$"""" $#"$ /Px¡ÁÑâêéëììììììììîìëëèÝ૧¨°¹À±±±±±±±²°²´´²¯¯¯µµ³²²²²²³³³´´´µµ´³±¬£˜‡wsmiggfeeedcbbaaaaa``__^`_^]\[[[]]\[[ZYYZYYXXWWVVXWSRUURWWUTUY_chhhhhhhhiiijjkklkklmmnoonnnnnnnnqqqrrsstrrstuvvwttttsrqpdb^XQKGEAAA@???>@@@@@@@@>>?@@?>>?><;;<=>========;;;;;;;;<<<<<<<<?BHPYagjvz~}|}~~~~~~~~€€€€~~}}~~~~~~~~€€‚ƒ„……‚‚zlb^XPJHGGEBACGHHHIIIIHHHHHHHHLKKJKKLMJKLMMMMLLLLMMNNNONNMNOQRVTXaeeksxyzzyz{|z{{||{{zyyyxxwwwssssssssrrrrrrrrssrqpponlmprledhacgkmoppopqrtuvvwxyzyxwu~~~~~~}€€‚„…†‡…„„…‡ˆˆ‡‡Œ‰„{qpe[VRNMOOONMMLKKNMLKIHFFFFFFFFFFAAAAAAAA@>=>=;>DOc|Ÿ±ÁÉÌÌËÌÎÐÓÔ××××××××ÝÝÝÝÝÝÝÝÞÞßàáââããâåãÝÕ·ŒwV?4(#$! -Km–ºÑåìéêëëëëëëëëíëëìéÚij¤ ž¢«¶½À®®¯¯°°±±°²³³±°°±µ´³³²²²³³³³´´µµ¶³²±¦ž–‘‰…|{{{zyyxwvvuuuuttsssrtsrqpooonnmlkkjjjiiiiihhjlkgfiheda\WSSTVWWWWWWWWVVWWXXYYXYYZ[\]]^^^^^^^^^^__````__`abbccaaaaaa`_YYYWVUVWUUUTTSSSRRRRRRRRSSTTTTSSSSRQQQQROOOOOOOOPPPPPPPPNNNNNNNNQQRUY\^^dgkkjijlkkkkkkkkllmmmmlllkkkjjjjkkkkkkkkmmmmmmmmllmnoppqlmi`\]\XYZ[\\ZZ\\\\]]^^^__``abbb^^^_`acc`abbcccbeeeffggghggfghijjffhfabfbcccbbccaabccbaa____^^^]\\\\\\\\[[[[[[[[\[[ZYXWWVVYZVRV]glu|‚†ˆ‰‰‰ŠŒŽ‘‘’’’’••••••––˜™š›œžŸ£¡Ÿ ¡¡Ÿž £¤¡œ”…wh[NE?:8:6655432233210/.---------++++++++*''('&)/Ha˜ÃÔÜÞÞÞÞßáãäææææææææççççççççççèèéêëëèçêéäÞÀ–zX@4'!!+Hk”¹ÐäëéêëëëëëëëëíëêëçÙ±œ™˜¨´½Á¬¬®¯°±±°±²±°°²´µ´´³²³³³²²³´µ¶··³³²¯«§£ ˜”ŽŽŽŽŒŒ‹ŠŠ‰ˆˆ‡‡‡‡††††††…„„ƒƒ‚„„ƒ‚‚€€~~€€|~~zy{{xsneZRLHGBBBBBBBBEEEEFFFFDDEEFGGHHHHHHHHHIIIIJJJJIJJKKLMMKKLLLMMMNPTW[`gkmmlllkkkjjjjjjjjghhiihhgghhhgffeffffffffddddddddeeeeeeeeeb^\ZWTQPRTUTSTUUUUUUUUUTTUUUUTTTTTSSRRRSSSSSSSSUUUUUUUUTUUVWWXXSUTSV\aajnsuvwxyuuvvvwwwuvwxyz{{vvwxy{}~|||}}}~~}}~~~€€€‚ƒ}wqi^XWPONMLKKKIIJKKJIIGGGFFFEEDDDDDDDDCCCCCCCCCCBAA@??@?@A?ALXgq— ¢¤¤¥¦§¨©©¨©©ª«®¯®®¯¯°°±±±²³´µ¶··»º¹¹»»º¸»»º¶±¤ycR?3*#!###""! #?Zž·ÎßçèèççèéêêëëëëëëëëêêêêêêêêèééêêëììëêííéäÉŸ}[A4&)Ei’¶Íâêèêëëëëëëëëíëêêæ×À®š˜—œ¥±»Á««¬®¯±²²±±²±°±´¶µ´´³³³´´²²³´µ¶·¸¶µ´³±¯¬£ œŸŸžœœ›š™™˜˜———–––––––––•””“—––•”““’‘‘’’““ŒŽ‹ŠŒ‹ˆ€xk]QF>:333333334444555555667788777777779999999999::;;<<:;;;<=>?EJQX_is{~~~~~~~~~~~~~~~~zz{{{{zzz{{|{yxvzzzzzzzzwwwwwwwwyyyyyyyyuoha[TLGABBCBBBCCCCCCCCCAABBBBAAAAAA@@@?@@@@@@@@BBBBBBBBBBBCCDDDBCEIQ\ejw‡‰‹Ž‹‹‹‹ŒŒŒ‹ŒŒŽŽŽŽ‘’“’’’““”•’’““””””•””””•••—…yl^RLA><:9987677887764444333200000000////////..--,,++-,,,-4FWguŠª±µ·¹ºº»¼½¾¾¿¿¾¾¾ÀÂÄÄÄÅÆÇÈÉÉÅÆÆÇÈÉÊÊÉÉÈÊÎÐÏÏÐÏÌÉÄ´–|dP9)#<Z¢¼ÑàæççççææççééééééééèèèèèèèèççèèééêêëêììèäÊ¡\B4%'BfŽ³ÊßèèêêêêêêêêêíêééäÕ¾¬ žœž¥°ºÀ¬¬¯°²³³±²²±°±´·µ´´³³´µµ³³´µ¶··¸¹¸·¶´³³³°®««¯¯®¬¬¬«ª©©¨§§¨¨¨¨¨¨§§¨¨¨§¦¥¦¥¥¤£¢¢¡ŸŸ ¡¡¢¢ž¡¡žŸ™ƒr`P@3+$$$$$$$$"""!!!!!''(((())((((((((**))))))))***++++**+,./19AMYer€Š‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘’’‘‹ŽŽŽŽŽŽŽŽŒŒŒŒŒŒŒŒ†~qe[OC:2100010000000000.//00//.///..---........///////////00000115?L[jt…‘œžž¡¢ ¡¡¡¡¢¢££¨¨§§¦¦¥¥¦¥¥¤¤¤¥¥©¨¨§¨©ª««¬¬¬®®®®ª¢“€n\K@.*%###" ""####""!! '=Rn€™¯¼ÃÈÊÌÌÍÎÎÏÏÐÔÓÑÐÐÑÒÓÕÕÖ×ØÙÚÚÖÖ×ØØÙÙÚØ××ØÛÝÝÜÞÝÛÙÔ¡„gQ7&!>\„¦¿ÓáæééééèèççêêêêêêêêêêêêêêêêëëëììììííêìêæãÉ¡€]B4%&?b‹¯ÆÜççêêêêêêêêêìéèèãÔ½«¢ ŸŸ¤®¹À®¯°±²²±³³³±±³µµ´´´´µ¶¶µµµµ¶¶¶¶º¹¹¸·¶µµµ´²³µ¶¶µµµ´³²²±±±±±±²²²²°±²³³²±°²²±°¯¯®®¬¬¬©¬ªª«©¤šycO;) *7I[l}œ¥¥¥¥¦¦¦¦££££££££¡¢££££¢¡¢¢¢¡ Ÿœ ŸŸŸŸŸŸŸŸšŽ|k[J8," $4G[p•¥²³³··³···¸¸¹¹¹¾½½¼º¹¸¸¾½¼»ºººº¾½¼»¼½¿À¿¿¿ÀÀÀÁÁÀÁÁÁÁÀ¿¾½³ ‡pZD3!!:Qr…¡¸ÅÌÐÓÕÕÕÖÖ×××ÛÛÚÙÙÙÙÙÚÚÛÛÜÝÝÝÝÝÞÞÞßßßáßÞÝÞÞÜÚÞßÞÝ×Ä£†iQ5$ 8V »ÑßæèéêêêéèèëëëëëëëëêêêêêêêêììììììììïìíêçäÌ¥„`D5& %<_‡«ÃÚåæêééééééééëèçèãÔ½¬žœœ¡«·À®®¯¯°°²³µ´³±²³´´´´´µ¶···¶¶¶µµµ··¸¸¸¸·¶¶´³´¶·¶µ··¶µ´´³³´´´µµ¶¶¶³µ·¸¸·µ´¹¹¸·¶¶µµ´´´´´³³³®²³°¯°®©Ÿ‘{eO:&!1H_s‡›¨²³³³´´µµ²²²²²²²²®¯¯°°¯¯®°¯¬ª©©©°°°°°°°°¯¯¯¯¯¯¯¯©›…p]H3$-D\t†°ÀÁÂÇÇÂÅÅÅÆÆÆÇÇÇÇÆÆÅÄÄÄÊÊÉÈÈÈÉÉÊÉÈÇÇÉËÌÈÈÈÉÉÊÊÊÉÊÊËÊÉÇÇÉ¿©s[B-!:Qo„¡¹ÆÍÒÖ×××ØØØØÙÚÚÛÛÜÛÛÛÛÛÛÛÜÜÜÜÝÞÞÞÞßßßâàÞÝÝÜÚØÛÝÞÝÕ¡†jQ5$!4Qy›¶ÎßææçèéééèçééééééééééééééééêêêêééééîëìêèçЪ‰eG7&"8\…©ÁØäæêééééééééêèçèäÕ¿®Ÿžœ›ž§´½¬²´¶¶´±±±´´´´´¶··¸¸·¶¶µ´´´µ·¸¹¹··¹·¶·¹º¹¸ººº¹¸··¶¸¸¹¹ºº»»¸¹»½½¼º¹»ºº¹¸··¶··¶¶µµ´´³·¹¶µ¶´¯œzdP<( 1Kcw‹Ÿ¬··¸¸¹¹ºº¸¸¸¸¸¸¸¸¹¹º»»º¹¹»¹·µ³³³´¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸········¯ ‰t_I3#-D\u‰²ÃÆÇÍÎÈÈÈÉÉÊÊÊÊËËËËËÌÌÌÌÌËËÌÍÎÏÌËÉÈÉËÍÎÍÍÎÎÎÏÏÏÎÏÐÐÏÎÌËÍÄv^D.7Np…£»ÈÐÕÚÚÛÛÛÛÛÜÜÚÛÝßàààßáààààààßààáááááââàßßààßÝÞâäáØÄ¥‹kS6%9V|¸ÐâëçèêëëëêéêêêêêêêêììììììììëëëëëëëëìéêéèèÒhJ8& 6[ƒ§À×ãåêéééééééééççèäÖÀ¯¥¤ ¤°¹®«ªª«¬¯±³³²²²³¶¶µµµµµ´¶·¸ºº¹¸··¸¸¹¹ºº»¸¸¸¹¹ººº»º¹¸¸¸¸¸¹¹¹¹¹¸¸¸¹ºº»»ºº¹ºººººººº···¸¸¸¸¸µ·¶³³´°ªž{eQ;&"2JbxŽ¢¯µº¾½¹·¹½¼»»ºº»»¼»»»»»»»»»»º¹¸··¶¹¹º»º¹·¶´µ¸º»º¸·»º¸··¸º»°¥u_J3! ,C]yŽ£¶ÅÇÇÍÐÎÌÌÌÌÌÌÌÌËÌÎÏÐÏÏÎÉËÎÐÐÐÒÔÐÐÐÐÏÎÍÌÒÑÑÐÐÑÑÒÓÓÒÑÐÐÏÏÑÅ‘w_E14TlŠ¤¸ÍÖÖÜÚÚÚÛÛÛÜÜßßßßßßßßÝßááàßàáßßßßßßßßáâãäãâàßßàààÜ˪ŽqS:*4Qxœ¹Óãéêêêêêêêêééééééééêêêëëìììììììììììêîçíëå׬ŽjK:( 1V¥½ÕáãççççèèéééçæçéæÙÄ´«©¤ž›¡¯º®®®®®¯¯¯±³³²²²³´µµµµµµµ¶¶·¸¸¸¸¸¸¸¹¹¹¹ºº¶¶··¸¸¸¹»»º¹¸¸¹¹»»»»»»»»ºº»»»»ºº»»»»»»»»ººººº¹¹¹·¹¸µµ¶²¬Ÿ‘{eQ;&"2JcyŽ¢°¶»¾¾»¹¼¿½½¼¼¼¼½½ºººººººº½½¼»º¹¹¸¹º»»»¹¸··¸º¼¼»¹¸¼»º¹¹º»¼±¦v_K3! ,C]yŽ¤¶ÆÈÈÍÐÎÎÎÎÎÎÎÍÍÎÏÐÑÑÑÐÏÌÎÐÐÏÏÐÒÐÐÑÒÒÑÑÐÒÒÑÑÑÑÒÒÒÒÒÒÑÑÑÑÒƯ“y`F23TlŠ¤¹ÎÖ×ÜÛÛÛÛÜÜÜÝßßßßßßßßÞáããâáâãááááááááâããäãâáààáááÝË«rT;*4Pw›¹ÒãéêêêêêêêêééééééééêêêëëìììììììììììêîèíëåØ®kL;( 0U~¤½ÕáãççççèèéééêèèéæÙŶ¯ª¤¡¥°¹¬¬®¯¯¯¯¯±³³²²²³³³´´µ¶¶¶¶¶¶¶¶·¸¸ºº¹¹¹¹¸¸¸¸¸¸¹¹¹¹»»º¹¹¹¹º¼¼½½¾¾¿¿»»¼¼¼¼»»¼¼¼¼¼¼¼¼¾½½¼¼»ºº¹»º··¸´®¡’|fQ;&"2Jcy£°·»¿¿½¼¾Á¿¾¾½½¾¾¿¼¼¼¼¼¼¼¼¿¾¾½¼¼»»»»»¼»»º¹»¼½¾½¼»¹¼¼»ºº»¼¼²§‘w`K4! ,C]yŽ¥·ÆÈÉÎÑÏÒÒÑÑÐÏÏÏÒÒÓÓÓÒÑÐÏÐÑÑÏÎÏÐÐÑÒÔÕÕÕÕÓÓÒÒÒÒÓÓÒÒÓÓÓÔÔÔÔȱ•{bG23SlŠ¤¹ÏØÙÞÜÜÜÝÝÞÞÞàààààààààâääãããäääääääääããäääãâáááââÞÍsU<+3Ov™·ÑâéêêêêêêêêééééééééêêêëëìììììììììììêîèíëæÛ±’mN<) 0T}¢¼ÔáãççççèèéééëêéêæÛɼ·¶²¬©«´»¨©«®®¯±³³²²²³²²³´µ¶¶·¶µ´´´¶¸¹»ºº¹¹¸¸·»»»»»»¼¼¼»ºººº»»¼¼½¾¿ÀÁÁ¼½¾¾¾¾½¼¾¾¾¾¾¾¾¾À¿¾½¼»»ºº¼»¸¸¹µ¯£”}fQ;&!2Jcy¤±·º½¾¾¾À¿¿¾½½¾¿¿ÀÀÀÀÀÀÀÀ¿¿¿¾¾½½½¼¼¼½¼¼¼¼½¾¾¾¾¼»º¼¼¼»»¼¼¼´©’xaL5" ,C]yŽ¦¸ÈÊÊÏÒÐÔÓÓÒÑÑÐÐÔÔÔÔÓÒÑÑÐÑÒÑÐÏÑÓÓÓÔÕÖÖÕÕÕÕÔÓÓÔÕÕÓÓÔÕÕÖ××Ôɲ–|bG23SlŠ¥ºÐÚÛàÞÞÞßßàààááááááááàâäåäãäåååååååååäääääããââãããàϯ’uW=,1Mt—µÏáèêêêêêêêêêêêêêêêêêêêëëìììììììììììêïéíêæݶ•pQ>+!/Q{¡»ÓàãççççèèéééêéééçßÑÇÃÀº³¯²¹À¨©«®®¯±³³²²²³±²²³´µ¶¶µµ´´µ¶¹º»ºº¹¹¸¸·¼¼»»»»»»¼»»»»»¼½»¼¼½¾¿ÀÁ¾¾¿ÀÀ¿¾¾ÀÀÀÀÀÀÀÀÀ¿¿¾½¼»ºº¼»¸¸¹¶°¦–~fP;&!2Jcz¥²·¹¼½¾¾¿À¿¾½½½½¾¿Â¿¿¿¾¾¾¾½¾¾¾½¾¾¾¾¾¾¾¾½¼¼»¼¼¼¼¼¼¼¼¶ª”zbM5# ,C]yŽ§ºÉËËÑÔÒÔÓÓÓÒÒÑÑÕÕÔÓÒÒÒÒÑÒÓÒÑÒÕ×ÖÖÖÖÖÕÔÓ×ÖÕÕÕÕÖ×ÔÕÕÖØÙÙÚÕʳ˜}cG12Rl‹¦»ÒÛÝãàààááâââããããããããàâääãâãäååååååååæååäääääãääåáѱ•wY?-0Kr”³Îàèêêêêêêêêêêêêêêêêêêêëëìììììììììììêïêíêçà»™sS@,! .OyŸ¹ÒàãççççèèéééèèèéèãÛÔÑ˺·ºÁǬ¬®¯¯¯¯¯±³³²²²³²²²³´´µµ´´µµ¶¸¹ººº¹¹¹¹¸¸¹¹¹¹¸¸¸¸¼¼»»¼¼½¾¼¼¼½¾¾¿¿ÀÀÁÁÁÁÀÀÂÂÂÂÂÂÂÂÀÀ¿¾¾½½¼»½¼¹¹º·±¨˜€gP;&!2Jd{‘¦³¹º¼½¾¿¿¿¿¾¾½½¾¾¿ÁÁÁÁÁÁÁÁ¿¿¿¿¿¿¿¿¿¿¿¾¿¿ÀÁ¿¿¾¾¾¾¾¾½½¾¿¿¾½½¸¬•{cN6# ,C]yŽ¨»ÊÌÌÒÕÓÔÔÔÔÔÔÔÔÖÕÔÓÓÓÔÔÔÔÕÔÓÕØÛØØØØ×ÖÕÔØØ××××ØØÖ×ØØÙÚÛÛ×̶š€eH22Rm‹¦¼ÓÝßåâââããäääääääääääàâääãããäååååååååçæåäääååäååæãÒ³—yZ@..Jo’±ÌßèêêêêêêêêëëëëëëëëêêêëëìììììììììììêðêíêèãÀœvVB-" -Mw¸ÑßâççççèèéééçççééçãßÜÖÍÅÂÅÊή®®®®¯¯¯±³³²²²³³³³³³³³´³´¶¸¹ººº¸¸¹¹¹¹ºº¹¸¸¸··¶¶¼¼¼¼¼½¾¿¾¾¾¾¾¾¾¾ÁÁÂÂÂÂÁÁÃÃÃÃÃÃÃÃÁÁÁÀÀÀÀÀ½¿¾»»¼¹³ªš€gP;&!1Jd{‘¦´½½½¿ÀÀÀ¿ÀÀ¿¿¿¿ÀÀÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÀ¿¿¿ÁÂÃÀÀÀÀÀÀÁÁ¿ÀÁÂÂÁÀ¿¹—|dN7$ ,C]yŽ©¼ËÍÍÓÖÔÔÕÕÖ××ØØ×ÖÕÕÕÖ×ØÙÙØÖÕÖÙÛÙÙÚÚÚÙØØÙÙØØØØÙÙÙÙÙÚÛÛÜÜÚкžƒhK51Qm‹§½ÔßàçãäääååååååååååååáäææåäåæææææææææèçæåäååæåææçäÔ´˜z\A/-Hn¯ËßçêêêêêêêêëëëëëëëëêêêëëìììììììììììêðëíêèåÞxXC.# ,Kuœ·ÑßâççççèèéééééééêéçåãßØÓÑÑÒÓ®«ªª«¬¯±³³²²²³´³³³³³²²³´·¹»»ºº·¸¸¹¹ºº»ººº¹¹¸¸¸¼¼¼¼½¾¿¿À¿¿¿¿¿¾¾ÁÂÂÃÃÂÂÁÄÄÄÄÄÄÄÄÂÂÂÂÂÃÃÿÁÀ½½¾»µ«›gP;&!1Kd{’§´À¿¿ÀÂÂÀ¿ÂÁÁÀÀÁÁÂÃÃÃÃÃÃÃÃÃÃÃÃÃÃÄÄÁÁÀ¿ÀÁÃÄÁÁÁÁÂÃÄÅÂÃÄÅÅÄù®—|eO7$ ,C]yŽ©¼ËÍÎÓÖÔÕÖÖØÙÚÛÛØ××Ö×ØÚÛÝÝÛØÖÖØÛÙÙÛÜÜÝÜÜÚÙÙØØÙÙÚÚÚÛÛÛÜÜÜÝÒ½¡†kM71Qm‹§½ÕßáèääåååæææååååååååãåçèæææèççççççççéèæåäåæçåæçèåÕµ™{\B/,Hm¯ÊÞçêêêêêêêêëëëëëëëëêêêëëìììììììììììêðëíêéçÅŸyYD/# ,Jt›¶ÐÞâççççèèéééëëêêééèçæãàÞÜÚ×Ö©©ª«®¯¯±±±±±±±±±±²³³´µµ·¶µ´µ¶¸¹¸¸¸¹¹ººººººººººº»»»»»»»»»¾ÂÂÀ¿ÁÃÂÁÁÁÁÂÃÄÂÂÄÅÆÇÇÇÁÁÂÃÃÂÁÁÅÇÄÀÀÁ¾¸¨šƒjR;'#3Le|“©·¾¿ÀÀÁÁÀÀÃÄÄÃÁÁÃÅÅÆÆÇÇÈÈÈÃÃÄÅÆÆÆÅÃÃÃÃÃÂÂÂÃÄÆÇÇÆÄÃÁÁÂÃÄÄÄú¬–~gO7('D]w“ª»ÌÓÓÕÖÖÛÛÛÚÚÙØØÚÚÚÚÚÚÚÚÞÝÜÜÜÜÝÞÜÜÜÜÜÜÜÜÞÝÜÛÛÜÝÞÚÚÛÜÜÛÚÚÛÓ½žƒkM3#/NhŠ§»ÓàâåææææææææçççççççççççççççççççççççççççççççççäçèâÚ¿›`D0*EkŽÉÝæèéêëëëëêììììììììììììììììììììììììíñëïëçæȦ]G1%"'Js™¶ÒáãæçççèèééééêëììêéèãåæãÝØÖÖ©©ª«¬®¯¯®®¯°±²²²²³´µµ¶¶¶¶µ´µ¶·¸¸¸¸¹¹ººº»»»»»»»»»»»»»»»»¼¾ÁÂÀÀÁÃÁÁÂÂÃÃÃÃÃÃÅÆÆÆÆÆÅÅÆÆÆÆÅÅÅÆÅÂÁ¾·©š„kS<'$4Le}”ª¸¿¿ÀÁÂÂÁÁÄÅÅÄÃÃÄÆÇÇÇÇÇÈÈÈÅÅÆÇÈÈÇÇÃÃÃÄÄÄÄÄÃÄÆÇÇÆÄÃÂÂÃÄÅÅÄļ—gO7''D]w“«¼ÎÕÕ×ØØÙÚÜÝÝÛÙ×ÛÛÛÛÛÛÛÛßÞÞÝÝÞÞßßßßßßßßßßÞÞÝÝÞÞßÜÝÝÞÞÝÝÜÜÕ¿ …mO5#/NhŠ§»ÓáâåææææææææçççççççççççççççççççççççççççççççççäçèâÚÀœ€aE1)Dj¬ÉÝæèéêëëëëêìììììììììììììììììììììììììðêïëèçʧ€^H1%"'Jsš¶ÒáãçççèèèééééêëìëêèçãååáÜ×ÖÖ¨©ª«¬®¯««¬®°±²³³³´´µ¶¶·¶µµµµ¶·¸¸¸¸¹¹ººº¼¼¼¼¼¼¼¼»»»»»¼¼¼¼¿ÁÂÁÁÂÃÀÁÃÄÅÄÃÂÄÅÆÆÆÆÅÅÆÇÇÈÈÇÇÆÃÆÆÄÃþ·ª›„kS<($4Lf}•ª¹ÀÁÂÃÃÃÃÂÅÆÇÆÄÄÆÈÉÉÉÈÈÈÈÈÇÈÉÉÊÊÉÉÃÄÄÅÅÆÆÇÄÅÆÇÇÆÅÄÃÄÅÆÆÆÅÅ¿°™€hO6&'D]w“¾ÏÖ×ÙÚÚ×ÚÝààÞÛÙÞÞÞÞÞÞÞÞáààßßààáààààààààßààááààßÞßààààßÞß×Á¢‡oQ7$.MhŠ§»ÓáãæææææææææççççççççççççççççèèèèèèèèççççççççèäçèãÛž‚bF2'Ch‹«ÈÝæééêëëëëëììììììììììììììììììììììììëîéîëééÍ©‚_I2&"'Jsš·ÓâäèçèèèéééééêëëëêèçããâßÚÖÕÕ¨©©«¬®®¬¯°±²³³³³´´µµµµµµµ¶¶··¸¸¸¹¹ººº»»»»»»»»»»»¼¼¼¼½½¿ÀÁÂÂÂÂÀÂÄÆÆÅÃÂÆÆÆÇÆÆÅÄÄÅÅÆÆÅÅÄÃÆÇÅÅÅ¿·«…lT<($4Mf~–¬ºÂÃÄÅÅÅÅÄÆÇÈÆÅÅÇÈËËÊÊÉÈÈÈÉÉÊËËÊÊÉÄÅÅÆÇÈÉÊÆÆÇÈÈÇÆÆÆÆÇÈÈÇÇÆÁ²›‚iO6&'D]w“¾Ð×ØÚÛÛÚÜÞàáàÞÝààààààààããâááâããààààààààáâãääãâáààááááàààØ£ˆpR8$.Lg‰¦»ÓáãæççççççççèèèèèèèèèèèèèèèèééééééééèèèèèèèèèåèéäÝÄ¡„dH3 %@fˆ©ÇÝçéêëëììëëììììììììììììììììììììììììêíèîìêìЬ„aJ3&"'Jsš·ÔãåèèèèéééêêéêëëêéçæâàÞÚÖÓÒÒ¨¨©ª«®°°°±±±±²±±²²²³³³µµ¶¶····¸¸¸¹¹ººº¹¹¹¹¹¹¹¹»»»¼¼½½¾¿¿ÀÁÃÃÃÂÁÂÅÇÇÆÄÃÆÆÇÇÇÆÅÅÄÄÅÅÅÅÄÄÃÆÇÆÆÆÀ¹¬ž‡mT=($4Mg—»ÄÅÆÇÇÇÇÆÇÈÈÇÆÅÇÉÌÌÌËÊÊÉÉÊÊËËËÊÊÉÆÇÈÉÊËËÌÈÉÉÉÉÉÉÈÉÉÊÊÊÉÈÈôœƒjP7''D]w“¬½Ï×ØÚÛÛßßßßßáâãââââââââåääããääåâââââââââãåææåãâááââââááàؤˆpR9$-Kg‰¦»ÔáäçççççççççèèèèèèèèèèèèèèèèééééééééèèèèèèèèéåèéäÞǤ†fJ5!#>c†§ÅÜçéêëììììëììììììììììììììììììììììììêíçíìëíÒ¯‡dL4&"'Irš·ÓãåéèèéééêêêêêëëêèæåßÜ×ÓÐÏÎͧ¨©ª«¬®±±±±±±±±±±±±±±±±´µ¶····¶¸¸¸¹¹ººº¸¸¸¸¸¸¸¸»»¼¼½¾¾¾À¿¿ÁÄÄÃÂÃÄÅÆÇÆÅÅÅÆÇÇÇÇÇÆÆÇÇÈÈÇÇÆÄÇÇÆÆÆ»®ŸˆnU=)$5Nh€˜®½ÆÇÈÉÉÉÈÈÉÊÊÉÈÈÉËÌÌÌÌÌËËËËÌÌÌÌËÊÊÉÊÊËËÌÌÍÌÌËËËËÌÌËËÌÌÌËÊÉĵ„kQ8('D]w“¬¾Ð×ÙÛÜÝäâáßßáäåããããããããæååääååæææææææææäååææååäââãääãââáÙÃ¥‰qS:%,Jfˆ¦»Ôâäçèèèèèèèèééééééééééééééééêêêêêêêêééééééééêæèéåàɧ‰iL6"!<a„¥ÄÜçêêëìííììììììììììììììììììììììììììëîçíëëîÓ±‰fM5&"'Hq˜µÒâåèééééêêêëêêëëéçåäÛÖÐËÊÉÉȧ§¨ª«¬¯¯¯°±±²²²²²²²²²²´µ¶·¸·¶¶¸¸¸¹¹ººº¹¹¹¹¹¹¹¹»»¼¼½¾¿¿Á¿¿ÁÄÅÄÁÅÅÅÆÆÆÇÇÄÅÆÇÈÈÈÈÈÈÉÉÉÉÈÈÆÈÇÅÅÇý¯ ˆoV>)%5Nh™¯¾ÈÈÉÊÊÊÊÊÌÍÎÍËËÍÏÌÌÌÍÍÍÍÍÎÎÎÎÎÍÌËÌÌÌÌÌÍÍÍÎÎÎÍÍÎÎÎÍÍÍÍÍÌËÊĵ…lS:*'D]w“¿ÑÙÛÝßßåäããâããäääääääääæååääååæèèèèèèèèæååääååæäååææååäãÛƧŒsU<%+Jfˆ¦»ÔâäèèèèèèèèèééééééééééééééééëëëëëëëëééééééééêæéêæáË©ŠjM7# :_‚£ÃÛçêëììííìììììììììììììììììììììììììììîèíëëîÔ³‹gN5&!'Fo—´Ñáäçéééêêêëëêêëêéçåã×ÑÉÅÄÄÄ秨©«¬«¬®°±²³³³³³³³³³³´¶·¸·¶µ¸¸¸¹¹ººººººººººº»»¼½¾¾¿ÀÁ¿¿ÁÅÆÄÁÆÆÅÅÅÆÇÈÄÄÆÇÈÉÉÉÇÈÈÉÉÈÈÇÇÈÇÄÅÇÄ¿¯¡‰oV>)%5Ni™°¾ÈÉÊËËËËÊÏÐÐÏÎÎÏÑÌÌÌÍÍÎÎÏÐÐÐÐÐÏÎÍÎÎÎÍÍÍÍÍÐÐÏÏÏÏÐÐÎÎÎÎÎÍÌËĵ…mS;+'D]w“¯ÁÓÛÜßááäåææåäâáääääääääæååääååæææææææææçæäããäæçæçèèèèçæåÝÇ©ŽuW>%+Ieˆ¥»Ôâåèèèèèèèèèééééééééééééééééëëëëëëëëééééééééëæéêæâ̪‹kN8#9^£ÃÛçêëìííííìììììììììììììììììììììììììíïèíëëîÓµŒhO6'!'En–³ÐàãçéééêêëëëêêëêéçäãÔÎÆÁÀÁÁÀ¨¨©ªª«¬¬ª¬®±´²²²³³´´´¹¸¸¸·¶¶¶¸¸¹¹¹¸··¶¸º»»»½¿¾¾½½½¾¿¿ÀÀÀÀÀÀÀÀÅÅÅÆÆÇÇÇÇÈÈÉÉÈÈÇÇÈÈÆÅÅÇÊÇÊÊÈÈÉÅ¿± ˆnV?)#5Pi€˜¯ÀÊÊËËÌÍÎÎÐÍÎÑÒÏÏÒÎÎÎÏÏÏÐÐÑÑÑÒÒÒÓÓÓÒÒÑÑÒÒÓÒÑÐÐÐÐÑÒÐÎÍÍÎÎÍËŤ‰pX=((E_y•¯Ã×ßßßàáääääääääææææææææççççççççççççççççèèèèèèèèççççççççãßί‘vX@,+Ie„£½ØãäèèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëêêêêêêêêêêíêççÔ³’qR;%8\~¡ÄÛäèêììëëëìììììììììììììììììììììììììîêíîêíëݺ‘kQ7(##Ak“±ÏàãçéééêêëëëèììéèèæáÙÏÆÃÁÀÂƨ¨©©ª«¬¬«¬®°²²³³³´´´µ···¶¶¶µµ·¸¸¹¹¸··º»¼»¹¸¹»¾½½½¾¾¿¿ÀÀÀÀÀÀÀÀÅÅÅÆÆÆÇÇÇÈÈÉÉÈÈÇÈÉÉÈÆÆÉËÇÊÊÈÈÉÅ¿±¡ˆnW?)#5Pi€˜°ÀÌÌÌÍÎÏÏÐÒÏÏÓÓÑÑÔÐÐÐÑÑÑÒÒÑÒÒÒÓÓÓÔÒÒÑÑÑÑÒÒÒÒÑÑÑÑÒÒÔÒÐÏÏÎÌÊź¤ŠqX=((E_y•®Â×ßàáãäååååååååææææææææççççççççççççççççèèèèèèèèççççççççãàÏ°’wYA,*Ie„¢½ØãäèèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëêêêêêêêêêêíêççÕ´”sT='7Z| ÂÚäèêììëêëìììììììììììììììììììììììììîêíîéìëݺ‘lR8)##@j’±ÏßãçéééêêëëëêììèçèåàØÐÉÇÆÄÅɨ¨¨©ª««¬«¬¬®±±±±±²²³³¶µµµµ´´´··¸¸¸¸··º»¼»¹¸¹º½½½¾¾¿¿¿ÀÀÀÀÀÀÀÀÅÅÅÅÆÆÆÇÇÇÈÈÈÈÇÇÉÊÊÉÈÇÉËÈÊÊÈÉÊÆ¿²¡ˆoW?)#5Pi˜°ÁÍÎÎÏÐÑÑÒÓÑÑÔÕÒÒÖÒÒÒÓÓÓÔÔÓÓÓÓÔÔÕÕÔÔÓÒÒÓÔÔÔÓÓÒÒÓÓÔØÖÓÒÑÐÍËǼ¦‹rY>)'E_z–Â×áâäæçææææææææææææææææççççççççççççççççèèèèèèèèççççççççäáв”xZB-)Gdƒ¢¼Øãäèèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëêêêêêêêêêêíêçè׶–uW?)5Wz¿×ãèêììëêëìììììììììììììììììììììììììíéíîéìêܺ’mS9)##?i‘°Îßãçéééêêëëëëíëèèéåß×ÑÍÍÍÉÈʧ§¨©ªª««¬¬««¯®®®¯¯¯°°´´³³³³³³¶¶·¸¸¸¸··¹»»º»¼¾¼¼½¾¿¿¿¿ÁÁÁÁÁÁÁÁÄÄÅÅÅÆÆÆÆÇÈÈÈÈÇÆÈÉÊÉÈÇÉÊÈËËÉÉÊÆÀ²¢‰oW?)#5Pj™±ÁÎÎÏÐÐÑÒÒÔÑÑÕÕÒÓÖÓÓÓÔÔÔÕÕÔÔÕÕÕÖÖÖ××ÖÕÕÖ××ÖÕÕÔÔÕÕÖÚ×ÕÔÔÓÑÏɾ¨sZ?*'D^z–°ÄÙâãäçèççççççççççççççççèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèæãÓµ–{\C.(Fcƒ¡¼×ãäèèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëëëëëëëëëëêìêçéÙ¸˜wX@)1Swš»ÔâçéëìêêêìëëëëëëëëëëëëëëëëëëëëëëëëíéìíéìêÜ»“nU:*##=g¯ÎßãèéééêêëëëëìëéêëæßÖÑÎÏÍÈÅŧ§¨¨©ª«««¬¬«ªª¬®®®®¯¯°°°²²²²²³³³µµ¶·¸¸¸·¹»¼¼»»½¾º¼½¿ÀÀÀ¿ÁÁÁÁÁÁÁÁÄÄÄÅÅÅÆÆÆÆÇÈÈÇÆÆÆÇÉÈÇÆÇÈÉËËÉÉÊÆÀ´£ŠpW?)#5Pj‚š²ÂÎÎÏÐÐÑÒÒÓÐÑÔÔÒÒÕÓÓÔÔÔÕÕÕÖÖÖ×××ØØ×ÖÖÕÕÖÖ×Ø××ÖÖ××ØÙØÖÖ×ÖÕÓËÀªŽu\@+&C^z—³ÇÜäãäææççççççççççççççççèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèçåÕ·™}^D/'Db‚ »×ãäèèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëëëëëëëëëëêìêèëÛ»™xX@).Ot—·Ñâçéëëêéêëëëëëëëëëëëëëëëëëëëëëëëëëìèìíèëéܼ”pV;+##;fŽ®ÍßãèéééêêëëëêìëêììäÛÑËÇÆý¸¸¦§§¨©ªªª©ª«ª©ª¬®°°°°±±±²²²²²³³³³´´¶·¸¸¸·½¾¾¼º¸¹º¹»½¿ÀÀÀ¿ÂÂÂÂÂÂÂÂÃÄÄÄÅÅÅÅÆÆÇÇÇÇÆÆÅÇÉÈÇÆÆÇÉËËÉÊËÇÀ´¤ŠpX?)#5Pj‚›³ÃÎÏÏÐÑÒÒÓÓÑÑÔÕÒÒÖÔÔÕÕÕÖÖÖ××ØØÙÙÙÙÕÕÔÔÔÔÕÕÚÙÙØØÙÙÚÚØ××ØØ×Õͬv]A,%C^z˜´ÈÜäãäååççççççççèèèèèèèèééééééééééééééééèèèèèèèèééééééééèæ׺œ_F/&Ca »×ãäéèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëììììììììëêìêèìݽ›yZA)+Kq”³ÎáæèëëêéêëêêêêêêêêêêêêêêêêêêêêêêêêìèììèëéÛ½•qX=+$#9dÍßäèéééêêëëëêëëêêçÜÏļ¶´°ª§§¦¦§¨©©ªª§©ªª©ª¯®®®¯¯¯°°²²²²³³´´³´µ¶·¸¸¸»¼¼º·¶¶·¹º½ÀÁÁÀ¿ÂÂÂÂÂÂÂÂÃÃÄÄÄÅÅÅÅÆÆÇÇÆÆÅÅÇÊÊÈÇÇÈÉÌÌÊÊËÇÁµ¤‹qX?)"5Pkƒ›´ÄÐÑÑÒÓÔÔÔÕÒÒÖÖÔÔ×ÖÖ×××ØØØØÙÙÙÚÚÚÛ××ÖÕÕÖ××ÛÛÚÚÚÚÛÛÜÚØØØØÖÔÎÑw^B-%B^{˜²ÆÛããäæçææææææææèèèèèèèèééééééééééééééééèèèèèèèèéééééééééèÙ¼ž`G0%Ba€Ÿ»×ãäéèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëììììììììëêìêèíÞ¿|\C+ )Gn’°ÌàæèêëéééëêêêêêêêêêêêêêêêêêêêêêêêêìèëìèëéÛ½–rY>,$#8cŒ¬Ìßäèéééêêëëëëëêèçß¡š–•—¦¦§¨¨©ªª¦§©©©ª°ªªª«««¬¬²²²³³´´´³´µ¶·¸¸¸µ·¸·¶¶·¸¸º½ÀÁÁÀ¿ÂÂÂÂÂÂÂÂÃÃÃÄÄÅÅÅÅÆÆÇÇÆÆÅÆÉËËÊÈÈÉÉÌÌÊÊËÇÁµ¥‹qX?)"5Pkƒ›´ÄÒÒÓÔÕÕÖÖ×ÔÔ×ØÕÖÙØØÙÙÙÚÚÚÙÙÚÚÚÛÛÛÛÛÚÙÙÚÛÛÜÜÛÚÚÛÜÜÞÜÙØØ×ÔÒÏÄ®’x^C-%B^{˜¯ÄÙâãåèéææææææææèèèèèèèèééééééééééééééééèèèèèèèèééééééééêèÚ½Ÿ‚aG1%A`€Ÿº×ãäéèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëììììììììëêìêéíßÀ ~^E,!(Fm‘®ËàæèêêéééêêêêêêêêêêêêêêêêêêêêêêêêêìèëìèëéÛ¾–sY>,$#7b‹¬ÌßäèéééêêëëëëìêçãÙı¥›‘‹ˆŠŽ¦§©ªª©¨§¤¥§©ªªª©¨©«®®®±±²²²³³³°°°³µ·¶´··¸¸¹¹¹¹¹¹º»¼¼½½½½¾¿ÀÀÁÁÁÁÂÃÄÄÅÅÃÃÄÄÄÅÅÅÉÉÉÉÉÈÆÆÈÈÈÉÊÈÅÁ´¡‰rZ>'$5Pj‚›´ÅÏÏÐÑÓÕ×ØÖÔÔÖØÚÚØÓÕ×ÙÛÜÝÝÛÛÛÛÛÛÛÛÚÚÚÚÚÚÚÚßÞÝÝßßÞÝÜÝÝÝÜÚØÖÔÈ°“x_C.&A\z™¯ÄÚäæçéêåääääåæçééééééééêêêêêêêêçèèééèèçèèèèèèèèêêêêêêêêççÚ¿¡„cH.!$?[~ž·ÕåçéèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëììììììììêéíîêëßǦ_H. (Dh‹ªÉÞèæéîìçæìêêêêêêêêêêêêêêêêééééééééìèëìèêèÚ¿—tZ?-$6^‰ÌÜâìèéêëëëëêçêìêàÌ·¨–†€€~¥¦§¨©©¨§¥¦¨©ªª©¨©ª«®¬®¯¯°°±±²±°±²µµ´³µµµ¶¶¶··¸¹¹º»¼¼½º»»¼½¾¾¿ÁÁÁÂÃÄÄÅÃÃÃÄÄÄÅÅÆÇÇÇÇÆÆÅÆÆÆÈÈÇÃÀ´¡ˆrY>'$5Pj‚›´ÅÐÐÑÒÔÖ×ØÖÕÕÖØÙÙØÔÕ×ÙÛÛÜÜÜÜÜÜÜÜÜÜÛÛÛÛÛÛÛÛÞÝÛÜÞÞÝÜÛÜÝÝÝÜÛÚÔÈ°”y_D/%A[y˜ÂØâäæèéåååååæççééééééééééééééééçèèééèèçèèèèèèèèêêêêêêêêççÚ¿¢„cI/"#>Z}¶Ôåçéèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëëëëëëëëëêèííêëàǧ`H/ 'Cf‰©ÇÝçæèíìççëêêêêêêêêêêêêêêêêééééééééìèëìçêèÚ¿˜t[?-$5^ˆ¬ÌÜãëèéêëëëëêíîïêÜƯŸ‘Š‚}}~}|¢£¥¦¨¨¨¨§§¨©©©¨§ª«¬¬¬¬«««¬®¯°°²±±²³´²°²²²²³³´´·¸¸¹º»»»ººº»¼½½¾ÀÀÁÁÂÃÄÄÂÂÃÃÃÄÄÄÃÄÅÅÆÅÅÄÅÄÅÆÇÅÁ¾³ ˆqY>'$5Pj‚›´ÅÑÑÒÔÕ×ØØØÖÕÖØÙØÖÖ×ØÙÚÛÛÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÝÜÛÛÝÞÜÛÛÜÝÞÞÞÝÝÔȱ”y`D/$@Zx—«À×áãäæçæææåæçèèééééééééèèèèèèèèçèèééèèçèèèèèèèèêêêêêêêêççÚ¿¢…dI/""<Y|›µÒäçéèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëêêêêêêêêêèííéëàȨƒbJ0!&Ad†¦ÅÛååèìëççêêêêêêêêêêêêêêêêêééééééééëçëìçêèÛÀ™u[@-%4\‡«ÌÝãëééêëëëëëïïîèÙ뛉‚€¡¢£¥¦§¨¨¨¨¨¨¨¨§§«¬¬¬«««ªªª«¬®¯¯²±°±²²¯°°°±±²²²¶¶··¸¹ºº»»¼¼½¾¿¿¿¿¿ÀÁÂÂÃÁÂÂÂÃÃÃÃÂÂÃÄÅÅÅÅÅÄÅÆÇÅÁ¾²Ÿ‡qY>'$5Pj‚›´ÅÑÒÓÕÖ×ØØÙ×ÖÖØØ×Õ××ØÚÚÚÚÚÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÞÝÜÜÞÞÝÜÝÞÞÞÞÞÞÞÕɲ•z`E0#?Yv•«À×áâäæçççææççèéèèèèèèèèèèèèèèèèçèèééèèçèèèèèèèèééééééééççÚÀ¢…dJ0#!;Wy™²Ñãçêèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëêêêêêêêêêèììéëáɪ…dL2!%?aƒ£Â×ãåèêéçèéééééééééééééééééèèèèèèèèêæêëçêèÛÁšv\@.%3Z„ªÌÞãëéêëëììëëêëëæÚƱ£—‘‹‰‹Œ‹¡¢¢¤¥§¨©©©¨¨¨¨¨¨¬«««ªªª«««¬®®¯¯²°¯°±°®¬°°°±±±²²´´µ¶··¸¸¹ºº»¼½½¾½¾¾¿ÀÁÁÁÁÁÁÁÂÂÂÃÂÂÃÅÅÅÅÅÅÅÅÆÇÆ¿±ž†pY>'$5Pj‚›´ÅÑÒÔÖ××××Ù×ÖÖØØ×Õ××ØÚÚÚÚÚÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝÝàßÞÞààßÞáàßÞÞÝÝÜÖʳ–{aF1 "=Wu“¬Á×áãäççççææççèéèèèèèèèèêêêêêêêêçèèééèèçèèèèèèèèééééééééççÚÀ£†eK1$8Uw–°ÏâæêèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëììììììììêèìëèëâÊ«†fN3"#<^Ÿ¾ÔáåèèçèèèééééééééééééééééèèèèèèèèéåéêçêéÛÛw]A.%2X‚¨ÌÞãêéêëììììëéééæÝν²¥ ›šœžž££££¥¦¨©©¨§§§¨©©«ªª©ªª«¬®®®®°¯®¯°¯«¯¯°°±±±±³³³´µ¶¶·¶¶·¸¹¹ºº¼¼½¾¿¿ÀÀÀÀÀÁÁÁÂÂÂÃÃÄÄÄÄÃÅÅÅÆÇž°ž†pX>'$5Pj‚›´ÅÐÒÔÖ×ÖÖÕØÖÕÖØÙØÖÖ×ØÙÚÛÛÛÜÜÜÜÜÜÜÜÝÝÝÝÝÝÝÝáàÞßááàßâáàÞÝÜÜÜ×˳—|bF2 !<Vs’«Á×áãäæçæææåæçèèççççççççêêêêêêêêçèèééèèçèèèèèèèèèèèèèèèèççÚÀ£‡fL2%7Su”®Íàæêèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëììììììììêèëëèëâ̈hP5#":[|›»ÑßäèææèéçèèèèèèèèèèèèèèèèççççççççèäèêæêéÛÄœx^B/&1W€§Ìßäêêêëìííììííëéâ×˸´¯¯±³³±¦¥¤¤¥¦§¨¨§¦¦§¨ª«ª©©¨©«¬®®¬¬¬®¯¯«®®¯¯¯°°°±²²³´µµ¶µµ¶·¸¸¹¹»¼¼½¾¿¿¿¿¿ÀÀÀÁÁÁÁÂÂÃÂÂÁÀÃÃÃÅÅÄÀ½°…oX='$5Pj‚›´ÅÏÑÓÕÖÖÔÓÖÕÕÖØÙÙØÔÕ×ÙÛÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜàßÞÞàáßÞàßÞÜÜÜÝÝ×Ë´—|cG2 ;Urª¿ÕßáãåæåååååæççççççççççééééééééçèèééèèçèèèèèèèèèèèèèèèèççÚÀ¤‡gM3%5Qs’¬ËßåêèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëëëëëëëëëêèëêçëãÌ®ŠiQ6$ 8Xy™¸ÎÝäçååèéæèèèèèèèèèèèèèèèèççççççççèäèêæêéÛÅy_B/&0U~¥ÌàäéêëììííììðïíìèâÚÕÎÊÅÅÈÊÉǧ¦¥¤¥¦§¨§¦¦¦§©«¬©¨¨¨©«®®®¬¬«ªª¬¬¯¯«®®¯¯¯±±²²³´µµ··¸¹¹º»»»»¼¼½¾¿¿¿¿¿ÀÀÀÁÁÁÁÁÁÀ¿¾½ÂÁÂÃľ»¯…oX='$5Pj‚›´ÅÏÐÓÕÖÕÓÒÖÔÔÖØÚÚØÓÕ×ÙÛÜÝÝÛÛÛÛÛÛÛÛÜÜÜÜÜÜÜÜßÞÝÝßßÞÝÞÝÜÛÛÝÞßØÌ´—}cG3! ;Tq¨½ÔÞßáãäåääääåæçççççççççèèèèèèèèçèèééèèçèèèèèèèèèèèèèèèèççÛÁ¤ˆgM3&4Pr‘«ÊßåêèèèééêêêêêêêêêêêëëëëëëëëëëëëëëëëêêêêêêêêêçêêçëãͯŠjR7$ 7Wx—·ÍÜäçääèéæèèèèèèèèèèèèèèèèçççççççççäèéæêéÛÆžy_C/&0T}¥ÌàäéêëìííííìðîíííêæãÞÚÖÕØÚØÖ£¤¥¦§¨¨¨©©©©©©©©¨¨¨©©ªªª«««¬¬¬¬««¬¬®®®®®¬«®¯±²³´¶·¶µ´¶º½¹»¹·»ÁÀ¹¿¾¾½½¾¾¿½¾¿ÀÀÀÀ¿ÁÀÀÁÂÁ¾¼ž†nW?)#4Ng˜²ÄÍÐÓÕÕÔÕÖÓÔÕÖ×ØØÙÕØÛÝÝÛ×ÕÚÙÙÙÙÚÛÜÞÝÜÝßààÞÞßàááßÞÝÝÝÝÜÜÛÛÛÖ˵™~cF0 9Ro¤ºÒÞáâããåååååååååååææççççèèééèèçèèèèèèèèççççççççææææææææåæÚ¿¡…fN8 3Pn‘ÅÛççèèèèèèèèééééééééêêêêêêêêëëëëëëëëêêêêêêêêìêíëæêäϳkR6#3Vx”±ÈÜäéçåæçæççççççççççççççççééééééééæééèèêæàÆŸ{aD0&.O~©ËáèæêëìíííììððïîìêèæåãáááàÞÜ¡¢£¤¥¦¦¦§§§§§§§§¨¨¨©©ªªª«««¬¬¬««ªª««¬¬««¬®¯°²³³¶¶¶µ´¶¹¼¸»º¸º¿¿º¿¾½½½½¾¿½¾¿¿ÀÀ¿¿ÂÁÀÁÂÀ½ºž†nW?)#4Ng~˜±ÃÌÏÓÔÔÓÔÕÓÓÔÔÕÖÖ×ÖØÚÜÛÚ×ÖÚÚÙÙÚÚÛÜÞÝÛÜÝÝÜÛÜÝÞßßÞÝÜÞÞÞÝÝÜÜÜ×̵šdG1 9RnŒ¤ºÓÞáâäääääååååååååæææçççèèééèèçèèèèèèèèççççççççææææææææåçÛÀ£†gO8 3Om‘¬ÄÚæçèèèèèèèèééééééééêêêêêêêêëëëëëëëëêêêêêêêêëéíëæêäϳkR6$2Uw“°ÇÝåêéçèéèççççççççççççççççèèèèèèèèåèèççéåßË£~cE/$!3R©Êáééëìíîîîîîïïïîìêéèçåããããáߢ£¤¥¦¦¦¦§§§§§§§§¨¨©©©©ªª««««¬¬¬¬¬««««¬¬¬¬¬««««¬®¯°±²²µµ¶µ´µ¸»¶º»¹¹¼½¼¾¾½¼¼½¾¾½½¾¿ÀÀ¿¿ÃÁÁÁÁ¿¼¹†nW?)#4Mf}–°ÁËÎÑÓÒÒÓÔÓÓÓÔÔÔÔÔ××ØÙÙØØ×ÚÚÙÙÚÛÛÜÞÜÚÚÛÛÙ×ÙÚÛÜÝÝÝÜÞÞÞÞÝÝÝÜ×̶š€eH3 8Qm‹¤ºÓÞáâääãããääååæååååæææçççèèèèççèèèèèèèèççççççççççççççççæèÝÂ¥ˆiP9!2NkªÂÙæçèèèèèèèèééééééééêêêêêêêêëëëëëëëëêêêêêêêêêéìëæêäϳŽlS7%1St‘®ÆÛãéèæçèæççççççççççççççççççççççççåèèæçéåßÍ¥€dF0% "4S§ÇÝçéííîïððïïîïïîíìêêêèæåæåãᦦ§¨©©©¨©©©ªªª««©©©©©©©©«««««««¬®¬¬®¬««ªªª««¬¬®¯°°±³´µµ´µ·ºµ¹»º¸¸»½½½¼¼¼¼½½¼½¾¿¿¿¿¾ÃÁÀÀÀ¾º·¬†nW@*#4Me|•®¿ÉÌÏÑÐÐÑÒÔÔÔÓÓÓÓÓÖÖÖÖÖ××ØÚÙÙÙÙÚÛÜÜÚÙÙÛÛÚØØÙÚÛÜÝÝÝÝÝÝÜÜÜÛÛ×Í·›fI4 7PlŠ£ºÒÞàâããâââãääååääåååææææçèèèèçæççççççççççççççççççççççççæèÞħŠkR9!1Lj¨ÀØåçèèèèèèèèééééééééééééééééêêêêêêêêééééééééêèëêæêäϳŽmU8&/QrÄÖßæåãäåãççççççççççççççççççççççççæééçèéæßË£dG2' !!#&);[‡®Ìàéêííîïïïïïîïïïîíìëëéçæçæä⧨¨©©©©¨©©ªª«««¬©©©©©©©©«««««««ª¬¬«ªª«¬¬¬«ªªª«¬¬¬¬®¯¯¯²³µ´´´¶¸µ·ºº¸·¹½¼¼»»»»¼¼¼½¾¾¿¿¾¾ÂÁÀ¿¿½¹¶¬œ…mW@*"3Ld{“¬¼ÇÊÍÏÎÎÏÐÔÓÓÓÓÓÓÒÕÕÔÔÔÖ×ØØØØØØÙÚÚÙØ×ÙÛÝÝÛÙÙÙÚÛÜÝÞÛÛÚÚÚÙÙÙ×̶›fJ4 6Okˆ¢¹ÑÝßáââááââããäääääåååææææçèèçææççççççççççççççççççççççççæèßƨ‹lS:"0Kh‹¦¾ÖäæèèèèèèèèééééééééééééééééêêêêêêêêéééééééééçëéæêäгnV:'/Pq¬ÄÕÞååäåäâççççççççççççççççééééééééçêêèéêçàË£dG2' !"#$%'((+-02369<Mnš¾×çííììíîïîîîïïððïîíìêèæææåä⦧§¨¨¨§¦§§§¨©ªªªªª©©©©¨¨««««ªªªª©¨¨§§¨¨©¬¬ªªª«®¬¬¬®®®°²´´´´µ·¶µ¶¹¹·¸¼¼»ºººº»¼¼¼½¾¾¾¾¾À¿¾¾¾½¹¶«œ…mW@+"3Kcy‘©ºÅÈËÍÍÌÍÎÑÑÑÑÑÒÒÒÓÓÓÓÔÕÖ×ÖÖÖÖÖ×ØÙ×ÖÖØÛÝÝÜÚÙÙÙÚÛÜÝÚÙÙÙØØØØÖ˵š€fJ4 6Mi‡ ·ÏÛÝßààââââââââãäääååååææççççææææææææææççççççççææææææææåèßÆ©ŒlS:"/If‰£¼ÕãæèèèèèèèèééééééééèèèèèèèèééééééééèèèèèèèèèæêéåêäгoW;(/Pp«ÄÖàèèçèçåççççççççççççççççééééééééæééèèêæàÍ¥fH4) "$&'(./1368:;CEHKMPUXf„¬ÊÜçêêììíîîîîîñññððîíìêèæåæåã᧧¨¨¨¨§§¦§§¨©ª««ªªª©©¨¨¨«««ªª©©©ª©¨¨¨¨©ª¬«ª«¬®°«¬¬¬¬¯²´´³³µ¶¸³³¸º¸·º»»º¹¹º»»»¼½¾¾¾¾½¾½½¾¾½º·«œ…mWA+"3Kbx¨¸ÄÇÊËËËËÌÍÍÍÎÏÏÐÐÑÑÒÓÔÕÕÕÕÔÔÔÔÕÖ×ÖÕÕÖÙÛÚÙÚÙØ××ØÙÚÚÚÚÙÙØØØÔÊ´™eI4 5Mh†ŸµÍÙÜÝÞÞããââáààßããäääååååææççææåææææææææççççççççååååååååäçÞÆ©ŒlR;".He‡¢»ÔâåèèèèèèèèééééééééèèèèèèèèééééééééèèèèèèèèçæééåêäдpX<(/Pp¬ÄÖàèéèéèæççççççççççççççççèèèèèèèèäççåæèäÞÉ¢€gM;2*""$&(+./3469<?ABHJMPTXZ\dgjmpty}‡¡ÁÖàçééííîïððïïóóòñðîìëêèææææä⪪«««ªª©©©ª«¬®ªªª©©¨¨¨«««ªª©©©¬¬««¬¬®«ª«¯±««¬¬¬¬¬¯±³´³³´µ¹²±·»¹·¹»ºº¹¹ºº»»¼½¾¾¾¾½½¼¼½¾½º¸«œ…mWA+"3Kbx§·ÃÆÉËÊÊËËÉÉÊËÌÍÎÎÏÐÒÓÔÕÕÔÔÓÓÓÓÔÕÖÖÕÔÕ×Ø×ÕÙØ×ÕÕÖ×ØÛÛÛÚÚÙÙÙÓɳ˜eI3 5Lh†´ÌØÚÜÝÝäããâàßÞÞãããääååååææççææåææææææææççççççççääääääääãæÞÆ©ŒkR;".Hd†¡ºÓâåèèèèèèèèééééééééèèèèèèèèééééééééèèèèèèèèçåéèåéäдpY=)/Pp¬ÄÔÞæèççæäççççççççççççççççççççççççâååãäæâÜÁœ}hRC=6569<AEILQRTX[_acgilpuy|~„‡ŠŽ‘•šž¦¼Öäéíðñîïðññññðôôóòðîìëëéççççåã©«ª¨¨¨ªªª««¬¬¬««««««««¬¬¬¬«ª©©««««««««®¬¬®®¬¬®°²³µµ´³²³´µ¶·¸¸·¸¸¸¹¹ººº½½½¼¼¼¼¼¹¼½»½¿»µª›†oYA*"1H`wŽ¥´¾ÄÈÈÉËÈÃÃÇÉÉÇÇÊÍÍÎÎÏÐÑÑÑÑÑÒÒÓÓÓÓÑÑÒÕ×ØÖÔÓÔÔÔÔÔÕÕÙØ×ØÙÚÙ×Ðdz™€gJ5 /Ik…Ÿ³ÉÕÚÞààÞßàáâãããäãáààáãäååååååååååååååååâãäååååäåääããääåâäÛĪnT=&&Adƒ›¹ÐÞèæææççèèèèèéééêêêéééèèçççëêéèçææåççççççççéçéèäèãϵpW<) *Km‹¬Æ×áééæèééçççççæææêéèçæåäãçæääåäáÞÝÚ××ØÖÎȪ“yjaYUWSVZ]_bfimosvx{~‰‹’“–šœ§©¬°´¸»½ËÔßæéëïóïïïððñññòòòðïíëêìêççèèç檬®®¬ªª«ªªª««¬¬¬««««««««««¬¬¬«ªª««««««««®¬¬®¯¯®®®®¯¯°°±²²²²²³´µ¶········¸¸¹¹¹¹¹ººººº¹¼¼»¼¾»µª›†oYA*!0G_vŽ¥´¾ÃÆÅÆÈÆÂÄÆÈÈÇÈÉËËËËÌÍÎÎÏÏÏÏÏÐÐÑÑÐÐÐÒÔÕÔÒÓÓÓÔÔÔÕÕÖÔÓÓÕÕÔÒÐƲ™€fJ5 /Hj„±ÈÔÙÝßßÞßàáââââãâàßßàâãååååååååååååååååââãäååäääääããäääâäÛĪnT=&&@c‚›¹ÐÝçæææçççèèèèèéééêêééèèèçççéèèççææåääääääääçåèçãèâϵoW:&)KmŒ¬ÆÓÝååäååäåääãâáààÞÞÝÛÙØÖÖÑÏÍÍÍËÈÅÃÀ½¼½º´˜ˆysqnnposw{~‚†ŠŠ‘”—šž¡¦ª®³¶»¿ÃÉÊÌÎÑÔÖ×Ùàçêêéìïïïðððñññóóòòðîìêëèæåæåä⪬®¯¬®ªªª««««¬ªªªªªªªªª««¬¬¬¬«««««««««®¬¬®±±°¯¯°±±°¯¯¯¯°±²²³´¶¶··¶µµ¶¶·····¸¸¹¹ºº»¹»¼»¼½º´©›…oYA*!0F^u¤³¾ÂÃÂÂÆÅÂÆÅÅÆÈÉÉÈÇÇÈÉÊÊËËËËÌÌÌÍÍÍÏÎÍÍÐÑÑÑÒÒÒÓÓÔÔÔÔÓÑÑÒÒÑÏÏű˜fJ5 .Giƒœ°ÆÓ×ÛÝÝßßàááààßáàßÞÞßàáããããããããääääääääáâããääããããããããããâäÚÄ©ŽnT=&&=b‚š¹ÏÛåææææçççèççèèèééééèèèççççççççææææææææææææèæéèåêåѵpX;',LmŠ¨¾ÌÖÞÞÝÝÝÛÙØÖÔÑÏÎÍÌËÊÇÅÃÁÀ·µ³²±¯«¨§¤¡ —‘{y~„ˆŠŽ’—›Ÿ£¨¬¬¯³¶¹¼ÀÃÊÍÒÕØÜáäâãäåæççèæêîîìêìïïðððññññóôôóòïíëëéæåäãàÞª¬®®®°««««««¬¬ªªªªªªªª©ª«¬¬¬¬¬¬¬¬¬®¬¬®±°°¯¯°°±°°®®®°±²²²´µ¶¶¶¶µ¶¶¶···¸¸¸¹º»¼½½¸»¼º»¼¹³©›…oYB+.E]tŒ£²¿Â¿ÀÄÅÃÇÄÂÄÇÉÇÅÅÅÆÇÈÈÉÉÉÉÊÊÊËËËÏÍËËÍÏÐÏÐÐÐÑÒÒÓÓÖÔÒÒÓÓÑÏÎÄ°—fJ4 -Fg›¯ÆÒ×ÚÝÝÞßßàßßÞÝààßÞÞßààââââââââããããããããààáâããââââããããââáãÚéŽnS=&%<`€™¸ÎÙãååæææçççæçççèèèèèèèçççææææççççççæææææææææåèçäéäе‘rZ>* "&7Rn†®»ÃÉÉÈÉÇÄÁÀ¾º·´±°°¯ª§¤¢¡›™—–“ŒŒŠ‡…„|xory…‘š¡¥°´¸»¾ÂÅÉÌÏÑÒÕØÚàâäååæèêèéééêêêëëíïïîîñôðððñññòòôõõõóðîìíëçäâàÜÚª¬¬¬®°¬¬¬¬««««««««ª«¬¬¬¬¬¬¬¬¬®¬¬®¯¯®®¯¯±°¯®¯°²³±±³´µµµµ¶···¸¸¸¹··¸¹º»¼¼¸»»¹º»·±¨š…oYB+-D\s‹¢±À¿ÀÄÆÄÆÃÁÃÆÈÆÃÄÅÅÆÇÈÈÉÈÉÉÉÊÊÊËÏÌÊÊÌÎÎÎÍÍÎÎÏÐÑÑÔÓÑÑÒÒÑÏÌï–~eI4 ,Eeš®ÅÑÖÚÜÜÝÞÞÞÞÝÝÜßßßßßßßßààààààààááááááááßßàáááááàáâããâáàáãÚémS=&%;_~—µÌØâåååæææççææææçççèèèçççæææççççèèèèääääääääåãæåâæâζ’s[=(!"#$((()+.0238G\qƒ“ž£©«ª«©¥§¦£Ÿ›˜•“Š†ƒ€|zxvqnmligec`]ak{Œ¸¾ÍÐÒÔÕ×ÚÜáãååååçéèêëêèçèêëëìííîïïíîïïïðóõððñññòòòôõööôñîëìèãÞÛØÔÒ¬®«¬®°¯¯¯®®®®«¬®¬®¬¬®¬¬¬¬°¯¯¯°°±²°±²³´´´´····¸¸¹¹µµ¶¶·¸¸¸¸º»¹¹º¶°§š„oYB, ,C[rŠ ¯¿ÁÁ¿ÀÄÅÃÄÃÂÃÄÄÄÂÄÄÅÅÆÇÈÈÈÈÈÉÉÉÊÊÌËÉÉËÌËÊÉÉÊËÍÎÎÏÏÎÍÍÏÐÏÍËÁ®•}eI4 +Cd}˜¬ÃÏÔØÚÚÛÜÜÝÝÝÜÜÝÝÝÝÝÝÝÝßßßßßßßßààààààààÝÞßààààßßàâããâàßàâÙ¨mS=&%;^|”²Ê×âäåååææææåååæææççççççæææåççççææææææææææææéçêèäèãÏ´qZ=( !#$&'(-./13466=>?ADGIJLR]kxƒŠ‘””‘ŽŠ‹‰‡ƒ€|zxvuspmjhgfca_^[WTPONLJHGFPc}•¬ÁÑ×âäææåæèéëìííëêëíìíïïííïðîîïððñòòññððïððñññññòòòóóôööõñíëèâÚÓÎËÉǯ°°®¬¬®°±±±°°¯¯¯®®®®®®®®®®®¬«®¬¬®¬¬¬¬®¯¯¯¯¯¯°±³³´´´µµ¶¶····¶¶¶¶¶¶¶·¸ºº¸¸¹µ¯§™„nYB, +BZq‰ ¯¼¿À¾¿ÂÃÀÂÃÄÃÂÁÂÃÂÃÃÄÅÅÆÆÆÆÇÇÈÈÈÈÉÈÇÈÉÊÈÆÆÆÇÉÊËÌÍËÊÉËÍÎÎÌÊÁ•}dI4 *Bb|•©ÀÌÑÔÖÖÙÚÛÜÜÝÜÜÚÚÚÛÛÚÚÚÝÝÝÝÝÝÝÝßßßßßßßßÜÝÞßßßßßÞßáââáßÞàâÙ¨mR=&$;]z‘¯È×ãääåååæææääåååæææçççæææååæååääããâääääääääåâåâÝáÛÇ«‰nZB0( !#$%&)*+-/13389:=?ACDIJLNPRSTZ[^aegiinrx|€}|}ztrsrnjigda^\[YXVTQOMLIGEDB@<977643112@\ž¹ÑáæçéëêééëìêìíìëêëìíîððððòôðððñññññòòññññðïñññòòòóóòóõöôñìéæÞÓÊÅÂÁÀ²²²°¯±³²²²±°°°¯¯¯¯¯¯¯¯®®®®®¬««®¬¬®®¬¬®ª«®¯®¬¯°±²³³³³´´´µµ¶¶¶¹¹¸¸¸¸¸·¸ºº¸¸¹µ®§™„nYC, +BYpˆŸ®¹½¿½¾ÁÁ½ÀÃÅÃÀ¿ÁÄÁÁÂÂÃÄÅÅÅÅÅÆÆÆÇÇÆÅÅÇÈÈÅÂÄÅÆÇÈÊËËÊÉÉËÍÏÏÎÉÀ”|dI4 *Bb{’¦½ÉÎÒÔÔ×ØÚÛÜÝÝÝ××ØØØØ××ÝÝÝÝÝÝÝÝßßßßßßßßÜÝÞÞßßÞÞÝßáââáßÝàâÙ¨lR=&$<]yÇ×ãäääååæææäääåååææçççææåååääãâáààßÚÚÚÚÚÚÚÚ×ÔÖÓÎÑË·¢ƒk]I<824568:<>?FGIKNPRSUVY[^acdfgikmpqrvx|€ƒ…†‡ˆ‹Œ‰„}unfe`YVXWSQPNLIGFE>=;964321/-,+)%"$$$" !"6W€¢¿×åééêììëëíîëíîîííîðìíïîííîðôôóóòòññðððòôôóòñññòòóóóñóõöôðìéçÞÒÇÁ¿¾¾²²±±±°°°µµµ´³²°¯¯°°°°°°°¯¯¯¯¯¯¯¯¬¬¬®ª¨§©¬®¯¯®±°¯®®®®¯±±±°¯²³°±·¸´²²²²³´µ¶º¹·¶¶·¸¹¸·¶¶·¶´²¤˜†qY@) )@WoˆŸ¯´º¾¼¼¾¿½¿ÀÀÁÁÀÀ¿ÁÁÀÀÀÁÂÃÂÃÅÆÇÆÅÄÂÃÃÃÄÅÅÅÇÇÆÆÆÇÈÈÅÆÆÇÈÉÊËÆ¿”{bH5! +Dd|¦¾ÉÌÎÓÕÔÕÖ×ØÚÛÛÕÖØÚÛÚÙÙÝÜÜÜÜÝÞÞßßßàààààÜÜÜÜÜÜÝÝããââááààäâØĪnW<*"<Wy”¬ÄÕÛèçäâááâãåäãâááááäâàßßÞÛÙ×ÕÓÒÒÑÏÍÍÌËÈÆÄÂÁ½À¿º¹¹±¦Œ€pc\VPLOOPRUXZ\]^`cfhjkopsvy|~‚„‡‰ŠŒ‘‘“–šž ¢£¥§¤šŒ}l_XNECB?=>98631/..*)('%$#"3Q|£ÃÛæéêîîëìïïíîîîîîîîîïïïïïïïïññññññññññññññññòòòóóôôôöõõõôðêæáÙÎÆ¿¼º³²²²±±±°´´´´³²±°°°°°°°°±¯¯¯¯¯¯¯¯¬¬®®¬ªª«¯°°¯¯®®®¬¬¬¬¬¬®²³°±¶·³³³³³´µ···¶µ´´µ¶¶·¶µµµ´²°¦›ˆrZA) +AXo‡ž®µ»¾½¼¿À¾ÁÁÁÁÁÁÁÁ¿¾¾¾¾¿ÀÁÃÄÆÇÈÇÆÅÄÄÅÅÆÆÆÇÉÈÇÆÆÅÆÆÇÇÈÈÉÊÊËÇ¿“zaG3 *B_vŒ¢»ÇÊÍÒÔÒÒÓÔÖ×ØØÔÕÖ×ØØ×ÖØØØØÙÚÛÜÜÜÜÜÜÜÜÜÝÝÝÝÝÝÝÝÛÛÜÝÝÞßßßÞÖênW<+%=Wx’¨¾ÏÖØ×ÖÔÓÒÒÒÒÒÐÏÎÎÎÏÎÌÊÉÉÈÅþ¼º¸¸·µ³¯®¬«©¨¨¤§¥¡ Ÿ˜Žxoihihgklnqtvxyz{}‚…‡ˆŠ‹Ž‘•™›ž ¤¦¨ª®±±³µ¹¼¾¿À¾¾¶¥xbQB8/-,)'(%$" 2P{¢ÃÚæéêîîëìïïíîîîîîîîîïïïïïïïïññññññññññññññññòòòóóôôôõõõõôðëæãÙËÁ½»¹·´´³³²²²²²³³´´³²²±±±±±±±±¯¯¯¯¯¯¯¯¯¬¯¯®¬¬®¯¯°¯¯¯°±±±°®¯¯®®®®¯¯®±²¯°³´±²²²²³´µ¶·¶µµµ¶··¹¸¶¶¶µ²°¥™‡qZA*,BYo‡ž´º¾¼¼¾¿½ÂÁÀ¿¿ÀÁÂÀÀÀÀÀÁÂÂÂÃÅÆÇÆÅÄÄÅÅÅÅÆÆÆÈÇÆÄÃÂÂÂÇÇÇÇÇÈÈȺ©x`F3 *@]s¤¼ÇÊÍÑÒÒÓÔÕÖ×ØØÕÖ×ØØØ×××××ØÙÚÛÜÜÜÜÜÜÜÜÛÜÜÛÛÛÛÛÛÜÜÝÝÞÞßßÛÛÔëŽnW=,!*CZw‹›¬¼ÅÄÄÃÃÁÀ¾½»»¹¸····²°®¬ª¨¤¢Ÿž›™–ŽŽŒŒŠ‹Š†„‚|uommqw~‚„†ˆ‹’”••—˜š £¥¦¨ª¬°´·º»»¾ÂÄÆÉÌÏÎÏÒÔÖ×ØØÙ×˳•wZE3) 1Oy¡ÁÙæéêîîëìïïíîîîîîîîîïïïïïïïïññññññññññññññññòòòóóôôôõõõõôñëçäØÈ»¶¶¶¶µµµ´´´³³±²³´´´´´³³³³²²²²°°°¯¯¯¯¯°®®¯®««««¬¬¬¬®°±±¯¬°¯®¯°±¯°°¯¯°±°°°°°±²³´µµµµµ¶¶·¹·¶¶¶´±¯¢—„oXA+,BXo‡ž´º½»»¾¾¼À¿½»»½¿À¿¿¿¿¿ÀÁ¿ÁÂÄÄÃÂÂÃÃÃÃÃÃÄÄÅÄÃÂÁÁÂÂÅÅÅÄÄÄÄļµ¥Žw`H5" *A^u’¦»ÆÉËÌÌÒÒÓÓÔÕÖÖÖÖÖÖÖÕÕÕÖÕÖÖ×ÙÚÛÚÚÚÚÙÙÙÙÙÙÙÙØØØØààßÞÝÜÛÛÛÛÔªnW<, !#$##%'*((*+,3;O`uƒ‹•¡ª««¬«ª§¥£¡ Ÿœœœœ•“‘‹ŒŠ‡…„‚|xwwutsrrqqomjgd`afnxƒ–šŸ£¨«¬¬«±²´¶¹»½¾ÄÅÇÊÌÏÐÑÒÕØÙÚÜßáÞÞàáâããâæä×¾ž|\E1&/Lwž¿ØæéêîîëìïïíïïïïïïïïððððððððññññññññññññññññòòòóóôôôõõõõõñìèãÖĶ²´·¸··¶¶¶µµµ²³´µ¶¶¶¶µµ´´³³²²²²±±°°¯¯±¯¬ª¨©¨§¥¥¦§¨£¥§©©§¥¤ª©¨§¨©«¬®®¯¯®®¯±±±±²³µµ²³³´µµµµ¶µ³³³²°¦š†oX@* *@Wn‡ž®¶¼¿½½ÀÀ¾Á¿½¼¼½¿Á¼¼»»¼½¾¾¿ÀÂÃÄÃÂÁÃÃÃÃÃÃÃÃÃÃÂÂÃÄÅÆÄÄÄÄÄÃÃÿ¸§ybI6!'?_wŽ¢·ÃÇËÌËÐÐÑÑÒÓÓÓÔÔÓÒÒÑÑÑÓÓÓÓÔÕ×ØÖÖÖÕÕÔÔÓØØ××ÖÖÕÕÙÙØ×ÕÔÓÓØ×줉mX;- !!!""###'(()*+,,,-./123468;;;<>@EBCFHHMS^fr{‚Š‘Šˆ†…„‚~~~ywutsspnomjhgeb_`_][YWVUTSRQNJIJU`q‚‘žª±»½ÁÅÇÈÈÇÍÍÏÑÓÔÖ×ÞÞÞßààááäåççççèêçèéêêêééèçÜÄ¥‚`I/$,Jtœ½×åéêîîëìïïíïïïïïïïïððððððððññññññññññññññññòòòóóôôôõõõöõòíéâÕö³¶º½¸¸¸¸··¶¶´µ¶······¶¶µ´´³³´´³³²±±°²°®«¨£Ÿ ž›™™š›œš›œžœ›¡¡¡¡¢£¤¥§¤¥¨¨¦§©®®®°±²°±²´´µ´´µ´³³´³±¯¨œ‡qYB,)?Vm…œ«·½À¿¾Á¿ÁÀ¾¾¾¾ÀÁ¾¾¾¾¾¿ÀÀÀÁÃÄÄÄÃÂÄÄÃÃÃÂÂÂÂÂÃÃÄÆÈÈÃÄÄÄÄÄÄÄž¬“zbH5 &=\tŒŸµÂÊÏÐÏÏÏÏÐÐÑÑÑÓÒÐÏÎÍÍÍÐÐÏÏÐÐÑÒÐÐÏÏÎÍÍÌÎÎÎÍÌËËËÉÉÉÉÉÉÉÉÈƼª–‚kZB6,)(')+**+,-/1244556778<<=?@BCCCDEGIKLMMORSSTWY^[\acbdhnnquutuzwwvuspnmmkjhfeeeb`]\\[YWTQOMLKHFHGFCA>=<;9997348IZt¡²ÂÌÕ×ÙÜÞÞÞÞààáâãääåééèèççææèêëêèçèêêêëììëêêêêàÉ©…aI0$*Hr™»ÖåéêîîëìïïíððððððððññññññññññññññññññññññññòòòóóôôôõõõööóîêâÖÆ»¸»¾Àº¹¹¹¸¸¸···¸¹¹¹¸¸¸¸·¶µ´´³¶¶µµ´³²²²°¯©£›–Œ‰†…†ˆŠŠ‹‹ŒŒ‘’“”••••’“˜™–—›žŸ ¡£¤¦¨¨¨¨¨©¨¨©ªª¨¦’€lYE2&+@Uj—¦²¸¼ºº¼½»¼¼¼¼¼¼¼¼¾¾½½¾¿ÀÀ½¾¿ÁÁÁÀ¿ÀÀÀ¿¿¾¾¾ÀÀ¿¿ÀÁÂÿ¿ÀÀÁÁÂÂÀ¹¨xaH5!,@Zo…—¬¹ÀÅÆÃÂÂÂÃÃÃÄÄÅÄÂÀ¿¾¾¿ÀÀ¿¾¾¾¾¿½½¼»º¹¹¸¶¶µ´´³²²±±±±±±±±®«¢“…xj]SJCCDCDGDDEFHJLMPPQQRSTTVWXZ\^__`abdfhjkilnpqruwywy~€~}€wonjb]]^][XVUTSRQOMKJIIHFDCCB?=;975542010/-+*(('%%'%!%,>Tu”¬ÁÔàããäåææççèçççççççééèèççççæçèèææçèèééêêééèëìã̬‡aH2')Fp˜ºÕåéêîîëìïïíððððððððññññññññññññññññññññññññòòòóóôôôõõõööóîêæÛ̾¿ÁÁººº¹¹¹¸¸¹¹ºººº¹¸¹¸¸·¶µ´´¸··¶µ´³³±±¯¨ —}xutuxzxwwwxyz{{}‚‚€†‚ƒˆŠ‡ˆ‹ŠŠ‹ŒŽŽ‘“””““–••–˜˜—•ƒteVG8."! -AUi~“¡¬²µ´³¶·µ··¸¸¸¸··¶¶µµ¶·¸¸¸¹»¼¼¼»º»»ºº¹¹¸¸¼»ºººº»»¹¹º»¼½¾¾µ®ŸŠu`H6&(4DZlz‹ž©®°¯«®®®®®¯°¯¬ª¨¨¨¨©¨§¦¥¥¥¥¤£¢¢¡ ŸŸžžœ›šš™›š™—–”“’™–Žxqi`d]XZ[[\^__`acehikklmnooppqrtvxzz{{}‚„†‡†ˆ‹Œ’””’”šœ™––}nh`SHDFDA><;;;8753100//-*))(&$(&$##" 9Qu–°ÆÚèèèçççèéêëëëêééèèêêêêêêêêçèêêééêìéêêëëëêêêëä͈cI1%(Eo—¹ÕäêêîîëìïïíððððððððññññññññññññññññññññññññòòòóóôôôõõõööôïëéßÑÇÃÂÁÀºº»»º¹¹¸¸º¼½½¼º¸¹¹¸¸¸···¸·¶µµµµ¶µ¶³¬¥‘…|pebbabeffghiijkjklmopqrrrstvwxyuvwxz{||~~~€€ƒ„…††…ƒ‚~uldYKB@544310//20./11-*,,,++******))(('%&&&&&''#""!!""#"! !"#)5GWfwŠ— ¢¥¥££¦¨§§§§§§§§¨¨¨¨¨¨¨¨¨©¬®«ª««««««««©©©ªª««¬ª«¬¬«ª¥Ÿ{l`O?1& " " !!!" !#$$$#"'''''&&&&&'()*++++,,------...///225:BO]et}Š’”•—™˜˜˜——–––˜—–•“’‘‘““‘ŽŽ‹‹‹ŠŠŠ‰‰ˆ‡†…ƒ‚€~}|{{{wusoijniorqqtvuyyz{}‚€ƒ…†‡‡‡ˆŠŽŽ’”————˜š›œžž ¢¤¦§¨¬¨¯³³§˜‡rbTD72))))((''!!!!!!!!5Vv”µÌÛêæçèééééèééééééééëêêééèèçêêêêêêêêêêêêêêêêìéæÔ¯ŒjK8%$@i’¸ÖçìëìíîîîîíïïïïïïïïïððññððïðððññòòòòòòòòòòòñññòòóóóôóôõöôðíçàÔÊÅÅÈË¿¿¿¿¾½¼¼¹»¼¾¾¼»¹»»ººº¹¹¹¸¸·¶µ¶¶¶µ¶³«¤›ŽpcWSRQRTRSSTUVVWXYZ[\]^_aabdefghefghikklmmmnnnoonopqqponpjeb\SMLGGGFFEDCECBBDC@>@???>>==>===<<;;;:::::::9988889987655678?GR[akw€’’’•””””””””••••••••“”—˜™˜–•””””””””””•••–––•–————–••ƒsiaTGA83575587888999:99:;;;;;====<<<<=>>??@@ADDDEEFFFFGGGHHHIFHKOT[bgjq{€‚‚ƒ…~~~}}}||}||zyxwvxxvuttttqqpponnnllkjhgffeeddcbaa`^^`bdjrxˆŠŒ’‘”••–˜šœžŸŸ¡¢£¤¥¢¤§¨¨©«°°°±±³´µµ¶·¹»½¾¾ÅÁÄÆÂÇƹ¢Žt_K7( 3Uu“´ËÚéæçèééééèééééééééêêéééééèêêêêêêêêêêêêêêêêìéçÕ°kL9%$@h‘·ÕæëëìíîîîîíïïïïïïïïïððññððïðððññòòòòòòòòòòòñññòòóóóôóôõöôðíçàÖÍÈÈËÎÂÂÂÂÁ¿¾½»¼¾¿¿¾¼»½½¼¼¼»»»º¹¸·····¶¶²ª£˜ˆzcTF@?>>?@@ABBCDDDDEFGHIJKLMNOPQQPQRSTUVVWWWXXXYY[[\]]\\[\Z[^_[[^[[[\\[[ZYXWXXXUSTTTTSSSSSSRRRQQQQQQPOONNNNNNNNNNLLKJJKKLOSY]_dkpy{||||}~~~~~~~~}~€€}}}}}}}}~~~~~€€~~zqgc`YRQLIKMMMPPPPPQQRRRRRRRSTTUUUUUUUUXXXXXYYY]]^^^___aaaabbbc_aceeecbadhjihhifeeeddddccba`^^]^]\[ZZZZXWWVUTSSRQQPNMMLLLKJJIHHCACJR\jw‚Ž›¡¥«¬®®¯°±³µ¶ºº¹º»½¿À¼¾ÀÁÁÂÄÆÈÈÈÈÉÊËÌËÌÍÎÐÑÒÓÙÕØØÔÖÔÆ–w]E-1St‘²ÊÙèççèéééééééééééééééééêêêêêêêêêêêêêêêêêêêêìéèÖ±mM9&%@g´ÓäêëìíîîîîíïïïïïïïïïððññððïðððññòòòòòòòòòòòñññòòóóóôóôõöôðíèâÚÒÎÎÑÓÂÂÂÁÀ¾½¼¾¾¿ÀÀ¿¾¾¾¾½½½¼¼¼»º¹¹¸¸¹¹··²ª¡–ƒr[J920/./11223344566789::99:;<==>>??@ABCCDEEEFFFGIJJKKKKKIJPY^aflnopqrqqpnmmmmkjiiiiiihhhhhhggggggfeeccba``aaaa``^]]]\\\\^^__^_acefgggghiiiiiiiiijjjjjjjjhijkkkjjjjjjjjjjiiiiiiiiiiijjiiihe_\\^^\^^_accegeeefffgghhfffhiklllmmmmmqqqqqpppssstttuuwwwxxyyyzzyxtnf`^\XUSRQPQQQQPPOONMMLKJIIIHGFFFFFDCCA@?>>>=<<;:99777665551.09EUj{‰™ª´º¾À¿ÀÀÁÂÃÅÆÇÍËÊÉÊÍÐÑÏÐÒÓÒÓÔÖ×ÖÖÖ×ØÙÙÙÙÚÛÜÝÞÞáÝàáÜÞÛͲšz]D-/Qr±ÈØççèééêêééêêêêêêêêèèééêëëëëëëëëëëëëëëëëëëëìêéØ´‘oO:'$?eŒ±ÐâéëìíîîîîíïïïïïïïïïððññððïðððññòòòòòòòòòòòñññòòóóóôóôõöôðíêæàÚÖÖØÚÂÂÂÂÁ¿¾½ÁÁÁÂÂÁÁÁ¾¾¾½½½¼¼½¼»ºººº»¸·±©¡”~lUB.&$#""!!!!""""''())**+))*++,,-../001124455666655566788:=FS\cmwƒ„†ˆ‰‰‡‡„„…„ƒ€€€€€€€€€}}|{zyxxvwxyyxwvttttsrrqsoic]WROPPOPQQQQQQQQQQQQRRRRRRRRRRSTTTTTSSSSSSSSSSSRRRRRRRRRRRRRVRPQV\afmsxzz{~~~~~€€€‚ƒ………††‡‡‡‹‹ŠŠŠŠŠ‰ŒŒŒŒŽŽ‘‘‘’’–”‘Œ…zmd[SIB?=<:999888775543321110//..//--,+*))(((''&%%$""!!!! # ",<Rl€—ª¾ÊÎÑÒÑÒÒÒÓÔÕ×ØÜÛÙØÙÛÞßÝÞààßßàâàààßààáââããääåååãßäæáäáÓ´›{^F/ .Pq°ÈØççèéêêêêéêêêêêêêêéééêëëììëëëëëëëëëëëëëëëëìêêÚ¶”qQ;(#=b‰®ÎáèëìíîîîîíïïïïïïïïïððññððïðððññòòòòòòòòòòòñññòòóóóôóôõöôðíìéåàÝÝÝÞÄÄÅÅÄÄÃÂÃÃÃÃÃÃÃÿ¿¿¾¾¾½½¾¾½¼»»¼¼¸·±©¡“|gP;% !!""$$%%%&&&&&&&'()*.2>MZgw…”•˜š›š˜—•—˜—•“““’’’’““““‘‘’’’’““ŽŽŒŒŒ‹ŒŽŽŒ‹ŠŠŠŠŠˆ‡†‚zof]UKE?>==?@?=>>>>>>>>????????@@@@AABB>>>>>>>>@@@@????@??>>??@B?@GQ[gq{…ŽŽ’””•••–––——————˜™™™™š››œžžžžŸŸŸŸ¢¢¢££¤¤¤¥¦¦¦§§§§«¨¢œ’‚pdUH8.**(&%%%%$$##!!! "6Po…¡¶Ì×ÛÝÝÜÜÜÜÜÝÞàáââáàáâäåáâäãâáãäâááàááââããããääääàÝâåáäáÒµ|_F.-Op°ÈØçèèéêëëêêëëëëëëëëêêêêëëëëìììììììììììììììììëëܸ–sS<(!:_…«ÌáéëìíîîîîíïïïïïïïïïððññððïðððññòòòòòòòòòòòñññòòóóóôóôõöôðíìëçäáßßÞÅÅÆÇÇÇÇÆÅÅÄÄÄÄÅÅÁÁÁÀÀÀ¿¿¿¿¾½½½½½¹¶±ª¢”{eN8 !#)7I[m„•¤¦¨ª«©§¥¥¨©¨¥££¥£££¤¤¥¥¥¢£££¤¤¥¥¡¡¡¡¡¡¡¡Ÿ ¢££¢ ŸžŸŸŸž›š‘†wi^QC9/-+,./-+,,,,,,,,-------------.//,,,,,,,,..--,,,+-,+**+,-,+0=M\o~‹™¤¤¢¤§§©©©ªªª««ª«¬¬¬¬®®¯°±²²°±±²²³´´µµ¶¶····¸¸¸¹¹¹ºº»¸´ ‹raN>* 3Oo‡£¸ÏÛÝßßßÝÝÝÝÞßàááááâââããàâãâààáâááàßßààáààààààààßÜáäàâÞ϶ž~bH0-Op±ÉÙèèéêêëëêêëëëëëëëëìëëëëëêêìììììììììììììììììëìݺ˜uU=)7\ƒ©ËâêëìíîîîîíïïïïïïïïïððññððïðððññòòòòòòòòòòòñññòòóóóôóôõöôðíêéçäáÞÜÛÃÄÅÇÇÈÇÇÆÆÅÄÄÅÆÆÃÃÃÂÂÂÁÁÀ¿¾¾½½¾¾¹¶±ª£”zdN7#3H]s¢´¶¹»º¹¶´¶¸º¹µ³´¶³³´´µµ¶¶³³´´µµ¶¶³³³´´´´´¯±³´´³±¯°°±±°®¬«¦˜‚n[H3&%7J^u‡œ¬¸¸´·ºººººº»»¼¼º»½¾¿¾½¼ÀÁÁÂÃÄÅÅÂÂÃÄÅÆÇÇÅÆÆÆÇÇÇÈÇÇÈÈÉÉÉÉÉÈÅ¿°–xcK9# 3Oo†£¹ÑÜßàááÞÞÞÞÞßáááâããäããâãåååãâãäåäããããääâââááááàãáæèãåáÑ·Ÿ€dK3!.Oq±ÉÙèèéêëëëëêëëëëëëëëíììëëêêéìììììììììììììììììëíÞ»™vV=)6Z¨ËâëëìíîîîîíïïïïïïïïïððññððïðððññòòòòòòòòòòòñññòòóóóôóôõöôðíèçæãàÝÚØÆÇÈÈÉÈÈÇÆÆÆÆÆÆÆÆÅÄÃÁÁÁÂÃÁÁÁÁÀ½»º¾·¶±£—ƒhM9#!2Iax’¦¶¼¿¾¾ÀÁ¿ÁÁÀ¿¾½½¼¾½½½¾¿ÁÃÂÁÀ¾¾¾¿À¾¾¾¾¿¿ÀÀ»¼½¾¾½¼»ººº¼¼»·´«ž‰s^H1#/E_{¡¶ÁÄÉÈÆËÄÅÅÆÇÈÈÉÈÇÅÆÈÉÉÈÊÊÉÊÊËÌÍÌÌÌÌÌÌÌÌÎÑÔÑÍÌÏÓÍÎÏÏÍÌÍÎÍÏͱš|eP5"1MoˆŸ¶ÏÜßàááÝÞßààßÞÝááááááááãããââáááâãäãââäæáâääãáÞÜàÝãåâåâÓ½œiK1!+Gm¬ÆÛåéêêëëêêéëëëëëëëëëëëëëëëëíììëëììíììììììììíééݾŸ|YC+ 4V~¤ÅÞìëíïïîîîïïïïïïïïïòññððïïîñððïïððññññññññññññòòóóóóõôòóöôîíéäàÝÚÖÓÈÉÉÊÊÉÈÈÈÈÈÈÈÈÈÈÇÆÆÅÄÄÅÅÃÃÃÃÁ¿½¼¾·¶±£—ƒhN:$!2Iay“¦¸¾ÂÁÁÃÃÀÃÂÂÁÁÀ¿¿ÀÀÀÀÀÂÄÅÅÄÂÁÁÁÂÃÀÀÁÁÁÂÂÂÃÄÅÆÆÅÄÃÀ¿¿ÀÁÀ¼¹±¢Œv_G0!/E_{£¸ÃÆËÊÈÎÉÊÊËÌÍÍÍÌÊÉÉËÍÌÌÏÏÎÎÏÏÐÐÎÎÎÎÎÎÎÎÏÒÓÑÍÌÐÕÒÓÔÓÑÐÑÓÎÐÎò›}fP6#1MnˆžµÎÛÞßààÞßàááàßÞááááááááãããââáááâããâááãåáâââáàÞÝàÝâäàäâÔ¾œhI0 +GmŽ«ÆÛåéêêëëêêéëëëëëëëëëëëëëëëëíììëëììíììììììììîëëßÁ¡~[D+2S{¡ÃÜêëíïïîíîïïïïïïïïïñðððððïïñððïïððññññññññññññòòòóóóõôòóöóîìéãßÛ×ÒÏÌÌÌÌËÊÉÈÉÉÉÉÉÉÉÉÉÉÉÉÉÈÇÇÅÅÅÄÃÂÀ¿¿¸·²£—ƒhO;$!2Iay“§¹ÀÅÅÅÆÅÂÄÄÄÃÃÃÃÃÄÄÃÃÄÅÇÈÇÇÆÅÄÄÅÅÃÃÄÄÅÅÅÅÄÅÅÆÆÅÅÄÃÃÂÃÄÃÀ½¶§x`G//F_{¦»ÆÈÎÍÊÐÌÍÍÎÏÐÐÑÐÎÍÍÏÑÑÐÒÒÒÑÑÑÑÑÑÑÑÑÑÑÑÑÒÓÓÑÎÎÒ×ÕÖ×ÖÔÓÔÕÐÒÏÅ´œhQ6#1Ln‡´ÍÚÝÞßßàáââââáàâââáááááããââââáááââáßßáãááààßÞÝÝáÝàáÞâáÔ¾œ}fG/ +GmŽ«ÆÛæéêêëëêêéëëëëëëëëëëëëëëëëíììëëììíììììììììïìíáã€]E,/PwžÀÚèëíïïîíîïïïïïïïïïïïïïððððððïïïïððññññññññññññòòòóòôôñòõóîîêäßÚÕÏËÎÎÎÎÍËÊÉÊÊÊÊÊÊÊÊÉÊËÌÌÊÈÇÆÆÅÅÄÃÂÁÁ¹¸³¥˜„iQ<%!2Jbz”¨ºÂÈÈÈÈÆÂÄÄÄÅÅÅÅÅÆÆÆÆÇÇÈÈÈÈÇÇÆÆÆÆÅÅÅÆÆÇÇÇÃÃÃÃÃÃÃÃÄÃÂÂÃÂÀ½·¨‘yaH/ .F`|§¼ÇÉÏÎËÑÌÌÍÍÎÏÐÐÓÑÐÐÒÔÓÓÒÒÒÑÑÐÏÎÓÓÓÓÓÓÓÓÔÔÓÑÏÑÕØÕÖÖÕÓÒÒÓÒÔÑǶž€iR7$0Lm†žµÎÛÞßààâããããããâãââââáááââââââââàáâàÞÞàáààÞÝÝÝÝÞáÜßàÜááÔ¿œ}dF.!+GlŒ©ÅÚåéêêëëêêéëëëëëëëëëëëëëëëëíììëëììíììììììììíëíâÄ¥_F- .Nt›¾ÙèêìîïíííïîîîîîîîîîîîïððññððïîîïððððððððððððñññòòòòôóñòõóîïëæàÚÓÍÈÐÐÐÏÎÍËÊÊÊÊÊÊÊÊÊÊÊÌÌÌÊÉÈÆÆÅÄÃÃÃÃü»µ§š…kS>&!2Jb{•©»ÃÉÉÉÊÇÃÅÅÅÅÅÆÆÆÆÇÇÈÈÈÈÈÈÈÈÈÇÇÆÆÅÅÆÆÆÇÇÇÇÇÇÇÇÇÇÇÅÄÂÂÃÃÁ¿µ¦xaI1! .F`|‘¦»ÆÉÎÍËÐÌÌÍÎÏÏÐÐÔÒÐÑÓÔÔÓÒÒÓÓÒÑÏÎÓÓÓÓÓÓÓÓÕÕÔÓÒÔ×ÙÕÖ×ÕÓÑÒÓÓÕÓÈ· ‚kS8%0Kl… ·ÐÝàáââääããããäääããââáááââââââââáááàÞÝßàßßÞÝÝÝÝÞáÜßàÜááÔ¿œ}eF.!*EjŠ§ÃÙäéêêëëêêéëëëëëëëëëëëëëëëëíììëëììíìììììììììêìâŦ‚_H. -Lr™¼ØèêìîîíìíîîîîîîîîîííîîïððððïîîîîïððððððððððððñññòòòôóñòôòíîêäÞØÐÈÃÏÏÐÏÏÎÌÌËËËËËËËËËËÌÌËÊÉÉÇÇÅÅÄÄÄÅÆ¿¾¸©œ‡mU?'!2Jc{–ª¾ÅÊÊÊËÊÆÇÇÇÇÇÆÆÆÇÈÈÉÉÉÈÈÈÈÉÉÈÇÆÆÆÆÆÆÇÇÈÈÉÉÈÇÇÈÉÉÉÇÅÅÆÆÄ´¦ybJ3# .F`}‘¦»ÆÈÎÍÊÐÏÏÐÐÑÒÓÓÔÒÐÑÓÔÔÓÔÕÖ×ÖÕÔÒÔÔÔÔÔÔÔÔÕÕÕÕÖ×ØÙØÙÙØÕÓÓÔÔÖÓȸ ‚kT9%/Jk„¡¸ÑÞàâããåäããããäåäääãââááááââââããáââàÞÝÞàÞÞÞÞÞÞÞÞáÝàáÞâáÔ¿~gH0"(Cg‡¤Á×ãéêêëëêêéëëëëëëëëëëëëëëëëíììëëììíììììììììëéíãǧƒ`I/!,Jo–º×çéëîîíìíîííííííííîîîîïïïïïïîîîîïïïïïïïïïïïðððñññññóòðñôòíëçâÛÕÍÄ¿ÎÎÏÏÏÎÎÍÌÌÌÌÌÌÌÌÎÍÌËËËËËÉÉÇÆÆÆÇÈÉÂÀº«ž‰oV@'!2Jc|–ªÂÈÌËËÍÍÊËËÊÉÉÈÈÇÉÉÊËËÊÉÈÉÉÊÊÊÉÇÆÇÇÇÈÈÈÉÉÈÇÆÅÅÆÇÈËÉÆÆÇÇÆÄ·¨’{dK4$ .F`}’¦»ÇÉÎÍËÑÐÐÑÒÒÓÔÔÔÒÑÑÓÕÕÔÔÖØÙÚÙ×ÖÕÕÕÕÕÕÕÕÕÕÖØÚÚÙØÙÚÚÙÖÔÔÕÔÖÓȸ ‚kT:&/Jk„ ·ÐÝàáââåäãââãäåååäãââáááááââãããâããáßÞßàÝÞßààßÞÝàÝâäàäâÔ¿€iK2"'Ae…¢¾Õáéêêëëêêéëëëëëëëëëëëëëëëëíììëëììíììììììììëêîåɪ†bK0!*Gk’·ÔåéëíîìììîííííííííïïîîîîîíïîîííîîïïïïïïïïïïïðððññññóòðñôòíëèãÝÖÎÅ¿ÍÍÎÏÏÏÎÎÎÎÎÎÎÎÎÎÐÏÍÌËÌÍÎËÊÉÈÇÈÉÊËļŸ‹pWA(!2Jc|—«ÅËÎÌÌÏÐÎÎÍÍÌËÊÉÉÊËÌÍÍÌÊÉÊÊËÌËÊÉÇÈÈÈÉÉÊÊÊËÊÈÈÈÈÊËÊÈÅÅÆÆÅú¬•}eL4$ .Fa}’§¼ÇÊÏÎÌÒÏÏÐÑÑÒÓÓÕÓÒÒÔÖÕÕÓÕ×ÙÚÙ×ÖÖÖÖÖÖÖÖÖÔÕ×ÚÜÜÙ×ØÙÙ×ÔÒÓÔÓÕÓÈ· ‚kU:&/IjƒŸ¶ÏÜßàááåäâááâäåæåääãâáááááââããããääâßÞßáÜÞàââàÞÝàÝãåâåâÓ¿ž‚kM3#&@dƒ ½ÔàéêêëëêêéëëëëëëëëëëëëëëëëíììëëììíìììììììììëðçˬˆdK0!(Ei´ÒäéëííìììíííííííííðïïîîííìïîîííîîïïïïïïïïïïïïððññññóòðñôòìîëæáÚÒÉÃÐÑÑÑÐÐÒÔÒÒÒÑÑÐÐÏÐÐÐÏÎÌËÊÊÈÇÈÉÊÉÈÈÉø¯¢‰qZD*"3J`x”ª¿ÈÏÏÎÏÐÎÏÎÍÌÌÌÌÌÍÍÌËËËÌÌÌÌÊÉÉÊÌÌÎÍËÊÊËÍÎÌÌËËËÌÍÍËËÊÊÈÆÅĺ®˜~fP7$ /E^z¨·ÆËËÍÐÐÐÐÑÓÓÓÓÓÒÒÑÑÒÓÕÖÒÓÕÖ×ØØØÖ×ØØÖÖ×Ø×××ØØÙÙÚÙÙÙØ×ÖÕÔÓÕÓʼ¥…lT>%0Hf‡¡¶ÏÝâääãåääããääåäääããââââââââââââááààááâààààààààßàßÞàâÝÕÀ§…hN5!%=`ƒ¡¼ÔäæçèééééèëëëëëëëëêêêëëìììëëëëëëëëììììììììëííåЫƒgL1"$?fŽ±ÏâæìîìëîïíííííííííîîîîîîîîííííííííïïïïïïïïïïïððñññòòòññððððìæàÙÑÈÃÐÑÒÑÐÐÒÔÒÒÒÑÑÑÐÐÐÐÐÐÏÎÍÌÌÊÉÉËËÊÈÈÉø¯£‹r[D*"3J`y•ªÀÉÐÐÏÐÑÏÐÏÎÍÍÍÍÍÌÌÌÌÍÎÏÐÎÍÌËËÌÍÎÍÌËÊÊËÌÍÍÌÌÌÌÌÍÍËËËÊÉÇÆź¯™~gP7$ /D]z©¹ÈÍÌÎÑÒÐÑÒÓÓÓÓÓÓÒÒÒÓÔÖ×ÕÕÖ×××ÖÖÕ×Ø×ÖÕÖØÖ×××ØØÙÙÙÙØ×ÖÕÕÕÕÖÔ̾§‡nT>&0Hf‡ ¶ÏÝâååäåääããääåååååääããâââââââââáààààáâßßßßßßßßàáàßâãßר†jP7#%<_‚ »ÔãæçèééééèëëëëëëëëêêêëëëììëëëëëëëëììììììììëíìåЬ„hM2"$>e°ÎáæìîìëîïíííííííííîîîîîîîîííííííííïïïïïïïïïïïðððññòòòññðððïìçâÛÓÊÄÐÒÒÒÐÑÓÕÓÓÒÒÒÑÑÑÐÑÑÒÒÑÐÐÏÍÌÌÍÍËÉÈÉű¥u\E+"3Jay•«ÀÉÐÐÏÑÑÏÑÐÏÏÎÎÏÏÌÌÌÍÎÐÑÒÏÏÎÎÎÎÏÏÍÌËÊÊËÌÍÎÍÍÍÍÍÍÍÌÌÌËÊÈÇƼ°šgQ8% .D]zªºÉÎÎÐÒÒÑÑÒÓÓÓÓÒÔÓÓÔÔÖ×Ø×××××ÖÕÔÕÖ××ÕÕÖ×ÖÖÖ×××ØØÚÙ×ÕÔÕÕÖÖØÖÎÀ¨‰pU?&0Hf‡ŸµÎÝãæçæååääääååççææååååããããããããááààààááßßßßßßßßáãâáãåàÙĪˆkR8$$;^€ž¹ÓãæçèééééèëëëëëëëëêêêêëëëìëëëëëëëëìììììììììììåÑ®…iN2##<bŠÌàæëîëëíîíííííííííîîîîîîîîííííííííïïïïïïïïïïïïðððñññññððððïíéåà×ÍÇÑÒÓÒÑÑÔÖÓÓÓÓÓÒÒÒÐÑÒÓÔÔÓÓÑÐÎÎÏÏÍËÈÊÅ»³§w]F,"3Jaz–¬¿ÈÏÏÎÐÐÎÒÑÑÐÐÐÑÑÎÎÎÎÎÏÐÑÏÏÏÏÏÏÏÏÎÍÌËËÌÍÎÏÏÏÏÏÎÎÍËËËÊÉÈÇƽ²›hR9% -C\z©¹ÉÏÏÐÒÒÒÒÓÔÔÓÓÒÔÔÕÕÖ×ØØÖ××ØØ×ÖÖÔÖ×ÖÕÔÕ×ÖÖÖ×××××ÚÙÖÔÔÕÖØ×Ù×ÏÀ©‰pV@'0Hf‡ž´ÎÝãçèçæåääääåæçæææåååäääääääääááààààááààààààààáââáäæáÚĪˆkR9$#:\~œ¸ÑâæçèééééèêêêêêêêêééêêêëëëëëëëëëëëììììììììììëåÓ°‡jN3#":_†ªÉÝæëíëêíîìííííííííííííííííííííííííîîîîîîîîîîïïïðððñðððððððîíëéäÛÑÊÒÓÔÓÒÒÔÖÓÓÓÓÓÔÔÔÑÒÓÔÕÕÕÕÒÑÏÏÐÑÏÍÊËƼ´©‘y_H-"4Kb{—¾ÇÎÎÍÏÏÍÒÒÑÑÑÑÒÓÑÑÐÎÎÎÎÎÏÏÏÏÏÏÏÏÏÎÍÌÌÍÎÏÐÐÑÑÑÏÎÍÊÊÊÊÉÈÇÆ¿´‚jS9& ,B\z‘§¸ÉÎÎÏÐÐÓÓÔÔÔÓÓÒÔÔÕÖ×ØØØÔÕÖØØÙÙÙÕÖ××ÕÕÖ×××××××××ÛÙ×ÕÕÖØÙ×Ù×ÏÀ©‰pXB)0Hf‡ŸµÎÝäçèçææåääåæææåååäääãääääääääââáààáââââââââââàááàãæáÚéˆkQ8$"9Z|š¶ÐáæçèééééèêêêêêêêêéééêêêëëëëëëëëëëììììììììíìêåÔ³‰kO4$ !8[‚¦ÆÛåêíêêìíìííííííííííííííííííííííííîîîîîîîîîîîïïïððïðððððððîíìêæÞÕÏÓÔÕÔÓÓÕ×ÓÓÔÔÔÕÕÕÒÓÔÕÕÕÕÕÒÐÏÐÒÒÑÐÌÎȾ¶ª’y`I."4Kb{˜®¿ÈÏÏÎÏÐÎÒÑÑÑÑÒÓÓÔÔÒÐÏÏÎÎÏÏÐÐÐÐÏÏÑÐÏÎÎÏÐÑÑÒÓÓÒÐÎÍÊÊËËÊÉÈÇÁµŸƒkS:& +A[z‘§¸ÉÏÏÏÐÏÔÔÔÕÔÓÓÒÓÔÕ××Ø××ÔÕÖØÙÚÚÚÖ×ÙØÖÖ×ØÙÙÙØØØ××ÚÚØ××ØÙÚ×Ù×ÏÁªŠqYC*0Hf‡ ¶ÏÞäçèçææååååææååååääããååååååååäãââââãäããããããããàááàãæâÚêˆkR8$!7Yz˜´ÏàæçèééééèééééééééèéééêêêêëëëëëëëëììììììììíëêåÖµ‹lP5% 6X~£ÃÙåêìêéìíëííííííííììììììììíííííííííííííííííîîîïïïïïïïïððððîíìêçàÙÓÓÔÕÕÓÔÖØÔÔÔÕÕÕÖÖÓÓÔÕÕÕÔÔÐÏÏÐÒÔÓÒÏÐÊ¿·ª’yaJ/"4Kc|˜®ÁÊÑÑÐÑÒÐÑÑÐÐÑÒÓÓÖÕÔÓÓÒÓÓÐÑÒÓÓÒÑÐÓÒÐÏÏÐÒÓÒÓÔÔÓÑÏÍÌÌÍÍÍÌËʶ „kT;' *@[z‘¨¹ÊÑÐÑÑÐÔÕÕÕÔÔÓÒÒÓÕÖ×××ÖÖÖ×ØÙÙÙÙ×ÙÚÙØ×ØÚÛÚÚÚÙÙØØÚÚÚÚÚÚÚÛÙÛÙÑëŒsZD*0Hf‡¡·ÐÞäççæçææååææçççææååååææææææææååäããäååããããããããáâââåèäÜÅ«‰mS:&!6Wx–³Îßæçèééééèééééééééèèéééêêêëëëëëëëëììììììììîëéå×·ŒmQ6%! 4V| Á×åêìêéìíëííííííííììììììììííííííííííííííííííîîîïïïîîîïïðððîíëéæáÛÖÔÕÖÕÔÔÖØÔÔÔÕÕÖÖ×ÓÔÔÕÕÔÔÓÏÎÎÐÒÔÔÓÐÑËÀ·ª‘yaJ0 "4Kc|™¯ÃÌÓÓÒÔÔÒÐÐÐÐÐÑÒÓ×ÖÖÕÖÖ×ØÒÒÔÕÕÔÒÒÔÓÒÑÑÒÓÔÒÓÕÕÔÒÏÍÎÎÏÏÏÎÍÍ÷ …lT;' *?Zz‘©ºÌÒÒÒÒÑÕÕÕÕÕÔÒÒÑÒÔÖ××ÖÕØØÙÙÙØ×ÖØÙÛÚØØÙÚÜÛÛÚÚÙÙÙÚÛÛÜÜÜÛÛÛÝÛÓÄt[D+0Hf‡£¸ÑßäæçåçææååææçèèèççæææææææææææææåääåææâââââââââääãçêåÞÇ‹nU;' 6Vw•²ÍßæçèééééèééééééééèèèééêêêëëëëëëëëììììììììîëéæظmQ6&!3TzŸÀÖäêìêéìíëííííííííììììììììíííííííííííííííííííîîïïïîîîïïðððïìêèåâÜØÖÖÖÖÕÔÓÓÓÔÕÖ××××ÕÕÖÖÕÕÔÓÒÒÒÑÐÐÏÏÒÓ͹®–~aJ/%1Eby’®ÁÊÒÓÒÔÕÔÓÔÓÑÐÑÔ××ÖÔÓÔÖØÙ×ÓÐÒ×ÙÖÓÔÓÑÒÓÔÓÑÑÑÒÓÔÔÔÓÓÓÒÑÐÏÏÎÇ»¤ˆnV<()@[y¨½ÏÓÓÖÕÑÓÓÓÓÓÔÕÖÔÔÔÕÕÕÖÖØÙÙÚÚÛÛÛÚÚÛÜÜÜÛÛÛÚØ××ØÚÛÝÝÜÜÛÚÙÙßßÜÔÇ°t`C-*Ce€žµÏÜàäæçççççççççéèçææææççççççççççççææåååååäääããããæåããåâÜÊ®‹oV='3Vx–±ÊÛåæçèèèèçêêêêêêêêêêêêêêêêéééêêëëëëëëëëëëëèëëåÖ¸jT6$0U{¿ÙåçêëêééêììììììììììììììììëëëììíííííííííííìííîîííìíííîîïïïñïìêçãÞÙÔÕÖ××ÕÔÓ××ØÙÙÙÙØ××ØØ×ÖÕÕÔÔÔÔÓÓÓÓÓÔͺ®–bJ/%1Eby“¯ÂÌÓÔÔÖ×ÖÒÓÕÕÓÒÓÔÕÕÖÖ××××ØÔÒÔØÚ×ÔÕÔÓÓÕÕÔÓÒÒÓÔÕÕÔÔÔÓÓÒÑÐÐÏȼ¥‰oW=))@[y§¼ÏÔÔ××ÒÕÕÕÕÕÖ××ÖÖÖ×××ØØÚÚÚÚÚÛÛÛÛÛÜÜÜÛÛÚÚÚÙÙÙÙÚÚÛÛÛÜÜÜÝÝÞßÜÔÇ°t_C-*Ce€žµÏÝáåçèççççççççéèççææçççççççççççççæææåååååäääããäæåãäæâÝÊ®‹oV<&3Uw•±ÊÚåæçèèèèçêêêêêêêêêêêêêêêêéééêêëëëëëëëëëëëèëëåÖ¸ŽlT6$ 0Tzœ¾ØäçêëêéêêììììììììììììììììëëëììíííìììììììììííîîííìíííîîîïïïíêéçãßÛÓÔÖØØ×ÕÔÙÙÚÚÚÙØ×ÙÙÙÙÙØ××ÔÔÔÔÔÕÕÕÔÔÎû¯—cK0 %1Ebz“¯ÄÎÕÖÖØÙ×ÑÔ×ØÖÔÓÓÓÕ×ÙÙØÖÕÙÖÔÖÙÛÙÖ×ÖÕÖ×Ø×ÖÓÔÕÖÖÖÕÕÕÔÔÓÒÒÑÑȽ¦ŠqX>))@[y§¼ÏÔÕÙÙÕ×××ØØØÙÙØØØÙÙÙÚÚÜÜÜÛÛÛÛÛÝÝÝÜÜÛÚÚÚÚÛÛÛÛÚÚÙÙÚÜÝßààÝÞÛÔÇ°u_C,)Cdž¶ÐÞãæèéççççççççééèçææççççççççççççççæææåææåååääääææääæãÞ̱ŽqX>(2Tv”°ÉÚåæçèèèèçêêêêêêêêêêêêêêêêéééêêëëëëëëëëëëëéëêå×¹mU7% /Rx›½×äçêëêêêëììììììììììììììììëëëëììììëëëëëëëëììííííììííííîîîïíëéçæäáÞÒÔ×ÙÚÙ×ÕÙÙÙÙØÖÕÔÙÚÚÚÚÙØ×ÒÒÒÓÔÔÕÕÕÖÏļ°˜dM1 %1Fcz”°ÅÎÖ××ÙÙØÔÖÙÙ×ÕÕÕÖ×ØÙÙØ×ÖÙ×Ö×ÚÛÚØÚØ×ØÚÛÚÙÖÖ×ØØ××ÖÖÕÕÔÔÓÓÓɾ¨ŒsZ?*)@[y¦¼ÏÕ×ÛÜØØØÙÙÙÙÙÙÙÙÙÚÚÚÛÛÞÞÝÝÜÛÛÛàßÞÝÜÛÛÚÚÛÜÝÝÜÛÚØÙÚÛÝÞßàÝÝÛÔȱ‘w_C,)Bd~ž¶Ñßäçééèèèèèèèèêéèççççèèèèèèèèèèèçççæææçæææååååäææäåçåßе’u\A*1St’®ÈÙåæçèèèèçéééééééééééééééééééêêëëëëëëëëëëëéëêå׺‘pV8% .Qv˜»ÔãæéëêêêëëëëëëëëëëëëëëëëëëëëëëëëìììììììììëìííííìëììíííîîîìêéèçåâßÔÕ×ÙÚÙØ×ÚÚÚÚÙ×ÕÕÙÙÚÚÚÙØ×ÓÓÔÔÕÕÖÖÖ×Ñƽ±š‚fN2!%2Fc{•±ÅÎÖ×ÖØÙØÙÚÙ×ÕÕ×ÙÚÙØ××ØÙÚÙØØÙÚÛÛÚÛÚÙÚÜÝÝÛÙÙÚÚÚÙØØ×ÖÖÖÖÕÕÕÊ¿ªu\@+)@[y§½ÐÖØÜÝÙØÙÚÚÚÙØØÙÙÚÚÚÛÛÛßßßÞÝÝÜÜáàÞÝÜÛÜÜÛÜÝÞÞÝÜÛÚÚÛÛÜÜÝÝÝÞÛÕɳ“y`D-(Ac}œµÑàåèééèèèèèèèèêéèèççèèèèèèèèèèèèèçççææççççæææåäççåæéæàѶ“v]A)0QrÇÙåæçèèèèçéééééééééééééééééééêêëëëëëëëëëëëéëêå×¼“rW9&!,Ot–¸ÒãæéëëêëìëëëëëëëëëëëëëëëëëëëëëëëêììììììììëëìííìëëìììíííîîíìêéèäßÛ××ØÙÙÙØØÝÝÝÝÜÚÙØÚÚÚÛÚÙØØ××ØØØØØÙ×ØÒǾ³›ƒgO3"%2Fd|–²ÅÏÖ××ÙÚÙÝÜÛØÖÖÙÛÝÛÙ××ØÚÛÙÙÙÙÚÚÛÛÜÛÚÛÞßÞÝÛÛÜÜÜÛÚÙØØ××××××ËÁ«‘w^B,)@[y¨¾Ò×ÙÝÞÚÙÚÛÜÜÚÙØÚÚÛÛÛÜÜÜßßßßßÞÞÞâàÞÝÜÝÝÞÝÝÞÞÞÞÝÝÝÝÝÝÜÜÜÜÞßÝÖ˶–|bE. (@b|›´Ðàåèééééééééééêêéèèèèèéééééééééèèèççççèèèçççææäççæçêçâе“v\?&/PqŽ«ÇØåæçèèèèçèèèèèèèèèèèèèèèèéééêêëëëëëëëëëëëéëêåؽ•uW:'!+Mq“¶Ðâåéëëëëìêêêêêêêêêêêêêêêêëëëëêêêêììììììììëëììììëëëìììííííííëêæà×ÒÛÚÙØ×ØÙÙÝÝÝÝÜÛÚÙÜÜÜÜÜÛÚÚÙÙÙÙÙØØØØÙÓÈ¿³œ„hP4#%2Fd|–³ÇÑØÙÙÛÜÚÜÝÝÛÙØÙÚÛÛÚÚÙÙÙÙØÙÙÙÙÙÚÛÜÛÚÜÞàßÞÝÝÝÝÝÜÛÚØØØØÙÙÙÙÌÂ’y_C-)@[yªÀÓØÚÞÞÚÛÜÞßÞÜÚÙÜÜÝÝÝÞÞÞßßßàààààáàÞÝÝÞßáßßÞÞÞÞßßßßßßßßßßßàÞØ͸™dG0!'@a{™²ÏßåçèèééééééééëêéèèèèéééééééééééèèèçççééèèèçççåççæèêèãÒ¸–y^A(/OoªÆØåæçèèèèçèèèèèèèèèèèèèèèèéééêêëëëëëëëëëëëêëêåؾ–wX:'"*Ko’´ÏâåéëëëìíêêêêêêêêêêêêêêêêëëëêêéééééééééééêëëììëëêëëìììííííììéäÚÎÆÝÛÙ×Ö×ÙÚÚÚÛÛÛÚÙØÝÞÞÞÞÝÜÛÙØØ××ÖÖÕÙÙÓÈ¿´œ„hQ5#%2Fd}—³ÉÒÚÛÛÝÞÜÚÝßßÜÙØØÙÚÜÝÜÚØ××ØÙÙÙÙÚÛÜÛÚÜÞàßÞÞÞÞÞÞÝÜÛÙÙÙÙÙÙÙÚÌ®“z`C-)@[y«ÁÔÙÚÞÞÚÝÞàáàÞÜÚÞÞßßßàààßßßààááâáàÞÝÝÞáâáàÞÝÝÞàáààááâââãßáßÙιš€eH1"'@a{˜±Îßäçççééééééééëêéèèèèééééééééééééèèçççéééèèèççåçèæèëéã×¼š}bE+.NoŒªÅØåæçèèèèçèèèèèèèèèèèèèèèèéééêêëëëëëëëëëëëêëêåؾ—xY;("*Jn‘³ÎâåèëëëìíêêêêêêêêêêêêêêêêëëëêêéééççççççççêëëììëëêëëëììíííììëèáÕǽÜÜÛÚÚÚÛÛÚÚÚÛÛÛÜÜÝÝÜÜÜÛÛÛÚÚÙÙÙØØØÙÓÔÏÁ´ŸƒiR7&$0Eb{–³ÈÕÞÛÙÞßÜÞÞÝÜÛÚÚÙÜÜÛÛÛÚÚÚÝÚØ×ÙÚÛÚÝÝÝÝÝÜÜÜßßÞÞÞÝÝÝÛÛÛÛÛÛÛÛÑDZ–{aE/)?Zz’¨ÀÑØàÞÚßÝÞàßÞÞàáàààáááââààààààààÝßáàÝÜÞáÞßßààáááààßßßÞÞÞáÜÝÙÈ·gI1!%=`{—°ÍÞãæçæèèèééêêêëêêééêêëëëëëëëëëééééééééèèèèèèèèçææçééçåÕ¾œ{^D-,Kl‹©ÄÕâåèéèçèéèèèèèèèèèèèèèèèèéééêêëëëééééééééêìëæÚ¿—xZ?+!)Fj¶ÐáæéèèëíëìêêêëëéçéééêìëéæêééêêéæäãßÛÙÕÕÞéèéëìêèêíìììììììììëéæÞϾ²ÜÜÛÚÚÛÛÜÛÜÜÜÝÝÝÞÝÝÝÜÜÜÛÛÚÚÚÚÙÙØØÚÔÔдŸ„jR7&%1Eb{•²ÇÕÞÛÙÝßÜàßßÞÝÜÜÛÞÝÝÝÜÜÜÜÞÜÛÛÜÝÝÜÝÞÞÞÞÞÞÞààßßßÞÞÞÝÝÝÝÝÝÝÝÒDz–|bE0)?Zz’ªÂÒØàÞÙÝÝßààßÞàáààáááâââààààààààÞàâáßÞßâßßàààáááààààßßÞÞáÜÝÙȶœ~gI1"%=_{–°ÍÞäæçæèèèééêêêëêêééêêëëëëëëëëëééééééééèèèèèèèèéèçèêêèæÖ¿{_E-,Kk‹©ÄÕâåèéèçèéèèèèèèèèèèèèèèèèéééêêêëëééééééééêìëçÚ¿˜xZ?+!+FhŒ®ÆÜâæææèéçëêéêëëéçèçæææåâßÞÜÚÙ×ÕÐÍƾ¼»¿ÌÙåçêëêèêíììììììììììëæÛɵ§ÜÜÛÛÛÜÜÝÝÝÝÞÞßßßÞÞÝÝÝÜÜÜÛÛÛÚÚÚÙÙÛÕÕÑõ …jS7&&2Ebz”±ÅÔÝÛÙÝßÜááàßßÞÝÝßßßßÞÞÞÝàßÞßááßÝÞÞßßàáááââáááàààÞÞÞÞÞÞÞÞÔɳ—}cF0)>Yy‘«ÄÓÙàÞÙÝÞßáàßßàâáááâââããáááááááááâãâáàáãàààáááââáááàààßßáÜÞÚÉ·~hJ2"$<^z–¯ÍÞäæççèèèééêêêëêêééêêëëëëëëëëëééééééééèèèèèèèèêéèéëëéç×Àž}aF.,JjŠ¨ÃÕâåèéèçèéèèèèèèèèèèèèèèèèééééêêêëééééééééêììçÚÀ˜y[?+!'EiŽ°ÇÜäéééëêæìêééêéæäãáÞÝÛÙÕÒÍÊÅÁ½¸³®§¢žž§»ÍßäéëééêìììììììììííëåÖÀ©šÝÜÜÜÜÝÞÞÝÝÞÞÞßßßßÞÞÞÝÝÝÝÜÜÜÜÛÛÚÚÜÖÖÒÄ·¡†kT7&'2Eby”°ÅÓÝÜÚÞßÜáàààßßÞÞàààßßÞÞÞàààâäãáÞßßàáâãäääãããâââáßßßßßßßßÖ˵™~dG1(>YyªÃÓÚáàÛàÞàááààáãââââãããäââââââââãäääãããäáááâââââââââááààâÞàÝ̺Ÿ€hK2"$;]x•¯ÍÞäçèçèèèééêêêëêêééêêëëëëëëëëëêêêêêêêêéééééééééèèéêêéçØ cH/+Iiˆ§ÃÔâåèéèçèéèèèèèèèèèèèèèèèèèèéééêêêééééééééêììçÛÁ™y\@,"%ChŽ°ÇÛãéêêêçãäâàÞÝÚÖÓÐÍÉÆÿº·±¨¢—‘Š…ƒ’¬Ã×àéêèéëëëëëëëëëëïîëáй£•ÝÝÜÜÝÞßàÝÝÝÞÞÞßßßßßßÞÞÞÝÞÞÝÝÜÜÜÜÝ××ÓŸ¢‡mT7%'2Eby”°ÄÓÞÝÜààÜßßßßßÞÞÞàààßßÞÞÞáàáâäãáÞàááâãäååååäääãããßßßßßßßßØÍ·›€eH2(=Xx§ÀÑÚããßäßáââááâäâãããääääääääääääååääåååäãããâââââääããââââåáäáн¢ƒjL3##:\w•¯ÌÝäçèèèèèééêêêëêêééêêëëëëëëëëëêêêêêêêêééééééééèçæçééçåÚÄ£‚eI0*Hg‡¦ÂÔâåèéèçèéèèèèèèèèèèèèèèèèèèèéééêêééééééééêììçÛÁš{]A-#&Beˆ¨¼ÒÚààßÞÚÕÓÐÌÈÅÀ»·²®©¥¡œ˜”ŽŠ„zuplkfa`fzšµÏÜçéçéëêëëëëëëëëðîéÝ˶£˜ÝÝÝÝÞßàáÝÝÝÞÞßßßàààßßßÞÞßßÞÞÞÝÝÝÞØØÔƹ¤ˆmU8%&2Ebz”±ÄÔßßÞáâÞßßßßßßßßáàààßßßßâááâããâàâââãääåååååäääããààààààààÚϹœfI3(=Ww¦¿ÑÚääâçàâããâáãäããäääåååååååååååæåääæçæääääãããââååäääãããçãçäÓÀ¤„jM4#"9Zv”®ÌÝäçéèèèèééêêêëêêééêêëëëëëëëëëëëëëëëëëêêêêêêêêçææçèéçåÛÆ¥„gK0*Gf…¥ÂÔâåèéèçèéèèèèèèèèèèèèèèèèçèèèéééééééééééééììèÜ›{^B-#)Fhˆ£´ÂÉÎÍËÉÄ¿¼¸´¯«¥Ÿ›–’Œ‡ƒzwplfb^ZVTOKGGPg¬ÇØæèæêëéêêêêêêêêïíèÛɵ¥œÝÝÝÝÞàáâÞßßßàààáááàààßßßààßßÞÞÞÞßÙÙÕǺ¤‰nU8%%1Eb{•²ÅÕááàãäßààààááááââââáááàåãááãäãâããããããääåååäääããááááááááÜѺžƒgJ4(<WvŽ¨ÁÒÛääâæáâäãââãåäääåååææææææææææçåãäæçæãååäääãããææååääääçäçåÔÁ¥…kM4$!8Yu”®ÌÝäçééèèèééêêêëêêééêêëëëëëëëëëëëëëëëëëêêêêêêêêèççèééèæÜǦ†hL1 *Fe„¤ÁÔâåèéèçèéèèèèèèèèèèèèèèèèççèèèééééééééééééëìèÜÃœ|_C.#!%'+-:Ur‰š¤§®±®ª¨¤ž™–’ŽŠ„{wrlhda]ZUQKGDA>;6314?[„¦ÁÕæçåêëèêêêêêêêêëìèÜÉ´¤›ÝÝÝÞßàââààáááâââáááàààßßàààßßßÞÞàÚÚÖȺ¥‰oV8%$0Eb{–³ÆÖââáååàâââââââãäääãããââçäââãåååäãããããââåååääãããããããããããÝÑ»žƒhK5'<WvªÃÔÛääàåáâääãâäåääåååæææææææææææçäãäæçåãæååääãããæææåååääæãçåÔÀ¤„kN5$!7Yt”®ÌÝäèééèèèééêêêëêêééêêëëëëëëëëëëëëëëëëëêêêêêêêêéèèéëëéçÝȧ‡iL1 )Ed„¤ÁÔâåèéèçèéèèèèèèèèèèèèèèèèçççèèééééééééééééëìèÜÃœ|_C.$ !''(+/5:=HISh{…‰‹‹‘“‹ˆ„wtqmjf`]ZUPKHEB?=93/,)&$" !%2P| ½ÔåæåêëçêêêêêêêêèêéÞË´¡—ÜÝÞßàáááääãââáààæåäãáàÞÞààààààààãÛÙÓŸ¥‹sS9($/A_x”±ÊÖßáàãææääääääääææææææææååååååååâããääåååäååææååäååååååååÝÒ¼ …jM8" #>Wr¨¼ÒÞâåææçççææåååæææææææææççèèççæææææææææåååææçççççççççççççäßÖäŠlT7# #7Ux‘¯ÈØçéæêêêêêêêêêêêêêêêêêìëëêêëëìììììììììééééééééééééééééÝȨ‡jM2!%Be„¡¾ÓßåéçæèèåçèèééèççêêêêêéééççèèèéééèèéééèççéëìèàÉ }[E,!! #'*-047;@EKOSX[^fnw€…‚z~wstslge^[WSQNIF>=:741/.&%$"!2MsšµÑâåêêçéèèèèèèèèçêèÜDz¤žÜÝÞßàáááãããâââááååäãâáàßààààààààäÜÛÖǺ¦‹sS9($/A_x”±ÊÖàááãææääääääääææææææææççççççççããäääåååäååææååäååååååååÝÒ½¡†kN8"#>Vr©½ÓÞâåçæçççææåååæææææææææççèèççæææææææææååæææçççççççççççççåàØĤ‰mU8# #7Uw®ÈØçéæêêêêêêêêêêêêêêêêêìëëêêëëìììììììììêêêêêêêêééééééééÞÉ©ˆkN3"%Bd„ ½ÓßåéèçéèæèèéêêêééééèèççææèèèèèèèèèééêêêééäæèåÜÄœz`J0##&(*,/36;>CFIMQUZ^dinrwz}‚…††ƒyoh_YXUOJHC@<:852/*)'%" 0Kq™´ÑâäêêçéèèèèèèèèèêèÜȳ¦ ÝÝßàáááàââââããããäääããâââááááááááäÝÝÙʽ§‹sT9)$/A_x”±ËÖáââäææååååååååææææææææèèèèèèèèäääåååææååææææååååååååååÞÔ¾£ˆmO9#"=Vq©½ÔßãæçæççççææææææææææææççèèèèççææææææææåæææçççççççççççççèçãÚŤˆnV9$"6Tv®ÇØçéæêêêêêêêêêêêêêêêêêìëëêêëëìììììììììêêêêêêêêééééééééàË«ŠmP5$%Ac‚Ÿ¼ÒàæêèèééææçèéêêééêéééèèççêéééééééæçèéêêêéæéêèÝÃœ}_I1$ #&'*-07:>BEJOSY\aeimrvy~„ŠŽ“˜›¡£¡™Ž€o`UKA>;500,*'&%$!.Ip—³ÐáäéêæéèèèèèèèèèêèÜȵ©¤ÞÞßàáááààááâãäååãããäääääââââââââãÝÞÚ˽§‹tT9)$/A_x”±Ë×âäãåççææææææææççççççççææææææææåååæææææååæççæååææææææææàÕÀ¥ŠoQ:#!<Uq©¾ÕáåççæçççççççæççççççççççèééèççççççççççæææçççèèèèèèèèèèèééæÝÇ¥‰pX:%"5StÆ×æéæêêêêêêêêêêêêêêêêêìëëêêëëìëëëëëëëëëëëëëëëëééééééééâͬŒoR7&$@a€»Ñàæêéèêéçäåæçèèèèçççèèèèèççççèèèèææçèééèèêëëæؼ˜~^L9/,+.248<@DHLPRUZ_djptvy~‚†Š“–š ¦ª¯³¶¼½¸©•~fTH=2.*&$$" .Io–²ÏàãééæèçççççççççéæÛÈ·ªßßàááááààáâãäåææääääååååâââââââââÝÝÙ˽¦ŠtT:)$/A_x”±Ë×ãååæççææææææææççççççççææææææææçççæææææåæççççæåææææææææá×èqS<$!;TpŽ©¾Öâæèèæçççççççèçççççççççèééééèçççççççççææçççèèèèèèèèèèèèêêçßʨ‹rZ<&!4QsŽ¬Æ×æéæëêêêêêêêêêêêêêêêêìëëêêëëìëëëëëëëëëëëëëëëëééééééééãήpS8'$?`~›¹ÐàæêèèééæåæçèèèèèåææççèééååææççèèæççççæåäâàÝÖÆ«ŒxfZNHFFJPRV[`dinrsv{€…‹‘––™ž¢¥¨°¶º¿ÃÆÊÎÐÒÓË·œaM:.#.Io–°ÍßâèéæèççççççççåçåÚÊ»³±ààááááààááâãäåææååååååææããããããããäÝÝÙʼ§‹uU:*$/A_x”±ËØäçæçèçççççççççèèèèèèèèééééééééèèèçççææææççççææççççççççâÙŪtT=$ :SpŽ©¿×ãçééçççççèèèèèèèèèèèèèèééééèèèèèèèèèèççççèèèééééééééééêêçàÌ«t[=' 3Pq«ÅÖæéæëêêêêêêêêêêêêêêêêìëëêêëëìêêêêêêêêêêêêêêêêééééééééäήŽpT9'#>^|š¸ÎßåéçæèèåèèééééèèêêêêêêêêçççæææååÞÞÝÜÚ×ÕÔÏÊÅ¿¯˜ƒxoidcbaeklpuz~ƒ‰Œ‘”™¡¦¬°´·º½¿ÁÄÇÏÒÖÙÚÜÞáãäÜĤ`I2'.In•¯ÌÝáçèåèææææææææäæåÛÍÁ¼»àááââáààâããääåååæææææåååääääääääçßÞÙʽ©ŽuU:*$/A_x”±ËØäèçèèçèèèèèèèèèèèèèèèèééééééééééèèèçççæççèèççæççççççççãÚƬ’uV>%9RoŽ©¿×äéêéççççèèéééèèèèèèèèèééêêééèèèèèèèèèçççèèèéééééééééééêéæàί•u]>( 2OpŒ«ÅÖæéæëêêêêêêêêêêêêêêêêìëëêêëëìêêêêêêêêêêêêêêêêééééééééäήŽpT9'#=]{˜·ÎÝäçæåççäççèççåäãéèæäâàßÞÝÜÚØÕÓÑÐÆÅÃÀ¼¸µ³±«¦¢—‡|zwvz€„‰‹”˜œ¡¦ª±³·º¼ÀÅÈÎÐÓÔÔÕ×ÙÝàâãããäæèêãË©„aK2',Gl“®ËÝàçèåèæææææææææèçßÒÈÅÅááâââáààããäääåååçççææåååääääääääéáßÙË¿«‘uU;*$/A_x”±ËÙåèèèéçèèèèèèèèèèèèèèèèççççççççêééèèçççæççèèççæççççççççäÛÇ“vV?%8RoŽ©¿Øåéêéççççèèéééèèèèèèèèèééêêééèèèèèèèèèçççèèéééééééééééêêéæàϱ˜v]?( 2NpŒªÄÖæéçëêêêêêêêêêêêêêêêêìëëêêëëìêêêêêêêêééééééééééééééééãήpS9'#<\z˜·ÍÝãçåäææãäääãâàßÞÝÛØÕÑÍÊÉÈÆÿº¶³±«¨¥ ›—”•ŽŠˆwsvƒ—œ¡§«®³·»¿ÄÇÍÏÒÓÕØÜßâäååäåæèæèêêèçèéäèâ̪†dN2'+Ek‘®ËÜàæèåèææææææææçééáÖÍËÌßßààààààááâãääääääääääääåäãâãäæçèçâÚÑÀ¥uV<*!/CZu•ÇÙçæäçéæççççççççèèèèèèèèéèèççèèéééééééééèèèèèèèèèèèèèèèèãÜɯ“uWA'!9RoŽ¬ÃÜçéêêéèèèèèêëëééééééééééééééééééééééééèèèèèèèèêêêêêêêêêêéçãÒ±•xZ@,.Pl‹¨ÂÔæêçêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêééééééééééèèèçççãÎpU;+";\z•²É×ÞâàààÛÓÖÕÔÑÏÍÌËÃÁ¾»·³°¯ª§£¡Ÿœ˜–Ž‹‡‚~{zrpnkfenz‚‘¡ª±·»»ÂÆËÏÒÕØÛßßàâãåæçéèèççèèéèèèèèèèèæåãЪ‡gI6)(DmŽÂØâãåççççççççççèçåáÚÒÊÅààááââããââãäääããââââââââäãâââãåæååàÚÑÁ§‘vW<*!/CZv–®ÈÚççåèéæééééééééèèèèèèèèéèèççèèéééééééééèèèèèèèèèèèèèèèèäÜÊ°“vWA' 9QnŽ¬ÃÛçéêêéééèèèéêëééééééééééééééééééééééééééééééééêêêêêêêêêêéèãÒ²–y[A-.OkŠ§ÁÓåêæêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêééééééééëêêêééééæÑ°qT9'$<\w¨¼ÃÊÍÌËËƾ¼»¹¶³°®¥¤¡™•’‘Œ‰…‚€}ywqoliea^\YVRPOUfwŽŸ³ÀÉÑÖÖ×ÚÞàáâåçäååçèéêêéèèççèèéèèèèèèèèéçæÓ¬‰iK6)(DnÂÙâäåçççççççççççèèåÝÓÉÂááâãäåææããäääãââââââââââãâáàáâäåãâßÙÑ©“vW<* .C[w˜°ÉÛèèæéêçééééééééèèèèèèèèéèèççèèéééééééééèèèèèèèèèèèèèèèèäÝ˱•wXA'8Pn«ÂÛçéêêéëêééèééêééééééééééééééééééééééééêêêêêêêêêêêêêêêêéêéèäÓ³˜{]B..Njˆ¦¿ÒäéæéêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêëëêêééééæѲ’tV9&!%0F`v‡˜¥¬°³±°®ª¤Ÿž›˜”‘Ž‡†ƒ{wtsmjfca^ZXRQNKHEBA@;76:Id|–ªÁÑÚâæåäæèéçççéèéééêêëëéèèççèèéèèèèèèèèéçæÓŠiK6)(En®ÃÙãäåççççççççççæèéçàÔÈÀßàáâäåæçääääãâááääääääääâáàßàáãäââÞÙÑ©“wX=+-BZw™²ÊÛééæêëèççççççççèèèèèèèèéèèççèèéééééééééèèèèèèèèèèèèèèèèåÞ̳–xYB(6OmªÁÚæééêêìëêéééééêêêêêêêêêêêêêêêêêêêêêêêêëëëëëëëëêêêêêêêêééééåÕµ™}_D/-Mh†£½Ðãèåéééééééééééééééééééééééééééééééééêêêêêêêêéééèèèççãϱ“vX<)"$%'+./258>HYiv†‹’”•”’‹ˆ…ƒ€|xtqpnljfb_\ZTQNKIGCA<;97420/+(%&-Bdš¯ÉØàäåäæçéèæääåééèèèèèèéèèççèèéèèèèèèèèçåäÑ«ˆgJ6))Eo¯ÄÚãäåçççççççççççèèåÞÒÇÀÞÞßáâãäåääääãâááääääääääáàßßßáâããâßØÐÁ§‘xY>+,AYv˜²ÊÛééæêëèççççççççèèèèèèèèéèèççèèéééééééééèèèèèèèèèèèèèèèèåßε˜zZB(5MlŒ©ÀÙæèéêêíìëêééééêêêêêêêêêêêêêêêêêêêêêêêêëëëëëëëëêêêêêêêêééééæÖ·›aF0,Keƒ »Îáçåèééééééééééééééééééééééééééééééééêêêêêêêêéééèèèççãϱ“vY<) !"#$&''...037;=ADHKNQUXY`jquwwuyxwwtolkgeb_[WTRPOMJGDA@;85320-+''%$"! #9]|µÐßåççåèéëëéçèèéèèèèçççéèèççèèéèèèèèèèèèæåÒ«ˆhJ6))Fp‘°ÅÛääåççççççççççèèæáÚÐÈÂÝÝÞßàáââããäääãâââââââââââáàßàáâäââÞØÐÁ§‘yZ>,+?Vt–°ÉÛèèæéêçééééééééèèèèèèèèéèèççèèéééééééééèèèèèèèèèèèèèèèèæà϶š{[C)3Lk‹¨¿Ùåèéêêìëëêêêêëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëêêêêêêêêéééêç×¹cG2+Ic€ž¸Ìàæäèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèééééééééêéééèèèçâΰ‘uX<* "%')*2358:=?@HHJMPTWX]`dgimpsswyvspjdeb`_\VSTKJGEA?<;66420.,+(%#""! 5Zxš³ÐáæééèèêììêéêëêêêêéééééèèççèèéèèèèèèèèêèçÔ®‹jM6)*Gq’±ÆÛäååæçççççççççèçåáÚÑÊÅÞÞßßààááââãäääããâââââââââáàààâãäàßÜ×Щ”zZ?,*=Tq“ÈÚççåèéæééééééééèèèèèèèèéèèççèèéééééééééèèèèèèèèèèèèèèèèæàи›|[C)2Kj‹¨¿ØåèéêêëëêêêëììëëëëëëëëëëëëëëëëëëëëëëëëêêêêêêêêêêêêêêêêèéêêèغŸƒdI3+Hb~œ·ËßåäçèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèææåååäääÛǪt[C2"!"##%'),/1267:=@CFGNORVZ]`afhjnqtvv}€ƒ†ˆŠŽ’’‹~sj_UOJGGC<9;321/-+*)%%$#" 4Yy–°ÎÞãæççæèêêèçèéêêêêêêëëéèèççèèéèèèèèèèèëéèÕ®‹kM6)*Gq“²ÆÜäååæççççççççççççäÞÕÍÇßßààààààááâãääääääääääääãâáàáâäåÝÝÛÖÑë–z[?,*<Sp’¬ÇÙçæäçéæççççççççèèèèèèèèéèèççèèéééééééééèèèèèèèèèèèèèèèèæáѸœ}\D)2JjŠ§¾ØåèéêêêêêêëìííëëëëëëëëëëëëëëëëëëëëëëëëêêêêêêêêêêêêêêêêèéêêèÙ»Ÿ„eI3*Ha}›¶ÊßåãçèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèèççççççççààààßßßÞѾ£‰t_K=20/037::?@CFJMPQTUX\`dfhjlosx|„‡‹Ž‘‘š ¢¤¦©¬¬©›…sfXJ93//+#!$ 0Wx˜²ÐßãäåæèéëêèççèèèèééêêêéèèççèèéèèèèèèèèèçåÒ¬‰iK6)*Hr“²ÇÜåååæçççççççççåçêéãÙÏÈÞÜÚÜàâàÞãââââãäåãäåæåäâáãâàßßàâãäâÝØÒÄ«•{[?-*>Uq’«Å×æçåéêçèèèèèèèèèèèèèèèèééééééééêêêêêêêêèèèèèèèèèèèèèèèèçÜк™}aD,0Gf‡¢»ÖåéêëêëëëëëëëëììììììììëëëëëëëëêêêêêêêêììììììììììëëêêêêëéçèèÚ»‚dH2)E^€—µËÚäèèææçèèéêêéèèçæååäèççæåääãçæåäãáàààÞÜÙ×ÕÔÔÐÍËÊÉÈÅú¥Ž~seXQJJJKLORTY[^bfiklmptz~‚„…ˆŠŒ”˜šœžŸ¡¤§ª¬®±³µ¹¼ÀÂÄĺ¥‹t`L<-%1Tr•´ÍÛæçãèæææççèèèèèèèèèèèèèèèèèèèèèèèèèèèèæåÒ«‰jM7*+Gp™®ÊÛÝäæäèèççççèéêæçéêåÙʾßÝÜÞáâáßãââââãäåääåæåäãâãâàßßàâãßÞÚÖÐë•z[?-)=Tq“¬ÂÕääãæèäééééééééççççççççèèèèèèèèééééééééèèèèèèèèèèèèèèèèçÛк˜}aD,0Gf‡¡ºÕäèéêéëëëëëëëëëëëëëëëëììììììììììììììììééééééééëëëêêéééêèæèèÚ»Ÿ…gL6 )G`~•²ÉÚåééååååååääæåäãâààßÝÜÛÚÙ××ÖÖÕÔÒÐÎÍÌÉÇÅ¿½¼»µ²°®®¬©§ wsmfcefhiknrtwy|€„†ˆ‰‹Ž’—›ž¡¡¥¦¨¬¯³µ·»¼¾ÀÃÅÇÈÊËÍÐÓÕ×ÙÕɱ“w_F4'1Tr”³ÌÛæçãèæææççèèèèèèèèèèèèèèèèèèèèèèèèèèèèæåÒ«‰jM7*+Gpš³ÏÞàåçäèèèççèèéêééêéãØɾßÞÝßáââáâââââãäääååååäãâãâáààáâãÝÝÛ×ÑĬ—|\A.(<So©ÄÖåæåèêçèèèèèèèèææææææææççççççççççççççççèèèèèèèèèèèèèèèèæÚϹ˜|`D-0Fe† ¹ÔãçéêéììììììììééééééééììììììììììììììììëëëëëëëëííìììëëëëêéêêÝ¿¤‚dJ6 &E`|‘ÂÒÝáàáàßÞÜÛÚÙØ×ÕÔÒÐÎÎËÊÉÇÅÃÂÁ¿¾¼º¸¶´³®¬©¦£ Ÿž˜–“‘Ž‹ˆwnosuwx‚†‰‹Ž’•—˜›Ÿ¢¤¥¦ª¬¯³·º¼½ÁÂÄÇÊÍÏÐÕÕÖØÙÛÜÜÜÝÞàâäåæä×½›|_D0!1Tr”³ÌÚæçãèæææççèèèèèèèèèèèèèèèèèèèèèèèèèèèèæåÒ«‰jM7*,Hqš¸ÓâãçèåèèèççèéêêêêèåßÔÇ¿ÝÝÝÞàáááââááââãäååååääãããâááááâãàáßÛÔƯ›~_D0*<Qk‹£ÄÖåæåéêçææææææææççççççççèèèèèèèèççççççççççççççççççççççççåÚθ—|`D./Fd… ¹ÕãèêêêììììììììêêêêêêêêêêêêêêêêêêêêêêêêìììëëëëêìììëëêêêêééêéÜÀ¦ƒeJ4+HbzŒ£´ÂËÎÌÏÎÌÊÇÄÃÁ¿¾¼º·µ³²°¯ª¨¥¤££¢ š˜–•’Š†„‚‚~{xvuspmhcbis{ƒ‰“˜ž¢¤§¬°±²´·º»¼½ÂÃÅÈËÎÏÐÕÖ×ÙÛÝßààááââãããââãäåææçæÙÀŸcG3"1Tr“²ËÚææãèæææççèèèèèèèèèèèèèèèèèèèèèèèèèèèèæåÒ«‰jM7*,Hq›¸ÔãäèéæééèèèèéêëéèæâÛÒÈÂÛÛÜÝÝÞßàâááááâãäååääãããããââââââããäâÜÔƱŸdJ6");Qk‹£ÀÓâããçèåææææææææççççççççèèèèèèèèççççççççççççççççççççççççåÚι˜}aE/ /Ec„ ¹ÕäéëëëëëëëëëëëêêêêêêêêêêêêêêêêêêêêêêêêêêêééèèèëêêêééééèèèèæÚ¿¦ŒlN6 !"$$&).;Rhuƒ”¢µ·µ²±¯¬©¦¤¢¤£¡Ÿœ™—–‘‹ˆ…ƒ‚ƒ‚€~{xvusqokhfeda^[ZYWTQRQWetšª±¹¾¿ÁÅÉËÌÎÐÑÓÓÓØØÙÛÝßáâããäåæèèéèèèèçççççççèèèèèãØ¿Ÿ€dI5#1Tr’±ÊÙææäéæææççèèèèèèèèèèèèèèèèèèèèèèèèèèèèæåÒ«‰jM7*-Irœ¶ÒáãèêçëééèèééêëééèãÜÓÌÈÙÛÜÝÜÜÞßááààáâããæåäããããäãããããããããäâÛÒƳ£‰oXF1*+'&&%#"! );QlŒ¥ÀÓâääèéçççççççççççççççççèèèèèèèèççççççççææææææææææææææææåÚϺ™~cF0!.Dc„Ÿ·ÔãèêëëééééééééëëëëëëëëììììììììëëëëëëëëííììëêêéííííìììëëìëêçÚÀ©mO7##$&')**,--/1356:8:?EM[iqz„Œ”œš—–”‘ŽŒŠ‰ˆ‡…ƒ€~|{wvtromkjhgfca_]\XVTQOMLLGEBAA?=;:?Lau‰¬¾ÆÏÔÓÔØÜÜÝÞàááâáäääåæèéêçççèèèéééééèèèççèèèèèèèèåÙÁ dG2!1Tr‘°ÊÙåæäéæææççèèèèèèèèèèèèèèèèèèèèèèèèèèèèæåÒ«‰jM7*-JsµÑàâèéçëéééééêëëëìëåÝÔÍÊÙÜÞÞÜÜÞáááààááâãæåäãâãääâããããããâãäáÚÓɺ™o_LEFC=<;97644321/-+*)*)('%#"""!! !,=Qj‰¡¼ÏÞààäæãääääääääääääääääååååååååååååååååæææææææææææææææææÛлš€dH0".DbƒœµÑàåèéèèèèèèèèèééééééééééééééééççççççççëëêêéèççèèçççææææçæäàÒ¸¢…iP=( !"#$%&((*+-./001235788<=>@BCEEHHIKMPRSYUV\adhlosuux||xyxvtrponhgfda_^][ZYWTRPPMLKIGFDD>=;976551/---,*('0C\u¦¸ÊÓÝáßÞáåãäåæææææçæååæçèéççççææææèçççææææççççççççèÜÄ£ƒeH2 1Tr¯ÉØåæäéæææççèèèèèèèèèèèèèèèèèèèèèèèèèèèèæåÒ«‰jM7*-Jtž¸ÓâãèéæéêééééêëìêëêãÙÎÆÃÚÝßßÝÝßâáààààáâãçæäãâãäåâããääããâäåãÜÕζ§’‚uc]^[XWVTRPONMLJHECA@@@><:8764432100/..-,+*))&%%$$###&(1?Pfƒš±ÄÓÕÕÙÛØààààààààââââââââããããããããääääääääææææææææææææææææçÜѼ›eI1".Cbƒ™²ÎÞãæçæççççççççèèèèèèèèååååååååááááááááâááàßÞÝÝÙÙØØØ××××Ø×ÔÏÁ¨’hVI921*//01345599:<=?@AABDFHJLLLMNPSUVWXYZ\^`abddegjlopwrqw|{xwqqmfcd`[\\ZYXVUTPOMLJHFF@?><:8664321/.--('%$""!! )>ZtŽ¨¼ÒÜæêçäçêççèéêéééèçæååæèéëëêêééèèéééèèèèèèèèèéééééÞƦ†hK6 1Tr¯ÉØåæäéæææççèèèèèèèèèèèèèèèèèèèèèèèèèèèèæåÒ«‰jM7*.Ktž»ÖäåèèåèêééééêëìçèçßÓƽºÝÜÜÜÜÝÞßáÝÞãæäãååäãâáàààäåææääåæéåàÝÚÔÊÁ¬£”†|vrponmljihgca^^^^]\ZYXVTRPPNNNLKHFEFFDCA?>=>=;976557<EO[l}ˆž¯¾ÂÃÆÈÇÊÌÍÏÐÐÏÎÑÑÑÒÒÒÓÓÓÒÒÒÔÖØÚÜÛÚÙØ×ÖÖÙÚÚÚÛÛÛÜààßßÞÞÝÝÝØȱš‚fN4'.Gcv“¦¿ÒÚÜÜÝÛÛÚÚÚÙÙÙÜÝÝÜÜÚÙØ××ÖÖÕÔÓÓÑÑÐÐÏÎÎÍÊÊÉÉÈÇÇÆÅÄÃÂÁ¿¾¾¹º»ºµ©—‰zpbXOIGHJKLMNOPPTTTVWZ\]]^`beghiijjklmmmrssuwy{|}ƒƒ…‰Œ‘‘‘…zvj\UPIEFFFECBA@?:9864210,,+)(&%$##"!#8Vt‘¯ÄØàçæåçèççèèééèèçèèèèèèèèééééééééééééééééèèèèèèèèçàȦ†iJ1$ .Mt“°ÈÖãååëçææååææçççççççççççççççççèèèèèèèèèåãЪˆiM7)1NwŸ½×ääèéèëêêêêêêêêéæàÖɺ¦ÝÜÜÜÜÝÞßáÝÞãæäãåæåãâááááäåææäãåæçãàÞÝØÐÈ¿¶©•‹Š‰ˆ‡†…„ƒ}{z{{zyvutrpommkkjigecbaa`^\[YYZXVSQQQQPSX^ep|„Œš§ª«¯°¯°±³µ¶µµ´··¸¸¸¹¹¹»»¼¼¾¿ÁÂÄÃÃÂÁÁÀÀÃÃÄÄÄÅÅÅÉÉÈÈÈÈÈÇÅÀ´¡|dQ?3& "%$!$$$$$$$$%%%%%%%%%%%%%%%%###$$%%%$$%&''&&''((()))(),2?Rgu†–¬¼ÂÃÃÄÃÃÃÃÂÂÁÁÂÂÂÂÁÀ¿¾»»º¹¸¸··¶¶µ´³³²²¯¯®¬¬««¨¨§¦¤£¢¢Ÿ žš‘ƒxxtnjhfeeghijlmnorrstvxz{{|}‚„…††‡‡ˆ‰ŠŠ‹‘“•—˜š›žŸ¡¤§©¬®«£”„rdSH@844/.-,+*)(&%$"!"8Us‘®ÄØàçæåçèççèèééèèçèèèèèèèèééééééééééééééééèèèèèèèèçàɦ†jK1$ .Mt’°ÈÖâåäêçææååææçççççççççççççççççèèèèèèèèèåäЪˆiL7)1NwŸ½×ääèéèëêêêêêêêêìæÜͼ¬ ˜ÜÜÜÜÜÝÞÞàÝÝãåäãäæåäãââââãåæåäãäææãáááÞØÒÌ屫¨¦¥££¢¡ žžš˜–•–—–”‘ŽŒ‹Š‰‡‡†…„‚€~~|{yxwvwurommnolmmmmptw{„‘”•”•–—˜™™™™œœœžžž ¢£¤¥¥¥§§§§§§§§ªªªª««¬¬®®®®®¯¯¯ª§‘†zj]RH>9;==;::::::::::::::::;;;;;;;;9999:::;;<=>>>==>>>??@@@=@EKS^ip|‡—¢§§¦§¨¨¨§§¦¦¦¤¤¤¤£¢ Ÿœœ›š™™™˜˜—–••””‘‘Ž‰‰ˆ‡†„„ƒ„‚~xpkrtw{~‚‚„…†ˆŠ‹‘‘’“”–˜™™š›Ÿ¡¢£¤¤¤¥¦§§¨««¬®°²³µ¶¸¹¹»¾ÁÃÇÉÈõžŠr`J:.$ "7Us®ÃØàçæåçèççèèééèèçèèèèèèèèééééééééééééééééèèèèèèèèçàɧ‡kL2$.Ms‘¯ÇÖâäãéçææååææçççççççççççççççççèèèèèèèèèæäÑ«‰iL7)1NwŸ½×ääèéèëêêêêêêêêìãÔÁ®ž“ŽÜÜÛÛÜÜÝÞàÜÝâåãâäææåäãããäãäæåããäåçåäääâÝÚÑËľ»º¹¸µµ´³²±±°¯«ª«¬«ª¦¦¥¤£¢¡¡žžž›š˜——–•”“’‘Ž‹ˆ†‡ˆ‰†…‚~xsommquwxyz{}}~€ƒ„„„………†…†ˆŠ‹‹Š‰‹ŒŒŒŽŽ‘‘‘’’“““””••–’Žˆ|wpjd_YVWYYXTTTTTTTTUUUUUUUUUUUUUUUUUUUVVVWWXXYZZYYXYYYZ[[\\Z\`eiloqu{ƒ‰ŒŒŒŒŒŒŒŒ‹‹ŠŠ‡‡‡‡†…„ƒƒ‚‚€~}}|{zzyywvvutsssmmlkjjiijgffdabenv†•™™œž ¢¤¥¦©©ª«¬®¯°²²³µ¶·¸¹º»»¼½½¾¾ÁÁÁÁÂÄÅÆÈÊËËËÍÏÒ×ÙÚØÑÁ¦uaG3%!7TrÂØàçæåçèççèèééèèçèèèèèèèèééééééééééééééééèèèèèèèèèàʧˆlM4$.Ms¯ÇÖâäãèçææååææçççççççççççççççççèèèèèèèèèæåÒ¬‰jL7)1NwŸ½×ääèéèëêêêêêêêêéß̸¥˜‘ŽÜÛÛÛÛÜÝÞàÜÜâåãâãæåäãããääãäååãâäåèèçæåãàÞÚ×ÒÏÎÎÎÍÉÉÈÈÇÆÆÅÅÃÁÁÂÃÂÁ¾¾½½¼»»»¸¸¸¸·µ´³±°°¯¬¬«ª©¦¤¢£¤¥ ž™“‰}rka^\]^_`abbccdeffhhhiiijjijlnonmmooppqrrstttuuuvvvvwwxyyyyupnnnpqqqqqrssrrrrrrrrrssssssssssssssssuuuvvvwwwwxxxwwvwwxyz{{|z{}}zxonnopqqpooonnmmmkkkjjhgfgffedccb``_^^]\\ZZYYXWVVQQPPONNNOKIJIIQ[n{‰“Ÿ¬µ¶··¹º¼¾¿ÀÃÃÃÃÄÆÇÈËËÌÍÎÏÐÐÑÑÒÒÓÔÕÕÖÖÕÖÖ×ØÙÚÜÝÝÜÝàâåæåáÛË°˜ycG1! 6SqŽ¬ÂØàçæåçèççèèééèèçèèèèèèèèééééééééééééééééèèèèèèèèèáʨ‰mN5$-Ls¯È×ãåãèçææååææçççççççççççççççççèèèèèèèèçæåÓŠjL7)1NwŸ½×ääèéèëêêêêêêêêçÛÉ´£™”’ÛÛÚÚÛÜÝÝßÜÜáäâáãåäããããääâäåäãâãåèèèçæäâáâßÜÛÜÝÜÛØØØ××ÖÖÖ×ÕÓÓÔÕÕÔÑÑÑÑÑÑÑÐÏÏÏÏÎÌËÊÆÆÅÄÃÂÂÁ¿¿½¼»»»»´±«¢•„rgYQJIKJKLKKJKLMNOOOOPPPQQSTTUVVVUWXXYYZZZ[\\\]]]]^^^_____c^\_djs||ˆŽŒŒ‹‹‹‹‹‹‹‹ŒŒŒŒŒŒŒŒ‘‘‘‘‘‘Ž‘‘’”••––••“ˆ~xoh_ZYZYWVVVUUUTTSSSSRQPOMMLLKJJIGGFFEDCCBBA@??>>:::99888943556DTgzŽ®ÁÍÏÍÎÎÐÑÒÓÓÕÕÕÕÖØÙÚÝÝÝÞÞßßàßßàáââããããâââããääåææååçéèèæäßдœzdG0 5RpŽ«ÁØàçæåçèççèèééèèçèèèèèèèèééééééééééééééééèèèèèèèèèáÊ©‰nO6$-Lr¯ÉÙåæäéçææååææçççççççççççççççççèèèèèèèèçææÔ®‹jL7)1NwŸ½×ääèéèëêêêêêêêêçÜ˸© œÛÛÚÚÛÛÜÝßÛÜáäâáãããââââãäâãåäââãäææçæåääääâàáâãâáààààßßßßáßÝÝßààßÝÝÞÞÞÞÞÞÞÞÞÞÝÜÛÚ×××ÖÕÔÔÔÐÑÑÑÑÏÎÍÉļ°ŸˆqbPC768779776678:;9:::;;;;>>==>>?@BBBBBCCCDDDEEEFFGGGGGFFFKGGPZgw†‹•¢ª¬ª¨§¦¦¦¦¦¦¦¦¨¨¨¨¨¨¨¨§§§§§§§§©©©©ªª««©ªªªª©¨§ª«¬®¯°±°¯®«£”ƒxmaQFCB@=?>>>====<<<<;:9876654333332100//.--,+***(((('''&(##&&(9N`y”§»ÐÛÜÜÜÜÝÝÞÞÞßßßßàáâãäääåååååääååæççèçæååäååæåæææääæèæçæåáÒ´š|eH1 4Rp«ÀØàçæåçèççèèééèèçèèèèèèèèééééééééééééééééèèèèèèèèèáË©ŠoP7$-Kr‘±ËÚçèåéçææååææçççççççççççççççççèèèèèèèèçææÕ®‹jK7)1NwŸ½×ääèéèëêêêêêêêêæÞÑù³±°ÛÚÚÚÚÛÜÝßÛÜáäâáãââáááâããâãääââãäãäååååæççåäåæçæäçæææææååèæäåæççæææææççççèèèèçæåäææååäãããßàáââàÝÛÜÖ;ªtcC3&$&$$''&&%&(*+(()))***+*)((*+,........///0001133321100514@O_u‡™¥µ¿Á¿¼»¿¿¿¿¿¿¿¿ÁÁÁÁÁÁÁÁÀÀÀÀÀÀÀÀÀÀÀÁÁÁÂÂÁÂÂÂÁÀ¿¾ÂÃÄÅÇÈÉÉÇÇÆ·¤Ž~fWC4/,)&**)))(((''('&%$#$$##"! """! .Ebž³ÇÛäâååååææææææææçèéêééééééééæççèéêêêéèççææççåæçæääæèèéëëç×·›~hJ2!4RoªÀØàçæåçèççèèééèèçèèèèèèèèééééééééééééééééèèèèèèèèéá˪ŠoQ8$,Kr’±ÌÛèèåêçææååææçççççççççççççççççèèèèèèèèçæçÕ¯‹jK7)1NwŸ½×ääèéèëêêêêêêêêæà×ÎÇÄÄÅÙÙÙÚÛÝÞßÝÝÞßßßÞÞàáããâáãäááââãäåååååææçççèççææååäçæååççæååæçèèèèççççèèèééééééééééççççççççççæææåååçÞØÉ®–z\B+!!!!!!!!!!!!!!!!""""""""$%*5E[y‘žºÊÌÑÒÐÔÒÒÑÑÐÐÏÏÓÓÓÔÔÔÕÕÒÑÑÑÐÐÐÐÒÒÒÒÒÒÒÒÕÕÔÔÔÓÓÓÕÕÕÕÕÕÕÕÖØÖÐÅ°‘whR9*#)E^~š±ÍàäéçççççççççççèèééééééèèçççççççççççççççççççæææçççèèèæêêâÙ¿œ‚dI50Pnˆ¥½ÔÞæççéêèééééééééèèèèèèèèêêêêêêêêèèèèèèèèçççççççççÞÉ«nN7%,Lt¯ÊÙææãèæççèèççæççççççççèèèèèèèèèèèèèèèèèççÕ¯ŒlN9+0Tt¢¼×ääèêèìëëëëëëëëæãßÚÖÔÔÔ×××ØÙÛÜÝÜÜÝÝÞÞÝÝàáãâááâäããäååæççåååæææççççççææææçæååçèæååæçèèèèçèèèèééêêêêêêêêêêèèèèèèèèéééèèçççèßÙʯ–z[@)#1D^~—¬ÈØÚßàÞáááááàààààààáááââàßßßÞÞÞÝááááááááââáááàààââââââââßàÞØ͸˜}dM4$)D]~š°ÍàåéççççççççççèèèééééééèèèççççççççççççççççççççççèèééèæêêâÙÀƒeJ50Pm‡¥½ÕÞæççéêèééééééééèèèèèèèèêêêêêêêêèèèèèèèèçççççççççÞɬnN7%,Lt¯ÊÙææãèæççèèççæççççççççèèèèèèèèèèèèèèèèèççÕ¯lN9+0Tt£½×ääèêèìëëëëëëëëéæâÞÛÙØØÕÕÕÖ×ÙÚÛÛÛÛÜÜÝÝÝßáââáàâãããääåææçååååæææçæçççççèèèæåæçèçåææçèèèèèéééêêêëëììììììììééééééééìëëëêêêéêáÚË°–yZ?(.C^€™³ÏßáçèåèçççèèèèèææçççèèèçççææåååççççççççèèèçççææèèèèèèèèæèæàÔ¾‚aK0!(D]}™°ÍàåéçççççççççèèèééééééééèèèçççççççççççççççççèèèéééêêéæêêãÚŸ„fL6 /Om‡¥¾ÕßæççéêèééééééééèèèèèèèèêêêêêêêêèèèèèèèèçççççççççÞɬnN8%,Lt¯ÊÚæçãèççèèèèççççççççççèèèèèèèèèèèèèèèèèççÖ°mO9+1Uu¤½×åäèêèìëëëëëëëëëéæãàßßßÔÔÔÕÖØÙÚÛÛÛÛÜÝÞÞÞàááààáãààáâããääääåååææææææçèèééèçåæèèçææçèèééèèêêêëëìììëëëëëëëëëëëëëëëëììììëëëêëãÜͱ—yZ?(-A\}—³ÏàãèéæèåååæççèèææççèèèèèèèçççææååååååååèèèèççææèèèèèèèèèéèáÕ¾‚dM2!'C\|™°ÍßåéèèèèèèèèèèèéééêêêêéééèèèèèèèèèèèèèèèèèèèéééêêëëëéçëëäÜÄ¢†hM8!.Nl‡¦¿ÖàçèçéêèééééééééèèèèèèèèééééééééèèèèèèèèçççççççççÞʬnO8%,Lt°ÊÚæçäéççèééèççèèèèèèèèèèèèèèèèèèèèèèèèèèèÖ±nQ:,2Vv¥¾ØååéêèìëëëëëëëëìëéæäããâÔÔÔÔÖ×ÙÚÛÛÚÛÜÝßàÝßààßßàâàààáâããääääåååææåææççèèéèçææèéçææçèééééèêêëëììììëëëëëëëëììììììììììëëëêêêìäÞϳ™zZB*.B\}–µÒãæëëèêççèèéêêêééééêêêëëëëêêéééççççççççëêêêééééééééééééçéèâÖ¾œfN2!&B[{˜¯ÌßåéèèèèèèèèèèéééêêêêêêéééèèèèèèèèèèèèèèèèèèééêêëëëëêçëëäÝÇ¥‰kO9"-Mk†¦À×áèèçéêèééééééééèèèèèèèèééééééééèèèèèèèèççççççççèßÊŽoO9%,Lt°ËÚçèäéçèééééèçèèèèèèèèèèèèèèèèèèèèèèèèéèèײpR:,3Wx¦¿ÙæåéêèëëëëëëëëëëêéçåäããÓÓÓÓÕÖØÙÚÙÙÙÚÜÞàÝÞàßÞÞßááââãäååæãäääååååååæææææçéçæçèéèæççèéêêééêêêëëìììêêêêêêêêììììììììëëëëêêêéëäßѵ›|\D+.C^˜³ÐáåêêæèééééêêêêèèèéééêêêêêééèèèééééééééêêéééèèèèèèèèèèèçééäØÀžƒgN2%AZ{—¯Ìßåéééééééééééééêêêëëêêêéééééééééééééééééééééééêêëëëëèëëåßɨ‹mQ:#,Lj†¦ÀØáèéèééèééééééééèèèèèèèèèèèèèèèèèèèèèèèèççççççççèßÊŽoP9%,Lt‘±ËÛçèåéèèééééèèééééééééèèèèèèèèèèèèèèèèéèéس‘qS;-4Xy¨ÀÚçæéêèëëëëëëëëëêêèçåãááÐÐÑÑÓÔÖ××ÖÕÕ×ÙÜÞÜÞßßÞÝßàááâãääååããäääååååååååäääéèæçééèççèééêêéééêêêëëëëììììììììëëëëëëëëìììëëêêêêãßÒ·~^D+.B]~˜°ÍßãèèäåèèèçççççççççèèèéèèèççæææèèèèèèèèéèèèççççççççççççæééåÙ „hP2 %@Yz—®Ìßåééééééééééééêêêëëëëêêêéééééééééééééééééééèéééêêêêëèììæà˪nR;$,Ki†¦ÁÙâééèééèééééééééèèèèèèèèèèèèèèèèèèèèèèèèççççççççèßËpP9%,Lt‘±ËÛèèåêèééêêééèééééééééèèèèèèèèèèèèèèèèéèéس’rT;-4Yz©ÁÛçæêêèëëëëëëëëëêéèçäâàßÏÏÏÏÑÒÔÕÕÔÓÓÔ×ÚÜÜÝßÞÝÝßàßßààáâãããããääååååååäããââéèççééèççèéêêêêééééêêêëëííííííííëëëëëëëëíííììëëëêãßÒ¸ž_D+-@Z{”²ÐâæëëæçéééèççææêêêëëëììëëêêêéééééééééééììëëëêêêêêêêêêêêäçèäÙ „kR4!$@Yz–®ÌßåééééééééééééêêëëëëëëêêéééééééééééééééééééèèèéééêêìèììæáÌ«ŽoS<$+Ki†§ÁÙâééèééèééééééééèèèèèèèèèèèèèèèèèèèèèèèèççççççççéàËpP9%,Lt‘±ÌÛèèåêèééêêééèééééééééèèèèèèèèèèèèèèèèéééÙ´’rU;- 5Zz©ÁÛèæêêèëëëëëëëëëêêéçäáßÞËÌÎÏÑÒÒÒÐÑÒÓÕÖ×ØÛÛÛÛÛÜÜÜÝÝÞÞÞßßßããâââãäåææææææææççççççççèèèééêêêêêêëëìììêêêëëìììììììììììììììììììêãÞѶ_G,-A[{•±ÉßåæéëèéééèèçççèéêëëëëêêêêêêêêêêêêééèèèéééééééééééêêëëëêêèãÙÄ£‡nP6%#<Vx–ÉÝåìèèèèèèèèëêêééêêëêêêêêêêêêêêêêêêêêêêêêêêêéééêêëëëëèìíèâͬŽoS=%-Lj…¥¿×áéêéêêèééééééééééééééééèèèèèèèèéééèèçççèèèèèèèèäàÍqR9%+Jr“´ÏÝèçåëééééééééééééééééééééééééééééééééìéèÙ·–sR;- 4T¤ÈÖäèçéêëééééééééêéèåãàßÞÊËÌÎÏÐÐÐÑÑÒÓÔÕÖÖØØÙÙÙÚÚÚÜÝÝÝÞÞÞßãââââãääææææææææèèèèèèèèèèèééêêêêêêëëìììêêêëëìììììììììììììììììììëäàÓ¸ž€aH,+?Yz“±ÉßåæéëèéééèèçççèéêëëëëêêêêêêêêêêêêéééèèéééééééééééêêëëëììêåÜǦŠoP7%#;Uw”«ÈÜäëèèèèèèèèëêêééêêëêêêêêêêêêêêêêêêêêêêêêêêêéééêêëëëëèìíèãÍpT=%,Ki…¥¿×áéêéêêèééééééééééééééééèèèèèèèèéééèèçççèèèèèèèèäàήŽqR9%+Jr’³ÏÝèçåëééééééééééééééééééééééééééééééééëèèÙ·–tR<.#8Y…§ÊØåèçéêêééééééééêéçåãáßßÈÉËÌÍÎÎÎÑÑÒÒÓÓÔÔÕÖÖÖ××ØØÛÛÜÜÝÝÝÝáááááâãäååååååååèèèèèèèèèèèééêêêêêêëëìììêêêëëìììììììììììëëëëëëëëìåâÕ»¡ƒcI-)=Wx’°ÈÞåæêëèéééèèçççèéêëëëëêêêêêêêêêêêêêéééèééééééééééêêêêëëíîìçÞÊ©pR8&";Su“ªÇÛãêèèèèèèèèëêêééêêëêêêêêêêêêêêêêêêêêêêêêêêêéééêêëëëëèìíèãήqU>&+Jh„¥¿ÖàèééêêèééééééééééééééééèèèèèèèèéééèèçççèèèèèèèèåáήŽrS:%+Jr’³ÎÝèçåëééééééééééééééééééééééééééééééééêèèÙ¸—tS=. '=a‹«ÎÚåèçéêêééééééééééçæäâáàÆÇÉÊËËËËÐÐÑÑÑÑÑÑÔÔÔÕÖÖ××ÚÚÚÛÛÛÜÜàßßßàáâãääääååååééééééééèèèééêêêêêêëëìììêêêëëìììììììììììëëëëëëëëíçäؾ¤…eK/)<Vx‘®ÇÞåæêêçéééèèçççèéêëëëëêêêêêêêêêëëêêêéééêêêêêêêêêêêêêêêêíîìèßË«rS9'!:Su“ªÇÛäêééééééééëêêééêêëêêêêêêêêêêêêêêêêêêêêêêêêéééêêëëëìéììèãϯ’sV?&*Igƒ¤¿ÕßèéèêêèéééééééééééééééééééééééééééèèçççèèèèèèèèæâϯrS;&+Jr‘³ÎÝèèæìêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêéçèÛº™vT>0!#$)6Ns›¶ÓÝæèçéêééééééééééèçåäâáàÅÆÇÈÉÉÉÉÏÏÏÏÏÏÐÐÒÓÓÔÕÖ××ØØÙÙÙÚÚÚÞÞÞÞßàâãââããääååééééééééèèèééêêêêêêëëìììêêêëëìììììììììììëëëëëëëëîèåÚÀ¦‡fM0);Vx’ÆÝåçêêçéééèèçççèéêëëëëêêêêêêêêêëëëêêêééêêêêêêêêêêêêêêêêëìëçßË«tU:( 9Su“«ÈÝåìééééééééëêêééêêëêêêêêêêêêêêêêêêêêêêêêêêêéééêêëëëìéììçäб”uX@')Ge‚£¾ÔÞçèèêêèéééééééééééééééééééééééééééèèçççèèèèèèèèæãаsT<&+Jr‘²ÎÝèèæìêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêéèêݼ›xV@1"!#%(-2:>ESkŽ±ÇÙáçèèêêééééééééééèçåãáàßÅÆÇÈÈÈÈÈÌÌÍÍÎÎÏÏÐÑÒÓÔÕÖÖ××××ØØÙÙÜÜÜÝÞàáâááââãääåèèèèèèèèèèèééêêêêêêëëìììêêêëëìììììììììììììììììììíèæÛ§ˆgO2 (;Uw’«ÅÝåçêêæéééèèçççèéêëëëëêêêêêêêêêìëëëêêêêëëëëëëëëëëêêêêééêëêçß̬vW<)8Su“«ÉÝæíêêêêêêêêëêêééêêëêêêêêêêêêêêêêêêêêêêêêêêêéééêêëëëíéììçäѳ–vYA'(Fd£¾ÔÞæèèêêèééééééééééééééééêêêêêêêêéééèèçççèèèèèèèèçãѱ‘tU<'+Jr²ÍÝèèçíëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëêéëß¿ž{YA2# !%)/37=FLW]eqˆ¦ÂÑÞäèèèêêèéééééééééèæäáßÝÜÅÆÇÈÈÈÇÇÊÊËÌÍÎÏÏÎÎÏÐÑÓÔÔÕÖÖÖ×××ØÛÛÛÜÝßàáààáâãääåèèèèèèèèèèèééêêêêêêëëìììêêêëëìììììììììììíííííííííçæܨˆgP3!&8SvªÄÝåçêêæéééèèçççèéêëëëëêêêêêêêêêììëëëêêêëëëëëëëëëëëêêéééêëêçàÍ’wX=*7Qs‘ªÇÜåìêêêêêêêêëêêééêêëêêêêêêêêêêêêêêêêêêêêêêêêéééêêëëëíéììçåÒ´—xZB((Ec€£¾ÓÝæçèêêéééééééééééééééééêêêêêêêêéééèèçççèèèèèèèèèäѱ‘tV='+Jr±ÍÝèéçíëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëêíâ¡~\B3$"'-279AGNSX`ksy‰’¤½ÐØâçéçèêêèéééééééééèåâßÜÚÙÆÆÇÈÈÈÇÇÈÉÊËÍÎÏÐËÌÍÎÏÑÒÒÕÕÕÖÖÖ××ÚÚÛÛÝßàáßàááâãääççççççççèèèééêêêêêêëëìììêêêëëìììììììììììîîîîîîîîìçæÜèˆgQ3!$7Rt©ÃÝæçêêæéééèèçççèéêëëëëêêêêêêêêêìììëëêêêëëëëëëëëëëëêêéééêëëèáή“xY=*7Or¨ÆÛãëêêêêêêêêëêêééêêëêêêêêêêêêêêêêêêêêêêêêêêêéééêêëëëíéëëçåÓ´˜x[B('Db€¢¾ÓÝåçèêêéééééééééééééééééêêêêêêêêéééèèçççèèèèèèèèèäѱ‘uV='+Jr±ÍÝèéçíëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëîãÄ£]B4%!#$149@HPVZbhpv{ƒ˜˜ §®¼ÑßãäèêçèêêèéééééééééèåâÞÛØ×ÇÅÃÄÈÉÇÅÉÉÊËËÌÍÍÌÌÌÍÍÎÎÎÖÖÕÕÔÕÕÖÕ×ØØØÙÜÞÞßßàâããäåæææææççèèèééêêêêêêëëìììììììììììëëëëëëëëëëëììíííîçåÚÁ©ŒlS5#&8RsŒ¨¿ÙæèééèéééééééééêêëëêêéëëëëëëëëêêêêêêêêëëëëëëëëëëëëëëëëéêéæßÍ®“{\A,5NoŒ¥ÆÜåìëëëëëëëëëëëëëëëëëëëêêéééëëëêêééééééééééééééêêëëëíêíîêæÓ³˜x]H,&Ed ¹Íâèäéëçéèèèèèèèèèèèèèèèèééééééééêééèèééêéééèèçççéäѱ’uV<+,Kr¯ÐàæìîëëëëëëëëëëëëëëëëëììììììììììììììììííêàÊ¥{`J6%! "'-39=@JQZ`diqw€…•¥²·»ÃÌÔÜáãåææççèèèççèééèèçéçåáÜ×ÓÑÇÅÃÅÇÉÇÅÉÊÊËÌÌÍÍÌÌÍÍÍÎÎÎÒÒÑÐÐÑÑÒÖ×ØÙØÙÜÞÝÝßáâäææåååææææçèèèéééêêêêêëëëììììììììììëëëëëëëëëëëììíííîéçÝĬŽnS6#&8QrŒ§¿Øåèééèéééééééééêêëëêêéëëëëëëëëêêêêêêêêëëëëëëëëëëëëëëëëêëêçàί•|]B-5MnŒ¥ÅÜåìëëëëëëëëëëëëëëëëëëëêêéééëëêêêééééééééééééééêêêëëìéìîêçÔµ™y^H-&Ed ¹ÍâèäéëçéèèèèèèèèèèèèèèèèééééééééêééèèééêêêêéééèèéäѲ’vV=+,Kr°Ñàæëíëëëëëëëëëëëëëëëëëììììììììììììììììííëą̂€eF4''(&)19>DKQW^cmt}„‰Ž–¤©¯¶¼ÂÈÍÔÖÚÞâåæçææççèèèéèèéêêêêéêèãÞ×ÐËÈÆÄÄÅÇÈÇÅÊÊÊËÌÍÍÎÍÍÍÍÎÎÏÏÐÐÏÏÏÏÐÐÖ×ÙÙØÙÜÞÚÛÜÞáãåæäääååæææèèèèéééêêêêêëëëìììììììììëëëëëëëëëëëììíííîêêàȯpT6#%7PpŠ¦½×åèééééééééééééêêëëêêéëëëëëëëëêêêêêêêêëëëëëëëëëëëëëëëëëëëèâб—}^C.4Mm‹¤ÅÜåëëëëëëëëëëëëëëëëëëëëêêéééëêêêééééééééééééééééêêêëëèëíêèÕ·šz_I-&Dc€Ÿ¹ÍâèäéëçéèèèèèèèèèèèèèèèèééééééééêééèèééêëëëêêêééèåÓ³“vW>+ ,Kr’±Òáæëìéëëëëëëëëëëëëëëëëììììììììììììììììííìãά‡oPB9;?@FNT[elqy‚Š”š£ª¯µ¼ÂÇÊÏÓÖÙÞáåæçççææåççèèèéééççèéêêêééæáÛÓÍÈÅÅÄÄÅÆÆÆÆÉÊÊËÌÍÍÎÍÍÍÍÎÎÎÏÑÑÐÐÐÑÒÓÕ×ØØØÙÛÞØÙÚÜÞßááãããäååææççèèèéééééêêêëëëëëëëëëëëëëëëëëëëëëëììííííéêâʱ‘pV7$$5Nnˆ¤¼ÖäçééééééééééééêêëëêêéëëëëëëëëêêêêêêêêëëëëëëëëëëëëëëëëëìëéãÒ´™`D/3KlŠ£ÄÛäëëëëëëëëëëëëëëëëëëëëêêéééêêêéééèèèèèèèèèèèèéééêêêêçêìéè×¹œ|`J.&CbŸ¸ÍâèäéëçéèèèèèèèèèèèèèèèèééééééééêééèèééêëëêêééééèæÕµ•wX@, ,Jq“²ÓáæëìéììììììììììììììììíííííííííííííííííîíåѲ‘|kaZ[_bhopz†‘˜¤®´¹ÀÅÊÏÔØÛÝßàáâäçåååæåååäèèèèèéééååæçèçççåâÞØÓÎËÉÃÄÅÅÅÅÆÆÉÉÊÊËÌÌÍÌÌÌÍÍÍÎÎÑÐÐÐÑÒÓÓÔÕ×××ØÚÝÛÜÜÝÝÞÞßáââãäåææçççèèèéééééêêêëëëëëëëëëëëëëëëëëëëëëììíííëçèàÉ°‘pX9$#4Ll…¢ºÕãçèéééééééééééêêëëêêéëëëëëëëëêêêêêêêêëëëëëëëëëëëëëëëëëììêäÓµ›bF02Jk‰¢ÃÛäëëëëëëëëëëëëëëëëëëëëêêéééêêéééèèèèèèèèèèèèèèéééêêêæêëéèغž}aK.%Ba~ž¸Íâèäéëçéèèèèèèèèèèèèèèèèééééééééêééèèééêééééèèçççæ׸–xYB, +Jq”³ÓâæëìéììììììììììììììììííííííííííííííííîïîæÔº †€{|€„‹‘—¡¬²µ»ÆÏÑÔØÜÞáäææçéèçæçéççççèèééèèèèèèèèåææççæååàÞÚÕÐÍÊÉÂÄÅÅÄÄÅÇÇÈÈÉÊÊËËÊÊËËËÌÌÌÍÍÍÍÎÏÐÑÒÔÕÕÕÖØÛÞÞÞßßßßßààáâãäåææçççèèèèèéééêêêêêêêêêêêêëëëëëëëëëëëììíííêææÞÈ°’rY:%"2Kjƒ ¸ÓâæèêééééééééééêêëëêêéëëëëëëëëêêêêêêêêëëëëëëëëëëëëëëëëêëëêåÔ¶ƒdG11Hj‡¡ÃÚäëëëëëëëëëëëëëëëëëëëëêêéééééééèèèççççççççççèèèééééëçêëèèغ cL/%B`}ž¸ÍâèäéëçéèèèèèèèèèèèèèèèèééééééééêééèèééêééèèèçççæçÙº˜y[D-!+Ip“²ÓâçìíëííííííííííííííííîîîîîîîîîîîîîîîîíîîèÚǵ©žœš›Ÿ¦³½ÄËÏÑÕÝããäåçèééêéêëêèæçèëëéèèèèéèèçççæææççççæåãâÝÚÖÐÌÉÇÆÁÄÆÅÃÃÅÇÆÆÇÇÈÉÊÊÉÉÉÊÊÊËËËËËËÌÍÏÐÐÒÓÓÓÔ×ÙÛÛÜÜÝÞÞÞßßàâãäåæææçççèèèèèéééêêêêêêêêêêêëëëëëëëëëëëììíííëææÝÇ°“tZ;%"1IiŸ·ÒáæèêêéééééééééêêëëêêéëëëëëëëëêêêêêêêêëëëëëëëëëëëëëëëëéêêéäÔ·„eH10Hi‡¡ÂÚäêëëëëëëëëëëëëëëëëëëëêêééééééèèèççççççççççççèèèéééìèêêçç׺¡€dM/%A_|·ÍâèäéëçéèèèèèèèèèèèèèèèèééééééééêééèèééêêêéééèèèæçÚ»™y[E-!+Ip’±ÒâèíïìííííííííííííííííîîîîîîîîîîîîîîîîëííêâÖÌÆ»¼¼¼ÀÇÏÓØÚÞàáãæéèèèéêêéèçèééçæçèìêèæååååççææåååääääãáßÝÜØÖÒÎËÊÊÊÁÄÆÅÃÂÄÇÅÅÆÆÇÈÉÉÈÈÈÉÉÉÊÊËËËÌÍÎÏÐÏÑÒÒÒÓÕØÕÖ×ØÙÛÜÜÞßàáãäååæææççèèèèèèééêêêêêêêêêêêëëëëëëëëëëëììíííìçæÝÇ°•v[;%!1Hh€ž¶ÒàåèêêéééééééééêêëëêêéëëëëëëëëêêêêêêêêëëëëëëëëëëëëëëëëèéêéäÔ·…fI20Gh† ÂÚãêëëëëëëëëëëëëëëëëëëëêêééééééèèççççççççççççççèèéééíéêêççÖº¢dM/$A_|·ÍâèäéëçéèèèèèèèèèèèèèèèèééééééééêééèèééêëëëêêéééåèÛ¼™z\F-!+Ip‘±ÒâèîðíííííííííííííííííîîîîîîîîîîîîîîîîéëíìçáÛÙÕ××ÕØßåéèèèééêêëëêêëììëééêëëêéêììêèçæææçæææååääãààßÝÛÙÖÕÔÓÐÏÏÐÒÓÁÂÃÅÅÆÆÅÆÆÆÆÇÈÉÊÊÊÊÊÊÊÊÊÉÊËËÌÍÎÎÐÐÑÒÔÕÖ×Õ×ÙÛÜÛÙØÜÞàááâäæääåçççççèèèèèèèèêêêêêêêêéééêêëëëëëëëëëëëíèçÞÇ°“t[>'!0Giƒž·ÔãèêêéèèèèèèèèéééêêëëëêêêêêêêêêêêêêêêêêêêêêêêêëëëëëëëëêéíëáÕ¼š~hJ3!+Fc…¡¼Öæêëëëëëëëëìììëëêêêééééééééèèèèèèèèèèèèèèèèêééèèééêéçëëçæ×¼¡cM1%CbŸ¹ÒãéçëéåéèèèèèèèèééééééééèèèééêêêêêêêêêêêééééééééççÙ¼`H."!)Gn“±ÑáéïïêîîîïïðððïïïïïïïïííííííííîîîîîîîîîíìëéèææààáâãäååççèèééêêêëìííìëëìëëìíìêçèèçççæææåäãáßÝÜÛØ×ÖÔÒÐÏÎÏÏÏÐÑÓÔÕÀÁÃÄÅÅÅÅÅÅÅÆÆÈÉÊÉÉÊÊÊÊÊÊÉÉÊËÌÌÍÍÎÏÐÑÒÔÔÕÔÖØÛÜÛÚÙÛÝßàààâäãäåæççççèèèèèèèèêêêêêêêêéééêêëëëëëëëëëëëìççÞÇ°”u[>(!/Gh‚¶ÓãèêêéèèèèèèèèéééêêëëëêêêêêêêêêêêêêêêêêêêêêêêêëëëëëëëëêéíëáÖ½›hK3"+Eb… »Öæêëëëëëëëëìììëëêêêééééééééèèèèèèèèèèèèèèèèêééèèééêêçëëççؽ¡cM1%Ba~Ÿ¸ÒãéçëéåéèèèèèèèèééééééééèèèééêêêêêêêêêêêééééééééççÚ½ž€aH/#!+Iq‘±ÒãéîïëîîîïïðððïïïïïïïïííííííííîîîîîîîîîíìëêéèèåææçèéêêêêêëëìììííìììëëëëêéêìëéçéèæãáßÞÝÛÛÚÙØØ××ÓÒÑÏÍÌÊÊÏÐÑÒÔÖ×Ø¿ÀÁÃÃÄÄÃÅÅÅÅÆÇÈÉÈÈÉÉÊÊËËÉÉÊÊËÌÌÍÍÎÏÐÑÒÓÓÓÕ×ÚÛÛÛÛÚÜÞßÞßáââãåæççççèèèèèèèèêêêêêêêêéééêêëëëëëëëëëëëìççÞȱ•v\>(!.Fg¶ÓãèêêéèèèèèèèèéééêêëëëêêêêêêêêêêêêêêêêêêêêêêêêëëëëëëëëêéíëáÖ¾jL4"+DaƒŸºÕæêëëëëëëëëììëëëëêêééééééééèèèèèèèèèèèèèèèèêééèèééêêèëëèçÙ¾¢€cM1%B`~ž¸ÒãéçëéåêèèèèèèèèééééééééèèèééêêêêêêêêêêêééééééééçèÛ¿Ÿ‚bI0$(Go²ÕåêîïìîîîïïðððïïïïïïïïííííííííîîîîîîîîíííììëëëêêëëììííëëëëììììííëêêéêêëéèèééèæèæâÝÙÕÓÒÑÑÑÑÒÒÒÒÍÍÌÊÉÈÇÆÌÍÏÑÔÖØÙ¾¿ÀÁÂÃÂÂÄÄÄÄÅÆÈÈÇÈÈÉÊÊËËÊËËËÌÌÍÍÎÏÏÐÑÒÓÓÒÔÖØÚÛÜÜÛÝßßÞÞàâââäåççççèèèèèèèèéééééééééééêêëëëêêêêêêêêëæçÞȲ–w\?) -DeœµÒâçêêééééééééééééêêëëëêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêèìêá×ÀŸ‚kM5#+C`‚¸ÔåêëëëëëëëëëëëëëëëëêêêêêêêêééééééééééééééééêééèèééêëèëëèèÛÀ£dN2$A_}ž¸ÑãèçëéæêééééééééééééééééèèèééêêêêêêêêêêêêêêêêêêêèéÜÁ¢„dK1% +Jq•¶ÙçêíïíîîîïïðððïïïïïïïïííííííííííííííííííííííííëëëëëìììêêëëëëëëìëêéèèéêëéæåååäâãàÜÖÑÎËÊÍÍÍÍÍÎÎÎÉÉÈÇÆÅÄÄÆÈÊÍÐÓÔÕ¾¿ÀÁÂÂÂÂÃÃÃÃÄÅÇÇÇÈÈÉÉÊÊÊÌÌÌÌÍÍÍÍÐÐÐÑÒÒÓÓÓÔÕ×ÙÛÜÜÝÞààßßáâáâãåæçççèèèèèèèèéééééééééééêêëëëêêêêêêêêëææßɳ—y^@*,Cc}›´ÑâçéêêéééééééééééêêëëëêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêèìêáØÁ¡„mO6#+B^€›¶ÓåêëëëëëëëëëëëëëëëëêêêêêêêêééééééééééééééééêééèèééêìéììèéÜÂ¥ƒfP4 $@^|¸ÑâèçëêæëééééééééééééééééèèèééêêêêêêêêêêêêêêêêêêêèéÞä†fM3&!&$(3@^„¢ÀÞèêíïîîîîïïðððïïïïïïïïííííííííííííííííííííîîîîììëëëëëëìììììëëëëëêéééééçäßÝÜÜÛÚÚØÓÏËÉÈÇÉÉÉÉÈÈÈÈÄÄÃÃÂÂÁÁÄÆÉÌÐÒÓÔ¾¿ÀÁÂÂÂÂÃÂÂÃÃÅÆÇÉÉÉÈÈÈÈÈÌÌÌÌÌÌÌÌÐÑÑÑÒÒÓÓÔÔÕ×ØÚÛÛÝßààßßàâàáãäæççèèèèèèèèèèèèèèèèèéééêêëëëééééééééêåæßÊ´™z^A*+Aa{š³ÑáçéêêêêêêêêêêéééêêëëëêêêêêêêêêêêêêêêêêêêêêêêêéééééééééèëêáÙã†oP7$+A]~™µÒäêëëëëëëëëêêëëëëììëëëëëëëëêêêêêêêêêêêêêêêêêééèèééêíéììéêÞĨ†iR6"$?]{œ·ÐâèçëêçëêêêêêêêêééééééééèèèééêêêêêêêêêêêëëëëëëëëèêàŦˆgN4'"$&'/69AO]y¶ÍâèêîðíîîîïïðððïïïïïïïïííííííííììììììììííííííííîîîíììëëîííííìììéééèæäâáÙÕÐÎÎÏÐÐÐÎÊÇÄÄÅÅÃÃÃÂÂÂÂÂÁÁÀÀÀÀÀÀÇÉÌÐÓÕÖÖ¿¿ÁÂÃÃÃÃÂÂÂÂÃÄÅÆÊÊÉÈÈÇÇÆÊÊÊÊÊÊÊÊÏÐÐÐÑÑÑÑÕÕÖÖ×ØÙÚÜÞßßÞÝßàßàâäæççèèèèèèèèèèèèèèèèèéééêêëëëéééééééééåæßʵš{_B++@`z™³ÐáçéêêêêêêêêêêéééêêëëëêêêêêêêêêêêêêêêêêêêêêêêêéééééééééçëéáÙĤˆpQ7$+@\}˜´ÑäêëëëëëëëëêêêëëìììëëëëëëëëêêêêêêêêêêêêêêêêêééèèééêíêììéëßŪˆkT8$$>\zœ·ÐáèçëêçìêêêêêêêêééééééééèèèééêêêêêêêêêêêëëëëëëëëéëáƨŠiO5(#')*-17=BFIQX]ft–¶ÊÚçèéïðìîîîïïðððïïïïïïïïííííííííììììììììííííììììïïîíìëëêëëêêéééèããâàÝ×ÒÏÅÁ½»½ÁÄÅÇÅ¿¾¿Á½½¾¾¿ÀÁÁÃÃÃÃÃÃÄÄÊÌÐÔÖØØ׿ÀÁÂÃÄÄÃÂÁÁÂÃÄÅÆËËÊÉÇÆÅÅÈÈÈÈÈÈÇÇÎÎÏÏÏÏÏÐÖÖÖÖÖØÙÙÛÝÞÞÜÜÝßßàâäæççèèèèèèèèèèèèèèèèèéééêêëëëéééééééééåæßʵš|_B+*@_y™²ÐáçéêêêêêêêêêêéééêêëëëêêêêêêêêêêêêêêêêêêêêêêêêéééééééééçëéáÚÅ¥ˆqR8$+@[|—³ÐäêëëëëëëëëêêêëëìììëëëëëëëëêêêêêêêêêêêêêêêêêééèèééêîêììéëßƬŠmV9%#>\zœ·ÐáççìêçìêêêêêêêêééééééééèèèééêêêêêêêêêêêëëëëëëëëéëáÇ©ŠiP6(''),17<?EHOV_gmpv~‚Š•›Ê×âéçéïðìîîîïïðððïïïïïïïïííííííííììììììììíííììëëëîíìëêéèèææååääããÛÜÛØÒʾµ²®®²·¼¾ÂÀ½ºº»½¿º»¼¾ÀÁÃÄÈÈÈÈÉÉÉÉËÍÑÔ×Ø××ÁÁÁÁÁÁÁÁÅÄÃÂÃÄÆÇÈÈÈÈÈÈÈÈÇÈÉÈÇÇÈËÍÍÌÌÍÐÓÖÓÔÕÖ×ÖÕÔØÙÛÝßàááÝÞáãååääçççèèéééêéçææçéêéééééééééééééééééääÞ̹žbD- +>Xw•¯ÎàçêëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëêêêêêêêêêéèèêêéèéçëéàÙÄ¥ŒoT<#$<Z›µÐãéêêêëëììììììììììììììëëêêêëëëêêéééêêêêêêêêêêêêêêêêëêîíçèßɯoX;&">\{¹ÑâéèìëèíëëëëëëëëééééééééêêêêêêêêëëëëëëëëëëëëëëëëæçßÈ©‰jU9* %),048;?EKPU[_cjsy}ƒŒ“™ž¤©°½ÍÙåçéìîïðñïððññððïñññððïïïîîîîîïðñïîëééëîðïíììíîìëêêëëëêêéåâßÜÚØÕÓÌËÉÈŽ³«¤£¢£§¬²µµ·¹¹¸·¸¹»»¼¿ÃÆÈÉÌÍÌÊÈÈÊÌÍÏÓÕ××ÖÕÀÀÀÀÀÀÀÀÃÃÃÃÃÄÅÅÇÇÇÇÇÇÇÇÆÇÈÈÇÇÉËÎÍÌÌÍÐÒÔÓÔÕÖÖÖÕÔØÙÛÝÞààààáâäåååæçççèèèééééççççééééééééééééééééééêåäÞ̹~cE- +=Xw”¯ÎàçêëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëêêêêêêêêêéèèêëéèéçëéáÚƧpU=$$;Y}™³ÏâèêêëëëììììììììììììììëëëêêëëëêêêééêêêêêêêêêêêêêêêêëêîíçéàÊ°ŽpY;&"=\z¹ÑâéèìëèíëëëëëëëëééééééééêêêêêêêêëëëëëëëëëëëëëëëëëìäÍ®mX<. "%&*.158=AEINQ\`flrw~‚‡–œ ¦®µº¿ÅÉÍÓÝåèéëíîïððïððññððïðïïïïïïïïîîîîîîïñðíëëëìíïîíîïîìêççåãàßÝÜÚ×ÓÐÍÊÇÅÈÇĽµª£œ›š›Ÿ¦²³¶¹ººº»¼¼½¾ÂÆÉÌÌÏÏÎËÉÉËÍÏÑÔÖØØ×Ö¿¿¿¿¿¿¿¿ÁÂÃÄÄÄÄÄÅÅÅÅÅÅÅÅÅÆÇÇÇÇÊÌÏÎÍÍÍÏÐÒÒÓÔÕÖÖÕÕ×ÙÚÜÞßßßâáááâãääççççèèèééèèççèèéééééééééééééééééìææß̹~dF.!*=Wv”®ÍßçêëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëêêêêêêêêëéèéêëêèéçëéáÛÈ©qV>%$9X{—²Îáèêëëëììììììììììììììììëëëêëëëëêêêéêêêêêêêêêêêêêêêêëêîíèêâ̲rZ<'"=[z¸ÑâéèìëèíëëëëëëëëééééééééêêêêêêêêëëëëëëëëëëëëëëëëêìãÍ®ŒmX?1$ "#%(-159=BHLVZ_dinsw…‹‘–œ¢¦²¹¾ÂÇÏÔ×ÜáãããæéëìíîïïïïïïððððïïîîîîïïïïññðððððïîîîíììììíììììêæâÞÜØÓÏÍËÊÉÈÆÄÁ¿½¼ÅÃÀ¼µ¬¡š”“’”š£«±³¶º¼½½¿À¾¿ÃÇËÎÐÒÓÓÑÍÊÉËÎÑÓÕØÙØ×Ö¾¾¾¾¾¾¾¾ÀÁÃÄÄÄÃÂÅÅÅÅÅÅÅÅÃÅÆÆÆÈÊÍÐÏÎÍÍÎÎÏÒÓÓÔÕÕÖÖ×ØÚÜÝÞÞÞàßÞÝÝÞàáææçççèèèèèèèèèèèééééééééééééééééíççà͹ž~eG/!*<Wu“ÌßæêëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëêèéëëêéêçëéâÝʬ‘tX@&$:W{–±Îâéëëëìììííííííííííííìììëëëììëëëêêêëëëëëëëëëëëëëëëëëêîíèëäδ’t\>("<Zyœ¸Ñâéèìëèíëëëëëëëëêêêêêêêêëëëëëëëëììììììììììììììììéëãΰ‘s_J>548<@EMPTY]bhlvz€‡Œ“™¡¥«°µºÀÄÉÍÑÕ×ÚßãäçêëéèèèîïïððïïîîïððððïîîîîïïïððîïïïïïïîêëìííìëêååäãâÝ×ÒÍËƾ¼¼¼¼½¿¿¿¾¿Àľ¸°¦—’’‘”›¥¯µ¶¹½ÀÀÀÀÁ¿ÃÈÍÐÓÕ×ØÖÔÏÌËÍÏÓÕ×ÙÚÙ×Ö¾¾¾¾¾¾¾¾¿ÀÂÃÄÃÂÁÅÅÅÅÅÅÅÅÃÄÆÆÆÇÊÌÏÏÎÍÍÍÍÍÒÒÒÓÔÕÖÖ×ØÙÛÜÝÝÝàßÞÝÝÞàáæææçççèèèèèèèèèèééééééééééééééééíççáκŸ€gH0");Vt’¬ÌÞæêëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëêééëìêéêçëêãßÍ°”v[B($;X{—²ÏäëëëìììííííííííííííííìììëëìììëëëêêëëëëëëëëëëëëëëëëëêîíèìæÑ·•v^?)!;Yx›¸ÑâéèìëèíëëëëëëëëêêêêêêêêëëëëëëëëìììììììììììììììììîçÔ» ‡vd[TUY]ciorw|‡’–š¡§´º¿ÂÅÊÎÑÖÚÞàáãååæèêëìííììíïðððððïîíîîïððïîîïïïïïðððëììíííìëëìììêçäãÙØÖÔÑÌÅ¿»¹¶³²³´µ¸»¿À¿¿ÁÃÁ¿»´¬£œ˜”””˜Ÿ©³¹¼¿ÃÄÃÁÀÀÀÆÍÒÔÖØÙÚÙÕÐÌÌÎÑÔÖØÚÚÙ×Õ¾¾¾¾¾¾¾¾¿ÀÁÁÂÂÁÁÅÅÅÅÅÅÅÅÃÅÆÆÅÆÉËÎÎÎÎÍÍÍÍÑÑÑÒÓÕÖ××ØÙÚÛÛÛÛààààáâããåæææçççççèèééèèçééééééééééééééééíççáϼ¡‚hJ1#);Ut‘¬ËÞæêëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëìììììììììêéêëìëéêçëêäáг—y]D)$;X{–±ÏäìììììíííîîîîîîîîîîíííììììíìììëëëëìììììììììììììììììêîíéíçÓº—y`@* !:Xw›·ÑâéèìëèíëëëëëëëëëëëëëëëëììììììììííííííííííííííííêìçØÄ°€yuvy{€…ŠŽ“™Ÿ¦²¸¼ÁÆÊÏÕØÙÜßáãåèëëëëëëëëëíììëìîðòðððððïîíîîïïïïîîððïïîîííîïïïîìêéèçæãÞÚÕÓËÉÇÅþ¹´±°¯®®¯°±·»¿À½¼½¿¼»¸²©¢žœ˜˜šž¥®¶»ÁÄÇÈÅÂÀ¿ÁÈÐÕÖÖØÚÛÚÖÑÍÍÐÓÕ×ØÚÙØÖÔ¿¿¿¿¿¿¿¿ÀÀ¿¿ÀÁÁÂÃÃÃÃÃÃÃÃÄÆÆÆÅÅÇÊÌÍÍÎÎÎÍÍÑÑÑÑÒÔÖØ××ÙÚÚÛÛÚÞßàâãäääååæææçççççééééççééééééééééééééééìæçáн£„iK2#):Ts«ËÞæêëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëìììììììììëéêììëêêçëêåâÒ¶™{^E*$:Wy”°ÎäììììíííîîîîîîîîîîîîíííìììííìììëëëìììììììììììììììììêîíéîéÕ¼™zaB+ !9Wvš·ÑâéèìëèíëëëëëëëëëëëëëëëëììììììììííííííííííííííííèëèÛÍ¿²¨˜–šœ¡¦«¯´¹¾ÃÊÎ×ÙÜÞßáäæäæèéèéêìììëëììëëíìëìíîîîîïïïïîíííîîïïîîíïîîíëêêéìììêæáÝÛÕÔÒÎÊÆÃÁÀ¾¼¼»º¶´±±±°¯¯¯¯²·½½º¹º½»»¹³¬§¥¦žŸ¢¦¬³º½ÃÆÊÊÈÄÁÀÁÉÓ××Ö×ÙÛÙÕÐÍÍÑÔÕ×ØÙÙ×ÔÓ¿¿¿¿¿¿¿¿ÁÀ¿¾¾ÀÁÃÂÂÂÂÂÂÂÂÅÆÇÆÄÅÆÈËÌÍÎÎÎÎÍÑÑÐÑÒÔ×ØÖ×ØÙÚÚÚÚÛÜßáâãââåååææçççæçéêêéçæééééééééééééééééëåæájK2#(:Ts«ÊÝåêëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëëìììììììììëêêììëêêçëêåãÓ·š|_F*$8Ux“®ÌãëìììííîîîîîîîîîîîîîîííìììíííììëëëìììììììììììììììììêîíéïêÖ½š{bB+ !9Vvš·ÑâéèìëèíëëëëëëëëëëëëëëëëììììììììíííííííííííííííííðíãØÏŽµ²²¸¼¾ÂÇÎÑÔ×ÙÝáåèêëêéèéëëìíìëêëìíììíîïïîñðððñðîìíîîïïîíííîîïïîîíîíìëéçææáàÞÛÕÏÉÅ¿¿½»¹¸·¶º¸·¸¹º¹¸¶¶µ´²°®¬¬²¹»º¹¼¿¼½¼·±®¤¥©®³¹¾ÀÃÆÊËÉÆÃÂÁÊÔØ×ÕÖ×ÛÙÕÐÍÍÑÕÕÖØÙØÖÓÒÂÂÁÀÀ¿¾¾¾¾¾¿¿ÀÀÀÂÁÁÀÀÁÁÂÃÄÅÆÇÈÈÈÉÉÉÊËÍÎÏÑÍÎÔÕÒÓ××ØÙÚÛÜÜÝÛÜÝÞßßßßâãäæèèééçççèèéééééééééééèèèèèèèèéææàÒŬŠmO6&):Tr¬ÆÙéëèìëëëëëëëëììììììììììììììììììììììììììììììììëëëëëëëëëéîíæäÕº }^G,"6Rv–²Íáëííîîîïïïííííííííîîîííìììììììììììììììììììííííííííêìííîîæݼ™zcE.!#9Uw›¶ÑßìïííîíììììììììììììììììíííììëëëììììììììííííííííëëìêåßØÔÊËÌÏÓ×ÜÞââãäåæççëëëëëëëëííîîïîîíîîïïïïîîíîîîîíìëñðïïðïìêííìíîíêèìèäââàÛØÐÍÉÄ¿»¹·µ±¯²²²´¹·¹»»¹¸¹º½»·´±±±²±³µµ´¶º¾¿Á¿º¶¶³®«¬¯µ¼ÀÁÊËÍÍËÇÃÀÃÉÒØÚÚÙØ×ÖÔÎÉÈÌÑÒÔÔÑÐÏÊÃÂÂÁÀÀ¿¾¾¾¾¾¿¿¿ÀÀÃÃÂÂÂÃÄÄÃÃÅÆÇÇÇÇÈÈÉÉÊÌÎÏÏÌÍÒÓÐÑÖ××ØÙÚÛÜÝÛÜÝÞÞÞÞÞâãäæçèèèçççèèéééééééééééèèèèèèèèéååßÑÅ«ŠnP6&):SqŒ«ÆÙéìéìëëëëëëëëììììììììììììììììììììììììììììììììëëëëëëëëëêîíæäÖ¼£aI."6Qv–²ÌáìííííîîîïííííííííîîîííìììììììììììììììììììííííííííëíííîîçÞÁ~fH0#$:Vxœ¶ÒàìîììíìììììììììììììììììíííììëëëììììììììííííííííëëìëèäàÝßßßàâåèêèèééêëììììììììììíîïðññññîîîîîíìëññññðïíìñðïðññïíîìêéèåáÞÝÙÔÐÎÊÅÁº¹·´²°¯¯®«¬±´´·¼¾ÀÂÂÀ¿ÀÁ¾½»¹¸··¸¸¹¸µ³³·»¼¿¿»¸¸µ°°°°´ºÁÆÈËÌÍÌÊÇÃÀÃÉÑ×ÙØ×Ö×ÕÑÍÉÉÌÎÐÑÍÈÆƼÂÂÁÀÀ¿¾¾¾¾¾¾¿¿¿ÀÂÁÁÁÂÃÄÅÂÃÄÅÆÆÆÆÇÇÈÈÊËÍÎÍËÌÐÑÏÐÓÕÖ×ØÙÛÜÜÜÜÝÞÞÞÞÝâãäæçèèèçççèèéééééééééééèèèèèèèèèäåßÑÅ«ŠoQ7')9Rp‹«ÆÙéìéìëëëëëëëëììììììììììììììììììììììììììììììììëëëëëëëëëêîíçåؾ¥‚dL1 "5Qu•±ÌáììììííîîîííííííííîîîîííííííííííííííííííííííííííííìîîíîîèßǤ„kK2$#:WxœµÕáëíëììëììììììììììììììììíííììëëëììììììììííííííííëëìììëêéëëêêêêëììììíîïïïííííííííððñññðïïððððïîííðððððïîîðïîîïîìéåâßÛØÓÎÊÄÁ½º·´°ª©©©©ª«««ª´¸¸º¾ÀÁÂÂÀ¿ÀÂÁÁÂÂÂÁÀÀÁ¿ºµ±°´·¸½¿½¼¼¹³³²²¶½ÄÈÊÉÊËÊÈÅÁ¿ÄÉÐÕÖÔÓÓÓÏÊÇÆÆÇÇÈÇý»½¼·ÂÂÁÀÀ¿¾¾½½¾¾¾¿¿¿¾¾¾¾¿ÀÁÂÁÂÃÄÅÅÄÄÆÆÇÇÈÊÌÍÌÌÍÏÐÐÑÒÔÔÕ×ØÚÛÛÝÝÞßßßßßâãäæçççççççèèéééééééééééééééééééèäåßÑŬŠqS9((8QoŠªÆÚêíéìììììììììííííííííííííííííííííííííííííííííìììììììììêîíèçÚÀ§„fO3!"5Pt“°ËáìììììííîîîîîîîîîîîîîîîîîíîîîîîîîîîîîîîîîîîîîîîîîîíïîíîïéàͨˆnM4%"#.Ec„¥¼ØâëëêëëêììììììììììììììììíííììëëëììììììììííííííííììììíîïïììëêéééèìììííîîïîîîîîîîîòòñðïíëêîîïïïïîíëìííîíííëéçåãàÜÙÑÍÉÄÀ»¶²¬«««««ªªªªª«¬®°¯³º½¼¼¿ÁÂÃÁÀ¿ÀÂÇÉÊËËÊÈÇÇ»³¯¯²µ·¼¿¿¿¿¼¶²±±³¹¿ÃÄÆÆÆÅÃÀ½»ÂÇÍÑÑÏÎÍËÆÀ¾¿¿¾¼¼½»¸¸¼º¶ÂÂÁÀÀ¿¾¾½½½¾¾¾¿¿¾¾½½¾¿ÀÁÁÁÂÃÃÃÃÂÅÅÅÆÇÉÊËÌÍÎÎÏÑÒÒÒÓÔÕ×ÙÚÛÝÞßàááááâãäåææææçççèèéééééééééééééééééééèäåßÒÆŒsT:)'7Pm‰©ÆÚëíéìììììììììííííííííííííííííííííííííííííííííììììììììíëïîéèÜè†hP4!"4Or’®ÊáíìììííîîîîîîîîîîîîîîîîîîïîîîîîîîîîîîîîîîîîîîîîîîîîðïíïðêáЫ‹pO4% "#$'*.135;<G^|š·ËÝåëëêëìêììììììììììììììììíííììëëëììììììììííííííííîííììíïïíííííííìììíííîîîîîîîîîîîññññðïííëìííîííìíííìêèæåßÜØÔÐËÅÁº·²®«§£ Ÿ ¢¥§©«¯®¬¬²²¶¾ÂÀÀÃÊËÊÉÇÆÈÊÏÐÒÓÒÐÍËÉú³°°³µ¸½ÀÀ¿À¼¶°¯®¯´¹¼½ÀÀ¿¾¼º·µ¾ÃÈÊÊÈÇÇÄ¿º¸¹º¸µ¶¹¹¸¹»·±ÂÂÁÀÀ¿¾¾¼½½½¾¾¾¾ÁÀÀ¿¿ÀÀÁÀÁÁÂÂÂÁÁÄÄÄÅÆÈÉÊËÎÏÍÎÒÓÑÐÑÒÔÖØÙÚÛÜÞàáâããâãäåååååçççèèéééééééééééêêêêêêêêéåæáÔȯŽuV<*'6Nlˆ©ÆÛëîéìííííííííîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîíííííííííëïîéêßƪˆjR6""3NqÊáíííîîîïïïïïïïïïïïîîîîïïïïïïïïïïïïïïïïïïïïïïïïïïïïðñïíïðëãÒ®ŒrP6&#%)+,.24:<?DIMQS[\f|–¯ÆÕâèìëêììêììììììììììììììììíííììëëëììììììììííííííííîîíììíííìíîïððïïîîïïïïïïîîîîîîîîíîïðñòòñîïïîîìëêëêèäßÚÖÔÌÈÄÀ¼·±ª§£ žœš—™œŸ¢¤¦ª¬®®¬««««²²¸ÁÆÆÇËÐÐÏÍËÊÌÎÓÔÖ×ÖÔÒÐËżµ³µ¶·º¾À½»»·²«ª¬°´·¸»º¹¸¶´±°¸¼ÁÃÃÁÁÁÀ½¹·¶µ´³¶¸¸¶µµ¯¨ÂÂÁÀÀ¿¾¾¼¼½½½¾¾¾ÂÁÀ¿¾¾¾¾ÀÀÁÁÁÁÀ¿ÃÃÃÄÅÇÈÉÈÍÎËÌÑÒÏÏÐÑÓÕ×ÙÚ×ØÛÝàâããâãäååååäçççèèéééééééééééêêêêêêêêêçèâÕʱvW=*&5Mk‡¨ÆÛìîéìííííííííîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîííííííííîìïîêëàÈ‹mU8$"3Mp¬ÉáíîîïïððððïïïïïïïïîîîïïðððððððððððððððððððïïïïïïïïññðíïðëäÔ°ŽtR8( #%&()+.1467?BFILPTW]_chmquw€€ˆ›±ÄÔßæëíëëííëììììììììììììììììíííììëëëììììììììííííííííííîîííííêëíîïîîíïïïïïîîîííííííííììííííììêêèæãàÝÛÖÔÑÍȾ¼¶³±¯®«§¤¡žš˜—–•“•™ ¢¥ª®°¯¯°±²³´»º¿ÇÌÍÏÓÑÑÐÍÊÊÍÏÓÔÖ×××ÖÕÐÉÀº¹ººº»¾½¸µ´°ª¥¤£¦«±´¶¸·¶´²°®²¶º½¼»»¼º¹¸µ²°°±²³±¬©£ÂÂÁÀÀ¿¾¾¼¼¼½½¾¾¾ÁÀ¾½»»»»¿ÀÀÁÁÀ¿¿ÃÃÃÃÅÆÈÉÇËÌÉÊÐÑÍÎÏÑÓÕ×ÙÙÓÕØÛÞàâãããäåååääçççèèéééééééééééêêêêêêêêëçèãÖ˲‘wX=+&5Mj‡¨ÆÛìîêìííííííííîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîîííííííííîìïîêìáʯoX;&"2LoŽ¬ÉáíïïðððñññïïïïïïïïîîîïïðððððððððððððððððððïïïïïïïïñòðîïñìäÕ±uT:* !"#$%,-/158;=ACFKPTXZ_chlosx|€…‰Ž’•— Ÿ¦·ÉØãëéíîììîîëììììììììììììììììíííììëëëììììììììííííííííìíîïïïîîìíîïïïííííííííììíííííííííìëêçäâàÝÛÙÕÐËÆÄ»º¸¶²®«©§¦¥¦§§¥£š–““’‘‘–œ £§²´µ¶¸»¾ÀÂÇÆÈÏÒÑÓ×ÔÔÒÏÍÍÏÒÒÓÔÖØÙÙÙÔÍÄ¿½½¼»¼½»´¯®ª¥œ §²´·¶´²°®¬¯²¶¹¹¸¸¹´¶¶²ª¬®¬¬©¤¥¨§£¿¿¿¿¿¿¿¿¾¾¾½½¼¼¼ÀÀÀÀ¾½»º¾¾¾¿ÀÂÃÄ¿ÄÄÀÁÇÇÃÉÊËÌËÌÏÑÑÒÒÔÕÖ××Ö×ÙÛÝßáâàáâãåæèèççççççççêêêêêêêêêêêêêêêêíæçåÙÌ´—yZ?,'1Ij‰¤ÄÚæìîìîîîîîîîîîîîîîîîîîîîîîîîîïïïïïïïïîîîîîîîîííííííííëëïïêëãͯpX;%0JmªÈàííîïððððïïððññððïððððððððñððïïððññññññññññððïïððñóñðððïìéÚ»˜}aB.( "$&'(+-01369=ACHKOSVY^abeimptx{„†‰Ž“˜œ£¤¦ª±³µ¼ÀÇÐÙáæéêêëíííííííííííííííííííííííìììëëëìììììíîïðïîíììììííîîîîííìííííîîîìëëìííìêìíïðïíëéããâßÛÕÏÌÇÅÀ»·´²±©©¨¨§¦¦¥¨¨¨¨§¦¥¤Ÿ—‘”˜ž£©®´¸ÀÁÂÄÆÆÇÇÌÏÑÓÒÓÔÖ×ÕÑÎÍÎÏÑÑÓÕ×ØØØ×ÓÑÌļ¹»¾Á¿»·²«£ž–˜œ¢¨²´µ²²´³®¯°±³µµµ´´²±®©¥¤§©§©ª¨¥¥§ªÀÀÀÀÀÀÀÁ»¼¼½½¾¾¿¿¿¿¿¾½¼»½½½½¾¿ÀÁ¿ÃÃÀÁÆÆÃÈÉËËËÌÎÑÐÑÒÓÔÕÖ×××ÙÛÜÞààààáãåæçèççççççççêêêêêêêêêêêêêêêêíæçåÚ͵˜|]B/'1IjŠ¥ÆÝèïðïîîîîîîîîîîîîîîîîîîîîîîîîííííííííîîîîîîîîííííííííëëïïêìãͳrZ<'0JnŽ¬ËäñíîïððððïïððññððïððððððððñððïïððññññññññññððïïððñóñðððïìêÛ¾ž‡nR?:69<>?AEGOPSVZ_cehkpsvz~„‡Œ“˜œ §©¬°´¸»½ÃÄÆÉÌÏÑÒÕ×ÛàåéìíêëìíííííííííííííííííííííîîîíííììííìëëëëìííìëëëëìêëìííííìîîîîïïïðïîìììëéçææåãßÜØÖÐÎÊÆÀ¼¸¶³±¯¬©¨§§¦¦¦¥¥¥¥¤©ªªªª¨¦¥–ŽŒ•š¢ª±¸¿ÃÉÊËÌÍÎÍÍÎÐÓÔÔÔÕ×ØÖÒÏÎÏÐÒÒÔÖØÙØØ×ÕÔÐÉÃÀÁÿ¼¸´¯©¢—™£©¯³¶¶³²´³®¬®°±³´µ´³²®¬©¥¢¡¤¦¨ª¬«©©«®ÂÂÂÂÂÂÁÁ½½½½½½½½½½¾¾¾½½¼¾½½¼¼½½¾¾ÁÂÀÁÄÅÃÇÈÊÊÉÊÍÏÏÏÐÑÓÔÕÕ××ØÚÛÜÝÞßàáâäæççççççççççêêêêêêêêêêêêêêêêíçèæÛ癀`E1'1Hi‰¤ÆÝéïðïîîîîîîîîîîîîîîîîîîîîîîîîííííííííîîîîîîîîííííííííìëðïêìäÏ·”u\>)!,Gk‹©ÇàíîîïðððððððññññððððððððððññððððññññññññññññððððññóñðððïíëÞƬ˜ƒl\XWZ^acfjmrsvz„ˆŠŽ‘–™œ ¤§ª®²¶º¾ÂÆÉÊÌÏÒÕ×ØÜÝÞàâäåæåæçéëìííëëìííííìííííííííííííííííîíííììììðïïîíìììíííííîîîéêëëìììëíííííìììêçäâáßÜÙØÖÒÍǾ¼·´°«§¥¤¤£¢¢¡¡¢££¥¥¥¦¦¦§§«¬ª¨¦ž–‘‘‘’™Ÿ©³¼ÄËÐÒÓÓÔÔÓÒÒÐÒÕÖÕÕ×ØÙ×ÔÑÐÐÒÓÔÕ×ØÙÙØ×ÕÔÑÍÈÆÆÇ¿¼·²§ ›–˜¢©®³µ·´³µ³®¬®®¯±²³²±°«ª§¤¡¡¤§¬®°°¯®¯°ÂÂÂÂÁÁÁÁÂÁÀ¾¼º¹¸º»¼½½½½½¿¾½¼¼¼¼¼¾¿ÀÀÁÂÃÂÅÇÈÈÈÉÌÎÍÍÎÏÑÒÓÓÖ××ØÙÚÛÛÞßàâãåæçææççççèèêêêêêêêêêêêêêêêêíçèçÜйœ‚bF2&0Gh… ÃÚçíîíïïïïïïïïïïïïïïïïïïïïïïïïððððððððïïïïïïïïîîîîîîîîíìðïêíæÑ»—w^?*"+Eiˆ¦ÄÝêîïððññððððñòòñððññññññññòñððððñòññññññññòñððððñòóñððñðîëäÓ¾®‹{y|€„†ŠŽ‘’“–šŸ¤¨«±´¸»½ÁÄÇÊÌÐÓÕ×ÛÞÜÝÞßáãääääåæçèèéçèêëìíííììíîîííìííííííííììììììììììëëëêêêíííííìëëëììíííííëëëëêéèçèçæäâàÞÞÖÓÏÌÊÇÄÁÂÀ»¶±ª©¥¤¢ ¡¢¡¢£¤¦§©©¨¨©ªª«¬¬¬¯°®¬©¦ š•–—••˜ž¥°»ÄÌÓ×ÕÖÖÕÕÓÒÑÒÔ×Ø××ØÙÚØÖÓÒÒÓÔÕÖØÙÙØ×ÖÒÒÐÍÊÈÇÇÄ¿¹²¬¥Ÿš•—›¡§¬°³¶³²´²ª¬¬®°°¯®®¬¬ª§¥¦©¬³´´´³±°°ÂÂÁÁÀÀ¿¿ÃÂÀ¾¼º¸·¹º»¼½½½½À¿¾½¼¼¼¼¾½¾¿ÀÀÁÂÄÅÆÇÆÇÊÌËËÌÍÏÐÑÑÕÕÖ×ØÙÙÚÝÞßáâäåææææççèèèêêêêêêêêêêêêêêêêíçéèÞÒ»žƒcF2&/Fg‚ŸÂÚçîïíïïïïïïïïïïïïïïïïïïïïïïïïððððððððïïïïïïïïîîîîîîîîîìðïêîçÓ¼™y`@+"+EiŠ©ÇáîîïðññññððñòòòòñðññññññññòòñððñòòññññññññòòñððñòòòñðñññïìëßÑĸ«¡›ž¢¥¨«¯²¶·¹¼ÁÅÉËÐÒÖØÙÜßâáãåæææéëéééêêêëëêêêêêëëëëìíïïðïïííîîîííìííííííííìììììììììììëëëêêéêëëìëêééêêëêéèçééèæãàÞÜÛÙÖÒÎÊÇƼ¹µ²±¯«¬«©¦¤£¢¢žŸ ¡¡¢¢£¤¥§©ª¬¬¬®¯°±²¯°°±¯ª¨¢œ™›œšš¥¬·ÂÉÏÔ××××ÖÕÓÑÐÔÖØÙØØÙÚÚÙ×ÕÔÓÓÔÖ×ØÙØ×ÖÕÒÐÎËÉÈÆÅÈú²«¤žš—™¢§¬¯²³°¯±¯ª¨ª©ª¬®¯¯®¯¯«ª¬°³¼»¹·µ³°®ÂÂÁÁÀ¿¿¿¿¾¾½½¼¼»¹¹º»¼¼¼»¿¿¾½¼¼¼¼½»¼¿À¾¿ÂÂÄÅÅÅÆÈËÉÉÊËÍÎÏÏÒÓÔÕÖØÙÙÝÝÞàâãäåååæççèééêêêêêêêêêêêêêêêêíçééßÓ½ †fI3%/FfƒŸÃÝêðñïððððððððððððððððððððððððîîîîîîîîððððððððïïïïïïïïïíðïëïéÕ½›|cC,",Gk‹ªÈáîïïðñòòññññòòòòññòòòòòòòòòòññññòòññññññññòòññññòòòñðñòòïíïéà×ÏÈÁ½½ÀÃÅÇÉÌÏÒÓÔÖÙÜßááãåççèêíêëíìêêëìîîííííííííííííííîîïïîíìëîîîïîííìííííííííëëëëëëëëîîííìììììíîïîíëêèééèçäáàÛÚØÕÑÍÊÈÆÄÀ»¶±®¬¦£ ŸŸ ŸŸŸ ¡¡¢¢¢ ¡¢¢¢¡¡¥§©«¬®®³³´µ¶··¸´´³²°®¬¤žœŸ¡Ÿ ¢´¿ÈÎÒÔÕÙÙØØÖÕÓÒÕ×ÙÚÙØÙÚÚÙ×ÖÔÔÓÓÖ××Ø×ÖÔÓÕÑÌÉÇÆÄÂÆÀ·®§¢š› £¨¬¯°®««¬¨¦¨©ª¯±±±±²²²°°³·»Å½¹·µ²°ÄÄÃÂÁÀÀ¿¾¾½½½½¼¼¹¹º»»»ºº½¼»»»»»¼½ºº¿À½½ÁÁÂÄÄÃÅÇÊÇÈÉÊËÌÍÎÐÐÒÔÕ×ÙÙÜÝÞßáãääååæççèééêêêêêêêêêêêêêêêêíèêêàÕ¿¢‹kN8$%.EfžÃÝêññïððððððððððððððððððððððððïïïïïïïïððððððððïïïïïïïïïíðïëïêÖ¿ž€hH/# !"""#$%%'+.?Xy•¯ÊàëïðññòòñññòòóóòòñòòòòòòòòóòòññòòóññññññññóòòññòòóòñðñòòðîïíéåáÞÚ×ØÚÝÞÞßâäããääæèéêèéëëêêìíëìíìëêëìïïîîííììííííííííííííìëêéîïïïîîíìííííííííëëëëëëëëëëëêêêéééêêêèåâàÜÜÜÚ×ÒÎÌÃÂÀ½º¶²°°®«¦¢š˜–”’“–š›œž £¤¤¤¤¤£¢¢¢¤¦§«¯²´¶¶¶¾¾¾¿ÀÀÁÁº¹¶´²±±±ª¥£§©¨¨«´¼ÆÏÔÖÖ×ÙÙÙÙØÖÕÔÕ×ÙÚØØØÙÙØ×ÖÔÓÓÒÕÖ××ÖÔÒÑÕÏÈÃÁÀ¾¼¾¸¯§¢Ÿœš›œŸ¢¥¨ª«©¦¦©©¥¤¦ª¬¯³µ¶··¹¹¹¸¹¼ÁÅÌÆÀ»º¹·µÆÅÄÄÃÂÁÁÁÀ¿¾¼»º¹¹ºº»»º¹¹»º¹¹¹ºº»½¹¹¿À¼¼ÁÀÂÃÃÃÄÇÉÇÇÈÉÊÌÌÍÎÏÑÓÕ×ÙÚÜÜÞßáâãäååæççèééêêêêêêêêêêêêêêêêíèêêàÕÀ£pR<' %.Ee~›ÀÚèïïíððððððððððððððððððððððððññññññññððððððððïïïïïïïïðîñïëðê×Á ƒkK2$ !"##%%&'(()*--.01345:;==>AEHZr¦»ÑãìïðñòòòòññòòóóòòñòòòòòòòòóòòññòòóññññññññóòòññòòóòñðñóòðîíîíëëëéææèêêêêìîîííííîïïíïðïîíîïîïððïïðòòòññððïïîîîîîîïïííîïðððïïïïïïîììííííííííëëëëëëëëççææååååÞÞÝÜØÔÐÍÈÈÇÄÀºµ²°°®«¨¥¢ ¢ žš–’ŽŒ‹’—›œŸ¡¤¦§§¦¤§¥££¥ª¯³´¶¹½ÀÁÂÂÈÈÈÈÉÉÉÉ¿¼¹¶´´µµ°¬«¯±°°³¹ÀËÔØÙÙÙØØØØ×ÖÔÔÕ×ÙÙØ×ØÙØØ×ÖÔÓÒÒÕÖÖÖÕÓÑÏÓÌý»º¸¶µ°¨¡žœ›š˜™› ¢¤¥¥££§§££¥¬®²¶¹º»»ÀÀÀÀÀÄÉÎÏÉÁ½¼½¼ºÇÇÆÅÃÂÁÁ¿¿¾½½¼»»¼¼¼»»»ººººº¹¸¹»¾¹º»¼½¾¾¿¿ÁÃÂÁÁÃÄÅÅÇÈÊÌÍÎÎÏÐÑÓÔÖÖ×ÙÝßßàâäãäåæèéêëéééêêëëëëëëëëëëëíëéçáÔµ˜„gK7/--)(('%$##!! ! $3La|™½ØèðòðððððððððððððððððððððððððññññññññððððððððððððððððððîíïïèÞÁ©ŠmT<+$""##$%&&%&&'(())*++,-.//124789::==>?BDFHIIJLOQTUWXZ]`cefy‹¤¼ÍÛæíððñòòóôôòòòòòòòòóóóóóóóóóóóóóóóóòòòòòòòòòòòòòòòòóóóòòñññïïîíìëëêééêêëëìììííîîïïïïïïïïïïïññðððïïïïïïðïïîíîñòñîíîñîííîðñïíííííííííîííììëëêïíêêìíêçæååâÞÙÔÑÎÍÊÇÃÁ¿¾¹·´°¬©¨§¤¡ŸŸ¡¡ž›œ›™•‹‰ˆ€„ˆ“˜šŸ¢¥§§¨ª¬¬¬¬¯´¹¼ÁÄÇÈÈÈÉËÏÐÑÑÑÏÎÍÆÄÁ½»»»¼¶¶¹½»¶¶¹ÄÈÏÔ×ÙÛÝÚÙØ×ÖÕÕÕÔÖÙÙØÖÖ××ÖÔÓÒÓÔÔÕÔÔÔÓÓÓÓÐÅ»¸¶±«§¤ œ™——˜•–™œŸ¡££¢£¤£¢£¥§«¯µº½¾ÀÁÆÃÀ½½ÁÅÈÊÅ¿¼¾¿¾½ÇÇÆÅÃÂÁÁ¿¿¾½½¼»»¼»»»ººº¹¹¹º¹¸¸»½ºº»¼¼½½¾ÁÃÄÃÁÁÂÃÄÅÆÈÊËÌÍÎÎÏÑÓÔÕÖÖÙÜÞßàâãääåæçèéééééêêêëëëëëëëëëëìëéèã×Ç»¤“zbQHEDCBA@>=<<:9987654543210000/./00.,--,,++**++***)))(&'*0=Th„ŸÁÚèðòðððððððððððððððððððððððððññññññññðððððððððððððððððñïíïïèßȲ•|dN?977899:;;AABCDDEEHIJKLNOORSTVXY[\^^_acfhjmmnortvxxz|€ƒ‡‰‹“¡·Ê×áéîððñòòóôôòòòòòòòòóóóóóóóóóóóóóóóóòòòòòòòòòòòòòòòòóóóòòñññññðïïîííîîîïïðððïïïðððññððððððððòòòñññððíîîïïîíííïðïíìíïðîîîðïíëììííííîîíííìëêêêèåâààßÜÙÕÔÓÑÍÇÃÀ»¹·´²±±²«ª©§¦¤£¢žœ›œž žœ›—’ŽŒ‹‚ƒ…‰–œ §ª®°²´¶¸¹¸¸¹¼¿ÃÅÍÏÒÓÓÓÔÖÕÕÖÖÖÕÓÓÌËÉÆÅÄÄĽ»»½»¸¹½ÇÌÑÕ×ØÙÛÜÛÙ×ÕÔÔÔÔÖØØÖÕÖ×ØÖÔÒÑÑÒÓÓÓÓÒÐÎÌËÆ»²¯¨££Ÿ™–”””••–™œŸ¡££¢£¥¥¤¤¦¨²¸¾ÂÄÅÆÁ¾¹¶¶º¿ÃÄÁ¾½½¾¿¾ÇÇÆÅÃÂÁÁ¿¿¾½½¼»»»ººº¹¹¹¸·¸¹¸··º¼»»»¼¼¼¼¼ÂÃÄÄÂÁÂÃÄÅÆÇÉÊÌÌÍÎÏÐÒÔÕÕÖØÜÝÞßàâåååææççèééééêêêëëëëëëëëëëêêéåÛÎÄ°£|nea___]\ZXWVWVUTSQPPPOMLJIIIJIHIJIGEDDDCCCCBA@@@???>B@@CHRfx“ªÈÝéðòðððððððððððððððððððððððððññññññññðððððððððððððððððñïíîïêâÓÁ¨“k^YXXYYZ[\\aabccdeeiiklnpqrvvvxz}‚‚„…ˆ‹“””•—šœŸ¡¥©¬¯±¶ÁÐÝäéíðððñòòóôôòòòòòòòòóóóóóóóóóóóóóóóóòòòòòòòòòòòòòòòòóóóòòñññóóóòñðððññññòòòòñññòòòòóððððððððòñññððððïïðññððïîðñðïîðñîíìíïïíëìììììëëëêéèçåäãâÜÙÕÒÐÍÊÇÂÂÀ½¹´°§¥£¡¡¢£¤ŸŸ¡¡¡ Ÿžœœœž¡££¢£¢ š–“‘‰ŠŒ‘˜¡©³·»¾ÁÃÆÉÆÆÆÇÉËÍÎÒÔ×Ø××ÙÚÙÙÚÚÚÙØ×ÑÑÑÐÏÎÍÌÆÃÁÀ¾º½ÂËÏÔ×××ØÙÛÚØÖÔÓÒÒÕÖ××ÕÔÕ××ÖÓÑÏÏÏÐÒÒÑÏÌÇÃÀº°§¤¢™™—–“’‘’”•–˜š £¤¥£¥¨¨§§¨ª¯³ºÀÅÇÇÆ»·±²¹¾¼½¾¾¼¼½¿ÇÇÆÅÃÂÁÁ¿¿¾½½¼»»ºº¹¹¹¸¸¸¶·¹¸··¹º¼¼¼»»»»»ÀÂÃÃÂÂÃÅÄÅÅÇÈÉÊËÌÍÎÐÑÓÔÕÕØÛÜÝÝßàååååææææèèéééêêêëëëëëëëëëêêêçàÖÏÀ´£“ˆ}{{zywusrqtsrqonmlonmkihhhfeeeffdbaaaaaaaa^^^]]\\\`^^bfoŽ¦¹Ñáêñòðññññññññññññññññññññññññññññññññññññññññððððððððïñðîîðìåßн¬š‰~{zz{{|}~~€‚ƒ„„„‡ˆŠŒŽ’“——–—™œ ¢¢£¤¦¨«¯³³´´¶¸¹º½¾ÀÂÅÈÊËÓÚãêíîïðñññòòóóóòòòòòòòòóóóóóóóóóóóóóóóóòòòòòòòòòòòòòòòòóóóòòñññôôóóòòññððððððññòòòòòòòòññññññññððïïïîîîîïïððïïîïïððïïïðëëëìîïîìëëéèæäãâßÞÜÙÖÔÒÑÌÊÇÄÁ¾»¹·¶µ²®ª¦¤Ÿš˜˜šœœž £££¡ ¤¥¦¨ª®®®«©§£Ÿœ–—™Ÿ§±¹¿ÁÄÈËÌÎÑÓÎÎÏÏÐÑÒÒÓÕØØØØÙÚÚÚÚÚÙÙØØÒÓÕÖÖÔÒÑÌÉÇÇÿÀÄÍÐÕ×ØØØÙØ×ÕÔÒÑÑÑÖ××ÖÔÔÕÖÕÔÑÎÌÌÌÌÐÐÏÌÇÀ¹µ°§Ÿš•“””“‘‘’”—™š›ž¡¤¦§¨§©«¬«ª«¬±´ºÀÄÄÁ¾´¯¨¤¦¶¼¸¼¿¾»¹º¼ÇÇÆÅÃÂÁÁ¿¿¾½½¼»»ºº¹¹¹¸¸¸µ·¹¹¸·¸º»»»»»ººº½¿ÁÂÂÃÅÇÄÄÅÆÇÈÉÉËÌÍÏÐÒÓÔÕ×ÚÛÛÜÝßääääååååèèèéééêêëëëëëëëëêêëëéäÞÙÓȸª¡œš™™™—–”’‘’‘‘ŽŒ‹‹Š‰‰‰ˆ‡†‡ˆˆ†„‚‚‚‚ƒƒƒƒ€€|{|†š¦»ÊÚåìñòïññññññññññññññññññññññññññññññññññññññññððððððððïññîîðíèèÜδ¥›™™š›œœ££¤¤¥¦§§«¬®°²´¶·»º¹¹»¾ÁÃÃÄÅÆÈÊÍÎÐÐÐÑÒÓÕÖÚÚÛÜÝßßàâæëîðïïïññòòòòóóòòòòòòòòóóóóóóóóóóóóóóóóòòòòòòòòòòòòòòòòóóóòòñññóòòòòñññððððððïïññññððððññññññññðððïïïîîîîïïîíììîííííììëíëêëìëéæåäáÞÚ×ÔÓÎÌÊÇÃÀ½¼ºº¹·´²°°°¯ª§¤¡ žœš—–—˜™›¢§ª¬¬¬°±³µ¶¸º»¾¼¹¸¶³¨¢£§µ¾ÇÌÌÎÑÒÒÒÔÕÓÓÓÔÔÔÔÕØÚÜÝÜÛÜÝÛÚÚÙÙÙÙÙÕÖÙÚÚØÖÔÏÍÍÎÊÃÂÄÌÐÔ×ØØÙÙ×ÖÕÔÓÓÓÔÕÖ×ÖÔÓÓÕÒÐÍËÉÈÈÈÍÍËÇÀ¹±¦Ÿ™—”’““’’“–™œž £¦©«¬«®®¬«¬´¶¹¾À½·±§£š¦±¸¸¼¿¾º··¹ÇÇÆÅÃÂÁÁ¿¿¾½½¼»»»ººº¹¹¹¸µ¸ºº¹¸¹ºººººº»»»»½¿ÀÀÁÃÅÄÄÅÅÆÇÈÈËËÌÎÐÑÒÓÔÖÙÚÚÚÛÝâããääåååçèèèééééëëëëëëëëêêëëéæãáÝÔǼµ²±±³³²±°¯®«ªª©¨¨§§©¨§¦¥¥¥¥¦¥¤¥¦¦¤¢ŸŸŸ ¡ŸŸŸŸžžž›™›¡¦«´¾ÎÙãéíòòïòòòòòòòòòòòòòòòòòòòòòòòòññññññññòòòòòòòòððððððððîòòïîðïëìåÜÕË¿¹¹··¸¹¹º»»ÀÀÁÁÂÃÄÄÊËÌÎÐÑÓÓÖÖÕÕÖ×ÙÚÜÜÜÝÞàáâäãããäåæçêêêëëëëëéëíîðððïòòòòòòòòòòòòòòòòóóóóóóóóóóóóóóóóòòòòòòòòòòòòòòòòóóóòòñññòòòñññññòòòòññññðððïïïïîððððððððòòññððððóóóòñïííîìêéééçåèåãáßÝÙÖÖÔÑÍÉÄÁ¿»º¸µ³°¯®®¯®¬ª«¬«ª©§¤¢¡ ¡ žœ›š™™›ž¤ª°µ¸¹º½¿ÁÂÄÇÉÍÊÇÆÅÁº´«®²¸ÀÈÏÓÓÕ××ÕÔÕÖ××ÖÖÖ×ØÙÙÛÝÞÝÜÝÞÝÜÛÛÚÚÛÛÙÚÜÝÝÜÙØÐÏÐÒÎÆÄÆÌÐÔ××××ØØ×ÕÔÓÓÓÓÑÓÕÕÓÑÐÐÍËÉÆÅÄÅÅÈÇÄ¿¹±ª¦Ÿ™•”‘Ž“–•””–˜›ž¢£¦©¬®°°®¯®¬©¨ª«µ¶¸»¼·¤—”• ¬´º»½¼º¸··ÇÇÆÅÃÂÁÁ¿¿¾½½¼»»¼»»»ººº¹¶¸»»º¹ºº¸¹¹ºº»¼¼½¾À¿¾¾¿ÁÃÄÄÅÆÆÇÇÊËÌÍÏÑÒÒÓÖØÙÙÙÚÜááâãäåææççèèèéééëëëëëëëëêêëêéçææâÜÕÎÊÈÆÄÇÇÇÆÆÆÅÅÁÁÁÁÁÁÁÁÁÀÀ¿¿¿ÀÁÂÁÀÁÂÁ¿½¼¼¼½½¾¾¾½½¼¼¼»»»½»¼ÁÅÈÎÕÝäêìîòòïòòòòòòòòòòòòòòòòòòòòòòòòññññññññòòòòòòòòððððððððîòòïîððîîéæäÞÖÓÔÒÒÓÔÕÕÖÖÖ××ØÙÙÚÚÞÞßáâãäåååååååååèèèçèéêêììëëëìíîíííîîïïïîîîïñòòñòòòòòòòòòòòòòòòòóóóóóóóóóóóóóóóóòòòòòòòòòòòòòòòòóóóòòñññòòòòòòòòóóóòòñññððððïïîîððððððððïïïîîîííïïîíëèæåáÞÛÚÚÙÖÓÑÏÍËÊÈÄÁÂÁ¾º·³°¯«««««ªªª«¯®¬«¬¯¯®«ª©©©©©©©¨¦¤£¤¦ª¯µº¾ÀÂÅÊÍÎÑÕÙÚÖÒÑÐË»µ¸½ÄËÑÖØ×ØÚÚØ××ØÙØÖÕÖØÚÜØÚÜÝÛÛÛÜÞÝÜÚÚÚÛÜÜÜÝÝÝÛÚÙÓÐÐÑÍÇÆÉÎÑÕÖÖÔÔÔÖÔÒÐÍÌËÊËÏÒÓÐÍÊÉÈÆÄÂÁÂÂÃÂÀ¼·°ª¥¢ž™––”’”šœ›š› ¢£¥§«®°±²°¯¬¨¤£¥§°°²µµ¯£™‹‰ˆŠ’Ÿ¬´ºº¹º»»º¸ÇÇÆÅÃÂÁÁ¿¿¾½½¼»»¼¼¼»»»ºº¶¹¼¼»ºº»·¸¸¹º»¼½¿ÀÁ¿½»»½ÃÃÄÅÅÆÆÇÊÊÌÍÏÐÑÒÓÕØÙØØÚÛßàáâäåæççççèèéééëëëëëëëëêëëêèçèèèæãàßÜØÖ××××××××ÕÖÖÖ××××Ø××××ØÙÚØ×Ö×ØØÖÔÖÖ××ØØÙÙÖÖÖÖÕÕÕÔÕÓÔØÛÜàæåëîíïòòïòòòòòòòòòòòòòòòòòòòòòòòòññññññññòòòòòòòòððððððððîòóïîðñïîììíêäãæãääåææççççèééêëëêêëìíîïïîïïïîíììïïîííîîïññððððñòíîïðñòòóòðððòôôôòòòòòòòòòòòòòòòòóóóóóóóóóóóóóóóóòòòòòòòòòòòòòòòòóóóòòñññóóóóóóóóòòòññððïñññððïïîïïïïïïïïëëêêééééááàÞÛØÖÔÌÉÅÃľ»¸·¶·¸·µ³´³±®«¨¦¥¢£¥¦¨ª«¬¯²³²°¯±³¶¶µ´³³³´²³µ¶µ³±¯±±³µ¸»¾ÀÇÌÑÕ×ÛàåàÜØÖÕÐÇ¿½ÀÆÍÓØÛÝØÚÜÜÚÙÚÛØ×ÔÓÔÖÚÜÛÝßßÞÝÞßÜÛÚØØÙÚÚÛÛÛÛÚÙØ×ÕÑÏÎËÆÈÌÐÓÖÖÔÒÑÑÒÐÍÉÆÃÁÀÇËÏÑÎÊÆÄÅÃÂÀÀÀÁ¾»·±«¥¡Ÿ œšš™—›¡¤£¡ ¡£¥§£¥§«®°±²°©¤ŸŸ¡¤©©«®¯¨›†……Š“¡®·º¸¶¸¼¾½ºÀÁÂÃÂÀ¾¼ººº»»¼¼½¼º¸¸º»»ººº»»»ºº¹»»ºº¹¹¹¹¾¾¾¿¿¿¿¿ÂÄÆÇÆÇÉËËËÍÎÏÑÒÓÓÕÖ×××ÙÛàßÞÞàäçéæååæçèéêêêêëëìììëëëëëëëëææææææææââââââââáâââããããââââââââääääääääææææçççèãäååååäããäåçèèèèìíîïñòóôñññòòóóóòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòññññññññððððððððîîíìëêêéëëëëëëëëëëëëëëëëííííííííîîïððïîîððððððððòòòòòòòòññññññññóóóóóóóóóóóóóóóóòòòòòòòòôôôóóòòòðððñññòòóòòòòòòòóóòññòòóòóóóóòññôôôòðððòöóðïðñðïïïïðòóòðîîíííìììîëæâàÝÚ×ÙÖÐÊÄÀ½¼´´²®ª¨©«¦¦§ª¬®¬¯°®ª¦¥¤¡£¦©¬¯°±µ¸ºº¸¸»¾À¿¾½½½½¾¿Âÿ¾¾¼····¹»½¿ÀÆËÒØÜÞàáããáÜÖÍÅÀÀÄÊÑ×ÚÛÛÜÜÝÝÝÜÛÚÙØ×Ö×ÙÜÞÝÝÝÝÝÝÞÞÜÛÙØØÙÜÝÞÝÜÜÜÛØÖÕÐÎÐÐËÈÈÏÐÒÓÒÏËÉÍËÇÀ»º¼¿ÂÈÏÑÍÈÅÅÁ¿½¼¼¼¹¸¸·¶³«¤£¥£¡ŸŸ¢¤¥¤§¤¢£¥¦¤¢ žž¡§®²µ²§Ÿ £¢¡¢ž«±ª©Ÿ‘‡††Š”¢°¹¹¸¹»½½»¹´µ·¸¸¶´³³³³³³³³³µ´³´¶¸¸¸¹¹º¼¼¼¼¼¸¸¹ººº¹¹»»»¼¼¼¼½¾ÀÂÃÃÄÆÈÈÈÉÊÌÍÎÎÐÒÕÖ×ØÛÝáààáâåçèææææçèéêêêêëëëììëëëëëëëëèèèèèèèèèèèèèèèèèèèééêêêììììììììêêêêêêêêééééêêëëìííîîííììíîïððððíîîðñòóóñññòòóóóòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòññññññññðððððððððïïîîííìííííííííïïïïïïïïïïïïïïïïïïððððïïððððððððòòòòòòòòññññññññóóóóóóóóòòòòòòòòôôôôôôôôñññññðððööööõõõõóóóóòòòòñðïïïïðñòóôôôôóóòóóòññòóóòññòñïìñïíìììéçæäáÞÚØÖÕ×ÔÏÌÉÆ¿¶´°¬§¤¢¡œœ™•‘‘“• ¡£¦©««ª¯±°¬¨¦¥¤¦ª®²¶¸º»¿ÂÄÄÅÈËÇÆÄÃÂÃÄÅÇÊËÇÆÆÿ½½¼¼¼½¾¿ÅÊÑÖÚÝàâåãßÚÓÌÆÃÂÆÌÓÙÜÝÝÜÝÝÝÝÜÛÛÙØ×Ö×ÙÜÝÜÜÜÜÜÜÜÜÛÚØ××ÙÛÝÝÜÚÚÛÚØÖÓÍËÌËÇÄÅÎÏÑÑÏÌÈÅÆÄÀ»··¹¼¿ÅÊËÇÁ¾½ººº¹¸··¸µ·¹¸³®¬¬©¦¤¤¦©ªª¯¬¨§¥¢™–––›¢ª¯²¥ŸŸŸœ§±¶²¯¬ ˆ††‰’ž«´·¹»¼»º¹¸®¯°²²±°¯¬¬«ª©©©¬«ª¬¯²²²²³µ·¸ººº¶¸º½¾¾¾¾¼½½½¾¿¿¿¿ÁÃÄÅÆÈÊÊÊËÌÍÎÏÏÐÒÖØÙÜßáààáâãääåææçèèéêêêêêêëëëìëëëëëëëëëëëëëëëëììììììììíííîîîïïîîîîîîîîîîîîîîîîìíííîîîîîîïïïïîîíîïñññññïïððñññòñññòòóóóòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòññññññññððððððððññññððððððððððððòòòòòòòòòòòòòòòòðññòòññðððððððððòòòòòòòòññññññññôôôôôôôôòòòòòòòòôôôôôôôôòóóóóóóóññðïîîííôôôôôôôôòññððññòòòóóôóóòðððððñññîîîïïìèåêçâßÝÚ×ÕÑÏÊÅÀ¼º¹»¸µ²°¬¨¤¦¥£¡Ÿ›š—•’Š‹“›ž¢§«°³¶¶²ª¨©¬°µ»ÀÄÆÇÊÍÏÐÑÔÕÏÍÉÇÆÈËÍÐÓÔÑÏÐÌÇÈÆÃÀ¾½½½ÂÆÌÑÕÙÝàáÞÙÓÎÉÆÄÅÈÏÖÛÞßßÝÝÞÞÝÜÛÛÙ×ÖÕÖØÛÝÛÛÛÛÛÛÛÛÚÙ×Ö×ÙÛÝÝÛÙØÙÙØ×ÓÌÈÇÆÁ¿ÀÈÉÊËÉÅÁ¿¾½º¶³³¶¹¼ÁÆÆÀº·¶³¶¸·´´·»º¾ÁÁ½¹¶³°ª©«¯¯´±©¥ž–‘‘–ž¦«§¢ ¡¡žž¢®µ¹·¶±£’‹‰‡‰›§®´¸¼¼¹¶¶·©ª¬®®®®©©¨¦¤£¢¡¤¢¡¢¥§§§¦§©¬®°°±¯±µ¸»¼¼¼»»¼½¾¿ÀÀÁÃÅÆÇÈÊÍËËÌÍÎÐÐÑÎÑÔÖ×ÙÜßÞÞßáááááææçèéêêêééêêêëëëëëëëëëëëëëëëëëëëëëëëëëëëìììíííîîììììììììîîîîîîîîîîïïððððìíîîîîíììíîïððïïñññññññññññòòóóóòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòññññññññññññññññññññòòòòððððððððððððððððòòòòòòòòñòòóóòòñññññññññòòòòòòòòòòòòòòòòôôôôôôôôóóóóóóóóóóóóóóóóóóóóôôôôõõõôôôóóóóóóòòòòóòñðððññññññðïíìëêêêêêéçåãáßÞÛ×ÔÔÐËÆÄÁ¾»³°¬¨¥¤¤¤¥¤££¢ œ˜•••””“’’‘‹†„‡’¢©¯³µ·¸¸»¿¿»µ°®¯±¶¼ÃÊÏÒÔÖ×ØØ×××ÓÐËÇÇÊÎÑÕÚÛÙ××ÔÏÑÎÈþ»¹¹º½ÂÇËÏÔØÔÓÑÎÊÇÅÃÆÉÐÖÛÞßßÞÞÞÞÝÜÛÚØ×ÕÕÕØÚÜÚÚÚÙÙÙÙÙÙØÖÖÖØÛÝÞÜÙØÙÚÙØÕÍÆÿ¹·¸º»¾¿¿¼¹·¸¸¶²°°²µ¹¾Ãþ¹¶¶³·º¹¶¶¼ÂÆÊËÇÄÁ½¸·³®««¯°²°¨¡˜ŠŠ‹Ž•¤¨©£¡£¦¦¥§°¶»¼¼¶§—‘Ž‹‹™¤«°¶»º¶³´· ¡¢£¤¥¦¦¥¥£¡Ÿœ›Ÿœšš››š™šœŸ¡¢¢¢Ÿ¡¥©¯±±³´µ¶¸¹º»½¿ÂÃÄÅÈÊÇÈÉËÌÎÏÐÍÐÒÓÔÕØÚÞÞàáááááåæçééêéééééêêêëëëëëëëëëëëëëëëëëëëëëëëëëëêëëëììììîîîîîîîîîîîîîîîîîîïïïððððññòòññððñòóóóòòòòòññññðñññòòóóóòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòññññññññññññññññððññññññððððððððððððððððòòòòòòòòòòóóóóòòññññññññòòòòòòòòòòòòòòòòôôôôôôôôôôôôôôôôóóóóóóóóññññññññòòòòòóóóòòñðïîîíðïíìëëëëììëêèåãâáßÝÜÝÛ×ÔÒÍÇ¿½»¹µ²®«©§¤¡˜•‘Ž‘“—˜šœžžš—‘‘‘‘‘‘’’”‘‰‡‹“˜¡©²º¾ÀÂÄÃÇÊÉž¹¶´¶»ÁÉÑØÛÜÝÞßÞÝÛÙÔÐËÇÇÊÏÒØÝàÞÝÞÚÕÕÑÉ»¶³²°³¸¼¿ÃÈËÆÈÊÌËÉÆÄÅÉÏÕÚÝÞÞÝÝÝÝÜÛÙÙ×ÖÔÔÕ×ÙÛÚÚÙÙØØ××Ø×ÕÕÖØÛÜßÝÛÚÚÚØ×ÑÉÀ¼¶¯««©¬¯²´³±°³²±®¬¬®°µ»ÀÁ¾»º»º¾ÁÀ½¾ÄÊÏÒÑËÈÈĽ¹³¬§§¨ª«¯®«¤š†€‚ˆ‘œ¥ª«¥¤¥¨¨¦©®±·½À¿¶¦˜•’Ž‘™£©®³·¶±¯±µ›œœžŸ Ÿ›™—–•š—”’’‘Ž’’“““’‘‘‘”˜œ £¤©ª«¯±²³·¹¼¾¿ÀÃÅÃÄÆÈËÍÏÐÑÓÕ××ØÛÝßßààáâãäãäæèééèçèéééêêêêëëëëëëëëêêêêêêêêííííííííëìììííííîîîîîîîîððððððððíîîîïïïðññòòòòñññòòóóòòñòòòòòññññññòòóóóòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòññññññññòòòòòòòòññññððððïïïïïïïïòòòòòòòòñññññññññòòóóòòñòòòòòòòòòòòòòòòòóóóóóóóóóóóóóóóóóóóóóóóóôôôôôôôôóóóòòñññîîîíííììòñðîìêéèèçåãáàßßÝÜÛÚØÕÓÑÎËÈÈÈÆÀ»·±ª¤¡ŸŸž›™™˜—“‰†‚‚†‰’”˜ž¡¢Ÿœž›šššœ™—“”œ¡§°¼ÅÈÊÌÎÐÒÔÒÌÆÁ¾º¼ÀÆÎÖÝáààáãäãßÜÒÏÊÆÆÉÍÐÖÜßßßàÝØÓÎƽµ¯¬«¨«°´¶¹¼¿¿ÁÆÉÊÉÇÅÅÉÏÕÙÜÜÜÜÜÜÜÛÙ××ÖÕÔÓÔÖÙÚÚÚÙÙØ××ÖÖÕÔÔÕ×ÚÜßÝÛÛÚØÕÒÉÀ¹´®¦ ž¡¥ª¬¬«¬«ªª¯·¼ÂÄÃÁÂÃÅÇÈÆÅÆËÐÐÕÔÍÌÎȾ´®¦ ¢¥§¯¨ž‘„{wrw€œ§¯«¦£¤£Ÿ £¯·ÁÅÀ´¥š›—“’•§±²²°¬ª¬¯››››œžžœœš˜–•““•’Œ‹‰‡‰‰ˆ†„‚~}~‚†‹’—˜šœž ¢¢§ª®¯±´¶·¸»¾ÁÄÇÈËÍÐÒÔÖÙÛÜÜÛÜÝàâäáãåçèèçæèèéééêêêëëëëëëëëëëëëëëëëííííííííììííîîîîììììììììððððððððíîîîïïïðïïððððïïïïððððïïññòòòòòòñññòòóóóòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòññññññññòòòòòòòòóòòññððïððððððððòòòòòòòòòòòòòòòòññòòòòññòòòòòòòòòòòòòòòòóóóóóóóóòòòòòòòòññññññññññññññññòñðïîíììððîíëéèçáàÞÛØÖÓÒÒÐÍÊÇÅÃÃÁÁÁÀ¿½¼»¶³°±²°ª¤ œ—“‘Ž“““”•“Ž‹…‚~}~„ŠŽš¢¨¬¬©¥¤¢žš™šœ•”’•œ¡®¹ÆÏÓÔÖØÚÛÛ×ÑÊÅÃÁÂÆËÒÚáåãââääâÝÙÌÉÅÂÁÄÇÊÍÓØÙÚÜÙÔÏÊÁ·®©¦¥¤¨®±³´¶·»½¿ÂÃÃÂÂÆÉÏÕÚÜÜÜÛÛÛÚÙ×ÖÕÖÕÓÒÓÕØÚÛÛÚÙØ××ÖÕÔÓÓÔ×ÚÜÝÜÛÛÙÕÐÌÁº´±¬¤ž›ž£§ªª©¨©«¬®°³¶ÀÅËÍÌËÌÎÏÎÌÊÊÌÏÑÐ×ØÒÐÏŶ«¥ž™šŸ¤¦«©¤™‹xuqv€¨®°¤žœ™˜˜§²ÁÈöª¤¤¡œ ¨²¸¸´¯ª¦¥¥¦˜˜˜˜˜™ššœœš™—•”“‘‹Š‰ˆ†…‚}yurpiiikou{~‚ƒ…‡ŠŒŽ“•˜š› ¢¦§ª±µ¸¹»¾ÂÅÇÊÎÑ××ÖÖØÛßáàâåçèçæäèèèééêêêëëëëëëëëììììììììëëëëëëëëìììíííîîïïïïïïïïïïïïïïïïîîîïïïðððññòòññððññòòñððñññòòóóóñññòòóóóòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòòññññññññòòòòòòòòõôóòñððïññññññññññññññññóóóóóóóóðññòòññðòòòòòòòòòòòòòòòòóóóóóóóóññññññññïïïïïïïïëëëëëëëëèèæåãâáàÜÛØÕÒÏÌËÇÆÃÀ¼¹¶µµ³°¬©¦¤£©©ªªªª©©¦£ ¢¥£—•“ŽŒŠ’“”–—”‹†ƒ…Œ”™¥¨´¸·³¯²®¨¤¡¢¥§££¢ ¡¥¬±µÀÎ×ÚÛÝàßàÞÙÒËÇÅÅÆÉÎÔÜãççåãâáÝÖÐÅÿ¼¼¾ÁÃÄÊÐÑÓÕÓÎËƼ²ª¤¢¡¤¨®²³³³´¹¹¹¹º»¼½ÇÊÐÖÚÝÝÝÚÚÚÙØÖÔÓÕÔÓÒÓÕØÙÜÛÚÚÙØ××ÕÔÓÓÔ×ÚÜÚÚÚÚØÓÌǾ¸³³¯§¢¡ ¤¨ªª¨§ª¬¯±´·¼¿ËÐÕ×ÕÔÕ×ÔÑÍËÌÏÐÐÒÚÝÖÒξ«¥Ÿ˜•—ž¤§¥¤Ÿ•‰€{zx}†“ ©®¬¡˜˜š˜––«¾Éź²°®«§¦ª³½Ã½·®§£¡ Ÿ’•——••—š˜™™™˜–”“”ŠŠŒ‹‡‚€}yslea^ZVX`glntuuuux|€€€ƒ†‰‹’–™›ž¢¥ªª¬°µº¿ÂÅÅÆÈËÎÒÔÖØÚÛÜÝßáââãäåççèèéêëëëëëéëìëêéêìììëëëìííîííííîïïñððïïîîîîïðñðïíìïððññññðòòòòññññòòòòòòòòòòòòòòòòóòññññòóóñïðòóóòòóôõôóñðòòòòòòòòððñòòóôôñññðððððññññòòòòððððññññòòòòòòòòòðïïññðîòñðñóôóñññòòòñðïññòòóôôôóòòññðððððððððððñððïððññóðîììëèæãâáßÝÛÚÙÛØÕÒÏÌÉÆÁ¿¼¸µ²°¯¬«©¦£ žš™—”’“–™™œŸ¢¢¤¦¨Ÿ¡¤¦¥¢žœ••”’‘’“˜™œ ¢Ÿ˜’Œˆ†‰‘›¢µºÀÄÅÃÁÀ»¹µ±¯¯°±ª¬¬ª¬±¶¼Ê×ÚÜâåäåãáÜÖÐËÈÆÅÇÐÜäæäçåâßÛÖÏʽ·´¶¸¹¸ÃÇÍÐÐÏÎÍÊƾ¶¯©¦¥ ¨°µ¸»¸³µµ¶¶¶¶µ´¸ÁÏÙÜÝÝÝÙØØØÙ×ÔÑÐÏÍÏÒÕ××ÛÚØØÚÚÙ×ÓÒÒÒÓÕ×ØØÚÛÚÖÐÊƼµ°°¯©¤£ £«´³®³·µ¶¹»½ÄÌÎÓÖÕÔ×Ù×ÕÐÊÅÀ½ÃÌÓÕ×ØÓƵ©š—“‘•œ¥«§§¢—‰||~€‡“ ª¬¬¥˜šœš›¾ÅÅÄ¿»»º·µºÅËËŽ±§ œ›’•——••—š—˜™™˜—•””‹ŠŒŒ‡ƒ€~{wph`[SOJKRZ_a]^^]\]adjjjlnqsuwz~ƒ…‰‹’”™¢¦©°±²´¶º½¿ÀÂÅÆÇÈËÍÕÕÖØÙÚÛÜÞÞàâäååææçééèèéëêêêêêëìíìëëëëìííîîîîîîîîíîîïïïîîíîïïððïïïïïïïïïîóóóóóóóóòòòòññññóóòòòòóóôòðñóôôóôôôôôóòòòòòòòòòòõõôôóòòñòòòñññððññññññññïïïðððððïïïïïïïïñïîîððîíòñððòòñðïððñññðïðððïîîííððïîìëêêëëêéèèççæäâßÜÙØ×Ú×ÕÓÓÒÏÍÈÈÆÄÁ¾¼ºµ³±®«©¦¤ Ÿœ™–”“’ŒŠˆ†„‚„„„‚‚…ŠŽ“—œ ¢£¥§¤¦©«ª¨¥¢žžœœœžŸ¤££¤§¦£Ÿ™•š¥®ÃÈÎÒÒÐÏÎÍËÇÄÂÃÄŽ¼ºµ±²¸½ÀÍÙÜßãæååäâÞØÒËÈÆÇÉÐÙÞßÞÛÙØÖÔÐÊƼ·±¯²¶¸¹ÃÈÍÑÐÎÌËËÇÀ·°«§¦¤µ¹¼¾»µ²³³³²±¯¯´½ÊÕÚÛÜÜÛÚÙÚÚÙÕÓÐÎÍÏÒÖ××ÚØ×ØÙØÖÔÒÑÐÐÑÓÕÖÛÜÜÚÔËý¹´±´³¨¦ª´¼¼¸¹¾Á¿ÁÅÇÇÍÓÑÕ×ÕÖØ×ÒÎƽ·³³¼ÇÒÓÔÓ̽¬Ÿ’ŒŒ’œ§®°®§™Š{{€‚‰”¡«®®¥—˜™–•• ±ÃÊÊÉÇÄÈÈÄÁÄÌÐÎû¯¦¢ žœ“•——––˜š–—˜˜˜—––”ŒŒŒ‰…ƒ}xqg]VIC==CKQSWWWUSRSURRSTVXZ[^aehiknpuw|†Š—˜™›ž¡¤¥¨«®°±³¶¸¿¿ÁÂÄÆÇÈÉÊÌÎÑÔÕÖÙÚÜÝÝÝßáààààáãäåèèèèèéêëëëìíîîïïîîîîïðñòïïðñòòññððððððððññññññññññññññññóòññññòóóñïðòóóòôóóòññòòññññððððôóóòñððïòòññððïïððððððððññññññññðððïïïïïóñððññïîòðïïðïîìëìííííìììëêèæäãâãâáßÝÛÙØÙØ×ÕÔÒÑÐÍËÈÄ¿»¸¶¶³±°¯®«©¦¦¥£ œ™—š™˜•“‘ŽŒŠ‰‡‡††…„„ƒ‚€€{|}~€…‹“˜Ÿ¥¨ª¬®°²µ··¶³±®®¬¬®¯¯ª¦¦©¬¬«¥¢š§´¾ËÐÕÙÙ×ÖÕÖÕÒÐÏÏÑÒÐÎÈ¿¹¸½ÃÆÑÛßáåçæååäáÛÔÌÈÇÉÌÐÓÔÕÔÏÏÎÎÎÌÇĸ´®°¶»¾ÄÉÏÒÑÍÊÈËÇÀ¸²ª©«³»¿Á¾·³²²±¯«ª¯¸ÄÐÖÚÛÜÛÚÙÙÚØÕÒÏÎÍÏÓÖØØØ×××ØÖÓÐÍÍÍÎÐÓÖ×ÝÝÛ×Ïż¶·´¶»º´¬´¸¿ÆÆÄÆÊÌËÎÒÒÐÓØÕ×Ø×ÙÙÓËø¬¥£¨¶ÃÓÓÓÏŵ£—Œ”Ÿª±¶²©š‹~~‚„‰”¡«¯¯£™šš—–˜§¹ËÑÏÏÐÑÕÕÒÎÏÔÔÐÅ»°©§¦£ ”•–———˜™––——————”’ŽŽ‹ˆŠ†‚|uj]SE>649BILMNMKGDCCDDDEEFGGJMQSTUWY]`flrvyzƒ„…‡‰ŒŽ’”˜š›ž¡¤¦§¨ª¬®¯°°±²´·¹¼½ÁÃÅÆÆÇÊÌÌÌÌÍÏÐÒÓÙÙÙÙÚÛÜÝÞÞàáãäåæææååçéëíêëìíîîîíííííîîîîííííííííðððððññññððïïððññïîîðòòñóòðïîïðñîîîîîíííìììííîîîîîíììëëêìììììëëëëëëêêééèéééèèèèçéèææççåããáßÞßÞÜÚÛÛÛÛÚØ×ÖÖÕÓÑÏÍËËÉÈÆÃÁ¾¼»º¹·µ³±°¯«ª¨¦¢Ÿ›•’ŽŽŠˆ‰ŠŠŠ‰†ƒ€€€~|zzz{{zz{{|}~~€€€‚„†ˆ‹‘™žž¥´¸»¼¾ÁÃÅÈÈÇÅÄÁ¿¾½½¼º¸¯¨¡¡¦«ªª©¨«´ÀÉÍÒ×ÙÙØ××ÖÕÓÒÑÒÔÕ×ÕÐÇ¿¼¿ÃËÒÛàãåææåææäÞÖÍÈÇÊÌÍÌËËÌÌÌÌÍÎÌÈż¸³°²¹ÀÄÇËÑÓÑÌÈÆÇþ¸³°®®±¹ÁÄÆÆÁº·¶µ³°ª©µÀËÔÙÛÜÙØ×××ÕÒÏÎÌÌÎÒÖØÙØ××××ÔÐÍÉÊËÍÑÕÙÛÛÙÔÏÈÁ¼¹»»¾Äú³±º¿ÇËÌËÎÑÓÒÓÕÓÏÏÓ×ØØØÚÙÏ÷ª›•–¡´ÄÔÕÔÏò¡–“““–œ¤¬±µ°¦˜‹„ƒ„‚‡’ž¨¢ŸŸ¡¡Ÿ ¥±ÃÓÖÓÓÖØÙÚØÕÕ×ÕÏÊÀµ¯®¨£–•–—˜™™™——————˜˜–”“’‘ŽŠ…€ym]RD<2/4>FJKLLID?=<>>=<;9877:>@A@ABEIOV]cfhqrsuvwxxy{ƒ…ˆ‹Ž’“•–—ššššœžŸ¡¥§ª««¯±³³³´¶·¹º½½½¾¿ÀÁÂÅÅÇÉËÍÎÏÐÐÐÐÒÔ×ØÙÚÛÝÝÞÞÞßààááâââççççççççééêêëëììííììììííîìêëíîîíïîìëêëìíêêêééèèèåååæææææããâáàßßÞßßÞÞÝÝÜÜØ×ÖÖÔÔÓÒÒÒÑÑÐÐÐÏÎÌÊÊËËÉÇÄÂÀ¿¿¾¼º¼¼»º¸µ³²²±°¯¬«ª©¨¦¤¡Ÿž™™—•“’‹‹‹Šˆ…ƒ‚|ywuutqoqsuwxyyyuwxwutuwyyz{|€‚‚ƒ„†‡ˆ‰ŒŽ‘•›¢§°¶¿ÆÊÌÍÎÏÐÒÔÕÔÓÒÐÎÌËÉž¹¨ ˜˜Ÿ¦¨¨©±´¶½ÆÎÒÖÚÜÜÛÚÚÙØ×ÖÖ×ØÙÖÖÔÍÆÁÁÃÍÑØßãäåææççäßÖÎÉÇÈÉÈÆÅÅÆÍÍÍÎÏÍÉÆÁ¾¹µ¶»ÂÈËÏÔÕÑÌÇÅ¿»·´³³³¶¿ÇÊËÊļºº¸µ²®«©¯´¾ÉÓÙÛÜÙØ××ÖÔÑÎËÊÊÍÑÖØÙÙØÖÕÕÒÎËËËÌÍÐÓÖØÕÑËÅÁÀÀÁÂÂÆÊǽ¶µ¾ÅÍÐÐÑÓÔÕÒÑÐÌÆÅÉÔÖØØÚ×ʼ¬ž‹Ÿ´ÅÒÔÔα¡˜”•˜¢©®²´®£–‹†…†‚‡’ž§««§§©¬ª§ª±¾ÌØØÔÕØÚØÚÚ×ØÙÖÐÍÅ»´±®¨¤—–•–™šš™˜˜—–––—˜˜——•”“’‘ŽŠ†‚|p_RD;0,1<FKNPQNID@?>=;84/,*-04665456:@HQX]`cdeffeedhjmopruxzz{|}~€…„ƒƒƒ„†‡‹Ž‘‘’•—™™™š›œžŸ££££¥¦¨©«¬¯±³µ¶··¸¸º¼½¾ÂÃÄÆÇÈÈÈÌÌÌÍÎÎÏÏÕÕÕÕÕÕÕÕÔÕÕÖ××ØØÝÜÜÛÛÜÜÝÝÛÚÚÜÝÝÝÝÜÜÛÚÚÛÛÙÙØ××ÖÖÕÖÕÔÓÑÐÏÎÌËÊÉÈÇÆÆÃÃÂÁÁÀÀ¿¾½¼»¹¸·¶µ´´³²²±±®¬ªªªª¨¦¥£¡ žœžž›™–”“““’‘‘‹‹Šˆ‡…„„€€~}||wxxwtqnmmjhgfeb``beimruwwz}}zz}€‚ƒ„†ˆ‹Ž‘’”–˜šœš›Ÿ¢¨¯´ÂÆÍÒÕÖØÙ×ØÚÛÛÛÚÙÙ×ÖÕÒʾµ¡—•Ÿ££¦¬´¹»ÀÉÐÔ×ÛÜÜÛÚÛÜÛÛÚÚÚÚÛÕ××ÒËÆÆÇÎÐÖßããäççççäÞÖÏÊÅÄÂÁÂÃÅÆÍÍÍÎÏÍÉÆÃÁ½¹¸¼ÃÈÑÔÖÕÑËÇÅÁ¿»¸¶¶·¸»ÃÌÏÐÏÈÀ½½»¸´°«²µ½ÇÑ×ÚÚÙØÖÖÖÔÐÍÉÈÈËÐÔ×ØÚ×ÔÒÐÎËÉÍÌËÊËÌÍÎÏËÅÀ¾ÀÄÇÅÅÇÉĺµµÁÊÓÕÔÕÕÔÑÌÇľº»ÀÌÒÖØØÒŸ¦™ŒŠ’¡µÄÎÐÑË¿¯¡™‘’•™ ¨¯³¶¯¤˜Ž‰‡†„†˜¥¯®±³¶¸³¯²¹ÉÓÚØÖ×ÙÙÙÛÛÙÚÜÙÓÌÇÀ¹³®©¦˜–•–™›š˜š™—–••–—ššš™—•••Œˆ†ucUF<0,2>IOMOQPKFB@FDA;5.(%)-121//..17@JS[_``a`_^\[^aceegjljjkkllmmpnmllnpqvxzzz{}€€€€€‚ƒ‰‰‰Š‹Ž‘’”–˜™šššœžŸŸŸ£¤¦§©ªªª®¯¯°±²²³³³³³³³³³±²²³´µ¶¶º¹¸¸¸¸¹ºº¸¶·¹ºº¹¸¹¹¹¸¸·¶µµ´´³²±±²²±¯¬«ª©©¨§¥¤££ ŸŸžœœžœš™—–•••”““’‘‘Ž‹‹‹‹ˆ‡ˆ†„„„„‚€€}|{}}|{yxwwsssrrrrrqqqqqqrrnoponkhfigdcba_\\]`dkrx{w|}}…‡‡‰‹Ž’”–›œž¡£¦§¨¬®°²µ»ÃÈÐÓ×ÚÛÜÝÞßßàààßÞÝÜÛÛÛØ;²‰–ž ¤«³¸ºÀÊÓÔ×ÚÜÛÚÚÚÜÜÛÛÚÚÙÙ×Ø×ÑËÇÈËÐÏÔßåäåéèèæâÜÕÏËÄÀ»»ÀÅÇÈÌÌÍÎÐÏÌÉÃÃÁ¾½¿ÆË×ØÙÖÑËÈÇÅ¿»¹¹¹º¿ÈÑÔÖÔÎÆÃÂÀ½¹µ²°´¶¼ÅÎÕÖÖÕÔÒÒÑÏËÈÆÅÅÉÎÓÖ×ÚÖÐÌÊÉÇÅÅÅÄÃÄÅÇÈËÈÄÀ¿ÀÂÄÂÁÁ¼´²´ÀËÕÖÕÕÓÏž·³®¬±¹ÃÌÕ×Õζ«Ÿ””œ©¹ÆÍÐÑ˽ ™•“‘’˜¡«²¶°¦œ•‘Ž˜¤°·¸¶»¾ÃÅ¿º¿ÈÑÖÙ××ÛÛÙÙÛÛØÙÛÙÓÌËÇÀ¸²¯¯˜–”–šœš˜›š˜–•••–›œœ›˜——˜“ŒŠ‡{iZI?3.4AMS^acc^YUSPMIC:2+'$(,-,*)(&)/8CMV[cddca_\[WY[\]^`bbbbbbbbb_^]\]_bcgiklklnpooonnopprrrsuvxyxyz|}€€‚„„„ƒƒ†‡‰ŠŒ‘’’“”•––••••••••””•–—˜™™™™˜˜˜˜™™™˜–—™šš™—˜™™™˜–•••”“’‘ŽŽŽŽŽŽŒ‹Šˆ‡‡ˆ‡‡†…„ƒƒ€}{yxw|{{zyxwwxvtssrpnonllmlkiiijjjjihlkjhfdcbddeefggghiijklmmkmnponljkifeeca__`bgnv~‚Š““‘‘–š›œž £§ª«®¯±³¶¹º»¸º¼¿ÃÉÑÖÙÛÞßÞÞàáååååäãâáÛÛÜÞÛϾ±šŠxt~Ž™ž¤«²¶¸¿ËÖØÛÞßÞÝÝÞßßÞÝÜÜÛÛÙØÕÎÈÆÈÌÑÏÔßæåæëéèåàÛÔÏÌý¶·¿ÆÊÊËÌÍÐÒÒÏÍÄÅÄÂÁÄÊÏÛÛÚÖÐËÉÈÉÇþ»ºººÁËÔØÚØÑÉÈÇÅÿ»¸¶¶·»ÃÌÒÔÓÏÎÍÌÌÉÅÂÄÄÄÇÍÒÕÖÙÔÍÈÆÅÄúº»¼¿ÂÅÇÉÈÅÃÁÀ¿¿½»»»µ¯¯³½ÉÔÔÓÓÐÊ»³ª¥¢¢ª´½ÉÔÖÓËÀµ³¨žŸ§²¾ÉÐÓÓ̾®¡šž™‘‘›§¯³®¦ ›™˜—”˜¡®ºÀ¿½¿ÄËÎÊÆÌÖÔ×Ø×ÙÞÞÛÚÛÚ××Ù×ÑÍÏÎǾ··¹ \ No newline at end of file diff --git a/tutorial/bridge/opencv/tutorial-bridge-opencv.cpp b/tutorial/bridge/opencv/tutorial-bridge-opencv.cpp new file mode 100644 index 0000000000000000000000000000000000000000..be16f98666082ab798fbb76a69808b13fab1cbb0 --- /dev/null +++ b/tutorial/bridge/opencv/tutorial-bridge-opencv.cpp @@ -0,0 +1,53 @@ +//! \example tutorial-bridge-opencv.cpp +#include <visp3/core/vpCameraParameters.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> + +#if VISP_HAVE_OPENCV_VERSION >= 0x020300 +#include <opencv2/core/core.hpp> +#include <opencv2/imgproc/imgproc.hpp> +#endif + +int main() +{ +#if VISP_HAVE_OPENCV_VERSION >= 0x020300 + //! [Set ViSP camera parameters] + double u0 = 326.6; + double v0 = 215.0; + double px = 582.7; + double py = 580.6; + double kud = -0.3372; + double kdu = 0.4021; + vpCameraParameters cam(px, py, u0, v0, kud, kdu); + //! [Set ViSP camera parameters] + + //! [Set OpenCV camera parameters] + cv::Mat K = (cv::Mat_<double>(3,3) << cam.get_px(), 0, cam.get_u0(), 0, cam.get_py(), cam.get_v0(), 0, 0, 1); + cv::Mat D = (cv::Mat_<double>(4,1) << cam.get_kud(), 0, 0, 0); + //! [Set OpenCV camera parameters] + + //! [Load ViSP image] + vpImage<unsigned char> I; + vpImageIo::read(I, "chessboard.pgm"); + //! [Load ViSP image] + + //! [Convert ViSP 2 OpenCV image] + cv::Mat image; + vpImageConvert::convert(I, image); + //! [Convert ViSP 2 OpenCV image] + + //! [Undistort OpenCV image] + cv::Mat imageUndistorted; + cv::undistort(image, imageUndistorted, K, D); + //! [Undistort OpenCV image] + + //! [Convert OpenCV 2 ViSP image] + vpImage<unsigned char> IUndistorted; + vpImageConvert::convert(imageUndistorted, IUndistorted); + //! [Convert OpenCV 2 ViSP image] + + //! [Save image] + vpImageIo::write(IUndistorted, "chessboard-undistorted.pgm"); + //! [Save image] +#endif +} diff --git a/tutorial/computer-vision/CMakeLists.txt b/tutorial/computer-vision/CMakeLists.txt index a8aed1f17a1ef4dcb37eb8be9d85d403312b707b..bde9d4c633a3550e2914f71434ec23a4b70ca457 100644 --- a/tutorial/computer-vision/CMakeLists.txt +++ b/tutorial/computer-vision/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-computer-vision) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_blob visp_vision visp_io visp_gui) set(tutorial_cpp tutorial-homography-from-points.cpp diff --git a/tutorial/computer-vision/tutorial-homography-from-points.cpp b/tutorial/computer-vision/tutorial-homography-from-points.cpp index e4aae515bcd047b8119ff921f2a75d4571139d30..6da57bfcb8b4196ca70ac39c1b4d1f0a557744e7 100644 --- a/tutorial/computer-vision/tutorial-homography-from-points.cpp +++ b/tutorial/computer-vision/tutorial-homography-from-points.cpp @@ -1,19 +1,19 @@ //! \example tutorial-homography-from-points.cpp //! [Include] -#include <visp/vpHomography.h> +#include <visp3/vision/vpHomography.h> //! [Include] -#include <visp/vpMeterPixelConversion.h> +#include <visp3/core/vpMeterPixelConversion.h> int main() { //! [Set 3D points] double L = 0.1; - std::vector<vpPoint> oP(4); - oP[0].setWorldCoordinates( -L,-L, 0); - oP[1].setWorldCoordinates(2*L,-L, 0); - oP[2].setWorldCoordinates( L, 3*L, 0); - oP[3].setWorldCoordinates( -L, 4*L, 0); + std::vector<vpPoint> oP; + oP.push_back( vpPoint( -L,-L, 0) ); + oP.push_back( vpPoint(2*L,-L, 0) ); + oP.push_back( vpPoint( L, 3*L, 0) ); + oP.push_back( vpPoint( -L, 4*L, 0) ); //! [Set 3D points] //! [Simulation] diff --git a/tutorial/computer-vision/tutorial-pose-from-points-image.cpp b/tutorial/computer-vision/tutorial-pose-from-points-image.cpp index a4140871059de0de316c6a00e1b36cb6285bad1a..a09ba98b13c41f8363f1c8ece5ccd43834771163 100644 --- a/tutorial/computer-vision/tutorial-pose-from-points-image.cpp +++ b/tutorial/computer-vision/tutorial-pose-from-points-image.cpp @@ -1,11 +1,11 @@ /*! \example tutorial-pose-from-points-image.cpp */ -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDot2.h> -#include <visp/vpImageIo.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpPose.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/vision/vpPose.h> void computePose(std::vector<vpPoint> &point, const std::vector<vpDot2> &dot, const vpCameraParameters &cam, bool init, vpHomogeneousMatrix &cMo); @@ -56,11 +56,11 @@ int main() dot[1].initTracking(I, vpImagePoint(203, 366)); dot[2].initTracking(I, vpImagePoint(313, 402)); dot[3].initTracking(I, vpImagePoint(304, 133)); - std::vector<vpPoint> point(4); - point[0].setWorldCoordinates(-0.06, -0.06, 0); - point[1].setWorldCoordinates( 0.06, -0.06, 0); - point[2].setWorldCoordinates( 0.06, 0.06, 0); - point[3].setWorldCoordinates(-0.06, 0.06, 0); + std::vector<vpPoint> point; + point.push_back( vpPoint(-0.06, -0.06, 0) ); + point.push_back( vpPoint( 0.06, -0.06, 0) ); + point.push_back( vpPoint( 0.06, 0.06, 0) ); + point.push_back( vpPoint(-0.06, 0.06, 0) ); vpHomogeneousMatrix cMo; bool init = true; diff --git a/tutorial/computer-vision/tutorial-pose-from-points-tracking.cpp b/tutorial/computer-vision/tutorial-pose-from-points-tracking.cpp index a9af0cf034e084704aa183445c70379032d71de0..dc8fffcb894939b6069d9af4988d527e7b47d822 100644 --- a/tutorial/computer-vision/tutorial-pose-from-points-tracking.cpp +++ b/tutorial/computer-vision/tutorial-pose-from-points-tracking.cpp @@ -1,12 +1,15 @@ /*! \example tutorial-pose-from-points-tracking.cpp */ -#include <visp/vp1394CMUGrabber.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDot2.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpPose.h> +#include <visp3/core/vpConfig.h> +#ifdef VISP_HAVE_MODULE_SENSOR +#include <visp3/sensor/vp1394CMUGrabber.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#endif +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/vision/vpPose.h> void computePose(std::vector<vpPoint> &point, const std::vector<vpDot2> &dot, const vpCameraParameters &cam, bool init, vpHomogeneousMatrix &cMo); @@ -62,10 +65,10 @@ void track(vpImage<unsigned char> &I, std::vector<vpDot2> &dot, bool init) int main() { -#if (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) && (defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_CMU1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100)) +#if (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) && (defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100)) try { vpImage<unsigned char> I; -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vp1394TwoGrabber g; g.open(I); #elif defined(VISP_HAVE_CMU1394) @@ -89,12 +92,12 @@ int main() vpHomogeneousMatrix cMo; std::vector<vpDot2> dot(4); - std::vector<vpPoint> point(4); + std::vector<vpPoint> point; double L = 0.06; - point[0].setWorldCoordinates(-L, -L, 0); - point[1].setWorldCoordinates( L, -L, 0); - point[2].setWorldCoordinates( L, L, 0); - point[3].setWorldCoordinates(-L, L, 0); + point.push_back( vpPoint(-L, -L, 0) ); + point.push_back( vpPoint( L, -L, 0) ); + point.push_back( vpPoint( L, L, 0) ); + point.push_back( vpPoint(-L, L, 0) ); bool init = true; #if defined(VISP_HAVE_X11) @@ -107,7 +110,7 @@ int main() while(1){ // Image Acquisition -#if defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_CMU1394) +#if defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) g.acquire(I); #elif defined(VISP_HAVE_OPENCV) g >> frame; diff --git a/tutorial/detection/barcode/CMakeLists.txt b/tutorial/detection/barcode/CMakeLists.txt index add4cc6f4621b8e8be592116d819022e856c6732..13a85d6a4c0684917a5694c50e54d3fb270f35f1 100644 --- a/tutorial/detection/barcode/CMakeLists.txt +++ b/tutorial/detection/barcode/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-barcode) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_detection visp_io visp_gui) set(tutorial_cpp tutorial-barcode-detector.cpp diff --git a/tutorial/detection/barcode/tutorial-barcode-detector-live.cpp b/tutorial/detection/barcode/tutorial-barcode-detector-live.cpp index 60297d0fa99d255a310c4262bca7cceb97f57114..bb74a8dcdad7f8d4b3c88019361a0cb2c04cc903 100644 --- a/tutorial/detection/barcode/tutorial-barcode-detector-live.cpp +++ b/tutorial/detection/barcode/tutorial-barcode-detector-live.cpp @@ -1,11 +1,14 @@ //! \example tutorial-barcode-detector-live.cpp -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpImageConvert.h> -#include <visp/vpDetectorDataMatrixCode.h> -#include <visp/vpDetectorQRCode.h> -#include <visp/vpV4l2Grabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/detection/vpDetectorDataMatrixCode.h> +#include <visp3/detection/vpDetectorQRCode.h> +#ifdef VISP_HAVE_MODULE_SENSOR +#include <visp3/sensor/vpV4l2Grabber.h> +#endif int main(int argc, const char** argv) { diff --git a/tutorial/detection/barcode/tutorial-barcode-detector.cpp b/tutorial/detection/barcode/tutorial-barcode-detector.cpp index 6d9523f5b66396638602fa1cd06d94f3c937a997..df10870c5f360ea52f8c78855ab075213aa7ef22 100644 --- a/tutorial/detection/barcode/tutorial-barcode-detector.cpp +++ b/tutorial/detection/barcode/tutorial-barcode-detector.cpp @@ -1,12 +1,12 @@ //! \example tutorial-barcode-detector.cpp //! [Include] -#include <visp/vpDetectorDataMatrixCode.h> -#include <visp/vpDetectorQRCode.h> +#include <visp3/detection/vpDetectorDataMatrixCode.h> +#include <visp3/detection/vpDetectorQRCode.h> //! [Include] -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpImageIo.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/io/vpImageIo.h> int main(int argc, const char** argv) { diff --git a/tutorial/detection/face/CMakeLists.txt b/tutorial/detection/face/CMakeLists.txt index 258eaf1512e6eb094cbea5681e19f64b4dc237d6..728429718b7285cfbec46636e1dd9569e28eb32e 100644 --- a/tutorial/detection/face/CMakeLists.txt +++ b/tutorial/detection/face/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-detection-face) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_detection visp_io visp_gui) # set the list of source files set(tutorial_cpp diff --git a/tutorial/detection/face/tutorial-face-detector-live.cpp b/tutorial/detection/face/tutorial-face-detector-live.cpp index e50b4c338f90d7b16be343ae07ae036a3c60b692..735b3b2f37f2e5f8f49d920dc499a99f083aa2ef 100644 --- a/tutorial/detection/face/tutorial-face-detector-live.cpp +++ b/tutorial/detection/face/tutorial-face-detector-live.cpp @@ -1,9 +1,12 @@ //! \example tutorial-face-detector-live.cpp -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDetectorFace.h> -#include <visp/vpV4l2Grabber.h> +#include <visp3/core/vpConfig.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/detection/vpDetectorFace.h> +#ifdef VISP_HAVE_MODULE_SENSOR +#include <visp3/sensor/vpV4l2Grabber.h> +#endif int main(int argc, const char* argv[]) { diff --git a/tutorial/detection/face/tutorial-face-detector.cpp b/tutorial/detection/face/tutorial-face-detector.cpp index 9a6927bd95ed28e07f3d272faaf4ae406968410f..aa694cd3cc6e8b6f2fe86d9bdfcd2cf4bbb2ecf9 100644 --- a/tutorial/detection/face/tutorial-face-detector.cpp +++ b/tutorial/detection/face/tutorial-face-detector.cpp @@ -1,11 +1,11 @@ //! \example tutorial-face-detector.cpp -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> //! [Include] -#include <visp/vpDetectorFace.h> +#include <visp3/detection/vpDetectorFace.h> //! [Include] -#include <visp/vpVideoReader.h> +#include <visp3/io/vpVideoReader.h> int main(int argc, const char* argv[]) { diff --git a/tutorial/detection/matching/CMakeLists.txt b/tutorial/detection/matching/CMakeLists.txt index cb29651a5e98f7f4d901f9035aab81ac2200a60e..b70aca69df451b8c49f5c238ae9edd11a6dffd03 100644 --- a/tutorial/detection/matching/CMakeLists.txt +++ b/tutorial/detection/matching/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-matching-keypoint) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_vision visp_io visp_gui) # set the list of source files set(tutorial_cpp diff --git a/tutorial/detection/matching/tutorial-matching-keypoint-SIFT.cpp b/tutorial/detection/matching/tutorial-matching-keypoint-SIFT.cpp index b5f4b81c834250821811c68568c97025b6acfc99..dc680bc306d79949abb7572fbc7d8cb8ec8c7f31 100644 --- a/tutorial/detection/matching/tutorial-matching-keypoint-SIFT.cpp +++ b/tutorial/detection/matching/tutorial-matching-keypoint-SIFT.cpp @@ -1,9 +1,9 @@ //! \example tutorial-matching-keypoint-SIFT.cpp -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpVideoReader.h> -#include <visp/vpImageIo.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/io/vpImageIo.h> //! [Include] -#include <visp/vpKeyPoint.h> +#include <visp3/vision/vpKeyPoint.h> //! [Include] int main() { diff --git a/tutorial/detection/matching/tutorial-matching-keypoint-homography.cpp b/tutorial/detection/matching/tutorial-matching-keypoint-homography.cpp index 6aa46d5fe0d372c6c2d311507c0f254c3d9ddf63..42d097451069d70a449cdfea4f8b92cd6913f1f2 100644 --- a/tutorial/detection/matching/tutorial-matching-keypoint-homography.cpp +++ b/tutorial/detection/matching/tutorial-matching-keypoint-homography.cpp @@ -1,9 +1,9 @@ //! \example tutorial-matching-keypoint-homography.cpp -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpHomography.h> -#include <visp/vpKeyPoint.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpVideoReader.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/vision/vpKeyPoint.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/io/vpVideoReader.h> int main(int argc, const char **argv) { @@ -83,16 +83,11 @@ int main(int argc, const char **argv) //! [Allocation] for (unsigned int i = 0; i < nbMatch; i++) { - vpImagePoint matched_ref, matched_cur; - keypoint.getMatchedPoints(i, matched_ref, matched_cur); + keypoint.getMatchedPoints(i, iPref[i], iPcur[i]); //! [Pixel conversion] - vpPixelMeterConversion::convertPoint(cam, matched_ref, mPref_x[i], mPref_y[i]); - vpPixelMeterConversion::convertPoint(cam, matched_cur, mPcur_x[i], mPcur_y[i]); + vpPixelMeterConversion::convertPoint(cam, iPref[i], mPref_x[i], mPref_y[i]); + vpPixelMeterConversion::convertPoint(cam, iPcur[i], mPcur_x[i], mPcur_y[i]); //! [Pixel conversion] - - // Store the image coordinates in pixel of the matched points - iPref[i] = matched_ref; - iPcur[i] = matched_cur; } //! [Homography estimation] diff --git a/tutorial/detection/matching/tutorial-matching-keypoint.cpp b/tutorial/detection/matching/tutorial-matching-keypoint.cpp index a70938f0a430b9818f687503da0db6b20c7292f7..5e84a818cbea36f1aa498c79a7d0d60ce9c77cb0 100644 --- a/tutorial/detection/matching/tutorial-matching-keypoint.cpp +++ b/tutorial/detection/matching/tutorial-matching-keypoint.cpp @@ -1,9 +1,9 @@ //! \example tutorial-matching-keypoint.cpp -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpVideoReader.h> -#include <visp/vpImageIo.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/io/vpImageIo.h> //! [Include] -#include <visp/vpKeyPoint.h> +#include <visp3/vision/vpKeyPoint.h> //! [Include] int main() { diff --git a/tutorial/detection/matching/tutorial-matching-surf-deprecated.cpp b/tutorial/detection/matching/tutorial-matching-surf-deprecated.cpp index 243e582f55f0fa3114df5121c18ddf840be9b125..234f15e749deaec9b5e9385fc5d680a598a0f85c 100755 --- a/tutorial/detection/matching/tutorial-matching-surf-deprecated.cpp +++ b/tutorial/detection/matching/tutorial-matching-surf-deprecated.cpp @@ -1,8 +1,8 @@ //! \example tutorial-matching-surf-deprecated.cpp -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpVideoReader.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpVideoReader.h> //! [Include] -#include <visp/vpKeyPointSurf.h> +#include <visp3/vision/vpKeyPointSurf.h> //! [Include] int main() diff --git a/tutorial/detection/matching/tutorial-matching-surf-homography-deprecated.cpp b/tutorial/detection/matching/tutorial-matching-surf-homography-deprecated.cpp index d7e17a68d1584c60c365e802444f965cdf952a88..0e31e8ea3fc83992ac7ac70dc037bc56fd8d4be3 100644 --- a/tutorial/detection/matching/tutorial-matching-surf-homography-deprecated.cpp +++ b/tutorial/detection/matching/tutorial-matching-surf-homography-deprecated.cpp @@ -1,9 +1,9 @@ //! \example tutorial-matching-surf-homography-deprecated.cpp -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpHomography.h> -#include <visp/vpKeyPointSurf.h> -#include <visp/vpPixelMeterConversion.h> -#include <visp/vpVideoReader.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/vision/vpHomography.h> +#include <visp3/vision/vpKeyPointSurf.h> +#include <visp3/core/vpPixelMeterConversion.h> +#include <visp3/io/vpVideoReader.h> int main(int argc, const char **argv) { diff --git a/tutorial/detection/object/CMakeLists.txt b/tutorial/detection/object/CMakeLists.txt index b6d8a2e5f1747c0766a1b3ede8d26b5c2bcb2a14..e353bc12e3d17cabc6e7af8d980d96802f53bcb4 100644 --- a/tutorial/detection/object/CMakeLists.txt +++ b/tutorial/detection/object/CMakeLists.txt @@ -2,11 +2,13 @@ project(tutorial-detection-object) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_vision visp_mbt visp_io visp_gui) # set the list of source files set(tutorial_cpp - tutorial-detection-object-mbt.cpp) + tutorial-detection-object-mbt.cpp + tutorial-detection-object-mbt2.cpp +) list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/detection-config.xml") list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/detection-config-SIFT.xml") @@ -16,6 +18,15 @@ list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/teabox.wrl") list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/teabox.init") list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/teabox.mpg") +list(APPEND tutorial_data2 "${CMAKE_CURRENT_SOURCE_DIR}/cube.xml") +list(APPEND tutorial_data2 "${CMAKE_CURRENT_SOURCE_DIR}/cube.cao") +list(APPEND tutorial_data2 "${CMAKE_CURRENT_SOURCE_DIR}/cube.wrl") +list(APPEND tutorial_data2 "${CMAKE_CURRENT_SOURCE_DIR}/cube.init") +list(APPEND tutorial_data2 "${CMAKE_CURRENT_SOURCE_DIR}/cube.mpeg") +list(APPEND tutorial_data2 "${CMAKE_CURRENT_SOURCE_DIR}/cube0001.png") +list(APPEND tutorial_data2 "${CMAKE_CURRENT_SOURCE_DIR}/cube0150.png") +list(APPEND tutorial_data2 "${CMAKE_CURRENT_SOURCE_DIR}/cube0200.png") + foreach(cpp ${tutorial_cpp}) visp_add_target(${cpp}) if(COMMAND visp_add_dependency) @@ -27,3 +38,7 @@ endforeach() foreach(data ${tutorial_data}) visp_copy_data(tutorial-detection-object-mbt.cpp ${data}) endforeach() + +foreach(data2 ${tutorial_data2}) + visp_copy_data(tutorial-detection-object-mbt2.cpp ${data2}) +endforeach() diff --git a/tutorial/detection/object/cube.cao b/tutorial/detection/object/cube.cao new file mode 100644 index 0000000000000000000000000000000000000000..4408839f0f3bb2d4c713f3a04a12fdb5177988ca --- /dev/null +++ b/tutorial/detection/object/cube.cao @@ -0,0 +1,19 @@ +V1 +8 + 0.000 0.000 0.000 +-0.084 0.000 0.000 +-0.084 0.084 0.000 + 0.000 0.084 0.000 + 0.000 0.000 0.084 +-0.084 0.000 0.084 +-0.084 0.084 0.084 + 0.000 0.084 0.084 +0 +0 +6 +4 0 4 5 1 +4 1 5 6 2 +4 6 7 3 2 +4 3 7 4 0 +4 0 1 2 3 +4 7 6 5 4 diff --git a/tutorial/detection/object/cube.init b/tutorial/detection/object/cube.init new file mode 100644 index 0000000000000000000000000000000000000000..a43f55858dabfa35cc61e6999ff94a3c8155abf4 --- /dev/null +++ b/tutorial/detection/object/cube.init @@ -0,0 +1,6 @@ +4 + 0.000 0.000 0.000 + 0.000 0.000 0.084 +-0.084 0.000 0.084 +-0.084 0.084 0.084 + diff --git a/tutorial/detection/object/cube.mpeg b/tutorial/detection/object/cube.mpeg new file mode 100644 index 0000000000000000000000000000000000000000..a081b02e7569efcb71b30eb66d735d0ce778750f Binary files /dev/null and b/tutorial/detection/object/cube.mpeg differ diff --git a/tutorial/detection/object/cube.wrl b/tutorial/detection/object/cube.wrl new file mode 100644 index 0000000000000000000000000000000000000000..759f76c3de7521885b48e46fb02dcfbc58ed4678 --- /dev/null +++ b/tutorial/detection/object/cube.wrl @@ -0,0 +1,34 @@ +#VRML V2.0 utf8 + +DEF fst_0 Group { +children [ + +# Object "cube" +Shape { + +geometry DEF cube IndexedFaceSet { + +coord Coordinate { +point [ + 0.000 0.000 0.000, +-0.084 0.000 0.000, +-0.084 0.084 0.000, + 0.000 0.084 0.000, + 0.000 0.000 0.084, +-0.084 0.000 0.084, +-0.084 0.084 0.084, + 0.000 0.084 0.084 ] +} + +coordIndex [ + 0,4,5,1,-1, + 1,5,6,2,-1, + 6,7,3,2,-1, + 3,7,4,0,-1, + 0,1,2,3,-1, + 7,6,5,4,-1]} +} + + +] +} diff --git a/tutorial/detection/object/cube.xml b/tutorial/detection/object/cube.xml new file mode 100644 index 0000000000000000000000000000000000000000..8c9eccb753f701da824bcd040801273839d09644 --- /dev/null +++ b/tutorial/detection/object/cube.xml @@ -0,0 +1,47 @@ +<?xml version="1.0"?> +<conf> + <ecm> + <mask> + <size>5</size> + <nb_mask>180</nb_mask> + </mask> + <range> + <tracking>7</tracking> + </range> + <contrast> + <edge_threshold>5000</edge_threshold> + <mu1>0.5</mu1> + <mu2>0.5</mu2> + </contrast> + </ecm> + <sample> + <step>4</step> + <nb_sample>250</nb_sample> + </sample> + <camera> + <width>640</width> + <height>480</height> + <u0>338.7036994</u0> + <v0>234.5083345</v0> + <px>547.7367575</px> + <py>542.0744058</py> + </camera> + <face> + <angle_appear>89</angle_appear> + <angle_disappear>89</angle_disappear> + <near_clipping>0.01</near_clipping> + <far_clipping>10</far_clipping> + <fov_clipping>1</fov_clipping> + </face> + <klt> + <mask_border>5</mask_border> + <max_features>10000</max_features> + <window_size>5</window_size> + <quality>0.01</quality> + <min_distance>5</min_distance> + <harris>0.01</harris> + <size_block>3</size_block> + <pyramid_lvl>3</pyramid_lvl> + </klt> +</conf> + diff --git a/tutorial/detection/object/cube0001.png b/tutorial/detection/object/cube0001.png new file mode 100644 index 0000000000000000000000000000000000000000..378dae7198e1fb222dcac9ea1cabdc4acdfa1912 Binary files /dev/null and b/tutorial/detection/object/cube0001.png differ diff --git a/tutorial/detection/object/cube0150.png b/tutorial/detection/object/cube0150.png new file mode 100644 index 0000000000000000000000000000000000000000..80dd4bb7f7e9254cf1c861ab18e5842bc1031d56 Binary files /dev/null and b/tutorial/detection/object/cube0150.png differ diff --git a/tutorial/detection/object/cube0200.png b/tutorial/detection/object/cube0200.png new file mode 100644 index 0000000000000000000000000000000000000000..a128cc302b30283a907a98156ad4e541caac75e3 Binary files /dev/null and b/tutorial/detection/object/cube0200.png differ diff --git a/tutorial/detection/object/tutorial-detection-object-mbt.cpp b/tutorial/detection/object/tutorial-detection-object-mbt.cpp index c05e3b8071b0c7aefd58b614671f7a0b6f3358f5..92c9fdcf47aa449c2823e25b938dc7ed5d05777c 100644 --- a/tutorial/detection/object/tutorial-detection-object-mbt.cpp +++ b/tutorial/detection/object/tutorial-detection-object-mbt.cpp @@ -1,15 +1,16 @@ //! \example tutorial-detection-object-mbt.cpp -#include <visp/vpConfig.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpMbEdgeTracker.h> -#include <visp/vpVideoReader.h> -#include <visp/vpKeyPoint.h> +#include <visp3/core/vpConfig.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/mbt/vpMbEdgeTracker.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/vision/vpKeyPoint.h> +#include <visp3/core/vpIoTools.h> int main(int argc, char ** argv) { -#if defined(VISP_HAVE_OPENCV) && ((VISP_HAVE_OPENCV_VERSION >= 0x020100) || defined(VISP_HAVE_FFMPEG)) +#if defined(VISP_HAVE_OPENCV) && ((VISP_HAVE_OPENCV_VERSION >= 0x020400) || defined(VISP_HAVE_FFMPEG)) //! [MBT code] try { std::string videoname = "teabox.mpg"; @@ -127,7 +128,6 @@ int main(int argc, char ** argv) { keypoint_learning.setMatcher(matcherName); //! [Keypoint code config] } - //! [Keypoint declaration and initialization] //! [Keypoints reference detection] std::vector<cv::KeyPoint> trainKeyPoints; @@ -224,7 +224,7 @@ int main(int argc, char ** argv) { #ifdef VISP_HAVE_XML2 vpXmlParser::cleanup(); #endif -#if defined(VISP_HAVE_COIN) && (COIN_MAJOR_VERSION == 3) +#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3) SoDB::finish(); #endif } diff --git a/tutorial/detection/object/tutorial-detection-object-mbt2.cpp b/tutorial/detection/object/tutorial-detection-object-mbt2.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c83eca39432c74241e8d0f52052c818296bb9a9d --- /dev/null +++ b/tutorial/detection/object/tutorial-detection-object-mbt2.cpp @@ -0,0 +1,335 @@ +//! \example tutorial-detection-object-mbt2.cpp +#include <visp3/core/vpConfig.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/mbt/vpMbEdgeTracker.h> +#include <visp3/io/vpVideoReader.h> +#include <visp3/vision/vpKeyPoint.h> +#include <visp3/core/vpIoTools.h> + + +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020400) +void learnCube(const vpImage<unsigned char> &I, vpMbEdgeTracker &tracker, vpKeyPoint &keypoint_learning, int id) { + //! [Keypoints reference detection] + std::vector<cv::KeyPoint> trainKeyPoints; + double elapsedTime; + keypoint_learning.detect(I, trainKeyPoints, elapsedTime); + //! [Keypoints reference detection] + + //! [Keypoints selection on faces] + std::vector<vpPolygon> polygons; + std::vector<std::vector<vpPoint> > roisPt; + std::pair<std::vector<vpPolygon>, std::vector<std::vector<vpPoint> > > pair = tracker.getPolygonFaces(); + polygons = pair.first; + roisPt = pair.second; + + std::vector<cv::Point3f> points3f; + vpHomogeneousMatrix cMo; + tracker.getPose(cMo); + vpCameraParameters cam; + tracker.getCameraParameters(cam); + vpKeyPoint::compute3DForPointsInPolygons(cMo, cam, trainKeyPoints, polygons, roisPt, points3f); + //! [Keypoints selection on faces] + + //! [Keypoints build reference] + keypoint_learning.buildReference(I, trainKeyPoints, points3f, true, id); + //! [Keypoints build reference] + + //! [Display reference keypoints] + for(std::vector<cv::KeyPoint>::const_iterator it = trainKeyPoints.begin(); it != trainKeyPoints.end(); ++it) { + vpDisplay::displayCross(I, (int) it->pt.y, (int) it->pt.x, 4, vpColor::red); + } + //! [Display reference keypoints] +} +#endif + +int main(int argc, char ** argv) { +#if defined(VISP_HAVE_OPENCV) && ((VISP_HAVE_OPENCV_VERSION >= 0x020400) || defined(VISP_HAVE_FFMPEG)) + //! [MBT code] + try { + std::string videoname = "cube.mpeg"; + + for (int i=0; i<argc; i++) { + if (std::string(argv[i]) == "--name") + videoname = std::string(argv[i+1]); + else if (std::string(argv[i]) == "--help") { + std::cout << "\nUsage: " << argv[0] << " [--name <video name>] [--help]\n" << std::endl; + return 0; + } + } + std::string parentname = vpIoTools::getParent(videoname); + std::string objectname = vpIoTools::getNameWE(videoname); + + if(! parentname.empty()) + objectname = parentname + "/" + objectname; + + std::cout << "Video name: " << videoname << std::endl; + std::cout << "Tracker requested config files: " << objectname + << ".[init," +#ifdef VISP_HAVE_XML2 + << "xml," +#endif + << "cao or wrl]" << std::endl; + std::cout << "Tracker optional config files: " << objectname << ".[ppm]" << std::endl; + + vpImage<unsigned char> I; + vpHomogeneousMatrix cMo; + vpCameraParameters cam; + + vpMbEdgeTracker tracker; + bool usexml = false; +#ifdef VISP_HAVE_XML2 + if(vpIoTools::checkFilename(objectname + ".xml")) { + tracker.loadConfigFile(objectname + ".xml"); + tracker.getCameraParameters(cam); + usexml = true; + } +#endif + if (! usexml) { + vpMe me; + me.setMaskSize(5); + me.setMaskNumber(180); + me.setRange(7); + me.setThreshold(5000); + me.setMu1(0.5); + me.setMu2(0.5); + me.setSampleStep(4); + me.setNbTotalSample(250); + tracker.setMovingEdge(me); + cam.initPersProjWithoutDistortion(547, 542, 339, 235); + tracker.setCameraParameters(cam); + tracker.setAngleAppear( vpMath::rad(89) ); + tracker.setAngleDisappear( vpMath::rad(89) ); + tracker.setNearClippingDistance(0.01); + tracker.setFarClippingDistance(10.0); + tracker.setClipping(tracker.getClipping() | vpMbtPolygon::FOV_CLIPPING); + } + + tracker.setOgreVisibilityTest(false); + if(vpIoTools::checkFilename(objectname + ".cao")) + tracker.loadModel(objectname + ".cao"); + else if(vpIoTools::checkFilename(objectname + ".wrl")) + tracker.loadModel(objectname + ".wrl"); + tracker.setDisplayFeatures(true); + //! [MBT code] + + //! [Keypoint declaration] + vpKeyPoint keypoint_learning("ORB", "ORB", "BruteForce-Hamming"); +#if (VISP_HAVE_OPENCV_VERSION < 0x030000) + keypoint_learning.setDetectorParameter("ORB", "nLevels", 1); +#else + cv::Ptr<cv::ORB> orb_learning = keypoint_learning.getDetector("ORB").dynamicCast<cv::ORB>(); + if(orb_learning != NULL) { + orb_learning->setNLevels(1); + } +#endif + //! [Keypoint declaration] + +#if defined(VISP_HAVE_X11) + vpDisplayX display; +#elif defined(VISP_HAVE_GDI) + vpDisplayGDI display; +#elif defined(VISP_HAVE_OPENCV) + vpDisplayOpenCV display; +#else + std::cout << "No image viewer is available..." << std::endl; + return 0; +#endif + + /* + * Start the part of the code dedicated to object learning from 3 images + */ + std::string imageName[] = {"cube0001.png", "cube0150.png", "cube0200.png"}; + vpHomogeneousMatrix initPoseTab[] = { + vpHomogeneousMatrix(0.02143385294, 0.1098083886, 0.5127439561, 2.087159614, 1.141775176, -0.4701291124), + vpHomogeneousMatrix(0.02651282185, -0.03713587374, 0.6873765919, 2.314744454, 0.3492296488, -0.1226054828), + vpHomogeneousMatrix(0.02965448956, -0.07283091786, 0.7253526051, 2.300529617, -0.4286674806, 0.1788761025)}; + for(int i = 0; i < 3; i++) { + vpImageIo::read(I, imageName[i]); + if (i==0) { + display.init(I, 10, 10); + } + std::stringstream title; + title << "Learning cube on image: " << imageName[i]; + vpDisplay::setTitle(I, title.str().c_str()); + + vpDisplay::display(I); + + //! [Set tracker pose] + tracker.setPose(I, initPoseTab[i]); + //! [Set tracker pose] + + //! [Refine pose] + tracker.track(I); + //! [Refine pose] + + //! [Display tracker pose] + tracker.getPose(cMo); + tracker.display(I, cMo, cam, vpColor::red); + //! [Display tracker pose] + + //! [Learn cube call] + learnCube(I, tracker, keypoint_learning, i); + //! [Learn cube call] + + vpDisplay::displayText(I, 10, 10, "Learning step: keypoints are detected on visible cube faces", vpColor::red); + if(i < 2) { + vpDisplay::displayText(I, 30, 10, "Click to continue the learning...", vpColor::red); + } else { + vpDisplay::displayText(I, 30, 10, "Click to continue with the detection...", vpColor::red); + } + + vpDisplay::flush(I); + vpDisplay::getClick(I, true); + } + + //! [Save learning data] + keypoint_learning.saveLearningData("cube_learning_data.bin", true); + //! [Save learning data] + + /* + * Start the part of the code dedicated to detection and localization + */ + //! [Init keypoint detection] + vpKeyPoint keypoint_detection("ORB", "ORB", "BruteForce-Hamming"); +#if (VISP_HAVE_OPENCV_VERSION < 0x030000) + keypoint_detection.setDetectorParameter("ORB", "nLevels", 1); +#else + cv::Ptr<cv::ORB> orb_detector = keypoint_detection.getDetector("ORB").dynamicCast<cv::ORB>(); + orb_detector = keypoint_detection.getDetector("ORB").dynamicCast<cv::ORB>(); + if(orb_detector != NULL) { + orb_detector->setNLevels(1); + } +#endif + //! [Init keypoint detection] + + //! [Load teabox learning data] + keypoint_detection.loadLearningData("cube_learning_data.bin", true); + //! [Load teabox learning data] + + //! [Create image matching] + vpImage<unsigned char> IMatching; + keypoint_detection.createImageMatching(I, IMatching); + //! [Create image matching] + + vpVideoReader g; + g.setFileName(videoname); + g.open(I); + +#if defined VISP_HAVE_X11 + vpDisplayX display2; +#elif defined VISP_HAVE_GTK + vpDisplayGTK display2; +#elif defined VISP_HAVE_GDI + vpDisplayGDI display2; +#else + vpDisplayOpenCV display2; +#endif + display2.init(IMatching, 50, 50, "Display matching between learned and current images"); + vpDisplay::setTitle(I, "Cube detection and localization"); + + double error; + bool click_done = false; + + while(! g.end()) { + g.acquire(I); + vpDisplay::display(I); + + //! [Insert image matching] + keypoint_detection.insertImageMatching(I, IMatching); + //! [Insert image matching] + + vpDisplay::display(IMatching); + vpDisplay::displayText(I, 10, 10, "Detection and localization in process...", vpColor::red); + + double elapsedTime; + //! [Matching and pose estimation] + if(keypoint_detection.matchPoint(I, cam, cMo, error, elapsedTime)) { + //! [Matching and pose estimation] + + //! [Tracker set pose] + tracker.setPose(I, cMo); + //! [Tracker set pose] + + //! [Display] + tracker.display(I, cMo, cam, vpColor::red, 2); + vpDisplay::displayFrame(I, cMo, cam, 0.05, vpColor::none, 3); + //! [Display] + + keypoint_detection.displayMatching(I, IMatching); + + //! [Get RANSAC inliers outliers] + std::vector<vpImagePoint> ransacInliers = keypoint_detection.getRansacInliers(); + std::vector<vpImagePoint> ransacOutliers = keypoint_detection.getRansacOutliers(); + //! [Get RANSAC inliers outliers] + + //! [Display RANSAC inliers] + for(std::vector<vpImagePoint>::const_iterator it = ransacInliers.begin(); it != ransacInliers.end(); ++it) { + vpDisplay::displayCircle(I, *it, 4, vpColor::green); + vpImagePoint imPt(*it); + imPt.set_u(imPt.get_u() + I.getWidth()); + imPt.set_v(imPt.get_v() + I.getHeight()); + vpDisplay::displayCircle(IMatching, imPt, 4, vpColor::green); + } + //! [Display RANSAC inliers] + + //! [Display RANSAC outliers] + for(std::vector<vpImagePoint>::const_iterator it = ransacOutliers.begin(); it != ransacOutliers.end(); ++it) { + vpDisplay::displayCircle(I, *it, 4, vpColor::red); + vpImagePoint imPt(*it); + imPt.set_u(imPt.get_u() + I.getWidth()); + imPt.set_v(imPt.get_v() + I.getHeight()); + vpDisplay::displayCircle(IMatching, imPt, 4, vpColor::red); + } + //! [Display RANSAC outliers] + + //! [Display image matching] + keypoint_detection.displayMatching(I, IMatching); + //! [Display image matching] + + //! [Display model image matching] + vpCameraParameters cam2; + cam2.initPersProjWithoutDistortion(cam.get_px(), cam.get_py(), + cam.get_u0() + I.getWidth(), cam.get_v0() + I.getHeight()); + tracker.setCameraParameters(cam2); + tracker.setPose(IMatching, cMo); + tracker.display(IMatching, cMo, cam2, vpColor::red, 2); + vpDisplay::displayFrame(IMatching, cMo, cam2, 0.05, vpColor::none, 3); + //! [Display model image matching] + } + + vpDisplay::flush(I); + vpDisplay::displayText(IMatching, 30, 10, "A click to exit.", vpColor::red); + vpDisplay::flush(IMatching); + if (vpDisplay::getClick(I, false)) { + click_done = true; + break; + } + if (vpDisplay::getClick(IMatching, false)) { + click_done = true; + break; + } + } + + if (! click_done) + vpDisplay::getClick(IMatching); + +#ifdef VISP_HAVE_XML2 + vpXmlParser::cleanup(); +#endif +#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3) + SoDB::finish(); +#endif + } + catch(vpException &e) { + std::cout << "Catch an exception: " << e << std::endl; + } +#else + (void)argc; + (void)argv; + std::cout << "Install OpenCV or ffmpeg and rebuild ViSP to use this example." << std::endl; +#endif + + return 0; +} diff --git a/tutorial/grabber/CMakeLists.txt b/tutorial/grabber/CMakeLists.txt index bf7b7884e4d3f6ee317ad180973ce6388d135a94..83d45a00d3933c21bce434d8c294d51cef06ea3b 100644 --- a/tutorial/grabber/CMakeLists.txt +++ b/tutorial/grabber/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-grabber) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_sensor visp_io visp_gui) # set the list of source files set(tutorial_cpp diff --git a/tutorial/grabber/tutorial-grabber-1394-writer.cpp b/tutorial/grabber/tutorial-grabber-1394-writer.cpp index d764956eb6301872165835af02de69242f5ef3ee..cc02717e6b3316f9d81e96a1c78503c84c3532e1 100644 --- a/tutorial/grabber/tutorial-grabber-1394-writer.cpp +++ b/tutorial/grabber/tutorial-grabber-1394-writer.cpp @@ -1,12 +1,12 @@ /*! \example tutorial-grabber-1394-writer.cpp */ -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpDisplayX.h> -#include <visp/vpImage.h> -#include <visp/vpVideoWriter.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpImage.h> +#include <visp3/io/vpVideoWriter.h> int main(int argc, char **) { -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 try { bool save = false; if(argc == 2) { diff --git a/tutorial/grabber/tutorial-grabber-1394.cpp b/tutorial/grabber/tutorial-grabber-1394.cpp index ea41cfc92469c3e614055980057d54fc4255d5b1..bb17fc771415ce4e277b0e1869bf951783db034a 100644 --- a/tutorial/grabber/tutorial-grabber-1394.cpp +++ b/tutorial/grabber/tutorial-grabber-1394.cpp @@ -1,11 +1,11 @@ //! \example tutorial-grabber-1394.cpp -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpDisplayX.h> -#include <visp/vpImage.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpImage.h> int main() { -#ifdef VISP_HAVE_DC1394_2 +#ifdef VISP_HAVE_DC1394 try { vpImage<unsigned char> I; // Create a gray level image container bool reset = true; // Enable bus reset during construction (default) diff --git a/tutorial/grabber/tutorial-grabber-CMU1394.cpp b/tutorial/grabber/tutorial-grabber-CMU1394.cpp index a7b527dac8029a1b974f8a8d9b351c02a1a6be39..708297723d169aeb471a2dec57270d26678f319a 100644 --- a/tutorial/grabber/tutorial-grabber-CMU1394.cpp +++ b/tutorial/grabber/tutorial-grabber-CMU1394.cpp @@ -1,7 +1,7 @@ /*! \example tutorial-grabber-CMU1394.cpp */ -#include <visp/vp1394CMUGrabber.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpImage.h> +#include <visp3/sensor/vp1394CMUGrabber.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/core/vpImage.h> int main() { diff --git a/tutorial/grabber/tutorial-grabber-opencv-bis.cpp b/tutorial/grabber/tutorial-grabber-opencv-bis.cpp index aed7af6ec267c5918a9886520b85f7254364be41..eb5d1b77974a2bc9e3dedc44327cdf6f4ba216a4 100644 --- a/tutorial/grabber/tutorial-grabber-opencv-bis.cpp +++ b/tutorial/grabber/tutorial-grabber-opencv-bis.cpp @@ -1,7 +1,7 @@ /*! \example tutorial-grabber-opencv-bis.cpp */ #include <stdlib.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpImageConvert.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/core/vpImageConvert.h> // usage: binary <device name> // device name: 0 is the default to dial with the first camera, diff --git a/tutorial/grabber/tutorial-grabber-opencv.cpp b/tutorial/grabber/tutorial-grabber-opencv.cpp index 2586e2421a693400b74917f9f3cc11c67b0760af..1debe79660691009507b441e4e2fe0633e9beeca 100644 --- a/tutorial/grabber/tutorial-grabber-opencv.cpp +++ b/tutorial/grabber/tutorial-grabber-opencv.cpp @@ -1,6 +1,6 @@ /*! \example tutorial-grabber-opencv.cpp */ -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpOpenCVGrabber.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/sensor/vpOpenCVGrabber.h> int main() { diff --git a/tutorial/grabber/tutorial-grabber-v4l2.cpp b/tutorial/grabber/tutorial-grabber-v4l2.cpp index ff9087b123fb286f9a4d0082b7f4385cd3316948..ee7de4ae5e9f7fa6d3ea9aa4779af3782410b8a5 100644 --- a/tutorial/grabber/tutorial-grabber-v4l2.cpp +++ b/tutorial/grabber/tutorial-grabber-v4l2.cpp @@ -1,7 +1,7 @@ /*! \example tutorial-grabber-v4l2.cpp */ -#include <visp/vpV4l2Grabber.h> -#include <visp/vpDisplayX.h> -#include <visp/vpImage.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpImage.h> int main() { diff --git a/tutorial/grabber/tutorial-video-reader.cpp b/tutorial/grabber/tutorial-video-reader.cpp index cb7dd46887e7e7908896156486efa40db4a6c1c7..bd982d7c05cb43ab70ee8299ba0bf719e8757166 100644 --- a/tutorial/grabber/tutorial-video-reader.cpp +++ b/tutorial/grabber/tutorial-video-reader.cpp @@ -1,10 +1,10 @@ //! \example tutorial-video-reader.cpp -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> //! [Include] -#include <visp/vpTime.h> -#include <visp/vpVideoReader.h> +#include <visp3/core/vpTime.h> +#include <visp3/io/vpVideoReader.h> //! [Include] /*! diff --git a/tutorial/grabber/tutorial-video-recorder.cpp b/tutorial/grabber/tutorial-video-recorder.cpp index b00d4d7f1580795c835b5b5a2e5ee58e7673402c..c6cd4a1c8444f0da4230f3f603ad61f95b7f5385 100644 --- a/tutorial/grabber/tutorial-video-recorder.cpp +++ b/tutorial/grabber/tutorial-video-recorder.cpp @@ -1,11 +1,11 @@ /*! \example tutorial-video-recorder.cpp */ -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpTime.h> -#include <visp/vpVideoWriter.h> -#include <visp/vpV4l2Grabber.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/core/vpTime.h> +#include <visp3/io/vpVideoWriter.h> +#include <visp3/sensor/vpV4l2Grabber.h> /*! This example allows to record a video from a camera. diff --git a/tutorial/image/CMakeLists.txt b/tutorial/image/CMakeLists.txt index 3f72d7f0fd64f429f266b13c1b6d0f6eb65a6f8f..7067db4a3c3c188efc4c2752591a320e6e73305d 100644 --- a/tutorial/image/CMakeLists.txt +++ b/tutorial/image/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-image) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_io visp_gui) set(tutorial_cpp tutorial-image-converter.cpp @@ -13,11 +13,11 @@ set(tutorial_cpp tutorial-viewer.cpp tutorial-image-filter.cpp) -list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/lena.bmp" ) -list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/lena.ppm" ) -list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/lena.pgm" ) -list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/lena.jpeg" ) -list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/lena.png" ) +list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/monkey.bmp" ) +list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/monkey.ppm" ) +list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/monkey.pgm" ) +list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/monkey.jpeg" ) +list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/monkey.png" ) list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/chessboard.pgm" ) list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/camera.xml" ) diff --git a/tutorial/image/monkey.bmp b/tutorial/image/monkey.bmp new file mode 100644 index 0000000000000000000000000000000000000000..8159f97a239b3fa981a4ff64ebbceeacb97a30db Binary files /dev/null and b/tutorial/image/monkey.bmp differ diff --git a/tutorial/image/monkey.jpeg b/tutorial/image/monkey.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..71ac7ead951d97fb1794ae0d085a74ae5dde0252 Binary files /dev/null and b/tutorial/image/monkey.jpeg differ diff --git a/tutorial/image/monkey.pgm b/tutorial/image/monkey.pgm new file mode 100644 index 0000000000000000000000000000000000000000..d14c6826be13469317cba48c1454c8a528fa903a --- /dev/null +++ b/tutorial/image/monkey.pgm @@ -0,0 +1,298 @@ +P5 +256 256 +255 + <24 9'4 <222&&<2SESS2UE*2 S4 h$ 4&4'K<?dC42d^YYRF6AOO?A'D?%'?dC).d68r^86C0$C)6KnAC+6RW6& )@T003,W$WW))6ccW6;OR"E"4=IPCKTEErR,&C864.6)4;&406%286ERC&6;yCcWKEcK+8F^.D626%;$-mk]MRIWˆmh6)K~]@SKU]W]:SRA=Ciii2', 4D$&2v&9<,&&ESS&2SE2C&EU&42444 U?'?44%6TTnYC-YYR[48&446?022R04?')?+%"IRAO2AE4WE&&)0&+%,;&&%@8)%6&WO@) 8)O'"Od3OWEC@&=E)6"%&&C,444)4WW@@4"2O&.OWVEOO PcCT$8RRT+8R2FDF4,48==mmF46I=Woh]RDh]IIKC{m?K4UW6.-][C !!') ]*<<E9S„]<&2{S222292D2EE44WR4DS:?mF?mIRW4WFRWR&&%C)40RC)Ad4A.)A% IFTR8+&2@)%)4) "&"60@ %?O&%8@^OBOR48ERR6")O466,.+&&4% 6"&)E)6E36ccdcr=8rT? $RK+48RIO^d[YmnmYCRKY==kkA]M%:<:@4IK-Si[U64.-=-4ES4&,!4/$&&S1E*V9&EV<EE&22‹E4& 4h4 S?24SkdS,'DR4WYA=)R0RcOR; .%@& ?6,C‚C)[+8.Cdd6EEA0 &) +&))) &4%%0%46& & 8OO@ )&)"OO8)C%) &'@R=;OvVWdEWR$ ,C0KW2 $Rdmmn.8TdY&6RkmR<UK[]:K<'C[444:CM)4R?,%UW]{[4'9ES$*V22&&49<9&2*2V<C4VSSVE&EE2&42'4UU649'424[? ?446-ddRA?0+d[d=%@)A@&&)0A&8AR<0 ;Wc64;=&R3 +C& C.46% %&0%%2& +40"40&,&2 & E& "OR888=.=LPcWETc+TCOC.nI6F6m[=M$"8d6'YOM~6:[{`Uh-<MWD4RFRUhW8C.,hhiv{I!C4 1*VV2&*ESSEEVE2 222]S4ESS{VE24ESR4SRk%''2'4S4DRd84282;TI&4W@&&@&A4%"4?+46$C4,"&4)% +)&&2&)$&%4&%)64"46"T@)'0.E4RR68.=Kcc;8cW WcE,;6=m08A$"2TAT2-6<?R=+D]PK`AU~o]h~hDUihYRIU2@OOI9*:" <*&,9SE<VE<<]C22&ESS?RSSE222Rh~URhR4R??42R4')RR??+% )82&,%0@C4220%2O+&6,66&0& )& + 0@B))3R0&O8 )0,O3%6,,%&8)@6,=EKWBd=cB",cdCO4,"468)R0K,)?$IRdO),9C=<FOK&2.:~k[{{iUDChkD6D4%,49C''2S'''&<9h2E2<&Sh2&4E{SCSSV2 2ShS2S{SR2?RRRD2U?2)2E4DAW@ @;C64&,=@OC02+&2&& + + + +4@3 % &0&@)33R^R0'RdW666 46&466C.)664@8;.&;Rccc=cWP;KRTW@646.CAD+28"[RYY=2!-MRDYkk-)88U[[i@9{hKUhhDCR'44UUh~[,9VE*22 &E,*<E244SSS&'4SVRCSSS4&S{4&<4UR'R~h?4)44F?D)2A)%%OyROO686;644 + + +% "%2 + + + % + &))"@@BORcR03@dR=8" 3.36)& ,8))=TREWKOO.E6KccR=WRPWVWdR6OR6,%!4!OadP.6<hmO).WhMCR8RhiS$:[kahhhkWCDU9KU]S E2 &4E&<2 <E<&R[]]S2ESESSECSRE4CS{{44URUhh4444'F4DTCA8TccTOO464 6"&2R ")&0 )& ,EO. +" &3 + '&3:3)E^RVOyyRCRcR6)@E6.4" )88@WrrcRBOcWW?KVWcdV@;R86.,OR6?;)'"08?E ?KW&"IdIM]~YY`[U,':UCD]hMU]UiI9'$CC4DR?C2& SU49S24CESE22VS2SC44S24S4SSR'444SS!-?)'dT0 C4&,&4 )"&0$+4.&!4+@%% &)468),=,46 63)346,83)%&R@R^R:pydyRyTcv~O006 "@W@EcdRWRcc=WVWWE,;W,40;3. 66.,3&,22;6$C,AI,%<4","$-.!kˆR86MoWD.4S4444:),2hMCC?,*4!4244''&2 &S2<„iEV]C&E{V2&E{]SSSSSRCS24CC?RDCSWK&''444'2AW0)68&46E0@WE4" . ) + 6B==B&84;)' )6)& RR)4)R8@63@:@RLcvOydRyydROcmR4OWc&,R==;6RWRB=WWd6@B@B=KcE@6&604 )@R466& &44A&TE$"R+ , &-Wk44<SiU6DWFYkh:'4hm444DSUC4KUY4,9C4E42& &<V9<VI4<S[US]]S22SUEE2ES{RCRRChRC'4U4 2S2 +&0T4?C= "4R.@8OE.68W8&);.& +)6;E$".$6W8&).8BB6@3 )RO)+;ER8BRdBORddO~cvycR4C@0&&% + KR6,RBTB)EEO8""&ER8046, +,4R!6.=II IY-,%@[hdkmddkWDYYYaUhh{[[{h]M=&9C4 *<2&&',2$&*&Si4SC22ESSES2C&4{USS4&4RCRD4444'&O2%8&%6O@+;$)0&8C& ,KO&,"""PR6KC=$RBEmRyR,R=0).@vO@@R^RdvvRyddRcR40% +"63. & ) 2 2C "$686.-4<):U2-MkkkhCFRWdYhk~aM[„{WIFO4' '4 2* <V$C4&'4''S{SS&&22&4&44&&S44&'%4C'&-C6%44A)$)6&6%&&&)&4 +"..EB$==WyRPW†PTW&)RR@B)@OERWV=.WVRP.. %) + +&& +0%!4600,-:MM"2'"FkhhkhYkRCUSM-UW[UYFDS9'& '&&<&/ 'U'CSE*'4{{[S?EC2&24ShR4244URS4'4''%4+ ))&)0& && "&")'.EEB8WRdcRB3& @WO8'@B8PER",RB8 & + " + + +& +&)!,:D4''4)%6=<i~~~{hW]{F)'Rh[hYU[iS44'-&2&2&&4hC&<S?9U[{KE{US]S2ESUUhS?&2 '2&')%% +% + &&& + + +4C,;EE)6===cORO&& "&03ERBBR3@0& +&2& 2622,4MUK4'44DWWUh~hi{S[{[K4A?U[K4*,>ESE4")FR2&EE44i{E&2U$&i{[RU{SSSE&&S{{hhR4<2 4?)44') + ")8")8)))ccR3))). ) ,4 % +%%"-D)!,PkWhD:][K~]ISIKDC9[hdFA6 *]SI4 -442 &VV]i9*]]9'4 <]ES[U[?C444D{„S&44'4' -44 + + + .'@8E8)00& +0'")& + + +$%?"+!%6.<D?]UDUACC%EU?4KhRF+'44!E]S'%CD44S4&&&&EVV2]{IW4&SS<E2SCCR4CUE2'6D44'9&' &4)"% 3B8,@ + + )"4)66OFRMKD4U44ID4[]h{„ˆk2)F6!2SS4& 2C4)<E&&*<<EE*[SE]4'ESSS]S42[{{hS&'2kh+!'"4' + ,& + 44 + + + + %8I++C[[dn~d4-:[[hkM[[UC6Oo~t~~kd8'6SU4&4E4Dh?!<EVV&E< $$&&9S{SC4iSE*ES?C[US4' '4:KC'!-). "C, + + + + + + 2 $+6F`OY<& ,IUmk`F88Rd`{~~~M8KaMDDD?444CD4 2/222 <V< 4Sih{h{i24SSUDC)'9CE*&& + + + + +$////IV[[[I];// + ++)+8.4C4&,ADMYYn[^F]~{kWRDC-)DYdRD?' & 2[VECC4)&ESE]„SEE* E[hUSR:4[2" ")"". + + + 2+C0& )$;;;<[]]]]]]66]66'@ + 6FA6;E[KRD6.)'CDW~m~kYU4-4]OUUUUCC4'44<=WRD4CC 2<*VVV2[i[]]S/ES9D4<S{R4,CS:FdMD4% +". $ + + + + + + + 2&%& 2";A,O0 +8/66]II6<;;6]]]]6];&O3 & +?8FKIOO`k?))6C<:A`~]:,4IUhi{[[[]„[U6) "<]U)&2 2 9]S<&[SEVV<&9SihC4499Ck?449::CC.! +!. + + + + + + $"66666 + +%&&C0& 112"A424& +32;[];]]6/6IVI]I/?R &A0%%$++"Md`kF2-KU:SU6-1CD=h~~~hhKCUhhiE" U4 &* E**4*' CES]S )hh9*EE9C{h[SUhSC4 -.,"$" + +% 6666LLL]66"66L666.")46 +%% + &12)8)% O<I]]I]6&4D6]]V;;6E^%&)A8%+2I4+&++6DFYYO2)4Fm{W4!-=]kk{hF.",CURUF<<<=WkWRU42*2*&2]EEE*42CU49<4<I{{C222,4SUIShhWUW4 '-4,4- +8 + 0466]6]L66666666:482 + + +"&2<2"2)% + +O<II]]V;:K6]]]];;2y0 24+8)6A+%&"48$.6,)%EOaaI8)"4464:CD68Rk~~~~R)!!C[{{R4'A`mM:-::CSU4U <9$<E9ES]{<99DK]i„{S2,E{{{~{~U44D6446' + + +@)6]L6]L6,"666LL@80,2 + + &%2&.6C40 O9[[I]]V/6]]6]]I4^682IT;?4 & $+8?Y$+;I=A6")DDRRR`k`YFMYK[]6!DSK<RkkWM6&4!4KWMEE&/<E9*<1<E>,:UD9IE]„{{US]SDSkkUk`hhFDUD+!"&" + + + +O';666L6M666LL@B& )4) "@3<)2& @4;I];]]];6]]]66];U^8ROnOF4%&&%+,,,6)+"<Y^64?Od[RAFDFK<I]M.&FC42CE]SDWiSC'!!CD4)"&</ES]h&24DI][SUESVVS{„hkhh~WS4:[UWD<<)-+",+ R6O)6]66L]6666L;OO +%;2?'' /%&Y6 %0/6]]]]]]]]]]]]]"6[/OB =PRaRI22&& )& E=)=8?="0FYk~aYYkkYMWW4'44,94,4:41S]?C{SUKK<CC'$$*]]{S V<1&9E]]S?S]i„VCC4UWWYYkkM?6+".6%4+ +2$%&!0)666]]]]66L866L;P' 226+- +?I% A26]]]]]]]]]]]6]66;4R F?OYd[C?&) ,+,$Cn=+++$<YO="CD,-Ak`O6RSSC444D4%"Sh{„S4-C4 -444&4C&1$<<E]< V{D 4*4S[hUUS[S[U9:UU]UK2DW<&80)0.8$I8 " %&+A;FA& 00&6]]LL]]LLLLLL66666K%2=' & 2F? 0VV]]]]]][I66]];/*R "6.`[dTC;64&&.$I, +IC+8T+&-Yn^[[F''-!,C<=DUhhR?h{kR4?dkkUD4!*II442*ES $<1&,&.)$ISC9,C[[]ihhkhCKWk~~kU[M6Y]M]OD==F.$8=$%%06CI6=?A0 066]LL]LL]]LLL6L661.8+)! !64 0/6]]]]I]V]]]66&A3 DI=cOTRC@4)$$+I4+;CF+$, <mˆnA))44F64C9IU[{[D?C~kR4R`MR6&,>S:*'&9*&&<E'*<**E9,%9[S9 &,&II[{S[SK[{W[]]W<2MYMDA..?I8K,"% ++)),4CTF6ADD06L]]]6L]]]]66]6;E*82= )D6' ,*M /<;]]Vs]]]6/'03 2YarR[R.4) ,)$,W+C6+8 %CMC:4+)4DFRRDRCW[Uh]S4SDCSKRY82+'MhS4CE2'*V*$2VS'EV]E</* 'RWKCS[[[[<-DD<:9[I<FWkF6=A[O0$46C $$2 , &2CKPRd2 66]]L]66]L]]661 +%& %3&RY2 $*[ /<6I]I6/&&30OIOOnRK42+&+8IE=88MA.4Y[OF<RkhkkkWFFWYR{{hD?h{hWYWUD4.42FdWURSS4<<22&<9*1S]V9$* 4Ei[]D-4K[]{~YMC249C6-<6&Fn040,,I;" 4)43E@CII=%+ + 6666]][]]]66% > +)+ *' 238[C%A]% %@;IaMR^F8&)&$468I$EF8=$IamA)6`h`MU[WhWWWUR)?~hRRddURRkkhU4'-hmFFDDhU<4,*/<<2& 9% 9]]M]]99<2CCUDhSE9!P~~`FYkh="=46.O=?P[[O8"&C&6%366@WIF8' 6666];"" $68& :! 2%"-I4&& +„v> OO4AAa`[R2+$&&2$C4$+A+%+OndYFFMWFIIAFRUF.)?Rh~RdddRRRD4-,-S{h4,)%?4 'V<&229'EE92!!4]]VEEE9CUhU[[WSSE<*1SihIOK:,K&FM.6OYC8$288I44 ,4&4TRR?-)4 1$,448% &9,I&0&0 @& 4O6IA;<I?RK4+"%8O44 %48EIR[666FRICdmmdRUSRYmR?ARddn~~hIR44W~i4 !))-42' 4$/9<&&<E9SK4*EO]>9[~~~{{UC2E]E$:O% ,>@hh:!!4FA0 CY.8)++))&06COI06M20 4:% +&;C8 :40 )0?C4<,?c=^C.%$& +"I 6FI4, CIIIF=FARRdmmYdYdkh?AR~‚~m~h[644[]C'"D`kR4C9*,EV$&<V2**&E9 *I]V>9:O[ihU[{~U9**9hU4,44?UhW<-DR.=0,[I.4I$2I4CC60R??+44%00-) R=AR$"1332A +EART@0A)0) 3333C)2^R=OIdnP;+48R,%, A4) ";IYYICAI[nˆˆmY`~~~kamkkWU[][h{hK424<W`YII4*2<&< &<E&&S:!%KI9**&&C[h{„{UUUK:RhIWhkU4.==R$%YmkA+CI"&;)C&&;0&0008AA?%00% +;Ec@26444?"1%1%$2$ 42C;4,4@O0R@O33RORR@@)0TTI??=?PnC4&-,+%.I++,+CnnmT^n‚dRDMk~~h~~dYdR4DUkh]??44CCU[S4'!4CC,&&4&<&EES< <EK{i]E<<4ES{]]iV[]MMKM{~„{[{]KM=?=08Iaa$ 4&+4&4&2@4ARC%44% ),6=WPn‚‚‚‚nC +23"%&0$ "2CT; &4C)%)0&C[rTI=?[TTI) + "6A= ++WO8 )[Ra~ndRIA-)Sh]kWMOFRW4CUS{~kddRR24ISE,':KI?44?4$&&49I>ISS4, 'Ci{U,'4S4S{[U[S<,,499Eh„iiSK-&%).&,8M.02A6+4,+C%%%%0AR4%%?A) )8)O33@@OO6&6, WWIEc[I6+ 1%""":"1'A?+ &%FWI8 %46C& &6C^nTF80&cPOK&$$4C,&CIY2;A8F[YYR+)ARDWk~[UDFYmWDD?DRWW??RdaWKSSC,4%'4US?44 49ESIEUIUC441IK{ihWKUhhhKKSK!4UhDCk~~hR.DMRF84,I8??A. &&K&&%&&C2)'%8I4% &%&%$$,)0;04[I%& $""/3""""1'3384%@A C0;EIKIE4+.+ %%0++4+,+?wPKRIOaaC80)344 8$RC +$)8&%&.mmdOIRd[AFWk~~~YkR?<YWk~mYRR???444CS4C[WUWMUSS4$&'2E[[E9CI99:@[]]SV2'CUi{{„{4'4USSi„hhC''4ADDOO0";dK6&&+CI8%40600 %42.))&AA%%0&%%%0%%&&&",TC4+&& 11">P'/1A13CO6)00 2 ,8K4KII^P;@4C+$.8IKPO=[kwwP=.8),&,+ 2A4+2F44IO+'6D<.6FR=akm`][Tdwmmmk~hRRdY~~{~~dddYY`h4'4R?2 2<<< *9S]]E99'4US{hC94CCOIEIC4USU]~k]KCIC?2:M<D&FY82I8?0=0;;,&36&4&%8+6&&AA4&+ACOCCC8.;08=, ..@8&& ''1@&%""""''8PO000 .&.00?a`k[O3;Pk…cUrckk=0! &)),+%++62484 .&0I[K)+:R=ARFRIRFDD44Rk`~ˆo~ndRRh{~{~kdR?RDUC4'DR?444'&9&&2<EE<,,[SKMDRIUi{hU[RCFRRW][]O:-EUh{hDD-)-6--?3"<==;0%$;82,),%%&,$!2$4?22A2+%4%+3".08==;O="&00&06 231&3%/I;"1@1KO600%00&)$$.2C3=AOPPUPcU."0)&2=8)=I++8[ndRK$.?8)+6<~‚‚mdRA2)4U[WFUkmhR?6I[C,E?Di{D!4C<[hC2%EM&&<>MVS,!$I~ˆkˆdW{[CDDCSii[DMM::4'4KWUK?<<6kF88I?O?+)))4$;64& % + %48D=IcP=30&OPCCC^C?P?&0$)63& +&1"'3U':1;.:1%?W606)&33"&66&+2 &$3&"34)03 ,4"0RR, "PO?OR, $<Uk`M=?6D]UF<hhkkdk~~dR4<?Wkk?2i{kUUCD'24444CR?4*9<* S[9$$$''!<]OSIKD[{hC66DWICD4"-KUR]UhC4A?2-F<$8IP.$&C3 8=,446) + ).=?3=O?CC=383A.A20 "")03 +;8&3%"'"I_:"":.6::0PB6O)&033@8.)6.. &$ &" )&360 ))+6+%,&+ "$%4)=8,&)+=UkYOWD8A4'4MWk~~YRRRhhdA4Mk~~kkmRF2F`hdD4??F%4&244<$*E9<24,>E[K),:,'4UUi]]S%!444:D]]YRIRACIY=A0+";=&E?A;T;)44& + &&03&2.22"&$! $,& ,4) + +,0?'"1"@U:1:.".:11EW@@0 .:VVVVdddkdVVEE3' ,)) +=+&+&8 6D)&M[CWRIFDDRF??%4?DDCI[k~~dRd~R?4Dh~~m~nCRDUWMY]UhU4,' 92E]S< 44-9E[SIC49]SSCICUUi]]]94RD44UUFU]KYddMMDY]aF"+6+F8? "A<$;C84) ".& + + +$?8&23:tY@.;/":P'0KW4 .EdoooouuusxxuosudoVVE3 + ) +8.I8)&8E +"RA"68)$82T[RYT+28AdRIAFWk]hkYdRARh~U??Si{~ddRUD44FRDC4IC6/$<<9SE4M9K[]k[]]<49E4Chk~khR<<d~YF464'44?Rh`K2=<?MFI" 48=;$,%&$4)& + ' ,O0'1 1_::>;;;IY12;O&'Lkppxuuyyysy|xyxyuuyuukk^E" ,40+$6M& . 4AA)64 8?FIICTOOTd‚‚ndA?R[kˆd?CA?Yh{kYY~{kRDS44 )CRd?4?A'*/VV]]E-%9S]K]OICC<DU{[S]O494CU{ˆ{{W:C??DRRWD-",4.&<3+P88$0.& 2)" ,C8, +"''LV^p^:. ?K?1@. 3>UUY@::I:Y12$)8^pp^suyxyyyy||||xx|xukkkkVLEL:8'E4$-6""2$6P=R8))%+A8CdddddRdnˆmkRRRARmm~m~kkdk~~kkWKRRhUWWhh[SUU4444'& <]ES[IC9E1-2E9' !19Vi[9& %9CD{{KCKU{~{hhh[9?CD&&),..&2? & 8 + + +.'",LdvyuppRK\>@P""'PfY;.;>;::A2 ^xxs||||||||„„||sxypV^LLE:L:08')36A,) %)"<8 )&)IRE64IYmdRTAYd~‚‚ddcWYYdk~~dddm~mkdkdRR{~DA4,4CSR4422$$Ei,99:'4CR:C,&%4SSUhC'.CWh{{~hKI2KUUDKDWC4'!- &=&&..+) + + + + +.EVVVVd^dVLEEVV^^my„|^'.;C?@P@'k@:";.6;1P@ + ^px|„‹”””””‹‹|„ym^RB860& &)66,)& AD)%4;6;0AWR4)-RDYYWW~~~dnm~d[R~ˆ~kdYI[mRDWFR?44C4!'CR4 &*2&&I:4C4)4S]~{[C4!,K]i„i:4-9C:Ci„i[I&!<F~iD<C[K-M%%8 )=<"4;% + +..EEEddodkoookkpkkkk^^u„„yE.?C3@U1"3y@:";6L::YY: 'L||„|””—”‹„„„„pRR@@340000$ )%%")"-'-YT8IIARYdOW`akdDDWkmddmkRFARYk~~~ˆdRRR{~R%'D48IRD44& ES]9,,:-%IOOS[oiv]E*24SSEE@K[i[KUU2%6)D[iK]h]]A?"+688$&I0%"%& +'..Vddkoodouyypppxxx^p^^yd=,?31P@'@y3"">R>;IIYY" .m||””””””‹‹„ymRRERVVVVVVVEE:)""& FT ."-??FDOAKRRT8DkRMRD')+RYRFRd‚~dFWY]{~khhR~kh{hU4,'?FUICCSC4 */VS9$*O*$:C]{h<<hhiI2!4]]9 4[ok~i<4CKDUM3CW<&=`k8CF-"& +"." % + + +'Edkoouuuxxpxpppx|xxxu^^P"\?APN"3w3.MLML.:NYU) B|„””—””‹ycy^^^kkssooooodddVE:8""")3) 84'4.)F$+RRA $4FDYF?4448RWkRRW~~mRRkhUS?RhR26FRdR=6W~kR4&4&4&2,2,@:9>9>E]]S9RUSKIS[]]<<CR]]@CWhhkR-DDC2<`WmA")6D34 , & +.LEddouxxyuup||||||||mWA'&C3Y_@13n@>LQL6"":PUA! $^”””—”‹yyy^^yyypxuuuuoooddokVE:.' "")6"), )CR+ )`kO2+ 6WYDMdd[YdhkRRWkR?FhhU:?RRR?24244'"!IShD'4444S 9EE1!9K9>[U4,9>IE:*&C[][[UhYWhE24Kkˆ{h[-&%.3"FY]3<A)-!4&+)0"..:33..EVkouxxy|x||u|„„„|VC: 3@__N1"@fNMQQQ6>:I:NYA 0m„”—‹~y^yy||xx|yyyuuoododsk^L''.""" ++ 0%2")D-++"2+6)4C46WhM6IAAWhhhU444'2?FA?RRhRU?A?ADUWW[S:42499&$&*1:KE@119:F:><E**O]>VppM[]E*,:<[[[i]I?3 !M`]M<<K<MD"!)..EEVVE:."":^pp||||||||||||ymd3'3:f_N1""1ZVUMQQQL.:INY@@0v‹””yRmyyy„||y|yyuuuoooodd^:83)% %4A4446+6F6.DOFR)4]kY??2:URIhkRRddFdn~~~~~hkR%)CKR4'%4C4''ES *</$$&*1$& *EE*4OU)',&,E,!4I{{iM:@14[P:<W<.FAM:&CAEEVddddVR')$:^pxx||||„|||†yP:."'U_NN1".1@fZQQQ>>>.1@@YP4By„”yRyy~„|„||yyyyuuoodd^E84)44 %A%"R?&%64)$284=WkkI?62DFRU{kddddndm~~~~RRhURRRhkhWkYWC%'4S?2!%94:2!!$$4<E>M`{KARWkhK4I[[]%&S„{ihD:iKRhR<YM.&.Y. +"% + Eddddddd^^L""8ppu|„„„„„„|‹„„y\@.'Y_ZLA"..@_VQMQL.6>:NNI;@0y‹”””ymy„yyy„„||x|yyyuyuddVO0+%4,.'::.' "&2)6 !8$+R8+TdmdWD)26FdWh~h{khm‚~YkdRdhhRFdkRRFW~~R4DC?R4C4 &CO9 ,UO9@O]I1,2<hPIUOO<E]]]/%!4[iU@KKIC2&DKM<2IM$"&OA-& 'EdVdddoooV^R:3B^yu‹„„„‹„vPN.""1YdULU6"">>I_VOMQQ>>>IIINI:$6|„”‹yyy„|„|„„”||||xyyuskE8@RO@@B:EEVE:3)&))&04F K`=2OICRWY?8)2?FYkkRRhhRkYFA?hhRR~hRARRdddhhhRR44?SCSK4**,K@11E9$%>EEUMCC@9S[iM?M<AFWM2!2@9@-.--".=<2W- +.ddddooousps^R:Rpy„„„„„|„„„vC@A"">IdYUUM."1@dZOOJML>L>IYNZI/'K||yy‹yy„|”„„|„||||yyxsd@@3OR^V^dksdkVV:')&&&6C8 4,'DU)!4F6=W~mRTO[dmkRCRR~~RCARh~~hdRTdRdd???4%44%2SkdR!"&%!&'-9IE]M<9KI>>>O>@,:1@[[[C-4KWA=.-]K-6F`-'"2:I%'33"'Ldoooosssss^^^R^‹‹”‹„„|~c31>6'1Y_YYL>6..:NYRQQQM8L>INZZI6$"=m|yyy‹~”„”„„„„|„|„|xxVO@LL^^^k^sxpypk^E3. 6)&%&)%-6?)%)2624`mYYYYYddddRRRRRRdhWYh~{hR04'CSS44444RR??4CD-OC,%,-1999:2CC$*,'*>>119EV]SI-!!!AKIU[SK, .:E::."3Voodosxsxpyp^^^m‹†”‹‹„„„ydUI>>"">YY@IO."6">MI_YUQMMQQMOIYdNI;""C~yyy””y„|„”„|„|y„y|x^:RR^k^dssyskpppk^:').))6464)4FRD%)+6C[RA2%!ID)D??DDChWRA?CRRRA?R{{hR?444CS]hRSSR4%%'%-<:C-99,*:%:FMKID[„„O*$*&914<:,'&>E-3EE, !$%) EVV^LR3Edouuuuxxxppp^^yy„†‹‹„„‹‹yy^IJ>.1IYYYZ>>."66>:VYOOMQQQLLZNY^;A"Cyuy‹”‹„‹”„„|„„”|y|^RVRV^kkuyyuoookkVL:)) )6@B) %)%6?4% 4Im[[[I?4?FRRRRhWRRRA??UR??RRRdd~~d4?444?~d??% 2 $,& :21I4!944-<:I9%DUi„[-)"FWikR66@IK1.MK4I>/$$2MA-+0,))).Vdkd^k^:3douuyyxxupupup^y~„†‹””„y~cA8...NdZUMM866"1I@NUMQQQQQULZNIII""0|uy”y””‹„„„„‹„”y|xER^sskdoyuououokkB3&& .BE;4;=6URI4%-R]R?ARRCRAWRA?DhY8ddd~ddRWOOORhhhkhdRUC4EUUhR'&!,9$$&9:'*44RYD,!44:91,1,@]MUUhk@-)+0``AM>O*,,"! +.)4.,;) %" .Vdd^sp^R:Edouysx|y|yuyudyv†””””‹„„yaAM8.IYZYUMQ>88"1A:VYZLOQQQMLUIZZIA1'Cyu„‹„”„”„„‹‹”‹yy^R^^pkoodousuuuskVR3&&&)))@6;;E=484226+&;4RddWTRFRR?22?RRRAdd~~~RRRRRddRR?444!'UkhC44&<E>> %*O]C@@I][OUK:S@9!%9IOUC..AR<&DU,$-<"8;OI;+ ,8Edooospy^:.Vdosysx|yxyummy~„—‹‹”yULM..>ZYYQQM68..M>1:NUQURQQQMMOIZYOA:"Cp||„„”„„„„””„ysRspupsssusuuusudVB836B@) )@8438)8O4.AA00)),6644Adnr‚dndAAAA2?Rdm‚mdRRddRd~~~WkR?4???DhhRC4CS&4&&,I2!4[E%!:CII1$$>iM214M::A`ki[U4,==MY3"9"&:<:6" .=<), &$ +Vduupk^m^^:Eosspxx|y„yyuyvv—”‹‹†UMM.6>YZYUOJ8.88>QAIdYUQQOOQQRUQQUIII"Cuu„~„†‹„‹‹”‹yyR^ys|x|yuuyuuuudR:8RRBR:00O8@@))6ERRW8)6C6@CRR.)KOYndOdRTRRR[[d‚‚ndRAA2FF`YRF??266M]h{S422&29,4,:2KU@%!%4E$$*<,/>2%2-&&.F`h]i{[9DA%&4,!&'<<&.?=IIY82+ VVuyppppyp^:Vskkxxx|y„yyyv†‹—””‹yUL8.8UYYZQ>QJM868JRQZUQQQOOORQAOUUUZN"Puu„‹‹‹„‹„‹”‹mR^ypxssssuuuuusV:38R^^RRR0688=88;O64EWRcycR6++22A4Kdd[ddIddYdAYRdnndYRFDD`kkdR?FYDCCS4424442 %1$.:::*-'",,*1<$$%<K=DCUKC]]-,,4&"&)M@,);[[K8&<64+EdkyxpppupyEEdsx|yx|~y~~v~†—””„†U>L.ZdUUQJ8L868>LQUQURQQRJOORQUVYZZ@1Cmu„‹~‹‹”””‹„mysyxxxsxysuuuudE.'R^^^dV^@3&)3))",@=E@ AEOEcrWOCAIY[TITddRRdmkFR‚ˆ‚dd~nmmYhhhWRR64-4FDSCS?4C4&,$%-K:1$!&2CKEVVE1$ ,I>@91:IUYhKK=MMDC488RODM8$+RI88 Eouyyyuuxp^R:^px||y||y~~yvvvv‹——”~y\L8M>ZdZUQQM888.8JQUVUUQQQJQQQUUZZNYI1>L|„„””””‹„ymyys|xxxyyxyuuoVBBLL^yypsV:33))0;RT;&8CEE4TdYTYm‚mm[AOkkdRR`d~n~~mdRAF[8k~~h[44,CRYR?4?% & %C&!'% 9VV9!4::UO12,*9@RA4:A[[WDKUY]]WKdYMUK=&8I8$0043+& +:kkooyp||us^VVssuy||||~~y†yv†”—~y`>>LMYYZURQRMLMM>>OUVUQQLQQOQOUVUZZZNA@d|„„~y‹””—”‹ymm|||y||yuuy|ys^E3L^^kx||sdV:)33)6=4,FC==446IRR4RI4;I[dCFRRaRTRWWRRY~~YYTRFOKhkhU4.DhR9:CSh?&' :2$%%IS1,%,>1 -!"C]i[E99$-UID2<@[O,!)86.<F=M=DKR<.A=.$0C?08K?$ .kkkpkyppuy^^R^px||||„~yyv†‹””c:L8LJNYUQUQ>>L>8>UZZVUUQQQQQOQRQUVIYZA>uy|„”‹vyy||||„||yyyyusVEL^^u|xxxuoVV388"";O46));B@R[RR6)6=OdddRMkRCAOk~dWh~kkI?FOYYMUR=26CU4,:CDKUhSURC4,&,""49%1<IP-&8R@9,,4[iIOI1,<<AKi[I99<-",4-!<]`hM6+804,;EE;, $8 "'ddkp|||u|y|mEVyp|u|yy„~„y~yy‹””‹rN>>>QZZUQRQ>NALJQMZIIAU]LQQQORQUUUZZN.>mpy~„†”†„†y„„|||||yyusysd:^^^pppyyukddV:3@8EKO@6@6@@C44E[=E;;KTkhdYR]W?Id~makhYFddkWUDSEIKFmkk?4?I?D4'4?4%OMO>,!-[ihi[I@2<S[[I>,'.M[ii[EE@<M-"6Yk[RIK=882$+44,$);,"'.'Lkokupp|uyyy^V^xxxu|xyyy~yvvy‹”‹y@M>OUYZQRQQL;>8QMUZNNNUQOQQOMOMUYYZZV>Uu|„„~””†„yy„„|„|y|yyxyysVL^^pp|xxxsuddVE8:6WPPWERVRWOIYCEOCI^I4FYdTRAA2FW`Y[RM]Y=<WhhU4'-DCIhkR44EFC?22A>$,@1$*2 %1192::&-9@I>* %21C@>I>&CK<)0?Ia`F 8$&=6$46TI&&':0'EdVkkxp|||y|p^Rxp||ppyyy„yv~”y@MMOUZUUOMM>L6QQQUZVYZURQLQQQQROZdZZNL>yy|‹””††‹yyyy„||||||||yodV^ppxxxyyyuuudV3'8,=6)B@ORVWcrcnWTdA4CTAIIRWn‚ndYdMF;<WkkO<?ADFYYWUSUCA6+4D')4RR??4 $ %1*1C@,>@11$$ -DS]]]S-!:[iD6".CFO6.6OI=4. :EL.Edkkkpx|y„|yy^Epu|y||pyypu~~„†‹„y@MORUZZUQUMJ8LQRUUZVUURQRRQQQQRUZYUZZIVy|„‹””””‹y|„„”|„„||yy||^^^xppy|xxxyuuudV3.RRORO66).OWO@OE66Tn^TTT[?28[w‚^FF`F=66:[hU?DUUMD4C94SC)-6-44'4RCF?R "!1:&%%@OS1!.6K]I1*,':@1/1<W]UM=<6<88=dwmO& Kn?),...:L^:Ldkksxxx|„„yym^^||„||y|uyv†”y@MOQZZUURMM88QQQQUUUQQQQRRQMQQRQYYZZNAVyu‹”†„|„„‹””||||||y|s^uupu|yuyyyuooV:0438@ROR@))6IWdn[EECT^ccnndTC;8IndRdY[IF=DFRYhWC6-:C?4<?4?CRhRD444'&!!4.!"$%',/%)]K* ""-P[@1',%::<FCA``M@2.-06-<F:304=D<$ ,.':EV^E:kkkdkppp|~y^y^Lpx~~„||~yyv†”†y@8OUZYUQOMQ>8JQQRQQUUQRQQQQOOORUUVYYIAVuu„‹‹”y„„„„||„yy|||yysppp||yyyuysuudV333')0.==BEEOEdWORCOc‚nddIRY[IDW`Ynndn[Td~m]kYYW<O[dmd?)!'44dmkF44'"!-%OO/-,<I</%2U99:I- -&.m`<AF."<<DDF=80 $2=;, '.VVkL:kksokxxyy„|y^^^||~y|yyv~†††r@MQQUZUUQRQM>LQQQUQUUQURQQOOOOJOYVZNN:Vuu‹”””——†y„‹„„„||||„„ys^^pu||||uououodd:33:33@38@@BRRRWc[c@@@OEKWdYdRRCRhFM`Yd^EYmmmkRIdd[R?YIAYRFR?)2'4%4S4!+"! ,>>2!&%1,2&.F<)IOM<9,!&=mo`]2-6DDUI1-2'!0F< +'LdkkL.Lokuxuxy|||y^R^uy„~||y|ymuyv~†yrIJROUZUURQJQQQQRQUQQUUUROOQRQMOOUVNZI:Vu‹””———”y„„‹‹”y||||||p^pxy|„|yyusuuoodRRRE330,,686)@WdOO^ccWcT@C[‚‚rnrndd68FFTRIAFRF=<Raˆ~ddhAAddT?46?44'2C211%% %,K2:&"!%,:-,I<&&&CYAC8=RkM<M..YRK<,)--<. EkokV3Eksyxxxyyyyy^^pm‹„x|muuuvy†‹rIMRZUUZOQQOJJMOOUUUVVSQQRQRRQQMMUIVVS1Vy”””———„y„„„„yy„|„||x^p|||||yx|ysuuooVR^^R@0%4,4;3)&6=TnccTTdcWdY[mIRdTd[dmdYRRIIYF44<FWkmYRWWTRRA2%44242,!-!!!%%!$$&@2&,@@1<<.36DM12=6<Rh]<F`Y`OAKI..+FM:&.VkkdE:ukkpxxxx„„~yyy^m„~y|uyu~†”nUJOOQVUUQRJGJMOQQZYVVUQROOOOQORROUZUS1V„”””——”‹‹„||”|„||ympy||||yyyyuuuodV^sVV33 &0OO@@ ,6@TTOOOCTnnnnnYTTRKC;n‚‚wm[RTRRFY[T[FD,4<FYd222??4&&,,!%!&9@1").A3<]]]][KAACKMi[@<FOK]iK<MCK26...?I4F0-& +"'".VkykE:Vkkuxx|ux„„ydymyy„„u|uu„u~‹†rIQRQQUZURNONOORJUYYZUZUQRROQOQQORUUQQ1Vy†‹†—yy„‹„„||„„umpmpu|||yyyyyuuuoVOsssVV3006&0OdO60EI^rrcWTRnddd[cTOA6<FAPOMWIKC;IkmF,-4A8244''44&'' ,21:229C@@1!!2&'+)AMOii2--%!2:1%&M]i[P<:K@@468COYD)$"+0'Edyuyk:Vkkks|yu|yym^^uy~~„yu„~~rIRQQQSYYROOOJJJRUYVZZZURQROOOOORRQUUQ1V„††—†yy‹‹„|„„„uupmmu„|||xyyyuuudVsdVodd3@6&&&0?@&6)4?dndOOOOcc^mnddAMOM]UKR.6F<8)&FF2-<<DA244444244$ 11%2&!K``M<IO2!-&"!)6.<K][KA2&:FWhK:FM3:6! ' 'Euy|yk:Eoppyxxuu||pdyuy„~„|uu|„~yu~†rZQQUUUVZQOJJJJOOUQUYYYURQQQOQOQOOUUSL1V††”—”y„„„„|‹„„|upvy|||yyyuuuudVssoddOO0&&0&A@@0+0&4;T^K@@COO~ndddYdYFAM]h{]?.+)<D<I8IDK:Ddd??S?%&4-&2-[A.<1%<i]3%-KD:&2@DMOOMO]U@I263&-$,"$+" +'EyuyupV:oypupxxx||yymmm„„„|uxv‹zURQUQUUQONJJJJOROUQVYZUQQQOOOOOORUOQAGV„‹”—”|y„„„‹”‹„„ummyyy|||yy|yuuodssssodd00%0RWOA&;IT^ndWE=dc~‚‚cORRAA.AMhkOI[K<DYW]W=%!KD4444%%11&::-&%1<-:K@2&!!3<M?W[KCMSI=.:=<U]K<.!9% 8=02+& 'Edouy||dEdxxssxyxuy|xummmm„‹‹„„p|||~v†jIORUQQRRQMJ8JQRRROOQUQUQRQOOOOOORQQQI1d‹”yy„‹‹|„„‹‹‹„„mpmm„|„„||yyxyyudsVsssssdO0%0@ROROR?88IIECC4FRd~m‚nO?Rd``Y<?K;;PmY8.6F?)!,<DDR??424441,OO1,IP1I@-C2<POKihi2-6R]M<K]K<%,,-08$,.8C '.Eou|||^EEsxsxuxxxy|umvy~v††~„„„„~yrURQOUROQMMQJJJRQQUUUUUURRRQOOQQOQQUUGGV†”m„‹†”|„„‹„„uyyy„|„|||yy|yuuod^^ssssdVV030000AAA04TOC?ARC&4ITRTdcddddRRMkhdY=8TTRI6606MMWC)!4R4211%%%%:92@1.<:%!@I@1:]WD4&..&"&2!!6`M&+<R<)?6<+..Voyyy|pVVussssxy||~ym~„y~†”„„|uy†jUMRQOROOMQQJ8QQOUSUVVZVQRRORQOQQRQOSAGV”‹””‹yy‹‹‹„”‹‹||vvu„„‹|||yyyyusoV^sssssdVV3333@330ORAACA2%MmI44CRRTdmnnTCddk`WkYTKCCdk]F4FD?4?4CS444 1-$%"21,!'=M[<1,I>%KiS:=::&.-22&D]3%.^mO<88) +EEdoyy||uVEdoossxxu|„v~vy„~‹~||„|yykUOUUUVQOMQ8JMOJQUYYVYdYZZRQQQOQQQUUYG1v‹”yy„„„„‹††”‹yy~yy|„||||yyysuuodV^sssssdVV@0@RO@300@OOA0%%+2?4@CRdnddOAACn~n`aYROIARRU?)!',6RR?4444444%% *$% %!%:DI&2&%%.M][K`]KYMDD2<D<6I=M<Y='.EddyyyypVEdduxpx|puy„„„yy~y~v„„|uy~kUMUQUQQNNMOMJORQQYdYVVddZUQQRQQORQUUG'v†‹”†mu„‹„„|‹‹†‹‹„ymvvy„„||y||yuudVmpsssussV@3)0@OO@30OTO@40800A?TnOFICRTWKI`k`YI4.?F?RYW?)6?R?4%'4S42424",1:9,%-,CS,!.:14:-,<<DiPYM<IKCD.-&$I<&<..E.dk|y|ypk:Eouyysuux||~~|m~~v~‹‹„u||vvyUUZUQUUOOOOMOQOQUUV]Y]dZQRRQOOOORRUVG'm‹””ymy„‹‹„‹†„„yyumy„‹‹„„„||y|yudEV^pyssussO06OROOcOROOOACAR[Y`dRR??6MYCIC44?RRYYRA86?RF6?A424444.-:&".<914'!%$%:-2M:$41 -[@&&.MM]{hODRAFY""FYI.)+" + +'EEduyyy|u^EEkupkx||p||~„ymv~~†””„„„y„yyyLOVUUURONOMMRQQQUYdYYYUQRRRRQQOQRUZYG>y†††uy„‹„‹„„‹‹‹‹yyymmy„„„„|||yyyyyd:^sxyyuudV00 +TcO4RR468OOCCRW?AATT?+)4YndmnT[TAFAFRddRA&42444'4444!'C&"FF4::+)%$$%.IIE1$%!DWW]kooM<MI<M6YMAYOOM!'EEkkyyyyupVEdkxyxuu||~„|v~‹””‹|„||vvfUUVUUQROOOOOJOQSUVdddYZUURQQOOQRRRVYG>y††„uy„„„y„‹†‹‹yyymuyy„„„„|||yyyysVVksyysudVO0&%2RR)%0406OWWTTTTddTnmWC8RdR?20<?)+8dmTC+"4D?44?442404))&1&!,C:,',% : %%!%K[%!!9-:W`M==F:2I`UO@MY<< +.EEddoooyxy^:Ekkupx|y„y‹‹†‹„„||y†fQQZUQQOOOMNORQQQUVyfd]dZUQRQQMRRRROQAVv†ymy„y||y„‹”„y†ym|„„„„|„„|yyxxsVVkpssysudVO000000&6?TOATnnTRRKCOYmR[mmdF0,-=<Ym`?2+"'DDR?4%?R44444,K,'92!&%%'"%C]], !..MRdYdMMM2!::4)2F:-EEEddooyuyp^:Epsp|upu|‹„|m~†‹||||yy_UUZUQQRNOOMNNQQQV]yf]ddZZUQRQQQRQUQLA>v††my„y|uu‹†„†yvm„„„‹„„|||||xy^V^sppyyysdd00%02&&06O@OT[CORmmYTAddTCIK[adnWKK86=--UWD4''!)R`YA44?444444!,E" C2-!22AA:,9:'6Fk`hiP:&!:AAUD-+4) + +'VEEdduyyxxxp^:^pu|||‹‹„uy†††”‹„„„yy_QQUQQRROONNNOQQUYYdf]YZZZUUQQQLQQRUUG@†„‹uy|‹„†yvmy„„„„||„||||xy^^|xssyyusdV@0%&%A400ACR40AdROTTRIA8?AC=YW6)%&4A;=CMF6<R22)'%!'44?4044 $%,1%,C:II:%CUC4-"-:<8]][I<-.=M0!% + +.ddEVdoyy|||ypL:ppx|„||„„‹‹‹yv††”„||uvydQQQQUUQOMMONOOQQ]Y]]]YdZsUQQQLQQQQOUS>†††my„†”†††ymmy„„„||||||||ysk^^|x|xsuuuoO0%%%&% 6@?R?42&%)AR^I+.FRIOF2%+28."-6?A4''4'&4R?44444!!44-% ,&'%99--""!9:1 %$%"9[4<4&"-).IF",< EkdEEduyy|„y^V:xxp||„„„‹~„yy~‹y||ymjVQQUUQQOOMMOMNOLSGG]]]]dYZZRQQLQQ]QUQQ@v„umu„‹„„vyy„„„|||||yyysLmm|||yyyuysO0%%%0%%AId@042%%&4C6AIRCAIIRCAA86)')20AA+'!44')?44444442%&!,!!.<2-,!'-,!+OW<-,:9:44-<Y[^``Y68CI0D""=) + EkdEEduy|||„|m^:Vskx||„„„y~~v†„„|uumyVUQQUQQROOOOMOOLSVVG]]SZZUZUMLQQQQRQOAV†vmmy„u‹—‹††ymuy„y|„|||||y|oV:^^|||yyyu|sV30&%%0)%2+&Adc^WECanTARYmdTCRdTRR26AFRdTTR)%'')4444@%%--,442$%4[>1$$!-&<K,,,4"")6TP?M]]<.$6=!dkdVEdpx||„|||^:Expxy„„~„~~vv†—”~„|uyjYVUQUQQRNNNMMOOLSVVVff]YUQUOQQQQQQRQUS>v†mmy„y„†—††vyuy„„|||||y|oEE^py|||xyyys:&4ROdOO@WTRd‚dITTddOFFC;CTRTRRA?2%%24%4+''44?O001//,,2<<, -D,)!!4[]?8;,"!<6YF&6 !%"-$EddVEVky|||||VLB^ux|„„~‹†„~v†——„yuvj]dZUUQRONNNMMNOLSVffyfVUZZQMOQORORQOSQVy†uuy|yy†††vy„„„„||ux||xdE^^y|||yysssoO00&4ETdmnWC040+26W~^TdRA442)+EEIRR444)2RR02Rd?%4044444111>1@:R<%'"'<@, 4[UD.%!9-&&&.W<< +!-%$EdddEEpkp|||„u^RBLp||~†‹„~„‹‹~vv———”„uuy…YZQUUUQOONNNJGLSSVffyfVUQUQQOOOOOOORQA@††muuuuy††vvyy„„|„„||||x|pL^^pp||||yuspkO340%6I[[[TROTCA?24WmYRAA88840.Y[F??2+)))4F?4)%4004444?41AA2&&&&-:-%!,! $//"6[K-'4-,"$MhK,!$." +VdooEEokk|||„|^L:Epyu‹†~†‹„‹„yv———”‹uuymj]UUQQUQOONNNGGGLSVVf…fVYVUUROQQQOOORQLVyy^muuy„†…†††yy†„„‹„„„||||pVER^p|||||xodsk3%0&2CC64CRnWOTTC8)6FFC48AF2?DdY2'"+??6%%)%?4%''04?3A@2223@2&*1*/)$-<,4,<: &6A:,4$""EdoV..^kyyy|„mLV:^u|„”””‹‹„~vm†———”„uuymj]dZZVUQONMNNNLLSGVfffffYZUQOOOMRQOQOOJ>„ymuuyy††——††vvy„„†‹„y„|u||ukLL^^~|xyyxoodV0%0@0 6I[6&&04?24TWndAA8FYdR26FF64?F6266FR?24)4)4'44%4R`PM3-2-2@9%%! A]D%' 9:&4]1 $,EdodE.dduyy||m^LLLp|„~‹”””~„yy——‹yyuyjfdZUUUQONNMNNGGSVVVf…ffYZUOQORQRONORQJV†yVuyyy„†—†yvvy„„„„‹‹|uy|pkLmmp„„||yyyyskR0%&%0A8++%%04A2?ACRCCTO8?ARYYWA))??66)42)!'4044%%4403&&&==2<:&'%1$ ''' + +..&! 2-:"$" + .dppE'Eddoy||||^mLL^y„†‹†”‹„yvv———””„yyj]SUUUURQNMNMOQOSSGfffffdZUZROQROQNNOLQ>†vmuyyyy—…†vyy„„††‹‹„yuu|pLLmxy„|||yusooV30%8R=+%%44@OYmT48ETCRWT0)'222?A6?D<)'6)'''%%'%%'%4)'?"<K.) -U1&:4% -%"!- +.dpkE':dooy|||uuLLLVpp‹‹‹†”‹„ymvy———””„yy…YLSYVQQONNNOOOQSSGVffffYZUQRQRQRQQOOLLVyvmyyy„†—†vvyy„‹††‹‹„y||kLmmm””|x|xsossV3&%&6,&=IR8C4+0@I8[kTCTdA%)AA+%'44)'4'''4%4?422222??00%)6,0AK2 $ %4,!)-D@' +.dk^k..Edooy|||uVLVL^u„†”†‹‹‹„yyv——yyvjSOUdVQRNNMONNNOS]VVffffVUUQQQROQQOOOQQ>†vmyyyy†——vvm††‹‹”„„||uLLVmv‹”„„|xssssR30026.<ddOA444+%4.&%2RA&%%;CA;+46!)'2?4)')6244%4002?+4)++<88=22 ! %''6<" + 2 .EkppE.Edoy|||mm^LLu„†”†‹„„„ymv””yyvjVOSUURNNONOONNQS]VGVfffdVUQQRRRRNROOLQ>yumyyyy†——†vy††‹‹„‹‹|upLVpu~„„„„„xyysdE) 00 ,82+)4I0242+224+AARRF6+)IIR6'?4%2+46RI4!%)%%442ROA4+%1%%$)COF-& '9$&%',!'RI<8" +dkupkE.ddyu||„umV^Lp„†††‹„yumv—„yv\SJNQQRMNNNQONNOSSS]ffff_GUUQORRROOOGSGf†ymyyy„…†vv„††‹—‹„†„pLLVV|‹„„„|yxxxs@066022RA?2446IRIOFdRD464)A,D)''!'')2?%%%2?424%@@'$! !!!4' 6:1-'%! % + + +ddkp^EVddkyu|yum^mm^u‹†”””„yyyv”‹yyy\SGOUQOMNJNQOOLLSS]V]VffYVUQQORQRONNGLG\†dmyy„†—†yvv††—†‹‹„pLVLm„~„„„„|xxxxd3 ?FR40CdTACCC8IC6A8A24")22%%)42%)'"26+%%42%)?2+)1123-3=M-' $ '4D%--42 , +EkpkkE.Edoyyx|„upmd^p„†”†”„yyymm„yyvfQQQQQNMNMNNNOJLG]fVVfffVUUQRROOOONOJLS\†mmyy††——†vy†††—„„uLLm^u„„„„|||xssV@&&%)406F?2&+%4++<RI86222262')46WR)&844&2%%%+&'@11%&32&!% " + %4, *"! EkkodE..dkdo||||pdv^Lu†††‹y„um†††yyvfOQUQOONNNOOJNOLS]]fffffVUUORRORQOOOGLL\†ymyy„vVv„††——†‹pL^mVy„|y||x|xssV3)0%4+%44%)%%'4)C?4'%!442)26+)''!")84224)&&-&.&"-& $ ):EdopukE.Vdddo„„|mdvv^my†‹„yydv—‹ymfSGLRONNNMRONJOJL]VfffffVQOOQORRUOOOOLL\vyuyy†Vyy„†—††„yuLVmVm„„|p|||||s^@3&60?22%444444FDR44D?6)+22RR2+"'''')"-==AM326-&&!*$ !"EkuupuL'.ddok„„yvddmmy††yymv…—‹yy\SOOONONOOOMNJOJLGfVf…ffVUQQOQORROOOOLAjymuyy††yVdy‹†—††yymL^dmu„‹„||x||||sV:3 2&&%2?%4????????4?%'2?4444A42"6C2'4,'"!'&&-:AF==D<2=A4,'-%$** !$,& +"" +EkyxuuL..ddkpu|„yvmm^y~†yyymd†—†„yy\LJOONNNOMOMJJLL]VfVfffVdUQOROOOROOOOLAj†myyy††dVyy‹†††‹„uLV^Lmuy†„„|xyy|ysVVE)%&&&0@C22%4?%A2%%%2?4R6'')YkR2%$+'.''2),2)'")-)'-2ACO=3:&"%!!!"% + ".& + + +do|kppE.Edkyu|yyuddmmy†††yumm††—†yy\LNQOMMNOOOMGLLLGffffyfVVSUQOOQOOONNOJQj†my„„†yvuy„‹…—††„mL^d^yy„‹|uy||yVER:&&""3C3&&%0%)&4%%???44?ART646-MM?2-+)%%")?A?)%%?22''%%11-&&<OOM:&%.2<'! + + +kppkuu^EEokppuyyydvmVuy„†††yumy—‹yyjGOONNNNMNNMMQQLGVfVfff]NNQQOOORROOOGLGjymyy„††…†vyy††††uLVvVu„„uuxy||yuVEV3&0&%0%&%%44%4?%')2+).6D2%)-'+68%%2)'%KA:21>@OOA---.<3.)'<,$ ".- +Ekkkuu^L.dkykuyy††vvdpuy††y†vumv—…„yyjGNONNNMMMMMMOGLGVVVVfff_NUROOOOOOONLSGvymyy„††ydy†„†„†—y^VydVy„„„|pyxy|uoV^V0&&%2A%22%4%%4)).)!??4%)&'4[K@:@IPAPkP>>>.<=I?M=!! +Eddkkpp^.Vooku|‹‹‹†vdV^y††yv††vmv†††yVGMNNMNMMMNMMNG>GGfVfff…yfYQROOOOOJGLLVvymuy†vVyy„„†y„—†uLvdVmy„„‹|xyyyy|uV:VV)%0%%&+2A&%??4&%24')%))))&'2"%%%+%OPOOI@<@AAAM]P:2-DK1,,68-&!% & & + + +'dddyuyV.Ekuuu„‹††mdm^uy†yymvv^dy‹ydNNMMNNNMMMNJNJQGGVfffVfyfdUROOOOOGGGGV„Vmy„„†Vuyv†††y†—ymVdmVv‹‹„„„|yyyxxyEVkE3)4%%'&+'4'!)-4"4F?)?F2%4+&TO%'%I@>IK<@2-=PM]P<119:1 &:::@@:D, &&9 -! ! + VddyuuL..Lppuy†††vVm^py†yyyvvyumy†„dVQOMMNNMMMMJGGLGVffff………yfYQORNOOOOOJfvmmuyv†duy†††††—†ymVvdd†††‹||yx|yydEssR0 %%060%%246''!4D4&!46))2!%%%MOI>OPAKMP[OACIK:<AKK@@:<-"4-'!*& !) + EVdkpumL.Epuuy††y†ddyVVy„yyy†ymmdd‹v_QONMMNONNMJJLLGVVfff…—fdYQOOOOOMMOJ\~mmvy†ydy„†„†††—‹pVVdv††„„‹„|pkx|ukEEsV3%&044402%04+%4?''",'')))'4)2)'%MV^]M@@@]`M`]]K@2FW]A:&%4 !! $ " +.Vdy|yL.E^ppu††vyyvmmuy†yyyyyudV†y~„y\QOMNNNNNNMNMGLGGVVf†f……d]QRQOOOOGOQjvmuyv†ymyyv†††—†yVVVVv††‹‹„|xykyxykE^sV3&)640%%0%&&04%.%)4'22%22%%%%424%%%]pp]MOOOO[`OKI1!$:C=-$,%**% '4& " EokkuyV.Eppmmy†yvyydmd††††yyypmVy†yv\QOMMNNNNMONOLLGVVf…yfVf…fYRRRONNOOGNv†dmy†mmyy††y—†uLVvv†††‹„|uuyook^EusV 0@00))&2864?2%C6"))?A2%226'))%%%%%%]p]]]^VOM>UP>>>>11@KKD@:1:,,*41*/ ) +EdkuuymL.kpmmyvvyvyuuyv††vyvmmLV††~yjYOOMNRNNOOLLLSGVVVyffVfff]QQRRMMOOLVv†muy†…†vyyv†—LVdV†††‹‹„up|||kk^VuVR %&?O2&,6=CAA02822"%)2% '%)C0%%)""%^]]]vv]]OM>M@E>MOPP@>I@A@I@E@@9*& + .dddpyuV.Epppv††††vVVVmyy†††v†mu^m††„dNONNNNMNONGGLLGVfffVff_VdYUQQRMMOOLV†vmy†——ydvyv††…—‹uVLVyv†”„|ypx|yukELdV: &OA440&&2442+4?)6%%2%'''4)%?244!)22>Oivvi]]]O>UP>MOO[OMOKI@99D@III* ddVpy„V.Lkp^v††…†yvVmmy††vyyymdy†ydVQNNMNNNOMGGGGGVfffVfVV_]YZQUQJOJGG\†vmy‹—v^yyy†„V^Vmy†—”„u|uu|yydL^kV %%20%282))))%%%0)2%4%%%))'EOOOOOi]]]@1PKOOOEO]IO[IOOOOSO@1* + Edddy‹VL.Lpuy†††„VVVv†††yyVd—††vfQNMNOOOQMGG8GGGVV\fVVfdUQQRORGLLLGV†vmy†—Vuy††††—u^Vdu„†…—”||uy|upE^|^: ))&&%+24$+%)2%FA)4?4%'44%%2+%%2M^^O@MM]i]M>O`[]OOi[O]]]]OOSKOIF' + .dddd†yV.Vpu„††††vvVVy††††vydV††\YLGNROOOMMJOQLGGfVVVfVYSUQONORUOLVmvmyy—†Vuy††v†‹mLVmy———†u||y|y|dE^^^3 %""""%)644''02'%%)?+>OOMM]]^MMOP[oOv]iiiiOOOK[P[KC8 + + + EEdky†V..puuv††yVVm…†y—yyVV~†j]SONOOOMMJMLLSGVVVVV>VVVVQOONOOOLf„†vy„†vLyy†††…yLVdyv——„u||||ykL^m^:%00&&)))% '''%$C2%) +42IE]OOM^]Oii^]it[[i]i]O[iK[UC, + + EdokmvdLEkuu†††„yVVm†††vmVy…yvyVVQOOOOMMJNJJGVGGVVVVNGVZOMNNOGOGj††vvyVLyy†††—uVVdv————†„yu|||yLE^kV: &00%"+0)'24)22+')")%%%&,%<;<^M^pv]v^M]^oiii]i]OI@C9, + + + + E.V^kpy†VLLpuy…†††VLVy…—†y…†vmVy††yfYQOOOONMJGGLGGGVVVVVVQQMONNNNGJGy†ymy††VVy†…†mVmmv…———†y|||uVLmss: %0%!"<A242)46%4",+" +&&%'%& ;II^^]p]]OvvPiio[O@@1:1D- + + E.EddkyyvLEpuy——††VLVu††…yyVy†vfVQOORJNNJJOJLGGGG@VVVQQOONNJMGL>††vyy†—yLmy††vLmvd†——‹„y|||dELpk^3 &C&%'%2)-!'%)&%)"%MIMM]vvvvv]POiO[PO111*,<'! + + + ...Ed^^yvLEVky——…††vVVm†—…yy…†yud…y†y\VONOONNMJJGGLLGGVV_VVQQOONJNOOGf†dyv†uLuyv††††mVdvv†——‹y|||||uEL^poE &%)460)AC+'%))!%%")'!%&%!'MM]]p]ivvPPOit]@OM@M>1*! + ..ddkpyvvLLpy†—††VvVLv…yy…yvvVy—†vjNQOMONJMJJGJLGGVV_dNGVQROMMNOJQj†dyy†uLy††…†††††dmVdy††—†||||||ydLpppp. 0%6+%0)) +'2%%%%"'%22"!%!I^^^ppi[OM@OM]OMMiOO[K$*,$* &,& + + E.EdkpummVEppu——…†vVVmVyy…††vdVy—vcVVQNOOGMMNJ881GGGfVGQVROONMNGGGjyvuv†††VVy„†††††VVdVdv†u||upyk:LuukV: && 42?%%2??4+'44%)IM^p]^^^^]M^PpMM]iPP@1$/1///1<'%,' + + +EEEdkpuyv^LVpmv———yvVVVVddy…y…vmVvvVVSLGNNGJMJG8LGNVVVV]QQONNNJGGJGy†vmvv†vVpy†††††vVVVVmv—uu|||yL:v|xsV + % %022%+"4D?)%))!!'")"'')"![V]p^^p]]ppivP]O>/1>K>/<<<$ $'9$ + + + +.V''dkkuyvV:Vppd…——†yVLmyVVVdy†yvdV……†vyfGOJONJJJJGJGGVGGLALQQNNMJNJGGG…†dmyyVLmv†††††uVLVmy…y|uu||yk:LyskkE) &)&0002%%C)4+"))%)%)p~~p^v]pvvM^p]^M</>/>iPM>1 $$ 1 + + + +VE:dkku†v.:puu†—…†dVLdm†dVVvdyvVVy†vyjNLOONJJJJJLLAGGGGGLQQONMNNJGGV††ddvvy†VLVvyvy††„pLVVd†”yppy||yL.^yxsk3) &@O42'2%%%+A%")%+2A+)ppp]vvvvvpv]v[OO]M>>M]]PK2$1* + + + + .E'Vkpu„yV:Eumvy†ddVVmdyyvdVVmVVyy††vyNOOJMMMMMJJLLGVVGSLOOONMMGGGLfvdvv††VLVv†vvv†yvVVLLVv„upku||u.BmyssV3 &46)4@4%0"%)"%+&"%!^V]vpvvv^vMP@P^M^VMMMM>ESM2,-- + +E.EkkuyyVEE^puvy†yvVVVu†—†vvyvVyyyvyjGOOORJJMGGJAGGVVGLLOOOOJNJGGS…†dVv†yV.Vy†vdv†v^L.VVy†yppuppkE.^„xuuE &)&) 06&&&);4&&%"")!"%"%"!!&%V^pp^]^MP^MMMM^MV[^[II>/*@]MaK + +++ +.Edkpy†dLEpmVvd††vVLLd†—…dVvddyyyyj]OJJJJNGG8LGLGGVf]LOROONGGGGG…vVd††VVLVvvv†††vV.VVv††uppppyL'Vypkk: %)840&00%2)).'%")'"'"%++%"$ !ppp]]pp]^]]^M^^^p^^M>@>;<>,%:< ,E.ddpuy†VEkumV†yyvVVL^v†…††vvVVdyyjjYJJOJJJJJGJLAGVVVSQQQQQGOGGG]fvVy‹†V..yvv†v††yV'VVmyp^kd^uL.vyukkE. %%%%)2+%")"+)"4+"$ ! ^^I^^p^^^p^^^^[s^MI>1/<<//$,I- + + +%& + .EEoppuyV.d^^VdyvVVLVuvy†yvvmVVy†y\IJJJJ8JJGJJAGVVVVGLQRRRGGGGLffyv‹†VLVyvvmv††uV'0Vvyupp^VuL.V†ukkV: % 26AT+26)""!.+ ^M^II^^^^]O^pp^^MMMO1II//*&$$$$,:- + 'V.VkpumBEpmvvyvV'VVdv—yv†vvmVVjyyVJJJJJJJJJGJLAGV]]]NQUQRQOOGJVjjdvB.Lyvyv†yVL''mv‹upmkkpp.LukkkV:'$",08===,8),6&++422)!+2-+"2"^^^^^]M^^^^M^P^OM]MIII/</$& *</$ /,:+ + + + +0&.dLEopuumB:dpmmvdVV0BVdy…†yyy†vVVv†yYNJJJJ8MJJGJA]GVGNNUQQOQQQLOLGfVyd'.mv††y„uL'BVv†ypupkkuL..V^LpkE::)@;"$ 640,00=KI& +))2$)"'%'4)"64'^]]vpp^pp^P^MP]MM>1I>M>><2*<<//&$ 2+ + + +0EE''E^ppmV:Ekpum†VV'VLmd…yVdyvVVyv…NOJJG8GJMNJOGSGNVNNVQQRRJOJOLGfj††V'Ldv††v†vmB'By††vupppppL.LLLkpV.'"'".6, +$;K8""$!'")%"".+82)" pp^^^M^^^p^p^p^MMIIM<1@@</</*/$//$*-)'EEEdkVLmB.kumudVVB0LVvvyVdVdddVBVyfYOJ>JJJJMJQOQGGYNdYQQRRQROQJGVfj†V'Vv†ydvyvyVL''Vy†ypppkkkL.L^VLud:E:.) + 4% ,=0%''))+))%""%.-')'"^pp^^^^^p^pp^YMMI;;////1<<</<;>>*&-.,8&'E..d^.LuL'Ekm^VVVV.0VVVVVddVvyy=V…fIAQJJJJMJNJOLQGNNYYUQQRUQOULGQfy††y.'Vyvvdvdvv^.'BVyyppkkkkVL.L^LEVE.L^:3. % CT40)%!'"!'!"!"'))"!)4)^p~^p^^]pvp^^M^^<;/$/<>/*<9E>M>,"+8& + + .E:'ELEL^L'.LkLLVuV0'LVVVdvyvvVVV\_YVUOJMJJJNNJOLQGNV]NUROQORQOJGQfyyyVV'Vvmvv†v†mL''VmmpkpppLE.Lm^^EV'.EV'3' & .;CIA!)"")))''' ppppp^ppp^^:M]^M<///<<>>>]]>:,$ +&,;8% EV'.Edo^V..ELLmyVV0BLdydyvvdddP@NIYGJJJMJMNNOQVGYVYVUUQQOQQQOJJLVjyVVd'^vmmdvvdLB.mmpkkpmLE''V„pLE'E^V'33 +&" ));4$))68%+"!%"""4+!p]ppvvpvYM^M^^^I;/$/<;IM>MO>KU,% + +))))44&$+0.^EEdkpmV..^yuVBB'Lv†yvvdd†vV3NUIL>JJNMMNNJQSG]]VQQUQQQQORJJJLV…yVmV".mmvmdvvmB"Lm^kLLumLE.V†ypL..EE:''. +%% );."%%$-"'",;+$)%$"'!!pppvvvvpMPMM^MI//1I[III>>IM>O>* + +EE'.Vdyu^''VLVyV'0Edd†††vvd†V@VAJ>OOONNRMNOOSNVVVUQQQQQQOOJJOJVjyvvL.Vy†vv†mm.''BLVVLLp^L..VypL.'EL:.L:"&)&"")%!!2)2,+"++")-))%p‹~ppppp^^^p^:/;;[^[[;I;/;//I1& + + + '''VL':VuuL0'.LLVV'.mv†vyvVyvjVNQQJOONNOOOJOLQQQGYQQQQQQUOONOQJQky†yP'Luy†„uL'0'.BL..LVuE'LyuLEE.:'33'"'"), 8,$%"!").++)"++!)'" !~~p^ppp^[^^^^;;;[[[IIII/>>>I/& + + E.B'Ekp^B''.LVVL''.dv††vVVyvj_GLOMJOOOOOOOOQQQYdYSOQQQQQOQOOQJLVf†v0Ldv††ymL0'..LLELVup.'LymL.':E:'::3::3'"" ""68%8I++)0)!))"""'!")-' s^sp~sss^^^[:6L[]];I^I11OMI</* + E:..:'.dVEL.'.E.Vm^.:VVvvyVdy…kIQOOOONNNOONMNOQQ]]SQQOOORQQQQQQOLVfyV"BVv†††uL''LVVLLLLLuV'.Vp^.EpV:B:':BE''") &3)")%$)"").)!'!)8)"!!'!!&)"!ssssss^^^^^I;L][^I^^^:M^MMI<< + + + &&% ..EV.VL:LL'VpLmmVB'0LvdVVdrkVUOORJOJMNOONNOOQSQQUQQQROQQQQUQOLLSfjB.Vv††yymL''LumpLpuukE.VLLL'.^^E''L''3''""'3'.)'@CE8&!"+.)"!!"0.)"!"-!!&)sss~s^^^^p^[^^pp^pp^^MIMIMpV/ + + &)) ':VkpLEE.LE'EppuyvB.VVVVyvyjVVJOQOONJMJONNNOQQSVVVQRQQQUQQUQROOLSV\0Vdy†vvmd:LVmmLLpuuL'EVLL' '.pp:'8':..''))" '" " " +&+&"""2"'$)"""!"!"%'&"!,ssps^pppp~s^^^vvvvp^^MIM^spI &88$$$++000EE^^L::EE'.^puyyB'LL^vyv†…yVAOROQONOOONNNNOQQQSSQQOQURQOQQQQOOLSVVVdyy†yv„m'''VumLELyyuE'LmL..dkE'.'33')))&$$$ " """!))$)!",-!&)!!)s^sp~~~~~p^M^ppp~vpp^[;[[[I< $ &0KjcK;&$ .':Ekm:":'..EL^mVB'LVdvvy…_SQOJOOOOJOOOOOOLQQUYVQQQUQOORQOOQQQLLGfVyv†yVmV'".vmL:LyuL..umB.LpL.'''.:''")6 "$ "! ;,%+"!!!"+!'&&!"-)%!'p~~~~~~~pp^^pppvsp~^^^OY^MM/$&&+83-...2?).aO<680$$':k^B'B'..LV.'VdvyyfYSQOOQOONOOOOOOOQSSU]SUQQQQQQQUQOROOQQSf…y…yyVdVdL''VyyVLVV^L.'LmL'.ppE'..''3:.':3 )" & "$+.""""$&&""')%"-'!p~‹~‹p~ppV^[pp‹p~~~s[^^p]ii]PPA@@%% +%+$O6.$'.E^: B' ''.''LVvvyfYSQQOQRQQOOOOOOOOOQSQUSUSQQUQQOQQQQROQOOLYfjyyvyVVVL'LVVV.VVL.".LV''.LpL.:LB''''''""&.& .. )6+.68""&$)!""!"!&'--"!'%&&~‹‹~p‹ps^pspp~p~‹ps[s^^^^M;>///" 0;,,?!&&88+++"")8E=E. ''E:.':'''ELmLVddyy_YOJOOLSQOOONOOOOOOOQSUSQQUQQQQQQQUQQQORQOLQVy…y†vvvdL'VLL''L.BL'"''L^L.''...'''3".6 &.$,&+).,+""!"""&+)"!"!%"!!)'!!,:Vp‹p‹p~p~~p~~‹~~‹~s^p^^p^I11$:- "0)K^8".=K8&""''EL'...''.LuudvdyffYQONJOOQQOOMMNOOOOOQOQSQSSUQQQQQVUQQUROQOOQLLQ]f……†yvdV''LVVL.LV0LV'''L..'EL''.RV8"'' =,)&),,, &""+)'"&&!"!")!'&s~p„‹‹~p~~~‹‹pp~v~sp~p~^I//%<AMA=?IPKKWWE=;,,)IPCKCOW[K?0?=-''::'E.'.L.BVc\\fVVQQOMMOOOOONNOMMOOOOOOQLQVSVVSSQQOQQQQQQQQQQOQLQOQS]fVVVVmV.VmVpL^L''LL.''.L''''.B.'0KKKKC="" &6;0&&,,)%"! !%"""")"&&$"&-"%")"-",s~‹~‹~‹‹~~‹‹„‹~„‹~Z~Zpp^M11$/ 88;[Kcrrcc^^crn[RI."')''''P>>GGNVISLOOOOOOOOOONOROOOOQQQQLOQSQSYQQQQQQQQQQQQQOOONOOOOOOL]VffyVVLmVm^LLL''LpL.''L.''''''""0PP8)6))&&",=K6 ,&& "$!&%""""'"!"--+"'!%)-)+)-ss~~s~pp~‹~~‹‹‹‹~~‹~~s[^:IP`A! / !%6T[^[[nc^T^dTK8, 3)....,."'"'">@AAALOQQQQQOOOQQQQOOORONNQQQQQQQQOQSSSSQQUQQQQQQQQQOOOOQQOOOOOLLS]fVVVmV^p^LL..^VL.'BBB "''..''' E^@').").&,66.0IK+)+,+%"%&--""'-'.+)&spps~~~~~‹~~p~p‹~‹‹‹p~s^;/>@M-,<1$! ++;WnTd[ddP^nTIPTWK;K0$&'683386''':.'>>AAJLQAQUQOOOOOQONNNNNNOQOOQOQQQLLSSSSQUQQQQUQOOQROOOOROOQQOLLGLLSVVfVVVLLL^''LL''.L.'"''BB8BPVRBR83 WP"",0;E;;??8800C^KIKI;0$).))"!""--"""-)'--+~~~~~‹‹‹‹‹ss‹‹‹‹‹‹‹‹‹Zs[;:>:1%*2, ,0crcnnnmn^^^c^mcPF.$ )8"'.:B''8>ALLAVSQQQQQOQOQORNNNOOOOOQQQQQOSSQQQVQQUQQQQUUOOQQOOOOQQQUQQQQQOORQQIN>VVLLL''L.'LV.LV0''''''''33''0K;).0KE=;40&&%%$;;)"$;=08))"%""!$&.)"-.-.'&)-~~~~‹‹‹~ss‹‹‹‹‹‹‹‹‹„pss^^I;/>1!-8+ + + 0Innnd[dny‚wwYA.=I0) ..''1AJQGQYYYQQQQQQQOOQOOONOOOOOQQQQQLQQQSQSQUVQQSQUQOQQOOOORQUQQQQQQQOOOOQQLAV>CBL..LV''...'.'...:.''33"WdP=RPPPPPPP^K==604,0?8$&&,0)$!!!"$+66)").--%&+~p~~‹‹~s‹‹‹s‹‹‹‹‹‹‹‹Z~^^^MM//M/$$$06AIOa^^ndccOFOFK[aOM6&)'3''''''.8ALGQNNYGYVVSUUQQQQQOOOOOOQQQUQQQLOQSSQVQQQQQQOQQQQQQROORQQUQQQUQQQQQQQOOQAG30VELLB'L.''..LB..'.B'.'':33'8R8$&B.& $,08;CKPPW;4;;$%! )$""!$..8&&+--.,".‹‹~‹‹~ss‹s‹‹‹‹‹‹‹‹‹vssp^;M1<O1, +FRA?[dndRDDIann`O=A43''.'.8B>11>AIIUAQQZNVVYVYVVUUQQOOQQQQQQQQQQQQQSSSSOQQQQORQQQQQOROOQQQQUUZZUZZUUUUQQQLL1'CVLLLLLLB.LB'.LB'''''''8::3)8:8. $;=KI;;C;,+)$!)""""+.0..&"-4-",~~‹‹v~s~ss‹‹‹‹‹‹‹‹‹~ss^[;M;/1>O1 $666=I`]KU4:Od`a[[WTC4''''0A>AUQOLAAAUUZYY]YVVVVQLQQSSLQQQQQQQSSSQQQQQSSLOQQOQRQOOQQUUZZZZZZYdYZZUZUQQRQ>A'VVVL.V..L.L:8:B0''.''.':''883'''''"PR=80=KK6608)& $0?CKW;,"$""))"$+....$!---2~~~‹~ppp‹‹‹‹‹‹‹‹‹‹‹ssZ[[^I11;@1&'0MFUR][[[hPOa`ad^ncn[KT4 +'.'''''.AJ>OOJOOQQAAUUZYYY]]]]]SSSSQQLLQQQQSSYYQSQSSSLSQQOQOOQQQYYYYddddddd]YYZZVZUUOROG>>'B.VBBBBB.:'.LB''.:.83.''383'"''..E.6=@66.,0;;K;8)"K^cK0.,4$$"%)""""..66.-&-.--ss~~~ss‹‹s‹‹‹‹‹‹~~~ssZ][[I:>@12<!%O<,&19]]O]tkomwOO^^^WTOC8.B8686.3'''8JJJJOOJJ>L>>AQOUV]dddf]]]]]SSSQQQQQSYSSYSQUSLLSQUQQOQQQYdfdfy_dddYYZYYZUZZUUURQ81>'''..0''8LB:'.0B8'.BLB:833'""""".'3E,)&,;64,+$0?I?&$?c^T8+!"!!+&&$ $.<=.+"-..&Zspp~~~s‹‹‹‹‹‹‹s~~~U][ss[^@11114.CTao]`km][]`arrrccrcTKPP?0)".."'''.AJJONGOJOJ>>>>>>>QV]]]]ffddf]S]SSSLSV]SSYSQQLSSSSVVQSSY]df…fyddYYZUUUUUUUUUUZUQRLAG>>LVV'''0.LB:'".B0BL8.',.)"" ..RREBO.,6.,6;40$ $0?C0$==?I0"%"!"+$&&6==<6&"4<-s~d‹~~p~‹‹s‹‹‹‹s‹‹‹]s[[]]:/1111'=8I^[O<APmo]=APr…‚nccnccnd. .''&1.JQQRNNOOJ>8.888>IQG]dfdfV]]V]]SS]SS]S]SSSSS]]]d]Y]df…ffdddZZUZZUUULUQQQQUZUUQGLL1>BLB'0'B8L:0'.'.'.B8"?P=".83...0").,=EC86;;4440+"&$&0=;& &$.$ ")+."$+....=F63.--4<sppp~vp‹‹‹‹‹‹‹‹s‹‹ss]s][[;/>1//%,)"0":@IK`M1-I‹wkkY[nP[r^=.$$$$'3''.''8OOROMNOOON>8.>UVY]]d]V]fV]]]]]G]]S]SS]]]]df]]dfddd]ZYUUO>MOOLOOUUUOQUUZZULJ8GGV.0'BB..LBB..'8BB8E$'00K0"'8. 36 &;;646;444+$+ ""??,$""$.2$")80&,.6=<864.6.^pp~‹‹‹‹‹‹‹‹‹~s‹‹~~sss[[[;1:1//9%!'&<aa`a[YKK<<[cac‹‚Y=)'&'.LJNNNOOOOOOQQM8>AUSY]]]]Vd]VV]]]VV]]S]]]V]ffddddYZZUZU>.>OUUUUUQUZUUONLA1>00'.0V0BBBB..08L'"0?KPB==EB;6.)0)..6O@44444+20++2)++$0?+ ,+ "-0+&++,..+$.6<<6<.-.pppvvd~‹‹ss‹~‹‹‹~~‹~~ss]I;MM/$%2&'12& ,-+[MPm`W``Uar‚z‹zwYFC& +$'''''.8JNNNNNOOQLVVQOJ8.QUSSS]]]]]]f]VffV]f]]Vf]ffd]]YZUZUUL"8>OOUUQRQUUQOG8A1@>'>>'.VB.'.8.3'="""=WP080.8.38=6=.3B6;@@606;2.."&."""$8K?.$;;80.+.++)).+..).<D66<2<v‹d~‹‹ppss‹‹‹‹‹‹~~‹~s‹ssIIM;/ $ 9E4&"Io`kM2<AMazmn—‹ncncT? &0+ +'.'=&''1>JONOMNNQOQU]VQQQQ88QQZNS]YS]V]]ffff]]ddfdd]]]YYZUUU>. .8LI1AJOOUQQQUUUQOOOOA'>''V'0BV8.'8.8".Pc=;==BB=0=R=)@6.4@@A44C408+.)""%"%$,?CK .0,,..+""&00.....FF66<<‹„‹~p‹‹Zs‹‹‹sssss~s~‹‹s~:/II//$CI-!'-<`I[[PPacmmw‹‚wk`OO=0?PP?+ 8E0.'1A8>OOOMOOQQQUSUVYYYUQ8>OZUSSSQS]]]]ff]]]f]dd]YVYZZZUO>'AIVGQVUQOQQUQRQQQQROOOJA1>0.LB'0B.'""'))88)) &K^=0880.@==")=RRC@4A424C40.$&""+))&$$?K$ &&++)"$$08..=88FFF<6<‹v~pZ~‹v‹‹‹‹ssssss‹‹~ssp^<>/<</I9:4KOIKMO`ww`r‹‹n`ORIOPrr^P.8B@6" 18AJNNNNOOOOQQQQU]YSQSS8>OUSLLSSSS]]ffffd]]]]VZVVYZZUM.AGGSVSSVYVSVUQUQQUQRROOORA10V'0CVP=0"'"")"'0.R8"&= "=ERcWEOEWTWWOCA4CE8.&!++4.'"0K& $$4,$0.$&.0.00=I[FF=6=v~vp~p~‹‹‹‹‹‹ss]ss‹ssss[^^I;II$* '%=P:Ko~PK]Po‹wi]mmrnrzycTW@, ''1>JONOOOOOOOQQQQQQQQQSSS8>ISSSSLSS]]]]]d]]]YVUZUZZUUR>GSSSQSVSVVUVUUQUOOQQQQOONOA1C>''"'CP=''"'...88B=B."",P$")6BPE;4;EWTccWRC;8;0.-)++)"&=$$$+06860....668=RR<?<<‹v~Z‹‹v‹‹‹‹‹ssss‹‹ssss]ss^MIM; --0kOS</KIO@AnoO1<`acwrr^P^A ""'G18L8OGGOOOLLQLLLLOSSY]SQL8ASYZQOQQQU]]Y]YdYVZUUZZUU>8LSSYVUSVVUVUUVQUQQOQQQORONG8L'>0PP8."'WP8.'".8."""BEB8',K0.)..8=WE=46446Kc^II8.,2-+"!")&0$$$&.??0,..$.38=FMF66<vpp‹„dv‹‹‹s~ss‹s‹sssssss][I<;/">>1-1]><E/2M[azwoP]UKcrncr^I0 ) +'0C'1G8GLGGNOOLLLLQLLLSSSS]SLQG88AUUOOQQOQQZVVVVUUUUZZZUO88QSSUVUUQQUVUUVQUQQRNRROOOMGOJG>'0'8cP,"PB)"' '00'0PPE80"K$ )..=REEOEC;;A;;=KKKK;04."""""""$ $&,.C?2&0+.68=FDFD<Dvpvvv‹v‹‹~~~s‹‹‹sss]ss]sI^^;;@/>>P$ME@Moonwˆt]ioanwmUn[3&=PPc?$ ;;$'A8LLGGJOOLLSLLLSSS]]]SQLLLJG>QUOQORQOZUUQUUUUUUZZZO888OQQQSUUQQQQUUQQQLLOOQOQQRNNNGLG'''0'0PKE'=W) 0'0PPWccB3.68ER=8BTE=CEKCE?Tc^PTE0"")$"$+$,+$4+2?8....0<<8FFD86vpvpvv‹‹‹‹s~ss‹s~‹]sssssIp^:>/$$/$<@9S>MPiiPOPPiowwoMOOcOTPPn^;;,")PP&'1A8LJLOOOOQSSSSSSY]]]SSLLLOGJ8.AIIQQQOZUUQUUUUZZYYZZ>8GJQQQUQUQQQOQOQQOQOOOOQQQQONNOLLA1'000'".=CP&"'.PB8 " 0rrP=KKEPWR=EOWWOEEKP^T[KKKPPI;0&++""$$0;$000=80.008=03=AMF=pvd„‹‹‹~s~~~‹s‹‹‹ssZsss[I^^:>I/*/,K9SM/IOO`12PPU``PPPOaPCCIrc=?0.W; '1AGOOGOOOOLLSS]S]YS]SQSSLSQQGG88AGIUUUZZUUUUQUVYNZZ>GJQQSQUQQQQQOOOOOQOOOOOQQOQOOOROOQ11000V''.PC)P00IC$"08" + Pr;B;66ORP=EEEW==KPCIKPI8&.0CPTC0,+$,,K8.&.86000066=6=FFRFv‹‹v‹„~~~~~sssssss]s[s^LIsI;I/$$*A>EE/1V]UO1<PMtoPOPPac[ccn=&&=&=c0 0"&'8JGOOOOLLSLS]]]SS]SSSSSSLQQJJ881NNVVIZVUUUUQUYVVNOJJOQQQOQQQQLOOOOOOOONLOOQQOOOOROOQAG1>30=000^0.E =P00=&;rPPEEWcKWEEKKWE;KI=6==<-&""&=CKI0.$0I0..860360<<===F=RA~vv„„‹‹‹~~~sssssss]sss[^p^I;6/>1$1],9>>>OoM;//AP>MM>OPazO^c3&=WPWr,"0K."''1A8GOOOQLLQSSS]QSSSSSSSLSSSSOJJ81NGIVUZQQQQUUZVILJOJQQQQQQQLLLLLLOOOOOOQOQQOOROOOJJQA1@>=00.$=C PK'.P;&P;&0C=PPTPEWcPKcTORIC6.===I==8.&""$0;=4,;.+.08=C6008?8=F=F<v„„„„‹v‹s~ssss]s~ss[ss]^~[MI;"$/$$KO<9/$/PO>[>9P]O]^]iPrU^cPP^WPyr?;c^K& +0''18OLOLQLQLSLSSS]SSLLQSLQLLLOGJ88ANNGUIISQUQUNGAJJQQQ]SQSSQSQLQQQLOOOOOONONNOOONOOJAA1'3=0""..0$V' K="=) 0C""0^P000KWc^Wc^PcTTIRI?=FI?=?F=884&$,+$$&,.=;46A=8=0=8=F=FFFM‹„t„pp~sp~sZssp~ssssss[p~^^^;/"$]>*$//@[Mi]>OM>M]]pPwzc‹r^PPrrj0PC??; >'118GLOLQLLSLLLQSLLLSQQLLQOLOLOJ81GN]GV]YYYGNGQGOLQQSVSQSLQQOQQOOOOOOOOOORQOOOOOOQVA11'&.'0="8$?P'K'PP^=,^^WI,[^T^^^crrdARRRRIRIKPKKP=C;;;8.$"$+,=ITI=88F88F=FOIFFItt„v~pppp~ps~sss~sZ~~s[^p[;IMI//3]V</;<]M<>MO;>I]IMMMwzzjccrrccPPPCK? '''VGGGOLQQLQLOOOLOLOLOQLQQOQQQLGOANSGV]]VVV]]VJNQLQQQQQSVQLLQQLQLLLLQLLOOQOOONOOOUYGA@>0$0&.0=&=c0P;6" 00?^r?.&Pc^;8^Kcc^P[^nccc^^T^[R=;=80,0,&4,)"$$&;,0CPCC=88A=R[IFF=t„vppYpv~‹~~p~ppp^ppps[[[[^^[^;1Op]E/1[</"MM/<s^V^o…w‹zjcc^crP?0cP^C?0U_AL8OOOOOOOQOOGLLLOOOGOLQQQLQLLQGYYYYYYd]]YVQJOLLSSSLQQSQLQSSQLQLSLOUQOOOOMOOOROLAG>33&B,&=& + PP$ PyyjP& CC3CcP$KzKIC^ICI[d[dcrcrcyc^^P^K?=8&&+&.+"$+.08.00IYOA8?8ORIFO=t„vpp~~vd‹pvpp~~^^ppp~[[sss[^I;% ]iO1<K]**2iV/IV]pt—w‚‹aPa\crj0PcrP.Kc0'0V^@'1AGLQOLOOOOOJOOOOOOLOLLQQQLLLLSNVSVVYVVSYYGLLLQSVSSSSQSQSQQSSSQLLOOQQNMOMOOONOOI@'U\'0B".P0&^P0cy^c03\PCP^^$$cr[I?^[[^P[^dnTI[nc[II??KP8..&+.+&"$+8C2606C[[?F8IOO=I=„vpvpvp„pppp‹‹pv^p^^pp[[[~s^^;/%12pM9E@i>/</MI<;V~v{……‚zU3PUCzzPPCPj?Kyc&PjP&'1AGLLLLOLOONGOOOGLLLOLQLLLQQLQQJJQUVYYVVUVQLQLQQQQQSSQSSQLQLQQQQQUUQONNNNNMNNOAN_''0P"".00?00^ dC?\>@Pjc?=cP.,Pcc^^[c?[ccnnd`Odn[T??KK?=<..++,.-0+.8I.486?=I[R?FIFA=FvYppp~vpp~p‹v‹‹~vpP^ps^][^s[[;1"1@MI1>KOE<I>9/IV^ppoˆ‚ookUOCcyjP0PP=r‹[Tc3"0''1AJ8LLOOOOOOOOJOOOOGOLLLLOOOGJJJQQUUQUQQOOOQLQOOOOSQQQQOQSQQQOOQQQOONNONMOOOJLAG\jV ,.&0K=? P"PP3CC''0?PK0cC46PnncIT[Rnn[Odand[[TnYA4&&-.&...++..&0K68A==8=?^IIFIC=Iivppvvvpps‹vv‹vpv]]ps^s[[pZ[;M;/1I<1/>OIO<<A1IpV^]wˆtyoUU1'P…yPPPCyr‚n0.^^= ?0'G1AAGGOONNOGOONOMOGGOLOOONONJJNNQQQQQQQOOOQOOOOLQQSQQQOLQQQQQQOOOOONNOOONOOJJAA'>C&jC$,""j^P"0Cjy^\\P3&?C=rWPKT^PcRc[OOcnnnndm`]AA2,1&-.)....&.008T688<=FI8ITIIRCAIYpYvvvppppppvv‹vpipp[ss[[[[;IM11;MI/<1@SM<Ai]^VpptˆoyPAPUOacj\AC?c†‹ync^rcE$.B&;>'1@GLGJOOOQOONONJMOLOOGOOONJJJJMMUUUUUUQOJLLQOQOSSQQQQQQQLQQQQQQOOOONNOONMOOOLA1'C0 &r0".."'crP^0$=\cj\ykCP3 + 0PrKErK^^cnRma[[O[an``WIC@1,&%-<=.&..&$.&0K66=A=F==F?IIYT=?vvvvvppvppivvp„~vv]s^[ss[[;I^"";^]I</1U>/1M]OM]vˆo^oP"C1\UcUaa33Crycc^r‚nC3P=E03'1AA8LGGYYOONNNJJNOOONJOJNONONJOJQUUVULGOLLLQQOQOOQQQSQQOOQOOOQOOONOOQOMOSQJLAV0P &j0".=B0"'0PjVrP&3jy\\jj=??" +0rrCcPcr^n^dndOYamomWWUIC:1::363)&&.&"$.8C06<==F=8AFFFPYFCvvivpv„pppvv„vpp„vp^[[ss[^^^;//;VOI>/9O/11oM>MvtiMMU;1U:`w3Ow33Pry&0cy‹yrcc^P.&K3'@V@VQLNSONJJJJJOOOMNJJOOJNJNMGGJLVZVULOGLOOOOONNOOQQQQOQQQQQQQOOOOONONOQVYQL1'P00C0=r0000Pcrr>>C\\yjycKC&0r^^KKrzrnncnaY][[````]IK@<:.-.-"""$..;626688F=AAAF?RRIRiivvv‹„piov„vpp„{pss^[[[[s[^[;/I[MII;I@1>[hM11PP;MPP;@@'PU3PkAPjr>Cyyr†rryP=c&0>3>@1NSJGJJJNNJNONOMNMMONNNMMOJJAVYYUOGOLOOMNOONOONOOONOOQOOQOOOONNNNNOOOUVN'CC&P0CCc&.""0.^^jc3>Vjyjrj;[? 0K‹rTRTnnPcnmwW][KU]kmk]SC22&&=6&"").&6?2.8688?=C88IIRRIRivtv„viivt„„vpvvipp[[[[p^^^^^;:I^OMMME9>1AP/1PM;1IP::APAkaUUUPjyj>0yzP[†‚r‹r3Pc=P>\\UUG8JLOJJONJOJMNNNMMMMNJNMMGJGYVSQLGJOQONNMMMMNNNOOOOOOOOQQOOOONOOONOOSIU\'\P^$0&PjK$'0CCC\\c>PjjdPy?0PC& ,=Ed‹n[IInnOaakmKA[]]komm]K:22-0.&&"$&+686.08=AAF8;AAIORIR{t„„viiiv„t„vppvv^[[[[sp^^^IIII^IM]MM<19>MP2PM">MPOMPko]U3czy…UU3cU^Pry‹‹yrrr^?d=0jjUPV>>LJJG8NLMONMOOONNMMMMMMGJ>GVIAJGOGGRONNNNNNNNNOOOOJOOMOOOOOONNOOOJJA1'CP3PyCC0VrW0P\C\jyCP&00CV0ryWcP;==EOyyncnnYnmOOmwki[]]]]```O<222.3.."""+.68.68=AA=CC88;RRII{vvvv{tt„t„vviivpp^^[^~[IM^^II^pIIMI<ME>>Y``M$/]^t]^UˆPPc\r‹wU&CPP0ccy‹”‹‹rrcPKKyj3>\11GA8JIVYOLOSONOOMMJMMMMOJJA1VGALGOOOONNONONNNNNNONJOOOGOQQQQONONGGGA1''C^3\c=',\Cjrr?3Cc\a\j@>P=\C0rryc=EEWWy^cnna[`aaM`mohiiiOO[K3OWA..&...&""+.6.8<AA?F?IC;8IRCIvv„iotv{t„tvvivvpps^[[s^[^^^[^sI;I^MI]]1@mUM<<II;1iIMmo@UzUwcU10r‹\PrrrPd‹yy‹dTc…^&?r@'@@VAV_L8JJQYOJNGJMNMJJMMLL8GVAAJOOOOOONNNNNMNMMMJMOONGOLYSLYQNNOGGG11'Cj0&…cCB=^P^^z`CUUU\>P>0&PVPWPKycccWcycrr^adPM`o]`a]K[[[]IUOKOI4--<..-."&-.666=88?FFAF68CTTTvvitvviooivtivivpp^Iss^^V^ssVppIII]IMOM3M`O;I;I":t:UwPMitwzaUAczrCcznOc‚rr‹yr‹rPPPC3C@\@\V8888JQOJJNSLNQLJNLGSGJGGALJOLSQOONNNNMMMNMNMNNOOOGJOSOOQOJULA@_'330=P0Pjc\.,CjjP…yU@C@kU3\0P0VCjPKWyrydcc[^d[[[[`aOa`hO<IPU]]UKKA<F.-<.0..+....88=IC8A=FC8;CRIT{iovovi~vt~iivvppv^^[^^^[^~VV~^>MVIVM>>POU>/;";/":UMawP^Po‚zUAUPj\c‹c3Pr^PPr‹‹‹‹rrw^CK>P\t@1IA1AGLGGJL]JOLOJOLLSL8GGL8LLLSLOOOQONOOJMNNOLQQONONNQQOLQI_A1'\333&0&P^Pjcac3?\yj…—`P3@\&P^0?;PcPcccyycKCTnrddaYOaatwmm]ii[iPPKD<FI8:8<&+."&0.8=FRC88=FI;;EIREiovoivttov]ovvp]p^^^^^^^^pps~p];]M^M11@:O`;/;//""1aUoU:PMtyoAP@Pjr‹UC3CP&CE‹—yy‹—cc=j^wzU1@U1G1VG8GASJGSLJGJLYLL1GGAVGGLYSOOOOOOOOJMMOOOUSOOOOQJLLLAG_V''3\\&&'C0CcyjC\jU\Pz……zU'&'>\\r0&CcP^cE^rr^^^^r^[[`M]]]oˆ~]@AAOKKWUDDFF<.0.&."...A88FI;08AII;RECC{tooitovii`ovvv^v^p^^p^p]s^^^p^I^<^M/111Ai</$$/$/2moiP1PYkwkPA3\z‹k?PnMC^‹r‹‹^‹‹wrccy‹ja33\@@@@@888GLGLGJGJGVGLA8GGA_NGJQVQQNNOQONNOQQJGOQLJNQdQQUJLA1\333\nP&.P&cza\Cy…k\\……—z3C>\rc00 =0PP^yP^cP[n^Yc[Oa``ioiPoo]C@@@@2:KKM<<<66..&&&.=86=IIC008=AIECCE~okv„ooooio„vpPv]v^pvpPppps^[^MIII]><M11K];"6<;`to>@^PwkˆwMP3r…za\cP&Ky‚y^‹zr‚rOzzrznCP3PU@>@UV18GV8>NJLVGAVAGAAVNGVNLJL]SSJOOQOMOUZMOOOQYOOLVYGYLJ@:C>3P\nOP3P\P…\z\U……kU\z…z>&CPcCP0PP0PWPc^WKPPO[OY`AM`MAA@IP`o[@@2@@:2AFF=82...-+..<6.8==80888=IKC;Eo{{vooooPoovvvv]p]OppPPvpp[^^>;IIMvPMM;1<O////APoi;POAktoPU1C…wP\nrCPyyn^czj3cyca‚—‹wcccAc33CUUV11@VANG8GG8VGGGLVVGNNA>GLNQGGLYLQOGOSOOGJJYQOJLN__I1@U3\3Pj\kac3Ozw…zkz@f…yk@\kkk &jC&KPP0^P0?cKOKPYO`OYM211*121@AP`@:199::22<=..0<&&&.68=+6FI=8408FIC;0Cvto~owo`ovvvpPPhpPM^]^Ovp^M^II<IMOiOM>11<O;/II/>`1MPMtPkzoPUkjjzUCcn`cyj^C30rc;rc=y‹…‹nczccaP^czcP1'U>\_A1fA@j@VA8\V1VAA>8>NQGQOYLQLGGYQOLGVSNLQGGUf_:'U3Ck&rPU\kkU\yzykz_@f\…3jUyc0 K…0P^PPKP03^c?<<<=AYMM@99/>@@@PYPM11112--2&..302.--.88808ACC8=;8C?;88C]ktwmmohiviiiPiv]OP]vPvpp]pVI;;MOPOM^111A>II<I;]@$P:MiawoPoPakckA>zUPrc^^C?Pc^C‹3P‹k‚zrz‹z—arjzrUP'3\Uj@>@\@\f__1@fV>N:NA8AVGNN8NVQLJAVGJJAVAYAJA1'\k3>0U3zc0ckUzzzkU\zykty@>\…\PPPyc? PrrycPKP00=cOFFIOOYYMMII[K@:@U`@M@*%:9----...-.66.0A;88A;CIC;668?88;8``ommo`ov_iii]iv[iPOP^Pvvp]^I;]P>@M]]>1>P/<<<<M`"/`OMPztiM]U\aw`3PzOP^cP?&Prnyc3z‹^‹y‚rz—…crjz…P\3C\j\3\U\Cj\U\>>\\\\@UA11_G1V1@kNA1A_NLA.VA_NNG1"UyOc3UCPz\cwkk…yy\\Uy…k_U@\kjPPc=nP &yrrKWEPPPC^rOIO[daYa``M][][MYO?AO<2.2-<3..-.6..80.;868888IK;4;8;88=?O`adok~ov]i]`]ii[[@]]iiippV^IMM>>MOOM>/IO</<<MPO/>[M2PoUM@UUnUP>C…kU3an=.Ky‹‹rPjrra…r‹‹‚—zzjz—zjU>jUj>C\jPcj>jP>^jcPj@\@>@k@@f@@y_@1@_VGN>VN@_P@@'>zj[CUz\…jr…ztUtYkyU\yyU@>>VjyCc?PPK)=cCPKEPE=KKPynT[[^daa`aak]`MMOA=<PMD=<6...&2860.6&2880;8;;;IE484C;;;C`am[koooa`o``ho[KAOPPP^ppp[^;1M1O]OI1MOE>>>MM;2MIO@'OooP1PAao33cwoP1aOU3?Pycr‹yr‚cCczz‚‹——zzj……k…>>jcyC\jjCcP?jC?cz\PrPyP\PzU^zU@…kU@>k\1@>>>>zU_>>Pj‹kaCjkykk‚…yUy_Y…k\kzk333>j\\Pa &K0P&=?0PPcW^P^PK3T…[[[dcmnna`oPKKMKK<2D`C4=.--&..666--.886,4?;88;E4;;@;AI;Yaamo``a`ot`Pi]KPDIKOvp]]p^MMO@1Oi:<<]]>@M>OO;11IM@3UP`11UUjPOcwUOCUaOAacPccrnrr=OPYUAk…wzzUz…wy_UjzjC…yj\c>Pz\\cjU\rPycjcjCcjc^…z\\\kj>@\Uk@j\a>\jcnwkUkkt…Ut…y_y_@kk\\zwU00\V^^c?0;c,P0CcC0??3.3cwYWMMMM``MMMAM`]MMKA`:%-2--&--.--).68?2.0AC;8CC=;;8;IECYmoa`aca`o`PioMWA@P`vivPp^^MOPOOi^>:IO>>MOM]>/1M>P:OOPU13AcPPwwU1mk`kaUOC?ry‹‹?zP=r1032akakfUkUkz\jkk\jj…j>\Ujk\jjkCcj\jckjjCjcUcz‹ccj>kU3j@\3cjjUjj\k…zk_ky…t_yty…yUU\\jPcc30&>j\Pc?yKK0.&0cKK?II3=P‚aYM`OFMMPKAAAY@@22&O22"-.&.-.---..8A80&0;=686ECC80,CEC`o`aOa^`o`P`iUYWAIkov]ipVM^OOKK[]M:>MM>O^POM/M@>PO/33A133O`@kPUU3a\azaPOCa‹‹‹c?r=?C2=3z\zkPUy@P_@z…\Ujj…\@k\\f\jkj\jj\\\\jjUrjkjk…ja\'\\Ck>k>\jzkwfUt…yykfy…ytyf\…UkC\zP=r3 &KjPn&$$crKR=0,P;c^PPOOFA=cw]MMMAMA@:21A@22@32=3&&&602-&-&-660880+8;;;4;CK40,.8E;Oo`P[POao`iPMOOAI]~iP]pM^V^>AAP[]]OO@:>]]]M1<>MMO/12.:C33U3UPPP@Ocww`PUOcy‹‹ykzP.[3&&P…czaCky__@Gky_@kkjV@kf@U\zjy\\Pj\jjz…k………kkjz_zYky\kU\@\ykykNN_kwtyN_…yyfk\wUk\'C‹\3n\ Pc^?,cP==.,P?PP[[PP=AAMwaMDA<2:<@2:M1@C:-&=@.."&-..-$),38.8=0+00;;;6;R;6,0;C=Po[[PIYao`PU[aRRMiiovi]MppM@AWM]]PP]I1O][]11>I<O://23'P3AUU@MU33kkwoPP`jar‹r‹‹a3OP3&C‹jac>'P…kwtYt_@@fkk@@yN:@UjU\\\\\\jz…\Uy…ykykz_kVU…Uy@k_Uy_yfNAV_ffyN1y……UUU\zcU>&Cj3kj^r;&?K====K^^a[[FM`?=MnwWMMK<<<KAM[::@12&=3-<&&&..+-)&-0.=C0+80;;;08C=00.,,6`a[IC[a```i]`[OM]i]]POPpvMO:A]K]v]O]KPOO]O1/I1>M</"3>U?kU:"CPPUaayP`kkoUn‹rw‹P?c?0Pjyz[3?&j—…yt_yYAU…\_V__NANV\V>VV\@@\\zV_y…_fk_yY_N_f_yNtNYfNytdANV_y_N1_y…U@\>PwzU\U0^>C^yW,00C,P^?crc[YM=AU`WankMMPKP]MD`K:12C9::&&2&..-..))&&.6A8&000;;;40=I=6,,&0aPP?I[c`o`P``PRW]PP]OOPpp@:AFMA]P[[[[OO@PP1/1/EE//&33aca111U@PPPkkUmoPaar‹knzOO^Prrjzryc=Pj——…yytyIA@f_@VU_GAA@fGUG>>@1>__1Nyyy___kd_A_fYyNYYIfNft_AAVdf_@1@jy_'\>>CzC3\.Kz3&Vr^R",K=PKPPPnnPOO[O]aaYmmF:<K[[PWmA:<2D:<-%%&&&...=&&&&0860&0.8;;;;;EC;,&,,KPPPP[aa]``aYTP]]`]]PO]v]KA=FOKU[O[PK@@@iO>1//O>/33OPU'%11P@@'AkwmoPOaczra‹zOryccPCyjr\C\z……kPU_z__U_@1NfNAAAIUGVGVVGV___AVy…fGU_VNNAVfNfNNYU_NY_YNAI@_t_@'>z\'C303cfP>0‹r&&rPP0,C?c00^PnnOY[Y[`acanmoKDM[K@AW@:::122&&&&&-&-.C.!"&08.00$0&4?0;;6C;0,0,,P^^[[[[Y`[Y]ORYAK]o]POO^vPM<MMDKP[P[K@@<PO:11I></$1CkzwA11=O1&'AcwUPOUcr‹na‹jr‹nrc?^ycjPCcyUO3'3kyt@V@V.N_IOUAAGGNANVIVNNNAVky_I_VAINOY_NtYYdZ_ZNYYNIAA@kU@'3y…Uc3?'\&3jPyC0 CP=;,KK=C.P^^^YOMOIOFMOamo][KA:<3<9:::,,<2&&&&"&..0."&.88.0..0000008;6800000K^adaMOY[PRO=FOKP]oKKOPii]M<O?KP[MM]@OP:I@>>@O>/1/2aaa3%/13U:1&2UPoo]Uwon‹`rz…‹rrn^jryrjOcCcCPCCayf@@U111UNIJAJAAGNGIVINVIVQGffYLdILAIAYdI_QN_I_IAY__IA1:kt\@\…yz3&=\&P\?j^K=0&^$B=Ec?T=3^aPcOOODFFFMOOMOK@:@IKD:<:<<3<2-%"&..+-&$-.6=.60&..880,0884,,080^naOF?ddaOKMFMM[]``POOOi]MFMMYWPPDMM@[K2AK@>O>/1$%=UA3&%@2OP/1APUMt]awo`zrnzP‹zzncr‹rrcrja>c3aCkU\UUY>1@G@1YUAO>>>NAIAQNNUUVUtfGAYUJAIANNI_IN_ItIAI_iI.11Pk\>>‹…jP3j>0PCjc0C;0&VC.KK^IIP3=a?PMYY`CCC4,-2A@2%%14::2:.2.-2&&&&"..."&.8=.A=80&.80,06;;000;6nmYCCTmn[OOOOOM]P`]PP]PP]OOY`O[]MDFM@P::K]MOO11//2O1A&'2:2U1:@1PM`Uoo`wwwzoa‹…awzzz‹r^‹rUOnP\cU@\\\@@1.@@NNA>>>AIA>IQZNQ>IQU__JUYIOAAIYZNfNYYI_Y>1Y_N..''kk\?zjUj3'PP0K^cc?&,?Pc;WCPO=KI3PMO<M]`][K@,*2,911%%'%&132-,-&!!&"&-<6!""0608?;;0&08+,00080;0,n^PWc[[[KO[aOMOUM`]OP]PWOOYY[O]YOOFMMK@APOOO@211/:@-A%/2.P$///@:AkoiiPowczcz‹zzzzzr‹…rzccPrj^CCPj\j`U11Ut@A>8AINIA>AIYNJUIOAd_JAZA>IAI_INfNYYNNII.@UY."''CzzC>Py?U>3C'&jrjP";KcPI=CcCIO?Oa?.M]KMPMKP:@<191,,-,%!,:2&,&,&!&!"&&==""".+00?I;0+.0&&&,0006.&c^TPKPK?O[[`P?MPMMPi]PO][YYYa[YY[M=MMPAAPPO@@,$ -A><21%33"$1/2UPii]MP`jzzn‹‹zwz‹‹‹zzwzzzzrcc\UUkUP\U@@Y:1.>NYI>>AI:IIAJ>AUA_d>IIIJIZI_NYYPYYPI1@.'U\1'>>\cj>0\3jCC03PWjjTK$$0?c^IMMC23O32POMCMPKKK<22:KIII>:@::2--2222--&!%&".<&"&&&,0;K=;008,$$..=;00,[EKIPICKKKIPU?MPPP[]iP`OYa[[d^YR[O?MMA3AM[P@11&*:<1<A/=1/$11UP1iPM]PPj‹cwzwac‚zw‹zrc‹‹zyrrznU@\>\kU::':.1@IA>8>>INA.L>A>AAfNININ>GIIYIYN@y@UG.P@"Pk33'3\>j\\jCP\CC>CP?cyKP+=POPra=Ma3%=3?aM-AKA@KK@,,2C1*,,%---:-!&22,-!"&&&<..""&"&&0E?;&000$$,000=.0KPKIOIIOKOPOOIF][]PMMM`O[a[[^c^OYMMMPA4MPKPK2%%%-:1KA112$3AA1/]MM^OMzzo‚oowzzzz‚…ww‚‹…z‹zrk33UaUUU::@11_:A1III>AI>>>NA>A:fIII>IAII:_AN@_yYU@':@''k@A'3P&Cy^c\&C3PC0P03Pj=Pyrr[AOPP^rP=a`<<<23OK1$1@K@UII1,D4*'*%"--4.!%-2--"&"&8<<&&&..,00;00880,.00===.PK?KP^OCCKIOO?<MPMM]`O`a[Pn^PTK[`==MYK@P=MP]A%&-<A@K1%11%1A["&1/E;MO]n‚kooowww‚zz…‚wk……z‹zmawU`jU@UkUUPU@@11@@Y>>IIOAANA>1@_:ANAAAAI:YI@1@yUU:''U''a@3@3C>&…\jC0P3KCjP0?P^c^ycrYMAPjncCOmaK2<2IA%%-92ACC1C:C:,&$%,-,,"'.---&$$&=<.&80&&&&00&&00;$&.,&0,&P;E^[^I;EP=MOCF```O``[[^TT[[PKT[YIOOMOOOAAMM32--4C1<&1,%"A1I>M;PUojwiioiow…www‚to‚‹‚‚‹kkzyzzcUUkUk_k_P@@'PY11@Y>>II:NANN@I.:I.A1_YN:Y@@kU@3A:A@'AU@U3'CC3\jjP3C>PV^PPPPrryaP[PMPU[aaam`]112[M**91,-@:C949@,%,--.--!&4--!!"&.8<0&I8&& $&$&$,6;,$$,,$WRWTTI;;=KIOOOOM``YdmY[RTc^KPKW^POOOOMOO=<FM<34%::,<&$1'&0K1A/>Ao`[n]Piiitˆ‚okˆootz‹‹zzwwzzzzkkzkkkkt_PY:P@@"U_::N@@YYAY:@N.@N.:@YP:@YUAtU@@U@@U:3\UC>33\C3Uwc??C03cr^^cccrzr[YPO`OOMaanPKI2@Od1$,9,&4:99,%:4,-&)'''"!!-6%!!00..$&I6.&$$$$&00&$$"RccI;=?00E[OO?FOaaY[aPK[TPOIK^c^OORMO==A33F?6=:::1!-&-32,$$3&KPPO`oP]iiow‚toˆooow‹……okjz‚zzkkzk\kwfUU_Y_YP_Y_UI@UYNUI:Y1P@1M_::_UV::@fUk`@@PUPt>@\kUU33cC'Ckj?IC?C?Pr‚kmnzrz‚n`KP`AOAMOo`@KPKAn1$9,,2D4,-,,4,,%,,%!%!!&.&"0.3.,T8++$$"")$+&, $ccK8<=6=KW^IIPORYY[[^T[WTT?0KK^[?FORO=<==3C==<<:@%$%-"A2%132>1/@`UP>iYoyw‚ˆtPyz…‚…tUnzz…zzwwykwkUUtkk_UN^@UUPY\_UUkYU_:U_:@kYP_UYYY_f_U_U:@f_UkUUyUk@AaP&3cccI\CP^jnz‚oUnj……wkKK]UM2@Kok@1IOMd1$$1,-:D4,'&44.)'-""!!"!.)"&!.006AK8.&"$WC8ARD8CKEKICT^IIR[T^^KWWEC0=PTKOOO??8==??O==6<::*3A-&-2%$&1/1;AMPM>i]twˆoowwz‚ˆ‚wow‚z‚…‚‚zzwkzyokkktkfoY_f\YVkt_k_YtU:U@@@f@_kUt_U_U__Y_Y_ktUyftyUkka\UUCkjzakncnzww‚z``k‚‚‚o[IOiPM@<@`K112I`14*$9,,-4::,,-66-'4-!'!.-"0&&8I;$.+++ EC=CTC;EECIIPKIIFRPTTPKKKKE;KWTKYF=0?80=F=?==6<:2%-2,<D-@2 2/1/AOO:1Poˆwotowww‚‚ˆit‚zz‚…‚……w…y…kykkkykfUykfyfkyyyy_NtU@\P@Mf_o_fkf_t_U_Nff_yytyyy\Uyyck`U\Uwzzwzoowwow‚tUanwˆt[OE]@]P::M[O>11WE<$ ,,%'',',,44-)'%' ))"""0++.F0""",8,"TT=EEEEIE=?RK;;KITOCPTKKPTKTWRTIF??==?=F=====<:21!22-<-!2@$$A/"1A>>>$Atˆioˆo~tw‚yoo‚…‚…ˆ‚…‚ywz‚ˆ‚kwzywkktfkkt\kzyky_tfffk__Ykk_ktyt_____oyyyyytttt_tkk`kUUokzzzzwtoˆˆowˆyoowmˆˆi]OM]IK[<<:O@/1K<* &%$ %%!,%!!)!!$&!"$0&&&=8"+,&+$T=CK=====POOI;EK=IKKKKEBEWVcWTTIFC=00?=3?<<<.3<4,%.2 -,'!%2$$$&@1121>1%aˆiP]vio‚w‚toy‚ˆ…z‚…‚ytw…ywyky…zyyykkkykykykU_Pffkyyftkkytktf__t__kyyyyytyftttkkUUUkowwy……‚…wowˆowˆytoaakˆi]V>OOO[>22@@//:E<& !' !%'!'""$")$.I;""" $$"$"""C==K=;;=EKI?;=KR=IKE=E=PPWccWTTKIKI088?KI?=..<F---<-!%4%%*1%A"&/11AwiM^v{vˆwˆyt~y…‚‚ˆˆwˆto…‚w…tˆ…………wkkyyy…ykUftktkUfyyyyyyyff_tyk_ttyttyyˆftyUyˆtUtztkˆyˆwwˆyˆzwyˆˆwtvtioo`ˆi]]M>OO]</*%@21:19*$& $ !!&""""0$""+88& 0=KEB==EKKC?;=KOIKWPEEEPPVccWRKIKPK;;0KWP?=..=?-,%,,!!&C&1%1$$A1&$:1aoMMpvtvowˆˆ~ˆw‚‚ˆwwˆˆow…y‚yy‚…y‚ˆwywyyy……yk_tyU_ktykyyyfyyytyyftftyytyyyytytyyttyˆˆtˆtwyˆtˆtvˆtotˆtvvviwotv<]OE>EO<1/$1>:2**& & !!""8&"+0;4$$$)EE.0BBBW;?=6=TOIKEBP=BWOWdccTC?CKK?00KcT?=3.84-)-%,!--%1111//32%$1`o1;M]vvvtˆootoˆ…‚ˆwwwtt‚z…‚‚ˆˆy‚yyyˆyywty…‚ytyyyPUUykyywkyytyyttttyyyytttytˆyˆywwywytowtˆwtoyvtwvt„tvitvok~iM<VM>E>1<*$/*1,$& & "-!"""""..068$$+" =E;===BBEKIEEKI?KCE=B==WWWcdcR=E=;E=;00KKI?26.)6=4&----4'%%%1/11A11a@1IM^vvt~tvittˆˆtwˆˆˆˆyw…ˆˆyyyˆ…ˆwty…‚tt…‚yytyyytU_fyyyyytyyyyyyyyyˆyttytytyyyyyˆˆyytoˆytttvot„ttv„tvvvYw]oiV<<<SO<19*$*9,*2 &4-%"+""+.+0"$$ + &$$%&,&&&&.&&.-$&.&.&&.&&.&02.&3&.&&..&&&&&.&&&&&2&'&.&&..3.33&&3.31...&.&&&.&&%.&&%%&%&%&%&&1%%%)%' + + + + + + + + + \ No newline at end of file diff --git a/tutorial/image/monkey.png b/tutorial/image/monkey.png new file mode 100644 index 0000000000000000000000000000000000000000..81bd2dc7e815535d9f0a62f78510524d882ff286 Binary files /dev/null and b/tutorial/image/monkey.png differ diff --git a/tutorial/image/monkey.ppm b/tutorial/image/monkey.ppm new file mode 100644 index 0000000000000000000000000000000000000000..b725d13dcd115e1b15ab46bd877a0781204f2d4e --- /dev/null +++ b/tutorial/image/monkey.ppm @@ -0,0 +1,4 @@ +P6 +256 256 +255 +oQ/UL-fZ8D:+UL-gg9oQ/oQ/‘ˆ;fZ8UL-UL-y„<y…Jgg9‡‡IhuIy…Jgg9gg9GF-‘ˆ;y„<y„<y„<lr9lr9‘ˆ;y„<˜¥W’•I˜¥W˜¥Wy„<™¥h’•IZe;wv;y„<gg9˜¥WoˆVJU:Ze;gg9¨µxfjg86+WW8oˆVlr9oˆVZe;huI—˜g†‰gx”kš³’‰•YoˆVj„hš³’˜¨§˜§ˆ˜§ˆ¥u‡—xx†hVZVQjJz•yv¤šv¤šx”kz•yIWGQjJKeWQjJIWGJU:huIˆ–hZe;IWGJU:x”k[tXhuIx”kš³’z•‡QjJhvXgy†QjJš³’i‡‡wˆw©¶¸˜¨§wˆwx†hz•‡pxŒfjgz•‡ZwvOKNi‡‡‡™—¨µ¨z•yz•‡:GFGH8hxgi‡‡v¥®ˆ¦§i‡‡YuhWifZwvj”’‰¥—]…qQjJKeW=eeKeW]…qZ†gywˆ¦§IYVfjgˆ¦§ˆ¦§ZwvZwvi‡‡•®²•®²ˆ¦§i‡‡w‰‡v¤šv¥®WiwVZVy–—Wiwi†xwŠ•‡˜‡Œš§z•‡‡™—‰¥—y–—y–—©¶¸v¥®gywYuhz•‡hˆ–i‡‡i†xgy†Jgnx†hZwvi†xw‰‡Yuhi†xOKN]…qi‡‡[tXj„hwˆwi‡‡y–—v¥®z•‡Yuhi‡‡MYj39Iw‰‡«¹Êz•‡•®²ˆ¦§‡™—y–—•®²‡™—hxgwˆw‡—x˜¨§uygˆ–hx†hj„hi‡‡[tXw‰‡fjgYeHYeHwxW¨¶—¨¶‡¦¨w–šwŠ¤ˆ‡˜‡™¦wÃÅ¡¨¶—¨µxx†hhvX—˜gµÄ¦¨w•ŠW˜¥W—˜g™¥h¦¨w™¦w¦¨w‡ˆX˜¥W¥uz•y…Šw‰•Y´±o´±o´±o…{WZe;UK7fZ8huIwwHgg9x…Xˆ–hvi8UL-UL-D:+Nf9UL-D:+5+(lr9UL-5+(D:+y„<ȵloQ/lr9‡‡I‘ˆ;wwHlr9lr9’•I˜¥W˜¥Wlr9Nf9UL-Nf9y„<˜¥W’•Iy„<‰•Ylr9’•I™¥hWW8lr9x…Xy„<y…Jy…JoˆVZe;gg9™¥hx”kNf9huIx”kx…XoˆV[tXQjJx†h‰¥—‰¥—¨µ¨˜§ˆ‰•YwxW˜§ˆ˜§ˆ¥u—¨–oˆVwˆwVZVYuhi†xi†xi‡‡x”k]…qj„hj„hŠ¤ˆ]…qKeWQjJXgWi†xx”khuIhvXIWGx”khxg[tXVZVfjV‡˜‡Š¤ˆz•yv¤šj„hz•yy–—i†xˆ¦§y–—YuhYuhXgWZwv]…qYuhhxgXgW[tXgyww‰‡YuhYuh[tX:QlGJFj”’hˆ–ZwvJgn[tXi‡‡Yuhˆ¦§v¤šj”’ZwvWifIYVJgnWifhˆ–Zwvv¤šSpŽWiwv¤šŽ¬ÌZ†v¤šˆ¦§y–—z•‡j”’IYVYuhwŠ•y–—ZwvXgWi‡‡Wiw[tXYuhVZVVZVYuhz•‡gywi†xi†xi†xZwvGJFKeWi†xˆ¦§ˆ¦§j”’j”’MYjXgWi†xXgWVZVIWGfjVj„hv¤šMYjVYGYuhgy†v¤šˆ¦§‰Äy–—v¤šv¤šMYjF<EŒš§•®²z•‡‰¥—fjgwˆwŠ¤ˆŠ¤ˆ‰¥—hxgwˆw¥uj„hGJF‡—xˆ–h‡—xi†xgywi†xwˆw…Šw…Šw¨¶—¨¶—‡—xx…Xx†h‡˜‡…Šw™¦w·²¨µx¦¨w¥uˆ–h¨µx¦¨w—˜Y—˜Y—˜g‰•Y¸Ãu¨¶—x”k—˜gx…X™¥h™¦wx†huygwxW¦¨w§§h‰•Ygg9WW8ghHghHhuIe[GhvXe[GWW8oQ/gg9UL-R4'UL-UL-UL-5+(GF-UL-5+(86+fZ8¯§Vwv;UL-‘ˆ;‘ˆ;’•I‡‡IZe;˜¥WÉÄp¯§V‘ˆ;lr9UL-D:+y„<¸Ãu˜¥Wy„<y„<y„<Nf9y„<‡‡Iy„<ˆ–hy„<’•I’•Iy…JNf9y…J™¦w¥uoˆVˆ–h˜¥W‡ˆXx”k¨¶—‡—xx”k¨¶—‡˜‡¥u™¦wx…X™¦w‡—x¥uˆ¦§Š¤ˆYuhYuh[tXz•‡hvXi†xXgW]…qKeW:GFQjJŠ¤ˆz•‡ZwvKeWz•yš³’i†xIWGz•ygy†hvXz•yVZV[tXWif‡˜‡‡—x‰¥—Š¤ˆhˆ–GJFhxgYuhj„hj”’Zwv[tXKeWZwvi†xZwvD<5WifIWGWiwKeWIWG;F8YuhWiwIWGi‡‡IYVKeW]…qj”’WifIWG[tXXgWx”kv¤šYuhQjJKeW[tXhˆ–j”’q¬Ôv¤šo®v¤šv¥®i†xhˆ–y–—v¥®v¥®i‡‡IYVWiwZwvv¤ši†xi‡‡i‡‡JgnOKNgywgy†VZVKeWhxgXgWYuhVZV;F8JU:YuhIYVXgWi†x[tXWifWifJgni‡‡WiwYuhZwv:GFIWGy–—ZwvOKNi‡‡y–—Z†i‡‡•®²•®²Ž¬Ì•®²©¶¸wŠ•hˆ–©¶¸‰¥—x”kWifGJFfjgŠ¤ˆ‡™—hxgi†xwˆwŠ¤ˆVZVXgW‡˜‡–š‡˜¨§š³’—¨–˜§ˆ¨¶—¨µ¨¨¶—˜§ˆ‰•Y¥u—˜g˜§ˆ…Šw…Šw¨¶‡¨¶‡•Šm¦¨w–šwujG‡ˆX†‰g‡ˆX•ŠWx…X—˜Y—˜gwxW˜¥W´±o§§h™¥hx†hoˆVuygwxW…ŠwwxWy…J’•I˜¥Wy…Jlr9Ze;wwHghHWW8y…JD:+Žr6vi8GF-lr9oQ/lr9UL-UL-UL-UL-UL-fZ8˜¥W†yHGF-fZ8’•Iwv;«¢;‡‡Ilr9’•I«¢;‘ˆ;’•I’•Ilr9y„<y„<ÜÄL’•INf9oˆVlr9:F/Ze;oˆV¨µxoˆVgg9˜¥Wx”kj„hoˆV˜¥W¨¶‡š³’˜¥WwwHhuIYeHˆ–h¥ux…X™¦w˜§ˆz•y…ŠwhvX¥u]…q¥u•®²v¤šŠ¤ˆw‰‡Wifuyg[tXXgWKeWj”’Yuh:OQ86+XgWx”ki‡‡gywz•‡¶Ã²z•‡IYVhvX—¨–hxgwˆwgy†z•‡š³’š³’i‡‡y–—y–—z•y]…qIYVIWGQjJIWGGJFQjJXgWKeWXgWWifGJFYuhZwvIYV995IWGYuhZwvZwvZwvWifGJFYuhi†x[tX;F8IWG:GFJU:[tX]…qKeW[tX=ee;F8XgWi†xi‡‡YuhWifYuhVZVKeWWifwˆwv¤šv¤šJgnKeWj”’WifZwvXgWYuhZwvXgWWiwv¤šv¤šhˆ–ZwvVZVVZVIYVIWGIYVXgWz•‡JgnKeWGJFIWGGH8GJFIWG[tXZwvWifKeWMYjYuhSpŽKeWJgnj”’v¥®wŠ•w‰‡v¤š—»Ø‰Äˆ¦§Ž¬Ìy–—ˆ¦§v¥®fjgXgWGJFWifgywz•‡uzv‡™—ˆ¦§j„hWiffjgŠ¤ˆš³’¨¶—¨¶—¨µ¨uygwˆw‰¥—š³’˜§ˆukXx†h¥u¨¶‡¨¶—Š¤ˆ†‰g™¥h—˜g§§h¦¨w‡ˆX—˜g†‰ghuI‰•Y§§hy…Jy…JoˆV‡ˆX‰•Y–šwhvXy…J¥ux”kwwHujG™¥h™¦w¯§V¸Ãu§§hoˆVhuI‡‡IZe;WW8’•I˜¥W5+(UL-vi8R4'wv;«¢;y„<y„<Ze;lr9lr9y…J‡‡I‘ˆ;‡‡Ilr9Nf9y„<wv;y„<«¢;‘ˆ;‰•Yy…J«¢;˜¥W˜¥W«¢;’•Ilr9’•I’•Iy„<lr9oˆVy„<huIy…J™¥h™¥hx†hy…J‡‡IhuIoˆVy„<y…J§§hx”kgg9Nf9x”koˆVx…Xx†hwxWš³’š³’Š¤ˆz•yx”kuzvhxgš³’—¨–š³’wŠ•KeW[tXj”’ZwvKeWz•yj”’YuhYuhZwv]…qz•yYuhwˆwz•yŠ¤ˆ†‰gGJFYeHuzvWifw‰‡ˆ¦§•®²i‡‡i†xw‰‡wŠ•Yuhv¥®Z†GH8;F8;F8XgW:GF86+IWGhxgMYjGJFIWGz•‡YuhWifIYVz•‡gy†i†xi‡‡[tXWifJU:;F8GF-;F8IWG;F8[tXYuh]…q[tX[tXj„h:GFGH8IWGGH8GJFIWGYuhKeWWifKeWhxgi†x]…qWiwQjJi†x]…qKeWIWGYeHIYVYuhgywYuhj„hWifOKNGH8IYVJgnOKNWifWifXgWYuhIYV:OQGJFWify–—YuhKeWWifWifWifWiwv¤šv¥®hˆ–hˆ–hˆ–wŠ•gy†wŠ•n˜ÇŒš§•®²ˆ¦§y–—‰¥—•®²MYjhxg‰¥—z•‡v¤šz•‡VZVuyg¨µ¨‡˜‡x†h‡—xx†h¨¶——¨–…Šw–šwfjgfjVwˆwš³’x†hUK7huI˜§ˆ–š‡–šwµÄx†h‡ˆX§§h¸Ãu¦©ˆ™¥h¨µxwxW†‰g–šw™¦wˆ–hoˆV¥u‡—x¥u™¥h¨µx™¦wwˆwz•‡uygwwH¨µx¨µx´±oȵl¸Ãu—˜YghH‰•Yx…XWW8Ze;gg9†yH5+(R4'UL-oQ/wv;«¢;«¢;y„<lr9wv;’•I˜¥W˜¥W’•I’•I«¢;’•Iy„<Nf9gg9y„<y„<y„<¯§V˜¥Wy…J’•I˜¥W˜¥W¸Ãu«¢;’•Iy„<oˆV’•I˜¥W¥uoˆV˜¥W¥u¨¶‡[tXZe;huIhuIj„hNf9huIoˆVNf9Nf9˜¥Wy…JNf9YeHVYGˆ–h¥uš³’wˆwoˆVj„hwˆwj„hw‰‡‰¥—‡˜‡Yuhi†xˆ¦§j”’YuhYuhj”’Yuhz•yi†x[tXfjVi†xx”khxgx…Xx†hGH8GJFOKNGJFIWGfjgz•‡i†xgywWiwYuhYeHi†xhvXIWGIYVQjJ[tXGJF-12995QjJIYVZwvYuhYuhj„hYuhJU:QjJKeWhvXfjgIWGIWGIYVIWGQjJYuh[tXIYVIWGQjJQjJIWGIWGIWGQjJIWGIWGJU:KeWi†xJgnGJFIYVYuhKeWIWGKeWIYVKeWIWG[tXKeW:GFVZVZwvIYVOKNIWGi‡‡i†xWiwKeWi†xi‡‡IWGIWGIYVJgnMYjKeWKeWIYVWiw‰¥—j”’ZwvJgnSpŽpxŒgy†y–—i†xv¥®v¥®i‡‡hˆ–gy†wŠ•‡™—•®²•®²w‰‡wˆw•®²ˆ¦§Wifˆ¦§•®²y–—gywe[GJU:w‰‡x†h…Šw¨¶—uzvwˆwz•yVZVfjgfjVj„h‰¥—z•y‰¥—j„hwxWx†h†‰gx”kŠ¤ˆ…Šwhxgˆ–h¦¨w©•o—˜g¦©ˆ•Šm™¥hµÄ·²¦¨w¨µxµÄ¨µxˆ–h™¥h´±o¨µx˜§ˆ¥u—˜Y™¥h…{W•ŠW§˜W§˜W—˜Y‡‡Iwv;‡ˆXfjVJU:gg9Ze;UL-UL-D:+UL-UL-oQ/‘ˆ;wv;oQ/lr9wwH‡‡I˜¥W’•I‘ˆ;«¢;’•I‘ˆ;‘ˆ;¯§V‰•Yy„<y„<lr9Ze;’•I˜¥W˜¥Wx”k¥u˜¥W˜¥W’•Iy„<y„<y„<¥u¨µxµÄ™¥h¥u¨µx¥uoˆVJU:QjJQjJŠ¤ˆx”kx”kx…Xy„<¥uoˆVhuIJU:hvXQjJ¥uŠ¤ˆx”kx”khxg[tXWifZe;Zwvwˆwj„hXgWYuhgyw[tX]…qj”’z•‡i†xj„hj„h]…q[tXj„hv¤šhxg;F8IWGIWGVZVVZVVZVYuhi‡‡gywi‡‡i‡‡Yuh]…qIYVXgWGH8GH8GH8D<5D:+IWGYuhWifZwvGJFYuhWifQjJVYGGH8:F/D<5GF-:F/GJF:F/:F/995GH8IWGIWGKeWIWGVYG;F8:F/:F/JU::F/]…qIYVKeWJgnj”’o®Zwv:GFIWGVZV:GF=eeZwvZ†v¥®]…qYuhIWGKeWv¤šhˆ–WifZwvMYjVYGIWGXgWIYVMYjKeW]…qJgnKeWgywv¤šZ†[tXi‡‡gywgyw[tXYuhhˆ–Zwvj”’i‡‡VZVgywwŠ•y–—‡™—ˆ¦§o®Ž¬ÌwŠ••®²o®Wiwgyw•®²Ž¬Ìz•‡v¤ši†xgywfjVx…Xx†hwˆwhvXŠ¤ˆuzvYeH‡™—gywhvX†Š‡fjg‡˜‡Š¤ˆš³’–š‡hvXwwH‡‡I‰•Y…Šw†‰g‡—x–š‡—˜gukXe[G…{Wuyg‡ˆXµÄ¨¶‡§§h¸Ãu¸Ãu´±o™¥hˆ–h‰•Y¨µx¨¶‡ˆ–hx†hˆ–hx…XUK7WW8ujGwwHy…J‡‡I‰•YhuIhuIy„<˜¥WhuIhuIhuIR4'lr9UL-5+(oQ/‘ˆ;UL-UL-Ze;‡‡I¨µxy„<’•Iy„<‘ˆ;lr9UL-˜¥W¨µxy„<lr9Ze;oˆV’•I¸Ãu˜¥W‰•Y˜¥W˜¥W«¢;y„<Nf9:F/y„<˜¥W¨µx˜¥Wy„<˜¥W¸Ãu˜¥W¥uj„hQjJx”kŠ¤ˆ¥u¥uˆ–hy„<™¥hx”kj„hNf9hvXVYGj„hy–—i†xˆ–hz•yˆ¦§j”’Wifj”’w‰‡z•‡i‡‡i†xYuhgywwŠ•j”’v¤šz•‡]…qVYGXgWIWGVYGj„hhxgGH8KeWYuhD<5GH8;F8JU:j„hYuhYeHYuhGJFQjJIYVGH8995D<5995995995GH8i†xj”’Z†GJFJU:VYGGH8JU::F/GH8GH8GH8VYGIWG86+5+(JU:IWG:F/[tXIWG:F/GF-:F/-12:F/JU:JU:IWGOKNYuh]…qYuhj”’ZwvJgnGJFIYVKeWZ†Z†v¥®q¬Ôv¥®]…qIYVSpŽv¥®Ž¬Ìˆ¦§i‡‡KeWKeWi‡‡i‡‡Wifi†xi‡‡Yuhi†xi‡‡i‡‡z•‡gy†IYVZwvi‡‡i‡‡MYji†xj”’hˆ–w‰‡gy†ojow‰‡v¥®•®²•®²•®²wŠ••®²ˆ¦§Œš§w‰‡‡™—v¥®‰¥—ˆ¦§j”’i‡‡i†xi‡‡XgWuygz•‡z•yˆ–hhxgIWGj„hwˆwJU:OKNfjV—¨–Š¤ˆ˜§ˆ˜§ˆ…Šwj„hghHwxW–šwŠ¤ˆˆ–h˜§ˆ¨¶‡¨¶‡wxWhvXwˆwwˆw™¥h§§h§§h´±o•ŠW‡‡I¸Ãu¨µx—˜g™¥h¨µx¨µxˆ–h‰•Y¥uhuIoˆVy…J™¥h™¥h¨µxµÄ§§hwwH‡‡I«¢;’•Iwv;QjJy„<UL-y„<I86+86+UL-UL-lr9Ze;Ze;’•IwwHwv;‘ˆ;’•Iy„<y…Jy…J˜¥W˜¥W˜¥Wlr9huIy…J˜¥W«¢;¥u‰•Y˜¥W˜¥W˜¥WoˆVNf9Nf9lr9˜¥W¸ÃuoˆVlr9‘ˆ;y…J™¥h¥uhuIŠ¤ˆµÄ¨µxx”koˆVhvXy…Jx…X‡—xx”kˆ–hhvXj„hz•yZwv[tX[tXv¤š«¹Êv¥®v¤šv¤ši‡‡hˆ–i‡‡w‰‡i‡‡i†xi†xWifWifhxgGJFGJFIYVKeW;F8GH8IWGWifVZV995-1286+995GH8VZV[tXWif86+GH8VYGGJFF<ED<5XgWWiwKeWKeWIYV[tXj„hVZVJU:XgWGJFXgWIWG995995D<5VZVVZV;F8995JU:;F8:F/[tX;F8995:F/86+-1286+JU:;F8:F/:F/IWGYuhIWGJgnZwvZwvWiwj”’j”’o®v¤šv¥®•®²v¥®]…qZ†j”’Ž¬Ìv¥®wŠ•hˆ–WiwWifZ†Jgngy†Z†i‡‡ZwvYuhWifWifgywhˆ–ZwvZwvwŠ•‰¥—v¥®y–—ˆ¦§‡™—v¤šv¤šgy†y–—i‡‡‡™—•®²•®²v¥®wŠ•ˆ¦§v¥®Œš§ˆ¦§‰Äˆ¦§Ž¬Ìv¥®i‡‡v¤šv¥®i‡‡gywVYGIWGYeH[tXghHx…XghHD<5GJF–š‡¦©—š³’—™—uygx†h†‰g¨µx¨¶—–š‡hvXuyg™¦w¨µx–šw‰•Y¥uwˆw¥u¨µx´±o˜¥Wvi8Ze;‡ˆX§§h¨¶‡¦©—¨µx¨µx¨µx¨¶‡™¦w‰•Yˆ–h™¥h‡‡I—˜g™¥h¯§V˜¥WYeHgg9’•Iy„<gg9lr9oˆV’•IUL-GF-UL-GF-Nf9lr9UL-Nf9‘ˆ;GF-Nf9y„<gg9‘ˆ;’•I‘ˆ;lr9¥u§§h¯§V¯§V˜¥Wy„<’•I˜¥W’•I˜¥W˜¥W’•I‰•Y˜¥W¥u’•IoˆV‰•Y˜¥W¸Ãu¸ÃuoˆVNf9Nf9oˆV™¥h¥u™¥h¨µx¨µxx…XoˆVoˆVx…XZe;huI‡—xy…Jˆ–h‰¥—z•‡z•yIYVGJFwˆw‰¥—•®²•®²‰¥—v¤šv¤ši†xi‡‡i†xKeWGJFIYVWifi‡‡WiwYuhj„h¥uWif:GFD<5WiwZwvYuh]…qWifYeHZwvYuhWifUK7GJFIWGGH8VZVVZVJgnWifgywy–—v¤šgy†GJFWW8GH8995GH8GJFKeWWiw:GFF<EIWGMYjYuhZ†Jgn;F8IWG:F/995;F8KeWKeW:GF;F8:F/QjJ=eeIWG;F8SpŽYuhZ†WŠ³Z†ZwvW•Éq¬Ôv¥®Z¨Õv¤šŽÁÚŽÁÚv¥®z•‡v¥®•®²v¥®i‡‡Zwvj”’y–—i‡‡gy†OKNXgWi†xWiwWifZwvhˆ–hˆ–j”’ˆ¦§©¶¸©¶¸•®²v¥®o®v¤š•®²ˆ¦§ˆ¦§†Š‡‡™—‰Äˆ¦§•®²Ž¬Ì‰Äj”’MYjw‰‡v¥®hˆ–i‡‡gy†gywv¤šv¥®i‡‡x”kw‰‡ZwvVYGQjJKeWQjJhuIYeHfjVIWGGJFuzvwˆwx”ky–—WifJU:x”k—˜g™¦wukXfjV‡˜‡š³’‡˜‡–šw¦¨wµÄ˜§ˆ˜§ˆ¦©ˆ§§h™¥hwwHhuI‡ˆX™¥h‰•Yˆ–h¦¨w¨µx–šw™¥h¦¨w™¥h´±o—˜Y‡‡IhuIUK7fZ8vi8WW8YeH‰•Y‰•Yx…Xˆ–h¥ux”k‰•YUL-5+(GF-UL-UL-y„<UL-GF-lr9Ze;gg9˜¥W™¥hy…J‡‡I˜¥Wy„<y…J‰•Y’•I˜¥W’•Iy„<y„<«¢;˜¥Wy„<˜¥W‰•YoˆVoˆV˜¥Wy„<oˆV˜¥Wy…J˜¥W˜¥W¥uhuIy…JoˆVYeHy…J˜¥W˜¥WghHJU:wxWZe;x”khvXJU:huIXgWXgWš³’‰¥—]…qQjJWifz•‡i†xYuhgywYuhi†xWifZwvWiwJgnYuhGJF]…qfjghxgi†xgy†YuhghHi†xJgnIWGhxgj”’[tXIWGJU:VYG[tXGH8F<EGH8YuhZwvVZVi†xi‡‡hˆ–ZwvgywwŠ•gywi†xi‡‡WifD<5GH8GJFVZVi‡‡Z†IYVGJFGJF:OQZwvZ†MYji†xi‡‡IWGJU:KeWgywhˆ–Z†Zwv[tXIWGYuhKeWKeWv¥®j”’v¥®q¬Ôv¥®WŠ³w»çŽÁÚŽ¬ÌŽÁÚv¥®ŽÁÚ‰¥—•®²—»ØšÂÝv¤š]…q]…qi‡‡JgnIWGGJFF<EIYVWiwj”’ˆ¦§j”’y–—•®²Ž¬Ìv¥®ˆ¦§v¥®•®²•®²wŠ•ˆ¦§‰Äˆ¦§ˆ¦§y–—gyww‰‡ˆ¦§gywi†xuzvw‰‡Z†gy†Wifi‡‡i‡‡gy†gywZ†Yuhgywj„hj„hw‰‡i‡‡fjgz•‡gywGH8XgWz•y‡˜‡gyw[tX†‰goˆVfjVgywfjVfjgYeHwxWuygghH¨¶‡ÃÅ¡¥uwˆwx†h–šw·²™¦wˆ–huygx…X˜¥Wx…Xy…JoˆVy…J‡ˆXhvXwwH…{W¨µx–šw‰•Y‰•Yx”kwwHwv;x…XghHZe;y…Jj„hoˆVoˆVhuIYeHhuIlr9Nf9y„<D:+R4'86+UL-GF-IIUL-lr9˜¥Wy„<‘ˆ;ÉÄp´±o’•I«¢;¯§V‰•Ylr9’•I¸Ãu«¢;y„<lr9’•I¸Ãu¯§V˜¥W˜¥W˜¥W˜¥W˜¥W¥u‰•Y˜¥Wy„<oˆV‰•Y‰•Yx”k¥uˆ–h‰•Y˜¥W™¦w—˜gUL-Nf9lr9huIhuIx…XGF-Ze;y…JQjJoˆVhuIj„hKeWz•yˆ¦§KeWQjJ]…qZwvIYVGJFi‡‡hˆ–Yuhi†xi‡‡y–—]…qj”’ˆ¦§y–—i†xWiwWifgy†WifVZVZwvXgWGH8:F/GH886+995OKNGJFGJFGH8Wifi‡‡o®wŠ•wŠ•o®Yuhhˆ–MYji†xw‰‡ZwvSpŽGJFWifZwvi‡‡ZwvYuhKeWKeWJgnWifJgnv¥®v¥®Zwv:OQi†xZwvv¥®hˆ–j”’i‡‡Z†j”’WŠ³j”’v¥®n˜Ç•®²—»Øv¤šŽÁÚŽ¬Ìv¥®ŽÁÚŽÁÚŽ¬Ìv¥®v¤š•®²ˆ¶Úv¥®i†xv¤šˆ¦§•®²YuhGJFGJFgywv¥®wŠ•wŠ•w‰‡i‡‡v¥®ˆ¦§v¥®o®wŠ•ˆ¦§ˆ¦§Ž¬Ìi‡‡j”’o®j”’o®wŠ•‡™—•®²y–—j”’i‡‡Yuhi‡‡]…qi†xWifZwvj”’v¥®i†xi‡‡i‡‡YuhWifYuhi†xi†xz•yYuhGJFGJFVZV‰¥—y–—fjgfjV¥uhxgJU:VZVWifgywWifojowxW™¦w¨¶‡x…XXgWUK7y…J†‰g˜¥W´±o™¥hx†hˆ–h™¦w‡—x˜§ˆ¨¶‡¨µx‡ˆXhuIx…X¨µx¨¶—x…Xy…Jx…Xˆ–h˜¥W™¥h‰•Yy…J—˜g™¥h˜§ˆx…XwwH‡‡I‰•YoˆV’•Iy…Jy„<UL-lr9:F/UL-lr9oQ/UL-GF-GF-‘ˆ;«¢;‡‡I‘ˆ;«¢;—˜Yy…J‘ˆ;˜¥W§§h™¥h˜¥W¯§V¯§V˜¥Wy„<y„<˜¥W™¥h’•I’•Iy„<’•I˜¥W¸Ãu¥u‰•Y¥u¥u‰•Y¨µx¥u‰•YhuIx…X™¥hy…JWW8UL-gg9y„<˜¥Wy„<Nf9UL-WW8WW8IWG995GH8Yuh]…q‰¥—i†xx”kz•‡wŠ•WifWiwi†xv¥®gy†j”’hˆ–v¤šy–—gy†i‡‡wˆwˆ¦§hˆ–YuhZwvVZVVZVw‰‡XgWQjJVYGgy†IYVIYVYuhWifGH8995IWGZwvi‡‡w‰‡y–—fjgVZVWiwgy†fjgi‡‡ˆ¦§hˆ–YuhZwvgy†hˆ–o®o®i‡‡j”’Z†WifZwvv¥®v¤šZwvQjJhxgVZVw‰‡y–—v¥®hˆ–o®v¥®Ž¬Ìo®v¤šv¥®Ž¬ÌŽ¬Ìv¤ššÂÝ•®²—»Ø«¹Ê•®²v¥®i†xz•‡j”’]…qJgnKeWYuhYuh[tXIWG995F<EWif‡™—v¥®i‡‡gywJgnv¥®o®‰¥—o®Zwvy–—y–—v¤šhˆ–Wiw=eeKeWVZVIYVVYGWiwYuhy–—v¥®hˆ–]…qi†xi‡‡IWGVYGIWGKeWXgWgywWifVZVWifhxggywVYGXgWIWGGJFVYGx…XŠ¤ˆXgWD<5ghHx†huyg…Šw‡˜‡‡˜‡VZVF<EWW8—˜Y˜§ˆwxWGF-UK7Ze;wwHujG•ŠW§§h¨µxš³’¨¶‡¨¶—š³’š³’¨¶‡™¦wˆ–h˜§ˆ˜§ˆ˜§ˆ¦©—™¥h¨µx¨µx¸Ãu§§h§§h¸Ãu¨µx¦¨w–šw…Šwe[Glr9‡‡I‰•YoˆVZe;Ze;gg9oQ/UL-UL-GF-wv;‘ˆ;y„<lr9lr9WW8huIwwHy„<vi8lr9wv;lr9Ze;˜¥W´±oy…J˜¥W‰•Yy„<y„<’•I˜¥W˜¥W’•I˜¥Wy„<‰•Ylr9oˆV¸Ãu™¥h˜¥W˜¥Wy…Jlr9oˆV¥u‰•Y¥uˆ–hZe;JU:UL-y…JoˆVy…JoˆVhuIYeHQjJGF-UK7IYVIWGYuhv¤šj„hNf9VYG[tXhˆ–YuhKeW[tXi‡‡v¤šj”’hxgw‰‡fjgZwvKeW]…qYuhXgWGJFIYVIYVwˆwz•‡YuhWifVZVgyw‡™—v¤šYuhKeWGJFGH8QjJVZVIWGMYjgywWiwWiwWiwŒš§v¥®i‡‡‡™—z•‡wŠ•fjgv¥®o®y–—ˆ¶Úv¥®«¹Êv¥®gywv¥®wŠ•]…qIYVGH8IWGZwvgy†j”’—»Øv¤šj”’j”’v¥®q¬Ôv¥®Ž¬Ì—»Ø—»Øv¥®«¹ÊŽ¬ÌŽ¬Ìv¥®•®²v¥®i†x]…qKeW:GFKeW[tXIWGJU:9955+(-12GH8Wiwi‡‡Z†gy†WifWifYuhKeWIYVIWGXgWWifIYVKeWIYV:GFIYVZwvWifIWGGH8IYVVYGj„hWif:GF;F8IWGIWGJU:KeWGJFGJFXgWIWGIWGOKNIWGXgWIYVVYGj„hz•‡WifUK7fjVVYGGF-D<5GJFfjgx†hwˆwx†huygUK7YeHwxWx…XVYGYeHGF-Ze;†‰ghvX‡ˆX™¥h…{WwxW–šw¨¶‡¨¶‡¨¶‡¨µx‰•Y‡—x¥u™¦wš³’˜§ˆ¨µx¨¶‡µÄ¦©—–šw§§hÉÄp¸Ãu™¦w‡˜‡‡—x–š‡x…XhuIgg9huIoˆVgg9UL-Nf9UL-GF-GF-UL-y„<wv;gg9‘ˆ;«¢;vi8Ze;‰•Yy…Jlr9huIy…JZe;huIhuI˜¥W¸Ãu˜¥W˜¥Wlr9Nf9lr9y„<y„<lr9y…Jlr9oˆVoˆVlr9lr9˜¥Wy…JoˆVlr9huI[tXoˆV‰•YhuIZe;Nf9QjJIWGlr9wxWYeH‰•Yx†hYeHXgWZe;YeH[tXi†xi†xz•yXgWGJF;F8:GFhvXIWGQjJfjgZwvi‡‡KeWKeWXgWIYVYuhi‡‡[tXYuhYuh:GF:GF:GFXgWYuhZwvJgnIYVVZVYuhi†xGJF:F/D<5GF-:GF995IYVGJFGJFIYVWiwgy†gy†y–—o®MYjfjgwŠ•wŠ•ˆ¦§«¹Êv¥®Œš§ˆ¦§¨ÅÛŒš§‰¥—ˆ¦§YuhKeWGH8JU:IWGZwvv¥®v¥®j”’o®Zwvj”’v¤šy–—v¥®ˆ¦§‰ÄwŠ•gy†ˆ¦§‰Äv¥®Œš§gy†gy†WifKeWGJFJU:[tXZwvKeW:GF995995GJFKeWYuhYuhIYVKeWIYVIYVIWGGH8995;F8IWGKeWVZVGJFGJF;F8GH8GJFVZVIYV;F8GJFGJF]…qIWGIWGIWGJU:IWGGH8IWGGH8VYGVYGXgWYeHGH8UL-JU:IWGVYG[tXXgWGH8GF-GH8GH8GH8GH8UK7ghHx…Xx†hVZVe[GuzvuzvVYGZe;wwHwxW‡ˆX–šw–šwfjVy„<huIYeHVYGfjV‡—x¨¶‡¨µx¨µx¨¶‡¨µx˜§ˆ¨¶‡¥u‰•Y™¥h˜¥W–šwwxW™¥h™¦w§§h™¥h˜§ˆ‡—xˆ–h˜¥W‡‡IhuIZe;lr9gg9WW8Ze;huIGF-lr9UL-lr9‘ˆ;lr9Žr6gg9gg9gg9GF-huI™¥hhuI‰•Y˜¥W’•Iwv;huIx…X¸Ãu¸Ãu§§h˜¥Wx”k’•I‰•Yy„<Nf9lr9y„<oˆV˜¥W¨µx¥uy…Jy„<Nf9y…JoˆV™¥h¥u˜¥Wx…XUL-huIy…JhuIYeHXgWD<5D:+UK7YeHVYGhuIVYG[tXoˆVhxgVYGIWGXgWIYVWifIWGKeWKeWGH8XgWXgWhvXZwvYuhZwv]…qYuh;F8WifKeWYuhKeW:GFJU:IYVYuhKeWIYVGH8QjJIWGGH886+86+GH8WifGJFGH8;F8GJFIYVMYjIWGWiwMYjojoWiwZwvSpŽgy†y–—y–—o®hˆ–ˆ¦§v¥®Ž¬Ì•®²v¥®o®Z†YuhJgnKeWWifj”’ˆ¦§v¤šhˆ–SpŽj”’o®hˆ–Œš§y–—v¥®Wiwgywv¥®o®hˆ–WifMYjYuhIWGJU:;F8GJFVZVQjJIWG995D<5JU:XgWKeWKeWWifVZVVZVWiwWifWifIYVKeWKeWIWGIWGGJFD<5995995995;F8GH8GH8GH8GH8GF-JU:GH8IWGIYVQjJYuhJU:GH8JU:GH8D<5JU:IYV9955+(IWGD<5D<5XgWGJFGH8QjJGH8GH8GH8VYGGJFUK7ukXhvXGH8UK7GJFJU:ghHe[GwwH‡ˆXˆ–hx…XhuIUK7huIy…JhvX[tXx†h…Šw†‰g´±oµÄµÄµÄ¸Ãu¨µx™¦w¦¨w¸Ãu‡—xhvXhuI¥u¨µx§§h¨µx˜§ˆ™¥h§§h´±o˜¥Wx…Xy…JYeHWW8YeHhuIwxWUL-lr9y„<oQ/lr9y„<lr9lr9y…JNf9GF-YeH¨µx‰•Ylr9‘ˆ;˜¥Wx”k‡‡I™¥h§§h¸Ãu—˜g’•I¸Ãu™¥h˜¥W¯§V˜¥Wy„<’•I˜¥W™¥h™¥h¨µx˜¥Wx”kYeHlr9y„<gg9huIy„<lr9UL-UL-GH8GF-huIhvX;F8IWGJU:YeHYeHJU:GH8GH8QjJJU:[tX[tXQjJXgWGJFGH8IWGKeW995QjJ[tXQjJGJFGH8GH8KeWIWG86+99586+XgWWifGJFVYGYuhYuhYuhVZVIWGIWGIWGGH8D:+JU:IWGGJF995:F/:F/GF-GF-;F8GH8995995OKNMYji†xz•‡gywVZVw‰‡y–—y–—Zwvi‡‡wŠ•wŠ•wŠ••®²v¤šv¥®v¤šYuhIWGIYVYuhWifWiwKeWYuh]…qZ†y–—v¥®o®o®v¥®Z†j”’]…qYuhKeWGH8UK7JU:GF-JU:JU:GF-995GH8IWGJU:XgWYuhj„hYuhIWGIWGIWGIYV:OQIWGKeWKeWKeWIWGIWGIYVGJFD<5JU:GJFGJFGJFVZVGJFJU:GF-GF-:F/GF-VYGJU:GF-GF-GF-GF-GF-GF-GF-:F/GH8GF-86+5+(86+GH8j„hi‡‡j„hj„hYeHVYGIWGIWGVYGVYGfZ8wwHYeHWW8WW8GH8y…J–šw™¥h—˜gx…XhuIx…Xx…Xˆ–h™¦w™¦w™¥h¨µxµÄ¨µx´±o¸Ãu˜¥W§§h¸Ãu§§h—˜gx…Xz•yx”k™¥h§§h—˜gx…Xwv;wwH—ˆI’•I˜¥W’•Iy…JfjVWW8hvX‡—x¥uNf9UL-UL-UL-UL-Nf9y„<lr9’•I’•Iy…Jy…J´±o¸Ãu’•Ilr9y„<™¥hvi8lr9´±o¸Ãu§§h¥u™¥h¸Ãu˜¥W˜¥W˜¥W’•Ilr9lr9˜¥W¸Ãu¸Ãu¨µx¨µx¥uy…J‘ˆ;y„<:F/Nf9JU:)'&86+JU:GF-y…Jx”khvXx…Xx…XQjJhuIZe;hvXGF-IWG995Nf9VYGGF-JU:;F8GH8GJFIWGGH8;F8;F8GH8GH8GJFGH8QjJIWGGF-86+86+86+;F8:F/GF-JU:D<5GH8D<5UK7UK7WW8JU:D<55+(D:+D:+86+GF-GF-GF-86+GF-GH8GJFGJFGH8GJFMYjWiwZwvhˆ–WiwZwvhˆ–ZwvZwvZwvMYjMYj•®²•®²v¥®Z†IYVJU:JU:;F8IWGKeWZwvZwvKeWIWGVZVZwvgy†WifZwvVZVWifgywi†xVZVGF-JU:JU:GF-JU:JU:GF-GF-Nf9VYGJU:JU:IWGIWGIWGVYGKeWJU:GH8GH8:F/GF-:F/:F/JU:[tXQjJIWGIWGGJFVYGGJFVYGWW8UK7GF-GH8GH8JU:GF-:F/GF-86+;F8JU:JU:GF-:F/GF-GF-GH8995GJFIWG[tXIYVIWG[tXIYVGJFVZVVZVXgWfjVOKNZe;wxWˆ–hhvXWW8Ze;Ze;fZ8ghHwwH©•o¨¶‡™¦w¨µxˆ–h‡ˆX¦¨w§§h—˜gµÄ¦¨w—˜Y˜¥W—˜Y—˜gˆ–h‰•Y‡‡I§§h¨µxš³’‡—x•Šmx†he[Ggg9gg9wv;¯§V˜¥W—˜Yx…Xgg9Ze;gg9wxWx…Xx…XGF-UL-UL-y„<UL-:F/lr9«¢;«¢;¯§V´±o‡‡Iwv;¯§V¯§V‡‡IhuIy…JfZ8gg9‘ˆ;¯§V’•I˜¥W§§h™¥h§§hx”k‰•Yy…JoˆVoˆVˆ–h¸ÃuÉÄp˜¥Wlr9y…Jy…JZe;huIYeHQjJy…JhuIGH8Ze;gg9D<5VYGwxWx…XoˆVGH8UK7UK7e[GD:+D:+D:+GF-GH8D:+GF-WW8UK7GF-GF-GF-GH8995GH8QjJIWGGH899586+GF-995D:+86+86+86+:F/86+5+(5+(5+(D:+GF-UK7UK7UL-D:+86+86+GF-GF-GF-D:+5+(86+86+GH8GH8GJFGJFMYjgy†SpŽj”’hˆ–y–—hˆ–ZwvJgnIYVOKNIYVXgW]…qJgnIWG]…qYuhJU::F/)'&995KeW]…qSpŽWiwZwvYuhKeWIWGIWGJU:VYGIWGUK7GF-GF-JU:GF-GF-JU:GH8GH8WW8JU:JU:;F8Nf9QjJVYGIWGIWGIWGGF-GH8:F/86+86+86+995:F/GH8GJFGF-GH8GJFOKNJU:JU:GJFGH8GF-D:+GF-GF-GH8JU:Nf9GF-GF-GF-VYGJU:JU:JU:GH8XgWGF-GF-GH8GH8GH8995995GF-D:+D<5VYGfjgVZVGF-D<5D:+UK7ujGx”kYeHXgWfjVhxgghHujGx†huyg†‰gˆ–hx”k¦¨w™¥hˆ–h™¥h•Šm‰•Y‰•YujG’•I™¥hx”kx…X—˜g¨µx¥u‡—xhxghuIy…Jy…JghH’•I¯§V˜¥WhuIujG‰•Yˆ–hy…Jx…X˜¥Wx…XD:+UL-lr9UL-lr9UL-lr9Ilr9’•I«¢;«¢;UL-y„<¯§V¸Ãu—˜Y™¦wy…JWW8lr9˜¥W˜¥W‘ˆ;’•Iy„<˜¥W‰•Y‰•Y¥uy…J‰•Y™¥h’•Iy„<Ze;GF-WW8huIx†hˆ–hx…Xx…XhuI‡‡Ie[GGF-GF-D<5GJFQjJlr9Ze;JU:huIGH8JU:Nf9GF-JU:JU:D:+86+GF-GH8GF-D<5GF-JU:UK7D:+GH8GH8GF-GF-86+GF-GH8D:+GF-D:+D:+D:+GF-UL-D:+D:+86+D:+D:+GF-UK7GF-GF-D:+GF-GF-GF-GF-GF-D:+86+D:+D:+GF-GF-GH8UK7IYVIYVYuhi†xZwvIYVOKNWiwKeWGJF;F8GH8:GFGJFKeW[tXKeW:F/-12;F8JgnZ†o®hˆ–gywj”’WifJU:JU:GF-GF-GF-GF-GF-:F/GF-GF-;F8GF-GF-JU:GH8JU:JU:UK7GH8GH8GJFJU:GJFIWGGH8GF-JU::F/:F/86+86+:F/86+995D<586+;F8GH8GH8GH8JU:D<5GF-:F/GH8GF-GH8GH8UK7GH8D:+:F/D:+86+GF-YeHJU:GF-995D:+D:+GH886+86+GH8D:+D:+D<5D:+D:+D<5R4'D:+D:+D<5OKNUK7hvXVYGfjVi†xhvXx†hx†h–š‡‡—x¥u–šw—˜gˆ–hy…J™¥hx…Xx…X—˜Yˆ–hx…X§§h¦¨w¨µx¸ÃuÉÄpÃÅ¡¨¶‡j„hhvX‡—xx†hghHy„<˜¥W˜¥Wy…JZe;fZ8lr9gg9y„<‰•YoˆVhvXUL-‘ˆ;’•Ilr9UL-GF-UL-lr9wv;‘ˆ;‘ˆ;’•I’•IfZ8wv;§§h˜¥W’•I¯§Vx…XhuI’•I˜¥W˜¥W˜¥W¯§V˜¥Wy…Jy„<§§h¸Ãu¸Ãu¨µx˜¥Wlr9Nf9Ze;huIj„h¨¶‡¨µxhxgVYGghHZe;IWGhuIXgWJU:fjVy…JhuIJU:86+D<5R4'D:+Ze;GH8GF-UL-D:+D:+UL-GF-GF-UK7D:+D:+D:+D:+5+(5+(D:+995JU:GF-D:+5+(R4'D:+D:+GF-UL-GH886+D:+D:+86+D:+D:+GF-GH8GF-R4'D:+D:+GF-86+D:+D:+5+(D:+86+GF-D:+D:+D<5GJFGJFGJFGH8GJFGJFWifgywYuhIYV995:F/IWGVYGQjJGH8GF-:F/:F/GH8KeWi†xi†xIYVIWGJU:GF-GF-:F/GF-GF-GF-GF-D:+GF-GF-995GF-GF-GF-GH8UL-JU:GF-D<5D<5D<5F<EGJFGJFF<E995;F8GF-86+86+86+86+86+86+86+-125+()'&5+(5+(86+:F/995D<5D<5995:F/JU:IWGGH8GF-GF-GF-IWGGH8GF-GF-86+GF-:F/;F8JU:[tXJU:GF-GF-GF-D<5GF-D:+D:+D<5GF-UK7XgWwˆw‡˜‡hxghxgz•‡—¨–—¨–š³’¨µ¨µÄš³’x…XwxW‡ˆX§§h§§h¨µx¨¶‡–šw§§h§§h™¥h‰•Yx†h–š‡·²µÄÄ°”µÄµÄ¨¶‡š³’wˆwhuIx†h˜¥W™¥hoˆVlr9Ze;y…J’•Iy…Jˆ–h¨µxx”kghHGF-‘ˆ;’•I«¢;«¢;Nf9lr9UL-WW8’•I‘ˆ;gg9vi8vi8lr9lr9‡‡I˜¥W¸Ãu˜¥W‰•Yx…X´±o˜¥W’•Iwv;’•I˜¥Wx”k‰•Y§§h™¥h˜¥WoˆVhuIgg9huIx…X‡ˆX—˜g‰•YhuIWW8GH8ghHwxWhvXuygGH85+(86+UL-GH8D:+5+(D:+5+(D:+D:+D:+D:+D:+D:+D:+GF-GF-86+86+D:+D:+86+86+86+D:+GF-GH886+D:+D:+86+D:+:F/86+86+86+5+(5+(D:+D:+D:+D:+D<5GH886+GF-GF-GF-D<5D:+D:+D:+D:+D:+GH8D<5D:+86+D:+fjVVYGGH8GH8D<5GH8GJFXgWz•‡gywJU:GF-JU:GF-GH8;F8JU:GF-:F/:F/GH8IWGIWG;F8JU::F/86+GF-GF-WW8JU:GF-D:+86+86+:F/86+D:+GF-99586+86+5+(5+(86+995995-12995F<E995:GF:F/D:+86+GF-GF-UL-fZ8Ze;oQ/UL-GF-86+R4'5+(5+(86+99586+86+86+86+86+5+(D:+GH8GH8GH8j„hGH8:F/JU:GH8D:+86+:F/GH8JU:GF-86+GF-GF-D<5GH8D<5GH8UK7GH8OKNVZVfjgVZVVYGGJFhxgx†h‡—x¦©ˆ–š‡˜§ˆ†‰gukXZe;gg9wwH—˜Y™¥h¨¶—¨¶‡¦©ˆ‡—xwˆwwˆwŠ¤ˆš³’¦©ˆ¸ÃuµÄµÄµÄ–šwwˆw—˜g¦©—–šwˆ–hˆ–hˆ–hx”ky…Jy…Jy…J‰•Yˆ–hy…JJU:D:+gg9y„<Žr6y„<y„<y„<gg9D:+86+‘ˆ;«¢;‘ˆ;UL-gg9YeHUL-VYGy…J˜¥W´±o¨µx¸Ãu¨µx¸Ãu´±oy„<Ze;y…J˜¥W˜¥W™¥hˆ–h‰•YhvXhuI‡‡I‰•Y’•Iwv;WW8lr9lr9gg9GH8D:+UK786+IWGIYVOKN995IYVIWGNf9GH8D<5GH8VZVD<5D:+GJFJU:GH8D:+GH8UK7D:+D:+GF-D:+86+D:+GF-995JU:GF-86+86+D:+5+(86+D:+GF-86+86+86+5+(D:+D:+D:+D<5D<5GF-D:+86+86+86+D:+D:+86+5+(D:+D<5GH8GH8D<586+D:+UK7GH8UK7D<5GF-GH8D<5GH8VYGJU:D<5:F/GH8JU:JU:GH8GH8GF-D<5GF-:F/:F/86+:F/:F/D:+86+D<5UK7VYGWW8GF-:F/5+()'&86+5+(5+(86+86+995D<5:GFIYVGH8XgWD<5995995:OQIWGUK7vi8Žr6Žr6Žr6Žr6²Š8«¢;Ì“2Ì“2Ì“2²Š8׎¬u/Žr6Žr6GF-:GF:OQ86+86+86+5+(5+(86+Nf9KeW995GH8GJFGH8JU:;F886+GH8GH886+86+JU::F/GF-GF-GF-GH8GH8VYGOKNGH8VYGUK7VZVXgWYeHVYGhxghxge[GhvXhxgwˆwuygx…X‰•Yy…Jlr9wwH•Šmˆ–h–šw˜§ˆ˜§ˆ¨µ¨—¨–˜¨§‡—x¦¨wµÄ¸Ãu¨¶‡™¦w¥uˆ–h‰•YwxWZe;hvXˆ–h˜§ˆš³’¥uˆ–hx”khuIgg9gg9Ze;D:+UL-gg9UL-gg9oQ/UL-lr9UL-86+y„<§§h«¢;’•I‰•Y‰•Yy…JhvXukX’•I˜¥W’•I¯§VÉÄp˜¥W’•I’•Iwv;gg9’•I§§h¨µx™¥h˜¥W¥u‡ˆXx…X§§h…{WfjVVZVVYGIWGWW8UK786+GJFKeWfjVhvXfjV:GFfjVuygVZVD<5D<5JU:e[G86+D:+GH886+5+(D<5VYGOKNGF-D<5D<5D<586+86+86+D<5GH8D<586+5+(86+86+86+86+5+(86+5+(5+(5+(5+()'&5+(5+(5+(5+(D:+86+5+(5+(D:+D<55+(5+(99586+D<5KeWGH8D<599586+GF-D<586+86+GH8D<586+86+86+D<5GF-:F/VYGIYVJU:IWGJU::F/:F/86+-12:F/:F/995:F/86+GF-JU:OKNJU:86+86+5+()'&5+(5+(GH8UL-WW8j„hhxgz•‡]…qYuh:GF86+-12:GFZwvvi8¬u/¬u/¬u/I‘ˆ;Ì“2׎׎׎׎׎׎°g°g׎°g°ghuIj”’=ee)'&5+(86+5+(995Nf9GJF86+:F/JU:JU:GH8JU:86+GF-JU:GH8D:+WW8GH8GF-GH8VYGVYGOKNVYGGJFVZVVYGx†h‡—xz•yi‡‡w‰‡y–——¨–‡™—¥uˆ–hx†huyghvXhuI‰•Yˆ–h™¦wµÄ¨¶—µÄ¨¶‡˜§ˆ™¥hoˆVwxWy…J¯§V§˜W™¥h™¥h™¥h™¥h‰•Y‰•Yy…JhuIoˆVx…X†‰g…Šw™¦wŠ¤ˆˆ–hy…J‰•Y‰•Ygg9UL-D:+UL-Nf9fZ8fZ8UL-y„<‘ˆ;UL-UL-wv;«¢;«¢;«¢;y„<§§h´±o§§h¯§V¯§V˜¥WŽr6’•I˜¥W‡‡Iˆ–hy…JNf9JU:†‰g˜¥W¸Ãu¥uy…JwwH‰•Y˜¥W‡ˆX‡—xš³’–šwˆ–hx…XujG995D<5fjVuygOKNF<E5+(F<EOKNWiffjgD<5D:+995GJF995995GJFD<5GH8:GFGH8GJFGJFIWGGH8:F/86+86+86+995;F8)'&-12)'&86+D<55+(5+(#86+#5+(5+()'&%#%#)'&#%##)'&)'&-12-125+()'&5+(-12-12995GH899586+86+86+D:+D:+995D<55+(5+(5+(86+D:+GF-GH8IWGVZVKeWj„hYuhIWGQjJQjJ[tXYuhJU:JU:Nf9:F/:F/GH8:F/86+86+5+(5+(5+(D<5lWR…{WfjVw‰‡z•ygywv¤š]…qIWG995-12-12MYjwˆwŽr6°g°g׎²Š8²Š8°g‘ˆ;¬u/¬u/°g׎׎׎׎°g׎¬u/lr9v¤šZ†-12&)'&)'&:F/GJFQjJYuhGJFGH8:F/995GF-IWGIWGJU:GH8GH8GH8GF-JU:JU:IWGIWGUK7UK7D<5GJFOKNXgW†Š‡wˆw‡—x‡™—‡˜‡–š‡–š‡¦©ˆ¨¶‡x”khvXhvXx†h‰•Y†‰g‡ˆX•Šm¦©ˆµÄ¦¨w‡ˆXwwHx…X—˜Y™¥h¨µx´±o¸Ãu§§h§§h§§h¯§VÉÄp§§h™¥hx†hhvXVYGF<EfjV†‰g¯§V™¥hhvXZe;WW8WW8GF-UL-lr9y„<gg9WW8gg9y„<gg9Ze;Ze;‡‡I¯§V˜¥W‘ˆ;lr9§§h˜¥W’•I«¢;«¢;‘ˆ;lr9‡‡I˜¥W´±o¨µx‰•Yx…Xx…X‡‡I‡‡I‰•Y¨¶‡x”koˆVx…X‡‡I‡ˆX‡ˆX‰•Y‰•YuygghHUK7995YeHghHuygF<E5+(5+(86+OKNGJFVZVF<ED<5KeW995995GJF995D<59959955+(:F/GJF86+995:F/-12)'&)'&-12-12=ee;F8GF-vi8P,II°g°g°g°g°gIIIl4$Il4$R4'GF-GJF39I5+(86+IWG;F8)'&)'&5+(5+()'&86+86+86+86+99586+-125+(86+86+GF-995;F8GF-GF-IWG[tXYuhXgWYuhz•‡]…qYuhNf9KeWQjJQjJIWGGH8GF-86+86+86+86+GJF‘rM‘rM…{WfjVz•yi†xj„hi†xYuh995-12-12-12Z†…{W¬u/Ì“2׎¬u/׎׎°gUL-R4'R4'UL-Žr6°g²Š8«¢;²Š8׎²Š8Žr6x”kv¥®;F8-12)'&)'&:F/Yuhz•y]…q[tXIWGNf9;F8GH8JU:GH8GF-GH8GF-;F8GH8IWGQjJXgWVYG[tXVZVXgWfjgVYGhxghxgIWGUK7JU:fjV–šwš³’¦©ˆ¨¶‡‡—xj„hwxW—˜g™¥h‡ˆX˜¥W™¥hx†hwxW†yH‰•Yˆ–h…Šw¨µxµÄµÄµÄ¨µx¨µx—˜g‰•Y™¥h¨µx¨µx´±o’•IfjVUK7UK7gg9™¥hx…XZe;gg9Ze;lr9wv;Nf9gg9’•Iwv;wv;y…Jwv;huIYeHgg9‰•Y’•I˜¥W¯§V˜¥Wgg9hvX¨µx¨µx‡‡IZe;Nf9Ze;Nf9wv;’•I’•I‡‡I‰•Y¸Ãu¨µx§§h˜¥W™¥h¨µx˜¥W‰•Yy…JWW8gg9e[GwxWuygwwHfjVfjgfjVGJFGJFGJFD<5D:+GH8D<586+D<5:GF;F85+(995GJF995GJF[tXIWG;F8-12:F/5+()'&)'&;F8-12%#&)'&:OQi‡‡WW8°g°g°gÙm"Ùm"Ùm"׎°g°gP,°g°gÙm"°g°g°g²N0P,Zwv39I)'&GJFi†xi‡‡WifIWG-12-125+()'&5+(5+(86+D<5D:+86+86+86+995GH8UK7IWGGH8JU:YeH[tX[tXQjJJU:Nf9Nf9JU:;F8VYGQjJJU::F/99586+86+D:+VYGe[GukX‘rM…{WlWRhvXwˆwhvX[tXQjJ:F/-12-12-12;F8v¤š‘ˆ;²Š8׎׎²Š8׎°glr9Nf9y…Jˆ–h5+(UL-°g׎׎«¢;¬u/¬u/°g’•Iq¬Ô=ee%#)'&JU:IWG[tXYuhhvXz•ywˆw[tXJU:JU:JU:IYVQjJXgWJU:GH8QjJXgWXgWVYGhxgXgWVZVj„h‡˜‡i†xhxgojohxghxgx†hˆ–h‡—x˜§ˆ˜§ˆ–š‡j„hhvXi†x‡—x¨¶—¸Ãu™¦wx…XghHwxW…Šw¦¨w¨¶‡¨¶‡¸Ãu¨µx‡—xuygfjVwwH‰•Y™¥h¥u™¥h‡—x†‰g†‰g†‰g…Šw™¦w¨¶‡™¦w¥u™¥hx…Xy„<wv;y„<wv;lr9y„<¯§V’•I’•I’•Iwv;y…Jy„<‰•Y™¥hx…X‡‡I‘ˆ;y…J†‰g—˜Y¸Ãu¸Ãu‰•Yy„<y„<y„<wwHy…J˜¥W™¥h—˜Y˜¥W¨µx¨µx™¦w™¥h™¦wy…Jgg9huIwxWy…JwwHy…JwxWUK7VYGe[GGH8D:+D<5e[GOKN86+GJFGJF995GH8wˆwVZV995D<5VYGVZVF<EVYGJU::GF:OQKeWIYV;F886+86+5+(%#&&]…qoˆV°g°g׎°g׎Ùm"°gIl4$5+(R4'l4$°g°g°g°g°g°g°g‡ˆX=d‹)'&-12GJFi†xwˆwj„hVYGJU:JU:)'&%#)'&5+(5+(D:+86+5+(86+86+86+:F/GF-JU::F/:F/:F/GF-:F/:F/:F/Nf9JU:JU:IWGNf9:F/99586+995995GF-fjVukX…{W†‰g…{WfjVj„hhvX[tXQjJ:F/86+86+995995:GFv¤š‘ˆ;²Š8²Š8׎׎«¢;¬u/IZe;‡ˆX—˜gD:+R4'°g׎׎׎׎¬u/¬u/y„<ŽÁÚ]…q)'&:F/j„hi†xhxgwˆwhvXx†hz•yhxgXgW[tXXgWYuhfjVIYVIWGQjJQjJQjJKeWVZVi†xwˆwfjguygx†hgywZwv[tXy–—–š‡¦©—¦©—‡˜‡wˆwhvXfjVoˆVoˆVx†hx…X‡ˆX‰•Yˆ–hx†hwˆwŠ¤ˆ¨¶‡µÄµÄµÄµÄ¥uhvXghHghH‰•Y§§h¸Ãu¸Ãu¥uoˆVhuI•Šm¦©ˆ¨¶—–šw‡ˆXwxW‡ˆX‡ˆX‰•Y˜¥W™¥hy…J™¥hgg9UL-‘ˆ;‡‡Ivi8‘ˆ;’•I‡‡I’•I˜¥W¯§V¸Ãu‘ˆ;‡‡I‡‡Iˆ–h—˜g¯§V´±oÉÄp¸Ãu˜¥Wy„<wwH’•I¸Ãu¸Ãu¸ÃuµÄ¸ÃuµÄ™¥hx…Xx…Xˆ–hx†hoˆVy…Jx†hhuIZe;GH8D:+86+D:+GH8D<586+GH8OKNGJFhxgOKNGF-;F8GH8D:+99586+GH8GJFIWG;F8;F8IWGIWGJU:IWGVYG;F85+()'&%#%#995j”’hvX°g׎Ùm"°g׎Ùm"°gR4'#5+(wwHe[Gl4$P,°g°g°gÙm"Ùm"•ŠWhˆ–-12-1239IGJF]…qgywj„hYeHZe;;F8)'&)'&)'&)'&5+(5+(5+(86+86+86+86+:F/GF-:F/GF-:F/JU:JU:86+:F/:F/:F/GF-JU:GF-:F/995995:F/VYGukXujGoQ/…{WukXuygx†hz•‡oˆV]…qJU::F/86+86+-12-12;F8v¤š‡‡IÌ“2Ì“2²Š8׎׎«¢;Žr6GF-5+(GF-#R4'°g׎׎°g׎׎²Š8y…Jq¬ÔJgn5+(-12GJFVZVx†hwˆwj„h‡˜‡‰¥—w‰‡x”ki†xQjJVYGKeWVZVWifYuhXgWJgnWifKeWWiffjghxgwˆwx”k˜§ˆfjgGJFhxgw‰‡‡˜‡…Šw•Šmx†hfjVhvXˆ–hˆ–h¥u¥u¥u¦©ˆ¨¶‡¦©ˆ˜§ˆ‡—x–šw˜§ˆ—˜g§§h¦¨wx†hWW8ghHˆ–h˜¥W—˜g†‰g¥u¨¶‡¨¶‡™¦w–šwx†hukXe[GWW8y…JZe;ghHx…X—˜g™¦w–šw’•I’•Ilr9Žr6‘ˆ;’•I‡‡Iwv;‘ˆ;†yH‘ˆ;’•I—ˆIwwH‡ˆX™¥hˆ–h‡‡I—˜Y’•I¯§VÉÄp¸Ãu¸Ãu™¥h˜¥W¯§V˜¥Wˆ–h˜¥W¨¶‡¨¶‡™¥h¨¶‡¦©ˆ¨µx¨µx‡—xˆ–h™¥hˆ–hhxgghHfjVukXfjVOKNGH8D<5JU:GJFVZVOKN995;F8GH85+(995GH886+;F8GJFQjJXgW;F8IWGKeW:F/IWG995-12;F85+(%#)'&995v¤šhuI¬u/°g°g°gÙm"°gI##R4'®’KoQ/R4'I°g°g°gÙm"Ùm"•ŠWo®-12)'&-12-12VYGYuhWifhvXx…XhvX:F/86+86+)'&)'&5+(5+(86+86+D:+GF-GF-GF-GF-:F/GF-:F/:F/5+()'&:F/:F/:F/:F/:F/:F/86+D:+WW8fjVe[GoQ/•ŠWtnlWR†‰ghvXj„hYuhJU:86+)'&)'&)'&)'&)'&-12j”’x…X¬u/²Š8׎¬u/׎׎׎¬u/IUL-I°g׎׎׎°g°g׎¬u/™¥hq¬Ô:GF5+(5+(GH8XgWwˆwŠ¤ˆ–š‡¨µ¨–š‡‡—xi†x[tXYuhXgWVZVVZVXgWYuh[tXhxggywgywgywi‡‡XgWVYGhvXhxgfjVVZV†‰g˜§ˆ˜¨§i‡‡i†x†Š‡–š‡š³’—¨–¥uz•y‡—xˆ–h‡—x—˜g†‰g—˜Y¦¨w–šwuygukX‡—x‰•Yy…Jy„<‰•Y’•I¯§V˜¥Wˆ–h™¦w´±o˜¥W‰•YhuIYeHghHghH‰•Yˆ–hx…XhvXfjVWW8UL-UK7lr9‘ˆ;Žr6’•I˜¥W¯§V¨µxUL-WW8lr9y„<WW8UL-x…Xˆ–h—˜Y¯§V§§h˜¥W™¥h’•I˜¥W«¢;«¢;˜¥W¸ÃuÉÄp¨µx¨¶‡¨µx¨µxµÄ™¦w˜¥Wy…J‡ˆX§§h™¥h™¦wˆ–h†‰g†‰ghvXwxWhxgfjVOKND<5XgWgywhxgVYGIWGIWG;F85+(5+(D<586+GF-JU:IWGIWGQjJXgWXgWIWGJU:JU:IWGVYG¥ux†h;F8&-12v¤šhvX°g׎°g°gÙm"׎°gID:+R4'5+(R4'II°g°g°gÙm"¬u/§˜Wv¤š-12%#)'&-12995[tXw‰‡j„hx”khuIhuID<586+)'&##5+(D:+D:+GF-GF-GF-86+86+GF-:F/5+(86+:F/:F/Nf9JU::F/:F/:F/86+86+D<5OKNlWRŽr6lWRujGfZ8ukX˜§ˆx†hNf9Nf9:F/)'&)'&)'&%#)'&&&[tX]…qŽr6°g׎׎׎׎׎׎׎׎׎׎׎׎׎P,°gÌ“2Žr6v¤šo®-12%#5+(GH8Wif…Šw—™—Š¤ˆ¦©—Š¤ˆ‡˜‡j„hj„hYuhYuhKeWIYVWifXgWZwvXgWYuhWifVZVy–—wŠ•Zwv…Šwwˆw†Š‡…ŠwfjVlWRuzv‡—x˜§ˆ¨¶‡µÄ¦©—˜§ˆ˜§ˆ¨¶‡¨¶‡˜§ˆ–šw™¦w™¦wy…JhuIoˆVy…JwwH‡‡Iy…JwwHy…J‡ˆXx…X†yH˜¥W¦¨wx”k‰•Y¸Ãu˜¥W™¥h—˜g—˜g†‰g‰•Y‰•YhuIUL-UL-Nf9Ze;GF-vi8vi8GF-wv;¯§V¯§V¸Ãu˜¥WWW8gg9«¢;‘ˆ;YeHJU:fZ8†yHlr9‡‡I’•I¯§V¯§V˜¥Wx”k˜¥W¯§V´±oÉÄp«¢;‰•Y‰•Yx…X™¥h™¦w™¦w˜§ˆ˜§ˆ¨¶‡¨¶‡–šwx”kx†hhxgVZVfjVuygx†hYeHVZV[tXi†xlWRVYGhxgXgWKeWGJFVYGGJF995OKNVYGj„hfjgXgWIWG[tXYuhVYGNf9IWG;F8JU:ghHGH8)'&-12]…qhvX°g°g°g׎׎׎׎°gIR4'l4$I°gÙm"Ò9(°g°gÙm"¬u/©•oSpŽ%####%#:F/j„hj„hx†hhxgwxWYeHGF-D:+5+(#)'&5+(86+86+86+:F/:F/GF-:F/:F/Nf9Nf9JU:Nf9Nf9:F/JU:JU::F/86+86+995oQ/e[Ge[GfZ8UK7YeHx”k‡˜‡[tXNf9:F/)'&86+5+(%#&)'&&&:F/z•yy„<°g׎׎׎׎׎׎׎׎׎׎׎°g׎°g°g¬u/x…Xv¥®:OQ%##86+WifIWG‡—x†Š‡–š‡˜§ˆš³’—¨–z•‡x”kYuhZwvWifVZVgywXgWXgWVZVhxgVZVXgWgywfjgz•‡¨µ¨wŠ•hxghxghxgXgWfjg†‰g˜§ˆ–š‡…ŠwfjV‰•Yˆ–hwwHwxW•Šm¨¶‡¦©ˆ–š‡x†h¥u˜¥W˜¥W‰•YoˆVoˆVy…Jˆ–hoˆV[tXfjVZe;˜¥W¨µx¸ÃuÉÄp˜¥Wx…XwxW‰•Yx…Xgg9wxWx…XoˆVoˆVlr9y…J‰•YUL-lr9†yHvi8‘ˆ;‘ˆ;’•I¯§V‘ˆ;WW8gg9«¢;¸Ãuˆ–hJU:JU:gg9y…Jwv;y…J˜¥W§§h¨µx™¥h™¥h˜¥W§§h˜¥W§§h™¥h‡‡I‡ˆX™¥h™¥h¦¨w™¥h—˜g…{Wˆ–h™¦w†‰gukXVZVwˆwuzvhvXuzvuygwˆwfjgIYV‡˜‡wˆwWifD<5fjVJU:IWGJU:JU:KeWWif[tXYuhhxgz•yw‰‡‡—xz•yYuh;F8QjJ:F/)'&)'&&]…q]…qlr9°g׎׎Ùm"Ùm"׎׎Ùm"Ùm"Ùm"Ùm"Ùm"Ùm"°g°g°g°g°g‡™—:OQ#####)'&GH8[tXj„h…ŠwXgWhuIGH8R4'UL-D:+#5+(5+(5+(86+86+GF-UL-JU:WW8lr9Nf9GF-:F/:F/:F/:F/GF-:F/:F/86+GF-oQ/fZ8gg9UL-e[G…{W‡—xx”kQjJ:GF:F/&)'&)'&)'&)'&%#&)'&)'&Nf9]…q«¢;«¢;׎׎׎׎׎׎̓2²Š8°g°g׎׎¬u/Žr6wv;v¥®=d‹-12)'&)'&Nf9WiffjVx†huyg¦©ˆ—¨–š³’‰¥—z•‡w‰‡i‡‡i†xYuhYuhgy†fjg‡˜‡gywXgWWifhxg‡˜‡z•‡hxgwˆw‰¥—hxgYuhwxW˜§ˆ¨µ¨˜¨§—¨–—¨–‡—xhuIhuIwxWghHZe;wwH‰•Y†‰g…Šwˆ–h™¥h¨µx¨µx¥ux”k¨µx¸Ãu¨¶‡¥uoˆVx”kš³’¨¶‡¨¶‡™¥hˆ–hx…XghHwv;—˜Y—˜Yy…Jy…Jj„hVYGZe;wv;’•I˜¥Wgg9WW8vi8‘ˆ;†yHUK7lr9wwHlr9uyghvXVYGvi8—˜Y˜¥W‰•Y‡‡IwwH‰•Y§§h§§h¯§V´±o¨µx¨µx¨¶‡¨µx‰•Y—˜g™¦w¨¶‡µÄµÄ¨¶‡™¥h§§h–šwx†h˜§ˆ¦¨w–šw¦¨w–š‡ˆ–h…Šw…Šw‡—xuygfjgGJFwˆw…ŠwfjgIWG;F8[tX[tXXgWIYVIWGKeWKeW]…qi‡‡z•‡‡˜‡x†h…Šwx”kz•y]…qJU:-12:F/-12)'&:F/]…qQjJ°g°g׎Ùm"Ùm"׎Ùm"Ùm"׎׎Ùm"Ùm"Ùm"°gÙm"°g°g‘rMgy†)'&###5+(-12)'&YeHwˆwhxghvXghHVYGD:+R4'UL-5+()'&5+(86+5+(86+:F/:F/GF-GH8UL-JU:GF-:F/:F/:F/:F/:F/86+86+86+GF-UL-l4$UL-UK7ghHx†hx…XQjJKeW:F/QjJ:F/)'&86+86+86+)'&)'&)'&)'&)'&=ee]…qŽr6°g׎׎׎׎²Š8׎«¢;׎׎׎°g°glr9z•yZ†-12)'&)'&:F/KeWVYGˆ–h‡˜‡…Šw§¨¨–š‡‰¥—Š¤ˆz•‡j”’i†xZwvfjgfjgVZVXgWhxg‡˜‡i†xMYjhxgw‰‡z•‡‡—xhxgfjgYeHgywWif†‰g¨¶—ÃÅ¡¨µ¨z•yhvXhvXx…Xx…X‡—xx†hy…J‰•Y‡‡I—˜Y™¥h§§h¸Ãu§§hˆ–hx”k‰•YµÄ¨¶‡¥uoˆV¥u¦©ˆ–šw¥ux†hJU:lr9wwH—ˆI˜¥W‡ˆXwv;huIlr9Ze;‡‡Iwv;lr9lr9‘ˆ;’•IhuIUL-wv;‘ˆ;wv;wv;e[GZe;’•I‡‡IwwHujG‡‡I§§h˜¥W‡‡IfZ8gg9lr9wwHlr9—˜Y—˜Y§§h¸Ãu˜¥W§§h˜¥W—˜g§§h¸Ãu™¦w§§h¦¨w¦¨w™¦w†‰g…{W–šw˜§ˆ–šwˆ–h•Šmuyguyg†Š‡‡˜‡wˆw‡™—gywfjV[tXWifhxghxgXgWKeWZwvZwvgywi†xz•‡‰¥—‡—xx†hz•yˆ–hˆ–hQjJ)'&)'&)'&)'&&)'&QjJ]…qNf9°gÙm"׎׎׎°gÙm"׎׎׎׎°g°g׎°g¬u/y–—39I#%###5+(wv;VYG)'&GJFwˆwj„h…ŠwOKNUL-GF-5+(R4'5+(#5+(5+(5+(5+(:F/86+GF-JU:GF-:F/:F/GF-GF-UL-:F/:F/:F/:F/R4'UL-oQ/UK7fZ8hvXˆ–hx†hhuIQjJIWG86+wwHGH85+(wv;–šw:F/86+86+-12)'&-12-12QjJZe;Žr6‘ˆ;¬u/׎׎«¢;Ù«9׎׎׎°gŽr6huI]…qZ†-12&86+-12KeWIWGIWGj„h˜§ˆ¦©—©¶¸Š¤ˆ—¨–v¥®uygi†xZwvXgWWifXgWgywQjJZwvfjggywˆ¦§hxgz•‡i‡‡VZVhxgwˆwWif[tXz•‡–šw‰•Y‡ˆXx…XhxghvXx…Xˆ–h‡—x¥u¥uˆ–h¥u‰•Y™¦w§§h™¥h¨µx¯§V˜¥Wx…X˜¥Wˆ–h‰•Y˜¥W—˜g¥u˜§ˆwˆwj„hhxgZe;UK7D:+huI–šw¨µx˜¥Wx…X‰•Y’•Iy„<QjJhuIZe;wv;«¢;wv;GF-D:+vi8y„<«¢;˜¥WfZ8huI’•I«¢;¯§V’•I‘ˆ;Žr6wv;gg9gg9huI¥u™¦w—˜g‰•Y˜¥W§§h§§h§§h§§h†‰gwxWˆ–hˆ–h†‰g‡ˆX‡‡I§§h—˜Y†‰g‡—x™¦w¨¶‡‡—xx†h…Šw•Šm—¨––š‡pxŒfjgi†xi‡‡z•‡Wiffjgfjgj„hWifgywWifWifYuhj„hz•‡‡™——™—Š¤ˆš³’j„hKeW-12:F/)'&)'&)'&&:F/Nf9=eeI°g°g׎׎Ùm"׎°g°g׎Ùm"׎׎°g°g†yH=ee-125+()'&)'&##D:+GF-VYG995UK7[tXYeHVYGGH8UL-5+(5+(5+()'&)'&5+(5+()'&GF-JU:GF-UL-UL-GF-GF-lr9ID:+:F/WW8UL-:F/D:+l4$ujGtnojo¥u˜§ˆj„hJU::F/GF-GF-UL-vi8e[Gwv;§§h:F/)'&86+)'&-12)'&)'&)'&:F/Nf9UL-Žr6‘ˆ;°g²Š8׎²Š8°gŽr6lr9YuhZ†=ee-12)'&)'&QjJ]…q;F8KeWv¤š‡˜‡–š‡–š‡¨µ¨Š¤ˆ‡™—i†xj„hhxgYuhXgWIWGXgWhxgXgWIYVXgWVZVwˆw‡˜‡y–—wŠ•wˆwwˆw–šwz•yuygi†x˜§ˆ—¨––š‡‡—x†‰g¥u¨¶‡¨µx¨¶‡¨¶‡¨¶‡™¦w‡—x‡—x™¦w˜§ˆ¥u¸Ãu¸Ãu¨µxˆ–hx”k¨µx¸Ãu¨µx™¦w˜§ˆ™¦w™¥hˆ–hoˆVNf9WW8Ze;uygi†xj„h‡—xš³’™¦w™¥h¥u˜¥W˜¥WoˆV‘ˆ;‘ˆ;y„<y„<lr9Ze;UL-oQ/‘ˆ;‡‡IoQ/wv;†yH˜¥W¯§V«¢;‡‡Ivi8wv;fZ8gg9y…J’•I´±o§§h¦¨wˆ–hwxWx…X—˜g§§h¦¨w¸ÃuµÄ˜§ˆ–šw‰•Y…{Wy…J‡‡I‰•Yx†hwxW†‰gx†hukX‡—x¨µ¨uzvi†xpxŒgywgyw‡˜‡w‰‡IYVIYVWiwWifi†xZwvi†xZ†y–—j”’z•‡‡˜‡‡˜‡…Šw[tXhxg995:F/:F/&-12)'&&)'&Nf9QjJUL-°g°g°g°g׎׎̓2׎׎׎°g°gujG:GF)'&)'&5+(5+()'&86+86+86+R4'—ˆIVYG995IYVhvXhxgYeHUL-86+5+(5+(#5+(5+(5+(86+86+86+D:+UL-wv;huIgg9UL-GF-86+GF-UL-GF-D<5R4'UL-…{Wtnwˆw—¨–z•‡[tXJU:Nf9QjJWW8•Šm¯§VujGD<5Ze;:F/)'&-1286+:F/)'&)'&86+)'&)'&86+GF-UL-UL-UL-IoQ/oQ/JU:=ee=ee-12&&-12[tXj”’IWGJU:w‰‡‡˜‡¦©—–šwŠ¤ˆ˜¨§‡—xwˆwYuhhvXojofjgXgWIYVGJFi†xi‡‡wˆw‡˜‡fjgy–—‡—xwˆw…Šwfjg‡˜‡¦©—¨¶—z•yhvXx†h¦©ˆ¨µx¦©ˆ–šw™¥h§§h™¦w¨µx™¦w™¦w™¦w™¥h¥uhvXx”kµÄ¨µx¥u¥uš³’š³’™¥h¥u¥u¨¶‡¨¶‡¨µx™¥hy…JhuIwxW¨µx¨¶—‡—x‡—xˆ–hˆ–h¨µx™¥h†‰goˆVwwHwv;UL-Žr6oQ/‘ˆ;‘ˆ;y„<lr9gg9gg9fZ8‡‡IujGUL-gg9‡‡I¯§V¯§V®’K¯§V¯§V‡‡I‡‡I‘ˆ;y„<‰•Y‰•Y™¥hˆ–h¨µx˜¥W’•I‡‡IghH©•oµÄµÄ¦©ˆ‡—x˜§ˆ¨¶‡¨µx…ŠwfjV…Šwx…Xx†huyg–š‡…Šw†Š‡—™——¨–—¨––š‡wˆwfjVYuhz•‡YuhKeWi‡‡[tXZ†i‡‡i‡‡j”’ˆ¦§‡˜‡‡—xwˆwYeHhuIQjJ:F/:F/-12&)'&&&&:F/Nf986+I°g°g°g°g׎¬u/P,P,oQ/D<5)'&#%#)'&5+()'&5+(86+86+D:+UL-vi8UK7D:+UK7x†hwˆwYuhWW8GF-R4'5+(#R4'R4'86+86+86+5+(GF-gg9‡ˆXghHUL-UL-GF-:F/:F/Nf9y„<ujGUL-UL-P,wxW‡˜‡i†xYuhYuhJU:QjJ995UK7ÉÄpȵl—ˆIUL-JU::F/5+(-12)'&)'&:F/:F/)'&)'&####86+5+(-12-12-12&-12KeWv¤šv¤šKeWIWGi†xz•y•Šm¦©—¦©ˆ—¨–Š¤ˆj„hhxgVYGfjgYuhIYVYuhj„hVZVfjgz•‡i†xfjghxgz•yhxgIWGKeW[tXhxg–š‡¨µ¨š³’˜§ˆ‡—x‡—x–šw™¦w‡—x‡˜‡‡˜‡z•y‡—x¥u™¥h‡—xuyghvXx”k¥u¨µxµÄ¥uš³’š³’š³’Š¤ˆ¥uŠ¤ˆˆ–hx…XwxWwwHwxW˜¥W¸Ãu¨µxoˆVwwHhvXYeH[tXx”kx…XWW8D:+:F/WW8huI«¢;‘ˆ;lr9y„<y„<‡‡IhuI’•I’•I‡‡Iy„<ghHghHy…J¯§V¯§V«¢;’•I’•I’•I‡‡I‰•Y™¥h¨µx™¥h§§h§§h™¦w˜¥W˜¥W’•I‘ˆ;wv;†yH˜¥W´±o¨µx—˜Y§˜W—˜g‡ˆXwwH—˜gukX‡—x–šwuygx†h–š‡˜§ˆ‰wˆwfjgj„hwˆwwˆw‡˜‡i†xi†xIYVWifgywi†xYuhi†x‰¥—Š¤ˆŠ¤ˆx”kwxWhvXoˆV:F/:F/:F/:F/:F/&)'&&&-12:F/:F/D:+R4'l4$oQ/R4'UL-D<55+(5+()'&)'&###5+(#%#-1286+GF-†yHvi8wwHUK7JU:GJFi†xi†xwˆw[tXUL-5+(5+(5+(R4'UL-GF-86+5+(D:+GF-JU:GF-D:+GF-GF-GF-lr9‡‡IwwHfZ8R4'UL-oQ/YeH‡˜‡Yuh]…qYuh]…qQjJ-1286+gg9•ŠWukXGH886+:F/)'&86+)'&)'&-12)'&)'&)'&)'&)'&#%#GF-GJF-12&;F8i†xv¤ši‡‡IWGQjJ‡˜‡z•yw‰‡†‰g‡˜‡†Š‡Š¤ˆ‡™—i†xhxgNf9fjVOKN[tXXgWIWGGJFGJFwˆw–š‡i†xi†xWif[tXi†xwˆwy–—‡˜‡Š¤ˆ—¨–x†hx†hx†h‡—xŠ¤ˆ‡˜‡z•‡š³’¨¶—¨¶—š³’¥u™¥h˜¥W¥u˜§ˆ¨¶—Š¤ˆx”kz•yŠ¤ˆš³’š³’¨µ¨µÄµÄ¨µx—˜Y¥ux…XoˆV™¦wµÄ´±ox…Xgg9ghHVYGhvXhvXwxWy…Jy„<WW8huIgg9y…Jvi8Žr6oQ/fZ8‡‡I‘ˆ;lr9lr9‘ˆ;’•I‡‡I˜¥W—˜gx…Xwv;’•I§˜W¯§V—ˆI‡‡I§§hµÄµÄµÄ¸Ãu¸Ãu™¥h‰•Yy„<’•I¯§V’•Ivi8fZ8‡ˆX§˜WujGgg9wwH—ˆI•ŠW¨µx¨µx‡ˆXghHghHx…X‡—x•ŠmuzvF<EXgWz•‡˜§ˆuygwˆwZwvhxghxgZwvZwvKeWYuh]…qi‡‡z•‡v¤š‡˜‡uzvx†h–šwj„hQjJNf9Nf9]…qQjJ:F/)'&)'&&&#)'&#)'&##%#%#)'&&#%####5+(VYGQjJVYGoˆV°mSoQ/ujGVZV995XgWYuhw‰‡z•‡wˆwD:+R4'5+(5+(D:+86+GF-UL-R4'D:+86+GF-:F/D:+GF-UL-IIoQ/fZ8‡ˆXfZ8UL-UK7oˆV]…qQjJNf9JU:JU:86+:F/:F/IWGIYVWifJgn:OQ;F8:GF:GF:F/:F/)'&:F/)'&)'&)'&#)'&###86+:F/JU:GJF=ee=eeZwv]…qKeWIWGx”kz•‡i†x†‰ggyw†Š‡•®²…Šw˜¨§z•‡uyg[tXfjgXgWJU:XgWYuh86+YeHhxgMYjfjV‡˜‡Wifx†h‡—x‡˜‡i†xgywWifXgWz•‡‡˜‡‡˜‡‡˜‡‡—x…Šw‡—xz•yŠ¤ˆŠ¤ˆš³’¨¶—¨¶—˜§ˆš³’˜§ˆš³’¨¶‡¨µxx”kz•yŠ¤ˆµÄ¶Ã²µÄ¨¶—µÄ¨µx§§hx†hoˆVx…X§§h¦¨w‰•YhuIfjVˆ–h¦©ˆ¨¶‡¥ux…X‰•Y‡‡Iwv;Ze;wwH’•I«¢;vi8oQ/lr9‘ˆ;«¢;y„<wv;wv;lr9’•I‡‡Igg9wv;—˜Y¯§V«¢;—ˆI‡‡I‡ˆX§˜W§§h´±o¨µx™¥h§§h¸ÃuµÄ™¥h‡‡Iwv;wv;‡‡I¨µx™¥hx…XwwHy…Jx…Xx”k™¥h¨µx™¦w†‰gwxWˆ–h¥uuyg…Šwuzvgyw—¨–‡˜‡uygi†x‡˜‡fjgGJFYeHj„h‡˜‡XgWi†xz•‡z•‡i‡‡]…qŠ¤ˆx”kx”khxgoˆVoˆV[tXKeWQjJ]…q]…q:OQ)'&&&&)'&&&&)'&)'&#&#GH8wxWhvXVYGGH8VYGGH8:F/VYGGH8Š¤ˆwŠ•XgWz•yŠ¤ˆGJF5+(D:+R4'UL-UK7D:+D:+l4$R4'R4'R4'5+(5+(D:+vi8P,oQ/‘rMtntnfZ8lWRUK7j„hz•y:F/:F/:F/-12:F/QjJhxgy–—z•yŠ¤ˆ‰¥—j”’]…qz•yZwv]…qJgnZwvKeW=ee-12:F/:GF:GF39I39IZ†Z†Z†Z†z•‡ZwvGJF:GF:GFIYVj„h˜¨§Š¤ˆ…Šw–š‡‡˜‡š³’¨µ¨—™—w‰‡hxgi†xVZVKeWIWGIWGGJFJU:GJFXgWwˆwŠ¤ˆgyw[tXgywIYVOKNWifz•yi†xZwvWiffjVw‰‡‡˜‡˜§ˆ˜§ˆ‡˜‡z•‡z•y‡˜‡—¨–¨µ¨ÃÅ¡ÃÅ¡¨¶—˜§ˆ¦©ˆµÄµÄµÄ¨¶‡¦©—¨¶—¨¶‡¨¶‡™¦w™¥h§§h¦¨w§§h¨µx¸Ãu¨µx—˜goˆVy„<x…X†‰g™¦w¦©ˆ˜§ˆ—˜Y—˜Yy…Jwv;Ze;y„<‘ˆ;lr9‘ˆ;gg9R4'UL-lr9‘ˆ;’•INf9Ze;lr9lr9˜¥W‡ˆXghHujG—˜g—˜Y‡‡Iwv;wv;lr9Ze;lr9‰•Y§§h¨µx¸ÃuÉÄp¸Ãu™¥h™¥h™¥h—˜g‡ˆX¥u¨µx—˜Y™¦w¨µx¨¶‡™¥hx…Xuyg…Šw…Šw¥ufjg[tX˜§ˆ¨¶—¨¶‡•Šmhxgz•‡‡˜‡fjVYuhw‰‡Zwvz•‡ojoYuhw‰‡]…qYuh]…q]…q]…qwˆwz•yz•yx”k[tX]…q]…q=eeNf9QjJ[tXIWGNf9-12:F/&&)'&)'&995%##%#-12;F8:OQVZVw‰‡y–—•®²j”’j„hi‡‡i†xi†xi†x-12VYGx”kGJF)'&5+(R4'P,‘rMujGR4'R4'R4'I‘rMlWRoQ/l4$UL-oQ/fZ8ujGfZ8vi8…{WfjgVYGQjJQjJ:F/:F/-12:F/QjJi†xj„hz•‡w‰‡i†xgywi†xj”’v¤šJgn:GF]…qv¥®j”’v¤šZ†Z†v¥®v¤šv¥®v¥®j”’j”’ZwvKeW:GF-12:GF]…q‰¥—‰¥—‡˜‡†Š‡†Š‡…Šw†Š‡—™—¨µ¨z•‡i†xXgWVZVJgnGJFXgWYuhGJFIWGZe;wxWXgWXgWgywhxgXgW[tXXgWuyg‡˜‡hxghxggywhxgz•‡¨µ¨¨µ¨¨¶—‰¥—˜¨§¨µ¨¶Ã²š³’Š¤ˆˆ–h–šw¨¶‡µÄµÄ¨µxµÄµÄš³’˜§ˆš³’¥ux…Xˆ–h™¥h¨¶‡¨µx¦¨wx”kx”kx…Xy…J‰•Y‰•Y™¥h§§h˜¥Wx…XhuIghHy…J‰•Y‰•YwwHlr9lr9y…Jlr9‘ˆ;lr9UL-GF-R4'UL-’•I’•I˜¥W‘ˆ;gg9gg9‘ˆ;’•IoQ/WW8—˜g¸Ãu´±o¯§V’•I‘ˆ;‘ˆ;y…J’•I˜¥W¸Ãu¯§V¯§V´±o«¢;§§h¦¨w–šw–šw—˜g–šw¸ÃuµÄÉÄp¸Ãu§§h¸Ãu¦¨w—˜g–šw…Šwx”k…ŠwpxŒwˆw‡˜‡¦©—¦©—fjgKeWWifi†xYuhhxgi†xYuhi†xYuhKeWKeWj„hj”’i†xz•y¥uz•‡QjJ[tXoˆVoˆVQjJ:GF;F8Nf9[tX=ee=ee=ee:OQ:GF;F8;F8-12-12:F/:GF:GF:OQIYVIYVWifZwvgywi‡‡wŠ•ˆ¦§Œš§¨µ¨¶Ã²¶Ã²¶Ã²¶Ã²¨µ¨z•‡IYV-1286+Nf99955+(D:+UK7oQ/oQ/IR4'l4$l4$oQ/…{WtnoQ/oQ/oQ/P,fZ8oQ/lWRujGojouzvfjg:GF:F/:F/Nf9:F/:F/Nf9fjVQjJj„hz•‡‰¥—w‰‡WifYuhi†xz•‡Zwv=eeJgn[tXZwv=ee]…qYuh:OQ=eeIWG;F8-12-12;F8:GFXgWz•‡—¨–©¶¸‰¥—‡˜‡…Šw†Š‡—¨–‰¥—‰¥—‡˜‡VZVhvXVYG:GFF<EIYVVZVhxgXgWWiffjVx†hz•ywŠ•WifXgWhxgYeHXgWhxg™¦w–š‡wˆwWifXgWhvX—¨–Š¤ˆ¦©—µÄ¨µ¨š³’Š¤ˆ‡˜‡z•ywxWhvX˜¥W¨µx¦¨w¨¶‡™¦w–šw–š‡‡—x¥u™¦wx…X‰•Y™¥h˜¥W¸ÃuµÄ¨¶‡š³’š³’¥u¥uj„hy…J—˜Y˜¥W’•IwwHhuI‡ˆX—˜g—˜Yx”koˆVoˆVx”koˆVvi8oQ/Ze;lr9lr9y…J‡‡I—˜Y—ˆI—˜Y˜¥W˜¥Wy…JwwHgg9huI‰•Y´±o¸Ãu™¥hwwHhuIy…J˜¥Wx…X˜¥W¸Ãu§§h™¥h§§h˜¥W‘ˆ;wwHwwHy…J‡‡I‡‡I’•I¨µxÉÄp´±o´±o˜¥W—˜gwxWlr9ujGhvXuygYuhgywwˆw–šwuyguzvj„hz•yi‡‡hxgi†xgywVZVhxgz•‡[tXQjJ[tX[tX[tX]…qz•yŠ¤ˆoˆV[tXQjJ[tXx”kz•yZwv;F8:F/-12=ee=eeZwvhˆ–Zwvv¤šZ†Z†j”’j”’v¤šv¤ši‡‡Yuhi‡‡gywWifˆ¦§ˆ¦§‡˜‡y–—•®²—¨–‡˜‡x†hhxgXgWWifIWG:F/)'&)'&%#%#86+oQ/‘rMujGoQ/l4$IP,P,oQ/oQ/oQ/P,°mSP,I²SNoQ/“UV•Šm†Š‡hxgIWG:F/:OQ=eeNf9:F/:F/GH8QjJYuh[tX‡—xˆ¦§‡˜‡wˆwWif[tXi†xi‡‡z•‡YuhIWGNf9:OQ:F/:OQQjJKeWIWGVYGYuhi‡‡z•‡˜¨§¨µ¨‰¥—‡—xwˆwuzvojo§¨¨Œš§–š‡‡™—XgWVZVIWGGJFKeWIYVIWGVZVYuhfjgfjgi†xVZVVYGz•‡gywYuhz•‡‡˜‡˜§ˆj„hVZVOKNVYGw‰‡z•ywˆw‡—x—¨–˜§ˆ˜§ˆ¥uhxghvXz•y¥uˆ–h™¦w¨¶‡µÄ§§h™¥hˆ–h‡—x˜§ˆ¨¶—™¦wˆ–hˆ–hx”kˆ–h¥u™¦w™¦wx”kx”kŠ¤ˆš³’¦©—™¦w—˜g˜¥W˜¥W‰•YwwHoˆV[tXhuIx…X™¥h˜¥Wx”koˆVy…J5+(5+(:F/Ze;y…J‡‡I’•I˜¥W—˜Y’•I™¥h—˜Y™¥h‰•Yx…Xy…J†yH—˜Y—˜g¸Ãu´±o¨µx™¦w—˜g™¥h¨µx¨µx¨µx—˜g—˜g˜¥W—˜gghHx…X™¥h¨µxˆ–h‰•Y¨¶‡µÄµÄ¨µx¥uuygWW8ˆ–h–šw¥u‡—xwˆwi†xgyw‡˜‡wˆw†Š‡†Š‡z•yuygYeHWifYuhYuh‡™—YuhIWGKeWKeWYuh[tXYuhYuhz•‡j„hhvXe[GhuI[tXwˆw‡˜‡i†x[tXQjJIWG:F/;F8:OQIWGYuh=ee[tXYuhKeW[tXfjgVZVfjggywhvXpxŒw‰‡uzvi†x—¨–‡˜‡XgW[tXYuhGJF:F/:OQ:F/)'&:F/86+%#)'&R4'R4'vi8e[Gl4$R4'l4$P,P,Žr6tnP,P,P,oQ/P,‘rM“UVtntnwˆwi†x=ee:GF[tXj”’z•y:OQ:F/;F8IWGz•‡uzvw‰‡y–—‡˜‡‡™—‡˜‡y–—i†xhxguyghxgWif[tX[tX]…qhxghxgi†xhxggywhxg†Š‡¸·©—™—‡™—Š¤ˆ‡˜‡–š‡¦©—¦©—‰wˆwuzvVZVGJFGJFZwvZ†i†xi†xWifXgWWifwˆwfjg¥uz•‡WifXgWhxgIYVfjghvXwˆwYuh[tXYuhVZVuyg¨¶—¨¶—š³’–š‡‡˜‡Š¤ˆš³’—¨–z•y‡—x™¦w¨¶‡µÄµÄµÄ˜§ˆ¨¶‡Š¤ˆx”k†‰g˜§ˆ™¦w¨¶‡µÄ¨¶—˜§ˆ¥uŠ¤ˆx”kx”kx”koˆVy…Jy…J‰•Y˜¥Wx…X‰•Y§§h™¦w™¥h™¦w–šw™¥h˜¥W˜¥WoˆVNf9Nf9vi8UL-Ze;lr9huIy„<’•I§§h§§h’•I‡‡I‰•Y—˜Y‡‡I‡‡I‡ˆX•ŠW§§h¦¨w¦¨w˜¥W«¢;y„<YeHhuI‰•Y™¥h´±o¸Ãu¸ÃuÉÄp¸Ãux…XhuIy…J™¥h˜¥W˜¥W´±oÉÄp¨µx¨µx‰•YhuIhuIx…X•Šmˆ–hˆ–h–š‡–š‡uzvfjVw‰‡š³’‡™—x†hukXYuhhxgz•‡‡˜‡wˆw[tXXgWi†x]…qi‡‡]…q]…qWif[tXi†xj„huyghvXhvXIWGXgWYuhz•yz•y[tX[tX]…qYuh[tX[tX[tX]…q[tX[tXYuhYuhYuhVZVfjVVZVlWRgyw‰¥—z•‡i†xVZVhxgYuhYuhIWGIWG:F/-12:F/:F/;F8GF-VYGR4'‘rM‘rMlWRR4'5+(5+(l4$P,—ˆI©•o“UVoQ/oQ/oQ/Žr6‘rM•Šm‘rMtn‰v¤ši‡‡Zwv=eeQjJ]…q]…q-12:F/;F8KeWj„hWifgywwˆw‡™—i†x‡™—‡˜‡‡˜‡˜¨§Œš§w‰‡j”’i†xz•‡hxgfjggy†wˆw‡˜‡‡™——™—–š‡…Šw—¨–¸¨¨¸·©¸·©—™—…ŠwuygwˆwVYG;F8GJFKeWZwvgywYuhgywhxgXgWWifVZVXgWj„hz•yi†xhxgIYVIWGIWGj„h‡—xi†xi†x‡˜‡v¤šhxghuIx†hˆ–h†‰guygx†h‡—xŠ¤ˆ…Šw¦©—¨¶‡¨¶—¦©ˆ¦¨w—¨–‰¥—š³’¸·©¨¶—¨¶—¨¶—¨¶‡µÄ¨µx¥u¥uš³’˜§ˆµÄµÄ¸ÃuµÄµÄš³’š³’š³’˜§ˆ˜§ˆ¦©ˆ¨µxy…JWW8huIx…X¥ux”ky„<Nf9Nf9gg9y„<‘ˆ;‘ˆ;‘ˆ;gg9fZ8wv;‡‡I˜¥W¯§V¯§V’•I‡‡I‡‡IWW8UL-huIy…J™¥h˜¥W¸Ãu¨µx‰•Y‡‡IoˆV‰•Y‰•Y§˜W—˜Y’•I—˜Y‰•Yx…X™¥h˜¥W™¥h¦¨wµÄ¨¶‡¦¨w—˜g‰•Y—˜Y‰•Yx”kj„h‡ˆX–šw†‰gˆ–hukXIYV‡—x˜§ˆwˆwj„h‡˜‡wˆw†Š‡uzv…Šwuzvw‰‡w‰‡gywYuhZ†i‡‡Yuhi†xYuh[tXYeHwˆwhxgx†hUK7UK7UK7KeWYuhYuhz•yz•yi†xYuhhxgz•yz•‡v¤šz•‡z•‡z•‡wˆwuygw‰‡uzvwˆwwŠ•gywWifgy†gy†j”’wˆwYuhYuh;F8:F/IWG=ee:F/&86+UK7R4'“UV“UV†yHe[G5+(D:+D:+D:+oQ/±spukXujGP,P,P,P,“UVlWR“UVwˆwŒš§v¤š]…q=ee=ee=ee]…q]…q=ee:F/IWGKeWWifIYVGH8VYGuygukXuyguzvuzv†Š‡¦©—¦©ˆ¸¨¨—¨––š‡tnw‰‡—™—¸¨¨Ã¼Ã§¨¨¯”‘©¶¸§¨¨¸¨¨¸¨¨…ŠwuzvVZVghHVZVF<EIWGYuhZwvZwvgywhxgKeWIWGXgW[tXhxghxgx†hj„hOKNYeHi†xwˆwi†xWifuygYuhuzv‡˜‡—¨–‡™—hvXhxg‡ˆX¥u…Šwz•y¥u‡—xŠ¤ˆ‡˜‡Š¤ˆ‡—xˆ–hˆ–hx…Xx…X¥u¨¶‡¦©ˆµÄÃÅ¡·²µÄ¨µ¨š³’Š¤ˆ¥u¨µx¸ÃuµÄ¸ÃuµÄ¨¶‡š³’¥ux”k¥uˆ–h™¥h‰•Yy…JhuIˆ–h¥ux”ky…JoˆVoˆVhuIUL-lr9‡‡Ilr9lr9UL-GF-y„<‘ˆ;’•I’•I‘ˆ;wwHwwH§§h˜¥W—˜g–šwˆ–h¥u—˜Y™¥h´±o¸Ãu¨µx™¥h§§h¥u‰•Y‡—x¥u¥u™¦w¦¨w§§h¯§V§˜W‡ˆXwxW’•I™¥h¨µx¸Ãu¨µxˆ–hˆ–hwxWhvXwxWx†hwxWwxWx”ktnfjV†‰g…Šw…Šww‰‡uzv[tXfjgVZVw‰‡wˆwj„hgywZwvgyw[tX[tXYuhKeWVYGgywfjgghHj„hfjgx…Xx”kj„hj„hz•yj„hQjJYeHhxg[tXoˆV[tXXgWhxgtnfjVuyguzvwˆwwŠ•wŠ•w‰‡v¤šwŠ•WiwYuh]…q]…qYuh:OQ:OQ]…qi‡‡-12)'&)'&86+R4'…{Wtn‘rMoQ/l4$IoQ/R4'ukXtnujGŽr6ÓgV¬u/P,‘rM±sp‘rMe[Gl[i‡™—v¤ši‡‡=ee]…q]…q[tX]…q]…q=ee:OQ;F8KeWYuhKeWIYVVYGXgWVZVhvXfjgfjguyg…{W‰tn…Šw•Šm–š‡—™——™—¯”‘—™—§¨¨¯”‘uyglWRWW8e[GJU:GJFOKNIYVJgnWiw]…qZwvKeWYuhj„h…ŠwwˆwVYGhvX…Šw‡˜‡hxghxgOKNVYGwˆw—¨–¨µ¨š³’Š¤ˆ‡™—fjguyg†Š‡wˆwhvXhxgx†h†‰gµÄ¶Ã²¶Ã²¨¶—š³’¥uz•yj„hhvXoˆV™¥h§§h™¦w‡—x™¥h¨¶‡¨¶—¨µx¥ux”kx†h—˜Y§§h‰•YwwH’•Ix”kˆ–h´±o¸Ãuˆ–hZe;YeHWW8ghHx…X‰•Y†‰g§§h¨µx‰•Yy„<QjJNf9[tXUL-UL-’•I®’Klr9fZ8WW8lr9†‰g—ˆI®’K«¢;˜¥WwwHghHvi8—˜YµÄÃÅ¡¨¶‡ÃÅ¡š³’™¦w¸Ãu§§h‰•Yˆ–hˆ–h‰•Y˜¥W´±o´±o§§hˆ–h–šw–šw‡ˆX‡ˆXx…XhuIy…J—˜g™¦w™¥h—˜gYeHVYGx”k†‰g†‰gx†h¨¶‡‡—xwˆwwˆw‡˜‡†Š‡–š‡†Š‡hxgZwvZwvZwvi†xfjgw‰‡x†hi†xYuhWif[tXNf9IYV995Nf9XgW:F/[tXi†xwˆwˆ–h…Šw‡˜‡§¨¨—™—…ŠwtnpxŒukX–š‡—™—‰‰‰˜¨§‰†Š‡—™—†Š‡ojouzvfjgVZVOKNVZVZwvKeWKeWJgni‡‡Z†YuhGJF5+(995IYVIWGe[GukX‘rMoQ/IP,l4$“UVtn¯”‘“UV°mS²SN¬u/²N0°mS‘rMujGR4'OKN†Š‡ˆ¦§i‡‡]…qi‡‡JgnZwv=eeYuhZ†Z†WiwIYV:OQIWG=eeYuhi‡‡i‡‡Yuhhxgj„hWifVYGlWRVYGukXfjgl[itnojolWRfjVOKNVZVD<5D<5UK7GH8D<5;F8=eeIYVJgnZ†i†xZwv]…qZ†Wifgywi†xXgWXgWWiwuzvŠ¤ˆŠ¤ˆgywWiffjV—™—–š‡†Š‡–š‡Š¤ˆgywYeHVZVWiffjg†‰g™¥h¨¶‡¦©ˆ–šw…Šwx”kx†hˆ–h¦¨w™¥h‡—x†‰g¨µx¨µx¨¶‡¨¶‡š³’¨¶‡µÄµÄš³’¥uoˆV†‰gx”k™¦w¨¶‡¨¶‡x”ky„<´±o¸Ãu¨¶‡™¥h™¥h‰•Yˆ–hhuIj„hoˆVx…Xx…Xy…J‰•Y¥ux”koˆVfZ8JU:fZ8wv;‡‡I‘ˆ;wv;gg9˜¥W§§h‡‡Ivi8vi8vi8huIhuIghH†‰g¦¨w§˜W˜¥W—˜Y—˜gˆ–h§§h¸Ãu¨µx‰•Yx†hx†hˆ–h™¦w—˜Y‰•Yˆ–hx…XfjVwxW—˜g™¥h¥u¦¨w™¥h¨µx‰•YoˆVz•yx”kj„hwxW‡—x†‰gfjgwˆw‡˜‡—™—uygfjgVZVYuhz•‡tnVZVWifwˆw…Šwgywi†xi†xi‡‡ZwvIWG:GF:GF:GF995:F/Nf9hvXuyg…Šw†Š‡tn…Šw–š‡†Š‡‰‰…Šwtnwˆwtn•Šmuyg•Šm…{WuzvVZVF<EGJFOKNGJFJgnWiwWiwJgnJgnZwv]…qZ†KeW:GF995)'&GH8w‰‡wˆwukXtnujGoQ/P,l4$“UVP,ÓgVÍ’°mSP,P,°mS²N0°g°mS°mSlWROKNuzvŒš§o®i‡‡v¤šZwvYuh:OQ;F8:OQ=eeJgnIYV39I:OQ:OQ=ee=ee=ee]…qZ†Z†j”’hˆ–gy†Zwvi‡‡gy†gy†WifojofjgWifukXfjVF<E86+-12-12GJFIYVZwvYuhZ†i‡‡]…qWifZwvJgnZwvhxgx†hhxg[tXgywYuhhxgWiffjVfjg[tXx…XZwvOKNYeH…ŠwwˆwgywYuhhvXhxg…Šw™¥h¨¶‡˜§ˆ–š‡™¦wˆ–hwˆwz•yx…XhuIy…J–šw™¦w¨¶‡µÄµÄ˜§ˆŠ¤ˆŠ¤ˆ¥u¨µx¨µxš³’z•yoˆV–šw¨¶‡µÄµÄ¨¶‡¨¶‡¨¶—Š¤ˆ‡—xj„h‡—x¦©ˆ¨µxš³’ˆ–hx…Xx”kx”k‡—x[tXOKNy…J5+(D:+D:+UL-WW8lr9y„<y…Jx…X‘ˆ;vi8fZ8wv;’•I‡‡I‘ˆ;y„<y…JwwH—ˆI’•I§§h—˜ghvXwwH‡ˆXwwHhuIx…X™¥h™¥h´±o¯§V¯§V˜¥WujGYeHghHy…Jy…Jx…X‡ˆXˆ–h¦¨w¦¨w˜§ˆ¥u‡˜‡Š¤ˆz•yz•‡‡˜‡˜§ˆ…Šwz•yuzvYeHhxgWiww‰‡…ŠwojoMYjy–—†Š‡z•yw‰‡‰¥—w‰‡Zwvi†xi†xYuhKeW;F8995-12:F/GJFGJFVZVukXukXuzvtne[GukX…{Wuyg…{W…{WfjVukXfjglWRghHl[iOKNl[iWiffjggywojoWif:QlIYVgywi†xZwvIYV:OQ-12995995OKNgywuzv†Š‡“UVP,l4$R4'oQ/‘rMP,±sp¯”‘°mS‘rM°mS²N0P,²N0°mS‘rM‘rMOKNUK7y–—ˆ¦§j”’j”’]…qKeWKeW-12:F/-12-12JgnSw©WŠ³Z¨ÕZ¨ÕZ¨ÕZ¨Õ[´è[´è[´èh¹é[´èZ¨ÕZ¨ÕW•ÉW•ÉZ†SpŽJgnIYV;F8;F8)'&5+(5+(F<E;F8IYVKeWIWGJgnWifgywZwvZwvWifWifhxg…ŠwhxgYuhhxgYuhwˆwWifIWGIWGXgWx†hˆ–hhvXYuhGJFVZV–šw—¨–z•‡ˆ¦§Š¤ˆ‡˜‡‡—xˆ–hˆ–h¥u‡—xx”kx”k[tXoˆVx”kˆ–hˆ–h‰•Y—˜Y§§h¨¶‡µÄµÄš³’Š¤ˆš³’µÄ¥ux”koˆVˆ–h¨µxµÄµÄ¨¶—µÄ¨µ¨z•‡Š¤ˆˆ–h™¥h™¦w–šw˜§ˆ¦¨w™¥h¨µx™¥hx…XwwHhuIZe;5+(D:+GF-gg9‡‡Iy„<’•I¯§V˜¥W‘ˆ;gg9y…Jy…JwxW‡‡I’•I§§h˜¥W—˜Y‰•Yy…J‡‡I¯§V˜¥W˜¥W‰•Y—˜Y‰•Y™¥h™¥h´±o¯§V¯§V¯§V‡‡Ix…X¥uˆ–hx…Xx…X™¥h™¥h‡—x™¥h¦¨w—˜g˜§ˆš³’š³’–šw–šwˆ–h˜§ˆ¦¨w¦©—‡—xfjVhxgx†hVZVhxg‡—xwˆw†Š‡WiffjVz•y†‰gfjgw‰‡z•‡wˆwi†xZwv:GF;F8:GF:F/5+(-12GF-86+UK7fjVuygukXUK7fZ8VYGVYGVYGVYGVZVXgWOKNF<EJU:OKNVZVVZVOKNGJF995-12D<5GJFIYV:GF99539IGJF995;F8GJFfjg†Š‡wˆwojo…{WtnoQ/R4'oQ/oQ/oQ/°mSÄ°”Ð…x±sp²N0¬u/Žr6P,°mS©•o“UVlWRGH8pxŒ‡™—ˆ¦§i†xQjJIWG)'&)'&:F/:OQSw©W•É[´èd½ïd½ïd½ïd½ïjÁòjÁòjÁòmÀëzÂízÂíjÁòd½ïmÀëjÁò[´èd½ïZ¨ÕZ¨ÕW•ÉZ†=d‹:OQ86+995:F/:GFIWG:OQKeWZwvJgnIWGWifhxgwˆwuyg‡˜‡wˆwZwvYuhwˆwy–—WifhxgVZVfjVŠ¤ˆz•yfjVx†hwˆwZwvfjgwˆwj„h‰¥——¨–Š¤ˆ˜§ˆ‰¥—hxgj„hwˆwz•yš³’¥u‡˜‡z•y‡—x™¦w¨¶‡¦¨w¨µx¨¶‡˜§ˆš³’Š¤ˆz•y¥u¨µxµÄ™¥hx”kx”k˜¥W´±o¸ÃuµÄš³’š³’¥u™¥hˆ–hy…JoˆV‡—x¥uˆ–h‰•Yx…X—˜Y‰•Yx†hYeHJU:Žr6UL-UL-vi8‘ˆ;‘ˆ;‡‡I˜¥W’•IfZ8WW8y…J–šw‡‡I—˜g§§h¦¨w¨¶‡§§h¦¨w¦¨w†‰gy…J‡‡I’•Ix…X‰•Y¨µx¨¶‡µÄ¨¶‡¨µx¥u†‰g†‰gš³’µÄ˜§ˆ‡—xoˆVx†hoˆVhuIoˆVx…Xx”k¥u¨µx¦©ˆ—˜g…{W…Šw†‰g†Š‡–šw‡—x‡˜‡fjVWifi†xwˆw…Šww‰‡fjggywVZVVZV[tXKeWojofjgi†xZwvYuhIYVWifIYV:GFGJF;F8IYV:GF5+(5+(D<5GH85+(995GJFGJFF<E:GFGJF39I5>hOKN:Ql=d‹SpŽ=d‹=d‹:Ql5>h39I-12)'&)'&86+:F/:F/GJF:GFIYVWifgyw–š‡uzve[G“UV‘rMoQ/R4'R4'R4'F<E²SNÍ’°mS°mSÔM1¬u/¬u/¬u/ÓgVÐ…x‘rM…{WUK7lWRw‰‡v¤šYuhIWG;F8)'&39ISpŽn˜Çh¹éw»çw»çzÂíjÁòjÁòuÃñuÃñuÃñmÀëuÃñˆÃézÂíuÃñzÂíuÃñjÁòjÁòuÃñjÁòjÁòh¹éh¹éq¬ÔW•ÉJgnJgn:QlIYV=eeMYjIYVWiwWifIWGJgngywi†xuzvhxgfjgVZVXgWx†h–šwYuhWifuygWifi†xz•yz•yhvXx†hi†xWifwˆwx”k‡—x‡˜‡‡˜‡z•‡‰¥—v¤šv¤š‰¥—š³’¶Ã²¶Ã²¨µ¨š³’z•yx”kŠ¤ˆ—¨–¨¶‡ÃÅ¡š³’†Š‡z•‡z•yx”k˜§ˆ¨µx¸Ãu¨¶‡˜§ˆ˜§ˆµÄ¸Ãu¨¶‡¥uˆ–h˜¥WoˆVoˆVNf9gg9hvX‰•Y¥uš³’x”koˆVx”kz•yhuIZe;wv;Žr6GF-R4'UL-«¢;«¢;¯§V¯§V’•IwxWujG‡‡I˜¥W¯§V—˜g¯§V§˜W—˜Y‰•Y‰•Y†‰gˆ–h™¥h¸Ãu§§h˜¥W¯§V§˜Wy…J‡‡Iy…J‰•Y™¥h¸ÃuÃÅ¡¸Ãu¸Ãu™¦w‡ˆX‰•Yx”kx”kˆ–h¥u¥u™¦wˆ–hwxWUK7fjVgywi†xuygukX†‰gtnhxg—™—wˆwwˆwfjguzvgy†ojoF<Ej„hhvXWiwWifgywz•‡wˆwgywWifWifIWGKeW:OQF<EIYVIYV39I99539IIYV39I:GFVZVIYV:GF:OQOKNIYVWiwSpŽSpŽn˜ÇZ¨Õq¬Ôw»çq¬ÔWŠ³Sw©=d‹:Ql)'&#)'&86+MYjIYVVZVWif†Š‡‡™—†Š‡‘rM±sp²N0oQ/R4'R4'F<EtnŸx‡¯”‘¯”‘Ð…x±sp°mS°mS²Š8°mSÐ…x‘rM…{WOKNGH8fjgZwvKeW-12)'&-1239Ihˆ–q¬Ôw»çw»çq¬ÔmÀëjÁòuÃñzÂíuÃñuÃñuÃñuÃñˆÃéˆÃéˆÃéˆÃézÂízÂíˆÃézÂíjÁòh¹éh¹éh¹éh¹éZ¨Õn˜ÇW•Én˜ÇWŠ³hˆ–SpŽIYVIWG:OQIYVKeWy–—i†xfjgQjJXgWGH8wxWx†hfjVfjVj„hfjgx†h—™—…ŠwŠ¤ˆwˆwhvXhvX[tXhxgz•ywˆwz•‡š³’š³’š³’š³’š³’v¥®š³’¨µ¨ÃÅ¡¨¶—¨¶‡Š¤ˆ¥u¥uz•y¥u¨¶—¨¶—µÄ¨¶—µÄ¨¶‡¨¶‡š³’¨¶‡µÄµÄ¨¶‡¨¶‡™¦w—˜g¥u¥u¨µx™¥h™¦w™¦w¨µx¨µx§§h˜¥W™¥h™¥hoˆVoˆVy…JoˆVhuIUL-lr9Ze;GF-86+‘ˆ;¯§V’•I˜¥W§§h—˜Y‰•Y‡‡I’•I†yHwxWy„<’•I‡‡IhuIgg9ghH†yH‡‡I«¢;´±o§§h‡‡Ilr9gg9gg9ujG‡‡I‰•Yˆ–h¸Ãu¸Ãu—˜g‰•Y—˜g™¥h¸ÃuµÄ¸Ãu¨µx¨µx¨µx§§h‡‡Ix”k‰•Yˆ–hukXIWGGJFYuhhvXgywlWRgy†gy†ojoj„h†Š‡WifWifXgWYuhKeWVYGWifwˆwWifIYVIWGIYVGJFGJFD<5995995995)'&39I5>h5>h5>h:Ql:Ql=d‹=d‹=d‹Jgn=d‹gy†SpŽWiwgywn˜ÇŽ¬Ì—»Ø’¾á‡½ãw»çw»çv¥®:OQ-12#5+(:GF:GFMYjVZV‡™—¯™§Ÿx‡±sp©•oP,R4'5+(R4'P,“UV©•oÍ”¨Ð…x¬u/²N0¬u/ÔM1¬u/°mS°mS•Šm…{WVZV:F/VZVKeWXgW)'&)'&5+(39I=d‹q¬ÔzÂízÂímÀëˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéšÆäšÆäˆÃéˆÃémÀëzÂíuÃñw»çZ¨Õq¬Ôn˜Çn˜ÇW•ÉWŠ³n˜ÇWŠ³pxŒhˆ–SpŽMYjMYj:GFIYVZwvZ†i‡‡z•ygywZwvWifQjJYeH[tXGJFVZVhvXfjVVZV†‰gwˆwWifZwvYuhhvX‡˜‡Š¤ˆy–—i‡‡i†x‡˜‡˜§ˆ¨¶—š³’Š¤ˆ‰¥—z•y˜§ˆš³’µÄ¶Ã²¶Ã²š³’š³’•®²ˆ¦§˜§ˆ˜§ˆš³’¨¶‡µÄµÄš³’š³’š³’¨¶—µÄ¨¶—¨¶‡š³’¨¶‡š³’¥u¥u¸ÃuµÄˆ–hz•yx…XwwHy…J‰•Y˜¥W¥uoˆVy…JZe;Ze;Ze;y„<y„<vi8UL-vi8’•I´±owwH‡‡I‡‡I‡ˆXYeHhuIx…X‰•Y¥u‡ˆX‰•YwwHlr9ujGWW8Ze;y…J˜¥W˜¥W™¥h¨µx‰•YhuIVYGuyg‰•Y™¦w¨µx¸Ãu¸ÃuµÄ¨µx—˜g—˜Y…{W—˜g™¥h™¥hˆ–h—˜gˆ–h™¦w‰•Yy…JhuIghHwxWWW8YeHWifYuh…ŠwukXojouyguyghxgZwvWifWifIYVQjJXgWIYVGH8995995995995:GF99539I39I5>h=d‹=d‹=d‹Sw©W•ÉZ¨ÕZ¨ÕZ¨ÕZ¨Õ[´èq¬Ô[´èZ¨Õn˜ÇW•ÉW•ÉZ¨ÕZ¨Õq¬Ôq¬Ôˆ¶Ú’¾ášÆäˆÃéq¬ÔSpŽ5+()'&39I;F8gy†w‰‡‰†Š‡±sp©•o±sp›8%l4$5+(R4'R4'oQ/“UV¸¨¨±sp°mSP,¬u/²N0°g¬u/²SN©•o±splWRGH8995IYVOKN5+()'&R4'F<EJgnq¬Ôw»çzÂíˆÃéšÆä¤Êâ¬Ðá¬Ðá¬Ðá¬Ðá¬Ðá¤Êâ¤ÊâˆÃéšÆäŽÁÚˆ¶Úq¬Ôv¥®o®hˆ–i‡‡]…qYuhWifVYGMYjIYVIYVVZVGJFF<EIYVIYVYuhZwvi‡‡i‡‡gywKeWZwvYuhVYGWifXgWz•yˆ–hhvXGJFIWGGJFVYG[tXi†xw‰‡i‡‡w‰‡uzvz•y™¦wŠ¤ˆi†xhvXwxW¥uˆ–h˜§ˆ˜§ˆ™¦w™¦wµÄµÄµÄš³’¨µ¨¨¶—µÄš³’—¨–Š¤ˆµÄÃÅ¡µÄ¨¶‡š³’˜§ˆ‡˜‡—¨–¨¶—¥uˆ–h™¦w‡—x¥ux”koˆVoˆV‰•Yy…JghHGF-JU:huI‰•Y¥uoˆVNf9gg9Ze;GF-lr9wv;y„<lr9JU:UK7lr9—˜Y‡ˆXx…X‰•Yx…XhvXx…X˜¥W¦¨wµÄ¸Ãu§§h‰•Yy…JghHwwH—˜g¯§V´±oÉÄp´±o‡ˆXx…XwxW‡‡I‰•Y‡ˆX‰•Y´±oÉÄp´±o§§h—˜YukXghH†‰g‡—xµÄ´±oˆ–h†‰g‰•Y§§h—˜gwxW–šwe[GGH8[tX[tXwˆwWifZwvwŠ•†‰gfjVi†xw‰‡[tXF<E:F/IWG;F8995;F8;F8;F8-1299539I-125>h:QlSw©Sw©W•ÉW•ÉW•É[´è[´èd½ï[´èh¹éd½ïd½ïd½ïh¹éh¹éw»çh¹éh¹éh¹éh¹éq¬Ôq¬Ô‡½ãšÆäšÆ䫹Êy–—GJF5+(;F8IYVgy††Š‡‰tn±sp¯”‘²SNP,R4'R4'R4'R4'oQ/tnű®±sp°mSP,¬u/°gÙm"°mS°mSÐ…xÐ…x‡ˆXIWG5+(IWGJU:-12)'&5+(F<EWl˜n˜ÇˆÃéˆÃéšÆäˆÃé¬Ðá¬ÐáÃÍЬÐá¤ÊâšÆäšÆäšÆäšÆäw»çv¥®v¥®j”’j”’Z†oˆV]…q]…q]…q]…qfjgWifGJFGJF39I-12GH8IYV;F8GJFGJFIWGWifOKNWifZwv[tX[tXfjVhvXfjVwxWhuIQjJXgWYeHVYGVYGwxW˜§ˆ‰¥—wˆw‡˜‡‡˜‡z•y¥u˜§ˆš³’–š‡™¦w¦©ˆ¦©—¨¶‡š³’ˆ–hˆ–h™¦w¨¶‡¨¶—š³’š³’¨¶—¨¶‡¥u‡—xz•yŠ¤ˆ˜§ˆ¨¶‡µÄµÄµÄÃÅ¡š³’¥u¥u¥u¸ÃuµÄ¥u[tXhuIˆ–hVYGJU:oˆVwˆw‡˜‡¥uˆ–hoˆVoˆVlr9Nf9GF-gg9’•I˜¥W¯§V‡‡IwwHwwH‡ˆXwxWWW8ujG—˜Y§˜W§˜W˜¥W§§h·²´±oȵl¯§V’•Iwv;y„<y…J˜¥W˜¥W’•I’•I•ŠW—˜g§§h´±o§§h—˜g™¥h™¥h…{WujGVYGYeHx†hhvXˆ–h§§h´±o—˜g¦¨w¨µx¦¨w¦¨w•Šm†Š‡fjVIYVKeWXgWGJFhxgi‡‡wˆwwˆwfjgYuh‡˜‡uzvujGVYGKeWfjVOKN[tXYuhGJF:OQ:GF995:GF39I5>h5>hWl˜Sw©Sw©Z¨Õ[´è[´èh¹éd½ïd½ï[´èd½ïjÁòuÃñuÃñw»çw»çw»çzÂízÂízÂíq¬Ôw»çq¬Ôq¬ÔŽÁÚŽ¬ÌwŠ•OKN5+(D<5IYVgyw†Š‡tn‘rM©•o±sp“UVoQ/l4$l4$R4'l4$l4$±spű®tnP,P,ÔM1òT'ÔM1¬u/ÓgVÓgVÐ…xÐ…xfjV-12JU::F/)'&86+5+(D<5Sw©ˆ¶ÚˆÃéˆÃé¬Ðá¬Ðá¬Ðá¬Ðá¬Ðá¬Ðá¤Êâ¤ÊâšÆäŽÁÚˆ¶Úv¥®v¥®W•Év¥®Z¨ÕZ¨ÕZ¨ÕZ¨ÕZ¨ÕZ¨ÕZ¨ÕW•ÉW•ÉWŠ³=d‹=d‹MYj:QlIYVMYj=eeIYV:OQMYjZwvWiwOKNfjVYuhWif‡—x‰¥—WifGH8uygfjVwxWx”kx”k‡—xˆ–h–š‡z•y‡™—Š¤ˆŠ¤ˆ‰¥—wˆwˆ–h¨¶‡Š¤ˆ–šw¥uˆ–hhuIhvXhxg¥u˜§ˆ¥u‡—x¥uš³’¶Ã²µÄš³’‡—x™¦w˜§ˆ¦¨w¸ÃuµÄ¨¶‡¨µx¨µx¥uµÄ¨¶‡¨µx¸Ãu¨µx™¥hx…XwwHQjJhuIx”k‡—x™¥h—˜Y‰•Y‰•Y˜¥W‰•YoˆVgg9gg9wv;Žr6«¢;˜¥W‡‡Ivi8wv;§˜Wwv;vi8fZ8‡ˆX‰•Y¯§V¸Ãu¨µx†‰g†‰g¨µx¨µx´±o—˜Yy„<ghHy…J¯§V¯§V‡‡Igg9y…J§§h·²¨¶‡µÄ´±o†‰gx…X‰•Y—˜gˆ–h™¥h–šwtn‰•Y™¦w†‰gukX…Šw¦©ˆ¨¶‡wˆwz•‡‡—xwxWIWGKeWfjVYuhWifKeWVYGhxgfjVD<5YeHVYGuygfjVWif[tXXgWIWG:F/99599599539I39I39I5>h5>hWl˜W•É[´èh¹éd½ïd½ïjÁòjÁòjÁòzÂízÂíw»çzÂíw»çw»çw»çzÂíˆÃézÂízÂízÂ퇽ãq¬Ôq¬ÔŒš§lWRR4'D:+VZVfjV¯™§†Š‡•Šm©•oÓopP,l4$l4$l4$R4'l4$l4$tn¸·©tn²N0êV&Ùm"êV&Ùm"²N0°mSÓopÐ…x¯”‘hvX86+:F/:F/:F/:F/JU:VZVo®ˆÃéšÆä¬Ðá¬ÐáÃÍзÊ׬Ðá¬Ðá¤ÊâŽÁÚ•®²ŽÁÚq¬Ôq¬Ôq¬Ôh¹éh¹émÀëmÀëd½ïd½ïd½ïd½ïd½ï[´è[´è[´èZ¨ÕW•ÉWŠ³hˆ–WiwMYjJgnWiwJgnWiw:QlZwvZ†ZwvIWGGJFOKNWifwˆwi†x:GFIWGhuIi†xuyghvX‡—xfjghxg¥uŠ¤ˆz•yWiffjgi†x‡—xˆ–h˜§ˆ‡—xx”ki†xi†xi†xwˆw¥u™¦w¨¶‡¥u¥u™¦wµÄµÄ¨¶—Š¤ˆŠ¤ˆ¨¶‡¨µx™¥h˜¥Wx”k¥u¨µx¥uj„hx†h‡—x¥uš³’¥u…Šwx†h™¦wµÄ¨¶‡¥uoˆVlr9y…Jlr9QjJQjJy…Jlr9y„<wwH…{WwwH•ŠW‡ˆXWW8D<5UK7‡‡I—ˆIfZ8‡‡I—ˆI’•I¯§V¯§V˜¥W‡‡I¥u™¥h˜¥W—˜g—˜Y˜¥W§§h¯§V¯§V†‰g†‰g‰•Y¥u¦¨w¯§V•ŠW‰•Y™¦w¨µx¨µx¨¶‡¥uwxWˆ–hˆ–h‰•Y…{WOKNVYG†‰g¦©ˆ™¦w¨¶—•ŠmfjVhvXx†hˆ–htnKeWi†xWifYeHgywWifWifIYVGJFXgWKeWKeWYuhIWG:GFGJF995-1239I5>h5>h5>h5>hl[iMYjSw©n˜ÇW•É[´è[´èd½ïjÁòzÂízÂíuÃñjÁò‡½ãw»çˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃ鈶ڈ¦§•Šm“UVR4'5+(D<5ukX‰tnÐ…xÍ’±sp²SN›8%›8%›8%l4$›8%l4$tn¨µ¨±spÔM1Ùm"ðWÙm"°gP,P,°mS©•o¯”‘•ŠmghH86+:F/:F/Nf9Ze;fjgq¬Ô”Ãä¬Ðá¬Ðá¬ÐáÃÍЬÐá¤ÊâŽÁÚŽÁÚŽÁÚq¬Ôq¬ÔŽÁÚŽÁÚŽÁÚw»çzÂíjÁòjÁòjÁòjÁòd½ïd½ïd½ï[´è[´èd½ïh¹éZ¨ÕW•ÉWŠ³Sw©SpŽWifWiwWiwMYjIYVJgnZwvi‡‡WiwIWGKeWIWGhvXgywWifGJFhvXz•‡Š¤ˆhxgWifWifhvX¦©ˆ¨¶‡–š‡j„hhxgWifx†h™¦w˜§ˆˆ–h–šwš³’š³’—¨–˜§ˆš³’¨µx¨¶‡¥u¥u™¦w¨¶‡¥ux”k‡—x¨µx¨µx™¥h‡ˆXx”k¥u¥u¥ux”kj„hoˆVj„hoˆVoˆVhuIfjVghH—˜Y˜¥W¨µxˆ–hZe;huIx…XoˆVoˆVy…J˜¥Wgg9‡‡I’•I’•I†yHghH‡‡I—˜g‡‡IUK7e[G—ˆI§§h™¥hy…JwwH‡‡I—ˆI²Š8’•I‡ˆXwv;lr9‰•Y§§h¯§V§§h§§h™¥h¨µx˜§ˆ™¦w¨µx’•Iy„<x…X—˜g¨¶‡ÃÅ¡¸Ãu¨µx§§hwxWukXlWRe[GujGuygtnfjV‡—x˜§ˆ¦¨wtn†‰g•ŠmhvXwxWVZVIYVIWGghHx…XYuhhxgVZVVZVMYjKeWZwv]…qfjVJU:GJF:OQ39I5>h=d‹=d‹Sw©Sw©WŠ³Z†Z†l[igy†Sw©W•ÉZ¨Õh¹éd½ïjÁòzÂízÂíuÃñˆÃézÂíˆÃéˆÃ釽ãˆÃéšÆäšÆäšÆäˆÃé”Ãä‰Ä‰°mSI86+R4'lWRtn±spÍ’Í’Óop²SNl4$l4$Il4$›8%P,±spÍ”¨ÓopêV&ðWðWðW°gÔM1°mSÓgV°mSÓopÐ…x•Šm86+:F/Nf9gg9fZ8pxŒˆ¶ÚšÆä¬Ðá·Ê×ÃÍзÊפÊâšÂÝŽÁÚq¬ÔŽÁÚŽÁÚˆÃéˆÃézÂízÂíˆÃéuÃñuÃñuÃñjÁòjÁòd½ïd½ï[´èd½ï[´èmÀëh¹éq¬Ôn˜ÇWl˜SpŽgy†WiwWiwWiwWifWifWifIYVhxghxgWif]…q[tXIYVVZVQjJj„hfjVhvXˆ–hwxWhxghxgfjVj„hhxgx†hhvXx…Xz•‡i†xx†h™¦w¨µx–šwx†h‡˜‡z•yz•y™¦w¨µx¨µx¨µx™¥hx…XoˆVx…XhuIj„hx”k‡—xz•yx”k¥u¥u¨µx¥u™¥hx”kz•yx”kz•yˆ–h™¥h™¦w™¦w§§h˜¥W‡ˆXx…XYeHQjJj„hoˆVZe;‡‡I‡‡Ilr9vi8lr9oQ/UL-wv;†yH‡ˆX—˜g’•I•ŠW†yH†yH‡‡I‡ˆX‡—x‡ˆX—ˆI‘ˆ;’•Iwv;fZ8wv;§˜W¯§V—ˆI«¢;ÏQÏQ®’K§§h¯§V’•Iwv;wwH‡ˆX†‰g§§h§§h§§h´±o¯§V—˜Yx”ktnUK7F<EghH–šw¦©ˆ¦¨w–šw†‰g†‰g—˜g†‰g–šwˆ–hfjVXgWGH8WW8VYGOKND<5ghHGJFGJFIYVZwvXgWIYV:GFKeW:Ql:OQSw©Sw©W•ÉW•ÉZ¨ÕZ¨ÕW•ÉWŠ³Sw©Wiwl[iWiwWŠ³q¬Ôw»çw»çˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéŽÁÚˆ¶ÚŽ¬Ìtn“UVl4$R4'UK7lWRtn°mSÍ”¨Í’Óop²SNP,l4$›8%IP,²SNèrYÕwŒêfXêV&ðWðWðWÙm"²N0°mSÓgVÓopÐ…x±sp±spZe;Nf9UL-oQ/e[GpxŒ—»Ø¤Êâ¬Ðá·Ê×·Ê׬ÐáŽÁÚv¥®ˆ¶ÚŽÁÚŽÁÚŽÁÚšÆäˆÃéˆÃéŽÁÚˆÃéuÃñuÃñjÁòjÁòjÁòd½ïd½ïd½ïd½ï[´è[´èq¬ÔWŠ³hˆ–Z†Zwv[tXWifVZVIWGGH8OKNMYjVYGIYVIWGIYV[tXi†xIWG;F8JU:z•yy…Jx…Xx…Xx†hhxgx†h‡—xx†huygˆ–h–š‡‡—x¥uhvXVYGy…J¦¨w¨¶‡˜§ˆx”kx”kj„h‡ˆX™¥h¥u—˜Y¨µx¨¶‡¥uŠ¤ˆš³’š³’‡—xš³’¨µ¨µÄµÄµÄµÄµÄ¨µx¨¶‡¥u[tXhvX‰•Y—˜g¥uoˆVhuI[tXx…X‰•Yy…JhuIJU:GH8huI’•I˜¥WUL-oQ/oQ/GF-gg9wv;‘ˆ;Žr6fZ8vi8vi8lr9wv;†yHvi8lr9gg9wv;’•I’•Iwv;WW8y…J§˜W™¥hhvXhuIwwHfZ8UL-lr9wwH’•IwwHghHZe;x…X—˜Y¸Ãu¸Ãu´±o®’K‡ˆX•ŠW†yHUK7IWGx…X§§h©•o‡ˆX†‰g™¦w†‰guyg‡—x•Šm–šw‡ˆXGH8GH8VYGIWGJU:GH8:GFMYjYuhz•‡z•yKeWIWGIYVGJFJgn=ee=d‹W•ÉW•ÉZ¨Õ[´è[´è[´è[´èZ¨Õv¥®SpŽZwvfjgWŠ³q¬Ôw»çzÂízÂíˆÃéˆÃé”ÃäˆÃé”ÃäˆÃéšÆäˆÃéˆÃéˆÃé¨ÅÛ«¹Ê—™—°mS²N0P,GF-UK7lWR“UV¯”‘Í’ÓopÓop²SNP,Il4$I²N0²SN±spÍ”¨èrYðWðWðWÔM1ÔM1ÔM1²N0²SN±sp±spÐ…x©•oy…JNf9oQ/oQ/lWRo®’¾ášÆä·Ê×·Ê׬ÐáŽÁÚv¥®ŽÁÚŽÁÚšÂÝ”ÃäšÆäˆÃéšÆäˆÃéˆÃéuÃñuÃñuÃñuÃñjÁòjÁòd½ïd½ï[´è[´èq¬ÔW•Éhˆ–i†xZwvi†xi†xKeWIYVVZVMYjIYVD<5:GFOKN:GFKeWWif[tXz•y[tXGJFfjV¥ux”kYeHJU:YeHYuh[tXx†hx…XhvXfjgVZVj„hwˆwi†x…Šw™¦w¨¶‡¨¶‡‡˜‡x”kx†hj„hˆ–h‡—x¥u™¥h¸Ãu¨¶‡š³’š³’š³’š³’¨µ¨š³’¨¶—µÄµÄµÄµÄ¥u¥u¨µx™¥h¥uŠ¤ˆŠ¤ˆ¨µx¨¶‡¨µx™¦w¨¶‡˜§ˆ™¦w‰•Y[tXhuIoˆV˜¥Wx”ky„<GF-WW8ghHujG‡‡Iy…J‡ˆX…{WghHghHfZ8Ze;vi8vi8y…J‘ˆ;’•I—ˆI–šw¦©ˆ¸Ãu—˜g•Šm¥u™¦w¨¶‡¨µx—˜gx…X—˜Y§§h§§h¯§VujGUL-lr9˜¥WÉÄp¸Ãu´±o¨µxˆ–h‡ˆX´±o—˜g¥u¨µxŠ¤ˆ†‰g˜§ˆ–šwuygukXUK7VZVuyg˜§ˆuygUK739I995IWGJU:fjVujGXgWXgWQjJQjJJU::F/;F899586+GJFOKN=d‹W•É[´è[´è[´è[´è[´è[´è[´èq¬Ôq¬Ôn˜ÇWiwWiwhˆ–w»çw»ç‡½ãˆÃéšÆäšÆäšÆäšÆäšÆäšÆäˆÃé¤ÊâšÆäšÆ䫹ʯ™§±sp²N0l4$l4$UK7l4$“UVÐ…xÍ’èrYÙm"ÓTM›8%IP,›8%²N0²N0±spÍ’èggðWêV&ðWÙm"²N0°gÔM1°mSÓopÓopÓgV¬u/•ŠWZe;oQ/oQ/uzv’¾á¤Êâ¬Ðá¬Ðá¬ÐáŽÁÚˆ¶ÚŽÁÚšÆäŽÁÚŽÁÚŽÁÚšÆäšÆäˆÃéˆÃézÂíˆÃéuÃñuÃñuÃñjÁòuÃñjÁò[´è[´èZ¨Õv¤š]…qhxg[tXi†xgywgy†Wl˜WŠ³WŠ³Sw©SpŽIYV;F8KeWIYVWifWiw:QlYuhj„hVZVVYGhvXx†hWifGH8GJFGJFghHwˆwfjghxgŠ¤ˆwˆwVYGhxg‰¥—š³’¨¶—š³’™¦wˆ–hhvXj„hx†h‡—xš³’™¦w¨µxµÄ¨µx¸Ãu¨¶‡¨µx¨¶—¶Ã²µÄ˜§ˆ¨¶‡š³’¥uš³’¨µx¨µx¥u‡—xš³’¨¶‡¥u¥u‡—x™¦wµÄµÄ¥uoˆVˆ–h‰•Yx”k¥uoˆV‰•YoˆVgg9Ze;ukX‰•Y§˜W‡‡Igg9fZ8wwH™¥h§˜W‡‡I•ŠW§˜W¯§V—˜Y†yHwwH…{W†‰g¨µx©•o—˜Y™¥h§˜W§˜W‘ˆ;’•I¯§V¯§V¯§VŽr6ujGghHy…J§§h´±o™¥h•ŠW—˜g—˜g—˜Y‰•Y…{WukXˆ–h—˜g–šw†‰g…{W—˜Y–šwfjgfjVukX–š‡•ŠmwxWukXGJFF<EJU:YeHVYGJU:JU::GF:F/:F/:F/:GF-12-12:GFF<EF<ESpŽW•É[´èZ¨Õ[´è[´è[´èd½ïd½ïd½ïZ¨Õq¬Ôv¥®WŠ³Z†o®q¬ÔŽÁÚ‡½ã”Ãä¤ÊâšÆäšÆä”ÃäšÆä”Ãä¤ÊâšÆä”Ã䗻ؗ™—Óop²N0P,R4'oQ/P,²SNÐ…x⃌ìdJÙm"ìdJ°gIP,P,ÔM1ÔM1ÓgVÍ’èggìV:êV&ðWðWÔM1ÔM1ÔM1ÓgVÓgVÓgVÓopÓgV°mSvi8fZ8fZ8i‡‡ˆÃéšÆä¬Ðá¤ÊâŽÁÚŽÁÚŽÁÚšÆäˆÃéšÆäˆÃéšÆäšÆä¬ÐáˆÃéˆÃéˆÃéˆÃézÂíuÃñuÃñjÁòmÀëh¹éW•Éhˆ–j”’v¥®v¤šj”’j”’o®WŠ³W•ÉW•ÉZ¨ÕW•ÉWŠ³Z†ZwvJgnJgnYuhZwvZwvYuhuzvXgWKeWIYVVYGx…X‡—xVYG:F/JU:e[G—˜g¦©ˆ…Šwj„h–š‡‡˜‡z•‡¥u™¦w˜§ˆx”kwˆwhvXj„hx”k‡—x˜§ˆ¨¶‡¨¶‡¥u¥u¨µx¨µx¥u¨¶‡˜§ˆ‡—xz•yx”k¨µx¨µx¥u¥uµÄ¨µxŠ¤ˆz•y¥u¥uš³’š³’š³’¨µx¨µx¨µx¥u¥uoˆVQjJoˆVx”k˜¥W‰•Y˜¥W—˜gy…Je[Ge[GfZ8fZ8WW8wv;wv;wwH—˜g•ŠW†yHfZ8fZ8†yH’•I‡‡Ivi8fZ8ujG—ˆI’•I’•I™¥h–šw‰•Y‰•Y•ŠW‡‡I˜¥W§§h´±o–šwx”k–šw†‰gz•y‡—x™¦w–šw…{WghHYeH…{W•ŠW‡‡I•ŠWwxWuygwxWwxWfjVuyg…Šw†‰g…{W™¦wwxWYeHGH8995GJFGH8GJFGH8;F8:GF;F8IYV:OQ:GF:OQ:OQIYVIYVlWRSw©[´è[´è[´è[´èd½ïd½ïd½ïjÁòmÀëw»çmÀëq¬Ôv¥®WŠ³v¥®w»çŽÁÚ”ÃäšÆäšÆäšÆäšÆäšÆäˆÃéšÆäšÆäšÆ䗻؉±spÓTMP,l4$P,ÔM1ÓgV⃌ЅxìdJìdJêV&²N0II›8%P,²SN±sp⃌èrYìV:óK"ëH&êV&Ùm"ÔM1Ùm"ÔM1ÓgVÐ…xÓopèrYÓgVŽr6oQ/“UV‡™—ˆÃéˆÃéŽÁÚŽÁÚ¤ÊâŽÁÚŽÁÚšÆäˆÃé¬ÐášÆäšÆäˆÃéšÆäˆÃéˆÃéˆÃéˆÃéuÃñuÃñzÂímÀë[´èj”’j”’Z†v¤šv¥®q¬ÔZ¨Õq¬Ô[´èh¹émÀë[´èh¹éZ¨ÕZ¨ÕWŠ³SpŽJgnZwvJgnYuhYuhYuhi‡‡z•‡wˆwWifx…XwwHYeHVYG;F8VYGIWGhuIˆ–h™¥hhvXghHx…X‡—xx†h…Šw™¦wµÄ¨¶—Š¤ˆ‰¥—v¤š—¨–š³’¨¶—¨¶‡Š¤ˆz•‡Š¤ˆŠ¤ˆµÄµÄŠ¤ˆz•‡z•y¥u¨µxµÄµÄ¨µxš³’Š¤ˆ‰¥—š³’¥uš³’š³’x”kx”kx”koˆV[tXQjJoˆVoˆV[tXy„<˜¥W¨¶‡š³’¥ughHfZ8fjVukXfZ8D<5UK7fZ8ujGghHukXhuIwxW‡‡I—˜Y’•I¯§V®’K‘ˆ;‡‡I—˜g—˜Y—ˆI—ˆI—ˆI§˜W—ˆI•ŠWwwH‡ˆX†yH•ŠW§§h§§h§§h‰•YwxWx…X—˜g™¦w•Šm…ŠwuygwxW¯§V—˜gwxWx†h‡—x¦©ˆwxWhuIe[GfjV…{We[G‡ˆX—˜YWW8VYGVYGGJFIWGVYGIWG[tXXgWKeWJgn=ee:OQ:Ql=d‹SpŽZ†Z†WiwSpŽn˜Ç[´èd½ïd½ïd½ïd½ïmÀëmÀëmÀëmÀëmÀëq¬Ôq¬Ôq¬Ôv¥®q¬Ô”Ãä”Ãä¤Êâ¤Êâ¬Ðá¤ÊâšÆäšÆäˆÃé”ÃäšÂÝ•®²tn²SNÔM1°gI“UV²SNÐ…xÍ’æpræprÙm"ÔM1›8%›8%I°g²N0²N0°mSÓopæpròT'ðWðWðWêV&Ò9(Ùm"ÔM1ÓgVÓopèrYèrYÓgV°gvi8P,wŠ•ˆ¶ÚˆÃéŽÁÚŽÁÚŽÁÚ¤ÊâšÂݬÐášÆä¬ÐášÆäšÆäšÆäšÆäˆÃéšÆäˆÃéšÆäˆÃézÂízÂíZ¨Õv¤šj”’n˜Çn˜Çq¬Ôq¬Ôq¬Ôh¹éq¬ÔmÀëzÂíw»çuÃñw»çh¹éq¬ÔW•ÉZ†gy†JgnJgnWifi‡‡ZwvYuh[tXYuhXgWIWGYeHYeHYeHhvX[tXVYGNf9wxWx†hx”khvX[tXhvXj„hx†hj„hx…X¦©ˆ¨¶—˜§ˆ˜§ˆ˜§ˆ˜§ˆ˜§ˆš³’š³’š³’š³’¥u¥uŠ¤ˆ¥u¥u¥uš³’¨µx™¦w˜§ˆ¨µxµÄ¸Ãu¨µx¥u]…qoˆVhuINf9‰•Y˜¥W˜¥WoˆVoˆVoˆVoˆVoˆV¥u¥ux”kx”koˆVUK7UK7WW8‰•Yˆ–he[GGJFwxW§˜W‰•YwwHujGwwHwxW†yH‡‡I‡‡I‡‡I‡ˆX…{W‰•Y‰•Yvi8fZ8wv;wwHhuIwv;—ˆI—ˆI‘rM†yH‡‡I’•I«¢;¯§V˜¥W—˜YwxWe[GghHghHghH•Šm—˜g—˜Y™¥h§§h˜¥W—˜gwwHe[GUK786+D<5D<5WW8D<5GH8Ze;GH8GH8QjJIWGIWGIYVGJFIWG=ee:Ql:QlSw©WŠ³W•ÉWŠ³WŠ³Sw©WiwZ†Z¨Õd½ïd½ï[´èd½ïmÀëzÂímÀëzÂíw»çŽÁÚw»çq¬Ôq¬Ôq¬Ôˆ¶Ú”Ãä¤Êâ¨ÅÛ¬Ðá¤Êâ¤ÊâšÆäšÆäšÆäŽÁÚŽ¬Ì¯”‘ÓgVÔM1ÔM1P,P,ÔM1Ð…xÐ…x±spÓgVìV:²N0P,°gP,›8%ÔM1êV&ÓgVÍ’æprìdJðWêV&êV&ðWðWêV&ìV:ÓgVÐ…x⃌ÓopÓgV¬u/P,P,‰šÂÝŽÁÚŽÁÚŽÁÚ¬Ðá¬ÐáŽÁÚšÆäˆÃéšÆä¬ÐášÆäˆÃéšÆäˆÃéuÃñšÆäŽÁÚˆÃézÂíq¬ÔWŠ³v¥®v¥®q¬Ôh¹éq¬Ô[´èmÀëmÀëuÃñmÀëh¹éw»çw»çw»çh¹éq¬ÔWŠ³SpŽZwvgy†ZwvZwvi‡‡i†xi‡‡i†xZwvIYVIWGIYVJgnoˆV‡—x¥uˆ–h[tXhvXhxgi‡‡z•‡—¨–Š¤ˆz•yj„h[tXghH—˜Yˆ–hhvXˆ–hx”kx”kˆ–hˆ–h‰•Y¨µx™¦w¥uz•yx”k‰•Y¥u¥u¥uz•yx”k¥u¸Ãu¸Ãu¨µx¥ux”koˆVoˆVoˆV‰•Y˜¥W¯§V¨µx¥u˜¥W˜¥W¥uoˆV[tX[tXQjJhuI[tXoQ/UL-GF-GF-fZ8UL-JU:wxW†‰g‡ˆX‰•YwxW‡‡I‡‡IwwHwv;‡ˆXujG‡ˆX‡—x–šw—˜g—˜Yˆ–h§§hÉÄpÉÄp§˜Wwv;vi8D<5D<5e[Gwv;lr9‡‡I†yHx…X†‰g‡ˆXwwHhuIfZ8ukX—ˆI’•IwxWtn’•I’•IwwHgg9UK75+(UK7ghHvi8GH8VYGYeH[tXIWGVZVXgW=eeZwvJgnIYVWifMYj=d‹W•ÉZ¨ÕZ¨Õq¬Ôn˜Çv¥®Z†JgnW•É[´èd½ïjÁòjÁòjÁòjÁòzÂízÂízÂíw»çw»çw»çq¬Ôq¬ÔŽÁÚŽÁÚšÆä¨ÅÛ¤Êâ¤ÊâšÆäšÆä¤Êâ¤ÊâŽÁÚŽÁÚ˜¨§ÓgVëH&ÔM1²N0²SNÓgVÐ…xÐ…xæprèrYÔM1ÔM1²N0›8%P,°g°gÔM1°mSÕwŒæprìV:ìV:êV&ðWðWðWÙm"Ùm"èrYÓopÐ…xÇšH¬u/ÓTMIP,‰”Ã䒾ᇽãŽÁÚ¤Êâ¬Ðá¤ÊâšÆä¤Êâ¬ÐášÆäšÆäˆÃéšÆäšÆä¬ÐáˆÃéuÃñˆÃéq¬Ôv¥®Z¨Õv¥®Z¨Õq¬Ôh¹éh¹éjÁòuÃñuÃñjÁòd½ïd½ïd½ïh¹éh¹éZ¨Õn˜ÇWŠ³ZwvZwvWifJgnZwvi‡‡j”’o®ZwvWifKeW[tXhvXXgW[tXx†hx”ki†x[tXXgWWifi†x‡˜‡¨¶——¨–—¨–—¨–‡˜‡x”kx…Xx”k‡—xŠ¤ˆ¥u¥u¥u¨µx™¦wŠ¤ˆ¥uŠ¤ˆz•yx”kx”k™¥h¥ux”kx”k¥uŠ¤ˆ¥uš³’š³’µÄµÄš³’oˆVx”koˆVoˆVoˆVx”kµÄš³’x”kx”k[tXQjJQjJXgWWifj„hfZ8UL-gg9UK7vi8wwHlr9gg9‡ˆX…{W†yH—˜Yx…XghH‡‡Iy…Jx…XwxW†‰g‡ˆX—˜Y‡‡IujGˆ–h™¥h´±oÉÄp§§hwxWhvXfjV‡—x™¦w´±o¨¶‡¥ux†hx†h•ŠW—˜Y—˜g‘rMe[Guyg–šw—˜gx…X—˜Y—ˆIŽr6fZ8vi8UK7GF-fZ8vi8WW8VYG…{W–šw•ŠmwxWhxguzvgywZwvZwvZwvKeWMYjSw©Z¨Õ[´èh¹é[´èq¬Ôh¹éq¬ÔWŠ³Z†[´èd½ïjÁòjÁòuÃñuÃñzÂízÂ퇽ãw»ç‡½ãw»ç‡½ãw»çq¬ÔŽÁÚšÂÝšÆä¨ÅÛ·ÊפÊâ¬Ðá¬ÐášÆäŽÁÚšÂݧ¨¨ÓTMÒ9(²N0²N0²N0Óop⃌èrYêfXêV&êV&Ò9(°g°g›8%›8%P,²SNÓgV±spÓopìdJêV&ðWðWðWðWðWìdJÙm"èrYÓopÓgVÓgVÓgVP,P,pxŒˆÃ釽ã”ÃäŽÁÚ¬ÐáŽÁÚ¬Ðá¬Ðá¤ÊâšÆäšÆäšÆäšÆä¤ÊâšÆä¬ÐáuÃñˆÃézÂíW•Év¥®q¬ÔmÀëmÀëh¹é[´èd½ïuÃñjÁòd½ïjÁòd½ïjÁòd½ïh¹éh¹éo®Z†YuhJgnYuhWifJgnIYVWifgy†o®y–—w‰‡i†xw‰‡wŠ•i‡‡KeWXgW™¥hŠ¤ˆ‡˜‡i†x[tXwxW¥u¦¨wŠ¤ˆx”kz•yŠ¤ˆŠ¤ˆz•‡Š¤ˆz•y™¦wŠ¤ˆz•yx”kˆ–h¨µx˜§ˆwˆwš³’š³’š³’µÄš³’š³’Š¤ˆˆ¦§v¤šv¤šv¤š¥u¨µx¨µx¨µx¨¶‡¨µxš³’¥u™¥h‰•Yy…J’•I™¥h™¥h¨µx¥uhuIZe;WW8IWGZe;lr9ghHwwH‡‡Ivi8vi8fZ8D:+UK7WW8WW8lr9‡‡I‡ˆXhuIwv;y…Jx…X¥u˜§ˆˆ–hwwHghHy…Jy…J‡ˆX‡‡I†yHwwH†yHwwH•ŠW¦¨w–šw™¥h™¥h¨µx¨¶‡•ŠWwxWhvXhxguzv¦©ˆ¦©ˆ•Šm–šw—ˆI§˜Wwv;wwHwwHfjVghHGF-995GJFIYVuyghvXi†xuyggyww‰‡ZwvWif[tXfjVF<EMYjSw©Z¨Õ[´è[´èq¬ÔmÀëw»çq¬Ôv¥®WŠ³W•É[´èd½ïjÁòuÃñmÀëzÂíˆÃéŽÁÚˆÃéŽÁÚ‡½ãŽÁÚ‡½ãŽ¬ÌŽÁÚ—»Ø¨ÅÛ¬Ðá¬Ðá¬Ðá¬Ðá¤ÊâšÆäšÆäŽÁÚ¦©—ÓTMêV&Ò9(²N0ÓgVÐ…xèrYÐ…xìdJêV&ðWÔM1Ò9(Ò9(IP,²SNÓTM°mSÕwŒæprèrYÙm"ìV:ðWðWðWêV&Ùm"ìdJÓgVèrYèrYÓgVÓTM²SN“UV‰ŽÁÚ‡½ã”ÃäšÆä¤ÊâšÆä¬ÐášÆä¬ÐášÆäšÆä¤Êâ¤Êâ¬Ðá¤ÊâŽÁÚŽÁÚq¬Ôv¥®q¬Ôq¬Ôw»çh¹éd½ïd½ï[´èd½ïjÁòmÀëjÁòjÁòjÁòmÀëh¹éZ¨Õv¥®Z†YuhYuhYuhIYVIWGZwvZwvZwvj”’i‡‡w‰‡w‰‡y–—wŠ•i†xwˆwi†xj„hj„hx†hhxgYuhXgWXgWXgWVZVw‰‡i†xŠ¤ˆš³’š³’ˆ¦§‰¥—Š¤ˆ‡—xŠ¤ˆ¥ux”kj„hj„hx”k¥u¥u¥uz•yš³’š³’µÄµÄµÄŠ¤ˆ¥u¥u¥u¥uš³’š³’¥u¥ux”koˆVoˆVoˆVghHhuI™¥h¨¶‡¨µx‰•Yy…Jx…XNf9WW8Ze;lr9‘ˆ;’•I—ˆI—ˆIfZ8gg9fZ8WW8R4'UL-UK7GH8fZ8ujGwv;§˜W¯§V‰•Y•ŠW•ŠW—˜Y¦¨w§§h§˜W™¥h—˜g‡ˆX˜¥W•ŠW‡‡IghHYeHujG‡‡I—˜Y§˜W™¥h‰•Yuyguygz•yŠ¤ˆ†‰gukXˆ–h™¥hwwHvi8UL-Ze;wxW†‰gfjVIWGVZVwˆww‰‡–š‡‡˜‡w‰‡hxgWifgywhˆ–IYVIYV:Ql39I:QlW•É[´èd½ïd½ïd½ïmÀëw»çŽÁÚq¬ÔWŠ³Sw©Z¨Õ[´èd½ïmÀëuÃñmÀëzÂíˆÃéŽÁÚzÂíŽÁÚ‡½ãˆ¶Úˆ¶ÚŽÁÚšÂÝšÆä·Ê×ÃÍзÊ×·ÊפÊâ¤Êâ¬Ð᫹ʯ”‘Ùm"êV&²N0²N0ÔM1èrYÐ…xæpríWHñT8óB°gÒ9(²N0²N0êV&ÔM1²SN°mSÓopêfXñT8ìdJòT'ðWðWðWêV&êV&ìV:ÓgVèrYæprìV:ÓTM°mSP,‰w»ç”Ãä”ÃäˆÃéˆÃéšÆäšÆä¬ÐášÆäšÆäšÆäšÆä¬Ðá¬ÐášÆäŽÁÚmÀëv¥®mÀëw»ç‡½ãw»çmÀëmÀëmÀëjÁòmÀëjÁòjÁòjÁòmÀëjÁò[´èZ¨Õo®hˆ–Z†i‡‡o®j”’ZwvWifZwvj”’hˆ–i†xZ†hˆ–Zwvhˆ–v¤ši†xuygz•yz•y]…q]…qZwvZwvgywi‡‡i‡‡i†xi†xz•yš³’¨µ¨©¶¸¶Ã²š³’¨µ¨š³’z•yz•yz•yz•yj„hx”k¥uš³’¨¶—¶Ã²¨¶—š³’¥u¥uš³’š³’¥uš³’µÄµÄµÄ™¦w¨¶‡¥ux”koˆVx”kx”kx”kˆ–h¨µx¨µx¥u‰•YoˆV‰•Y˜¥Wlr9oˆVlr9lr9wwH—˜Y…{WghHx…X§§h’•IujGfZ8YeHe[GghH‡ˆX‰•Y—˜Y—˜Y†yHvi8vi8WW8—ˆI´±o–šw…{W†yHx…X–šw‡ˆX‡ˆX•Šm¦©ˆ¨¶‡´±o§§h™¥hoˆVwwH…Šw…Šw–šw˜§ˆtnfjV‡‡Ie[GGH8fjVukX‡ˆX†‰g‡ˆXx†hfjVWifuyg…Šw†‰ghvXgywWifYuhVZVfjgIYV:OQ99539I=d‹Z¨Õ[´èjÁòjÁòw»çh¹éq¬Ôˆ¶Úq¬Ôq¬ÔWŠ³W•Éd½ïmÀëmÀëw»çzÂízÂíˆÃéŽÁÚšÆäŽÁÚ”ÃäŽÁÚ‡½ãŽÁÚ—»Ø—»Ø·Ê×·Ê×ÃÍзÊ׬Ðá¤Êâ¤Êâ¨ÅÛ¯”‘êV&êV&²N0°gÔM1æprèrYæprìdJóK"ëH&Ò9(²N0Ò9(Ò9(ÔM1ðWÓTMÓgV⃌æprìdJðWðWóK"óK"ðWðWòT'ìdJíWHíWHìdJÓgVÓgVÓgVP,‰‡½ã‡½ã”ÃäšÆäšÂÝšÆä¨ÅÛ¤ÊâšÆä”Ãä¤Êâ¤Êâ¬Ðá¤Êâ’¾áŽÁÚv¥®q¬ÔŽÁÚmÀëˆÃézÂíˆÃéuÃñjÁòjÁòuÃñjÁòjÁòjÁòjÁò[´èv¥®WŠ³hˆ–v¥®v¥®o®v¥®WŠ³]…q=ee=ee]…qv¤šhˆ–j”’j”’ZwvZwvi‡‡y–—v¥®v¥®ˆ¦§hˆ–Zwvi‡‡z•‡i‡‡j”’z•‡Š¤ˆŠ¤ˆuyghvX—˜g–š‡˜§ˆ¨µ¨š³’v¤šš³’Š¤ˆ‰¥—Š¤ˆ¥uŠ¤ˆ—¨–—¨–š³’¶Ã²¶Ã²¨µ¨š³’Š¤ˆz•yz•yj„h‡—x‡—x¦©ˆ˜§ˆ¥u‡—xx”kx”kj„hx†hx†h–šw¦¨w¨µx¸Ãu˜¥WoˆVNf9y„<y„<Nf9lr9y„<‡‡IwwHx…XwwH‡ˆX…{W—˜g™¥h•ŠWujGghHujGy…J’•Ivi8GF-fZ8vi8wv;‘ˆ;wwHŽr6—ˆI…{WujG…{WwxWukXukXuyg‡—x¦©ˆ¨µx¦¨w´±o¸Ãu§§h‡‡Iˆ–h•ŠmujGlr9y…JwwHghHukXhuI†‰g†‰gukXe[Guyg†Š‡wŠ•‡˜‡‡˜‡˜§ˆwˆwj„hhxgWifYeHVZVXgWVYG86+39IF<EJgnZ¨ÕZ¨ÕjÁòuÃñw»çw»çw»çw»çŽÁÚw»çq¬ÔWŠ³Z¨ÕmÀëh¹éh¹ézÂízÂízÂíˆÃéŽÁÚ”ÃäšÆä”ÃäŽÁÚŽÁÚŽÁÚ—»Ø¨ÅÛ¸ÇËÃÍзÊ׬Ðá¬Ðá¤Ê⫹ʯ”‘Ùm"Ò9(²N0Ò9(ìdJÐ…xæprèrYñT8ÔM1ðWëH&êV&Ò9(°gÒ9(ëH&òT'íWHèrYêfXñT8ðWðWóK"óK"óK"òT'ðWÓTMìV:ìdJêfXìdJèrYÓopP,Œš§‡½ã‡½ã”ÃäšÆä¤Êâ¤Êâ¤ÊâšÆä¤ÊâšÆä¤Êâ·Ê׬Ðá¤Ê∶Úv¥®q¬ÔŽÁÚw»çzÂímÀëmÀëmÀëmÀëjÁòjÁòjÁòjÁòjÁòmÀëZ¨ÕWŠ³Z†hˆ–v¥®q¬Ôq¬Ôv¥®v¥®v¥®]…qKeW=ee=d‹Jgni‡‡hˆ–hˆ–wŠ•hˆ–hˆ–w‰‡v¤ši‡‡i†xy–—ˆ¦§v¥®•®²«¹Ê•®²Š¤ˆi‡‡hxghxgj„hj„hz•yi†x‡™—š³’š³’—¨–š³’š³’‡˜‡š³’š³’˜§ˆš³’z•y˜§ˆŠ¤ˆš³’¨µ¨¨µ¨š³’˜§ˆŠ¤ˆ‡—xˆ–hˆ–h¦©ˆ¨¶‡¨¶‡š³’Š¤ˆx”k‡—x˜§ˆˆ–h‰•Y‰•Y˜¥Wy…JoˆVy„<oˆVy…JoˆVy„<gg9ujG†yHvi8UL-WW8GH8UK7fZ8uyg‡ˆX‡ˆX‡ˆXwv;wxWhuIfjVe[Ge[GwwHwwHwv;†yH‘ˆ;vi8GF-vi8ujG†‰g—˜g…Šwˆ–h‰•Y™¥h—˜g‰•Y¯§V¯§VwxWwwHwwHoˆVukXfjVukXhvX–šw•ŠWwwHVYGhvXw‰‡—¨–—¨–‡™—wˆwukX†‰gx†hoˆVhxgVZVIWGGJF;F8GJFIYVJgn5>hMYjW•É[´èh¹éuÃñzÂíw»çw»çw»ç‡½ãw»çŽÁÚW•ÉW•É[´èmÀëzÂíˆÃéŽÁÚzÂíˆÃé”Ãä”Ãä”ÃäšÂÝŽÁÚšÂÝšÂÝ—»ØšÂݨÅÛ·Ê×ÃÍЬÐá¬ÐášÆä¨ÅÛ¯”‘ÔM1Ùm"›8%²N0èrY⃌ìdJìdJñT8ëH&Ò9(Ùm"Ò9(°gÒ9(ÔM1Ùm"íWHêfXëYVìdJòT'ðWðWòT'ëH&óK"óK"òT'íWHìdJèggæprèrYèrY±sp‘rM‰ˆ¶Ú‡½ã”Ãä”ÃäšÆä¤ÊâšÂݤÊâ¤Êâ¬Ðá¬Ðá¬Ðá¤ÊâšÆ䈶ڎÁÚmÀëŽÁÚzÂízÂízÂímÀëzÂíuÃñmÀëjÁòjÁòjÁòjÁò[´èW•Égy†SpŽv¥®q¬Ôq¬Ôq¬Ô[´èZ¨Õq¬Ôj”’Z†YuhZwvZ†ZwvZwvWiwgywj”’wŠ•y–—j”’WifWifz•yy–—v¤šy–—•®²©¶¸ˆ¦§v¤šz•‡z•y‡˜‡˜§ˆ—¨–‰¥—‡˜‡‰¥—š³’š³’Š¤ˆŠ¤ˆš³’¨¶—¨¶‡‡—xŠ¤ˆ¶Ã²ÃÅ¡¶Ã²š³’š³’µÄ¨µ¨¨¶—¨¶—˜§ˆ¨µx¨µx¨µx™¦w¥u¥ux†hoˆVwxWx…X‡—xˆ–h˜¥W‰•Y˜¥Wx”koˆV‰•YoˆVNf9lr9fZ8GF-UL-WW8wwHvi8ujGfZ8UK7VYGwxW—˜g‡ˆX†yHvi8ghHukX…{W‰•Y—˜g’•I«¢;«¢;’•I†yHvi8gg9UL-UL-wwH—˜Y—ˆI•ŠW‡‡I†yH‡ˆX—˜Y™¥h˜§ˆ¨µx—˜g—˜g…Šw–šw–šwˆ–h‰•Yx…Xwˆwwˆw¥u–š‡ˆ–h–šwwˆwfjghxgŠ¤ˆ‡˜‡wˆwwˆwWifVZVKeWJgnGJFIWGIYV:OQMYjW•Éd½ïjÁòuÃñuÃñuÃñ‡½ã‡½ãzÂíw»çq¬Ôv¥®WŠ³q¬Ôw»çzÂíˆÃéˆÃéŽÁÚˆÃéˆÃéŽÁÚšÂÝšÂÝŽÁÚ—»Ø—»Ø—»Ø—»Ø¸ÇË·Ê×ÃÍÐÃÍЬÐášÂÝŽÁÚ¯™§Ùm"Ò9(êV&ÔM1èrY⃌èrYìdJñT8ðWêV&Ò9(Ò9(Ò9(²N0Ò9(ëH&íWHêfXèggìdJìdJðWðWðWëH&ðWðWðWìdJìdJèrYèrYÓopÐ…xÓgV²SNŸx‡n˜ÇˆÃé”Ãä”Ãä”ÃäšÆäšÆä¬Ðá¬Ðá¬Ðá¬Ðá¤ÊâšÆ䒾ሶڎÁÚŽÁÚmÀëˆÃézÂízÂízÂíuÃñuÃñzÂíuÃñjÁòjÁòd½ïZ¨Õo®o®n˜Çn˜Çq¬ÔŽÁÚŽÁÚw»çmÀëZ¨ÕWŠ³Z†JgnZ†ZwvJgnXgWZwv]…qw‰‡¥u‰¥—w‰‡YuhXgWwˆwz•‡y–—y–—i†x‰¥—š³’˜§ˆ‰¥—˜§ˆ¨¶—¶Ã²¨¶—¨¶——¨–z•y–š‡¨¶‡¨¶‡š³’¥u¥u¦©ˆš³’µÄ¨µ¨µÄµÄ¨¶—š³’Š¤ˆz•y‡—x—¨–wˆw¨¶‡µÄµÄ¨µx§§hx…XYeHe[GoˆVwwH‰•Y¥u˜§ˆ¥ux”koˆVx”k[tX:F/JU:lr9gg9ujGfZ8fZ8‰•YukXUK7ghHhuIujGUK7UK7gg9‡‡I«¢;«¢;‡‡IfZ8UK7ghHy…J‡ˆX‡ˆX™¥h§˜W†yHy„<wwHwv;‡‡I•ŠW¥u•Šmy…J‡ˆX•Šm§§h§§h™¦wˆ–h—˜g™¥h˜§ˆ¦¨w¦¨w™¦w—˜gš³’˜§ˆ–šw™¥h—˜g…ŠwukXXgWwˆw‡˜‡wˆwfjguzvuzvi†xtnhxgYuh:Ql995GH8MYjMYjWŠ³h¹éh¹éd½ïd½ïuÃñw»çˆÃéˆÃ釽ãmÀëq¬ÔZ¨ÕZ¨ÕmÀëmÀ뇽ãŽÁÚˆÃéˆÃéˆÃéˆÃéšÂÝšÂÝŽÁÚ”Ãä¨ÅÛŽÁÚ—»Ø¨ÅÛ¬Ðá·Ê×ÃÍзÊךÂÝŽÁÚ¦©ˆÔM1ÔM1Ùm"êV&æpræprèrYìdJòT'ðWòT'êV&Ùm"êV&êV&ÔM1ÔM1ìV:ìdJèggìdJðWðWÙm"ðWðWóK"ðWóK"ìdJèggìdJèrYèrYèrYÓopÓTM±spŽ¬ÌˆÃéšÆäšÆäšÂÝŽÁÚ¤Êâ¬Ðá¬ÐáÃÍЬÐá¤ÊⒾሶڈ¶ÚˆÃéˆÃéˆÃéuÃñˆÃéˆÃéuÃñjÁòjÁòuÃñˆÃéuÃñmÀëq¬ÔW•ÉZ†n˜Çq¬Ôq¬Ôh¹ézÂíˆÃéˆÃémÀë[´èZ¨ÕWŠ³ZwvZ†Z†Zwvi‡‡wŠ•i†xgyw‡—xz•‡wŠ•wŠ•i†xi†xi‡‡‡˜‡Š¤ˆŠ¤ˆi†xŠ¤ˆ‡˜‡i†xw‰‡‡˜‡—¨–š³’z•‡‡—xŠ¤ˆŠ¤ˆ¦©—¥u‰¥—Š¤ˆ™¦w™¦w¥uŠ¤ˆ˜§ˆµÄµÄ˜§ˆ˜§ˆ‰¥—Š¤ˆ‡—x–š‡—˜g¨µx¨¶‡¨µx™¥hoˆVVYGJU:uygˆ–h¨µx¥u‡‡I‡ˆX‰•Y˜¥W¨µxx”kNf9Nf9lr9huIgg9‡ˆX…{WfZ8vi8ujGUK7fZ8ujG—˜Y˜¥W†yHwwHujGwwH—ˆI†yHgg9wxWghHfjV‰•Y¦¨w´±o§§h’•I‡‡I‡‡Ivi8wxW™¥h—˜Yˆ–h…{W†‰g•ŠW§§h§˜WwwHghHhvXwˆwx†huyg†‰g‡—x…Šw–šw…Šwˆ–h—˜g¥u†‰guygz•y…Šwuygfjg]…qz•‡†Š‡pxŒwˆw‡™—†Š‡fjgWifGJFVZVOKNgy†h¹éh¹éh¹éw»çh¹éuÃñw»çw»ç‡½ãŽÁÚq¬Ôq¬Ôv¥®q¬Ôw»çzÂíˆÃéˆÃéˆÃéˆÃé”Ãä”ÃäšÆäšÂÝ”ÃäŽÁÚŽÁÚ—»Ø¨ÅÛ¸ÇË·Ê׬Ðá·Ê׬Ðá•®²°mSÙm"Ò9(Ùm"ëH&ÓopæprêfXñT8ìdJðWÔM1ÔM1Ùm"ÔM1Ò9(ÔM1ìdJèrYèrYèggìdJìdJðWðWðWðWðWóK"ðWòT'ëYVìdJèggÓgVÐ…xèrYÓTMŸx‡‡½ãŽÁÚ”ÃäˆÃé”ÃäšÆä·Ê×·Ê×·Ê׬Ðá·ÊפÊ◻ؒ¾á’¾áˆÃéˆÃéˆÃéˆÃéšÆäˆÃéˆÃéuÃñuÃñuÃñuÃñjÁòmÀëZ¨ÕW•Én˜Çq¬Ôq¬Ô‡½ãˆÃézÂízÂízÂíjÁòd½ïZ¨ÕZ¨ÕZ†hˆ–hˆ–WiwWiww‰‡v¤ši†xx†hZwvZwvw‰‡o®j”’Š¤ˆ—¨–Š¤ˆŠ¤ˆi‡‡Zwvi‡‡wŠ•v¤šš³’š³’š³’Š¤ˆ–šw¨¶‡¥uz•‡z•y–š‡¨¶‡µÄš³’™¦w¨µxµÄ¨¶‡¨¶‡‡˜‡x”k‡—x–š‡˜§ˆ˜§ˆ–šw™¥h¥u…Šwj„hx†h‰•Y™¥hx…XwwH‡ˆX‰•Yˆ–h—˜g™¥h¨µx˜¥W™¥h¥u‰•Yy…JNf9wwHlr9wwHfjVfjVx…X‡‡IujGUL-Ze;†yH‘ˆ;—˜Y©•owxWukXwˆw¥u•ŠW‡‡IwwHwwHy…J§§h´±o—˜Y§˜W—˜Y†yHwwH†‰g†‰g•Šm—˜g´±o§§h—˜Y‡‡I‡‡I†‰gwxWfjVwwHx…XwxWghHe[G†‰g¦¨w¦©ˆ¨µx–šwx†hhxgwˆwuzvi†xgyww‰‡y–—y–—w‰‡gywWiffjgwˆwWifOKNMYjWiwWl˜[´è[´èh¹éw»çˆÃéˆÃéˆÃ釽ãˆÃéŽÁÚˆÃ鈶ÚW•ÉZ¨ÕŽÁÚw»çˆÃ釽ãˆÃéŽÁÚŽÁÚ”ÃäšÆäšÂÝšÆäŽÁÚšÂÝŽÁÚŽÁÚ¤Êâ·Ê׬Ðá¬Ðá¤Ê⩶¸ÓopÔM1ÔM1ÔM1ñT8èrYèrYìdJñT8òT'ðWÔM1ÓopÓTMÙm"ëH&ðWêV&èrYÓgVÓgVÓTMìdJ׎Ùm"ðWðWðWóK"òT'ñT8ìdJêfXêfXèrYèrYÓop²N0Ÿx‡ˆ¶Úw»çŽÁÚ”ÃäšÂÝšÆä¨ÅÛ¬Ðá·Ê×·ÊרÅÛšÆä¨ÅÛ’¾ášÆäšÆäˆÃéˆÃéˆÃéˆÃéˆÃéuÃñuÃñjÁòmÀëuÃñmÀë[´èWŠ³q¬Ôq¬Ôq¬Ôw»çw»çw»çuÃñuÃñjÁòh¹é[´è[´èZ¨ÕWŠ³Z†j”’hˆ–y–—‡™—v¤šj”’i‡‡j”’i‡‡j”’j”’z•‡i†xi†xy–——¨–wŠ•y–—w‰‡w‰‡‡™—‰¥—¨¶‡¨µxš³’˜§ˆ¥u¦¨w™¦wx”k‡˜‡š³’µÄ¨¶—¦©—¨¶‡¨µx˜§ˆ‡—xš³’š³’¨¶‡™¦w™¥hˆ–h˜¥W’•I—˜Y—˜g‡—x¨¶—¨¶‡¨¶‡x”koˆVx”k‡˜‡x”kˆ–hoˆVhuIZe;Ze;y…Jx”koˆVNf9ujGWW8GH8UK7XgW–š‡–šw§˜W—ˆIwwHghHWW8WW8UK7wxW§§h´±o¨µx´±o§§h—˜Y•ŠW…{W†‰g˜¥W§§h§§h—˜Y—ˆIwwHhuIuyg–šw§§h´±o´±o§§h’•I’•I•ŠWVYGYeH†‰g–šwwxWfjVVYGx†h˜§ˆ¨¶‡—¨–Š¤ˆ‡˜‡‡™—…Šwwˆwwˆwj„hfjghxgi†xi†xgywfjgZwvw‰‡gywWiwSpŽgy†SpŽn˜Çh¹éd½ïh¹éjÁòw»çw»çˆÃ釽ãŽÁÚŽÁÚŽÁÚq¬ÔZ¨Õq¬ÔzÂízÂízÂ퇽ãˆÃézÂíŽÁÚŽÁÚŽÁÚšÂÝŽÁÚ—»Ø—»ØŽÁÚ¤Êâ·Ê×·Ê׬Ðá¤Ê⫹ʱspêV&ÔM1ìV:ìdJæprèrYïTBòT'ðWðWÙm"¬u/ÔM1Ò9(ðWêV&ìdJèrYÓopÓopÓopìdJñT8ìV:ðWðWóK"êV&óK"êV&ìdJæpræprèrYèrYèggÔM1¯”‘‡½ãˆÃé”ÃäšÆäšÆäšÂݬÐá·Ê׬Ðá·ÊרÅÛšÆ䒾ᒾášÆäšÆäˆÃéšÆäˆÃéuÃñˆÃéuÃñuÃñzÂíuÃñuÃñmÀëZ¨Õn˜Çq¬Ôq¬Ôw»çw»çˆÃézÂízÂízÂímÀëjÁò[´è[´èZ¨ÕW•Éhˆ–WŠ³i‡‡ˆ¦§Œš§Œš§ˆ¦§y–—v¥®‰Äv¥®ˆ¦§v¤š‡˜‡˜§ˆz•‡y–—v¤šz•‡‡˜‡˜¨§‡˜‡i†x‡—x˜§ˆš³’‰¥—Š¤ˆz•yz•yj„h‡—x™¦w¦©ˆ˜§ˆ—¨–Š¤ˆ–šw¦¨w˜§ˆ…Šw†‰g™¦w¨µx¨µx™¥hoˆVhuIwxWˆ–h‰•Y—˜Y¨µx¨¶‡¥ui†xi†xy–—‡—x‰•Yx”kZe;JU:Nf9Ze;j„hj„hz•y—ˆIvi8GF-GF-D<5fZ8wwH•ŠW†yHvi8wv;y„<fZ8fZ8gg9ujG†yH†yH‡‡I…{W‡ˆX‡ˆXukXwxW‡‡I•ŠW—˜Y—ˆIwv;gg9oQ/ujG…{WfZ8†yH‰•Y•ŠW—ˆI—˜Y—ˆIukX‰•Y—˜g†‰ghvXuzvx”k‡˜‡¦©—¦©ˆ‡—xVYGWifwˆwfjgojo…Šwx†hfjgi†xi‡‡‰¥—‡˜‡ojoVZVojol[iWl˜WŠ³pxŒSpŽW•É[´èZ¨Õh¹éh¹ézÂíw»çˆÃéˆÃéˆÃéŽÁÚˆÃéw»çq¬Ôv¥®zÂíw»çˆÃéˆÃéw»çw»çŽÁÚŽÁÚŽÁÚ”ÃäšÆäŽÁÚ”Ã䗻ؚÂÝ·Ê×·Ê׬Ðá·Ê׫¹Ê±spêV&êV&ìV:ìdJèrYêfXêfXìV:êV&êV&ÔM1Ùm"°gðWñT8ñT8êfXèrYèggæprèrYìdJòT'ðWÙm"ðWðWðWðWòT'ìV:èrY⃌èrYèrYÓopÙm"Ÿx‡’¾á’¾á”ÃäˆÃé¤Êâ¬Ðá¬Ðá·ÊרÅÛ¨ÅÛ¤ÊⒾᒾᒾᒾášÆäˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéuÃñd½ï[´èZ¨Õq¬Ôw»çw»çzÂízÂízÂíuÃñuÃñuÃñjÁòjÁòjÁò[´èZ¨ÕZ†SpŽhˆ–gywwŠ•i‡‡Zwvo®j”’v¤šv¥®‰Äˆ¦§•®²©¶¸•®²¨µ¨ˆ¦§‰¥—š³’z•yi†xz•‡‰¥—z•y‡˜‡‡˜‡Š¤ˆˆ¦§¨µ¨¶Ã²¨µ¨š³’˜§ˆš³’–šw‡—xw‰‡†‰g™¦w¨¶‡¨¶‡–š‡†‰gx”kz•yˆ–h‡—x˜§ˆ˜§ˆ™¦w™¥h˜¥W™¥h‰•Yz•yx†hhxgx…Xˆ–hhuIYeHhvXoˆV¥u¥ux”kx”ky…Je[GUK7GF-UK7fZ8fZ8UK7e[Ge[Ggg9fZ8fZ8vi8gg9WW8ujG†yHwv;†yHfZ8e[G‰•Y•ŠWwwHWW8fZ8—ˆI•ŠW†yH‘rMvi8vi8gg9GF-e[GwxWˆ–h˜¥W¯§V¯§V¯§V˜¥WwxWghH‡ˆX§§h´±oˆ–hx†hfjVuygz•‡‡—x–š‡x†huygx†h–š‡‡˜‡…Šwi†xuygVZVF<EIYVMYj=d‹WŠ³W•Én˜ÇSw©W•É[´èh¹éh¹éh¹éw»çzÂíˆÃéŽÁÚšÆäˆÃéŽÁÚŽÁÚq¬ÔW•Éw»ç‡½ãˆÃéŽÁÚˆÃéˆÃéw»çŽÁÚ”ÃäŽÁÚw»ç‡½ãšÂÝšÂÝšÆä¨ÅÛ·ÊפÊâšÆ䫹ʱspêV&óK"òT'ìdJèrYèrYìdJïTBìdJêV&ð=Ò9(Ùm"ðWòT'ìdJìdJèrYèggìdJìdJòT'ðWòT'òT'ðWðWðWðWòT'êfXèrYæprêfXèrYèrYÓgV‰Ä’¾áˆÃé”ÃäšÆä¤Êâ¬Ðá¬Ðá·Ê׬Ðá¬Ðá¤Êâ’¾áˆÃéšÆäšÆä¬ÐáˆÃéšÆäšÆäˆÃéˆÃéuÃñuÃñˆÃéˆÃéq¬Ôq¬Ôq¬ÔzÂíw»çw»çuÃñˆÃézÂízÂízÂíuÃñjÁòjÁòjÁò[´èZ¨ÕZ†gy†v¥®v¥®v¤šv¥®v¤ši‡‡i‡‡Zwvgy†v¤šˆ¦§v¤šj”’v¤šy–—i‡‡i‡‡‰¥—¨µ¨˜¨§‰¥—‰¥—‰¥——¨–†Š‡j„hwˆw—¨–¸·©¶Ã²˜¨§‡—x‡—x¦©ˆ‡—x…Šwx†hx†h‡ˆX§§h¨µx™¥hx”kˆ–h™¥h™¥h–šwˆ–hy…J‰•Y‡‡Iy…J˜¥W‰•YhvXwxWx†hwxWy…Jx…XhuIy…J¥uz•‡‡—xx”k¥ugg9fZ8fZ8fjVghHWW8D<5UK7†yH‡ˆXe[GUK7WW8lr9ujGujG•ŠW§˜W˜¥W†yHUL-ghHe[GVYGuygx†h—˜g¦¨w—˜Y†yHwv;wwHhuI‡ˆX•ŠW†yHŽr6†yH†‰g™¦w¦¨w™¥h–šw…Šw†‰gx†h†‰gwˆwwˆw…Šwš³’¸·©¨¶—–š‡ukXWif‡™—¨µ¨†Š‡hvXYeHVZVMYjgywgy†gy†Sw©WŠ³n˜Çq¬ÔWŠ³n˜Ç[´èh¹éh¹émÀëzÂízÂízÂíˆÃéšÆäšÆäŽÁÚŽÁÚˆ¶Úq¬Ôq¬ÔˆÃéˆÃé”ÃäšÆä”ÃäˆÃéˆÃéŽÁÚˆÃ釽ã”Ãä’¾á”Ã䗻بÅÛ·Ê×·Ê׬Ð᫹ʱspêV&óK"ñT8èrYèrYêfXêfXòT'êV&êV&Ò9(Ò9(ðWðWðWñT8ìdJêfXêfXíWHïTBñT8ðWòT'òT'ðWóBðWðWòT'íWHæpræprèrYèrYÓopÓTM‰Ä’¾á‡½ã”Ãä¤Êâ¬Ðá·Ê×·Ê×·Ê×·ÊרÅÛšÆäˆÃéšÆäšÆä¤Êâ¬Ðá¬ÐáˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéuÃñˆÃémÀëq¬Ô‡½ã‡½ãw»ç‡½ãˆÃéuÃñjÁòuÃñuÃñuÃñjÁòd½ïd½ïZ¨ÕWŠ³]…qi†xZ†hˆ–j”’v¥®v¤šv¥®j”’ZwvZwvi‡‡‡˜‡ˆ¦§š³’¨µ¨—¨–y–—y–—z•‡‰¥—˜¨§•®²•®²¨µ¨¨µ¨š³’‰¥—z•‡w‰‡wˆw‡˜‡¨µ¨š³’Š¤ˆš³’˜§ˆ—¨–‡˜‡‡—x…Šwˆ–h‡—x¥u˜§ˆ¨µx™¦w‰•Yx†hwxW‡ˆX‰•Yx”kx…X†‰gx”kx…Xx”k‰•Y¥u¨µx¥uˆ–hoˆVoˆVoˆVhuINf9lr9ghHVYGghHx…XuygghHfjVD<5UK7vi8ujGhuIwwHŽr6ujGlWRhvX¦¨w—˜gfZ8UL-wv;gg9e[GfjVfjVwxW©•o§§h•ŠW†yHhuIwwHujG‡ˆX‡ˆX†‰g‡—x‰•Šm¦©ˆ¦©ˆ–šw•ŠW…{WuygwxWuzvx†hwxW†‰g‡—x‡ˆXtnuzvi†x…Šwˆ–h†‰gXgWYeHfjgWifgywgy†Wl˜WŠ³W•ÉZ¨Õq¬ÔW•ÉWŠ³h¹éh¹éh¹é[´èh¹éw»çw»çw»çˆÃéšÂÝŽÁÚq¬ÔŽÁÚq¬Ôn˜Çw»çzÂíšÂÝšÂÝšÆä”Ãä”Ãä”ÃäˆÃéˆÃéšÂÝ’¾áŽÁÚ—»Ø¨ÅÛ·Ê׬Ðá¨ÅÛ«¹Ê±spÒ9(óK"ìdJèrYæprêfXíWHìV:êV&ðWÔM1Ò9(ëH&ðWðWòT'ïTBïTBìdJìdJñT8òT'ðWðWðWðWóK"óK"óK"òT'ìdJêfXèggæpræprÓgVÓTM‰Ä‡½ã‡½ãšÆä¤Êâ¤Êâ·Ê×·Ê׬Ðá·Ê×·Ê×’¾ášÆäšÆäšÆäšÆäˆÃéˆÃéšÆäuÃñuÃñˆÃéˆÃéˆÃéuÃñuÃñmÀëw»çw»çw»çˆÃéˆÃéuÃñuÃñuÃñjÁòuÃñmÀëjÁòjÁò[´èZ¨ÕZ†Z†Z†SpŽZwv]…qgy†wŠ•wŠ•o®y–—y–—v¤šy–—š³’ˆ¦§v¤šŠ¤ˆz•‡v¤š•®²¶Ã²¨µ¨š³’š³’‡˜‡Š¤ˆ˜§ˆ—¨–‡˜‡ˆ–h™¦w¦©ˆ˜§ˆ¨µ¨¨µ¨š³’¨µ¨—¨–‰¥—š³’µÄ¨¶—¦¨w¨¶‡˜§ˆ˜§ˆ™¦w†‰g–š‡—¨–š³’¨¶—š³’x”khvXghHhuIx…Xx…Xš³’¨¶—¨¶‡‡—xoˆVy…JhuIZe;GF-UL-WW8e[Ge[Ge[GfjVe[GVYGghHwxWYeHujG§˜W§˜WŽr6UL-D:+D:+WW8wxWwwH‘ˆ;²Š8‘ˆ;Žr6UK7D<5D<5fZ8ujG…{W™¥h‡‡I‡‡I‡ˆX—˜YwxWgg9wxWukXuyg¨¶—¦©ˆ†‰g•Šm‡—xuygfjV†‰g†‰gˆ–hˆ–h‡—x…ŠwwˆwuzvWiffjgj„h…Šww‰‡gywVYGGJFOKNF<ESpŽSw©Z¨ÕZ¨Õh¹én˜ÇWŠ³h¹éh¹émÀëd½ïh¹ézÂízÂíŽÁÚŽÁÚšÆä”ÃäˆÃéŽÁÚq¬Ôq¬Ôq¬ÔˆÃéˆÃéšÂÝ”Ãä”Ãä”ÃäŽÁÚˆÃé”Ãä”Ãä’¾áŽÁÚ—»ØšÂݨÅÛ¨ÅÛ¨ÅÛ©¶¸±spóBðWñT8êfXèrYêfXìdJñT8òT'ðWêV&ÔM1Ùm"ðWñT8ñT8ìdJñT8ìdJìdJëYVìdJòT'ðWðWóK"óK"óK"óK"ëH&ìV:æprèggèrYÓopÓop°mS‰Ä‡½ã‡½ã¤Êâ¬Ðá¬Ðá¬ÐáÃÍÐÃÍзÊרÅÛ’¾ášÆä¤ÊâšÆäšÆäšÆäˆÃéˆÃéˆÃéˆÃéšÆäšÆäuÃñmÀëq¬Ôq¬Ôw»ç‡½ãˆÃéˆÃéˆÃéˆÃéjÁòd½ïjÁòd½ïjÁòd½ï[´è[´èWŠ³Z†Z†WŠ³Z†Z†j”’Z†hˆ–j”’j”’o®v¥®v¥®v¥®ˆ¦§•®²—¨–•®²j”’j”’j”’v¤šy–—‡™—ˆ¦§š³’˜§ˆš³’Š¤ˆŠ¤ˆz•‡¥u¨µx‡—x–šw¦©ˆ˜§ˆš³’˜¨§y–—˜§ˆ¨¶—¨¶—¨¶—¨¶‡Š¤ˆ‡˜‡š³’š³’—¨–Š¤ˆx”k˜§ˆ‡˜‡z•y˜§ˆŠ¤ˆ‡—x¥ux”khvXj„hhuIoˆV[tXNf9Nf9y…J˜¥WoˆVGJFUK7ghHhxgfjVVYGWW8ghHfZ8gg9wwH—ˆI—ˆI…{WVYGghHukXUK7VYGujG†yHwwH…{WukXuyg‡—x†‰ghvXe[GWW8—˜Y§˜W®’K‘ˆ;‡‡IwwHVYGghHukX…Šw¨¶—·²¦©ˆ¦¨w…{WwxWx†hˆ–hˆ–h™¥h—˜Y†yHwxW…{WhuIghHuzv‡—x†‰gVZV:GFF<E;F899539IWl˜n˜Ç[´èh¹éh¹én˜ÇSw©n˜Çd½ïh¹éjÁòzÂ퇽ãzÂíŽÁÚˆÃé”ÃäˆÃéˆÃéŽÁÚq¬Ôv¥®q¬Ô‡½ãŽÁÚšÆäšÂÝ”ÃäˆÃéˆÃéŽÁÚˆÃéŽÁÚˆ¶Ú‡½ã’¾á—»ØšÂݨÅÛŽÁÚ©¶¸ÓgVëH&òT'ìV:êfXèrYêfXìdJòT'ðWëH&ðWðWðWðWòT'ñT8êfXïTBïTBìdJêfXìdJòT'óK"óK"ðWòT'ðWêV&óK"ìV:ìdJèggÓopèrYÓgV°mS‰Ä‡½ã”Ãä¤Êâ¬Ðá¬ÐáÃÍÐÃÍÐÃÍЬÐá”Ãä’¾ášÆäšÆä¤Êâ¤Êâ¬ÐáuÃñˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéw»çq¬Ôw»çzÂíŽÁÚˆÃéšÆäˆÃéuÃñuÃñjÁòmÀëjÁòjÁòd½ïd½ï[´èv¥®v¥®v¥®W•ÉZ†Z†]…qgywgywi‡‡wˆwi‡‡Zwvj”’ˆ¦§Ž¬Ìv¤šv¤š˜¨§•®²•®²ˆ¦§•®²‰¥—j”’z•‡—¨–¶Ã²¶Ã²©¶¸¨µ¨©¶¸¨µ¨š³’š³’x†hwˆw‡—x‡—x‰¥—Š¤ˆ‡˜‡z•y‡—xŠ¤ˆ‡—x…Šw†‰gŠ¤ˆ¦©—ÃÅ¡µÄš³’š³’¨µxz•yz•yš³’š³’‰¥—x”koˆVx†hx”koˆVoˆVhuINf9y„<‰•Yy„<WW8fZ8†yH†yHujGujGgg9fZ8UL-Ze;ujGfZ8wwH—˜g…{W‡ˆXukXfjVghHujGwwH‡ˆXwxWwwH—˜Y†‰gukXukXe[GWW8UK7VYGukX‰•Y˜§ˆ•Šmz•‡wˆw…Šw¥u¨¶‡–šw†‰g–šwuyguyg˜§ˆ¥u—˜g†‰gwwHVYGhvXwxWwxW†‰guygVYGGH8:GFOKNIYVIYVF<EF<E=d‹W•Éh¹éd½ïh¹éZ¨ÕZ†W•Éh¹émÀëuÃñzÂízÂízÂíŽÁÚŽÁÚ”Ãä”ÃäŽÁÚŽÁÚŽÁÚq¬Ôq¬Ôw»çˆ¶Ú”Ãä¤ÊâšÆäzÂíˆÃ鈶ڇ½ã‡½ã”Ã䇽ã”Ã䗻ؒ¾á¨ÅÛ¤Ê⩶¸ÓgVêV&òT'èrYìdJêfXèrYìV:ðWðWóK"ëH&ëH&êV&óK"óK"ìdJêfXêfXèggèggê\eíWHñT8òT'ðWòT'òT'ðWðWêV&êV&ìdJÓgVèggèggê\e²SN‰Ä’¾á¬Ðá¬Ðá¬ÐáÃÍÐÃÍÐÃÍзÊךÆä’¾á”ÃäšÆäšÆäšÆäšÆäuÃñuÃñšÆäˆÃéšÆäˆÃéˆÃézÂíq¬Ôw»çˆÃéˆÃéˆÃéˆÃéˆÃéuÃñzÂíˆÃéuÃñmÀëjÁòjÁòd½ïd½ïZ¨Õv¥®q¬Ôq¬Ôv¥®j”’]…q[tXi†xgywi†xw‰‡Z†ZwvQjJYuhi‡‡wŠ•‰¥—¨µ¨•®²•®²‰¥—‰¥—š³’•®²ˆ¦§š³’˜§ˆ—¨–¨¶—‡˜‡Š¤ˆš³’‰¥—š³’—¨–š³’¨¶—š³’˜§ˆŠ¤ˆŠ¤ˆ‡˜‡‡˜‡˜§ˆ‡—xx…Xx…X†‰g‡—x™¦w¨¶‡¨¶—˜§ˆ¥u™¦w™¦w‰¥—Š¤ˆ¥uz•yj„h[tXNf9oˆVoˆVy„<oˆVy„<Nf9Nf9wwHfZ8ghHwxWVYGe[GghHfZ8fZ8Ze;ghHghHujGujGghHe[GfjgfjgukX•ŠW…{WukXwwH•ŠW•ŠW†yH†‰g†‰guygtnx†hˆ–h–šw†yH…{W…Šwx†h†‰g¥u¨µx¦¨w†‰g‡—x¦©ˆ˜§ˆ¦©ˆ–š‡•Šm—˜g—˜YuyguyglWRhxg‡—x–šw‡ˆXVYGOKNUK7OKNIYVVZVojoMYjMYjSw©Z¨Õh¹éh¹é[´èW•ÉWŠ³jÁòh¹éh¹éw»çzÂízÂízÂízÂí”ÃäšÆäšÆäšÂÝŽÁÚŽÁÚŽÁÚq¬Ôˆ¶ÚšÆäšÂÝ”Ãä”ÃäŽÁÚˆÃ釽ãŽÁÚ”Ã䇽ã”ÃäšÂÝ”Ãä¨ÅÛ¬Ðᨵ¨ìdJëH&ìV:ìV:ëYVèggêfXìdJðWòT'ð=ì=&ëH&êV&óK"ñT8íWHèrYæprèggèggêfXíWHòT'óK"óK"óK"óK"ðWóK"òT'òT'ìV:êfXèrYêfXê\e²SN‰ÄšÆä¬Ðá¬Ðá¬ÐáÃÍÐÃÍзÊ׬Ðá”Ãä”Ãä¤Êâ¤ÊâšÆä”Ãä”ÃäˆÃéˆÃé¬ÐáˆÃéšÆäˆÃéˆÃéuÃñˆ¶Úw»çuÃñˆÃéˆÃéˆÃéˆÃéuÃñuÃñuÃñuÃñjÁòjÁòjÁòd½ï[´èZ¨Õq¬ÔmÀëZ¨ÕZ¨ÕZ†Z†KeWWifYuh]…qv¤šv¤šj”’j”’Wifgywi‡‡j”’‰¥—‰¥—v¤šv¤šv¤šz•‡‰¥—¨µ¨¨µ¨¨µ¨¨µ¨¨µ¨˜§ˆ‰¥—‰¥—Š¤ˆ‡™—z•‡w‰‡¨µ¨¶Ã²¶Ã²¸·©¨¶——¨–Š¤ˆ‰¥—Š¤ˆŠ¤ˆ‡—x˜§ˆ—¨–‰¥——¨–‡—xˆ–hwwHx…X†‰g‡—x˜§ˆš³’j„hj„hQjJNf9y„<x”kx”koˆVNf9lr9Nf9e[Ge[GukXwwHwwHghHujGghHe[Glr9‡‡I•ŠW†yHe[GfjVhvXuyg•Šmtn†‰g¦¨w¦¨w¦¨w¯§V§§h—˜g•Šm•Šm‰•Y—˜g–šw´±o§§h•ŠW†‰g‡—x–š‡—˜g¯§V´±o—˜g†‰g–šw‰•Y—˜g…{Wx†huyguyguyg†Š‡‡˜‡i†x‡—xuzvwxWukXMYjWifGJF995OKNVZVWiwWl˜WiwSw©Z¨Õh¹éuÃñh¹éW•ÉWŠ³Z¨Õh¹éh¹éjÁòzÂízÂíˆÃ釽ãzÂíšÆäšÆä”ÃäŽÁÚŽ¬ÌŽÁÚˆ¶ÚŽÁÚŽÁÚšÆäšÆä”Ã䇽ãˆÃ釽ㇽã”ÃäšÆä”Ã䇽ãšÂݤÊâ¨ÅÛ©¶¸ÓgVðWòT'ñT8ëYVêfXèrYìdJòT'óE!óK"óE!óK"óK"òT'êI8ìdJæpræprèrYêfXèrYìdJñT8òT'òT'óK"ðWóK"ðWðWòJ,òT'êfXìdJñT8íWH²SN‰Ä’¾á¨ÅÛ¤Êâ¨ÅÛ·Ê×ÃÍзÊ×’¾á’¾ášÆä¤ÊâšÆäšÆä”ÃäˆÃéˆÃé”ÃäšÆäšÆä”Ã䇽㈶Úw»çˆ¶Úw»ç‡½ãˆÃéˆÃéˆÃéuÃñuÃñuÃñuÃñuÃñjÁòjÁòjÁòd½ïZ¨Õv¤šmÀëmÀëmÀëZ¨ÕZ¨ÕZ†]…q]…qi‡‡KeWYuh]…qv¤šš³’v¤ši‡‡]…qy–—‡˜‡˜¨§©¶¸©¶¸•®²ˆ¦§‰¥—Š¤ˆ¨µ¨š³’š³’š³’—¨–•®²‰¥—v¤šz•yx†h†‰g‡—x•Šm©•o–š‡–šw™¦w‡˜‡‡™—z•‡w‰‡‡˜‡¨¶‡¨¶—‡—xgywwxWx…Xz•ywˆwj„hy…Jy…JhuINf9Nf9Nf9Nf9Nf9huIoˆVoˆVlr9huIhuIgg9wwH…{W‘rM‡ˆX…{W…{W‡‡I‰•Y•ŠW•ŠW†yHghHghH…{WukXe[GhuIhxghvX•Šm–šw§˜W´±o´±o…{WwxWwxWujGghH…{W‡ˆX†yHujGukX–šw¦¨w´±o§§h©•o†‰g‡ˆX—˜g•ŠW•ŠWx…Xx†hwˆwz•‡–š‡˜§ˆˆ–hhvXVYGVYGfjgfjVhxguzvVZV:GFIYVOKNMYj5>hWl˜W•É[´èuÃñ‡½ãuÃñh¹éWŠ³Z¨Õh¹éh¹éh¹émÀëˆÃéŽÁÚ‡½ãˆÃéŽÁÚ”Ãä”ÃäŽÁÚˆ¶Úq¬Ôq¬Ô‡½ãŽÁÚšÂÝšÂÝšÆä”Ã䒾ᇽã”Ãä”ÃäšÆä”Ãä”Ãä”ÃäšÂÝšÂÝ©¶¸ÓgVòT'ëYVïTBíWHê\eæpræpròT'óK"óK"óK"ð=ëH&ëH&òT'ìdJæprèggèrYèrYèrYìdJòT'ñT8òT'óK"óK"óK"óK"óK"òT'òT'ïTBêfXêfXëYV²SN‰ÄšÆä¨ÅÛ¨ÅÛ·Ê×ÃÍзÊרÅÛ’¾á’¾á¤Êâ¤ÊâšÆä”Ãä”ÃäˆÃéšÆä”ÃäšÆäšÆ䇽ㇽãw»çˆ¶Úˆ¶Ú‡½ãšÆä”ÃäˆÃéˆÃéˆÃézÂíuÃñuÃñuÃñjÁòjÁòjÁò[´èZ¨ÕmÀë[´èZ¨Õd½ï[´è[´èZ†j”’i‡‡YuhYuhJgn=eeYuh]…qx”kj”’Yuhi‡‡Zwvi†x†Š‡š³’¨µ¨š³’v¤šv¤šv¤šv¤š•®²•®²˜¨§¨¶—¨µ¨š³’š³’z•y–šw–š‡–šw¦¨w™¥h—˜g¥uuygx†h‡—x†‰gwˆwhvXukX‡—x‡—xj„hwxW†‰g†‰gˆ–hz•yj„hoˆVoˆVoˆVoˆVoˆVQjJy„<oˆVoˆVNf9Nf9Nf9vi8fZ8fZ8UK7e[GUK7UK7gg9‘rM‘rMe[GujG…{WukXe[Ge[GghH—˜g¦©ˆ¦©ˆ–šw†‰g—˜Y§˜W…{WghHwxWukXfjVghHhvXx†huyg†‰g—˜g¦¨w§§h—˜g•Šm…{WukX‡ˆX‡—x™¦w¨µx—˜g‡ˆX‡—x–šwtn‡ˆXx†hghHGH8GH8F<EGJFVZVhuIXgWXgWWifXgWVZVl[iWl˜W•ÉjÁòuÃñˆÃéuÃñh¹éWŠ³W•Éd½ïw»çw»çuÃñzÂízÂ퇽ㇽãˆÃé”Ãä”ÃäˆÃéw»çŽ¬ÌŽÁÚ‡½ãŽÁÚšÆäšÂÝšÆäˆÃ釽ㇽãˆÃé”ÃäšÆäšÂÝ’¾á‡½ãšÂݨÅÛ©¶¸èrYðWïTBìdJìdJêfXèggèrYñT8óK"ëH&ëH&ëH&ëH&óK"ìV:ìdJëYVêfXæpræpræprìdJòT'ðWðWðWóK"ðWóK"ðWóK"óK"ìdJêfXê\eëLE²SN‰Ä¨ÅÛ¨ÅÛ¬Ðá·Ê×ÃÍЬÐá”Ãä’¾ášÆäšÆäšÆäšÆä”ÃäˆÃé”Ãä¤ÊâšÆäšÆä”ÃäˆÃ釽ãw»ç—»Ø’¾á”Ãä”Ãä”ÃäˆÃéˆÃéˆÃéuÃñuÃñuÃñjÁòjÁòjÁòjÁò[´èZ¨ÕmÀëmÀëd½ï[´è[´èv¤šv¤š]…qYuhYuh]…qYuhz•yj”’j”’]…qhxg]…qYuhi†xw‰‡‰¥—˜¨§‡™—j”’j”’z•‡v¤šv¤šµÄ¨µ¨š³’š³’š³’˜§ˆš³’˜§ˆ‡—xz•y–šw¦¨w¨µx¸Ãu¦¨wx”kuyghxghvX†‰gˆ–h†‰g‡˜‡wˆw‡˜‡ˆ–h—˜g‡ˆXˆ–hš³’š³’x”kx”k˜¥Wx”k[tXGH8JU:lr9oˆVNf9Nf9Nf9e[GwxWlWRVYGlWRlWRukX…{WlWRUK7UK7VZVUK7UK7D<5OKNVYGwxW§§h•Šmuyg†‰g†yHujGe[G†‰g´±o¦¨wtnujGwxW—˜gˆ–h‡ˆXukX…{W•ŠWˆ–h–šw–š‡–š‡–šw–š‡¦¨w™¥h•ŠW—˜Y…{WVYGVYGx†htnukXwxWfjggywVZVfjVfjghxgfjVVYGF<E995=d‹Wl˜W•ÉuÃñjÁòuÃñ‡½ãw»çZ¨ÕWŠ³d½ïuÃñw»çjÁòw»çzÂízÂízÂíˆÃé”ÃäˆÃéŽÁÚŽÁÚˆ¶Úˆ¶Úˆ¶Ú”ÃäšÆäšÆäšÆä”ÃäˆÃ釽ãzÂí”Ãä”Ãä”Ãä”Ãä”Ã䗻ظÇË·¹·ìdJòT'ñT8ìdJíWHìdJìdJïTBóK"óE!ð=ð=ëH&ëH&óK"òT'ìV:ìdJëYVèggæprèrYêfXñT8ñT8ðWóK"óK"óK"óK"óK"óK"òT'ìdJìV:íWHÓTM×[h‰ÄšÆä¤Êâ¬Ðá·Ê×ÃÍЬÐáˆÃé’¾ášÆäšÆäšÆä”Ãä”Ãä”Ãä¤Êâ¬Ðá¤ÊâšÆäšÆ䇽㈶ڈ¶Ú’¾á’¾á’¾á”Ãä”ÃäˆÃéˆÃéˆÃéuÃñuÃñˆÃéuÃñjÁòjÁòd½ï[´èmÀëmÀëmÀëmÀëd½ï[´è[´è]…q]…qKeWQjJKeW[tX]…qŠ¤ˆˆ¦§v¤šz•yYuhw‰‡‡˜‡‰¥—˜¨§¨µ¨š³’ˆ¦§y–—wŠ•š³’•®²µÄ¶Ã²¶Ã²•®²v¤š¥uŠ¤ˆz•yz•yuygz•y–šw¨µx¨¶‡–š‡‡˜‡—¨–‡™—†‰gˆ–h˜§ˆ™¦w¦¨w™¦w…Šw[tXWW8ghH—˜gˆ–hoˆVoˆVoˆVQjJQjJNf9Nf9Ze;Nf9Nf9Nf9Nf9oˆVujGujG†yH‘rMukX‡ˆX‡ˆXwxWukXWW8UK7UK7UK7ujG†yH†‰gwxW‡ˆX—˜g•ŠW…{WukXVYGe[GghHghHtn†‰g–šw†Š‡™¦w§§h—˜g‰•Y–šw˜¥W—˜Y…Šwuyg‡ˆX…Šw†‰g™¥h¦¨w—˜g†‰guyge[GghH‡‡IujGUK7GJFWifwˆw…Šwuzv…{WhxgYuhXgWOKNF<EF<EWl˜W•É[´èd½ïjÁòuÃñˆÃéˆÃé[´èW•É[´èzÂízÂímÀëmÀëzÂíŽÁÚzÂ퇽ãŽÁÚˆÃézÂ퇽㈶ڈ¶Úˆ¶Úˆ¶ÚšÆä¤Êâ¤ÊâšÆäšÆä”Ãäw»çˆÃéˆÃéˆÃé”ÃäšÂÝ—»Ø¨ÅÛ¯ª¶ÓgVóK"òT'ìdJïTBñT8òT'òT'ðWóBëH&Ò9(ð=ðWòT'òT'òT'ìV:ìV:íWHêfXïTBìdJñT8òT'ñT8óK"óK"óK"óK"óK"óK"òT'ïTBíWHíWHÓgV²SNŽ¬Ì¤Êâ·Ê×·Ê×·Ê׬ÐᒾᒾášÆä¤Êâ¤Êâ”ÃäˆÃéšÆäšÆä¤Êâ¤Êâ¤ÊâšÆäšÆ䈶Úw»çˆ¶Úˆ¶ÚšÆäˆÃéšÆäšÆäˆÃéˆÃéuÃñuÃñzÂíuÃñuÃñjÁò[´èmÀëZ¨ÕmÀëmÀëmÀëmÀëmÀë[´èv¤š]…q=eeKeW[tX=ee]…qj”’Š¤ˆv¤šŠ¤ˆv¤šŠ¤ˆx”kwˆwwˆw‡˜‡‡˜‡y–—z•‡z•‡i†x‡—x¥uš³’µÄ¨¶—¶Ã²¨µ¨v¤šx”kŠ¤ˆš³’¦©ˆ¦©ˆ˜§ˆ†‰g†Š‡‡™—w‰‡w‰‡—™—¨¶—˜§ˆwˆwuygx†h‡—xx”khvXghHwwH†‰gˆ–hˆ–h¥ux”kx”koˆVy„<Nf9oˆVNf9Nf9Nf9oˆVoˆV‘rMUK7OKNwwH§˜W§˜W†yHWW8OKNUK7UK7D<5R4'e[GwwH—˜Y©•o‘rMfZ8e[G—˜Y•ŠWwxW‰•Y…{WfZ8e[GlWR†‰g©•o§˜W—˜g´±o¨µx´±o…{WwxWx†h¥u¦¨w–šw†‰g—˜g¦¨w—˜g†‰gujGwwHwwHwxWVYGGH8VYGuzvwˆwfjggywuygwˆwz•‡XgWF<EF<E5>hWl˜Sw©W•Éd½ïjÁòˆÃéˆÃéˆÃéq¬ÔW•ÉW•ÉmÀëzÂímÀëzÂ퇽ãzÂízÂízÂíŽÁÚ”ÃäˆÃ釽㈶ڗ»Ø’¾ášÂÝ—»Ø¨ÅÛ¨ÅÛšÂÝšÆäšÆä”Ãä”Ãä”Ãä”ÃäšÆäšÆäšÂÝŽÁÚ©¶¸ìdJòT'ðWìV:ìdJòT'ìV:ðWóBóBðWëH&ð=ëH&òT'ñT8íWHìdJìdJìdJêfXêfXìdJòT'òT'òT'ðWóK"óK"ðWðWóK"ðWñT8ìdJêfX×[h×[h‰Ä¨ÅÛ·Ê׬Ðá·Ê×·Ê׈¶ÚšÆä¤Êâ¨ÅÛ¬Ðá”ÃäˆÃé”ÃäšÆäšÆä¤ÊâšÆäšÆä”Ã䇽㒾ᒾᒾášÆäˆÃéšÆäˆÃéˆÃéˆÃéuÃñuÃñˆÃéuÃñjÁòjÁòd½ï[´èq¬Ôq¬ÔmÀëmÀëmÀëmÀë[´èZ¨ÕZ¨Õ]…qZ†]…q]…q]…q]…qz•yz•yz•y]…qi†x‰¥—v¤šz•‡x”kz•yŠ¤ˆz•‡Yuhi†x‡˜‡‰¥—Š¤ˆ‰¥—š³’•®²š³’š³’š³’š³’Š¤ˆ¥u–šw¨¶‡¨µxš³’˜§ˆ…Šwwˆw‰¥—‰¥—Š¤ˆ‡˜‡x†hx†huzvx†h–šw–šw™¦w‰•YhvXghHNf9oˆV¥uoˆVy„<Nf9Nf9Nf9Nf9Nf9Nf9Nf9†yHfZ8e[GOKNVYG‘rMujGujGujGUK7e[GUK7UK7UK7e[GujG‡ˆX‡‡I…{W•ŠW†yHfZ8fZ8uyg†‰g‡ˆXujGghH•ŠW—˜Y•ŠW†yH‡ˆX¦¨w™¦wˆ–hx…XojouyguygukXfjVukX…{WghHghHx†h¦©ˆ–šwukXZe;hxg†‰gŠ¤ˆ†‰ghvXx”kx†h†‰ghxgJU:GH85+(5>hSw©Sw©Z¨Õd½ïuÃñuÃñuÃñˆÃéw»çZ¨ÕZ¨ÕjÁòmÀëmÀëmÀëmÀëzÂíŽÁÚˆÃé”ÃäˆÃéšÂÝ”ÃäŽÁÚˆ¶ÚšÂÝšÆä’¾ášÂݨÅÛ¬ÐášÆäšÆäˆÃ釽ã”Ãä”Ãä”Ãä”ÃäŽÁÚ¨ÅÛ¯ª¶ìdJêV&òT'ïTBìV:òT'ìV:óK"óBðWðWëH&Ò9(ðWñT8ìV:ìdJê\eêfXèggèggèrYèggïTBòT'òT'óK"òT'ðWóK"ðWðWòT'ñT8ìV:ê\eÓTM×[h‰Ä¬Ðá¤Êâ¬Ðá¬Ðá¤ÊⒾᒾá¤Êâ¤Êâ¤Êâ”Ãä”ÃäšÆä¬Ðá¤Êâ¤Êâ”ÃäˆÃéˆÃ闻ؗ»Ø‡½ã”ÃäšÆäšÆä¤ÊâˆÃéˆÃéˆÃéuÃñuÃñuÃñuÃñjÁòmÀëd½ïZ¨Õq¬ÔmÀëmÀëmÀëmÀëmÀë[´èZ¨ÕZ¨ÕZ†Z†Z†Z†j”’Z†Z†]…qv¤šŠ¤ˆz•yz•yz•‡z•yj„h[tX–šw¨¶—‡˜‡i†xi†xz•‡Š¤ˆŠ¤ˆ‰¥—š³’¨¶—¨µ¨¨µ¨‰¥—z•‡š³’š³’¨¶‡¦©ˆ™¦w¨¶‡˜§ˆ‰¥—‡™—z•‡z•‡š³’¨¶‡¦¨w‡—xx…X‡—xˆ–hx”ky…Jx”koˆV‰•Y˜¥WoˆVoˆVoˆVNf9Nf9Nf9Nf9:F/Nf9Nf9e[GlWR†yHwxWvi8fZ8UK7fZ8ujGWW8UK7WW8WW8UK7UK7WW8fjV…{W†yHwwHghHhuI…Šw–šw§§h†‰g†yHwwH—˜Y—ˆIfZ8ujG—˜g´±o˜¥W‡ˆX…Šw‡ˆX‡ˆXukXuygwxW…{W…{WukXˆ–h¦¨wtnujGe[Guyg˜¨§¨¶—–š‡†‰gwˆwwˆwhvXYeHOKND<5995-12=d‹W•ÉW•É[´èd½ïuÃñuÃñˆÃéˆÃéjÁòZ¨ÕW•É[´èd½ïd½ïmÀëmÀëzÂízÂ퇽ãˆÃé”ÃäšÆä”Ãä”Ã䗻ؚÂÝ—»Ø’¾ášÆäšÂݤÊâšÂÝ”ÃäˆÃéˆÃé”ÃäšÆäˆÃé”ÃäŽÁÚ«¹Ê¸¨¨ìdJìV:ìdJìdJêfXèggñT8òJ,óBðWÒ9(ëH&óBóK"ëH&ïTBêfXæpræprèggæpr⃌æprèrYèrYòT'ðWðWðWóK"ðWðWñT8ìdJìdJæpr×[h²SN—»Ø¤Êâ·Ê׬Ðá·Ê×’¾á’¾ášÆäšÆäšÆäšÆä”Ãä¤Êâ¨ÅÛ¨ÅÛ¬Ðá¤Êâ”Ã䒾ᒾášÂÝ’¾á’¾áˆÃéšÆäˆÃéˆÃéˆÃéˆÃéuÃñuÃñuÃñmÀëjÁòjÁòd½ï[´èZ¨Õq¬ÔmÀëmÀëmÀëmÀëmÀë[´èZ¨ÕZ¨Õj”’]…qj”’v¥®v¤šj”’Z†]…q]…qj”’v¤šv¤šz•y]…q[tX[tXhxgj„hx”ki†xj”’z•‡Š¤ˆš³’¨µ¨š³’š³’v¤šz•yz•yz•‡¨µ¨µÄ¨µ¨¦©ˆ¦©—˜§ˆŠ¤ˆv¤š‡˜‡z•y¥u¥u™¥hx”khvXghHhuIwwHx†h¥u¥ux”koˆVoˆVoˆVoˆVNf9oˆVoˆVoˆVNf9Nf9Nf9Nf9ujGUK7fZ8ujGe[GUK7D:+GJFe[Ge[Ge[Ggg9wv;vi8ujGgg9ujGghHWW8ujG‡ˆXˆ–h—˜YukX…{WukXUK7e[GujGujGuyg–šw¦¨w§§h—˜g¦©ˆ¦¨w—˜g˜§ˆ–šwˆ–hˆ–h…{W†‰gˆ–h†‰ge[GGH8lWRx†h‡˜‡…Šw–šw†‰g˜§ˆ…ŠwVYGGH8VYGD<5D<5IYV5>hWl˜Sw©W•É[´è[´èuÃñuÃñuÃñuÃñw»çZ¨ÕW•É[´è[´èjÁòzÂíw»çzÂíˆÃéw»ç‡½ãŽÁÚšÆäšÆäšÆäŽÁÚŽÁÚšÂÝŽÁÚšÂÝ—»ØšÆäšÆä”ÃäˆÃ釽ã”Ãä”Ãä”Ãä”Ãä’¾ášÂݸ¨¨ìdJêV&ìdJíWHêfXëYVñT8óE!óE!óBóK"óBëH&óK"òT'íWHïTBæpr⃌æprèggègg⃌⃌èrYìdJðWðWòT'ðWðWóK"òT'ïTBìdJêfX×[h“UV—»Ø¨ÅÛ¤Êâ¬Ðá¨ÅÛˆ¶Ú‡½ãšÆä¤ÊâšÆäšÆäˆÃé¤Êâ¤Êâ¨ÅÛ¤Êâ¤ÊâšÆ䒾ሶڗ»Ø—»Ø’¾ášÆäšÆä”Ãä”Ãä”ÃäˆÃéˆÃéuÃñˆÃéˆÃéuÃñjÁòjÁò[´èZ¨Õˆ¶Úw»çmÀëmÀëmÀëjÁòmÀëmÀëZ¨Õj”’Z†Zwv]…qj”’v¤šv¤šj”’Z†]…qv¤š‰¥—v¤šj”’i†x]…qwˆw]…q]…qz•yx”k‰¥—¨µ¨–š‡‡—x‡˜‡z•‡Š¤ˆ‰¥—ˆ¦§‡™—‡˜‡¦©ˆ¨¶‡¦©ˆ˜§ˆ‡˜‡i†xuygx”k‡—xx”k¥u˜§ˆ™¦wx”kYeHhvXx†hx”k¥ux”koˆV[tXhuIoˆV˜¥WoˆVNf9y„<oˆVQjJNf9y„<oˆVVZVUK7lWRe[GWW8UK7VYGfjVwwH†yH‡ˆX‡‡IwwHfZ8GJFD<5VYGujGwxWwwH‰•Y˜¥WwwHVYGghHuyg‡ˆX†yHy…J‡ˆXwxWwwH†‰g†‰gˆ–h´±o©•o˜§ˆ–šw†‰g—˜Y—˜g‰•Yˆ–huygwxWukXfjg‡˜‡†‰gVYGUK7ukX†‰guygYeHGJFGH8GH8D<5OKN5>hMYjSw©W•ÉSw©[´èh¹éˆÃéuÃñˆÃéuÃñw»çh¹éWŠ³W•Éd½ïjÁòuÃñuÃñmÀ뇽ㇽãzÂíˆÃéˆÃéšÂÝšÂ݈Ã鈶ښÂÝšÂÝ—»ØšÂݤÊâ¤ÊâšÆä”Ãä”Ã䇽ã”ÃäˆÃéˆÃ闻ؗ»Øű®ìdJìdJèrYìdJïTBìdJìdJóK"óK"óK"óK"óBìV:íWHìV:ëYVìdJêfXÕwŒãvˆæprãvˆâƒŒèrYñT8òT'òT'ðWóK"óK"óK"óK"òT'òT'ìdJègg×[h“UVˆ¶Ú¤Êâ¬Ðá¬Ðᒾሶڒ¾ášÆä¤Êâ¤Êâ”Ãä”ÃäšÆä¤Êâ¨ÅÛšÆäšÆ䒾ᒾᇽ㈶ڒ¾á”ÃäšÆä¤Êâ¤ÊâšÆäšÆäšÆäˆÃéˆÃéuÃñˆÃéuÃñjÁò[´èW•ÉZ¨Õq¬Ôw»çuÃñmÀëmÀëjÁòmÀëmÀëv¤š]…qKeW=eeIWGKeWJgnJgni‡‡v¤šv¥®v¤šv¤š•®²v¤šv¥®v¤šv¤šv¤šz•yz•‡z•y¥u—¨–˜§ˆ¦©ˆš³’Š¤ˆŠ¤ˆx”kx”kx†h–šw˜§ˆz•‡‡˜‡z•‡i†xi†xx”k¥uŠ¤ˆ˜§ˆ˜§ˆ¥uz•ywˆwx†hx”k¥u‡—xx†hx”kz•yoˆVy„<y…JoˆVNf9Nf9Nf9oˆVoˆVQjJNf9Nf9uyge[GwxW‡ˆXukXfjVuyg†‰g‡‡I†yHy…JhuIUK7D:+UK7lWRghHfZ8fZ8ujGvi8ujG‡ˆXwxW…{W®’K‡ˆXe[Gvi8y…J†yHgg9wxW§§h•ŠWukXukXuyg–šw–šw¦¨w¸Ãu¨µx§˜Wˆ–h¥uz•y‡—x˜§ˆfjVfjV‡—x˜§ˆ‡˜‡uyghvXhxgfjV995995-12-1239IWl˜W•ÉW•É[´è‡½ãuÃñuÃñuÃñˆÃ釽ãq¬ÔW•ÉW•Éh¹éjÁòw»çh¹ézÂíˆÃéˆÃéw»çˆÃéˆÃéšÂÝšÆäŽÁÚˆ¶Ú—»ØšÂÝšÂݨÅÛ¬Ðá¬ÐášÆäšÆäšÆä”Ãä’¾á”ÃäšÆ䒾᫹Êű®ëLEìV:èggêfXêfXìdJòT'óK"óE!óK"óBóBòT'ñT8ïTBïTBêfXæpr⃌æpræpræprìdJñT8òT'òT'òT'òT'ðWðWóK"ðWòT'ìdJèrYæpr×[hŸx‡’¾á¨ÅÛ¨ÅÛ¨ÅÛ‡½ã’¾ášÆä¤ÊâšÆä¤ÊâšÆäšÆä¤Êâ¤Êâ¤Êâ¤ÊⒾᒾᒾሶڈ¶Ú’¾ášÆä”ÃäšÆäšÆäšÆäˆÃéˆÃéˆÃéuÃñuÃñuÃñuÃñuÃñ[´èWŠ³q¬ÔmÀëzÂíuÃñuÃñjÁòjÁò[´èZ¨Õ]…q]…qNf9;F8:F/Nf9:F/IWGhxg‰¥—•®²v¤ši†xŠ¤ˆŠ¤ˆi†xi‡‡hˆ–v¤šv¤šz•‡z•‡¥u™¦wx”kz•yz•y‰¥—‰¥—x”khxghvXi†x˜§ˆ¨µ¨š³’¨¶—¨µ¨‰¥——¨–‰¥—z•y‡—xz•y‡—xŠ¤ˆš³’š³’Š¤ˆz•yYuhQjJoˆVj„hoˆVoˆVoˆVhuINf9oˆVQjJoˆVoˆVoˆVNf9Nf9ghHVYGVYGhuI‰•YukXfjV‡—x‡—xx…X‡ˆX‡ˆXlWRUK7VYGUK7GH8GH8GF-GH8YeHhxghvXujGvi8vi8ujGuyg—˜Y—˜Y’•I†yHvi8ujGGF-ghHˆ–h™¦w™¦w¦¨w¨¶‡·²·²–šw†‰g–šw—˜Y†‰g–šwx†h˜§ˆ–šw•Šm˜§ˆ–š‡–š‡–šwghHVZVGH8-12-125>hWl˜W•ÉW•Éh¹éh¹éuÃñuÃñuÃñuÃñ‡½ãw»çZ¨ÕW•É[´èh¹ézÂíuÃñzÂ퇽ㇽãˆÃéˆÃé”Ãä”ÃäšÂÝšÆäˆÃ闻ؚÂݤÊâ¬Ðá·Ê׬Ðá¤ÊâˆÃéšÆäˆÃé”ÃäˆÃé”Ã䗻ؗ»ØÍ”¨ìdJìdJèggêfXìdJïTBòT'óK"óK"óK"óK"óK"ëH&óK"ïTBê\eêfXègg⃌⃌⃌æprèrYìdJìdJòT'ðWðWóK"óK"ñT8òT'òT'òT'èggæpr×[hŸx‡’¾á¨ÅÛ¨ÅÛšÆ䇽㒾ášÆäšÆäšÆä’¾ášÆä¤Êâ¨ÅÛ·ÊפÊâ¤ÊⒾᒾᒾሶڇ½ã’¾á’¾ášÆäšÆäšÆä”ÃäšÆäˆÃéˆÃéˆÃéuÃñuÃñuÃñuÃñmÀëZ¨ÕZ¨Õh¹émÀëuÃñuÃñmÀëjÁò[´èZ¨Õv¤š]…qYuhKeWJU:IWG;F8Nf9[tXj„h¥uŠ¤ˆZwv[tX]…qi†x]…qi‡‡v¤šˆ¦§ˆ¦§‰¥—‰¥—‰¥—‰¥—š³’š³’‰¥—¨µ¨¨¶—™¦wz•‡wˆwŠ¤ˆš³’Š¤ˆx”kj„huzv†‰gx”khvXhxgwˆwš³’¨¶—‰¥—z•‡hxgfjVx…Xˆ–hx”kx…XoˆVx”koˆVoˆVy„<Nf9oˆVNf9QjJ]…qoˆVNf9hvXhvXe[Ge[GukX†yHukXghHwwH‰•Y‡ˆXwwHoQ/WW8huIwwHujGJU:GF-GF-gg9‡ˆXgg9ujGujGghHfZ8e[GujG—˜g§§hujGghHghHVYGe[G‡‡IwxW‡ˆX™¦w¦©ˆ–šw…Šw…Šw‡—x‡ˆX…{W‡˜‡¦©ˆ™¥h§˜W•ŠW–šw˜§ˆ†‰g†‰glWRVYGOKND<5995-125>hSw©W•ÉW•É[´è[´èd½ïd½ïd½ïuÃñzÂíŽÁÚq¬ÔWŠ³W•Éh¹éh¹é‡½ãw»çzÂí”ÃäˆÃéŽÁÚ”ÃäšÆä”Ãä”Ãä”ÃäŽÁÚ¤Êâ¤Êâ¨ÅÛ·Ê×·ÊפÊâšÆä”Ãä”ÃäšÆäˆÃéˆÃé’¾á¨ÅÛÍ”¨ïTBñT8èrYìdJíWHñT8óK"óK"óK"óBóE!óK"òT'ñT8ïTBëYVêfXÕwŒÅ±®Í”¨âƒŒãvˆâƒŒèrYìdJñT8òT'ñT8ðWêV&òT'òT'òT'òT'ñK6íWHÓTMÕwŒ—»Ø¨ÅÛ·Ê×’¾áˆ¶Ú’¾ášÆä’¾áˆÃéˆÃé’¾ášÆä¤Êâ·Ê׬ÐášÆä’¾á¨ÅÛ’¾áˆ¶ÚˆÃé”ÃäšÆäšÆäšÆäšÆäˆÃéšÆäšÆäˆÃéuÃñuÃñzÂízÂímÀëZ¨ÕZ¨Õh¹éw»çmÀëmÀëuÃñmÀëjÁò[´èZ¨Õv¤š]…qQjJQjJQjJQjJIWGQjJ]…q]…q]…q]…q]…qYuhi‡‡x”k‰¥—v¤šz•y‰¥—¨µ¨¨µ¨‰¥—Š¤ˆŠ¤ˆ‡™—z•‡v¤š˜§ˆ¨¶—Š¤ˆ—¨–¨¶—¨¶—š³’‡—x]…qgywVZVwxW…Šw†‰g˜§ˆ¨¶—¦©ˆx”kj„hhxgfjVhuIˆ–hˆ–h¥ux”koˆV[tXx”k¥uoˆVNf9Nf9oˆVoˆVoˆVNf9oˆVwwH—˜gwwHUK7UK7WW8UK7e[GhuI‡‡I…{WghHUK7UL-GF-UK7WW8Ze;Ze;UK7WW8lr9ujGujGe[GhuIfjVujG‰•Y¯§V¯§VwwHgg9ghHuyguyg–šw¥uš³’˜§ˆš³’–šw–šw–šw…{WVYGghH‡ˆX‡ˆXx…XhvXj„h‡—x‡ˆXwxWe[GGH8IWGGJFIYV39I39I=d‹W•ÉW•ÉW•É[´è[´èd½ïd½ïuÃñjÁòuÃñw»çq¬ÔWŠ³W•Éw»çmÀëw»çˆÃ釽ãw»ç‡½ãˆÃé”Ãä”Ãä¤ÊâšÆäˆÃ鈶ښÂݨÅÛ·Ê×·Ê×·Ê×·ÊפÊâˆÃéˆÃéˆÃéˆÃé”Ã䒾᫹ÊÍ’ìdJìdJèrYìdJëYVñT8òT'óE!óK"óK"óBóE!óE!ñT8íWHíWHèggãvˆÅ±®Í”¨ãvˆâƒŒâƒŒèrYèrYìdJñT8òT'ðWðWðWòT'ñT8ìdJñT8ëLEÓTMŸx‡—»Ø¨ÅÛ¨ÅÛˆ¶Ú’¾ášÆä’¾áˆÃé”Ã䇽ㇽã”Ãä·ÊפÊâ¨ÅÛšÆä¨ÅÛ’¾á—»Øˆ¶Ú”ÃäšÆäšÆäšÆä¤ÊâšÆäšÆäˆÃéˆÃéˆÃéˆÃéˆÃézÂíuÃñq¬ÔZ¨Õq¬ÔmÀëw»çw»çuÃñuÃñuÃñmÀë[´è[´è]…q=ee=ee]…q[tX]…qj„hYuhKeWYuh]…qi‡‡v¤šj”’v¤š‰¥——¨–z•‡v¤šŠ¤ˆ¨¶—¨¶—˜§ˆ‰¥—z•yš³’š³’‰¥—z•‡‡˜‡‡™——¨–¦©—š³’¨µ¨ˆ¦§‡™—‡™—wˆwx†h…ŠwwxWwxW™¥h™¦wˆ–hx…XhuIhuIghHhvX¥u¦©ˆ˜§ˆz•yoˆVoˆVx”koˆVoˆVoˆVoˆVoˆVNf9Nf9oˆVWW8WW8UK7GJFD<5D:+D:+GH8e[GghHwwH’•IP,UL-5+(5+(5+(86+WW8‰•Y…{WwxWYeHghH…{W…{W•Šm•Šm‡ˆXwwH‡‡I‡ˆXhuIYeHx†h‡—x¨¶‡¦©ˆ¨µx´±o©•o‡ˆXukXghH‡ˆX•Šm•Šm™¥hˆ–hwxWhxgoˆVhvXYeHYeHGH886+995995GH8GJF:QlWl˜Z¨ÕW•ÉW•É[´è[´èjÁòuÃñuÃñzÂízÂízÂíw»çq¬ÔWŠ³q¬Ôw»ç‡½ãˆÃéˆÃé”ÃäˆÃé”Ãä”Ãä”Ãä¤Êâ¤ÊâšÆ䇽ãŽÁÚ¨ÅÛ¨ÅÛ¨ÅÛ·Ê׬Ðá¤ÊâšÆä”ÃäšÆä”ÃäšÆ䒾᫹ÊÍ’ïTBñT8êfXëYVïTBòT'òT'óK"óK"óE!óE!óE!óK"ñT8íWHêfXæpræpr⃌͔¨ãvˆæprèrYèrYèrYìdJìdJñT8ðWðWÙm"ðWðWòT'ìdJìdJ×[h±sp¨ÅÛšÆä¤Ê⇽㒾á”Ãä”ÃäˆÃé”Ãä”Ãä”Ãä¤Êâ·Ê×·ÊךÆä¨ÅÛ’¾á—»Øˆ¶Ú’¾á”ÃäšÆäšÆäšÆäšÆäˆÃéˆÃéšÆäˆÃéˆÃéˆÃéˆÃézÂíuÃñq¬Ôq¬ÔˆÃézÂímÀëmÀëuÃñuÃñjÁòmÀë[´èZ¨Õj”’]…q[tX=eeYuh[tXz•yi†x]…q]…qz•yz•‡Š¤ˆi†x]…qz•yš³’Š¤ˆv¤š‰¥—‰¥—Š¤ˆ‡˜‡z•ywˆwx”kz•yz•‡…Šw˜§ˆ™¦wx†hhvX[tXYuhi†xz•yw‰‡wŠ•z•‡–šw‡—xx†h†‰g¥uj„hj„hhvXhuI[tXYeHYeHghHhuIYeHNf9Nf9Nf9oˆVoˆVx”koˆV]…qoˆVoˆVNf9WW8fZ8fZ8UK7e[GUK7GF-86+D:+UL-UK7fZ8vi8oQ/UK7D<5GH8GF-YeHujGwwH†yHujGwwH‰•Y‡ˆX—˜Y—˜Y‡ˆXujG‰•Y™¥h‰•YWW8fZ8y…JwxWfjVe[GwxW‡ˆX†‰gwˆw¦¨w¦¨w§§h—˜Y†‰gwxWuyg…Šw–šwuzvghHujGGH8GH8D<599586+995:QlSw©[´è[´èW•ÉZ¨Õ[´èd½ïuÃñuÃñˆÃéˆÃéˆÃéŽÁÚw»çn˜ÇWŠ³w»çw»çzÂíˆÃéšÆäˆÃéˆÃéšÆäšÆä¤Êâ¤Êâ¤ÊâŽÁÚ—»Ø¨ÅÛ¨ÅÛ·Ê×·Ê×·Ê׬ÐášÆä”ÃäˆÃéˆÃ釽㗻ث¹Ê⃌ñT8ñT8íWHïTBìdJìdJðWóK"óBóBóK"óE!óK"ñK6íWHëYVãvˆæprãvˆãvˆãvˆæpr⃌èrYÙ«9ìdJðWðWñT8Ùm"ðWðWðWðWìV:ìdJê\eŸx‡¨ÅÛ¨ÅÛ¨ÅÛˆ¶Ú’¾ášÆä”Ãä”Ãä”Ãä”Ãä¨ÅÛ¬Ðá·ÊרÅÛ¨ÅÛ¨ÅÛ’¾áˆ¶Úˆ¶Ú’¾ášÆäšÆäšÆäˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéuÃñmÀëh¹éq¬Ôq¬ÔˆÃézÂíˆÃézÂímÀëjÁòjÁòjÁòd½ïv¤š]…q[tXQjJ:OQNf9Nf9[tX[tXYuh[tXWifWifWifi‡‡j”’x”kŠ¤ˆx”koˆVj„hYuh[tXhvXz•yŠ¤ˆ˜¨§‡˜‡hxguyg‡—xŠ¤ˆ‡˜‡–š‡‡—xj„h[tXhxgj„hwˆwuygfjVYeHVYGwxWx†hx”kz•yoˆVQjJYeHhuIhuIoˆVhuIlr9oˆV¥ux”koˆVoˆVNf9oˆVNf9Nf9oˆVoˆVfZ8fZ8e[GR4'D<5GH8GH8GH8UL-Ze;fZ8ghHe[GghHy…Jx…XwxWujGgg9wwHukXhuIujG‡‡I‡‡IwxWwxWfjVfjVghH‡‡I‡ˆX†yHgg9ujGvi8ujGVYGfjV‡‡I§§hx…X†‰gx…XukXfjVwxWhvXuyg‡˜‡‡—xfjVOKNwwH†‰ge[GIWGGH886+86+39I5>hW•Éh¹é[´èW•ÉW•É[´èjÁòuÃñuÃñˆÃéšÆä”ÃäŽÁÚq¬ÔZ¨ÕWŠ³zÂízÂíw»çˆÃéˆÃéšÆäšÆäšÆä”Ãä¤ÊâšÂÝšÆ䒾ᒾášÂÝ·Ê×·Ê×·Ê×·Ê×·ÊפÊâ’¾áˆÃéˆÃ钾ሶگª¶ÕwŒëYVíWHìdJìdJíWHñT8óK"óK"óBóBóK"óBóE!óK"ëLEê\e×[h×[hãvˆãvˆãvˆãvˆâƒŒæprèrYèrYòT'ðWðWÙm"ðWðW׎ðWìdJëYVëYV±sp—»ØšÆ䇽㈶ڇ½ã”Ãä”ÃäšÆä”Ãä”Ãä·Ê×·Ê×·ÊפÊâšÆäšÆ䗻ؒ¾á’¾á”ÃäšÆäšÆäšÆä”ÃäˆÃéˆÃéˆÃéˆÃéˆÃéuÃñuÃñuÃñmÀën˜Çˆ¶Úˆ¶ÚˆÃéˆÃéˆÃéuÃñuÃñuÃñjÁòuÃñmÀëv¤š]…q[tXKeWQjJ[tXKeW[tX]…q[tXQjJJU:IWGKeW[tXz•y‡˜‡š³’j”’]…qi†xj„h[tX[tXYuhi†xz•‡i‡‡z•y‡˜‡Š¤ˆz•‡z•y‡˜‡‡˜‡¥uz•‡z•yz•ywˆwx†hhvXhuIhvXj„h]…qz•yz•yhxgNf9YeHhuIYeHghHoˆVoˆVhuIhvXx”koˆVoˆVoˆVoˆVoˆVoˆVNf9oˆV…{WujGukXghHwwHghHghHYeHIWGXgWuyg†‰g…{WwxWwwHe[GghHhuIwxWwwHghHfZ8fZ8oQ/UK7GJFhxg–š‡™¦w†‰gwxWwwH‡ˆX‡‡I‡ˆXy…Jx…XwxW†‰g˜§ˆ—¨–˜¨§¦©ˆ¦©ˆ˜§ˆx†hwˆwz•‡‡˜‡uzvˆ–hfjVD<5fjV…ŠwhvXWW8GH8:F/995F<E5>hW•Éh¹é[´èW•ÉW•É[´èjÁòuÃñˆÃéˆÃéˆÃéšÆäˆÃ鈶Úq¬ÔWŠ³Z¨ÕmÀëh¹ézÂíˆÃéˆÃé”Ãä”ÃäšÆäšÆäšÆäŽÁÚšÂÝšÂÝ—»Ø·Ê×·Ê×·Ê×·ÊרÅÛšÆäšÆäˆÃ釽ㇽ㈶ګ¹ÊÕwŒìdJëYVñT8êfXïTBñT8òT'óK"óK"óK"óK"óBóK"òJ,ëLEê\eÕwŒÕwŒ×[hãvˆãvˆê\eèrYèrYìdJèrYìdJêV&Ùm"ðWðWðWðWòT'ñT8ìV:ÓTMÕwŒ¨ÅÛ—»Øˆ¶Úˆ¶Ú’¾ášÆ䇽ã”Ãä”Ãä¤Êâ·Ê×ÃÍзÊפÊâ¨ÅÛ¨ÅÛ’¾áˆ¶Ú‡½ã’¾ášÆä’¾áˆÃéšÆäˆÃéˆÃéˆÃéˆÃéˆÃéuÃñˆÃéd½ïZ¨ÕWŠ³q¬Ôq¬ÔˆÃéˆÃéˆÃéuÃñuÃñuÃñjÁòˆÃémÀëZ¨ÕZ†]…qKeWKeWYuh[tXQjJKeW[tX]…qhvX[tXj„hhxgYuhz•yš³’•®²˜¨§ˆ¦§y–—z•‡¦©—¨µ¨‰¥—z•yŠ¤ˆ˜§ˆ¨¶—š³’‰¥—z•‡Š¤ˆš³’‰¥—Š¤ˆ¥uj„hx†hz•y‡—xŠ¤ˆš³’‰¥—‰¥—Š¤ˆhvX[tXQjJYeHhuIZe;huIhvXoˆVQjJNf9Ze;Nf9Nf9oˆVoˆVoˆVNf9Nf9Nf9•ŠWujGe[GujGwxWwxWwwHx…Xy…J…{Wvi8ujGWW8WW8JU:fZ8Ze;y…J§§h—ˆI†yHvi8vi8ghHUK7e[GwxWukXe[G†‰g—˜gwwHwwHwwHy…JfjVfjVhvXx†h‰¥——™—†Š‡–šw¦¨w¦¨w†‰guygXgWfjgx†h…ŠwD<55+(GJFGH8UK7D<5VZVghHMYj39I:Ql[´èh¹é[´èZ¨ÕW•É[´èw»çzÂíˆÃéˆÃéšÆäˆÃéˆÃéˆÃéq¬ÔWŠ³W•ÉzÂíw»çzÂíŽÁÚ”Ãä”ÃäšÆäšÆäšÂÝšÆäšÂÝšÂÝ—»Ø—»Ø¨ÅÛ·Ê×ÃÍзÊ׬ÐášÂÝšÆä”ÃäˆÃ釽㒾ᯪ¶æprèggìdJïTBêfXïTBïTBòT'óE!óE!óE!óBóBóK"òJ,ëLEê\eÕwŒÕwŒÕwŒÍ”¨Í”¨ãvˆæprìdJñT8ìdJìV:ðWðWðWðWðWðWòT'ïTBìdJê\eŸx‡—»Ø¨ÅÛˆ¶Úˆ¶Ú’¾á”ÃäšÆä’¾ášÆä¨ÅÛ·Ê×ÃÍзÊרÅÛ¨ÅÛ—»Ø’¾á‡½ã’¾ášÆä”ÃäšÆä”ÃäˆÃéˆÃé”ÃäˆÃéˆÃéˆÃéuÃñˆÃéd½ïW•ÉW•Éq¬Ôw»çuÃñˆÃéˆÃéˆÃézÂíuÃñuÃñuÃñmÀëWŠ³YuhQjJJU:JU:Nf9QjJKeWNf9;F8QjJQjJ:GFKeWi†xŠ¤ˆv¤šš³’v¤šv¤šj”’ˆ¦§‰¥—Š¤ˆš³’¶Ã²š³’‡˜‡‰¥—‰¥—š³’š³’v¤š‡—x‡—xz•‡w‰‡z•‡‰¥—Š¤ˆ‰¥—Š¤ˆŠ¤ˆz•yx”kj„h[tX[tXj„hoˆVQjJ[tXoˆVhxghuIhuINf9Nf9YeHoˆVoˆVx”kv¤š]…qNf9Nf9]…q‘rMŽr6Žr6wwHwwH…{W†‰g†‰gwwHfZ8WW8UK7UK7Ze;GF-86+UL-fZ8e[GUK7WW8wxWˆ–hwwHUK7GJFVYGYeHUK7hvXghHghHx…X§§h¦¨wx”kwˆww‰‡gywfjVe[GghH†‰gx†h˜§ˆ‡—xojoVYGVYGi‡‡OKN86+JU:UK7ghHujGfjVwxWfjgl[i5>h:QlW•É[´è[´èZ¨ÕW•ÉZ¨Õh¹éuÃñˆÃé”ÃäˆÃéˆÃéˆÃéˆÃé‰Än˜Ço®q¬Ô‡½ãzÂíˆÃé”ÃäšÆäšÆäšÂÝ”Ãä¤Êâ¨ÅÛšÆäšÂÝ—»Ø¨ÅÛ·Ê×ÃÍÐÃÍзÊךÆä”Ãä”Ã䒾ᇽ㗻دª¶ãvˆâƒŒèrYìdJêfXïTBòT'óK"óE!óE!óE!óBóBóE!òJ,ëLEê\eÕwŒÍ”¨Í”¨«¹ÊÍ”¨ÕwŒìdJèrYèrYñT8êV&óK"ðWìV:òT'óK"òT'ðWìV:ê\eëYVÕwŒ’¾á¨ÅÛ‡½ã‡½ã’¾áˆÃ钾ᒾá¨ÅÛ·Ê×·Ê×·ÊרÅÛ·ÊרÅÛ—»Ø’¾á”ÃäšÆäšÆä”Ãä”ÃäšÆäšÆäˆÃéˆÃ釽ãzÂíˆÃéˆÃézÂí[´èW•Éq¬Ôq¬ÔŽÁÚˆÃéˆÃéˆÃéuÃñuÃñmÀëmÀëmÀëd½ïv¤š=eeNf9IWG:OQJgn]…q]…qYuhQjJ:GFKeWi†xy–—‰¥—š³’¨¶—¨µ¨ˆ¦§z•‡]…qi†x]…qhxgj„hx†h™¦wµÄ˜¨§‰¥—š³’Š¤ˆz•yi†xi†xj„hZwvhxgy–—y–—‡˜‡¥u¥uoˆVoˆVoˆVhvXj„h¥uŠ¤ˆ]…qj„h¥uš³’x”k[tXVYGZe;YeHQjJoˆV]…qoˆVoˆVoˆVoˆVoˆV‘rM‘rM‘rM—ˆI‘rM•ŠW‡ˆX¥u†‰gujGhuIfjVUK7UL-GF-GH8GH8GJFGH8UL-huI†‰g•ŠWwwHfZ8D<5F<EUK7VYGWW8GH8VYGy…J§§h™¥hˆ–huyg[tXghHe[G‡‡IwxWukXukXukXuyg™¦w†‰g†‰glWR995VYGUK7ghHwxWVYGVZV[tXfjgVYG-125>hW•É[´è[´è[´èW•ÉW•Éw»çh¹éw»çˆÃéˆÃéˆÃéšÆ䇽ãq¬Ôv¥®o®n˜Çw»çˆÃéˆÃéšÂݨÅÛ¤ÊâšÆäšÂÝšÆä¤Êâ¤ÊâšÂÝ—»Ø—»Ø·Ê×ÃÍÐÃÍÐÃÍЬÐášÆ䇽ㇽã”Ãä’¾áüÃæprèrYñT8ìdJìdJìdJñT8òJ,óK"óE!óE!óE!ð=ì=&ëLEê\eê\eÕwŒÍ”¨Í”¨«¹ÊÍ”¨ÕwŒìdJïTBìdJñT8ðWóK"óK"ìV:óK"óK"óK"óK"òT'ïTBÓTM±sp¨ÅÛ¨ÅÛˆ¶Ú‡½ã‡½ã‡½ã‡½ã’¾á¨ÅÛ·Ê×·Ê×·Ê×·ÊרÅÛ—»Ø—»Ø’¾á’¾ášÆäšÆä”ÃäˆÃéšÆäšÆäˆÃéˆÃéˆÃéˆÃézÂíˆÃéw»çn˜Çq¬Ôq¬Ôw»çw»çˆÃéˆÃéˆÃéˆÃéuÃñjÁòmÀëw»çh¹év¤šZ†=ee;F8IWGi†x]…q[tXQjJIWG:GFIWGKeWi‡‡‡˜‡—¨–—¨–—¨–‰¥—Š¤ˆv¤š‰¥—z•‡z•yx”kj„hoˆV™¦w¨¶—˜§ˆŠ¤ˆz•yz•ywˆwwˆwwˆwi†x]…quyg˜§ˆ—¨–‡—xx”kx”kj„hhxghvXhvXhvXoˆV‡—xx”koˆVhvX[tXYeHQjJoˆV]…q]…qoˆVoˆVoˆVNf9oˆVx”koˆV‘rM•Šm•Šm…{WukXukXukXukXe[GOKNYeHwxW‡ˆXwxWujGghHwwHghHWW8GF-UK7gg9vi8Žr6Žr6D<5IYVOKNGH8GH8VYGfjVx†h§§h—˜gwxWhuIy…JwxWwwHfZ8e[GfjVIYVfjg–šw¨µx—˜gwwHIWGUK7VYGOKNghHfjguygfjVVYGGH899539I=d‹Z¨Õ[´èd½ïd½ïW•ÉW•Éd½ïh¹éh¹éˆÃéˆÃéˆÃéšÆäˆÃéq¬Ôn˜ÇWŠ³W•Éw»çŽÁÚ‡½ã”Ãä¤Êâ¨ÅÛšÂݨÅÛ¤ÊâšÆä¤ÊâšÆ䒾ᗻطÊ×ÃÍÐÃÍÐÃÍЬÐá¤Ê⇽ㇽ㒾ሶگª¶ãvˆìdJìdJïTBïTBìdJïTBòJ,óK"óE!óE!óE!ì=&ì=&ì=&ëLEê\eÕwŒÕwŒÍ”¨Ã¼ÃÍ”¨ÕwŒæprèggìdJìdJòT'óK"ðWñT8ñT8óK"óK"óK"òT'ñT8ëLEÕwŒ’¾á’¾áq¬Ôˆ¶Ú‡½ã‡½ã’¾ášÆä¨ÅÛ·Ê×ü÷ÊרÅÛ¨ÅÛ¨ÅÛ’¾á’¾á¨ÅÛšÆäšÆä¤ÊâšÆäšÆäšÆäˆÃé”ÃäˆÃéˆÃéˆÃéw»çZ¨ÕW•Év¥®q¬Ôw»çˆÃéˆÃéˆÃéˆÃéˆÃézÂíd½ï[´èmÀëh¹éZ†QjJQjJKeWQjJQjJIWGNf9[tX]…qYuhKeWKeWj„hz•‡z•‡i‡‡i†xz•‡Š¤ˆ¨µ¨ˆ¦§v¤š‰¥—‰¥—z•‡wˆwhvXx†h‡—x‡—xz•‡i†xwˆwz•y‡—xj„hx”kˆ–hš³’˜§ˆj„hhuIXgWXgWVYGfjVhxgx”kx”kx†h[tX[tXQjJhvX[tXQjJx”koˆV[tXhuINf9huINf9]…qoˆVx”ktn•Šm•ŠW…{W…{W…{Wtn•ŠW…{We[GfZ8lr9wv;†yHfZ8UK7Ze;D:+5+(5+(D:+wv;Žr6UL-UL-YeHhvXfjgVZVVYGYeHwxW†‰gwwHy…JwwH‘ˆ;‡ˆXe[GGF-WW8gg9VZVojox†h•Šm‡ˆXwwHx…Xe[GD<5GF-D<5OKNVZVfjgfjVfjVGJF:OQ5>h5>hW•É[´èd½ïZ¨ÕSw©Sw©q¬Ôh¹éuÃñuÃñuÃñˆÃéšÆä”Ã䈶Ún˜Ç‰ÄWŠ³q¬Ô‡½ã”ÃäˆÃéšÆä¬Ðá¬Ðá¬Ðá¤Êâ¤ÊâšÆäšÂÝ—»Øˆ¶Ú¨ÅÛÃÍÐÃÍÐÃÍЬÐášÆ䇽ㇽ㒾ሶگª¶ãvˆâƒŒèrYèrYèggêfXñT8óK"óE!óBóE!óE!óE!ëLEëLEê\e×[hÕwŒÍ”¨Í”¨Í”¨Í”¨Í”¨æprèrYêfXñT8óK"óK"óK"êV&òT'ðWóK"ðWòJ,ñK6êI8Ÿx‡šÆ䒾ሶڇ½ã‡½ã’¾á’¾á¨ÅÛ¨ÅÛÃÍÐÃÍзÊרÅÛ¨ÅÛ—»Ø—»Ø’¾ášÆäšÆä¨ÅÛ¤ÊâšÆä’¾ášÆäˆÃ釽ãˆÃéˆÃ釽ãh¹én˜Çn˜Çq¬Ôq¬ÔšÂÝ”ÃäˆÃézÂíuÃñuÃñzÂíd½ïd½ï[´èZ¨Õ]…q=ee=eeKeWKeWKeWNf9[tX]…qj”’]…qWifi‡‡‡˜‡—¨–i‡‡YuhYuh]…qi†xx”kj„hi†x‰¥—ˆ¦§¨µ¨š³’z•yz•ywˆw‡—x˜§ˆš³’Š¤ˆj„hx†h‡—x‡—xx†hoˆVx”k‡—xx†hj„hx†hx†h‡—x¥ux”kj„hoˆVQjJhvXoˆVhvXoˆVhuIoˆVoˆVQjJNf9QjJQjJQjJ[tXoˆV¥u¦©ˆ©•o–šwtnwxW…{WwxW…{W•ŠW‡‡IujGujGfZ8UK7Ze;ghHGF-86+GF-D:+86+GH8UL-WW8UL-VYGz•y¦¨wˆ–hYeHujGhuIUK7GF-R4'gg9‡‡I‡ˆXUK7D:+D<5OKNVZVXgWYeHukXx…X¯§V‘rMe[Ge[GF<ED<5OKNfjglWRVYGwwHVZVOKN39I5>hW•É[´èd½ï[´èW•ÉSw©[´è[´èjÁòuÃñuÃñˆÃéˆÃé”Ã䈶Úq¬Ôn˜Çn˜Çn˜Çw»çˆÃéšÆäšÂݤÊâ¬Ðá·Ê׬Ðá¬ÐášÂÝšÆ䒾ᒾá·Ê×·Ê×ÃÍÐÃÍзÊפÊⒾᒾᇽ㒾ᯪ¶Í”¨âƒŒèrYêfXêfXìdJñT8òJ,óE!óE!óBóE!óE!ì=&ì=&ê\eÕwŒÕwŒÕwŒÍ”¨Ã¼ÃÍ”¨Í”¨æprèrYìdJìV:ñT8óK"òT'ñT8òT'óK"óE!óK"òT'ñT8êI8ÕwŒ¨ÅÛ’¾á‰Ä‡½ã’¾á’¾á’¾ášÆä¨ÅÛÃÍзÊרÅÛ«¹Ê—»Ø—»Ø’¾ášÆäšÆäšÆäšÆä¤Êâ¤Êâ”Ãä”ÃäˆÃ釽ãuÃñˆÃéw»çh¹én˜Çˆ¶Úˆ¶Úw»çšÆäšÆäˆÃéˆÃéuÃñuÃñuÃñuÃñmÀëh¹év¥®]…qQjJQjJIWGKeW[tXYuhKeW[tX]…qz•ywˆwhxghxgQjJIWGQjJ[tX[tX]…qi†xz•yj„hx”kz•yz•‡Š¤ˆz•‡z•‡‰¥—v¤šwˆwx”kz•y¥u˜§ˆ˜§ˆ™¦wz•yhvXhvXx”kx”kx†hx†hhvXoˆVj„hhvXYeHYeHYeHghHhuIQjJQjJoˆV]…qoˆVoˆVNf9Nf9[tX[tXoˆVoˆV]…qtnukXukXukX…Šw…Šw…{W†‰g‡ˆXukXhuIujGWW8D<5D:+D:+D<5VYG†yHvi8D:+)'&5+(5+(86+WW8huIhuIhuIe[GfZ8D<5995:GF:GFVYGNf9GH8995OKNuyguygukXghHD<5D<5gg9…{WwxW‡ˆXWW8fjVfjgfjVOKN995D<5UK7UK7F<E39I5>hSw©[´èw»çw»çW•ÉWl˜W•É[´è[´èd½ïuÃñˆÃéˆÃéˆÃéˆÃéq¬Ôˆ¶Ún˜Çn˜Çq¬Ô’¾á”ÃäšÆä¨ÅÛ¤Êâ¨ÅÛ¬Ðá·ÊפÊâšÆ䒾ᗻؗ»Ø·Ê×ÃÍÐÃÍÐÃÍЬÐá¬ÐášÆ䒾ᒾᯪ¶ãvˆê\eìdJìdJêfXìdJòT'ðWóE!óBóE!óBóK"ñT8ñK6ê\eê\e×[hÍ”¨Í”¨Í”¨Í”¨Í”¨âƒŒèrYìdJèrYòT'óK"ðWòT'óK"ðWóE!óE!òJ,ëLEëYVŸx‡¨ÅÛ—»Øˆ¶Ú‡½ã’¾á’¾á’¾á’¾á·Ê×ÃÍÐü÷ÊרÅÛ—»Ø’¾á’¾ášÆäšÆä¨ÅÛ¨ÅÛ¤Êâ¤ÊâšÆ䒾ᇽㇽã”ÃäˆÃéw»çn˜Çn˜Çˆ¶ÚzÂíŽÁÚšÆäˆÃéˆÃéˆÃéuÃñjÁòmÀëd½ïd½ïZ¨ÕZ†]…qQjJ;F8;F8:GFKeWIWGGJFQjJ[tXwˆwŠ¤ˆ…Šwhxg[tXQjJ[tXoˆVi†xj”’v¤š˜§ˆ¨¶—‰¥—i†xwˆwy–—‰¥—z•‡Š¤ˆˆ¦§‰¥—]…qhvXhuIj„hj„hj„hx”kz•yx†hx”kˆ–h†‰ghvXYeHJU:JU:;F8UK7huIx†hhvXhuIhuIhuI[tX[tXhuI[tX[tXhuI[tXoˆVhvXhuIx”ke[Ge[Ge[GUK7VYGlWRfjV†‰g—˜guyghvXfZ886+D:+5+(D<5wxW™¥h†yHUK7D:+GF-R4'5+(5+(GF-UK7lr9‡ˆXy…JujGVYGGJFF<EWW8wxW[tXfjVVYGVZVVZVVYGGH8;F8GJFVYGVYGXgWXgWYeHghHwxWUK7YeHVYG995D<5OKNGJFIYV-1239ISw©[´èw»çh¹éW•ÉWl˜WŠ³[´èd½ïd½ïuÃñˆÃéˆÃéˆÃ釽ㇽãn˜Çn˜Çn˜ÇZ¨Õw»çw»ç”Ãä¤Êâ¤Êâ¤Êâ¨ÅÛ¬Ðá¤ÊâšÆ䒾ሶڗ»Ø«¹ÊÃÍÐÃÍÐÃÍЬÐá¬ÐášÆ䒾ᒾáüÃæprëLEê\eæprèggïTBñT8óK"óE!óE!óE!óK"óK"òJ,ëYVê\eê\e×[hÕwŒÍ”¨Í”¨Í”¨Í”¨æprèrYìdJñT8òT'ðWòT'ñT8òT'ðWðWóK"òJ,ëLEëLEÕwŒ’¾á—»Øˆ¶Ú’¾á’¾á’¾ášÆä¨ÅÛ·Ê×ÃÍзÊרÅÛ—»Ø—»Ø’¾á’¾ášÆä¤Êâ¨ÅÛ¨ÅÛ¤Êâ¤ÊâšÆä”Ãä’¾á”ÃäˆÃéˆÃéh¹én˜Çˆ¶Úˆ¶Úˆ¶Ú¬Ðá¬ÐáˆÃézÂíˆÃézÂímÀëd½ïmÀëmÀëZ¨ÕZ†Yuh[tX:GFJU:;F8:GFIWGYuhx†hgywYuh…Šw‡˜‡Š¤ˆwˆwz•‡i†xhxg]…qj”’‡˜‡wˆw§§h¨¶‡‰¥—z•‡‰¥—š³’z•y[tXhvXz•yz•yhxgXgW[tXIWGNf9huIoˆVoˆVhvXhuIoˆVXgWhuIXgWhuIhuIoˆV[tXy…Jx”koˆVj„hj„hj„hj„hj„hx”kx”k]…q]…qQjJ[tXhvXx†hOKNVYGVZVIWGVZVVZVgywuzv•Šm—˜g…{WGH886+D:+D:+UL-vi8fZ8UL-D:+D:+UL-R4'86+86+GJF[tXy…JwwHghHJU:JU:JU:GH8GF-GH8YeHhvXwxWˆ–h•ŠWhuIVYGIWGUK7VYGQjJVYG86+GH8WW8GH8gg9e[GUK7UK7UK7995%#-12&39ISw©[´èh¹éq¬Ôh¹éSw©Sw©W•É[´èd½ïd½ïuÃñˆÃéˆÃéˆÃ釽ã‰Än˜Ç‰Än˜Çq¬Ô‡½ãšÆä¨ÅÛ¬Ðá¨ÅÛ¤Êâ¤Êâ¤ÊâšÆ䒾ᒾᗻطÊ×·Ê×·Ê×ÃÍÐÃÍзÊ×’¾á’¾á—»Ø¯ª¶ê\eñK6êfX⃌èggñT8òT'óE!óE!óBóK"óE!óE!óE!ñK6ê\eãvˆÕwŒÕwŒÍ”¨Í”¨Í”¨Í”¨èggìdJìdJñT8ñT8ðWòT'ñK6ñT8ðWóK"óK"ñK6íWHëYVŸx‡¨ÅÛ—»Øˆ¶Ú’¾á’¾á’¾á’¾á¨ÅÛÃÍÐÃÍзÊ×—»Ø—»Øˆ¶Ú¨ÅÛ¨ÅÛ¤Êâ¤Êâ¬Ðá·Ê×·Ê×·ÊךÆäšÆä”ÃäˆÃéˆÃ釽ãn˜Çn˜Ç‰Äˆ¶Ú—»Ø¤Êâ¬ÐášÆäšÆäˆÃézÂímÀëmÀëmÀëmÀëv¥®Z†KeWIWGQjJKeW;F8QjJ=eeQjJ]…q]…qj„hx†huyg†‰gš³’š³’v¤šz•yi†xi†xi†xhxg[tXx…XuygYuh[tXj„hŠ¤ˆz•yYuh[tX[tXKeWVYGw‰‡z•‡z•yw‰‡hxgoˆVx†hQjJghHhvXYeHhuIj„hx”koˆVhvXhuIhvXi‡‡j„hoˆVoˆV[tXoˆV]…q]…qj„hx”khxgoˆVhvXhxgUK7e[Ghxg†‰gwˆwwˆw…Šw…{W…{We[GVZVWifWifMYjVZVVZVVZVQjJWW8D<5GF-ghHfZ8D<5GH8VYGgg9ujGe[GWW8huIhuIWW8UK7GH8JU:UK7WW8x†h†‰gfjVe[GD<5GJFIYVVYGUK799586+e[Ge[GGH8D<5GH8VZV…{We[GF<E39I%#5>h39ISw©W•Éh¹éw»çw»çW•ÉSw©W•É[´èd½ïuÃñˆÃéˆÃéˆÃé”Ãä”Ã䈶ڈ¶Úq¬Ôn˜Çn˜Ç‡½ãšÆä¨ÅÛ¬Ðá·ÊרÅÛ¤ÊâšÆäšÆäšÆ䒾ሶڗ»Ø·Ê×·Ê×·Ê׬Ðá¬Ðᒾᒾᗻدª¶èggòJ,ê\eìdJìdJòT'óE!óE!óK"óE!óK"óK"óE!óE!ñT8ê\eãvˆÕwŒ×[hÕwŒÍ”¨Í”¨Í”¨âƒŒèggìdJñT8ñT8òT'òT'òT'òT'óE!òT'óK"òJ,ëLEëYVŸx‡’¾á‡½ãˆ¶Ú’¾á’¾á’¾á’¾á¨ÅÛÃÍÐÃÍзÊרÅÛ—»Ø’¾á¨ÅÛ¨ÅÛ¤Êâ·Ê×·Ê×·Ê×·ÊפÊâšÆä¤Êâ¤ÊâˆÃ釽ãw»çn˜Ç‰Äw»ç‡½ãšÂÝšÆäšÆäšÆäšÆäšÆäzÂíuÃñuÃñmÀë[´èW•ÉZwv=eeIYVIWG;F8:F/]…q]…qWifgywwˆwj„hhxghvXx…X‡˜‡]…qj„hi†xj„hKeWIWGXgWhxgj„hj„hoˆVhxgz•yz•y¥uŠ¤ˆ‡—xx†hhxgXgWhvX‡˜‡‡˜‡¥ux†hhuIx”ki†x[tXj„hhxgx…Xx†hŠ¤ˆ‡˜‡oˆVghH[tXhvX[tXQjJ[tXQjJoˆVoˆVj„hŠ¤ˆv¤šz•yi†xhxg[tX†yHujGujGvi8fZ8e[Ge[Ge[GlWRWW8VYGe[GhvXz•‡–š‡‡—xe[GVYGwxWukXUK7YeHVYG86+GF-YeHhuI‡‡Ivi8Ze;lr9ujGZe;YeHhuIwwHghHhuIŠ¤ˆ‡˜‡†‰gwˆwlWRQjJfjVGH85+(86+-1286+GF-86+995GH8e[GVYGe[GUK7D<5-12&5>h=d‹[´èh¹é‡½ãw»çh¹éW•ÉSw©[´è[´èuÃñ‡½ãˆÃéˆÃé”ÃäšÆ䇽㈶ډÄq¬Ôn˜Çw»ç”ÃäšÆä¨ÅÛ·ÊרÅÛ¨ÅÛ¤ÊâšÆ䒾ᇽ㈶ڗ»ØÃÍзÊ×·Ê×·Ê×·ÊךÆ䒾ᗻد™§ê\eð=óE!ñT8íWHòT'óBóE!óE!óE!ñT8ñK6óE!óE!ñK6ê\eê\eê\eãvˆÍ”¨Í”¨Í”¨Í”¨Í’×[hêfXìdJñT8óK"òT'òT'òT'óK"óK"óK"ì=&ê\e×[hÍ”¨¨ÅÛ’¾áˆ¶Ú’¾á’¾á’¾ášÆä·Ê×·Ê×üèÅÛ—»Ø—»ØšÆä¨ÅÛ¨ÅÛ¤Êâ·Ê×ÃÍзÊ×·ÊפÊâšÆä·ÊרÅÛšÆäw»çn˜Çn˜Ç‰Ä‰ÄˆÃé”Ãä¤ÊâšÆäšÆäšÆäˆÃéuÃñzÂízÂízÂímÀëj”’]…q=eeIWG=eeKeW;F8:OQNf9Nf9=eeIWGJU:YeHx†hx†h]…qj„hj„hŠ¤ˆz•yx”kj„hi†xi†xx†h‡˜‡Š¤ˆ‡˜‡v¤š‡—xš³’Š¤ˆˆ–hx…Xx†hoˆVYeHhvXz•ywwHˆ–hhvXhuIhuIWW8Ze;YeHghHhuIhuIhvXQjJJU:VYGYeHj„hx”k[tXQjJQjJ[tX[tXj„hx”ki†xj„hi†x[tX•ŠW•ŠW“UVe[GfZ8OKNVZVVZVVYGVYGUK7e[Gvi8ghHfZ8WW8D:+:F/VYGJU:Ze;ghHVYGWW8GF-IWGghHWW8Ze;ghHe[GoˆVhuINf9JU:86+5+(Nf9x†h‡ˆX†yHwxWYeHhuI[tXghHUK786+86+86+86+5+(5+(UK7ujGfZ8F<E9959959955>h5>h=d‹[´è[´èh¹éw»çq¬ÔW•É=d‹Z¨Õ[´è[´èh¹éuÃñ‡½ãˆÃ钾ᇽ㈶Úq¬Ôˆ¶Úˆ¶Úq¬Ô‡½ã¤Êâ¨ÅÛ¬Ðá¬Ðá¬ÐášÆä”Ã䒾ᒾᒾᗻطÊ×·Ê×·Ê׬Ðá¤ÊⒾᒾᒾᯙ§ê\eì=&ñK6ìdJíWHóK"óBóE!ð=óE!ïTBñK6ñK6ëLEëLEê\eê\eãvˆÕwŒãvˆÕwŒÍ”¨Í”¨æprèggêfXíWHñT8óK"òT'ðWòT'óK"óE!óE!ì=&ëLE×[h¯™§¨ÅÛŽ¬Ìˆ¶Ú’¾á’¾ášÆä¨ÅÛ·Ê×ÃÍзÊרÅÛ«¹Ê—»Ø—»Ø¨ÅÛ¨ÅÛ·Ê×·Ê×·Ê×ÃÍзÊרÅÛ¤Êâ¤ÊâšÆä”Ãäw»çn˜Ç‰Än˜Çˆ¶ÚšÆäšÂÝšÆäšÆäšÆäšÆäˆÃézÂízÂízÂízÂí[´èZ†=eeJU::F/:GF:OQNf9:OQNf9IWGNf9JU:KeWXgWx”k‡—x¥ui†x]…qz•‡š³’‰¥—z•yz•‡z•‡z•‡wˆw‡˜‡z•‡i‡‡z•ywˆwz•yj„hoˆVfjVhvXj„hj„h[tX[tXYeHhvXoˆVj„hVYG[tXhvXhuIYeHZe;Ze;Ze;IWGQjJfjVj„hx†hhxg[tX[tXoˆVj„h[tXhvXx”kj„hhxghvX‘rM†yH…{WtnwxWtn…Šw–šwwxWe[GWW8huIgg9D:+)'&86+D:+D<5UK7UK7vi8gg9fZ8GH886+GF-GH8JU:VYGhuIx…Xˆ–hujGUL-JU:GF-Nf9Ze;D<5GH8VYGwxWwxWoˆV…{WfZ8gg9UK7WW8wwHWW8D:+86+D<5GH8UK79955+(39I&&&5>hW•Éh¹éw»çh¹éh¹éW•ÉSw©W•É[´èd½ïuÃñuÃñzÂíˆÃé”ÃäšÆ䇽ãw»çˆ¶ÚŽ¬Ìq¬Ôw»çšÆä¨ÅÛ¬Ðá¨ÅÛ¬ÐášÆ䒾ᒾᒾሶڈ¶Ú·Ê×·Ê×·Ê×·ÊךÆ䒾ᒾᗻØÍ”¨ëYVñT8ëYVëYVñT8óE!óBóE!óBóE!óE!óE!òJ,êI8ëLE×[hãvˆÍ”¨ÕwŒÕwŒÍ”¨Í”¨Í”¨èggêfXêfXíWHòT'òT'óK"óK"ìV:óK"óE!óK"êI8ëLEê\e¯™§¨ÅÛˆ¶Úˆ¶Ú’¾á’¾á¨ÅÛ¨ÅÛÃÍÐÃÍзÊרÅÛ—»Ø’¾á¨ÅÛ¨ÅÛ¨ÅÛ·Ê×ÃÍзÊ×·Ê×·Ê×·Ê×·ÊךÆäšÆ䇽ãn˜Çn˜Çˆ¶Úq¬Ô‡½ãšÆäšÆäšÆäšÆä”ÃäˆÃéˆÃéˆÃézÂímÀëmÀëZ¨Õj”’=eeQjJ:OQJU:KeWYuhYuhJU::GFIWGQjJ[tXYeHVYGhvXi†x]…qx†h‡—xx”kj„hYuhhxg[tXi†xhxghxg†‰gŠ¤ˆ‡˜‡wˆwx†hj„hj„hj„hj„hx†hj„hhuIhvXoˆVJU:JU:Ze;YeHx†h™¦w¥uhvXZe;Nf9VYGZe;WW8Nf9QjJYuhwˆwi†xi†xYuhj„h[tX[tX[tXhxgYuhhuI•ŠW‘rM‘rMujGukXtn…{WukXVYGe[GghHujGUK75+()'&86+GF-fjVe[GWW8WW8Ze;WW899586+;F8GH8VYGZe;ujGy…JwwHWW8Ze;UL-86+Ze;wv;fZ8D:+GH8VYGfjVWW8ghHD<5D<5fZ8UK7GF-D:+D<5D<5GH8IWGGH8F<EF<E&&&39I5>hW•Éh¹éh¹éd½ï[´èW•ÉSw©Sw©[´èh¹é[´èd½ïˆÃéˆÃéˆÃé”ÃäˆÃéw»çŽ¬Ì—»Øq¬Ôn˜Ç‡½ã·Ê×·ÊרÅÛ¨ÅÛ¨ÅÛ¤Êâ’¾ášÆ䇽㈶ڨÅÛ·Ê×·ÊרÅÛ¨ÅÛ’¾á’¾á—»ØÍ”¨ñK6ñT8êfXñT8óK"óK"óE!óE!óE!óK"óK"ð=óE!ñK6ëLEê\eãvˆãvˆÍ”¨Í”¨Í”¨Í”¨Í”¨ÕwŒêfXêfXìV:òT'òT'óK"òT'ïTBóK"óK"óK"ì=&ëLEëLE¯™§¨ÅÛ’¾áˆ¶Ú’¾á’¾ášÆä·Ê×·Ê×·Ê×·Ê×—»Ø‰Ä—»ØšÆä¨ÅÛ¨ÅÛ·Ê×ÃÍÐÃÍзÊ×·Ê×·ÊרÅÛ¤Êâ”Ãäw»çn˜Çq¬Ôˆ¶Ú‰Ä’¾á”ÃäšÆäˆÃéuÃñˆÃéˆÃézÂíˆÃézÂímÀëmÀëZ¨ÕZ†ZwvIWGNf9IWGKeWQjJ]…qKeWNf9IWG[tXoˆVhxgQjJYeHYeHQjJ[tXoˆVoˆVYeH[tXhvX[tX[tXhuIoˆVhvX‰•Yx”koˆVhuI[tXghHoˆVi†xj„hhvXj„hx†hhxghvXWW8huIhuIghHfjVYeHZe;VYGZe;Ze;Nf9GH8JU:hvXwˆwi†xj„hj„hoˆVQjJVYGVYGJU:IWGXgWhvXukXukXwxWukXlWRVYGuygukXfjVwxWukXOKNUK7fZ8UL-UL-GF-D:+D<5WW8JU:GH8YeHWW8JU:e[Ggg9vi8gg9UK7GF-UL-UL-GH8GF-5+(86+WW8Nf9YeHVYG86+D<5GH8D<5D<5D<5WW8UL-UL-:F/86+GJFhvX‡ˆXfZ8GH8-12%#&&&5>hW•É[´èd½ïw»ç‡½ãh¹éW•ÉSw©Z¨Õ[´è[´è[´èd½ï”ÃäšÆäšÆäˆÃ鈶ڎ¬Ì—»Ø—»Øq¬Ôˆ¶Ú’¾á·Ê×·Ê×·ÊרÅÛ¤ÊâšÆ䒾ᒾᎬ̗»Ø·Ê×ÃÍзÊפÊâ”Ã䒾ሶÚÍ”¨ê\eì=&ëLEòT'óK"óE!óE!óE!óBòT'òJ,óE!ð=òJ,êI8ëLEãvˆÕwŒÍ”¨Í”¨Í”¨Í”¨Í”¨ÕwŒëYVìV:ìV:ñT8óK"òT'òT'êfXñK6óK"óK"óK"ëLEëLE¯™§—»Ø’¾á‡½ã’¾á’¾á¨ÅÛ·Ê×·Ê×·Ê×·Ê׉Ē¾á’¾ášÆä¨ÅÛ·Ê×·Ê×ÃÍзÊ×·ÊרÅÛ¨ÅÛšÆ䒾ᇽãn˜Ç‰Äˆ¶Ú‰Äˆ¶ÚšÆäšÆä”ÃäˆÃéw»çˆÃéˆÃéˆÃéˆÃéˆÃémÀëq¬Ôj”’Z†=eeNf9Nf9JU:IWGGJFYuhi‡‡]…qx”kj„hj„hNf9Nf9JU:JU:YeH[tXoˆVx…XoˆVoˆVoˆVx…X‡—xˆ–h¥uoˆVoˆVˆ–hx”kx†hhvXhxgj„hj„h¥uŠ¤ˆj„hhxgfjVYeHUL-UK7UK7VYGWW8YeHhuINf9QjJZe;YeHYeHhuIhuIhuIZe;Nf9VYGNf9JU:JU:QjJZe;IWGVYGhvXfjVlWRwxW…Šw…Šw•Šm–šwtn…{Wx†hwxWukXukXghHfZ8UL-WW8WW8WW8WW8UL-WW8wv;vi8YeHYeHUK7JU:GH886+D<586+Ze;gg9GH886+86+86+GH8ghHe[G5+(D<5VZVfjVVYGUK7UL-GF-WW8fZ8D<5GH8VYGUK7D:+5+(-12)'&&&&5>hW•Éh¹é‡½ã‡½ãw»ç‡½ãn˜ÇWl˜Sw©[´è[´èd½ïh¹é”Ãä”ÃäšÆäšÆ䒾ᗻ؎¬ÌŽ¬Ìˆ¶Úˆ¶Ú’¾á¨ÅÛ·Ê×·Ê×·Ê×·ÊרÅÛ’¾á’¾áˆ¶Ú—»ØüÃÃÍзÊפÊâ”Ã䒾ᒾᯙ§ê\eñK6òJ,òJ,óE!óK"óE!óK"óK"óK"óBóE!ëH&ñK6êI8ëLE×[hÍ”¨ÕwŒÍ”¨Ã¼ÃÍ”¨Í”¨ÕwŒêfXñT8ñT8óK"ðWóK"òT'òT'óK"óK"óK"òJ,ëLEÓTM¯ª¶’¾áˆ¶Ú‡½ã’¾á’¾á¨ÅÛ·Ê×·ÊרÅÛ«¹Ê‰ÄŽ¬Ì’¾á¤Êâ¨ÅÛ·Ê×ÃÍзÊ×·Ê×·ÊרÅÛ¨ÅÛ’¾á’¾áˆ¶Ún˜Çq¬ÔŽ¬Ìˆ¶Ú‡½ãšÆä¤ÊâšÆäˆÃéˆÃézÂíˆÃéˆÃéˆÃéˆÃémÀëZ¨ÕWŠ³Z†JgnKeW;F8:F/:F/IYVj„hYuhYuh[tXj„hx”k[tXQjJQjJQjJQjJi†xx”kx”kx”kx”kx”kx”kx”kx”koˆVx”k[tXYeHhuIj„hx”koˆVoˆVoˆVoˆVz•yoˆVj„hfjVYeHNf9GH8JU:YeHi‡‡z•‡j„hYeHhuIoˆVwwHhuIfjVghHYeHJU:YeHZe;IWGWW8Ze;huIYeHJU:JU:VYGukXukXwxW‡ˆX•Šm‡—x…Šw…Šwˆ–h†‰g…{W…Šw•Šmx…XwwHfZ8UL-Nf9huIwxWujGvi8wv;wv;gg9GJFIWGe[GghHvi8wwHlr9fZ8UL-UL-WW8GH886+995VYGGJFGH8fjVfjVVYGGH8WW8GF-GF-GF-GH85+(86+D:+;F886+99539I%#&&&&W•Éh¹éuÃñzÂ퇽ㇽãn˜ÇSw©Sw©[´è[´èh¹éw»ç‡½ãˆÃé”ÃäšÆä”Ã䒾ᗻ؈¶Úˆ¶Úq¬Ô’¾ášÂݨÅÛ·Ê×·Ê×·Ê×’¾á’¾á’¾áˆ¶ÚŽ¬Ì¨ÅÛ·Ê×ÃÍШÅÛšÆ䒾ᒾᯙ§ëLEð=ñK6óK"óE!óE!óE!óK"óBóK"óBëH&ëH&ëLEëLEãvˆÕwŒÍ”¨ÕwŒÍ”¨Í”¨Í”¨ÕwŒâƒŒêfXïTBìV:òT'óK"óK"òJ,òT'òJ,óK"óK"ñK6ëLEÓTM¯ª¶¨ÅÛˆ¶Ú’¾á’¾á’¾á¨ÅÛ·Ê×·ÊרÅÛŽ¬Ì‰Ä’¾á’¾á¤Êâ·Ê×·Ê×·Ê×·ÊרÅÛ¨ÅÛ¨ÅÛ¤ÊâšÆ䇽ãn˜Ç‰Äq¬Ôn˜Çˆ¶Ú‡½ã’¾á¨ÅÛšÆäšÆäˆÃézÂíuÃñuÃñˆÃéuÃñmÀëZ¨ÕZ¨ÕW•ÉZwvKeWKeW=ee=eeKeW[tXYuhYuhYuh]…qj”’z•‡j„hj„h[tXoˆVx”k[tXz•yj„h[tX[tX[tXj„hx”koˆV¥ux†hhuIhuIhvX˜§ˆ¨¶‡¥uj„h[tXfjghxgXgWhuIuyghuIYeHhuIj„hhvXgywj„hhvXhuIfjVVYGYeHYeHhvXwxWhvXYeHYeHIWGYeHhuIQjJJU:IWGIWGVYGoQ/fZ8fZ8wxW…{W•Šm‰–š‡…Šwtn‡ˆXukXfjVujGghHe[Ge[GghHghHfjVujGgg9Ze;VYGVYGGH8995GH8UK7UK7GF-:F/:F/GF-Ze;fZ8GF-86+D<5GH8GH8XgWfjVuyge[GUK7WW8GH8WW8lr9gg9GF-GF-995UK7D:+9959955+()'&&&&=d‹[´èd½ïˆÃéh¹éw»çw»çW•ÉSw©W•É[´èh¹éuÃñ‡½ãˆÃé”Ã䒾ᒾᇽ㎬̎¬Ìˆ¶Úˆ¶Ú’¾á¨ÅÛ¨ÅÛ·Ê×·Ê×·ÊרÅÛ’¾á‡½ãˆ¶Úˆ¶Ú¨ÅÛ¨ÅÛÃÍзÊרÅÛ’¾á’¾á¯™§ëLEóE!ñT8óK"óBóBóE!óK"óK"óK"óBì=&ëLEëLEëLE×[hÍ”¨Í”¨Í”¨Í”¨«¹ÊÍ”¨ÕwŒèggê\eìdJñT8óK"óK"ñT8óK"óK"òJ,óE!óE!ñK6êI8ëYV¯ª¶¨ÅÛˆ¶Ú’¾ášÆäšÆä¨ÅÛ·Ê×·Ê׫¹Ê—»Ø‡½ã’¾ášÆä¤Êâ·Ê×üÃÃÍзÊרÅÛ·Ê×·ÊרÅÛšÆ䈶Ún˜Çq¬ÔŽ¬Ìq¬Ô’¾á’¾á”ÃäšÆä¤Êâ”ÃäˆÃéjÁòuÃñˆÃéˆÃéuÃñZ¨ÕW•Év¥®WŠ³JgnKeWYuhYuhWiwWiwZ†z•‡Z†YuhYuh[tX]…qQjJ[tXhvXYuhoˆV[tX[tXx”kx”kx”koˆVoˆVx”kz•y¥u‰¥—x†hoˆVx†hwxW–šw–šwx”kj„hwxWhxghvX[tX[tXfjVhvXx”kz•yx”khvX[tXQjJZe;VYGIWGNf9[tXx”kj„hj„hhuIYeHYeHYeHhuI[tXJU:GH8GH8VYGujG†yH†yHwxWukXukX†‰g–š‡–š‡–šw‡ˆXukXujGuyg…{W†‰ghuIZe;WW8Ze;WW8fZ8fZ8fZ8ghHe[GJU:GH8IWGZe;Nf986+86+86+GF-gg9UL-:F/86+86+GJFGJFQjJhxgVYG86+GF-86+995GF-GF-5+(5+(UL-D:+995GF-D:+)'&&%#&=d‹h¹éw»çw»çh¹é‡½ã‡½ãq¬ÔW•ÉW•Éd½ïh¹éw»çw»ç‡½ã”Ã䒾ᒾᒾᎬ̗»Øˆ¶Ú‰Ä‡½ã’¾ášÆä¨ÅÛ¨ÅÛ·Ê×·ÊרÅÛ’¾á‡½ãˆ¶Ú«¹Ê·Ê×ÃÍзÊפÊⒾᒾᯪ¶×[hóK"óK"óE!óE!óE!óE!óBóE!óE!óBóBñT8ëYVëLE×[hÕwŒÍ”¨‰ÄÍ”¨Í”¨Í”¨ãvˆÓopÓopïTBñT8óK"óK"óK"òT'òT'òJ,óK"óK"ì=&ëLE×[h¯ª¶’¾áˆ¶Ú’¾á’¾ášÆä¨ÅÛ¨ÅÛüèÅÛ—»Ø’¾á’¾á¨ÅÛ·Ê×·Ê×·ÊרÅÛ¨ÅÛ¨ÅÛ·Ê×·Ê×·Êׇ½ãn˜Ç‰Ä—»Ø‰Ä‡½ã”ÃäšÆäšÆä”Ã䇽ㇽãzÂíuÃñˆÃéˆÃéuÃñjÁòZ¨ÕW•ÉZ¨ÕZ†YuhXgWIWG:GFKeW]…qYuh[tXKeWNf9QjJ]…q[tXKeWYuh[tX[tXoˆVi†x[tXoˆVx”k[tXhuIYeHhvXj„hhxghvXuygx†hˆ–hj„hYeHYeHujGZe;VYGVYGYeHhvXwxWhuIYeHhxgx†hwˆw[tXYeHQjJYeHVYGYeHe[G[tXj„hhvXYeHYeHYeHQjJYeHhuI[tXQjJNf9JU:YeH—˜g•Šm‡ˆX…{W†yH—ˆI•ŠW§˜W§˜W•ŠmwxWwxWwxWuyg†‰gtnuyghvXhuI†‰glWRGH8GF-VYGwwHvi8GJFGH8JU:GH8GF-:F/UL-Nf9GF-GF-:F/86+VYGVYGfjVuygwxWVYGGH886+86+GF-D:+:F/5+(#)'&D<5GF-GF-GH8D<5995)'&5>hW•Éh¹éh¹éh¹é‡½ã‡½ãq¬Ôn˜ÇSw©[´èh¹éuÃñh¹é‡½ã’¾á’¾á¨ÅÛ¨ÅÛ—»Ø—»ØŽ¬Ìw»ç‡½ã’¾á¨ÅÛ¨ÅÛ’¾á¨ÅÛ·Ê×·Ê×—»Ø‡½ãˆ¶Ú—»ØÃÍÐü÷ÊךÆ䒾ᒾᯪ¶×[hóE!óK"óE!óE!óE!óBóBóBóBóBóBòJ,ì=&ëLE×[hÕwŒÕwŒ‰Ä‰ÄÍ”¨Í”¨Í”¨Í’ÓopìdJòT'óK"óK"óK"òJ,ñK6òJ,óK"óE!ëLEê\e×[h—»Ø’¾áˆ¶Ú’¾á’¾ášÆä¨ÅÛ·ÊרÅÛ«¹ÊŽ¬Ì’¾á¨ÅÛšÆä¨ÅÛ·Ê×·ÊךÆä¨ÅÛ·Ê×ÃÍзÊ×’¾áq¬Ô‰Ä’¾áŽ¬Ì‰Ä’¾ášÆäšÆäšÆä”ÃäˆÃéw»çuÃñzÂíuÃñˆÃéjÁòd½ïZ¨Õq¬ÔZ¨Õ]…qIWGNf9GH8;F8QjJYuhYuhKeWKeWJU:JU:KeW[tXIWGj„hz•y[tXQjJj„hj„h[tXoˆVQjJ[tXQjJ[tXoˆVhvXVYGNf9QjJhvXuyghvXVYGJU:WW8ghHYeHVYGYeHx”kx”ki†x[tXhvXYuhQjJJU:WW8YeHWW8YeHYeHZe;QjJYeHZe;VYGVYGYeHYeHXgWQjJhuIoˆVYeHZe;§§h—˜g•ŠW‡ˆX•ŠW—˜Y©•o•Šm©•o¨¶‡©•o—ˆI—ˆI—ˆIuyg†‰g…Šw‡˜‡†Š‡–šw…ŠwghHghHe[Ge[GfZ8IWGZe;gg9GF-GF-UL-gg9GF-GF-:F/GF-GF-GH8GH8VYGgg9JU:GF-D:+5+(D:+fZ8WW8UK7GF-D:+UK7VZVVYGGH886+D<5995&&W•É[´è[´èh¹éh¹éw»çw»çq¬ÔSw©Z¨Õd½ïd½ïh¹é‡½ãˆÃé¤Êâ¤Êâ¤Êâ¨ÅÛ—»ØŽ¬Ì‰Äq¬Ô’¾á¨ÅÛ¨ÅÛ’¾á—»Ø¨ÅÛ·ÊרÅÛ—»Øˆ¶Ú—»Ø¨ÅÛ·Ê×·ÊרÅÛ¨ÅÛ’¾á‰Ä×[hóBóE!óE!óBóE!óBóBóBóE!óBóBóE!ì=&ÔM1×[h×[hÍ”¨‰ÄÍ”¨Í”¨Í”¨Ã¼Ãű®Í”¨æprïTBòT'óK"óK"óK"òJ,òJ,ð=ì=&ëLEëLEÕwŒ—»Ø’¾áˆ¶Ú‡½ã’¾á¨ÅÛ·Ê×·Ê×—»Ø‰Ä’¾á’¾ášÆäšÆä·ÊרÅÛ’¾ášÆä·Ê×ÃÍзÊרÅÛ‡½ãn˜Ç—»ØŽ¬Ì‰Äˆ¶Ú’¾ášÆäšÆä¤ÊâˆÃézÂíuÃñuÃñuÃñuÃñˆÃéjÁòZ¨ÕWŠ³Z¨ÕZ¨ÕZwvQjJIWGVYGJU::OQ[tX]…q[tXQjJQjJQjJ[tXYuhhxgj„hz•yYuh[tXx”kx”koˆVYuhQjJ[tXj„hoˆVhuIYeHYeHNf9Nf9VZVYeHhvX[tXYeHYeHYeHYeHhvXhvXhvXhvXYuhYeHhuIj„hfjV[tX[tXNf9IWGVYG[tXhxgQjJQjJQjJIWGQjJYeHZe;[tXVYGZe;QjJYeHZe;§˜W©•o§˜W§˜W—˜Y•ŠW†‰g•ŠW•Šm•Šm•Šm–šw¦¨w©•o‡ˆX…{WwxWˆ–h—˜g†yHwwHwwHx†hwˆwwxWukXghHujGgg9gg9gg9lr9gg9Nf9lr9GF-86+86+IWGYeHe[GWW8VYGGF-##5+(D:+UL-Nf9WW8UK7GH8D:+D<55+(-12995995995Wl˜[´è[´è[´èuÃñ‡½ã’¾á‰ÄSw©W•Éh¹é‡½ã‡½ã‡½ã”ÃäšÆä¤Êâ¨ÅÛ¨ÅÛˆ¶ÚŽ¬Ìˆ¶Úq¬Ô‡½ã’¾á¨ÅÛ’¾á’¾áˆ¶Ú—»Ø·Ê×—»Øq¬ÔŽ¬Ì«¹Ê·Ê×·Ê×·ÊפÊⒾᎬÌÓopóE!óBóBóE!óE!óE!óBóBóBóE!ð=óE!ëH&ëYV×[h×[hÕwŒÍ”¨Í”¨Í”¨‰ÄÍ”¨Å±®Í”¨âƒŒêfXòT'óK"óK"óK"òJ,òJ,ì=&ì=&ì=&ì=&ÕwŒšÆä‰Äˆ¶Ú’¾ášÆäšÆä·Ê×·ÊרÅۉć½ã’¾á—»Ø¨ÅÛ¨ÅÛ¨ÅÛ’¾á¨ÅÛ·Ê×ÃÍзÊ×’¾áˆ¶Ú‰ÄŽ¬Ìˆ¶Ú‰Ä—»Ø¤Êâ¤ÊâšÆäšÆäšÆäˆÃéuÃñuÃñuÃñzÂízÂíuÃñW•ÉZ¨Õh¹éW•ÉZ†QjJQjJQjJJU:IYVXgWIYVhvXoˆV[tXQjJ[tXKeWIYVQjJhuIYuhIWGQjJhxghuIYeHy…JhuINf9ghHZe;WW8VYGVYGYeHXgWXgWhvXwxWoˆVfjVVYGYeHoˆV‡—xx”khvXYeHYeHx”k‡—xj„h[tXoˆVhxgQjJVYGYuh‰¥—v¤š[tXQjJNf9Nf9huI[tXQjJQjJNf9Nf9VYGYeH—˜Y•ŠW—ˆI—˜Y—˜g†‰g•ŠW…{WwxW…Šw©•o–šw¦¨w©•o†‰g‘rM†yH‡‡I‡ˆX†yHgg9lr9‡ˆX‡ˆX‡ˆX•ŠW•ŠW‡ˆXˆ–hwwHgg9lr9lr9‡‡Igg9D:+86+Nf9wxWghHWW8GF-UL-##86+GF-GF-GF-WW8ghHfZ8OKND:+86+GH8:F/995;F8:F/-12&5>hZ¨Õ[´è[´èuÃñ‡½ã‡½ãn˜ÇSw©Sw©n˜Çw»çw»ç‡½ã’¾á¨ÅÛ¨ÅÛ·ÊרÅÛ—»Ø‰Äˆ¶Úq¬Ôw»ç’¾á¨ÅÛ’¾á’¾á’¾á—»Ø—»Ø’¾á‡½ãˆ¶Ú«¹Ê·Ê×·Ê×·ÊרÅÛšÆ䎬ÌÕwŒïTBóK"óBóBóE!óE!óBóBóBóBð=ì=&ì=&ëLE×[hÕwŒÍ”¨Í”¨Í”¨Í”¨Ã¼ÃüÃüÃű®Í”¨æprïTBóK"òT'óE!óK"óK"óK"óK"òJ,êI8Í”¨—»Øˆ¶Úˆ¶Ú‡½ã’¾á—»Ø·Ê×·ÊרÅÛŽ¬Ì‡½ã’¾á¨ÅÛ¨ÅÛ¨ÅÛ¨ÅÛ¨ÅÛ·Ê×ÃÍзÊרÅÛ’¾áˆ¶Ú‰Ä—»ØŽ¬ÌŽ¬Ì¨ÅÛ¨ÅÛ¨ÅÛ¤Êâ”ÃäˆÃéˆÃéuÃñzÂíˆÃéuÃñuÃñ[´èW•ÉmÀëmÀëv¥®]…qQjJNf9:GF:F/Nf9JU:;F8[tX[tXKeWQjJ]…qi‡‡]…q[tX[tXj„hQjJJU:;F8VYGoˆVx†hhuIhuIQjJJU:Ze;QjJghHx…Xˆ–hoˆVIWGWW8YeHYeHNf9YeHYeHlr9ghHVYGVYGQjJQjJoˆVx†hhvXhvXYeHIWGNf9QjJQjJVZVXgWj„hghHNf9IWGQjJ[tX[tXQjJKeW[tXYeH®’K§˜W²Š8—ˆI§˜W©•o•Šm—˜g–šw©•o§§h§˜W•Šm‰•Y—˜Y—˜g‡ˆX†‰g•Šm—˜g—˜g•ŠW•ŠW‡ˆX†‰gwxWfjVx…XwxWhuIghHwv;lr9UL-5+(GF-UK7VYGUK7GH8GF-86+:F/D:+JU:UL-R4'GF-GF-ghHhvXGH8D:+5+(86+GH899586+:F/)'&5>hW•ÉZ¨Õ[´èh¹éw»ç‡½ãˆ¶Ún˜ÇSw©W•Éw»ç‡½ã‡½ã’¾á¨ÅÛ¨ÅÛ’¾á¨ÅÛŽ¬ÌŽ¬Ì’¾á‰Ä‰Ä’¾ášÆ䒾ᒾᒾá¨ÅÛ’¾áˆ¶Úˆ¶ÚŽ¬ÌŽ¬Ì·Ê×·Ê×·Ê×·ÊפÊâ—»ØÍ’ëYVòJ,óE!óBóBóE!òJ,óE!óE!óBð=ð=ëLEëLE×[hÕwŒÕwŒÍ”¨Í”¨Í”¨Ã¼Ã·Ê×ÃÍÐÍ”¨âƒŒæpríWHóK"óK"óK"óK"óK"óBóBòJ,êI8¯™§šÂ݈¶Úˆ¶Ú—»Ø’¾á¨ÅÛ·Ê×·Ê׫¹ÊŽ¬Ì’¾ášÆä¨ÅÛšÆä¨ÅÛ¨ÅÛ¨ÅÛ·Ê×ÃÍзÊפÊâw»ç‰Ä‰ÄŽ¬Ì—»Ø¨ÅÛ¨ÅÛšÆäšÆä¤ÊâšÆäˆÃéw»çh¹ézÂíˆÃéjÁòh¹éW•ÉW•ÉmÀëZ¨ÕZ†=eeNf9=eeIWG:OQ:OQ:GFJU:[tXYuh]…qi†xi†xi†x]…qj„h[tX]…qoˆVhxg[tXJU:QjJx…Xx”khuIhuIYeHYeHYeHYeHfjVwwHhuIhuIQjJhvXhvXhvXYeHYeHYeHYeHVYGQjJhuIQjJoˆVhvXj„hhvXYeHNf9VYGYeHhuIVYGIWGNf9[tXNf9JU:IWGKeWXgWIWGQjJVYGWW8®’K«¢;ÇšH¯§V®’K•ŠW•ŠW•ŠW¦¨w¦©ˆ–šw¦©ˆ¦¨w¦¨w—˜g•ŠW…{W‡—x™¦w¦¨w•Šm‡ˆXukXujGy…JVYGGF-UL-gg9ghHghHgg9UL-:F/JU:Ze;gg9Ze;JU:;F8GF-JU:vi8Nf9WW886+86+5+(86+;F8XgWVYGVYGfjVYeHYeHGH8995-12)'&&-125>hSw©Z¨Õ[´èuÃñˆÃé”Ãä’¾án˜ÇSw©W•Éq¬Ôw»çw»ç‡½ã¨ÅÛ·ÊרÅÛ—»Ø«¹Ê’¾á—»Øˆ¶Úˆ¶Ú‡½ã’¾á¨ÅÛ’¾á’¾á’¾á’¾á’¾á‡½ãŽ¬Ì‰Ä¨ÅÛ·Ê׫¹ÊšÂÝšÆ䒾ᯙ§íWHóK"óBóE!óE!óE!óE!óE!óE!óBóE!óBì=&ëLE×[h×[hÕwŒÕwŒÍ”¨¨ÅÛ·Ê×Í”¨Ã¼ÃüÃ⃌ãvˆñT8òT'ñT8óK"óK"óK"òJ,ì=&ñK6ëYV¯ª¶—»Øˆ¶Ú‡½ã’¾á—»Ø¨ÅÛ·Ê×·Ê׫¹Êˆ¶Ú’¾á’¾á—»Ø·ÊרÅÛ¨ÅÛ¨ÅÛ·Ê×ÃÍШÅÛ’¾á‰Ä‰Ä‰Ä‰Ä—»Ø¨ÅÛ¨ÅÛ¤Êâ¤ÊâšÆäˆÃézÂíuÃñh¹éuÃñzÂíuÃñh¹éW•Éq¬ÔmÀëZ¨ÕZ†:OQNf9=eeNf9Nf9:OQ;F8=eeYuhZwvi‡‡i†x]…q[tX[tX]…q[tXYuhYuh]…qi†x[tXJU:YeHuyg[tXQjJhvXoˆVhuIVYGGF-GH8Nf9j„hj„hQjJ[tXj„hj„h[tXYeH[tX[tX[tXoˆVj„hoˆV[tXQjJ[tX[tXXgWXgWYeHNf9VYGIWGIWGQjJYeHJU:JU:Nf9YeHJU:GH8JU:GH8¯§VÏQÏQ¯§V®’K§˜W§˜W§˜W§˜W§§h¦©ˆ§˜W—˜g—˜Y†yHghHfZ8vi8‡ˆX‰•Y…ŠwwxWYeHvi8wwHujGZe;wv;wv;ujGfZ8gg9huIoˆVlr9gg9gg9Ze;Ze;:F/86+D:+GF-86+86+Nf95+(5+(GH8IWGWW8GJFVYGVZVVYGfjVQjJ;F8:F/&39I=d‹W•Éd½ïh¹éh¹é‡½ã’¾á‰ÄSw©W•Éw»çw»çˆ¶Úˆ¶Ú’¾á¨ÅÛ·Ê×’¾á—»Ø«¹Ê«¹ÊŽ¬Ìˆ¶ÚŽ¬Ì¨ÅÛ¨ÅÛ¨ÅÛ¨ÅÛ’¾á’¾á’¾áw»çˆ¶Ú‰Ä«¹Ê·Ê×·ÊרÅÛ’¾á—»Ø¯™§ëYVóK"óBóBóE!óE!óE!óE!óBòJ,óE!òJ,ëLEëLE×[hÕwŒÕwŒÍ”¨Ã¼Ã«¹ÊÍ”¨ÕwŒÍ”¨Ã¼ÃÍ”¨æpròT'òT'òT'óK"óE!óE!òJ,ñK6ì=&Óop—»Ø¨ÅÛŽ¬Ìˆ¶Ú’¾á¨ÅÛ·Ê×·Ê×·Ê׈¶Úˆ¶Ú’¾á’¾á¨ÅÛ·ÊרÅÛ«¹Ê·Ê×·Ê×ÃÍШÅÛ‡½ãn˜Ç‰Ä—»Ø—»Ø¨ÅÛ¨ÅÛ·ÊרÅÛ¤ÊâšÆäˆÃ釽ㇽãuÃñd½ïd½ïh¹éq¬ÔW•É‡½ãmÀëZ¨Õ=ee;F8:F/Nf9:OQQjJKeWQjJKeWIYV]…qj”’]…q]…qZwvZwvYuhj„hwˆwi‡‡i†xx”kj„hXgWIYV[tXz•‡x†hfjVhvXhvXJU:JU:GJFVYGx”kz•yj„h[tXj„hj„hx†hhuIYeHhvXhvX[tX[tX[tX[tXQjJQjJYeH[tXYeHXgWQjJQjJNf9IWGJU:Nf9Nf9[tXQjJIWGJU:GH8IWGGH8¯§VÏQ¯§V¯§V¯§VÇšH«¢;§˜W®’K—ˆI™¥h©•o—ˆI—ˆI—ˆI—ˆI‘rM†yH•ŠW—˜g—˜gˆ–h•ŠW‡ˆX†yH‡ˆXwwHwwHwv;y…J†yHwv;Žr6Ze;JU:UL-:F/D:+86+GF-86+)'&%#%#)'&86+86+GF-GF-GF-86+86+5+(GH8YeHhvXJU::F/995-125>h5>hW•É[´èh¹é‡½ã‡½ã’¾áˆ¶Ún˜ÇSw©h¹éw»çˆ¶Úˆ¶Ú’¾á·Ê×·Ê×—»Ø—»Ø«¹Ê—»Ø«¹Ê‡½ã‡½ã’¾á—»Ø¨ÅÛ¨ÅÛ—»Ø’¾á—»Øˆ¶Úˆ¶Ún˜Ç‰Ä¨ÅÛ·ÊרÅÛšÂÝ’¾á¯ª¶æprñK6óK"óBóE!òT'óE!óE!óK"òJ,ëLEëLEëLEê\e×[hÕwŒÕwŒ‰Ä«¹ÊÍ”¨Í”¨ÕwŒÍ”¨Í”¨Í”¨ãvˆíWHñT8òT'òT'óBóBòJ,òJ,ëLEÕwŒ—»Ø¨ÅÛˆ¶Ú‡½ã’¾á¨ÅÛ·Ê×üèÅÛ—»Ø’¾á’¾á—»Ø·Ê×·ÊרÅÛ·Ê×·Ê×ÃÍзÊ×”Ãän˜Ç‰ÄŽ¬Ì‰Ä¨ÅÛ¨ÅÛ¨ÅÛ·ÊפÊâ¤ÊâšÆ䇽ãw»çˆÃéˆÃéˆÃéh¹éh¹éq¬ÔZ¨Õ‡½ãZ¨Õv¥®=ee:F/;F8;F8:F/KeW[tXYuhKeWQjJ:GF:OQKeWx”kv¤šj„hYuhgywi‡‡wŠ•z•‡z•yz•y]…qj„hXgWwˆwj„hYeHVZVj„hfjVUK7XgW[tXhvXj„h[tXUK7WifhuIYeH[tXQjJQjJhvXz•‡]…q[tX[tXXgWVYGIWGhvXfjVYeHfjVQjJQjJYeHQjJQjJQjJ[tXVYGIWGNf9JU:Nf9JU:ÇšH¯§V¯§V¯§Vȵlȵl¯§V¯§V§˜W®’K—ˆI–šw•ŠW’•I—ˆI®’K§˜W©•o©•o•ŠW—ˆI—˜Y•ŠW•Šm•ŠW—˜Y•ŠW’•I•ŠW•ŠW‡‡Iwv;WW8UL-lr9WW8D:+5+(5+(GF-D:+)'&)'&%#86+86+86+:F/JU:WW85+(%#99586+GJF;F886+86+:F/5+(&&&5>h5>hSw©[´è[´è[´èw»ç’¾á‡½ã‰ÄSw©W•Éw»çw»çw»ç—»Ø¨ÅÛ¨ÅÛ¨ÅÛ¨ÅÛ—»Ø‰Ä‰Ä‰Äˆ¶Ú’¾á«¹Ê¨ÅÛ¨ÅÛ¨ÅÛ—»Ø¨ÅÛˆ¶Ú‡½ãq¬Ôˆ¶Ú¨ÅÛ·Ê×·ÊרÅÛšÆ䎬ÌÓopòJ,óE!óE!óE!óE!óBóE!óK"óE!ì=&ì=&ëLEëLE×[hÕwŒÍ”¨Í”¨Í”¨‰ÄÍ”¨Í”¨Í’ÕwŒâƒŒæprêfXïTBñT8òT'óBóBòJ,ñK6ëLEÕwŒ¨ÅÛ—»Øˆ¶Ú’¾á¨ÅÛ·Ê×ÃÍÐÃÍЫ¹ÊŽ¬Ì—»Ø’¾á—»Ø·ÊרÅÛ¨ÅÛ·Ê×üÃÃÍФÊ⇽ã‰Än˜Ç‰Ä’¾á—»Ø¨ÅÛ·Ê×·Ê׬ÐášÆäˆÃéuÃñw»çzÂíˆÃéuÃñ‡½ãh¹éW•Én˜Ç[´èZ¨ÕWŠ³;F8:F/:OQ;F8;F8;F8QjJQjJQjJ:F/:F/:OQYuhv¤šz•yi†xi†x]…qYuhYuhj„hi†xoˆVj„hhxgQjJoˆVx”kVYGNf9hvXx†h[tX[tXj„h[tXhuIhuIQjJJU:GH8IWGhuIoˆVhvX[tXx”kj„hoˆVoˆVghHQjJWW8hvXj„hj„hYeHIWGIWGNf9IWGQjJYeHVYGQjJWW8JU:VYGWW8IWG—ˆI§˜W´±oȵlȵl´±o¯§V¯§V¯§V§˜W—ˆI™¥h©•o—ˆI®’K§˜W§˜W§§h§˜W®’K§˜W—˜g—˜Y•ŠW‡‡I‡‡Iˆ–h•ŠW—˜Y—˜Y—˜Ywv;gg9gg9WW8D:+5+(5+()'&5+(:F/86+86+86+YeHWW8UL-Ze;Ze;86+5+(5+(86+5+(86+86+:F/86+%#)'&:F/&-12:GF5>h=d‹=d‹[´è[´èZ¨Õw»ç’¾ášÆä‰ÄSw©n˜Çh¹éw»çq¬Ô—»Ø¨ÅÛ¨ÅÛüèÅÛ’¾á—»Ø‰Äˆ¶Úˆ¶Ú’¾á·Ê×·ÊרÅÛ¨ÅÛ—»Ø«¹Ê’¾á’¾áˆ¶ÚŽ¬Ì«¹Ê·Ê×·ÊרÅÛ’¾áŽ¬ÌÕwŒëYVóE!óE!óBóE!óE!óE!òJ,óBì=&ì=&ì=&×[h×[hÕwŒÍ”¨Í”¨Í”¨ÕwŒÍ”¨ÕwŒÕwŒÍ’ãvˆæprèrYñT8êfXñT8ð=ñK6êI8ì=&×[h¯™§¨ÅÛ—»Øˆ¶Ú’¾á¤Êâ·Ê×ÃÍзÊ×—»Øq¬Ô’¾á’¾á·Ê×·Ê×’¾á¨ÅÛ·Ê×·Ê×·ÊךÆä‰Äq¬Ô‰Äˆ¶Ú’¾á¨ÅÛ·Ê×·Ê×ÃÍЬÐášÆ䇽ãˆÃ釽ㇽãˆÃéuÃñuÃñ[´èn˜Çq¬Ôh¹éZ¨Õ=ee-12:F/:F/:F/:OQ;F8JU:IWG:F/:F/:F/Nf9KeWQjJ[tX[tXQjJj„h]…qQjJIWG[tXj„hwˆwj„hhvXYeHhvXQjJZe;JU:Nf9hvXhvX[tXQjJQjJNf9JU:YeHVYGNf9[tX[tX]…qhvXj„h[tXIYVi†x[tX[tX[tXhvXhvXhuIQjJNf9IWGVYGVYGJU:Nf9VYGJU:JU:JU:JU:IWGNf9’•I§˜W§˜W§˜W§˜W§˜W´±o¯§V¦¨w¦¨w•ŠW‘rM©•o—˜g§˜W§˜W§˜W’•I§˜W¯§V—˜Y§˜W§§h—˜Y§˜W§˜W§˜W§˜W˜¥W§˜W•ŠW†yHwv;fZ8GF-%#86+5+(:F/:F/86+86+:F/JU:JU:UL-UL-GF-GF-UL-D:+GF-GF-GF-995-12:F/86+)'&%#&5>h=d‹=d‹W•É[´è[´è[´è’¾á¤Êâ‰Än˜ÇSw©n˜Çw»ç‡½ã’¾á¨ÅÛ¨ÅÛ·Ê×·ÊרÅÛšÆä‰Ä‰Ä‰Ä—»Ø·Ê×·ÊרÅÛ¨ÅÛ·Ê×·ÊרÅÛ’¾á’¾á‰ÄŽ¬ÌÃÍзÊרÅÛ¨ÅÛ—»ØÍ”¨ëYVóE!óBóE!óK"ñK6ñK6ïTBóBì=&ì=&Ò9(×[h×[h×[hÕwŒÕwŒ¯™§Í”¨ÕwŒÕwŒÍ”¨âƒŒêfXíWHñT8òT'ñK6òT'ì=&ëLEëLEëLE×[h‰Ä¨ÅÛ—»Øˆ¶Ú’¾á¨ÅÛ·Ê×ÃÍзÊ׉ć½ã’¾á¨ÅÛ·ÊרÅÛ¨ÅÛ¨ÅÛ·Ê×ÃÍзÊׇ½ãq¬Ô‰ÄŽ¬Ì‡½ãšÆä¨ÅÛ·Ê×üÃÃÍЬÐá”ÃäˆÃéˆÃ釽ãuÃñˆÃ釽ãw»çW•Éq¬ÔˆÃéq¬ÔWŠ³=ee:F/Nf9:OQ;F8Nf9-12:F/KeWQjJ;F8;F8:F/Nf9KeWQjJhvXhvXYuhYuhQjJQjJ[tXhxgj„hi†xfjgYeHhxg[tXhvXj„h[tX‡—xz•yhvXoˆVx”koˆVJU:JU:[tXhuIoˆVoˆV[tX[tXj„hhxg[tXQjJQjJ[tXQjJj„hQjJYeHGH8JU:IWGYeHNf9IYVNf9WW8JU:GH8IWGVYGVYGKeW®’KÇšHÇšH§˜W•ŠW®’K®’K¯§V´±o¯§V®’K—ˆI§˜W¦©ˆ§§h¯§V§˜W§˜W´±o§§h§˜W¯§V¯§V¯§V¯§V§˜W§˜W˜¥W—˜g§˜W—˜Y‡—xhuIGF-86+)'&GF-:F/JU:YeHIWGD:+D:+86+GF-UL-5+(86+5+(5+(GH8YeHWW899586+GH8GH8;F886+-12)'&&=d‹=d‹Sw©[´è[´è[´è[´è¨ÅÛ’¾á‰ÄSw©‰Äw»ç‡½ãšÆä¨ÅÛ¨ÅÛ¨ÅÛ·ÊרÅÛ—»Ø—»Ø‰Ä‰Ä’¾á¨ÅÛ·Ê×·ÊרÅÛ¨ÅÛ·ÊרÅÛ—»Ø’¾áŽ¬Ì‰Ä·Ê×·Ê×·ÊרÅÛ¨ÅÛ¯™§æprëLEì=&óE!òT'òJ,òJ,ñK6óBóBð=òJ,ëYVëLE×[h×[hÍ”¨ÕwŒÕwŒÕwŒÍ”¨ÕwŒæprê\eìdJñT8óK"óE!óK"òT'êfXñK6ëLEÕwŒˆ¶Ú—»Øˆ¶Ú’¾á’¾á·Ê×ÃÍзÊרÅۉć½ã’¾á¨ÅÛ·ÊרÅÛ—»Ø¨ÅÛ·Ê×·ÊפÊ∶Ún˜Ç‰Äˆ¶Ú’¾á·Ê×ÃÍÐÃÍÐÃÍзÊרÅÛ‡½ãˆÃéˆÃéuÃñˆÃéuÃñˆÃé[´èW•Éq¬Ôq¬Ôq¬ÔZ†IWGKeW:OQ:F/Nf9;F8:GF=eeQjJKeW;F8KeWNf9:F/QjJKeWIWGQjJKeWXgWQjJYeH[tXYeHVYGNf9YeHfjVfjVfjVfjVXgW[tXhvXx†hoˆVoˆVhuIhuIQjJWW8IWGYeH]…qj„hhuINf9[tX[tXYeHYeHXgWXgWhvXx”khxgYeHYeHNf9IWGVYGXgWXgWXgWVYGGJFUK7Nf9VYGJU:;F8—ˆI§˜W§˜W®’K®’K¯§V¯§VÇšH®’K®’K§˜W©•o§§h·²§˜Wȵl¯§V´±o´±o´±o´±o§˜W§˜W§˜W—˜g§§h©•o§§h—˜g‰•YwˆwYeHJU:GF-)'&:F/:F/GF-GH8UK7GJF9955+()'&D:+GF-)'&86+86+)'&5+(86+86+GF-;F8995995-1286+-12)'&-12&&=d‹=d‹=d‹W•ÉW•É[´èh¹é’¾á¨ÅÛ‰ÄSw©Sw©w»ç‡½ã‡½ã—»Ø¨ÅÛ·Ê×·ÊרÅÛ«¹Ê·Ê׉ĉĈ¶Ú·Ê×·Ê×üèÅÛ«¹Ê·Ê×ÃÍЫ¹Ê’¾á‰Ä‰Ä·Ê×·Ê×·ÊךÂݨÅÛ¯ª¶ãvˆê\eòJ,óE!ñK6ñK6òJ,óBóBð=óBëLEëLEê\e×[hÕwŒÕwŒÕwŒ‰Ä‰ÄŸx‡ÕwŒèggèggèggñT8óK"óK"óE!óK"ñK6ñK6ëLEÍ”¨šÆä¨ÅÛ—»Ø’¾ášÆä¨ÅÛ·Ê×·Ê×—»Øn˜Ç’¾á’¾á¨ÅÛ·ÊרÅÛ¨ÅÛü÷Ê×·Ê×’¾án˜Ç‰ÄŽ¬Ì«¹Ê—»Ø·Ê×ÃÍÐÃÍзÊ×·ÊךÆ䇽ãˆÃéˆÃéˆÃéˆÃéuÃñh¹én˜Çq¬Ôˆ¶Úq¬ÔWŠ³Jgn;F8KeWQjJ:GF;F8-12Nf9[tXNf9:OQKeW]…q]…qQjJYuhXgWQjJYuhYeHIWGIWGQjJhvXhvXYeHJU:XgWhvX[tXNf9IWGVYGZe;gg9huIZe;huIQjJIWGhuI[tXYeHfjgz•‡j„hQjJQjJ[tXhvXQjJWifYeHYeHhxgi†xj„hXgWXgWYeHKeWQjJQjJVYGJU:JU:JU:GJFIWGVZVQjJGH8²Š8’•I¯§V§˜W§˜W®’KÇšH¯§V§˜W´±o´±oÇšH¯§V´±oÄ°”§§h§§h´±o¯§V´±o¯§V§˜W§§h´±o—˜g§§h™¥h‰•YwwHYeHGF-86+:F/86+)'&#)'&)'&-125+(99586+5+(D<5GF-JU:UL-UL-5+(#5+(86+86+995GH8D<586+86+-12)'&&:F/)'&&5>h=d‹=d‹=d‹W•É[´èd½ïh¹éˆ¶Ú—»ØŽ¬Ìn˜ÇW•Éh¹é‡½ã‡½ã¨ÅÛ¨ÅÛ·Ê×·ÊרÅÛšÆ䫹ʉĉĈ¶Ú¨ÅÛ·Ê×·Ê×·ÊרÅÛ¨ÅÛ·Ê×·Ê×—»Øˆ¶Ú‰Ä«¹Êü÷Ê×’¾á—»Ø«¹ÊÕwŒèggïTBóK"óK"òJ,óK"óBóBð=óE!êI8êI8×[hÕwŒ×[h×[hÕwŒÕwŒÕwŒÕwŒÓop×[hèggèrYòJ,óBóE!óE!òJ,ì=&ñK6×[h¯ª¶¨ÅÛ¨ÅÛ—»Ø—»Ø’¾á·Ê×·Ê×·Ê׉Än˜Ç’¾á’¾á¨ÅÛ·ÊרÅÛ¨ÅÛ·Ê×ÃÍзÊׇ½ã‰Ä‰ÄŽ¬Ì—»Ø·Ê×ÃÍÐÃÍÐÃÍÐÃÍШÅÛšÆ䒾ᇽãˆÃéˆÃéˆÃéuÃñn˜ÇW•Éq¬Ôh¹éZ¨ÕWŠ³:OQ39I:OQQjJ:F/Nf9Nf9:F/;F8:OQKeWYuh]…q]…q[tXQjJIWGIWGKeWKeWIWGIYVQjJfjVhxguzvhvXhuIj„hoˆVVYGYeHhvXj„hXgWj„hhxgJU:UK7JU:huIhvXfjVQjJYeHhvXVYGJU:JU:VYG[tXYeH[tX[tXYuhgyw[tXQjJYeHYeHYeHVYGYeHVYGUK7QjJVYGUK7VYGKeWQjJGH8‘ˆ;¬u/‘ˆ;ÇšH®’KÇšHÏQȵl¯§VȵlÇšH®’K¯§VÇšH·²´±o´±o´±o¯§V´±o¯§V§˜W—˜Y•ŠW‰•Y‡‡IwwHUK7WW8GH8995995)'&86+:F/)'&)'&GJF;F8;F8995995D<5GH8D:+GF-UL-86+%#)'&)'&5+(86+:F/GF-:OQ-12:F/-12)'&#)'&)'&&&5>hW•É=d‹Sw©Z¨Õq¬Ôh¹éw»ç’¾á¨ÅÛ‰Än˜Çn˜Çw»ç‡½ã’¾á·Ê×ü÷ÊרÅÛ¨ÅÛ¨ÅÛ‰Än˜Ç‰Ä’¾áüÃÃÍзÊרÅÛ«¹ÊüèÅÛ—»Øˆ¶Ú‰Ä«¹Ê·Ê×·ÊרÅÛ¨ÅÛ«¹ÊÍ”¨æpríWHóK"óK"òJ,óK"óE!óBð=ì=&ì=&ëLE×[h×[h×[hÕwŒÕwŒÕwŒÕwŒÕwŒÕwŒëYVëYVêV&òJ,óE!óE!óE!óE!ì=&êI8×[h«¹Ê¨ÅÛ«¹Êˆ¶Ú’¾á¨ÅÛ·Ê×·ÊרÅۉĉĒ¾á¨ÅÛ·Ê×üèÅÛ·Ê×·Ê×·Ê×·Ê׈¶Ú‰Äˆ¶Úˆ¶Ú—»ØüÃÃÍÐÃÍÐÃÍзÊרÅÛ’¾á”ÃäˆÃé”ÃäˆÃéˆÃ釽ãZ¨Õn˜Çˆ¶ÚmÀëmÀëWŠ³:GFJU:KeW;F8:F/:F/:GF;F8-12:F/:GFIWGJU:KeW[tX]…q[tXGJFGH8JU:QjJQjJNf9ghHYeHfjV†‰gz•yj„hoˆVj„hhvXx…Xx†hXgW[tXi†xfjVVYGGJFVZVgywhxgfjVQjJVYGJU:JU:Nf9JU:GJFWifWifhxgYuhYuhXgW[tXhuIXgW[tXYuhWifQjJJU:VYGIWGIWGIWGIWGVYGGJF¬u/²Š8²Š8ÇšHÇšH¯§VÏQ¯§V¯§V§˜Wȵlȵl©•o´±o´±o·²§§h§˜W•ŠW•ŠW‘rM‡ˆX†yHˆ–hwxWZe;WW886+:F/GH8GF-GF-:F/Nf9GF-86+:F/JU:JU:VYG995-125+(5+()'&GF-Nf9GF-86+5+()'&5+(D:+GF-GF-995:F/;F8-12&)'&)'&&5>hW•ÉSw©=d‹W•É[´è[´èh¹é’¾á’¾á—»Øn˜ÇW•Éw»ç‡½ã’¾á·Ê×ÃÍÐÃÍзÊרÅÛ¨ÅÛ‰Än˜Ç‰Ä‡½ã¨ÅÛ·Ê×·Ê×·ÊרÅÛü÷Ê׫¹Ê’¾á‰Ä«¹Ê·Ê×·Ê×·ÊרÅÛ—»ØÍ”¨èggïTBóK"óK"òT'ëH&óE!óE!ð=ð=òJ,êI8ëLE×[h×[h×[h×[h±spÕwŒÕwŒèggïTBïTBóK"óK"óE!óE!ð=óBì=&ëLEŸx‡¨ÅÛ¨ÅÛ—»Ø’¾á’¾á¨ÅÛÃÍзÊ×’¾án˜Çˆ¶Ú’¾á¨ÅÛ·Ê×·ÊרÅÛ·Ê×·Ê×·Ê×—»Øn˜Çˆ¶Ú—»ØŽ¬Ì¨ÅÛ·Ê×ÃÍÐÃÍзÊפÊâšÆä’¾á”ÃäˆÃé”ÃäˆÃéˆÃé[´èW•Én˜Çw»çh¹éq¬ÔZ†;F8-12;F8Nf9;F8:F/;F8-12-12;F8=eeQjJKeWJU:JU:=eeQjJKeWKeWYuhz•‡YuhQjJVYGQjJIWGIWG[tXhuI[tXj„hhvXwxWghHJU:UK7VYGhuIQjJNf9YeH[tXXgWXgWhvXXgWVYGNf9VYGQjJIWGIYVKeWYuh[tXhvXYeHfjVYeHVYGYeH[tXXgWJU:GH8JU:JU:QjJQjJJU:GH8JU:®’K²Š8®’K®’K¯§Vȵlȵlȵlȵlȵl¯§V©•o§˜W´±o§˜W§§h©•o§˜W‘rM†yH‘rMwv;wwH†‰ghuIghHe[GJU::F/GF-UL-GF-GF-UL-JU:Ze;GF--12995-1239I995995-12:F/86+JU:GF-GF-86+86+86+D<5D<586+86+:F/-12)'&86+:F/:F/)'&&&5>hSw©Sw©=d‹Sw©W•É[´èq¬Ôq¬Ô’¾á—»Øn˜ÇW•ÉZ¨Õh¹é’¾á·Ê×ÃÍÐÃÍÐüèÅÛ¨ÅÛ—»Ø‰Ä‰Äˆ¶Ú¨ÅÛÃÍÐüë¹Ê«¹Ê·Ê×üèÅÛ’¾á‡½ãŽ¬Ì·Ê×üë¹Ê¨ÅÛ«¹Ê¯™§èggñK6óE!óK"óK"óE!óE!óBð=ð=ì=&ì=&ëLEëLE×[h×[hÕwŒÕwŒÍ’ÕwŒèggëYVñT8óK"óK"óE!ð=óE!ñK6ñK6×[hÍ”¨¨ÅÛ·Ê׎¬Ì’¾á—»Ø¨ÅÛ·Ê×·Êׇ½ãn˜Ç‡½ã’¾á—»Ø·Ê×·ÊרÅÛ¨ÅÛ¨ÅÛ¨ÅÛˆ¶Ú‰ÄŽ¬Ì—»Ø—»Ø¨ÅÛÃÍÐÃÍзÊ×·ÊפÊâ’¾áˆÃéˆÃéˆÃéˆÃéˆÃ釽ãW•Én˜Çq¬Ôw»çd½ïW•ÉJgn:F/86+:F/JU:-12:F/;F8-12:F/JU:Yuh[tXKeWKeWJgnZwvi†xi‡‡]…qZwvz•yz•‡hxgQjJhuI[tXVYGJU:YeHhvXhvXghHVYG[tXVYGGH8VYG[tXfjVJU:hvXhuIghHIWGWW8YeHQjJYeHVYGQjJ[tXIWGVYGYuhXgWYeHYeHYeH[tXQjJQjJghHhuIVYGVYGGJFNf9VYGJU:JU:GF-GF-®’K®’K¯§V¯§VÏQ¯§V´±oȵlȵl©•o©•o§˜W´±oÄ°”¦¨w•ŠW§˜W–šw•ŠW®’K—ˆI†yHwv;fZ8ghHfZ8WW8UL-GF-UL-UL-gg9gg9UL-JU:YeHIWG-12)'&)'&-125+(GH8IWG86+5+(:F/86+5+(86+86+86+5+(5+(995D<5:OQ;F8:F/:F/:F/&)'&&&5>h=d‹Sw©=d‹Sw©[´è[´èh¹éw»ç’¾á—»Ø—»Øn˜Çn˜Çw»ç’¾á¨ÅÛ·Ê×ÃÍзÊרÅÛ¨Åۉė»Ø‰Än˜Ç—»Ø·Ê×ü÷Ê׫¹Ê«¹Êüë¹Ê—»Ø—»Ø‰Ä«¹Ê·Ê×ÃÍШÅÛ—»Ø¯ª¶ÓopëYVòJ,óBóK"óE!ð=óBð=ð=ì=&êI8ëLE×[h×[hÕwŒÕwŒÍ’⃌Óop×[hèggñT8òT'óK"óBóBóE!ñK6êI8ëYV¯ª¶·ÊרÅÛŽ¬Ì’¾á’¾á·Ê×·ÊרÅÛ‡½ãn˜Ç’¾á¨ÅÛ¨ÅÛüèÅÛ¨ÅÛ¨ÅÛ¨ÅÛ¨ÅÛŽ¬Ìˆ¶Ú‰ÄŽ¬Ì’¾á¨ÅÛ¨ÅÛ·Ê×ÃÍШÅÛˆÃéˆÃéˆÃéˆÃéˆÃéˆÃéuÃñ[´èn˜Çw»çw»çw»çw»çSw©:OQ-12:F/IWG:OQ;F8;F8=ee:F/:GF=ee]…q=eeJgn[tXKeW=eeJgni‡‡hxgQjJVYG[tX]…qhvXXgWhvXYeHJU:995VYGhuIXgWIWGVYGj„h[tX[tX[tX[tXVZVfjVhuIYeHWW8JU:UK7JU:YeH[tXj„hj„hYeHIWGQjJfjVQjJZe;YeHghHYeHNf9YeH[tXghHVYGVYGJU:JU:JU:Nf9Ze;JU:²Š8ÇšHÇšHÇšHÏQÏQ´±o§§h§˜W®’K•ŠW§˜W®’K¯§V§˜W®’K®’K´±o–š‡§˜W§§h—˜gvi8wv;wwHvi8wv;gg9WW8lr9wwHlr9gg9Nf9GH8WifVYG:F/GF-86+)'&-12F<EGH886+D<5Nf9UL-86+GF-D<55+(%#-12995995:F/Nf9=ee:F/-12&&5>hW•ÉSw©=d‹W•É[´èh¹éw»ç‡½ãˆ¶Úˆ¶Ú‰ÄW•Éw»çw»ç‡½ã·Ê×ÃÍÐÃÍÐüèÅÛ—»Ø‰Ä‰Äˆ¶Ú‰Ä«¹Ê«¹ÊüèÅÛ¨ÅÛ·Ê×·Ê×—»ØŽ¬Ì‰Ä«¹Ê·Ê×ÃÍзÊ×—»Ø•®²ÕwŒèggñT8óE!óK"óK"ì=&óBóBóE!ð=Ò9(Ò9(²SN×[h×[h×[hÍ”¨ÕwŒ×[hëYVèggòT'óK"óK"óE!óBóE!ì=&ì=&×[h¯ª¶·Ê׫¹Ê—»Ø‡½ã—»Ø¨ÅÛ¨ÅÛ¨ÅۉĉĒ¾ášÆä¨ÅÛ·ÊרÅÛ¨ÅÛ¨ÅÛ·ÊרÅۉĉĎ¬Ì‰ÄŽ¬Ì—»Ø¨ÅÛ·Ê×·Ê×”Ã䇽ãˆÃéˆÃ釽ãw»çuÃñh¹éWŠ³n˜Ç‡½ã‡½ãh¹éZ¨ÕWŠ³IYV=ee;F8-12:F/:F/;F8Nf9=eeIWGQjJ=eeQjJKeW;F8;F8IWGQjJYuhYuhIWGGJFQjJXgWWifi†xj„hx”kQjJUK7JU:Ze;[tX[tXYeHj„hx”kx”ki†xQjJVYGYeHhxghuIXgWQjJXgWYeHXgWoˆVoˆV[tXQjJVYGIWGYeHhvXYeHYeHYeHQjJYeHYeHYeHYeHYeHYeHJU:Nf9WW8WW8JU:JU:²Š8®’KÇšHÏQ¯§VÇšHÇšHÇšHÇšH¯§V®’KÇšH©•oÏQ®’K®’K¯§V´±o©•o©•o•ŠW†yHvi8Žr6†yHŽr6Žr6Žr6†yH‘ˆ;huIujGwwHhuIYeHVYGGF-Ze;UL-)'&%#-12D<55+(995D<5GH8D:+D:+86+5+()'&)'&:F/;F89955+(86+JU:995)'&&5>h&5>hW•ÉW•É=d‹W•É[´èh¹éw»ç‡½ã’¾á—»Øq¬Ôn˜ÇZ¨Õw»çˆ¶Ú—»ØÃÍÐÃÍÐÃÍЫ¹Ê—»Ø‰Ä‰Ä‰Ä‰ÄŽ¬ÌŽ¬Ì«¹Êüë¹Êü÷Ê×—»Øˆ¶Ú‰Ä—»Ø·Ê×·Ê×·Ê×—»Ø‰ÄÕwŒê\eëLEì=&óE!óE!ì=&ð=óBð=ì=&Ò9(ëLE×[hÓopÕwŒÕwŒÕwŒÕwŒãvˆíWHïTBóK"óE!óE!óE!ð=ì=&ì=&êI8×[h«¹Ê¨ÅÛ—»Øˆ¶Ú—»Ø—»Ø¨ÅÛ·Ê×—»Ø‰Äw»ç’¾á¨ÅÛ¨ÅÛ·ÊרÅÛ¨ÅÛ¨ÅÛ·Ê×—»Ø‰Ä‰Ä‰Ä‰Äˆ¶Ú—»Ø·Ê×ÃÍзÊ×”Ã䇽ㇽãˆÃéˆÃéˆÃéuÃñn˜ÇWŠ³—»ØˆÃézÂímÀëZ¨Õ=d‹995:OQ:OQ-12-12-12-12:F/:OQ:OQJU:KeW:OQIWGKeWJU:IWGQjJIWG[tXWifXgWKeW[tX]…qQjJYeHj„hj„hYeHYeHNf9YeH[tXhxgfjVoˆVˆ–hx”khvXQjJJU:[tXhvXhvXYeHghHYeHYeHghHhuIYeHJU:VYGXgWXgWfjVhvXfjVhuIhuIhvXfjVYeHghHYeHYeHNf9WW8WW8WW8UK7JU:Ì“2«¢;¯§VÏQÇšHÇšHÏQ¯§V¯§VÏQÏQ´±oȵl©•o¯§V§˜W—ˆIŽr6†yH—ˆI—˜g—ˆIŽr6‘ˆ;‘ˆ;‘ˆ;vi8gg9vi8fZ8huI‡‡Ivi8WW8JU:)'&GF-UL-)'&)'&5+(D<5D<59955+(5+(86+)'&#)'&5+(5+()'&86+-1286+995995;F8995)'&%#&)'&&&39ISw©Z¨ÕWl˜Wl˜[´èh¹éh¹é‡½ã’¾á—»Ø‰ÄWŠ³Z¨Õw»çw»çŽ¬ÌüÃÃÍÐÃÍзÊרÅÛ«¹Ê‰Än˜Çˆ¶Ú«¹Ê‰Ä‰Ä‰ÄŽ¬Ì«¹Ê¨ÅÛ«¹Ê—»ØŽ¬Ì‰ÄüÃüèÅÛ—»Ø«¹ÊÍ”¨×[hñK6ð=óK"óE!ð=ð=ð=ð=ì=&êI8×[h×[hÕwŒ×[h×[hëLEÓTMëLEïTBñT8óE!óE!óBð=óE!ð=ì=&ì=&×[hüèÅÛŽ¬Ìˆ¶Ú’¾á«¹Ê·Ê×·Ê׉Än˜Çˆ¶Ú—»Ø¨ÅÛ¨ÅÛ·ÊרÅÛ¨ÅÛ·ÊרÅÛ‡½ã‰Än˜Ç‰Äˆ¶Ú’¾á·Ê×ü÷Ê×’¾áˆÃ釽ㇽãˆÃéˆÃéuÃñh¹éWŠ³n˜ÇŽÁÚmÀëh¹éh¹éW•ÉZwv=ee:OQ:F/:F/-12:F/;F8:OQ=eeIWG=eeKeWIWGYuhZwv=eeNf9IWGIWGIYVYuh]…q]…q]…qj„h[tXVZV[tXz•‡hvXYeHUK7YeHoˆVhxgXgWYeHfjVYeHhvXhvXVYGIWGIWGWW8YeHZe;[tXhvXQjJ[tXQjJYeHJU:VYGVYGYeHYeHhvXYeHVYGZe;YeHZe;Ze;Ze;Ze;Ze;YeHQjJVYGVYGVYGÏQÙ¸HÙ¸HÏQÇšHȵl¯§VÏQȵlȵl®’KÇšHÏQ¯§VÇšH®’K‘ˆ;Žr6—ˆIŽr6—ˆI´±o©•o®’K—ˆI†yHgg9vi8vi8gg9†yHfZ8)'&##)'&5+(5+(5+(5+(5+(995995-125+(86+5+(%#%#%#)'&5+(5+(5+(86+5+(995995-12)'&)'&#&%#&5>h39I=d‹Z¨ÕW•É=d‹WŠ³[´èh¹éh¹é‡½ã¨ÅÛ—»ØSw©WŠ³w»ç‡½ã‡½ã¨ÅÛÃÍÐüèÅÛŽ¬Ì‰Än˜ÇŽ¬Ìˆ¶Ú·ÊרÅÛŽ¬Ì‰Ä‰Ä—»ØŽ¬Ì«¹Ê—»Ø‰Ä‰Ä«¹Ê·ÊרÅÛ—»Ø«¹Ê¯ª¶ÓopëLEòJ,óK"óE!ð=ð=ð=ð=ëH&ëLEëLEÓTM×[h×[h×[h×[h×[hëLEïTBñT8òJ,óE!óBóE!óE!ð=ì=&ì=&ÕwŒ¨ÅÛ¨ÅÛŽ¬ÌŽ¬Ì—»Ø—»Ø«¹Ê¨ÅÛ‰Än˜Ç‰Ä—»Ø«¹Ê—»Ø·Ê׫¹Ê¨ÅÛ¨ÅÛšÆäw»çn˜Ç‰Ä‰ÄŽ¬Ì¨ÅÛ·Ê×·Ê׬Ðá’¾áw»çw»çuÃñˆÃéˆÃéuÃñn˜ÇSw©q¬Ô’¾ázÂímÀëh¹éZ†Zwv:OQ:F/-12-12:F/-12)'&-1239I:OQ=ee=ee:OQQjJ=eeKeWIWGKeWKeWYuhj”’v¤ši†xj„hhuIj„h[tXKeW[tX[tXYeHYeHYeHhxgz•y[tXVYGXgWVYGfjVhvX[tXYeHIWGZe;YeHNf9QjJhxgj„hz•yhxghvXYeHZe;IWGUK7VYGYeHYeHWW8UK7JU:WW8WW8WW8Nf9VYGYeHYeHe[GYeHZe;ÏQÏQÏQ¯§VȵlȵlȵlȵlȵlÏQȵl¯§Vȵl§§h§˜W§˜W¯§V®’K—ˆI—ˆI®’K¯§V¯§V©•o—˜g…{Wvi8†yHwv;gg9fZ85+(##)'&UL-86+)'&:F/:F/995995-12)'&)'&)'&9955+()'&%##&)'&5+()'&-12-12995:F/-12#&39I39I5>hSw©W•É=d‹Wl˜Z¨Õh¹éw»ç‡½ãšÆä’¾á‰ÄWŠ³W•É‡½ãˆ¶Ú—»Ø·Ê׫¹Ê¨ÅÛŽ¬ÌŽ¬Ì‰Ä‰Äˆ¶ÚŽ¬Ì«¹Ê·Ê׫¹Ê—»ØŽ¬Ì‰Ä‰Äˆ¶Ú‰Ä‰Ä«¹Ê«¹Ê¨ÅÛ¨ÅÛ—»Ø«¹ÊÓopòJ,òJ,ëH&óBóBóBóBóBêI8êI8ëLEëLE×[hÕwŒÕwŒ×[hê\eëLEòJ,òJ,òJ,óE!óBóBì=&ì=&ì=&ëLEÍ”¨·Ê×—»ØŽ¬Ì—»Ø—»Ø¨ÅÛ¨ÅÛ‰Än˜Ç‰Ä—»Ø¨ÅÛ—»Ø—»Ø—»Ø¨ÅÛ«¹Ê—»Ø‰Ä‰Än˜Çn˜Ç‰Ä—»Ø·Ê×·Ê×·ÊךÆ䇽ãw»çh¹é‡½ãˆÃéˆÃ釽ãSw©o®ˆ¶Ú’¾ámÀëmÀëZ¨ÕZ†:OQ-12:F/:F/;F8:F/-12:F/:F/:OQ:OQNf9QjJIWGJU:Nf9;F8;F8IYVYuhi†xi‡‡Zwvi†xj”’i†x[tX]…qQjJIWGVYGUK7JU:XgWIWGVZVNf9IWGYeHXgWfjV[tXhvXYeHVYGYeHVYGVZVIWGfjV[tXhxgYuhfjV[tXYeHIYVVYGe[GXgWYeHVYGIWGYeHQjJYeHghHYeHZe;YeHVYGJU:Ze;Nf9ÇšH«¢;¯§VȵlÏQȵlȵlȵlÇšHȵl®’K©•o•ŠW©•oÇšH®’KÇšH«¢;®’K®’K®’K®’K—ˆI’•I˜¥W–šw…{WwwHwxWwxWUL-D:+86+5+(:F/86+5+(86+GF-UL-IWG9955+()'&%#)'&)'&#%#86+IWGIYV:GF-12:F/86+99539I-12-12&&&-12=d‹W•ÉSw©MYjW•Éh¹éh¹é‡½ã’¾á’¾á‰ÄW•ÉW•Éq¬Ôw»ç‡½ã—»Ø«¹Ê¨ÅÛ«¹Ê—»Ø‰Ä‰Ä‰Ä‡½ã¨ÅÛÃÍзÊ×·ÊרÅÛ—»Ø—»Ø«¹Ê—»Ø‰Ä«¹Ê«¹Ê«¹Ê—»Ø«¹Ê¯ª¶×[hñK6ñK6òJ,òT'ëH&ëH&óBì=&ì=&êI8ÓTM×[h×[hÕwŒÕwŒ×[hëLEëLEòJ,óK"óK"óK"ð=óE!ð=ì=&ì=&ê\eüèÅÛŽ¬Ì‰Ä—»Ø¨ÅÛ·Ê׫¹Ê‰ÄSw©‰Ä’¾á¨ÅÛ—»ØŽ¬Ì—»Ø¨ÅÛ·Ê×—»Øq¬Ôn˜ÇSw©‰Ä‰Ä’¾á·Ê×·ÊרÅÛ’¾áw»çw»ç‡½ãw»çw»çh¹éW•ÉSw©q¬ÔšÆäzÂíjÁòjÁòW•ÉJgn39I-12&:F/:F/=eeJgnJgnYuhZwvYuh=ee:OQKeWIWGJU::GFIWGKeWZwvWif]…qi‡‡YuhYuhYuhZwvw‰‡i†xYuhIWGYeHQjJJU:QjJVYGGH8GH8GH8XgWYuh[tXfjVYeHfjVhvXghHfjVYeHYeH[tXYeHXgWe[GQjJYeHYeHfjV[tXYeHfjVYeHVYGYeHghHghHlr9YeHZe;[tXZe;WW8WW8Ze;«¢;ÇšHÏQÏQÇšH¯§VÇšH®’K©•oÇšH®’K®’K®’K®’KÇšH®’K«¢;Ì“2ÇšHÌ“2²Š8²Š8—ˆIŽr6wv;•ŠW¦¨w–šw¦©——˜gUL-5+(D:+GF-UL-:F/GF-D:+GH8GH899586+)'&86+5+()'&)'+(995IWGIYVhxghxg:GF995GH8IYV:GF&&&&39I39I:OQ=ee=d‹Sw©:QlW•É[´èh¹éw»ç’¾á¨ÅÛŽ¬Ìn˜ÇW•Éw»çˆ¶Ú‰Ä—»ØŽ¬Ì¨ÅÛ¨ÅÛ—»Ø‰Än˜Çn˜ÇŽ¬Ì¨ÅÛ·Ê×ÃÍзÊ×·Ê×üά̉ė»ØŽ¬ÌŽ¬Ì«¹Ê«¹Ê«¹Ê«¹Ê¯ª¶ãvˆñK6êI8êI8ëH&ëH&óE!ì=&ì=&Ò9(ëLE×[hëLE×[h×[hÕwŒÍ”¨ãvˆëLEñK6òT'ñK6òJ,óE!ì=&ì=&ì=&ì=&×[hü׻؉Ď¬Ì¨ÅÛ·ÊרÅۉĉÄn˜Ç‰Ä—»Ø—»Ø—»Ø¨ÅÛ¨ÅÛ·ÊרÅÛ—»Ø‰ÄSw©‰Ä‰Ä—»Ø¨ÅÛ·Ê×·ÊרÅÛ‡½ãw»çw»çw»çw»çuÃñn˜ÇWl˜‰Ä’¾á”Ãäw»çh¹éh¹éWŠ³=d‹:OQ;F8-12:F/:F/:OQ:OQ;F8:GF=eeIYVIYVKeWKeWIWGIWG[tX=eeZwvwˆwi†x]…qYuh]…q]…qIYVIYVXgW[tXj„hhvXhvXuyghuI[tXIWG;F8GH8IWGVYGYeHfjVhvXhuIfjVhuIYeHfjVXgWIWG[tXhxghxg[tXVYGfjVfjgXgWVYGVYGVYGYeHYeHYeHZe;Ze;Ze;Ze;gg9ghHYeHZe;WW8IWGÏQÏQÏQ¯§V¯§VÏQÏQ¯§VÇšH¯§V¯§VÇšH®’KÇšHÇšHÇšHÏQÇšHÇšH®’K—ˆI•ŠW—ˆI¬u/‘ˆ;—ˆIwwHujG‡ˆX†‰ge[GD<5D:+fZ8WW8UL-86+86+GF-GH886+:F/5+(86+:F/5+(#-12;F85+(-12-12-12IWGgywVZV:GF:GFJU::OQ;F8=ee:OQ:OQ=ee=ee:GF-12:OQ=eeW•É=d‹Sw©[´è[´èw»ç‡½ã’¾á¨ÅÛ‰ÄW•Éh¹é‡½ãˆ¶Ú‰Ä¨ÅÛ«¹Ê«¹Ê—»Ø‰Ä‰Än˜Çq¬Ô—»Ø¨ÅÛü÷ÊרÅÛ·ÊרÅÛ—»Ø—»Ø‰Ä‰ÄŽ¬Ì«¹Ê«¹Ê¯ª¶¯ª¶æprêI8êI8òJ,ð=ëH&ð=ð=ð=ì=&êI8ëLEÓTM×[hÕwŒÕwŒÕwŒê\eëYVíWHñT8ñT8ñT8ì=&ñK6ì=&ì=&ì=&ãvˆÍ”¨—»Ø‰Ä’¾á¤Êâ·ÊרÅÛ‰ÄSw©Sw©’¾á—»Ø—»Ø¨ÅÛ—»Ø¨ÅÛ·ÊרÅÛ’¾á‰ÄWl˜‰Ä‰Äˆ¶Ú·Ê×·Ê×·Ê×’¾áw»çq¬Ôh¹é[´èq¬Ô‡½ãn˜ÇSw©—»Ø’¾á‡½ãh¹éh¹éW•ÉSw©=d‹=ee=d‹=ee=ee:F/-12-12:F/;F8;F8:GF:OQ;F8:OQKeWIWG=eeQjJKeWQjJ[tX[tXXgW[tXXgW[tXQjJIWGGJFIWGNf9YeHQjJYeHYeHVYGIWG;F8VYGhvXXgWj„hhxg[tXYeHYeHfjVhvXfjVJU:YeHXgWhxghvXXgWfjVi†xhxgXgWfjVfjgXgWVYGJU:WW8Ze;gg9ghHgg9Ze;Ze;Ze;YeHVYGÇšHÇšH²Š8ÇšHÇšHÏQÇšHÇšHÇšHÏQÇšHÇšHÇšHÇšHÌ“2Ù«9ÇšH®’K²Š8—ˆI‘rMŽr6‘ˆ;‘ˆ;Žr6Žr6fZ8UK7fZ8vi8wwH—˜YwxWgg9GF-GF-86+86+86+995D:+9955+(86+)'&)'&#:GFOKN5+()'&##%#995[tXYuh:OQ995:GF=ee=eeJgn=ee=ee:F/-12-12:Ql:QlSw©W•É=d‹W•Éd½ïw»çw»ç‡½ã’¾á‰ÄSw©[´èq¬Ôq¬Ô‰ÄŽ¬Ì«¹Ê—»Ø‰Ä‰Än˜Ç‰Ä‡½ã—»Ø·Ê×·Ê׫¹Ê·ÊרÅÛ«¹Ê—»Ø—»Øˆ¶Ú‰Ä‰Ä«¹Ê¨ÅÛ«¹Ê¯™§ÓgVëH&êI8ëH&ð=Ò9(ð=ð=ì=&êI8êI8ÓTM×[hÕwŒÕwŒÕwŒÕwŒ×[hëLEñT8òT'òT'òT'ì=&ì=&ì=&ì=&ëLEÍ”¨Í”¨«¹Ê—»Ø¤Êâ·Ê×·ÊרÅÛ‰Än˜Ç‰Ä’¾á—»Ø—»Øˆ¶Ú—»Ø·ÊרÅÛ¨ÅÛ‡½ã‰ÄWl˜pxŒ‰Ä—»Ø·Ê×·Ê×’¾á‡½ãw»çw»çq¬ÔZ¨Õ‡½ãn˜ÇSw©‰Ä¨ÅÛ‡½ãh¹éh¹éZ¨ÕWŠ³=d‹=ee=ee:OQ:OQ=ee=ee=ee:GF86+:GF:GF;F8;F8;F8:F/;F8:OQ;F8:F/;F8IWGGJF;F8IWGIYVKeWWif[tXIWGWifYeHUK7JU:JU:GH8WW8YeHYeHVYGUK7j„hx†hz•y‰¥—hxgXgWVZVVYGj„hx†hhvXXgWVYGfjVfjVghHVZVuyghxgYeHVZVXgWVYGVYGWW8JU:JU:Ze;Ze;YeHgg9Ze;Ze;Ze;YeHÇšH®’KÇšH²Š8²Š8ÇšHÇšHÇšHÇšH¯§V§˜WÇšHÏQÏQÇšHÇšH®’K®’K®’K§˜W‘rM²Š8²Š8Žr6Žr6wv;lr9vi8oQ/vi8vi8vi8wwH‡ˆXwxWVYG;F8-12GH8GF-86+86+86+86+GF-5+(%#GH8GF-)'&###)'&)'&995GJFXgWKeW:OQ:OQJgn=ee:F/&&&&:Ql5>hSpŽZ¨ÕSw©=d‹Z¨Õh¹éw»ç‡½ã”Ã䈶Úo®W•Éw»çˆ¶Ú—»Ø—»Ø«¹Ê—»Ø‰ÄWl˜‰Ä‰ÄŽ¬Ì—»Ø·Ê×ÃÍзÊ׫¹Ê—»Ø¨ÅÛ—»Ø—»Øˆ¶Ú‰Ä‰Ä¯ª¶«¹Ê«¹ÊÕwŒêI8ð=ëH&ëH&ð=ð=ð=ð=ð=ì=&êI8ëLEÓTM×[hÕwŒãvˆãvˆãvˆÓopñT8ìdJïTBòT'ñT8òJ,ñK6ì=&êI8ÕwŒ¯ª¶¯ª¶Ž¬Ì·Ê×·Ê×·Ê×—»Øo®Sw©n˜Ç’¾á—»Ø’¾á—»Ø·Ê×·ÊרÅÛ’¾á‰Än˜ÇWl˜Wl˜ˆ¶Ú—»Ø·ÊפÊ⇽ãw»çˆ¶Úh¹éh¹éw»çw»çSw©n˜Ç‡½ã”Ãäh¹éh¹éh¹éZ¨ÕWŠ³SpŽJgn:Ql:OQ:OQ=eeKeW=ee:OQ-12:GF:OQJU:IYV:QlfjgWiwgywpxŒhˆ–wŠ•wŠ•wŠ•gywwˆwZwvgywi‡‡YuhIWGKeWhxgIWGJU:JU:JU:JU:JU:QjJQjJJU:VYGhxgoˆVj„hj„hhvXghHVYGhxgj„hwxWhxgYeHfjVj„hfjVVYGYeHZe;WW8IWGGH8GH8GJFVYGXgWVYGVYGWW8Ze;WW8e[GYeHWW8Ze;ÇšHÇšHÇšHÇšHÇšH¯§V®’KÇšHÇšHÇšHÇšH®’KÇšH©•oÇšH§˜W®’K¯§V®’K²Š8²Š8²Š8Žr6‘ˆ;Žr6vi8lr9gg9wv;‘ˆ;Žr6vi8gg9Žr6wwH‡ˆXhxgGJF995-125+(86+GF-9955+(%#995;F8)'&%#)'&5+()'&)'&)'&-12-12-12995KeW]…qYuh:OQ&&&&&5>h=d‹Sw©[´èn˜Ç=d‹W•Éd½ïw»ç‡½ã‡½ãˆ¶Úo®WŠ³[´èw»çˆ¶Úˆ¶Ú—»ØŽ¬Ì‰Ä‰ÄpxŒo®‰ÄŽ¬Ì«¹Ê·Ê×üèÅÛ«¹Ê«¹Ê«¹Ê¨ÅÛ—»Ø‰Ä‰Ä—»Ø¨ÅÛ«¹ÊæpróE!ð=ëH&ð=ð=Ò9(óBð=ëH&ì=&ëH&ÓTMãvˆ×[hègg×[hÓopÓopìdJñT8ñT8óK"ñT8ñT8ñT8ëLEòJ,ëLE×[hÍ”¨‰Ä«¹Ê·Ê×·Ê×·Ê׎¬ÌWl˜Sw©ˆ¶Ú—»Ø¨ÅÛ¨ÅÛ’¾á·Ê×·ÊךÆ䇽ãn˜ÇWl˜l[io®‰Ä—»Ø¨ÅÛ’¾áw»ç‡½ãw»çh¹éh¹é‡½ãn˜ÇSw©Sw©‰Äq¬Ôn˜Çw»çh¹éW•ÉWŠ³WŠ³=d‹=ee=ee39I:GF:GF:OQ:GF:OQIYVZwvj”’w‰‡WiwfjgWifIWGOKNIYVi‡‡i†xuzvgywuzvpxŒwŠ•‡™—‡˜‡YuhVZVYeHYeHWW8YeHGF-:F/UL-VYGhxghvXhvXj„hfjgYeHYeHhvXfjVYeHhuI[tXhuIoˆVhvXfjVx†hoˆVhuIYeHNf9VYGVYGYeHUK7GH8GH8WW8VYGWW8WW8UL-WW8Ze;Ze;Ze;YeHÇšH¯§V¯§VȵlÏQÏQÇšHÏQÏQÇšH©•oÇšH®’K©•o¯§V®’K®’K—ˆI‘rM²Š8—ˆI®’K—ˆI—ˆI‘ˆ;y„<wv;‘ˆ;‘ˆ;Žr6Žr6lr9vi8gg9fZ8UK7e[Gj„hhxg:GF&)'&5+(###995995#&5+(-12;F8:F/-12)'&)'&-1239I995-12-12=ee]…q=d‹=ee:OQ&39I=d‹:QlW•ÉW•ÉWl˜Wl˜W•Éq¬Ôw»çw»çˆ¶Ú‰ÄWŠ³W•Éh¹éw»ç‡½ãˆ¶Ú¨ÅۉĉÄWl˜‰Än˜Çˆ¶ÚŽ¬Ìü÷Ê׫¹Ê·Ê׉Ď¬Ì«¹Ê—»Ø‰Ä‰Ä«¹Ê—»ØüÃÓopìV:ëH&ëH&ì=&Ò9(ì=&ð=óBóE!ëH&ìV:×[hê\e×[hÓopÕwŒÓopÓopèggñT8ñT8òT'òT'ëH&ñK6êI8òJ,ëLE×[hÍ”¨¯ª¶¨ÅÛ¨ÅÛ·Ê×·Ê׉ÄWl˜n˜ÇŽ¬Ì—»Ø¨ÅÛ¨ÅÛ—»Ø·ÊרÅÛ—»Øˆ¶Úo®l[iWl˜o®’¾á¨ÅÛ¨ÅÛ—»Ø‡½ãw»çw»çw»çw»çw»çn˜ÇSw©n˜Çn˜Çn˜Çh¹éw»çZ¨ÕSw©Wl˜=d‹JgnWiwSpŽJgnJgnMYj:QlWiwgy†i‡‡gywKeWGJF995;F8:GF=eeIWG:GF:GFQjJQjJIWGIWGVZVIYVOKNfjgw‰‡‡™—wˆwYeHJU:VYGZe;VYGWW8JU:YeHVYGfjVfjVfjgVYGVYGghHhuIYeHfjVhvXujGfjVfjVuyghxgwˆwj„hhvXfjVVYGWW8VYGVYGUK7XgWVYGJU:JU:Ze;Ze;GH8Ze;gg9fZ8Ze;ÏQÏQÇšHÇšHÇšH®’KÇšHÇšHÇšHÏQÇšHÏQÇšHÏQÇšH®’K®’K²Š8²Š8®’K‘ˆ;†yH•ŠW•ŠW‘ˆ;Žr6‘ˆ;Žr6wv;Žr6vi8Žr6Žr6vi8wv;UK75+(5+(UK7wxWhvXIWG)'&&GJF)'&##5+(;F8XgWKeWKeWMYj:OQGJFGH8-12&&-12=eeNf9:OQ:Ql&&:Ql=d‹SpŽW•ÉW•É=d‹W•É[´èh¹éZ¨Õn˜Çˆ¶Úo®Sw©h¹é‡½ãˆ¶Ú‡½ãŽ¬Ì‰Ä‰Äo®pxŒn˜Ç‰Ä—»Ø—»Ø«¹Ê‰ÄŽ¬Ì‰ÄŽ¬ÌŽ¬ÌŽ¬Ì‰Äo®‰Ä«¹ÊÍ”¨æprñK6êI8ÔM1ð=ð=ð=ð=óBëH&ñT8ìV:íWH×[h×[hæprÓop⃌æprëYVñT8òT'òT'ñT8òT'ìV:íWHêI8ì=&ÕwŒÍ”¨¯ª¶·Ê×·Ê×·ÊרÅÛ‰ÄWl˜‰Ä—»Ø¨ÅÛ«¹ÊŽ¬Ì—»Ø«¹Ê—»Ø’¾á‰Än˜ÇWl˜Wl˜‰Ä’¾á¨ÅÛ’¾áw»çw»çw»çh¹éh¹éh¹én˜ÇSw©n˜Çq¬Ô‰Än˜Ç‡½ã[´èWŠ³W•ÉWŠ³=d‹=d‹=ee:OQ=eeJgngy†ZwvXgWGJF995-1286+86+;F8:GF;F8KeWIWG:GF;F8JU:IWG:GFIYVi†x[tX:F/:GFGJFOKNgyw…Šwuzv[tXZe;huINf9huIWW8JU:Ze;WW8VYGUK7JU:JU:VYGhvXhvXhxghvXhvX[tXfjVfjV[tXuygwxWhuIhvXhuIYeHNf9UK7fjVXgWNf9WW8Ze;Ze;JU:UK7Ze;Ze;Ze;ÇšHÏQÏQÇšHÇšHÇšHÇšHÇšHÏQÇšHÏQÏQÇšHÐ…x®’K®’K²Š8¬u/¬u/Žr6Žr6Žr6Žr6†yH‘ˆ;‘ˆ;‘ˆ;Žr6‘ˆ;¬u/—ˆI—ˆIwv;lr9fZ8GF-##%#5+(UK7wxWuygOKN&-12OKN)'&OKNgywwˆwojoKeWKeW;F8-12-12-12)'&;F8:OQ-12:OQ:OQ39I:OQ=d‹SpŽW•ÉSw©=d‹Sw©[´èq¬ÔSw©n˜Ç‡½ãn˜ÇWl˜W•Éh¹éˆ¶Úq¬Ô‰Ä‰Ä‰Ä‰ÄSw©pxŒ‰Ä‰Ä‰Ä‰Ä‰ÄŽ¬ÌŽ¬Ì‰Ä—»Ø«¹Ê«¹ÊwŠ•‰ÄüÃÍ”¨ÓgVÓTMïTBëH&ð=ð=ð=óBð=óE!ëH&òJ,ëLEëYV×[hÓopÓopæpræprìdJñT8ïTBòT'ìdJñT8ìV:ìdJëLEì=&ëYVÍ”¨«¹Ê¨ÅÛ¨ÅÛ·Ê׫¹ÊSw©Wl˜‰Ä«¹Ê—»Ø—»ØŽ¬Ì—»ØŽ¬Ì—»Ø—»Øq¬ÔSw©Wl˜o®‰Ä’¾á’¾áw»çw»çh¹éh¹éh¹éh¹éZ¨Õn˜ÇSw©n˜Çq¬Ôn˜ÇW•ÉZ¨ÕW•ÉSw©n˜Çq¬ÔWŠ³:Ql:Ql:QlJgnZ†gy†IYVIWGGH8:F/;F8;F8:GFIWG:OQ;F8:GFKeWQjJIWGIWGIWGJU:;F8:OQKeWKeW[tXXgWGJFGF-GJFWifz•‡‰¥—i†x]…qhvX[tXWW8ghHhuINf9UK7VYGfjVVZVghHhuIghHYeHfjVghHfjVhuIhvXhvXfjVghHhvXoˆVhvXVYGUK7YeHZe;Nf9JU:WW8UK7UK7Ze;Ze;Nf9WW8ÇšHÏQÙ¸HÇšHÏQÇšHÇšH¯§VÏQȵlÏQÇšHÇšH®’KÇšHÇšH‘ˆ;¬u/Žr6vi8Žr6‘ˆ;—ˆIŽr6wv;‘ˆ;‡‡I’•I—ˆI®’K—ˆIwwHfZ8UL-GF-5+()'&%#)'&#%#)'&GH8fjVhxgwˆwVZV-12-12:OQl[iojolWRVYG995-12:F/995-12)'&-12)'&)'&-12:F/)'&-12:F/:OQ:OQ=ee=d‹Sw©W•ÉWŠ³Wl˜W•Én˜ÇW•Én˜Çq¬Ôn˜ÇWl˜Sw©n˜Çh¹én˜Çn˜Ç‰Ä‡½ã‰ÄpxŒWl˜n˜Ç‰Ä‰Ä‰ÄŽ¬Ì—»Ø«¹Ê—»Ø—»Ø‰Ä‰Ä‰Ä¯™§Í’Ð…xèggêfXìV:ð=óBð=ëH&ð=óE!óE!ëH&ìV:ëLEíWH×[hÓopÕwŒãvˆÓopìdJòT'óK"ñT8ìV:òT'ïTBìV:êI8ì=&ëYVÍ”¨«¹Ê«¹Ê«¹Ê‰Ä‰Äl[iWl˜‰Ä—»Øˆ¶Ú—»Ø—»Ø¨ÅÛ—»Ø¨ÅÛˆ¶Ún˜ÇWl˜l[iWl˜‰Äˆ¶Úˆ¶Úw»çh¹éw»çw»çw»çn˜ÇW•ÉSw©n˜Çˆ¶Úq¬Ôq¬ÔW•ÉZ¨ÕSpŽSw©W•ÉZ¨ÕSpŽZ†SpŽJgnIYVKeWJgnIYVIWG;F8;F8GJFGH8:GF:GFJU:IWGKeWWifIWG:OQIWGIWGJU:IWGIWGVZVKeWWifYuhWifOKNWifgy†w‰‡z•‡‡˜‡z•yghHYeHJU:YeHhvXfjVVZVOKNVYGVYGfjVhvXZe;Ze;JU:WW8VYGhvXXgWhvXhuIYeHYeHhuIhuIYeHVYGWW8Ze;gg9Ze;UL-GF-UK7UL-WW8WW8Ze;ÏQÏQÏQÏQÏQÇšHÏQÏQÏQÇšHÇšH°mS®’K¯§VÇšH®’K‘ˆ;Žr6IŽr6Žr6‘ˆ;‘ˆ;—ˆI—ˆI—ˆI¯§V¯§V—ˆI‡ˆXwwHvi8WW8GH886+)'&)'&)'&)'&-12)'&)'&%#%#995IWGojogyww‰‡wˆw[tXIYV39I39IKeWXgWIYVOKN:OQMYj=eeJgn:OQ:GF:F/:OQ:GF:F/&&39I:Ql=d‹W•ÉZ¨ÕWl˜Sw©W•É[´èd½ïq¬Ô‰ÄSw©=d‹Sw©W•Én˜Çn˜Çˆ¶Ú’¾á‰Ä‰ÄpxŒo®n˜ÇŽ¬Ì«¹ÊŽ¬Ì«¹Ê—»Ø—»ØŽ¬ÌŽ¬ÌŽ¬ÌŒš§±spÓopÓgVæpr×[hêI8êI8ëH&óBð=óBóE!óE!òJ,íWHègg×[hæprÕwŒæprèggêfXìdJñT8ñT8ìV:ïTBñT8ëYVìV:êI8êI8ëLEÕwŒ¯ª¶«¹Ê‰Ä‰ÄŽ¬Ìl[iWl˜q¬Ô—»Øˆ¶Úˆ¶ÚŽ¬Ì—»Ø—»ØŽ¬Ìn˜Ço®l[iMYjSw©ˆ¶Úˆ¶Úw»çh¹éh¹éw»çˆ¶Ún˜ÇW•ÉWl˜Wl˜‰ÄšÆäw»çn˜ÇW•ÉWl˜=d‹W•Éq¬ÔZ¨Õ=d‹SpŽZ†Z†Jgn:GF:OQGJF;F8995IYVJgnKeW;F8:GF:GFGJFIWGKeWJgnQjJIWGKeWQjJIYVYuhWiwWifWifZwvZwvw‰‡i†xfjgXgWhvXhvXx†hwˆw[tXZe;YeHhxgfjVYeHghHYeHXgWe[G[tXfjVVYGXgWYeHYeHfjVfjVi†xhxgYeHVYGVYGYeHVYGe[Ge[Ge[GZe;YeHUL-UL-Ze;YeHWW8Ze;ghHÏQ¯§VÏQÏQȵlȵlÏQȵlÐ…x®’KÇšH®’KÇšHÇšHÇšH²Š8¬u/Žr6vi8Žr6‘ˆ;¬u/²Š8®’K—ˆI®’K§˜W—ˆI—˜g™¥hwwHujGOKNGJFGH886+995-12-12IWGJgn:Ql:GF;F8-12)'&)'&)'&995GJFVYGhvXZwvZwvZwvi†xi†xYuhfjghxg]…qKeW=ee:OQ-12-12&-12-12&-12:QlJgnSw©q¬ÔW•É=d‹W•É[´èh¹éw»çˆ¶Ú‰Äl[i5>hSw©Sw©q¬Ô’¾á‡½ã‰Äo®o®Wl˜n˜Ç—»Ø¨ÅÛ«¹Ê—»Ø—»ØŽ¬ÌŽ¬Ì¨ÅÛ—»Ø‰ÄtnÓopêfXÓgVëLEÔM1ëH&ëH&óE!óBóBóE!óE!êI8íWHê\e×[hãvˆãvˆèggëYVíWHìdJíWHïTBñT8ñT8óK"òT'ëH&ëH&êI8ëLEÕwŒÃ¼Ã«¹Ê‰Äˆ¶Ú‰ÄWiwSw©ˆ¶Úˆ¶Ú—»Øˆ¶ÚŽ¬Ì—»Ø—»Øˆ¶Úo®WiwMYjl[in˜Çˆ¶Úq¬Ôh¹én˜Çn˜Ç‡½ãˆ¶Ún˜ÇW•ÉSw©‰Ä¨ÅÛ’¾áw»çn˜ÇSw©=d‹Sw©W•ÉW•ÉWŠ³SpŽSpŽSw©Jgn:QlIYVIYV:OQGJF:GF:F/JU:GF-GJFIWGGH8;F8995GJFGJFGJFJU:[tX[tXIWG:OQWifZwvw‰‡gy†VZVVYGXgWVYGUK7fjV[tXVYG[tXfjgXgWVYGXgWwxWfjVYeHe[GVYGYeHXgWhuIfjVgyww‰‡hxgfjghvX[tXfjgfjVhuIXgWghHghHYeHVYGVYGWW8Ze;Ze;UK7Ze;VYGVYGZe;VYGÏQÏQÏQȵlȵlȵlȵlÏQ®’K©•o®’K®’KÇšH®’K²Š8Žr6Žr6‘rM²Š8Ì“2²Š8²Š8²Š8—ˆI—ˆI²Š8®’K—ˆI§˜W—ˆIwv;oQ/GF-GH8:F/GJFIWGIWGGJFVYGGJFIYV=eeWif:F/UL-:F/)'&)'&5+(86+:F/Nf9Nf9JU:;F8:F/995995-12-125+(:GF:OQ:OQ-12-12=ee39I&:OQ=d‹=d‹:QlW•ÉW•ÉSpŽSw©Z¨Õ[´èuÃñ‡½ãq¬ÔWl˜OKNWl˜‰Än˜Ç‰Ä’¾á‰ÄWl˜pxŒl[iW•ÉŽ¬ÌŽ¬Ì¨ÅÛ¨ÅÛ¨ÅÛ—»Ø—»ØŽ¬Ì¨ÅۉıspÕwŒÓTMêI8ÔM1òJ,òJ,òJ,óE!óE!òT'óBóE!ñK6ñK6ê\eÓopÕwŒÕwŒèggêfXíWHíWHïTBñT8ñT8ñT8ñK6òJ,êI8êI8òJ,êI8ÕwŒ¯ª¶«¹Ê—»Ø—»Øn˜Çl[iSw©‰Ä’¾á¨ÅÛ—»Ø—»Ø¨ÅÛˆ¶Úˆ¶ÚSw©Wl˜Wl˜l[io®n˜Ç‰Ä‰Än˜Çn˜Çw»çq¬Ôn˜ÇSw©Sw©‰Ä’¾áw»çn˜ÇSw©MYjWl˜W•Én˜ÇWŠ³:QlSw©n˜ÇWŠ³=d‹JgnJgnWiwJgnJgnIWG;F8:GFIWGIWGGJF:OQGJFIYVIWG;F8;F8;F8KeWYuhIYV=eeZwvojofjVVYGJU:VYGYeHfjVYeHJU:JU:QjJQjJUK7JU:IWGYeHhvX[tXghHYeHYeHe[GghHj„hhvXj„hgywhxgfjVhxghxgfjVVZVhvXwxWhvXhvX[tXVYGJU:e[GYeHYeHWW8e[GVYGWW8WW8XgWÏQÜÄLÙ¸HÏQÏQÏQÏQÏQÇšHÇšHÇšHÏQÇšH°mSŽr6¬u/¬u/Ì“2ÇšHÌ“2Ì“2¬u/²Š8¬u/Žr6¬u/Žr6Žr6²Š8†yHlr9WW8GF-UL-;F8JU:IWGGH8-12995-1299599586+86+)'&#)'&86+5+()'&:F/:F/JU::F/:F/;F839I;F8IWG:F/&-12=ee=ee=ee=ee=ee:OQ39I:OQSpŽSpŽSpŽZ¨Õn˜ÇSpŽWŠ³Z¨ÕjÁò‡½ãn˜ÇpxŒ5>hWl˜Sw©n˜Çn˜Ç‰Ä‰ÄWl˜l[il[iSw©ˆ¶Ú—»Ø¨ÅÛ—»Ø«¹Ê—»Ø‰Ä«¹Ê—»Ø¯ª¶ÕwŒÓopëYVíWHêI8òJ,òJ,óE!óE!óK"òJ,òJ,ëH&ñK6ëLEëYVíWHíWH×[hæpríWHíWHíWHñT8ñT8ñT8ìdJñK6ñK6óE!ìV:íWHêI8ëYV¸¨¨«¹Ê¨ÅÛ’¾áŒš§Wl˜n˜Ç‡½ã’¾á·Ê×·ÊרÅÛšÆ䇽ãn˜ÇWl˜pxŒl[iWl˜Sw©o®n˜ÇSw©Sw©n˜Ç‰Ä‡½ãW•ÉWl˜n˜Ç’¾á‡½ãn˜ÇW•É=d‹5>h=d‹W•ÉSw©=d‹=d‹WŠ³Wl˜Z†Z†SpŽ=eeJgnWiwSpŽKeWWiwJgnJgnJgnIYVIWG:GFIWGIWGIWGKeWIYVJgnZwvgywWifIWGIWGGH8GH8VYGUK7VYGYeHXgWVYGJU:JU:WW8JU:UK7OKNwˆwgywfjg[tXfjVghHfjVWW8hvXuyghxghxghvXfjVhxghxgYeHghHXgWhvXhuIfjVVYGe[GVYGVYGgg9ghHZe;YeHYeHYeHVYGYeHÙ¸HÙ¸HÏQÇšHÏQÏQÏQÇšHÌ“2ÇšHÇšHÇšHÇšH¬u/¬u/¬u/Ì“2Ì“2Ì“2²Š8²Š8²Š8²Š8Žr6—ˆI—ˆI—ˆI²Š8Žr6lr9fZ8UL-fZ8WW85+(5+(GH886+%#)'&-12995GJF995)'&5+(86+86+5+()'&)'&)'&5+()'&:F/JU:GH8:GF:F/:F/:F/-12-12-1239I:GF=ee=ee=ee39I39I5>h=d‹W•É=d‹Sw©o®SpŽ=d‹W•Éh¹éw»çq¬Ôo®Wl˜5>hWl˜Sw©n˜Ç‰Ä‰Än˜ÇWl˜Wl˜Sw©Ž¬Ì—»Ø¨ÅÛ¨ÅÛ—»Ø‰Ä‰Ä«¹Ê—»Ø¯ª¶Í’×[hëLEñK6óBëH&óK"óK"óK"óK"òJ,ñK6òJ,òJ,ñT8ëYVëYVæpr⃌æprê\eìV:ñT8ñT8ñT8ñT8ñT8ñK6ïTBóK"òJ,ëYVêI8ëLEÕwŒÍ”¨¨ÅÛ—»ØpxŒMYjn˜ÇŽ¬Ì—»Ø¨ÅÛ·ÊרÅÛ’¾áˆ¶Ún˜ÇpxŒl[iWl˜Sw©Sw©n˜Çn˜ÇW•Én˜Ç‰Ä‡½ãw»çSw©Wl˜n˜Ç’¾áˆ¶Ún˜ÇSw©Wl˜5>hWŠ³W•ÉWŠ³Wl˜WŠ³WŠ³Z†WŠ³WŠ³Z†Jgn:QlSpŽWiwWiwWifJgnWiwWiwIYVIWG;F8;F8:GF:GFIYVJgni‡‡hˆ–IYVGJFGJFGJFVYGVZVYeHVYGVYGXgW[tXYeHZe;YeHYeHQjJVYGYeHwˆw‡˜‡hxghxghvXuzvhvXVYGVYGVYGXgWghHXgWhvXhvXfjVYeHVYGYeHfjVfjVhuIYeHWW8UK7e[GYeHYeHghHfjVhvXwxWhuIgg9Ù«9ÇšHÙ«9ÏQÙ¸HÙ«9Ù«9Ù«9ÇšHÇšHÇšHÌ“2°mS°gÙm"Ì“2׎׎¬u/²Š8ÇšH²Š8‘rM‘rM§˜W®’K²Š8‘ˆ;Žr6wv;UL-UL-GF-D:+)'&86+86+-12-12;F8;F8GH8GH8995)'&)'&)'&)'&###)'&)'&:F/:F/86+;F8;F8-12-12-12:F/:OQ;F8:OQ:OQ:OQ:OQ-12-125>h=d‹=d‹W•ÉWŠ³Sw©Sw©WŠ³SpŽSw©[´èZ¨ÕW•Én˜ÇSw©Wl˜Sw©W•ÉSw©‰Äˆ¶Úq¬ÔSw©l[iWŠ³‰Ä‰Ä—»Ø—»Ø«¹Ê‰ÄŽ¬Ì«¹Êüø¨¨ÓgVíWHìV:òJ,òJ,óK"óE!óE!óE!óK"òJ,óE!óBóE!ñK6íWHëYVãvˆãvˆê\eíWHñT8òJ,óK"òJ,òT'ñT8ñT8ñT8ïTBñT8íWHìV:ëLEèggÍ”¨«¹Ê‰ÄWiwl[io®‰Ä—»Ø¨ÅÛ¨ÅÛ¨ÅÛ‡½ãn˜ÇWl˜Wl˜MYjn˜Ç‰Ä‰Än˜Çn˜Çn˜Çn˜Çn˜Ç‡½ãZ¨ÕWl˜Sw©‰Äw»çq¬ÔSw©5>h5>hW•Éw»çZ¨ÕWŠ³=d‹o®WŠ³Wl˜WŠ³o®W•ÉSpŽSpŽJgn=ee:QlIYVWiwZwvWifIYVIYV:OQIWGIYVKeWYuhZ†ZwvKeWGJFIYVIYVIWGVZVXgWVZVVZVVZVfjVhvXXgWYeHYeH[tXQjJYeHVZVVYGfjghvXfjVfjVhvXuyghvXVYGUK7YeHVYGVYGghHhuIghHVYGUK7VYGhvXwˆwhvXfjVghHWW8ghHhuIXgWghHghHukXhvXfjVghHÙ«9Ù«9Ù«9Ù«9Ù«9Ù«9ÇšHÇšHÇšHÇšHÇšHÓgV¬u/Ùm"׎̓2ÇšH²Š8ÇšHÇšHÇšH°mS®’KÇšH®’K®’K²Š8‘ˆ;‘ˆ;oQ/5+(GF-D:+86+5+(GH8Nf9JU:99586+86+99586+99586+86+5+(-1286+:GFIYVIYVYuhYuh[tXKeW:OQGJFIWGIWG:F/;F839I%#)'&:OQ:GF-125>h:Ql:Ql=d‹=d‹Sw©Sw©W•ÉZ¨ÕSw©MYj=d‹Z¨Õn˜ÇWŠ³n˜Çn˜ÇWl˜Z¨Õw»çn˜Çˆ¶Úˆ¶Ú‰Äo®MYjWl˜pxŒn˜Ç—»ØŽ¬Ì‰Ä‰ÄŽ¬Ì©¶¸¸¨¨ÕwŒêfXìV:óK"òT'ëH&óK"ð=óBóE!òJ,òJ,óE!óE!òJ,ñK6ëYVê\eëYVëYVìdJëYVñT8ñT8òT'ñK6ñT8ñT8ñT8ïTBìdJñT8ñK6ëLEëLEê\eÍ”¨¯ª¶o®MYjSw©‰Ä—»Ø¨ÅÛ¨ÅÛ’¾á’¾áˆ¶Ún˜ÇWl˜l[iWl˜n˜Ç‡½ãˆ¶Úw»çn˜Çw»ç‡½ã‡½ãh¹éW•ÉSw©‰Än˜Çn˜Çn˜ÇWl˜MYjSw©q¬Ôq¬ÔW•ÉWl˜SpŽn˜ÇSpŽSpŽZ†SpŽSpŽWiwWiwSpŽJgnKeW:GFJgnZ†SpŽgy†ZwvSpŽj”’z•‡y–—hˆ–YuhVZVVZVIWGIYVKeWVZVVZVVYGVZVVYGVYGVZVghHfjVYeHWW8VYGNf9VYGJU:UK7VYGYeHIWGVZVYeHhxguyghvXVYGVYGVYGfjVXgWghHghHGJFUK7e[GfjVuzvuyghvXfjVghHfjVwxWghHe[GfZ8e[GghHukXhvXÙ«9Ù«9Ù«9Ù¸HÙ«9ÇšHÇšHÇšHÇšHÏQÇšHÌ“2ÇšHÇšHÏQÏQÇšHÏQÏQÇšHÇšH®’K²Š8®’K²Š8®’KÏQ«¢;Žr6R4'D:+UL-R4'D:+GF-IWG99586+-12-12995)'&-1239I-125+(5+(86+86+GH8KeWWifKeWIWGYuhZwvZwvWifVZVIYVIYVKeW:OQ-12)'&&39I39I:OQ=ee:OQ:OQWl˜=d‹WŠ³Z¨Õh¹éw»çn˜Ç=d‹W•ÉW•ÉSw©n˜ÇW•ÉWl˜W•Éw»çw»ç‡½ã’¾á—»Øo®l[iSw©‰Ä‰Ä‰Ä‰Ä«¹Ê—»Ø«¹Ê¯ª¶ÕwŒèggêI8ñK6ñT8ìV:òJ,óE!ð=óBð=òJ,óE!óE!óE!ñK6ïTBëYVê\eèggèggèggñT8òT'ïTBïTBïTBìdJñT8ñT8ìdJïTBòT'òJ,ñK6ëLEê\eÕwŒ¯™§pxŒl[i‰ÄŽ¬Ì«¹Ê¨ÅÛ—»Ø—»Øˆ¶ÚŽ¬ÌWŠ³MYjMYjn˜Ç‰Äˆ¶Úˆ¶Ún˜Çn˜Çw»ç‡½ã‡½ãn˜ÇWl˜W•É‰Än˜Çn˜ÇWl˜F<EWl˜Sw©w»çw»çWŠ³:Ql=d‹Wl˜hˆ–Wl˜WŠ³Sw©Sw©SpŽ=ee=eeSpŽJgn=eeMYjKeWZwvZwvWiwWifSpŽWiwWifWifMYjWiwKeWWifWiwWifKeWhxgYuhhxgYuhVYGJU:VYGXgWfjVVYGIWGXgWVYGYeHVYGVYGVYGfjVYeHIWGVYGfjVj„hfjVYeHYeHhuIfjghvXfjVfjVfjVghHfjVVYGghHfjVujGhuIukXfjVghHYeHVYGWW8fZ8lWRwwHÙ«9Ù«9ÏQÙ«9ÇšHÏQÏQÏQÏQÙ¸HÙ«9ÇšHÇšHÇšHȵlȵlȵlȵlÏQÇšHÇšH®’K²Š8®’KÇšHÙ«9ÏQ²Š8oQ/R4'oQ/oQ/5+(D:+86+86+5+(86+;F8:GF39I:OQWifXgWJU:D<5###)'&)'&&-12VZVojowˆwwˆwfjgfjgfjghxghxg]…q]…q]…q=ee39I=ee39I:OQ=d‹=d‹W•ÉW•Éq¬Ôq¬Ôn˜Ç=d‹:QlWŠ³WŠ³W•ÉW•ÉWl˜Sw©q¬Ôw»ç‡½ã’¾á’¾áo®Wl˜n˜Çn˜Çq¬Ô—»Ø«¹Ê—»Ø¨ÅÛüÃű®ÕwŒÓTMòJ,òT'ñK6ïTBòJ,óE!óK"òJ,òJ,óE!óE!óE!óE!ìV:ïTBïTBëYVê\eê\eëYVñT8ñK6ïTBìdJòT'ñT8ñK6ñT8ñT8ñT8ñT8ñK6ñK6ëLEê\eÕwŒÕwŒl[i‰ÄŽ¬Ì«¹Ê«¹Ê¨ÅÛ«¹Ê—»ØšÆ䈶ÚWl˜Wl˜Wl˜‰Ä‡½ãˆ¶Ún˜ÇW•Én˜Ç’¾á’¾á‡½ãW•ÉWl˜n˜Çˆ¶Ún˜ÇSw©5>h5>hSw©[´èh¹éW•É=d‹5>h=d‹Wl˜JgnSw©Wl˜Z†Z†SpŽJgnJgnIYVIYV;F8:GFGJFMYjZwvZwvZwvGJF:GF:GF:OQIYVKeWXgWYuhfjgfjgXgWXgWfjgWiffjVXgWOKNVYGXgWXgWIWGJU:VZVVZVVYGUK7IWGIWGVZVWifKeWXgWXgWYeHXgWYeHVZVfjVfjVfjVghHhvXhvXfjghvXghHYeHe[Ge[GfjVwwHwxWghHukXhvXghHe[GghHhvXÙ«9ÇšHÙ«9ÏQÙ¸HÙ¸HÙ¸HÙ¸HÙ¸HÏQÇšH®’KÇšHÏQÏQÏQÙ¸HȵlÏQÏQÇšHÌ“2¬u/Ì“2Ì“2Ì“2²Š8‘ˆ;IoQ/oQ/UL-UL-86+#%#&:F/IWGXgWIYVVZVWifVZVVZVVZVVZVfjgl[iVZVVZVWifojopxŒ‡™—¯ª¶§¨¨‡™—w‰‡ojofjgGJF%#%#:F/:GF=ee=ee=ee=d‹:Ql39I:QlSw©Wl˜WŠ³W•Éh¹éˆ¶ÚWŠ³5>hWiwWŠ³Wl˜Sw©Sw©5>hW•Én˜Çq¬Ôˆ¶Ú‰Äo®l[iWl˜n˜Ç‰ÄŽ¬Ì—»Ø—»Ø«¹ÊüÃÍ’ê\eëYVñK6ëH&ñK6ñK6ñK6òJ,ëH&òJ,ñK6òJ,òJ,ñK6ñK6ëLEïTBëYVêfXæprèggëYVïTBïTBìdJíWHòJ,òJ,òT'ñT8ñK6ñK6ñT8ïTBïTBëLEëLE×[hÍ”¨‰Ä«¹Ê·Ê×·Ê×—»Ø¨ÅÛ«¹Ê‰Äˆ¶Ú‰ÄWl˜WiwSw©—»Ø”Ã䈶Ún˜ÇWŠ³n˜Ç’¾á‡½ãn˜ÇSw©Sw©‡½ãˆ¶Úo®MYj5>hSw©n˜Çw»çn˜ÇSw©=d‹JgnSpŽMYjSpŽ=d‹SpŽSw©WŠ³SpŽSpŽWiw=ee:OQIYVIWGIYVIYVKeWMYjZwvi‡‡WifIWGVYGVZVIWGIYVWiwfjgWifVZVVYGIYVOKNVYGVYGfjVVYGUK7WW8VYGUK7VYGghHOKNUK7OKNOKNWifw‰‡gyw[tXhxgXgWfjVe[GVYGWW8e[GlWRVYGghHghHghHfjVhxge[GWW8ghHhuIukXukXghHfjVwxWhvXujGghHhuIÏQÙ¸HÙ¸HÙ¸HÙ¸HÙ¸HÙ¸HÙ¸HÏQÏQÇšHÇšHÏQÏQÏQȵlÙ«9ÏQÙ¸HÇšHÇšHÇšH§˜WÐ…xÇšH®’K®’KŽr6oQ/vi8e[GlWRukXukXe[GlWRhxgwˆwtnwxWuyguyguygj„hx”khvXVYGVYGfZ8VYGe[Ge[Guyg¦©—–š‡†‰gx†hwˆwuzvfjgfjgVYG)'&&&-125>h5>h=d‹=d‹:Ql:QlSpŽ:Ql=d‹WŠ³h¹éq¬Ôo®5>h39IWl˜MYjo®Wl˜5>h=d‹Sw©Sw©n˜Ç‰ÄSw©l[iWl˜‰ÄŽ¬Ì—»Ø«¹Ê·Ê×ű®Í”¨æprê\eíWHòJ,ñK6ñT8òJ,òJ,óE!òJ,òJ,ñK6òJ,óK"ñK6ñK6ëYVê\eê\eêfXãvˆê\eìdJíWHíWHëYVïTBïTBñT8ïTBìdJïTBòJ,òT'ñK6ñK6ïTBëYVê\eÍ”¨Ã¼Ã«¹Êüë¹Ê«¹Ê‰ÄŽ¬Ì‰ÄŽ¬Ìn˜ÇWl˜Wl˜‰Ä’¾á’¾á‰Än˜Ç‰Ä‰Äq¬Ôn˜ÇSw©Wl˜n˜Çˆ¶Ún˜ÇWl˜39I5>hSw©w»çw»çW•ÉWl˜JgnSw©Sw©SpŽSpŽZ†JgnWŠ³Sw©=d‹SpŽWŠ³Z†=d‹JgnIYVIYV:F/:GF:GFIWGMYjZwvWiwIWGIWGIYVKeWWifYuhWifVZVVZVXgWXgWVYGGH8WW8VYGVYGJU:GJFIWGVZVfjVVYGVYGVZVfjghxggy†VZVfjVfjVfjVfjVfjgXgWYeHVYGUK7VYGWW8e[Ge[GVYGYeHukXukXfjVfjVhuIhvXujGe[GlWRfjVwxWhuIghHÏQÙ¸HÜÄLÙ¸HÜÄLÏQÙ¸HÏQÏQ«¢;ÇšHÌ“2ÏQÏQÜÄLÏQÙ¸HÙ¸HÙ¸HÙ«9Ì“2ÇšHÇšHÏQ¯§V´±o´±o¦¨w©•o©•o•Šm•ŠW•ŠWujGujGe[GUK7UK7D<55+(995-12;F8[tXGJF:OQ:OQ39I;F8QjJhxgfjg–š‡x†huygfjgVZVVZVIWG:GF:GF:OQ=ee:Ql=ee:Ql:Ql:QlJgnSpŽ=ee:Ql:OQJgn=d‹=d‹Sw©W•Éq¬ÔWŠ³MYjF<E5>hOKNo®Wl˜F<E5>hWl˜5>hWl˜Sw©Wl˜Wl˜n˜Ç‰Ä—»Ø—»Ø«¹ÊÍ”¨æprê\eíWHíWHñK6ñT8òT'ñT8ñT8ñK6òJ,òJ,ñK6ñK6ñK6òJ,ñK6ñK6ëYVê\eëYVêfXê\eêfXê\eëYVëYVêfXïTBñT8ñK6ïTBñT8ïTBñT8òT'ñK6ñT8ñK6ñK6ëLEæprÍ”¨¯ª¶«¹Ê«¹Ê—»Ø«¹Ê‰Ä‰Ä‰Än˜ÇWl˜5>hn˜Ç‰Ä‰Ä‰ÄSw©‰Ä‰Än˜ÇSw©WiwSw©n˜Ç‰ÄWl˜Wl˜=d‹Sw©n˜Çw»çn˜ÇSw©5>hWŠ³n˜Ço®Wl˜Wl˜=d‹SpŽWl˜SpŽ:GF:Ql=d‹SpŽWiwWiwYuhKeWIYVKeWIWGGH8:GF:GFJgngy†YuhWifKeWIYVXgWgy†gy†WifZwvi‡‡hxgVZVIWGVYGVYGVYGVYGUK7UK7WW8IWGOKNVYGuygx†hwˆwfjVOKNVYGVZVfjVukXfjghvXe[GVYGUK7UK7VYGghHfjVfjVghHfjVghHukXhuIwxWwxWfjVghHhuIujGukXukXÙ¸HÜÄLÜÄLÙ¸HÏQÜÄLÏQÙ«9ÇšHÏQÙ«9ÏQÏQÙ¸HÏQÙ¸HÜÄLÏQÙ«9Ì“2Ù«9ÇšHÇšHÇšHÇšH®’K¬u/—ˆIŽr6Žr6Žr6P,R4'5+(D:+5+(86+86+-12)'&)'&-12:GFIYV:GFIYV]…qw‰‡gywVZVgyw†Š‡ghHVYGIWGYeHYuhojowˆwwˆwhxghxghxgWiwWiwZwvhˆ–y–—wŠ•y–—gy†WifMYjMYjSpŽMYj:QlSpŽW•ÉWŠ³Sw©:Ql=d‹Wl˜WŠ³Wl˜=d‹Wl˜Wl˜W•Én˜Çˆ¶Ún˜Ç‰ÄŽ¬ÌŽ¬Ì«¹Êű®Í’æprìV:êI8ñK6ñK6ëLEê\eñT8òJ,ñK6òJ,óE!òJ,òJ,òJ,ñK6ñK6ñK6ñK6íWHê\eìdJê\eëYVëYVêfXïTBïTBïTBíWHíWHñT8ñT8ìdJñT8ïTBñT8òJ,òT'ñT8ñK6ëLEëYVÕwŒÅ±®Ã¼Ã«¹Ê¨ÅÛ—»Ø—»Ø—»ØŽ¬Ìn˜Çl[i5>hWl˜‰Än˜Çn˜ÇWl˜Wl˜n˜ÇSw©MYjMYjo®n˜ÇWl˜WiwWl˜Wl˜n˜Çq¬Ôn˜ÇSw©Wl˜Wl˜Sw©Sw©Sw©SpŽWl˜SpŽJgn=d‹JgnJgnJgnZ†JgnIYVJgnKeWIYVIYVKeWJU:GH8;F8GJFKeWWiwgy†i‡‡WifYuhgy†fjggywYuhhxgZwvgy†gywVZVYeHhxgfjVZe;VYGfZ8OKNOKNe[GfjVghHfjVfjVXgWIWGGH8UK7VYGVZVfjVukXhxghvXVYGUK7VYGfjVghHfjVghHe[GujGfjVghHghHhvXhuIghHghHlWRwwH‡ˆX«¢;ÏQÜÄLÏQÜÄLÏQÙ¸HÏQÙ¸HÙ¸HÏQÙ¸HÙ¸HÜÄLÙ¸HÙ¸HÜÄLÙ¸HÙ«9ÇšHÏQÇšHÇšHÏQÇšH²Š8‘rM†yHe[Gvi8‡ˆXwxWVZVe[GF<ED<5D<5GH8GJF-12:GFWiw]…qJgnKeWQjJGJFIYVZwv‡™—˜¨§wˆwfjVXgWgy†wŠ•‡™—wˆwukXVYGGJF39I:GF-1239I:GF:OQ:GF39I:OQMYjWiwWiw:QlSpŽ=d‹:QlJgnSpŽW•Én˜ÇSpŽSw©Sw©Sw©Wl˜Wl˜Sw©n˜Ç‡½ã‡½ãŽ¬Ì—»ØŽ¬Ì«¹ÊÍ”¨Í”¨æprñT8òJ,óE!êI8ñK6ñK6ñT8ïTBñK6óK"óBóBóE!ñK6ñK6ñK6òJ,òJ,ïTBñK6ëYVê\eëYVê\eê\eìdJëYVïTBíWHñT8íWHèggêfXïTBïTBìdJòT'ñK6ñT8òJ,ñK6ñT8ëLEëLEëYVãvˆÍ”¨Ã¼ÃüèÅÛ«¹Ê—»ØŽ¬Ì‰ÄWl˜Wl˜n˜Ç‰Ä‰Än˜ÇSw©n˜Ç‰ÄpxŒOKNMYjn˜Ç‰ÄWl˜Wl˜5>hWl˜n˜ÇSw©Sw©Wl˜5>hW•Én˜ÇSpŽWl˜Sw©v¥®‰Ähˆ–WiwJgn=eeSpŽSpŽMYjIYVIWGIWG;F8:GFGJFIWGGJFIYVIYVIWGGJFOKNWifwŠ•gywZwvYuhZwvgywgywgywVZVWifYeHZe;VZVXgWVYGOKNOKNe[GVYGIWGVYGVYGVZVUK7VZVVZVe[GYeHukXVZVfjVYeHfjVhxghvXe[GVYGe[GhuIfjVukXukXe[GghHfjVe[GghHfjVhvXghHYeHhuIukXÙ«9Ù¸HÏQÉÄpÜÄLÜÄLÙ¸HÏQÙ¸HÙ¸HÙ¸HÜÄLÜÄLÏQÏQÙ¸HȵlÙ¸HÙ«9ÏQÙ¸HÏQÙ¸HÇšH²Š8Žr6Žr6oQ/fZ8ujG†‰g•Šm–šw•Šm…Šw†Š‡‡˜‡Œš§‡™—‡™—ˆ¦§ˆ¦§y–—wŠ•w‰‡gywgywZwv‡˜‡—™—z•‡‡™—z•‡v¤šˆ¦§—¨–‡™—†Š‡uzv†Š‡…ŠwwxWGJF-12-12-12-12-1239I=d‹SpŽ:OQJgnSpŽWŠ³WŠ³=d‹IYVSpŽW•ÉSw©MYj=d‹Wl˜Sw©n˜ÇSw©o®‰Ä§¨¨¯™§¯™§Í”¨ÕwŒÕwŒëYVëYVòJ,óBóBòJ,ñK6ñK6óK"óK"óE!óE!óK"óBóBóK"ñK6òJ,òJ,ñK6ñK6íWHëLEïTBèggê\eèggèggê\eê\eíWHëYVñK6ïTBëYVëYVíWHíWHïTBñT8ñT8ñT8ñT8òJ,ñT8ëLEïTBñK6ïTBê\eãvˆÍ”¨‰Ä‰Ä‰Ä‰Äˆ¶Ú‰ÄSw©‰Äˆ¶Ú‰Äw»çn˜Çq¬Ôn˜ÇWl˜l[iWl˜n˜Çn˜ÇSw©Wl˜Wl˜Sw©n˜ÇWl˜Wl˜Wl˜Wl˜Sw©o®Sw©Wl˜MYjpxŒ‡™—‡™—‡™—‡™—z•‡wŠ•WiwWiwKeWIYVIYVIWGIYVKeWKeWKeWIYVVZVKeWKeWMYjWifYuhi‡‡w‰‡uzvYuhojogywgywZwv[tXXgWXgWXgWXgWVZVVZVfjVVYGghHVZVYeHVYGGJFF<EVYGVZVlWRghH[tXfjVVZVfjVVZVfjVfjVhvXYeHVYGfjVukXukXfjgfjVukXwxWfjVujGfjVhvXfjVwxWfjVwwHÙ«9Ù¸HÜÄLÙ¸HÜÄLÙ¸HÜÄLÜÄLÙ¸HÙ¸HÜÄLÜÄLÉÄpÜÄLÙ¸HÉÄpÜÄLÙ¸HèrYÙ¸HèrYÏQÏQÇšH®’K‘rM‘rMoQ/vi8Žr6fZ8oQ/oQ/UL-UK7GH8YeHUK7GJFVYGWifwˆwwˆww‰‡—¨–‡™—•®²©¶¸©¶¸•®²•®²˜¨§˜¨§•®²©¶¸¨µ¨—¨–Š¤ˆ‡˜‡uygIWGIWG:GFIYV=ee:Ql:OQ:QlJgnWiwJgn=eeSpŽIYVZwvSpŽ=d‹JgnJgnSpŽWl˜=d‹=d‹Wl˜Œš§Ÿx‡Ÿx‡×[h×[hÓopèggÓgVê\eëLEìV:ìV:òJ,óK"óK"ñK6ñK6òJ,óK"óK"óE!óK"òT'óK"óK"òJ,ñK6ñT8ñT8ïTBïTBëLEñK6íWHê\eëYVê\eæprëYVïTBïTBíWHíWHïTBïTBíWHëYVëYVñT8ñT8ïTBñK6ñK6ñK6óE!óK"òJ,òJ,ñK6ñK6ñK6ëLEãvˆÕwŒÍ”¨Í”¨«¹Ê‰Ä‰Än˜Çˆ¶Ú‰Äˆ¶Úq¬Ôn˜Çn˜Çn˜ÇWl˜Wl˜n˜Çw»çn˜ÇSw©Wl˜Wl˜n˜ÇSw©Wl˜5>hWl˜Wl˜Wl˜SpŽSpŽ:Ql:OQ5>h:Ql:QlWiwWiwpxŒŒš§—™—hˆ–ZwvJgnJgnKeWMYjIYV;F8IYVIYVJgni‡‡ZwvZwvYuhYuhWiwgywwŠ•‡™—i‡‡WifXgWWifgywYuhYuhWifXgWfjVfjgVYGVYGVZVghHukXYeHVYGUK7VYGYeHVZVVYG[tXfjVVYGl[ifjVfjVfjVhuIfjVghHe[GfjVwxWwxWhxgfjVhuIghHujGhvXwxWhvXhxghvXwxWÙ«9Ù«9Ù¸HÙ¸HÙ«9Ù¸HÏQÏQÙ¸HÜÄLÙ¸HÙ¸HÜÄLÜÄLÜÄLÜÄLÙ¸HÙ¸HÜÄLÙ¸HÙ¸HÙ«9Ì“2ÇšH°mS²Š8©•o¦©ˆ•ŠmghHgg9Žr6gg9UL-GF-ghHujGD<5)'&:GFGH8IWGXgWi‡‡‰¥——¨–˜¨§—¨–—¨–¨µ¨•®²˜¨§‰¥—˜¨§š³’‰¥—‡™—wˆwgywWifGH8GJF:OQJgnZ†Zwvgy†gy†gy†gy†gywgy†Wiw:OQ=d‹SpŽMYjMYjWiw=d‹Wl˜Wiwl[iŸx‡±spÓTMÓTMÓTMëLEìV:íWHíWHïTBíWHíWHñK6ñK6òJ,ñT8ñT8ñT8ñT8óK"óK"òJ,òT'óK"óE!óE!ñT8ïTBñT8ïTBïTBïTBïTBïTBñK6ëYVê\eê\eê\eê\eïTBëYVêfXíWHíWHïTBïTBíWHïTBñT8ïTBñT8óK"óK"òJ,òJ,ñT8ñT8ñK6ñK6ñK6ñK6ñK6ëLEëLEê\eãvˆÍ”¨‰Ä‰Ä‰Äˆ¶Ú‰Äq¬Ôw»çq¬Ôn˜Çn˜ÇSw©Sw©q¬Ô‰Än˜ÇSw©Wl˜o®o®o®OKNF<EMYj=d‹MYjWiwSpŽWl˜gy†gy†SpŽSpŽSpŽMYj:Ql:QlWify–—˜¨§j”’SpŽZwvgy†Wiw=eeIYVIYVVZVJgnZwvgy†Yuhgywi‡‡i‡‡gy†uzv‡˜‡‡™—hxgZwvhxggywhxg[tXXgWXgWfjVe[GVYGGJFVZVIWGVYGYeHVYGVYGIWGKeWWW8YeHYeHJU:UL-YeHYeHVYGNf9VYGe[GVZV[tXukXwxWwxWfjVfjVYeHhuIwxWhuIuyghxghvXukXÙ«9ÏQÏQÙ«9Ù¸HÙ¸HÙ¸HÙ¸HÙ¸HÜÄLÙ¸HÙ¸HÏQÙ¸HÏQÜÄLÙ¸HÜÄLÜÄLÜÄLÏQÙ¸HÙ«9ÇšH¬u/Žr6—ˆI•ŠW–šwwxWwwH‘ˆ;†yHvi8fZ8ghHWW886+99539IGJFMYjhxgw‰‡ˆ¦§¨µ¨‰¥—š³’—¨–š³’š³’—™—˜¨§¨µ¨‰¥—‡˜‡—™—‰¥—ˆ¦§‡™—w‰‡‡™—pxŒfjgYuhKeWIYVIYVSpŽi‡‡hˆ–Z†Z†hˆ–i‡‡SpŽ=d‹SpŽWl˜=d‹WŠ³Sw©l[i“UVÔM1ÔM1ÓTMÓTMêI8ëLEïTBÓTMíWHìdJïTBòJ,òJ,ñK6ñK6òJ,ñT8ñK6óE!óE!óE!óE!óE!óE!ñK6ïTBñK6ñK6ñT8ñK6ñT8ïTBïTBëLEëLEê\eê\eê\eê\eëYVêfXëYVïTBïTBïTBêfXïTBñK6ñK6ñT8òT'òJ,óK"ñK6ñK6òT'ñK6ñK6ñT8ñT8ñK6ëLEëLEì=&ëLEëLEê\eÕwŒÕwŒÍ”¨‰Ä‰Ä‰Än˜Çn˜Çn˜Çq¬ÔWl˜Wl˜n˜Çn˜ÇWl˜Wl˜Sw©n˜ÇSw©Wl˜5>hWiwWl˜Wl˜o®o®hˆ–o®Œš§‰Äv¥®o®v¥®hˆ–Z†Jgn:OQMYjWifˆ¦§Œš§WiwKeWJgnKeWIYVWiwgywuzvw‰‡y–—w‰‡w‰‡†Š‡†Š‡wˆwwˆwuzvpxŒ‰˜¨§‡™—‡˜‡‡™—‡˜‡w‰‡uzvfjgVYGVYGIWGVYGVYGXgWhvXuyghvXhvXfjVYeHVYGYeHVYGGH8WW8ghHVYGVYGfZ8VYGVYGVZVfjVfjVwxWwxWfjVfjVfjVwxWhvXhuIwxWwxWhxgÙ¸HÙ¸HÙ¸HÙ¸HÙ¸HÜÄLÜÄLÜÄLÜÄLÜÄLÙ«9Ù«9ÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLèrYÙ«9Ì“2¬u/°mS—ˆI‡ˆX†yHujGwv;…{WwwHgg9WW8VYGJU:86+;F8;F8MYjgywpxŒ•®²©¶¸•®²¨µ¨¨µ¨¨µ¨¨¶—¨µ¨˜¨§˜¨§˜¨§§¨¨˜¨§¨¶—§¨¨—™—‡—xuygfjgF<E:OQJgn:Ql:OQ:GF:OQ:Ql:OQ39I:GF:OQZwvhˆ–WiwWl˜Sw©WŠ³o®“UV“UVÒ9(ÔM1ÓTMëLEëLEÓTMèggê\eëYVíWHíWHïTBñT8ñK6ïTBñK6ñT8ñK6òT'óE!óE!óE!óK"óK"òJ,òJ,ñK6ïTBíWHíWHïTBïTBñK6ê\eê\eíWHëYVëYVèggëYVïTBìdJëYVïTBïTBïTBêfXêfXòJ,òJ,ñT8ñT8ñK6òJ,ñK6òJ,ñT8íWHïTBìdJñT8ñT8ïTBñT8ñT8òJ,ñK6òT'ñT8ëYVÓgVÓopŸx‡‰Ä‰Än˜Çn˜Çn˜ÇWl˜Wl˜n˜ÇSw©MYjWl˜n˜Ç‰ÄSw©n˜Ç‰ÄpxŒWl˜Wl˜Wl˜MYjWl˜MYjJgnMYj=d‹SpŽWl˜SpŽSpŽZ†Z†SpŽJgnSpŽpxŒ‡™—w‰‡Zwvgy†pxŒ‡™—y–—wŠ•w‰‡i†xuzvYuhYuh[tX[tXXgWXgW:GFIWGfjgw‰‡w‰‡hvXfjVfjgw‰‡wŠ•pxŒwˆwZwvVZVOKNXgWhvXfjVXgW[tXfjVfjVYeHghHVYGIWGWW8e[GWW8e[GVYGVYGe[GVZVfjgukXuyghvXfjVwxWuygwxWuyghuIukXhvXwxWÙ¸HÙ¸HÙ¸HÙ¸HÜÄLÜÄLÜÄLÙ¸HÙ«9Ù«9ÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÉÄpÏQÙ«9Ù«9ÇšHÇšH²Š8¬u/Žr6oQ/fZ8—ˆI‘rMghHwxWwˆwhxg995)'&995:OQWifpxŒ‡˜‡¨µ¨¨µ¨¨µ¨š³’—¨–š³’¨µ¨«¹Ê¶Ã²¸·©¸·©˜§ˆ•Šmuyg…Šw‡˜‡uzvhvXVZVWifWif:OQIYV39I;F8:OQJgn=ee=d‹Jgn:Ql:QlJgnMYjSw©Sw©Wl˜l[i“UV²SNÓTMêI8íWH×[hëYVæpræpræprëYVëYVëYVíWHíWHíWHñT8ñK6ñK6ñT8òJ,òJ,óK"óE!óK"òJ,òJ,ñK6ñK6íWHíWHëYVñT8ïTBëLEíWHëYVëYVê\eëYVê\eëYVêfXèggëYVëYVê\eñT8ìdJñT8òJ,ñT8ñT8òJ,òJ,ñK6ñK6òT'ñT8ìdJïTBïTBñT8ñT8ñT8ñT8ñT8ñK6óK"óK"òJ,ñT8ñT8ëLEÓTMÕwŒŸx‡‰o®n˜ÇSw©Sw©n˜Ç‰ÄWl˜Wl˜Sw©Sw©Sw©Wl˜Sw©Wl˜Sw©Sw©Sw©WŠ³Sw©Wl˜5>h:QlMYjMYj:OQ=eeJgn=eeJgnSpŽZ†Z†JgnWiwˆ¦§Ž¬ÌŒš§wŠ•v¥®Œš§Œš§Œš§Œš§Œš§Œš§Œš§˜¨§‡™—wŠ•wŠ•i‡‡uzvi†xgywuzv†Š‡wˆwVZVYeHfjgukXojogywuzvZwvfjgXgWVZVYeHUK7VYGVYGYeHVYGghHYeHVYGUK7VYGYeHghHghHfjVe[Gfjghxgx†hx†hhvXfjVhvXuygwxWwxWujGukXhxgÙ¸HÏQÙ¸HÙ¸HÜÄLÜÄLÙ¸HÙ«9ÜÄLÜÄLÜÄLÙ«9ÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLèrYÙ¸HÇšHÇšHÇšH®’K®’KŽr6oQ/Žr6®’KŽr6vi8vi8WW8Ze;IWGVYGfjguzvx†hz•y‡˜‡–š‡¦©—˜¨§˜¨§¨µ¨š³’•®²§¨¨–š‡‡—x–š‡‡—x‡™——¨–¦©—–š‡–šwx†hukXVYG:GF-12-1239I:OQ=d‹ZwvSpŽZ†SpŽSpŽ:Ql:QlSpŽSpŽWl˜Wl˜l4$²N0Ò9(ÓTMëLE×[hëYVÓopÓopæpr×[hæprèggèggê\eêfXìdJëYVíWHñT8ïTBïTBñK6òJ,óK"ñK6ñK6ñK6ïTBïTBíWHìdJïTBñT8ïTBëLEñK6íWHê\eê\eëYVèggëYVïTBïTBíWHíWHïTBñK6ñT8ñT8ïTBïTBñT8ñT8òT'òJ,óK"òT'ñT8ñT8ìdJñT8ïTBïTBìdJïTBñT8ïTBïTBíWHïTBñT8òJ,óK"ñT8ÓTM×[htnpxŒ‰ÄW•Én˜Çn˜Ço®Wl˜n˜ÇSw©Wl˜Wl˜Sw©Sw©n˜Ço®Sw©Sw©Wl˜Sw©o®SpŽSw©Wl˜MYjSpŽWŠ³Z†Z†Jgn=eeSpŽhˆ–v¥®hˆ–fjgojoo®gy†YuhWifXgWXgWWifWiffjggywuzvwˆww‰‡‰‡™——™—Œš§ˆ¦§w‰‡i†xw‰‡w‰‡fjg[tXYeHghHQjJOKNIYVWifZwvfjgVYGVYGIWGUK7UK7VYGfjVVYGVYGVYGVYGfjVVZVVZVghHVZVfjguyguygwˆwukXukXhxgwxWwxWuygwwHfjVuygÜÄLÜÄLÙ¸HÜÄLÜÄLÙ¸HÙ«9Ù«9ÜÄLÙ«9ÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLȵlÙ«9Ù«9ÏQÇšH¬u/®’K‘rMoQ/oQ/‘ˆ;§˜W†yHwwHgg9JU:IWGZe;IWGGH8IWGhxg‡—xŠ¤ˆ•Šm†Š‡—¨–š³’¨µ¨š³’¥uˆ–hˆ–h‡˜‡¦©—¨µ¨¨µ¨¦©ˆ–š‡…Šwz•yi†xJU:%##)'&5>h:OQ:Ql:Ql=eeZ†SpŽSpŽ=d‹Sw©Wl˜Sw©hˆ–o®Ÿx‡²SN²SNÔM1ÓTMÓgVÓgVìdJÓTMíWHëYVèrYÓopèggèggæprèggæprèggèggêfXêfXñT8ïTBñK6òJ,ïTBïTBïTBïTBïTBëYVëYVïTBñT8ïTBëYVëYVëYVê\eê\eê\eê\eñK6ñT8ïTBïTBïTBñK6òT'ñT8ñT8ñT8ñT8ñT8ñK6òT'óK"óK"ñT8ïTBïTBñT8ìdJìdJèrYèrYìdJèrYèrYêfXìdJêfXìdJíWHñT8ñT8ëLEëLE²SN“UV‰‰Än˜Çn˜Çn˜Çn˜Çn˜Çn˜Ço®Sw©n˜Ço®Wl˜Sw©n˜Ço®Wl˜Wl˜Wl˜Wl˜Wl˜MYjSpŽSpŽhˆ–WŠ³WŠ³Z†Zwv=ee:QlJgnhˆ–WŠ³MYjMYjhˆ–gy†WifVZVKeWXgWXgWQjJNf9QjJVZVOKNIYVOKNfjgw‰‡wŠ•‡™—‡˜‡w‰‡w‰‡z•‡w‰‡gywhxghvXYeHUK7UK7VZVfjgghHVYGVYGGJFOKNVZVYeHhvXe[GVYGVYGVZVYeHfjVfjVfjVfjVhxguyguzvuyguygojofjVwxWx…XwxWfjVwwHÙ¸HÙ¸HÜÄLÜÄLȵlÙ¸HÙ«9Ù¸HÙ«9Ù«9ÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÙ¸HÙ«9Ù«9ÇšHÌ“2¬u/®’K¬u/Žr6‘rM—ˆI§˜W†yHWW8WW8JU:UK7GH886+GH8fjgx†hx†hx†h…Šw‡˜‡¦©ˆ¦¨w—˜g™¥hx…X‡ˆX–š‡š³’¦©ˆ¦©——¨–—¨–ˆ¦§‰¥—z•‡i†xXgW:GF-1239I:OQ:OQ5>h:OQJgn=d‹Jgn=d‹SpŽSpŽWl˜Wl˜l[ipxŒl4$›8%ÓTMÔM1ÓTMìdJëYVìV:ëLEÓTMÓTMÓTMêfXêfXèrYæpræprãvˆæprèggèggèggèggëYVëLEíWHíWHê\eê\eëLEíWHëYVïTBïTBïTBíWHíWHê\eê\eê\eëYVïTBïTBïTBïTBê\eê\eëLEñK6ñT8ïTBñK6ñT8òT'ñT8òJ,òJ,ñT8íWHêfXìdJèrYèrYèrYèrYèrYèrYæpr⃌æprèrYèrYêfXèrYêfXíWHñT8òT'ñT8ÔM1ÓTM“UV‰Ä‰Ä‰Än˜ÇSw©‰ÄSw©Sw©n˜ÇSw©n˜ÇWŠ³hˆ–WŠ³o®pxŒSpŽWl˜Sw©Wl˜SpŽgy†SpŽWŠ³SpŽSpŽhˆ–hˆ–Z†SpŽSpŽMYjSpŽSpŽSpŽWiwŒš§v¥®wŠ•hˆ–pxŒwŠ•‡™—‡™—i‡‡i‡‡uzvwˆwZwvYeHVZVYuhWiffjguzv†Š‡‰‡™—ˆ¦§w‰‡gywfjVVYGVYGVYGXgWfjgVZVIWGUK7IWGVYGVYGQjJfjVVYGVYGVYGfjVXgWhvXhvXfjVfjghxguyguyguyguygfjgghHwxWwxWwxW…{WÙ¸HÙ¸HÙ¸HÜÄLÙ¸HÏQÏQÏQÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÙ«9Ù«9èrYÌ“2Ì“2ÇšH²Š8‘rM‘rM¬u/•ŠW‘rMukXfZ8huIZe;WW8VYGVYGuzv–šw‡—x™¥h¥u¦¨w§§h§§h§§h¨µx©•o–š‡¦©—¦©ˆ¦©—š³’˜¨§¨µ¨•®²¨µ¨—¨–‡™—‰¥—i†xVYG-12&995GJF:OQ:OQIYV:QlSpŽgy†SpŽWl˜SpŽl[il[i“UV“UV²N0ÓTMêI8ÔM1ìV:ìV:ëH&ìV:ìV:íWHíWHÓTMÓTMêfXêfXèrYæpræpræprãvˆãvˆãvˆãvˆãvˆê\eê\eê\eê\eëYVïTBëLEëLEíWHíWHïTBëYVê\eê\eæpræprëYVê\eëYVê\eê\eê\eëLEê\eíWHïTBñK6ïTBòJ,ñK6ñT8ñT8ëYVæpræpræpræpr⃌⃌⃌⃌⃌⃌⃌ãvˆæpræprèrYèrYèggèrYìdJìdJìV:òT'ìV:×[hŸx‡Ÿx‡Wl˜o®Sw©‰Äo®o®o®o®o®Sw©WŠ³Wl˜gy†n˜Ço®Wl˜Wl˜Sw©WŠ³Sw©hˆ–Z†gy†SpŽSpŽZ†hˆ–Z†Wl˜MYjMYjWiwSpŽSpŽgy†gy†y–—gy†i‡‡wŠ•j”’i‡‡i‡‡gy†gywuzvw‰‡w‰‡‡™—w‰‡wˆwhvXfjVVYGOKNl[i‡™—˜¨§•®²‡™—pxŒgy†gywi†xfjgVYGVYGUK7fjgYeHVYGIWGYeHfjVVYGVYGujGhvXfjVfjVfjVfjVuyguygx†hx†huygwxWukXwxWuygwxWwxWÙ«9Ù«9Ù¸HÙ¸HÙ¸HÙ«9Ù«9ÜÄLÜÄLÙ«9ÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÙ¸HÙ¸HÙ¸HÙ«9Ù«9èrY׎̓2Ì“2²Š8°mS—ˆI•ŠW‘rM…{W†‰gghHujGUK7fZ8VYG–š‡†‰gwwHlr9†yH‡‡I¯§V¯§V§˜W¯§VÄ°”¸¨¨·²¨¶—¸·©–š‡–š‡˜¨§˜¨§˜¨§ˆ¦§‰¥—v¤šz•‡wˆwKeW:OQ:OQOKNJgngy†o®hˆ–i‡‡hˆ–i‡‡Sw©Z†Wl˜Wl˜l[i“UV›8%Ò9(êI8ëH&ëH&ëH&òJ,òJ,êI8ëH&ÔM1ëLEÔM1ÔM1ÓTMíWHìV:êfXèggãvˆâƒŒâƒŒâƒŒÍ”¨ãvˆãvˆãvˆãvˆãvˆê\eê\eê\eëYVëYVëYVïTBëYVê\eæprê\eê\eæprê\eïTBêfXê\eëLEëLEê\eëYVìdJïTBïTBñK6ïTBíWHëYVæpr⃌͔¨âƒŒÍ”¨Å±®Í’⃌⃌⃌æpræprèrYæpræprèrYêfXèrYèrYìdJìdJìdJòT'ñT8Ò9(²SNŸx‡Wl˜Wl˜Wl˜Sw©Sw©pxŒWl˜Wl˜hˆ–n˜Ço®WŠ³Wl˜Sw©pxŒo®hˆ–Wl˜Sw©o®n˜Ço®WŠ³hˆ–Z†Z†SpŽJgnWiwWiwWiwMYjWiwMYjWiwgy†SpŽZ†y–—gywZwvYuhgyww‰‡i‡‡i†xgywhxgXgWfjguzv†Š‡‡˜‡†Š‡ojoIYVVZVfjg†Š‡•®²˜¨§‰¥—wˆwhxgghHWW8IWGUK7VZVfjVVYGVYGVYGghHVYGVYGghHhxgukXojofjgWiffjguyg†‰g…ŠwuyghxgfjVwxWuyguygukXèrYÙ«9ÏQÏQÙ¸HÙ¸HÙ¸HÙ«9ÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÙ«9Ù¸HÙ¸HÙ¸HìdJ׎̓2Ù«9Ù«9Ì“2ÇšH•ŠW‘rM‘rM†yH†yHfZ8UL-fZ8e[GGJFi†xuygGJFKeWz•‡‰¥—¦©—·²¦¨w¦©ˆ¸¨¨¨¶—¦¨w§§h¦¨w¦©ˆ¦©—©¶¸©¶¸©¶¸•®²•®²©¶¸•®²‰¥—‡™—Œš§Œš§†Š‡uzvhvXVZVKeWMYjWiwgy†gy†JgnWiwSpŽl[i“UV“UV²N0ÓTMêI8êI8òJ,óE!ì=&òJ,ëH&ìV:êI8ÔM1ÔM1ÔM1ÔM1ÔM1ÔM1ÔM1íWHèggãvˆãvˆãvˆãvˆÍ”¨Í”¨âƒŒâƒŒÍ”¨ãvˆê\eãvˆê\eê\eê\eëLEê\eèggãvˆê\eê\eæprê\eëYVïTBëLEê\eê\eê\eê\eèggèggëYVê\eê\eæprãvˆâƒŒÍ”¨Ã¼ÃÍ”¨Å±®âƒŒâƒŒæpræprèrYêfXìdJìdJìdJêfXêfXìdJìdJêfXìdJèrYìdJïTBòT'ëLEÓTM×[hŸx‡Ÿx‡n˜Ç‰Ä‰ÄWl˜Wl˜Wl˜pxŒSw©n˜Ço®WŠ³Wl˜WiwSw©o®pxŒo®n˜Çhˆ–gy†SpŽgywgy†ZwvWiwGJF:OQJgnWiwMYjWifgy†gy†v¥®v¥®y–—o®v¤šgy†gywi‡‡gy†gywi‡‡w‰‡i†xuzvfjgWifVZVfjguzv†Š‡‰uzvVZVOKNfjgwŠ•…Šw†Š‡‡˜‡uzvVZVVZVXgWIWGVZVe[GXgWfjV[tXfjVe[GYeHghHfjVhxgfjgojoojox†h…Šw…Šw†‰gx†hukXfjVx…X†‰gwxWÙ«9Ù¸H⃌ÜÄLÙ¸HÙ¸HÏQÙ¸HÜÄLÜÄLÙ«9ÜÄLÜÄLÜÄLÜÄLÙ«9ÜÄLÜÄLÜÄL׎٫9Ì“2Ì“2׎׎°mSŽr6‘rM†yH†yH†yHoQ/e[GhuIGJFJgn…Šwwˆw‡˜‡˜¨§—¨––š‡†‰g•Šm©•o¨¶—·²¦¨w…Šw•Šm—™—©¶¸Ã¼Ã¶Ã²¨µ¨•®²•®²¨µ¨•®²•®²¨µ¨š³’uygOKN39IGJFWifIYVMYj:QlSw©SpŽMYjMYjSpŽMYjojolWR²SN²N0êI8ñT8ñT8òT'óE!óE!óK"óK"ëH&ÔM1Ò9(²N0›8%›8%Ò9(›8%Ò9(Ò9(ÔM1ÓgVëYV×[hãvˆâƒŒÍ”¨âƒŒÍ”¨ÕwŒãvˆãvˆÕwŒãvˆãvˆê\eê\eãvˆê\eê\eãvˆê\eãvˆê\eê\eê\eê\eê\eãvˆãvˆãvˆâƒŒãvˆæprãvˆâƒŒÍ”¨Ã¼ÃÍ”¨Í”¨âƒŒâƒŒâƒŒèrYèrYêfXèrYèrYìdJìdJìdJÙm"ìdJíWHíWHíWHíWHìdJèrYìdJìdJñT8ì=&ëLEëLE²SNŸx‡o®n˜Ço®Wl˜pxŒWl˜o®hˆ–n˜ÇWŠ³pxŒSpŽgy†Wl˜Sw©Wl˜Sw©o®hˆ–MYjWiw†Š‡Œš§wŠ•IYV:OQWiwgy†hˆ–Z†gy†gy†gy†pxŒWiwZwvgy†gywwŠ•y–—z•‡hˆ–i‡‡w‰‡w‰‡i†xi†xi†xuzvhxgfjVojofjgojouzv…Šww‰‡ojoWifojoXgWfjggy†fjgVZVWifWifVYGXgWfjVhvXhxguygfjVVYGe[Gfjghxguyguyguyguyg…Šw‡—xx†htnuygwxWwxWx…X†‰gÙ«9ÏQÏQÏQÙ¸HȵlÏQÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÙ«9ÜÄLÜÄLÙ«9Ù«9׎٫9׎̓2Ì“2¬u/Žr6—ˆI†yHŽr6Žr6ujGwwHhvXfjVuzvYeHYeHYeHfjV‡ˆX•ŠW—˜Y—˜g¦©ˆ®’K†yHwxW‡˜‡¸Ç˸·©¨¶‡¨¶‡˜§ˆ—¨–¨µ¨—™——¨–©¶¸˜¨§…ŠwuygfjgfjgfjgfjgXgWMYjJgnSpŽZ†SpŽMYjJgnSpŽgy†l[i“UV“UVÒ9(ìV:òJ,òT'óK"óBóE!óK"ñK6óK"óE!ÔM1Ò9(²N0›8%Il4$l4$›8%›8%›8%ÔM1êfXèggæprãvˆãvˆâƒŒãvˆÕwŒãvˆÍ”¨ÕwŒãvˆãvˆãvˆãvˆãvˆ×[hãvˆãvˆê\eãvˆê\eê\eãvˆãvˆãvˆãvˆâƒŒÍ”¨ãvˆãvˆâƒŒÍ”¨âƒŒâƒŒâƒŒãvˆèrYæprìdJìdJìV:ÔM1êV&ìV:ìV:Ùm"ìV:ìV:ìdJìdJìdJìV:íWHìdJìdJèrYèrYìdJëLEêI8Ò9(×[h×[h‰ÄSw©pxŒWl˜o®o®Sw©Sw©n˜Ço®o®gy†Jgngy†Wl˜hˆ–o®o®hˆ–y–—fjgSpŽpxŒpxŒ‡™—pxŒWiwMYjSpŽhˆ–gy†WifMYjVZVWifWifZ†i‡‡WifYuhw‰‡w‰‡i‡‡i†xi‡‡w‰‡i†xi†xi†xhxgfjghxgWiffjVfjVVZVl[i†Š‡†Š‡gywfjgVZVVZVfjVVZVVZVVZVXgWVZVfjVfjguygj„hfjgfjVXgWhvXwˆwuzvojogywuygx†h…Šw†‰gwˆwx†hx…Xuygx†huygÇšHÏQÏQÙ¸HÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÙ¸HÙ«9ÜÄLÜÄLÙ¸HÙ¸HÙ«9Ù«9Ù«9Ì“2Ì“2Ì“2¬u/‘rM°mS†yHŽr6Žr6fZ8‡‡IujGghHWW8UL-Ze;WW8UL-huIukX†‰g¦©—¦©—¦©ˆ¦©——¨–˜§ˆ—˜g—˜g†‰g†‰g—¨–§¨¨¦©—§¨¨¸Ç˶ò˜§ˆ…ŠwhvXVZVOKN:GF:OQ:OQ39I39I5>hSpŽJgnMYj:QlMYjojol[i“UV²N0ëLEëH&óE!óE!óE!òJ,óK"óK"ñK6òJ,ìV:íWHïTBêV&Ò9(›8%›8%l4$l4$R4'R4'l4$ÔM1ÓTMêfXê\eæprãvˆãvˆãvˆãvˆÕwŒâƒŒãvˆÕwŒÕwŒãvˆãvˆãvˆÕwŒÕwŒãvˆãvˆê\eãvˆãvˆãvˆÕwŒãvˆÍ”¨Í”¨âƒŒâƒŒâƒŒâƒŒæprèrYèrYêfXèrYìdJÔM1›8%›8%l4$l4$l4$›8%²N0ÔM1ìV:ìdJêfXêfXìdJìdJíWHìdJèrYìdJìdJñK6óE!ëLEÓTM²SNŸx‡pxŒpxŒWl˜Sw©pxŒ‰ÄpxŒo®o®o®o®gy†gy†pxŒhˆ–n˜ÇWl˜WiwpxŒ†Š‡‡™—Œš§o®wŠ•wŠ•y–—o®w‰‡i‡‡gy†ZwvpxŒZwvgy†gy†i‡‡v¤šj”’i†xi†xi†xi†xi†xhxgj„h]…qhxghxgj„hhvXhxghxgXgWe[GVYGVZVVZVfjgpxŒ†Š‡hxgVZVVZVWifVZVgywhxgWifWiffjVwxWuzvhxgojohxghxggywuyguyghxgfjguygx†h†‰g†‰gx†h†‰guygwxWuygÏQÏQÏQȵlȵl⃌ٸHÜÄLÜÄLÙ«9Ù«9ÜÄLÙ¸HÜÄLÜÄLÜÄLÙ¸HÙ¸HÜÄLÙ¸HÙ¸HÙ«9Ù«9׎²Š8¬u/®’K®’KŽr6vi8oQ/ujG…{Wlr9huI†yHy„<lr9gg9wwHwxWhxg—¨––šw—™—¨¶—¦©ˆ™¦w¦©ˆ¦©ˆ¯”‘¦©—©¶¸¶Ã²·¹·¸ÇË·¹·¸·©˜§ˆ‡—xz•‡ojoOKNVZVVZV:GF995OKNfjgOKN:OQMYjSpŽSpŽSpŽMYj“UV“UV²N0Ò9(êI8óE!óE!óE!óE!óE!óK"ñK6ïTBëLEèggèggëYVòJ,ëH&Ò9(›8%›8%l4$l4$R4'l4$²N0íWHìdJê\eê\eê\eãvˆãvˆãvˆãvˆãvˆãvˆÍ”¨ãvˆÕwŒÍ”¨Í”¨ÕwŒãvˆÍ”¨ãvˆãvˆÕwŒÍ”¨ãvˆÍ”¨Í”¨âƒŒãvˆãvˆæprèrYêfXèrYìdJìdJÙm"P,R4'R4'R4'l4$l4$›8%l4$›8%Ò9(ÔM1ñK6ìV:ìdJêfXïTBòT'ñT8ìdJìdJñT8ñK6ì=&Ò9(ÓTM²SN±spŸx‡Wl˜Ÿx‡Ÿx‡Wl˜Sw©‰Äo®Sw©Wl˜gy†hˆ–Sw©Z†SpŽwŠ•Wiw:OQMYjWiwMYjWiwwŠ•ˆ¦§Œš§pxŒhˆ–pxŒgy†hˆ–Sw©Z†hˆ–wŠ•i‡‡wŠ•gy†Z†o®i‡‡w‰‡j”’j”’i‡‡]…qi‡‡w‰‡j„huyguygfjVukXuygfjVVYGVZVfjVfjVfjgwˆw‡™—†Š‡gy†fjgVZVVZVw‰‡w‰‡wˆwuzvuyghxguyghxghxghvXhvXuyghxguyguyghvXuyg†‰gˆ–hx†hx†h†‰g…{W†‰gȵlÜÄL⃌ٸHÜÄLÜÄLÏQÏQÙ«9Ù«9ÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÙ¸HÙ¸HÜÄLÙ¸HÙ«9ÜÄLÙ«9Ù«9²Š8²Š8®’K¬u/Žr6oQ/gg9vi8fZ8gg9‡‡I’•Iy…JWW8WW8ukXfjV‡˜‡·²¦©ˆ¨¶‡–šw…{W†‰g•Šm–šw¦©—·¹·¨¶—¨µ¨ÃÍиÇ˨µ¨§¨¨¨µ¨•®²‰¥—†Š‡WifWifVZVojouzvhxgVZV995:QlSpŽgy†Wl˜wŠ•ojo“UV“UV²SNÔM1êI8òJ,óE!òJ,óBóE!óE!ñT8ñK6íWHêfXãvˆèggëYVïTBëYVñT8Ò9(›8%l4$l4$5+(l4$Ò9(ïTBëYVèrYÓopê\eãvˆæprê\eãvˆÕwŒãvˆãvˆÍ”¨Í”¨Í”¨Í”¨ãvˆãvˆâƒŒâƒŒÍ”¨âƒŒâƒŒãvˆãvˆãvˆæpræprèrYìdJìdJìdJÔM1²N0F<ER4'R4'l4$›8%²N0Ò9(ëLEÓgV²SNÓTMêI8òJ,ìV:ìdJñT8ñT8ñT8ìdJìdJìdJñT8ñK6òJ,ñK6ìV:ÓTM“UVŸx‡Wl˜Wl˜‰ÄWl˜pxŒo®‰Ähˆ–gy†SpŽhˆ–gy†JgnMYjVZVIYVOKNJgnhˆ–WiwMYjMYjgy†Œš§•®²wŠ•w‰‡wŠ•wŠ•o®o®wŠ•pxŒwŠ•v¥®wŠ•Zwvj”’i‡‡gy†i†xj”’j”’z•yi†xi†xz•‡i†xuzvwˆwhxguyghvXfjVfjV[tXfjV[tXfjggyw†Š‡‰‡™—WifVZVXgWgy†uzvgywgywuyguyghxgfjVfjVukXuzvuzvuyguyguyguyguyg‡—x‡—xx†hx†h†‰g†‰gÜÄLÉÄpÜÄLÙ¸HÏQÜÄLÜÄLèrYÙ«9ÜÄLÜÄLÜÄLÙ«9Ù«9Ù«9Ù«9Ù«9Ù¸HÙ«9Ù¸HÜÄLÜÄLÙ«9Ù¸H°mSŽr6²Š8²Š8Žr6Žr6vi8fZ8fZ8fZ8‰•Y—˜YwxWghHhuIwxW†‰g¦©ˆ—˜Y§§h§§h©•o©•o¦©—§¨¨¨¶—¨¶—¸·©¸Ç˶ò¸·©¨¶‡¦©ˆ–š‡–š‡…Šwuzv†Š‡Œš§—™—†Š‡hxgWifMYjMYjMYjhˆ–y–—pxŒgy†MYjOKN“UV²SNÓTMÒ9(ÔM1óK"óK"òJ,óBñK6óK"ïTBíWHíWHìdJê\eêfXèggæpræpræprêfXíWHÒ9(›8%l4$R4'l4$ÔM1ìV:èrYìdJê\eê\eê\eëYVê\eãvˆãvˆãvˆãvˆÍ”¨Í”¨ãvˆãvˆãvˆÍ”¨ãvˆâƒŒâƒŒãvˆæprèggæprèrYèrYèrYìdJìV:ÔM1›8%R4'l4$l4$“UVÓTMÓgVègg×[hëYVèggêfXíWHìV:ïTBïTBìdJñT8òT'ïTBïTBñT8ñT8òT'óK"óK"óK"êI8ÓTM²SNŸx‡pxŒSw©n˜Ço®Wl˜pxŒo®gy†Wl˜WiwMYjWiwSpŽZwvIYVMYjZwvhˆ–hˆ–ZwvZwvIYVF<EMYjojo‡™—˜¨§wŠ•pxŒhˆ–hˆ–pxŒgy†j”’wŠ•wŠ•WiwZwvwŠ•v¥®v¥®z•‡j”’i†xz•yi†xj„hi†xz•‡i†xuzvuygfjgukXfjVfjVhxghvXhvXukXfjgfjg†Š‡‡™—fjgVZVVZVWifojoojohxghxghvXfjVfjgfjguzvwˆwuyguyg…Šwwˆwwˆw‡—x‡—x‡—x†‰gx†h†‰gÜÄLȵlÙ¸HÏQèrYÙ¸HÜÄLȵlÜÄLÜÄLÜÄLÜÄLÙ«9Ù«9Ù«9Ù«9Ù«9Ù«9ÜÄLÜÄLÙ¸HÙ«9Ù«9ÏQÇšH‘ˆ;—ˆIŽr6‘ˆ;‘ˆ;Žr6UL-oQ/Ze;—˜Y‡‡I‡ˆXy…JfZ8YeH—˜g§˜W—˜Y—˜g–šw–š‡¦©ˆ¸·©¸·©¦©ˆ©¶¸¸Ç˸Ç˨µ¨¦©ˆ–š‡Š¤ˆ‡˜‡–š‡Œš§©¶¸©¶¸˜¨§Œš§gy†hˆ–o®j”’i‡‡MYjMYj:Ql5>hWiw5>hF<El[i²SNÒ9(ÓTMêI8óE!óE!óE!óE!òJ,òJ,òJ,ñK6ïTBïTBëYVíWHêfXãvˆæprê\eëYVê\eê\eÒ9(›8%l4$R4'l4$ÔM1ìV:ìdJê\eëLEëLEê\eê\eê\eê\eãvˆãvˆÍ”¨Í”¨Í”¨Í”¨âƒŒãvˆãvˆãvˆãvˆèggèrYèggèggæprèrYèrYìdJêV&›8%R4'›8%²N0ÓTM×[h×[hê\eèggê\eê\eèggæprèggê\eèggìdJëYVìdJñT8ñT8ìdJñT8òT'òT'óK"óK"óK"òT'ÓTM²SNl[ipxŒ‰ÄWl˜pxŒ‰‰ÄŒš§wŠ•pxŒWiwIYVMYjSpŽWiwWiwZwvWiwSpŽpxŒgy†v¥®hˆ–WiwMYjMYjIYVojowŠ•VZVF<EIYVWiwwŠ•y–—v¥®•®²ˆ¦§y–—v¤šy–—ˆ¦§‰¥—ˆ¦§ˆ¦§v¤šz•‡z•yi†xz•‡y–—wˆwuygojoghHhxghxgoˆVuyghuIfjVYeHVYGVYGuzv‡™—YuhWiffjgfjgi†xgywfjguzvuygfjgukXuyguzvuyguzvuzv…Šw‡˜‡—¨–‡—x‡—x…Šwx†h…ŠwȵlÙ¸HȵlÏQÙ¸HÏQÙ¸HÜÄLÜÄLÜÄLÜÄLÜÄLÜÄLÙ«9Ù«9׎٫9Ù«9ÜÄLÙ«9Ù«9Ù«9Ù«9Ì“2ÇšHÇšH²Š8¬u/²Š8²Š8vi8IR4'fZ8wv;gg9huIujGD<5…Šw©•o‡ˆX—˜g·²µÄ©•o—˜g¦¨w©•o·²¸Ç˸·©´±o¦¨w¨¶—¨¶—©¶¸¨µ¨©¶¸·¹·«¹Ê•®²‰¥—ˆ¦§j”’gywXgWIYV:GF39IJgnOKNF<E:Qll[iF<E“UV“UV²SNÔM1êI8òJ,óE!òJ,òJ,òJ,ñK6ñK6òJ,ñK6ïTBïTBíWHñT8ëYVíWHïTBïTBëYVê\eê\eê\eÒ9(l4$R4'›8%ÔM1ÓgVê\eê\eê\eê\eëLEê\eê\eãvˆãvˆãvˆãvˆãvˆâƒŒãvˆãvˆãvˆæprèggêfXèrYêfXèrYèrYìdJìdJòT'›8%l4$›8%ÔM1×[hê\eê\eê\eëYVê\eèggê\eèggèggêfXèggêfXêfXïTBìdJñK6ñK6ñT8ñT8ïTBñT8óK"óK"óE!ñK6ÓTM²SNl[i‰Ÿx‡Wl˜Wl˜l[iWiwWl˜‰Œš§wŠ•JgnSpŽSpŽWiwSpŽgy†gy†gy†hˆ–hˆ–o®wŠ•o®gy†WiwWiwJgngywŒš§fjgGJFMYjWiwZwvi‡‡o®Œš§y–—w‰‡i†xw‰‡y–—ˆ¦§‰¥—•®²•®²ˆ¦§Š¤ˆz•‡w‰‡wˆww‰‡uzvuygwxWhvXhxghxghvXfjVe[GOKNVYGOKNojowŠ•fjgfjgfjghxgpxŒi‡‡wˆwx†huzvuyguyguyguygx†hx†hwˆw…ŠwŠ¤ˆ¥u†‰gx”k†‰g†‰gÜÄLȵlÙ¸HèrYÜÄLÜÄLȵlÜÄLÜÄLÜÄLÜÄLÜÄLÙ«9Ù«9Ù«9Ù«9ÜÄLÜÄLÙ«9Ù«9Ù«9Ù«9׎٫9Ù«9ÇšH®’K²Š8®’K¬u/oQ/R4'R4'gg9gg9e[GwxWwxWuzv¨¶‡§˜W˜¥W‘ˆ;Žr6—˜g—˜Y§˜W•ŠW•Šm¨µ¨·²§˜W‘rM†‰g¦©ˆ¦©—§¨¨¸·©©¶¸©¶¸˜¨§Œš§˜¨§z•yXgW86+-12;F8;F8-125+(-125>hWiwWiwVZV“UV×[h²SNÒ9(ëLEÒ9(ñK6ì=&ì=&òJ,òJ,ñK6ëLEëLEëYVëLEëLEëLEëLEñK6ê\eê\eæprãvˆê\eëYVëLEÒ9(›8%l4$›8%ÓTMê\eæprèrYíWHìV:íWHíWHíWHêfXãvˆãvˆæprãvˆæpr⃌æprèggèrYêfXìdJèrYèrYìdJìdJÔM1›8%›8%Ò9(ëLEê\eê\eæprèggêfXê\eèggèggêfXèggêfXêfXèggëYVêfXïTBñT8óK"ñT8ïTBïTBñK6òT'òJ,óE!ì=&Ò9(ëLE“UVŸx‡l[ipxŒŒš§Œš§hˆ–Sw©WiwOKNWl˜ˆ¦§Œš§hˆ–gy†SpŽWiwgy†hˆ–gy†WiwWiwWiwo®y–—o®hˆ–SpŽMYjMYjgyw‡™—pxŒgy†Zwvgy†gy†hˆ–wŠ•ˆ¦§y–—wŠ•i†xi‡‡i†xi†xi‡‡‡™—•®²˜¨§‡˜‡‡˜‡wˆwuyggywj„hwxWhxgfjVghHfjVhvXe[GVYGVYGVYGVZVojopxŒfjgfjgfjgYuhgy††Š‡†Š‡uzvgywuyguygfjguygtnwˆw…Šw‡—x–šw‡—xx†hx†h†‰gȵlÏQÏQÜÄLÉÄp⃌ȵlÜÄLÜÄLÜÄLÙ«9Ù¸HÙ«9Ù«9ÜÄLÙ«9ÜÄLÙ«9Ù«9Ù«9Ù«9Ù«9Ù«9Ù«9׎̓2²Š8‘ˆ;¬u/Žr6oQ/D<5fjV—ˆI—ˆI†yHwxW†yH¦¨w—ˆI‘ˆ;’•IŽr6oQ/…{W®’K§§h¦©—·¹·¸·©·²©•o¯§V™¥h—˜g§¨¨©¶¸¨µ¨§¨¨©¶¸˜¨§‡˜‡uzvWifIYVIYVZwvWif-1299539I-12MYjSpŽpxŒ‰“UV²SN×[hÒ9(ì=&ëLEì=&ì=&óE!òJ,ñK6ëLEëLEëLEëLEëYVëLEëLEëLEê\eê\eê\eê\eãvˆê\eëLEëYVì=&Ò9(›8%l4$Ò9(ÓTMêfXêfXìV:òJ,ñT8ñT8ìV:íWHëYVèrYèggèggèggèggêfXêfXìdJêfXèrYèrYèrYìdJìV:Ò9(›8%Ò9(íWHê\eê\eêfXèggêfXêfXíWHíWHìdJèggêfXêfXèggëYVìdJëYVïTBòT'óE!òT'òT'òJ,òJ,òJ,óBì=&ñK6êI8×[hŸx‡“UVpxŒWl˜MYjhˆ–•®²Œš§gywJgnGJFMYjWiwŒš§o®ZwvWiwMYj=eeSpŽWifWl˜pxŒpxŒWl˜pxŒŒš§Œš§y–—hˆ–pxŒWiw‡™—fjgWifZwvgy†gy†wŠ•v¥®y–—y–—v¤šy–—z•‡w‰‡w‰‡z•yw‰‡w‰‡wŠ•‡™—‡™—‡™—‡™—w‰‡uzvi†xuygfjVVYGfjVfjVVZVfjVVZVfjVfjVfjVfjgWiffjgojogywuygz•‡†Š‡j„hojouzvhxguygx†hwˆw…Šw‡—xˆ–h‡—xˆ–h†‰gˆ–hȵlÏQȵlȵlȵlÜÄLȵlÜÄLÜÄLÙ¸HÙ¸HÙ¸HÙ«9ÜÄLÜÄLÜÄLÙ«9Ù«9Ù«9׎٫9Ù«9׎٫9²Š8ÇšHÇšH¬u/¬u/•ŠWŽr6oQ/—ˆI—ˆIfZ8GF-R4'YeH©•ovi8®’K’•I•ŠW–šw·²·²¨µ¨¸·©ÃÅ¡Ä°”¦¨w´±o·²¦©—¨µ¨¸·©¨¶—¯”‘¨µ¨—¨–tnojowŠ•Œš§Œš§•®²†Š‡fjgIYVIYVF<EMYjw‰‡w‰‡fjgOKN“UV›8%ÓTMÒ9(ëLEëLEì=&ì=&ð=òJ,ñK6ëLEëLEê\eëLEëLEëLEê\eê\eê\eãvˆãvˆãvˆê\eëYVëLEëLEëLEð=ì=&›8%›8%ÔM1íWHêfXìV:ñT8ìV:òT'ñT8ìV:èrYìdJìdJëYVêfXêfXìdJìdJêfXìdJèrYèrYèrYìV:Ò9(Ò9(Ò9(ñK6ëYVïTBëYVê\eêfXêfXëYVëYVëYVëYVìdJìdJëYVíWHíWHëLEëLEñK6ñK6ñT8ñK6ñT8ñT8òT'óE!óE!óE!ì=&ëLE×[h“UV“UVWl˜pxŒWl˜MYjpxŒŒš§‡™—y–—XgWGJFMYjWl˜wŠ•ˆ¦§ZwvWifIYVVZV:GFOKNMYjpxŒSpŽOKNMYjl[ipxŒŒš§Œš§ˆ¦§•®²•®²o®Z†gy†i‡‡hˆ–y–—v¥®wŠ•hˆ–o®‰¥—y–—wŠ•z•‡y–—‡™—z•‡y–—†Š‡‰¥—•®²˜¨§—™—‰¥—y–—uzvfjVVZVVYGfjVhvXfjgfjVfjghxgfjggywhxgfjgi†xhxgj„h†Š‡wˆwuyguyguyguyguzv†‰g†‰gwˆw‡—x‡—xˆ–hwˆwx†hȵlÏQȵlÏQȵlȵlÜÄLÜÄLÜÄLÜÄLÙ«9Ù¸HÙ«9Ù«9ÜÄLÙ«9Ù¸HÜÄL׎٫9Ù«9Ù«9Ù«9Ù«9²Š8ÏQÇšH°mS—ˆIŽr6vi8vi8Žr6vi8GF-UL-oQ/†‰g•ŠW‡‡I˜¥W—ˆI®’K©•o´±o´±o©•o§˜W©•o©•o´±o·²¸·©¸·©·²–šw–š‡–š‡§¨¨–š‡‰¥—Œš§—™—¨µ¨˜¨§w‰‡w‰‡gywWiwZwvŒš§Œš§ojo39I39IOKN5>h“UV²SNÓTMÒ9(ëLEêI8ëLEòJ,òJ,ñK6ñK6ëYVê\eê\eê\eê\eê\eê\eæprãvˆãvˆãvˆê\eê\eëLEëLEëLEñK6ì=&ð=Ò9(²N0ÓTMÓgVÓgVíWHïTBñT8ìV:èrYìdJìdJïTBìdJìdJêfXêfXèrYèrYæpræprèrYèrYÔM1Ò9(ì=&êI8ëYVëYVëYVêfXíWHìdJïTBñT8ïTBñK6ñT8ñK6ñT8ïTBñK6ïTBñK6ñK6ñK6ñK6ïTBïTBëYVñT8óK"óE!óE!òJ,ëLEëLEÓTM²SN“UVpxŒpxŒpxŒWl˜Wiwgy†wŠ•‰Œš§ojo39IWiwSpŽgy†Œš§o®hˆ–WifOKNF<EF<EWifWiwOKNMYjOKNF<EF<EMYjpxŒ©¶¸©¶¸Œš§wŠ•‡™—‡™—y–—Œš§ˆ¦§v¥®wŠ•y–—v¤šˆ¦§ˆ¦§v¤šy–—y–—‡™—Œš§˜¨§‰¥——¨–‡™—‡™—‡™—Œš§—™—‡˜‡w‰‡uzvojohxghxgfjVfjVfjgfjguzvw‰‡fjguzvuzvuzv…Šwwˆwuzvuyguzvuzvwˆw…Šwuzvtn…Šw•Šm–šw‡—x…ŠwÏQȵl⃌ÉÄpÜÄLÜÄLÜÄLÙ¸HÙ«9Ù¸HÙ¸HÙ¸HÜÄLÙ«9ÜÄLÜÄLÜÄLÙ«9Ù«9èrYÙ«9Ù«9Ù«9Ì“2²Š8ÇšHÇšH°mS—ˆI²Š8Žr6wv;Žr6oQ/R4'UL-wwH—˜g‡‡I˜¥W®’KŽr6²Š8§˜W§˜W¦©ˆ‘rM…{W©•o©•o¯”‘¦©ˆ¦©ˆ©•o©•o©•o–š‡¦©——™—‰‰‡˜‡©¶¸•®²wŠ•†Š‡uzvMYjgy†ˆ¦§w‰‡IYV-12-1239IF<ElWR“UV²SNÓTMì=&ñK6ñK6ì=&ñK6ñK6ñK6ñK6ëLEëLEê\eê\eãvˆê\eãvˆæprê\eãvˆê\eëYVê\eê\eëLEê\eëYVëYVì=&ì=&Ò9(Ò9(ÓTM×[hÓgVêfXêfXìdJèrYèrYêfXìdJêfXêfXíWHêfXèggæprÓopèrYèrYÔM1ì=&ëH&ïTBëYVê\eïTBìdJïTBíWHïTBëYVïTBñK6òJ,òJ,ñK6ñK6ñT8òJ,òJ,ñK6ñK6ñK6ëYVñT8ñK6ñT8óK"óK"óK"òT'ñK6ñK6íWH²SN²SNl[ipxŒpxŒpxŒ‰ÄWl˜MYjSpŽl[igy†—™—‰VZVOKN5>hZwvŒš§pxŒpxŒ‡˜‡‰fjgWiwMYjpxŒhˆ–WiwVZV9955+(F<El[i—™—©¶¸w‰‡o®w‰‡i‡‡i‡‡v¤šv¥®Œš§wŠ•y–—y–—y–—ˆ¦§wŠ•wŠ•‡™—Œš§z•‡‡˜‡‡™——™—‡˜‡wˆwojouyguzv‰—™—‰¥—‰uzvgywhxgfjggywgyw‡™—wˆwuygojouygwˆwx†huzvuzvuzvuzvx†hx†h…Šwx†h…Šw‡—x‡—x¥u‡—xȵlÜÄLÜÄLȵlÜÄLÉÄpÙ¸HÙ¸HÙ¸HÙ¸HÙ¸HÙ«9Ù«9Ù«9Ù«9Ù«9Ù«9Ù«9׎٫9Ì“2Ù«9ÇšHÙm"²Š8Ù«9²Š8¬u/²Š8Žr6Ivi8vi8wv;fZ8fZ8•Šm—ˆI’•I’•IŽr6†yH«¢;¦¨w¯”‘§˜W‘rM†‰g©•o–šwÄ°”·²©•o§˜W©•o©•o¦©—§¨¨—¨–§¨¨•®²¨µ¨…ŠwojoojowŠ•ojowŠ••®²uzvWifOKNMYjpxŒWiwojol[il4$“UVÒ9(êI8ì=&ñK6ñK6ñK6ñK6ëLEëLEê\eëLEê\eãvˆãvˆãvˆê\eê\eãvˆê\eê\eê\eê\eê\eê\eëLEíWHëYVêI8ëH&Ò9(Ò9(²SNÓopÓopèggèggÓgVèrYèggìdJìdJìdJìdJíWHêfXæprèggèggÓopìV:ëH&ëH&ñK6ïTBïTBïTBñK6ïTBëYVëYVïTBëLEñK6ñK6ñK6ñK6ñK6ñK6ñK6ñK6óE!ëLEñK6ñK6ïTBïTBòJ,óK"óK"óK"òT'òJ,ñK6ïTBÓTM×[h²SNŸx‡tnpxŒwŠ•pxŒpxŒOKNMYjVZVMYjVZVpxŒ˜¨§pxŒMYjJgngy†y–—OKNF<El[iwŠ•—™—pxŒMYjl[iuzvwŠ•ojol[iVZVOKNVZVw‰‡©¶¸Œš§Œš§y–—y–—ˆ¦§•®²‡™—ˆ¦§y–—y–—‡™—‡™—ˆ¦§y–—w‰‡‡™—‡˜‡…Šwx†h…Šw…Šw†‰gwxWukXfjVVZVfjVojowŠ•‰‡™—‡˜‡pxŒuygfjguzv‡˜‡uzvuyguygwˆwx†huzvtnx†huzv†‰g†‰g…Šw…Šw…Šw‡—x…Šw¥u•ŠmÙ¸HȵlȵlÉÄpÉÄpÜÄLÜÄLÜÄLÙ¸HÙ¸HÙ¸HÙ«9Ù«9Ù«9Ù«9Ù«9Ù«9Ù«9׎٫9Ù«9Ù«9Ì“2ÇšHÏQÇšH²Š8¬u/°gŽr6UL-I—ˆI†yHvi8†yH¦¨wwwH‡‡I—ˆI—ˆI—ˆI§˜W·²®’K¬u/Žr6Žr6•Šm©•o—ˆI®’K®’K—ˆI§˜W©•o¦©—·¹·–š‡˜¨§§¨¨tnojowŠ•ˆ¦§Œš§ˆ¦§©¶¸gywMYjWiwpxŒ‡™—gy†WiwVZVl[i“UV“UV²SNÓTMÒ9(ì=&ñK6ñK6ñK6ëYVëLEëLEëYVê\eê\eê\eãvˆëYVê\eê\eê\eê\eê\eê\eê\eëLEê\eê\eê\eê\eñK6ð=ð=Ò9(²SNÓop×[hÓgVèggêfXèrYëYVïTBñT8ïTBìdJêfXèrYèggÓgVëLEëH&óK"êI8ëYVëYVïTBïTBëYVëYVïTBëLEëLEëLEëLEëLEëLEñK6ñK6òJ,ñK6ñK6òJ,ñT8òJ,ñT8ñT8òJ,óK"òT'óK"òJ,òJ,êI8êI8ëYVÓTM²SN±spŸx‡wŠ•l[ipxŒpxŒgy†fjgMYjOKNwŠ•‰F<EVZVŒš§‡™—SpŽgy†Œš§w‰‡:Ql;F8IYVojoŒš§w‰‡l[iOKNMYjojopxŒ‰wŠ•VZVOKNŒš§Œš§‰¥—Œš§y–—ˆ¦§•®²Œš§‡™—•®²‰¥—v¤šŠ¤ˆ‡˜‡z•‡x†huyg…Šw…Šw…Šw‡˜‡…Šw…ŠwwˆwuygukXfjVVZVlWRXgWfjVfjguzvw‰‡wŠ•i†xgyww‰‡uyghxguyguzvwˆw…Šwz•‡x†huzvuzvwˆw†Š‡wˆw…Šw‡—x…Šw‡—x†‰gȵlÉÄpÉÄpÉÄpÉÄpÜÄLȵlÜÄLÙ«9Ù¸HÙ«9Ù«9Ù«9Ù«9׎٫9Ù¸HÙ«9Ù«9Ì“2Ù«9Ù«9׎ǚHÙ¸HÌ“2®’K²Š8¬u/P,vi8Žr6vi8vi8oQ/—˜g§˜W‘ˆ;‡‡IŽr6vi8Žr6©•o§˜W—ˆI§§h—ˆI‡‡I©•o¯§V§˜W¯§VÇšH¯§V´±o©•o©¶¸¯”‘˜¨§§¨¨—™——™—˜¨§ˆ¦§Œš§«¹Ê©¶¸†Š‡w‰‡•®²˜¨§‡™—ojo:OQ-12995l[ipxŒ“UV“UV²SNÒ9(ñK6ëLEñK6ëLEëYVëLEëYVëLEê\eëLEê\eê\eê\eãvˆê\eê\eëLEëLEëYVê\eëLEëYVëLEëLEëLEñK6ì=&ð=Ò9(Ò9(ÓTMÓopÓop×[hìdJÓgVÓgVê\eëYVìdJëYVêfXÓop×[hÓTMëH&ëH&ïTBëYVëYVãvˆê\eëYVê\eê\eëYVê\eëYVëLEïTBëYVëYVëLEñK6ñK6òJ,ñK6ñK6òJ,óE!óK"óE!óE!óK"óK"óK"óE!òJ,òJ,êI8ÓTMÓTM²SN“UVtnwŠ•pxŒWiwWiwgy†gy†pxŒOKNfjg‰ÄSpŽF<EVZV‡™—wŠ•WiwMYjwŠ•ZwvOKNF<E39IOKNpxŒ‰WiwVZVWiwl[ipxŒ˜¨§Œš§uzvpxŒuzv‡™—ˆ¦§•®²˜¨§ˆ¦§•®²˜¨§Œš§•®²‰¥—‰¥—‡˜‡Š¤ˆ‡˜‡†Š‡…Šw‡—x‡˜‡†Š‡…Šw†Š‡‡—x…Šwwˆwwˆwi†xojofjggywhxgfjgVZVfjgojogywgy†wŠ•w‰‡i†xx†hz•y…Šwwˆw…Šwuzv…Šwwˆw…Šw‡—x…Šw‡—x‡—x‡—x–šwÜÄLÉÄpÄ°”ÉÄpÏQÏQÙ¸HÙ«9ÏQÙ¸HÙ«9èrYÙ«9Ù«9ÏQÙ¸HÙ«9Ù«9Ù«9Ù«9Ù«9Ù«9Ì“2ÏQÙ¸HÇšHÇšHÇšH¬u/Žr6P,vi8fZ8oQ/fZ8¦¨w—ˆIwv;vi8Žr6Žr6•ŠW§§h®’K´±o¯§V—ˆI§˜W®’K—ˆI®’K¯§V¯§VÏQ©•o¸·©·¹·§¨¨¸ÇË©¶¸˜¨§Œš§Œš§©¶¸©¶¸¯ª¶pxŒŒš§‰†Š‡†Š‡w‰‡F<EF<E5>h5+(MYjŸx‡“UV²SN›8%²SNÒ9(ì=&ëLEñK6ëLEëYVëLEëLEê\eëLEëLEëLEëYVê\eëLEëLEëLEê\eëYVëYVëLEëLEëYVñK6ëLEñK6ëLEñK6ð=Ò9(²SN×[hÓopãvˆ×[hèggãvˆæpræpræpr×[hÓop×[hëYVì=&ñK6ëLEëYVëYVê\eèggê\eëYVê\eëLEëYVëYVñK6ïTBïTBñK6ñK6ñK6ñK6ñK6ñK6ñK6ñK6òJ,òJ,òT'ñT8óK"óK"óK"óK"òJ,òJ,íWHèggÓTM²SN²SN“UVojol[igy†l[iMYjWl˜pxŒwŠ•WiwMYjhˆ–fjgGJFOKNMYj†Š‡Œš§l[iSpŽ‡™—KeWIYVIYVOKNl[iWl˜Œš§Œš§˜¨§wŠ•MYjgyw˜¨§˜¨§ˆ¦§‡˜‡gyw—¨–˜¨§‰¥—˜¨§˜¨§˜¨§•®²©¶¸©¶¸š³’z•y¥uŠ¤ˆŠ¤ˆŠ¤ˆ‡˜‡Š¤ˆ‡˜‡‡™——™—‡™—‡™—Œš§wŠ•z•‡w‰‡w‰‡w‰‡wˆwuygfjgfjVfjghxggywwŠ•‡˜‡‰¥—‡˜‡…Šwwˆwwˆw‡—xwˆwwˆw‡—x…Šw‡—x–š‡‡˜‡‡—x‡—x‡˜‡Ä°”Ä°”ÉÄpȵlÙ¸HÏQÏQÏQÏQÙ¸HÏQÙ«9Ù¸HÙ«9Ù«9Ù«9Ù¸HÙ«9èrYÙ¸HÙ¸HÙ«9Ì“2ÇšHÏQÌ“2¬u/²Š8®’K²Š8Žr6Žr6fZ8UL-tn¯§V«¢;‘ˆ;Žr6¬u/‘ˆ;¯§V®’K‘ˆ;—ˆI®’K§˜W¬u/—ˆI²Š8¯§V²Š8®’K®’K–šw¸·©·¹··¹·¯ª¶•®²§¨¨©¶¸©¶¸•®²•®²Œš§—™——™—‰‡™—†Š‡VZV39I39IF<EMYjl[il[i“UV“UV“UVÕwŒ×[hì=&ì=&ñK6ëLEïTBëYVëLEëYVëLEñK6ñK6ñK6ëLEñK6ëLEñK6ëLEñK6ïTBëLEëYVïTBñK6ïTBïTBíWHëLEì=&ñK6ÓTMÓopê\e×[hèggãvˆãvˆÕwŒÕwŒÕwŒãvˆãvˆèggêI8óE!ïTBëLEïTBëYVëYVëYVïTBê\eèggëYVëLEëLEëYVëYVëLEïTBëLEëLEëLEëLEëYVëLEëLEñK6ñK6ïTBòJ,óK"óK"óE!óK"òJ,ñK6ìdJæpr×[hÓTM±spŸx‡uzvfjgl[ipxŒojogy†pxŒMYjOKNIYVwŠ•ojoD<539IGJF5>hwŠ••®²pxŒŒš§w‰‡i‡‡WiwF<EMYjpxŒpxŒ†Š‡˜¨§©¶¸†Š‡gy†ojo—™—§¨¨˜¨§w‰‡wˆw˜¨§‡™—•®²§¨¨˜¨§—™——¨–˜¨§¨µ¨•®²•®²•®²˜¨§˜¨§‰¥—˜¨§—¨–Š¤ˆ…Šww‰‡…Šwwˆwuzvgywuzvgywojoi†xgywhvXfjVfjgfjgojow‰‡gywpxŒz•‡Œš§z•‡z•‡…Šwwˆwwˆwz•y…ŠwŠ¤ˆ—¨–‡˜‡‡—x‡—x…ŠwÄ°”ÉÄpȵlÏQÏQÐ…xÏQȵlÙ¸HÜÄLÙ¸HÙ¸HÏQÙ¸HÏQÏQÏQÇšHÏQÏQÏQÙ«9Ì“2Ì“2Ì“2Ì“2ÇšHÇšHÌ“2ÇšH¬u/†yHUK7fZ8§˜WÏQ¯§V’•IŽr6‘rM§§h‘ˆ;Žr6oQ/P,–šw®’KŽr6‘ˆ;Ù«9ÇšH«¢;ÇšH·²Ã¼Ã¸·©¸ÇË·¹·¯ª¶§¨¨•®²˜¨§•®²©¶¸Œš§†Š‡pxŒ•®²Œš§˜¨§lWR)'&39IMYj‰†Š‡MYjl[ipxŒ¯”‘Í’ÓTMëLEÒ9(ñK6ñK6ñK6ñK6ñK6ñK6ñK6ïTBñK6ñK6ì=&ëLEëLEëLEñK6ñK6ñK6ì=&ñK6ëLEëYVïTBïTBëLEïTBëLEëLEíWH×[hæpræpræpræpræpræpr⃌ãvˆãvˆæprèggëYVêI8ñK6ëLEëLEê\eê\eê\eëLEïTBëYVê\eëYVëLEëYVê\eê\eëYVëLEïTBëLEê\eëLEñK6êfXïTBòJ,òJ,òJ,óK"óBóK"óK"óK"òT'òJ,ëLEÓTM×[hŸx‡tntnojol[iMYjo®gywojowŠ•ojo995F<EMYj—™——™—fjg39IF<EMYjŒš§«¹Ê«¹Ê¯ª¶Œš§ojoF<EMYj‰‰tn‰•®²—™—fjgIYVMYj‡™—·¹·‡™—‡˜‡z•‡˜¨§‡˜‡z•‡‡˜‡—¨–š³’—¨–š³’•®²©¶¸•®²©¶¸•®²«¹Ê•®²˜¨§˜¨§—™—˜¨§‡™—†Š‡…ŠwwˆwojoojohxgukXuyghxgfjVfjghxguygpxŒwˆwuyguzvuzv‡˜‡˜§ˆ–š‡z•ywˆw†Š‡wˆw–š‡Š¤ˆ‡˜‡‡—x–š‡…ŠwÄ°”ÉÄpȵlÏQÏQÙ¸HÙ¸Hȵl⃌ÜÄLÏQȵlÏQÏQÙ¸HÙ¸HÇšHÇšHÏQÏQÏQÙ¸HÌ“2Ì“2Ù«9Ù«9Ù«9Ì“2ÇšH²Š8¬u/ujGoQ/gg9¯§V´±o§˜W‘rM‘ˆ;—˜g¯§Vwv;wv;I…{W´±o«¢;Žr6²Š8«¢;¯§VÏQÄ°”ÃÍи·©¶Ã²¸Ç˦©——™—¦©—¯™§§¨¨©¶¸¯ª¶pxŒŒš§§¨¨©¶¸—™—uyg39IMYj‡™—§¨¨pxŒWl˜pxŒ‰Ä˜¨§±sp“UV²SNÓTM×[hëLEïTBñK6ëLEñK6ñK6ñK6ñK6ñK6ð=ñK6ñK6ñK6òJ,ñK6ñK6ëLEñK6ëLEëLEëYVíWHëYVëLEëLEëLEëLEê\eÓopèggê\eèggèggæprèggèggê\eæpræpr×[hëLEëLEëLEëYVê\eèggê\eê\eê\eê\eëYVê\eëYVê\eëYVëYVê\eê\eê\eëYVëLEëLEñK6òJ,íWHïTBóE!óBóK"óBóK"óK"óK"óE!óK"ñK6ÓgV±sp“UV¯”‘¯™§lWRl[iSpŽl[ipxŒo®Wiwuyg—™—uzvD<5GJFMYjojo˜¨§Œš§OKN-125>hpxŒ•®²«¹Ê˜¨§§¨¨uzvl[itn¯™§—™—‰—™—˜¨§˜¨§fjgMYjfjg•®²©¶¸—¨–‡˜‡†Š‡˜¨§—¨–—¨–˜¨§—™——¨–˜¨§š³’¨µ¨‰¥—‡˜‡—¨–¨µ¨•®²—¨–‡˜‡‡˜‡†Š‡†Š‡‡™——™—wˆwuyguygojohxguyghxgukXfjVfjghxgwˆwz•‡j„hx†huzvx†hz•‡—¨–—¨–†Š‡‡—xwˆw‡˜‡–š‡–š‡…Šw‡˜‡…ŠwÉÄpȵlÏQȵlÏQȵlÏQÉÄpÏQÏQÏQÏQÜÄLÜÄLÏQȵlÇšHÏQÇšHÇšHÏQÏQÌ“2Ì“2Ì“2Ù¸HÙ«9ÇšHÇšH¬u/Žr6ujG‘rM…{WÏQ®’K‡‡I’•I•ŠW´±o—ˆIŽr6‘ˆ;Žr6–šw²Š8‘ˆ;¬u/«¢;Ù¸Hȵl¸ÃuüÃüöò·¹·¯”‘tn—™—¯”‘‰·¹··¹·—™—Œš§‰Œš§¯ª¶†Š‡l[i‡™—«¹Ê§¨¨ojoMYjŒš§¯ª¶—™—ojolWR“UV²SNÓTM×[hëLEëLEëLEëLEñK6ëLEñK6ñK6óE!ì=&ñK6òJ,ñK6ì=&ëLEëLEëLEñK6ëLEëYVëLEëLEëLEëYVëYVëLEëYVëYVêI8êI8íWHìdJèggæpræprèggèggêfXèggïTBëLEïTBëLEïTBíWHëYVëYVíWHê\eê\eëYVê\eê\eïTBëLEïTBëLEïTBïTBïTBïTBíWHìdJêfXïTBñK6óE!óE!óE!óE!óE!óBóE!óE!òJ,ÓTMÓopÍ’“UV“UVpxŒŒš§WiwMYjWiwgy†pxŒpxŒMYjVZV†Š‡pxŒGJFOKNMYjOKNpxŒ˜¨§l[i-12F<El[iŽ¬Ì‰†Š‡¯™§Ÿx‡±sp—™—¯ª¶•®²†Š‡wŠ•§¨¨Œš§gy†gywŒš§§¨¨§¨¨˜¨§˜¨§—¨–§¨¨†Š‡—¨–§¨¨§¨¨¨µ¨¨µ¨š³’¦©ˆ–š‡š³’¨µ¨—¨–‰¥—†Š‡†Š‡‡™—‡™—†Š‡…Šw†‰guyguyghxghxggywuygwxWuzvhxguygwˆw‡˜‡uygi†xwˆwx†hx”k…Šw‡˜‡—¨–Š¤ˆ†Š‡‡—x‡˜‡‡—xz•y…Šw‡—xȵlÐ…xÏQÏQÏQÙ¸HȵlÏQÏQÙ¸HÏQÜÄLȵlÜÄLÜÄLÙ¸HȵlÏQ©•oÇšHÏQÙ«9ÇšH׎̓2ÇšHÙ«9Ì“2Ì“2¬u/‘rMP,‘rM•ŠW®’K²Š8‘rM—ˆI—˜g§˜W’•I‘ˆ;²Š8—ˆI‡‡IŽr6²Š8«¢;ÇšHÏQÏQ·²ÃÅ¡¶Ã²·²·²¸¨¨¯”‘–š‡‰§¨¨«¹Ê¯ª¶—™—pxŒMYjŒš§Œš§wŠ•©¶¸¸ÇË—¨–VZVMYj‰¥—•®²tnOKNWiwpxŒ“UV“UV²SNÓTMêI8Ò9(ëLEëLEñK6ñK6ñK6ñK6ñK6ñK6ñK6ñK6ð=ñK6ñK6ñK6òJ,ì=&ñK6ëLEëLEëLEëLEñK6ñK6ñK6ì=&ð=ð=êI8íWHïTBìdJìdJíWHìdJíWHïTBñK6ñK6ñK6ëYVëLEëYVñK6ñK6ñK6ñK6ê\eëYVëYVïTBïTBñK6íWHê\eëYVïTBïTBñK6ñK6ñT8ïTBïTBñK6óK"óE!óE!óK"óE!óBóK"ñK6òJ,êI8ëLEÓTM×[h¯™§l[ilWR¯ª¶‰ÄlWRWifgywgy†VZVojol[iOKNpxŒ‡™—wŠ•†Š‡Wif39Il[iŒš§WiwOKN5>hŒš§Œš§tn‰‰“UV“UVpxŒ†Š‡Œš§‡™—pxŒ•®²‰i†xi‡‡Œš§¨µ¨¨µ¨§¨¨‡˜‡‰¥——¨–Š¤ˆ¨µ¨¨µ¨—¨––š‡š³’¦©—¨µ¨š³’—¨–—¨–‰¥—¨µ¨˜§ˆ•Šmx…XukXukXwxWuygukXuyguyguyghxghxguyguygojouzv‡™—x†hwˆwz•y…Šw…Šwwˆw…Šw†Š‡˜¨§‡˜‡‡˜‡‡—x‡˜‡z•‡…Šw‡˜‡´±oȵlÏQÏQȵlȵlȵlÏQÏQÙ«9ÜÄLȵlȵlÜÄLȵlÏQȵl¯§V¯§VÏQÙ«9ÇšHÙ«9Ì“2Ì“2ÏQèrYÌ“2¬u/®’K¬u/Žr6‘rM²Š8‘ˆ;‘rMŽr6—ˆI§˜W—˜Y§˜W‘ˆ;‘ˆ;•Šm†yH²Š8ÏQ«¢;ÇšH¯§V¸·©ÃÅ¡Ä°”ű®·²¯”‘¯”‘‘rM“UV—™—üë¹Ê—™—Œš§Œš§‰«¹Ê©¶¸·Ê׶ò¨µ¨uzvgy†˜¨§˜¨§wŠ•F<ElWR†Š‡pxŒlWR“UV×[h²SNÓTMÓTMì=&ì=&ñK6ñK6óE!óE!òJ,ì=&ñK6òJ,óE!òJ,óBñK6ì=&ì=&ñK6ëLEñK6ñK6òJ,óE!ñK6óE!ð=ð=óE!óE!ïTBñT8ïTBïTBñT8ñT8ñT8ñK6òJ,ñK6ïTBñK6ñK6ñK6ñK6ëLEëYVïTBê\eïTBëYVïTBñK6ëLEëYVëYVëYVëYVïTBñT8òJ,ñK6ñK6óK"óK"óE!óE!óK"óK"óK"óE!òJ,òJ,êI8êI8ÓTMÓTM“UVŸx‡‰OKNojo¯ª¶‰VZVfjggywWiwMYjMYjl[iMYjWiw¯ª¶˜¨§—™—lWR39IWiwpxŒ‰l[i¯ª¶«¹Ê˜¨§¯™§¯™§—™—tnojoVZVVZV†Š‡‰wŠ•©¶¸ˆ¦§Œš§‡™—‰¥—˜¨§—™—§¨¨Š¤ˆ§¨¨—¨––š‡–š‡§¨¨¨µ¨¨µ¨¨µ¨¨µ¨š³’¨¶—¦©ˆ¦¨w•Šm•Šm…{WwwH†yHukXwxWuyghvXuyguyguyguygukXuyguzvuzvwˆw‰¥—x†hwˆwwˆw†‰g…Šw‡—x‡˜‡wˆw‡˜‡‰¥—‡˜‡‡˜‡Š¤ˆz•‡z•y‡˜‡Ð…xÏQÐ…xȵlȵlȵlÏQÏQÏQÏQÏQÏQȵlȵlÜÄLȵlÏQ´±oÏQÏQÌ“2Ù«9Ù«9Ì“2Ì“2Ì“2Ì“2¬u/²Š8®’K†yH‘rM¬u/®’K²Š8Žr6‘ˆ;‘rM•ŠW˜¥W®’K‘ˆ;•Šm´±o¯§VÇšH«¢;ÏQÏQÄ°”ÃÅ¡·²Å±®©•o•Šm©•o¯”‘–š‡¦©—§¨¨¯ª¶¯™§•Šm‰†Š‡§¨¨¨ÅÛ¸ÇË«¹Ê¨µ¨•®²˜¨§©¶¸§¨¨y–—fjggy†o®ojow‰‡Ÿx‡“UV²SN±sp×[hëLEì=&êI8ñK6ñK6ñK6ëYVñK6òJ,óE!òJ,óE!ð=óBñK6ëLEñK6ñK6ì=&òJ,òJ,ñK6óE!ð=ð=ð=ð=óBóBìdJìdJìdJìdJìdJìdJïTBñK6ð=ëLEëLEïTBñK6ïTBñK6ê\eê\eëYVíWHëYVïTBïTBïTBïTBëLEïTBëYVëYVíWHïTBëYVòJ,óK"óK"óK"óE!óE!óK"óK"óE!óBòJ,òJ,òJ,ëLEÓTM²SN“UVlWR‰pxŒF<Eojo©¶¸pxŒOKNWiwgy†gy†l[iMYjWiwSpŽ•®²©¶¸Œš§˜¨§uzvfjgVZVwŠ•¯™§•®²¯ª¶¯™§«¹Ê¸¨¨‰—™—tnOKN995F<EpxŒ—™—©¶¸‡™—y–—©¶¸‡™—˜¨§˜¨§•®²¨µ¨Š¤ˆ¨¶—¦©——¨–—¨––š‡—¨–¦©—¨µ¨¦©ˆ¦©ˆ™¦w—˜Y‰•Y•ŠW†yHwwHukXujGwxW†‰g…Šwuygojouyguygojofjguygojouzv‡™—x†hx†h…Šwz•y…Šw‡—x…Šw…Šw‡—x†Š‡‡˜‡‡˜‡˜§ˆ‰¥—…Šw†Š‡ÈµlȵlȵlȵlȵlÏQÏQȵlÏQÏQ´±oȵlȵlÏQÉÄpÙ¸Hȵlȵl¯§VÙ«9ÇšHÌ“2Ù«9Ù«9Ì“2Ì“2¬u/²Š8ÇšHP,P,¬u/ÇšH¯§V²Š8‘ˆ;Žr6‘rM™¥h—ˆIŽr6†yH–šw¯§V§˜W®’K¯§VȵlÃÅ¡·²ÇšH·²©•oP,‰‘rM¯™§¯”‘§¨¨¯”‘¦©—¦©—tntn‰©¶¸«¹Ê§¨¨§¨¨˜¨§©¶¸·Ê׶ò¨µ¨z•‡Z†Œš§wŠ•y–—pxŒl[itn“UV²SNÓTMÓTMÒ9(ëLE×[h×[hæpræprñK6óK"óE!óE!óE!ð=ð=óE!ñK6ñK6òJ,óE!ð=òJ,ð=óE!òJ,óE!òJ,óE!ð=òJ,êI8ïTBìdJêfXèggìdJëLEì=&ñK6ëLEëLEëLEïTBïTBñK6ïTBñK6ñK6ñT8íWHëYVê\eïTBïTBñK6ñK6ïTBñK6òJ,ñK6ïTBòJ,òJ,ñK6óE!ñK6òJ,ñT8òJ,óBñK6ê\eïTBêI8ëLEÓTMÕwŒpxŒl[il[iŒš§l[iF<Eojo¯ª¶pxŒWiwgy†wŠ•o®pxŒWiwSpŽpxŒŒš§¯ª¶‰Ä©¶¸—™—ojotn¯ª¶«¹Ê¯™§¯™§¯ª¶¯ª¶…Šw†Š‡†Š‡fjV9955+(OKNpxŒ©¶¸©¶¸z•‡•®²Œš§•®²©¶¸˜¨§¨µ¨˜¨§š³’¨µ¨š³’–š‡˜§ˆ¦©—¨¶—·²¨¶—™¦w™¦w™¥h—˜Y‰•Y‡ˆX†yH‡ˆX‡ˆXtnx†htnhvXukXukXuygukXfjVfjguygwˆwz•‡uzvx†h†‰g…Šw…Šw‡—x…Šwwˆwz•y‡—x‡—x‡—x—™—˜§ˆ‡—xz•‡Èµlȵl´±oȵlÏQȵlÉÄpÏQÏQÏQȵlȵlÉÄpȵlÏQÏQÉÄpȵlÏQÇšHÌ“2Ì“2Ù«9Ù«9Ì“2ÇšHÇšHÇšH¬u/Žr6Žr6¬u/«¢;§˜W²Š8—ˆIŽr6‡‡I§˜WŽr6‘rM‘rM·²®’K—ˆI®’KȵlÄ°”´±o®’K®’K¯”‘¬u/‘rM¯”‘°mS¦©ˆ¸·©tn–š‡¸·©tntn—™—©¶¸«¹ÊojopxŒ§¨¨«¹Ê·Ê׸ÇËŽÁÚ©¶¸•®²•®²˜¨§Œš§gy†ojo‡™—tn“UV±spÕwŒ±spÕwŒëYVëLEÓopê\eñK6óE!ð=ð=ð=ð=ð=òJ,ñK6òJ,óBóE!ð=ð=òJ,òJ,ð=óE!ð=óE!óBì=&ì=&êI8ëLEèggèrYèggìdJëLEñK6ì=&ëLEñK6ñK6ñK6òJ,ñK6óE!óE!ñK6ñK6ïTBïTBïTBïTBñK6ïTBïTBïTBïTBïTBíWHïTBñK6ñK6ñK6óK"óK"óE!óK"óE!òJ,ïTBèggæprëYVëLE²SN“UVŒš§pxŒOKNpxŒ‰pxŒMYjwŠ•©¶¸pxŒOKNOKNMYjpxŒpxŒpxŒl[iMYjŒš§•®²©¶¸©¶¸Ÿx‡Ÿx‡‰¯™§¯™§«¹Ê¯ª¶«¹Ê•®²‡™—‰ojoOKNOKNIWGOKNuzv©¶¸˜¨§˜¨§‡™—‡™—©¶¸·¹·©¶¸¨µ¨¨µ¨§¨¨¨µ¨¦©—˜§ˆ¦¨w§§h§§h¦©ˆ¦©ˆ¦©ˆ¦©ˆ¦¨w—˜Y—˜g•ŠW†‰g‡ˆXuygwxWuygwxWfjVlWRfjVfjVfjguyguygw‰‡x†hj„hx†hx†hwˆwwˆw‡—x…Šwz•yz•yz•y‡—x†Š‡Š¤ˆŠ¤ˆ‡˜‡Š¤ˆ´±o´±oȵlȵlȵlÜÄLÉÄpÏQ´±o·²ÈµlÉÄpȵlÏQÏQÉÄp¸ÃuÏQÙ«9Ù«9ÇšHÌ“2Ì“2Ì“2Ì“2Ù«9Ì“2ÇšHÌ“2¬u/Žr6²Š8Ì“2®’K²Š8²Š8¬u/—˜Y•ŠW‘rM—ˆI§§h¨µx®’K‘rM‘rM©•o©•o¬u/®’K©•o©•o¬u/•ŠW±sp“UV—™—¯”‘tn—™—¸¨¨•Šm—™—¯ª¶©¶¸Ÿx‡-12‰«¹Ê·Ê׫¹Ê©¶¸¨ÅÛ©¶¸©¶¸«¹Ê—™—l[iwŠ•§¨¨ojolWRpxŒŸx‡tnŸx‡±sp²SNÓopê\eêI8ì=&ð=ð=ð=óE!óE!ð=óE!òJ,óE!òJ,óBóE!óBóBòJ,óE!óE!óE!óBóBòJ,êI8êI8ÓTMèggæpræprêfXñK6ì=&ñK6ëLEñK6ñK6óBóE!òJ,óK"óE!òJ,óK"óE!óK"òJ,òJ,óE!ñK6ñK6ïTBñK6ñK6ïTBñK6ñK6ñK6óK"óE!óE!óE!óE!óE!òJ,ñK6ñK6êfXÕwŒÓop“UVlWRlWR‰‰ojo—™—pxŒ‰MYj‰§¨¨ojoOKN:GF:OQgy†WiwWiwpxŒgy†˜¨§˜¨§¯ª¶§¨¨tnŸx‡‰Ä¯ª¶«¹Ê¯ª¶©¶¸¯ª¶w‰‡—¨–†Š‡OKNGH8GJFWifpxŒ‡™—¸ÇË©¶¸‰¥—Š¤ˆ‰¥—¨µ¨¨µ¨—™—§¨¨¨µ¨¨¶—¸·©™¦w¦¨w§§h—˜g™¥h¦¨w¨¶‡¨¶—¨¶‡¦¨w˜¥W‰•Y…{W…{WukXukX…Šwx†hukXfjVfjVhvXuygojox†h†Š‡j„huygwˆwx†hwˆwwˆw†Š‡…Šwz•‡wˆwwˆw‡˜‡‡˜‡Š¤ˆŠ¤ˆ‡˜‡Š¤ˆ´±oȵlÄ°”ȵlÉÄpȵl´±o´±oȵlÄ°”ÉÄpÉÄpȵlÏQȵlȵl´±oÏQÏQÌ“2Ì“2Ì“2Ì“2ÏQÇšHÇšHÇšHÇšHÇšH¬u/°mS²Š8ÇšH§˜W®’K®’K®’K’•I‡‡I—ˆI†yH•Šm©•oŽr6†yH©•o®’K¬u/‘rM²Š8©•o°mS°mS•Šm©•o•Šm¸¨¨¦©—¯”‘¯”‘¯”‘—™—¯ª¶«¹Ê¯ª¶Ÿx‡pxŒ«¹Ê·¹·—™——¨–¨Å۶ò©¶¸¸ÇË©¶¸tn—™—•®²l[il[iwŠ•Œš§Ÿx‡¯™§¯™§¯”‘¯”‘×[hÒ9(êI8ëLEñK6ð=ð=òJ,óE!ð=ñK6ð=óBóE!óE!óE!óBóBóBóBóE!ð=óE!óBóBì=&êI8×[hæprèggê\eïTBëLEì=&ð=ñK6ïTBñK6óE!óE!óBóBóBóBóE!óE!óE!óK"ñK6òJ,ñK6ñK6ñK6ñK6òJ,ïTBïTBñK6ñK6óK"óK"óE!óK"òJ,òJ,óE!ñK6ñK6ê\eÓgV¯”‘¯™§“UVlWRl[i¯™§Œš§˜¨§fjgMYjpxŒojoŒš§¯ª¶‡™—fjgGJF:QlSpŽpxŒ‰‰‰¯™§¯™§§¨¨Ÿx‡l[iŒš§¯ª¶¯ª¶Ž¬ÌŒš§«¹Ê†Š‡pxŒ—™—z•‡ojoWifgywwŠ•y–—Ž¬Ì¸Ç˨µ¨—¨–‡˜‡‡˜‡¨µ¨¨µ¨–š‡¦©—¦©—¨¶‡¨¶——˜g•Šm§§h¦¨w¦¨w¨¶‡·²¨¶—¨¶—¦¨w—˜g‡ˆX…{W…{WwxWuzvuygukXukXfjVfjgojohxgx†hwˆwx†huyguzvwˆw…Šwz•yz•y‡—xwˆww‰‡z•yz•y‡˜‡–š‡Š¤ˆ‡˜‡Š¤ˆ¸ÃuÄ°”ÉÄpÉÄpȵl´±o´±o´±oȵlÉÄpÄ°”ÉÄpȵlÏQÏQȵlȵlÇšHÌ“2Ì“2Ì“2Ì“2Ù«9ÏQÇšHÇšHÇšH²Š8²Š8²Š8²Š8ÇšH²Š8®’K¯§V®’K®’K‘ˆ;†yH‡‡I—ˆI–šw©•o…{W©•o®’KP,I—ˆI®’K©•o§˜W®’K©•o¸¨¨·²¦¨w¯”‘tn§¨¨·¹·«¹Êü¯”‘tn§¨¨¯”‘˜¨§Œš§©¶¸«¹Ê¸Ç˸ÇË«¹Ê©¶¸©¶¸©¶¸˜¨§†Š‡Ž¬ÌwŠ•pxŒ¯ª¶¯ª¶¯”‘©•oÕwŒÔM1ÔM1ëLEêI8êI8ì=&Ò9(ÓopëLEóBòJ,óE!óBòJ,ñK6òJ,óE!óE!óBóBóBóBóBóBì=&êI8ÔM1×[hÕwŒÓgVÓTMêI8ì=&ñK6ì=&ì=&òT'óK"óE!óE!óE!óE!óE!óE!óE!óE!óE!òJ,ñK6òJ,òJ,ð=òJ,ñK6óBòJ,ñK6ñK6òJ,òJ,òJ,óE!óE!òJ,ñK6ñK6êI8êI8ÓTM²SN“UV‰Œš§tnVZVl[iŒš§«¹Ê‰MYjMYj‰pxŒ‰Ä©¶¸ˆ¦§pxŒIYVOKNŒš§¯™§‰¯™§¯ª¶Å±®‰Œš§ojopxŒpxŒ‰‰ÄpxŒ©¶¸«¹Êˆ¦§§¨¨Œš§w‰‡wŠ•wŠ•y–—v¤š«¹Ê«¹Ê¨µ¨•®²¨µ¨¨µ¨˜§ˆ¨µ¨¨¶—–š‡–š‡¨¶—¸·©¨¶‡´±o§§h¯§V¯§V¯§V¦¨w¦©ˆ¦©ˆ¦©ˆ–š‡†‰g…{W…{W…{WuygtnuyguygfjVfjVfjVhxguygx†hwˆwuygx†hwˆw…Šwz•yz•y…Šwz•‡z•‡wˆwwˆww‰‡Š¤ˆŠ¤ˆ‡˜‡‡˜‡¸Ãuȵlȵlȵlȵl¸ÃuÄ°”Ä°”ÉÄpÄ°”ÉÄpȵlȵl´±o´±oȵlÏQÏQÇšHÇšHÌ“2ÇšHÙ¸HÌ“2²Š8®’KÇšHÇšH²Š8²Š8ÇšHÏQ²Š8²Š8®’K²Š8‘ˆ;®’K’•I—ˆI—ˆI˜§ˆ¦©ˆ¦©ˆ®’KoQ/vi8Žr6¯§VÇšHÄ°”¯§VÇšH¯”‘ÃÅ¡©•o©•o§¨¨¯™§©¶¸¸Ç˸·©¯”‘ukX‰—™—Œš§pxŒ§¨¨•®²«¹Ê·Ê׸ÇˬÐá¸Ç˸ÇË©¶¸©¶¸•®²Œš§‡™—‡™—«¹Ê¯ª¶tnŸx‡¯™§²SN²SN×[hÓTMÒ9(êI8ÓgVÕwŒæpròJ,ëLEòJ,ê\eñK6óE!ñK6òJ,óBóBð=óBóBóBóBòJ,êI8êI8ÓTM²SNÕwŒ×[hÓTMëLEì=&ñK6ñK6ñK6óK"óE!óE!óK"óE!óK"óE!óE!óE!óE!óE!óE!òJ,óE!ð=ñK6ñK6òJ,ì=&ñK6ëYVïTBñT8íWHñK6óE!òJ,óE!ì=&ì=&ì=&ÓTM²SN“UVl[i“UV‰˜¨§tnOKNOKN¯™§§¨¨wŠ•Wl˜gyw¯™§‰¯ª¶©¶¸©¶¸†Š‡tn‰§¨¨¯™§¦©—¯™§¯ª¶±spŸx‡Œš§l[il[iwŠ•¯™§‰pxŒ©¶¸©¶¸«¹Ê§¨¨wŠ•y–—y–—ˆ¦§ˆ¦§«¹Ê˜¨§•®²¨µ¨¨µ¨¦©——¨–¦©ˆ¦©—¦©—–šw¦©ˆ¨¶—·²¨µx´±o´±o´±o§˜W§˜W§§h—˜gtn–š‡™¦w•ŠmuyguygukXuyguyguygukXfjVlWRfjVhxguygx†huygwˆw†‰gz•yz•y†Š‡‡—x†Š‡‡˜‡z•‡w‰‡wˆw‡˜‡Š¤ˆz•‡‡˜‡ÈµlȵlÉÄp´±o·²Ä°”ȵl¸ÃuÄ°”ÉÄpÄ°”ȵlȵl´±oȵlȵlÏQÏQÙ«9ÇšHÌ“2Ì“2Ù«9ÇšHÌ“2ÇšHÇšHÇšHÌ“2ÇšHÙ«9²Š8¬u/²Š8ÇšH®’K²Š8¯§V¯§V‘rM•ŠW¨¶—¯”‘®’K‘ˆ;‘ˆ;²Š8²Š8¬u/‘rM´±o²Š8®’K¨¶—·²±sp¯”‘·¹·¯”‘¸·©§¨¨¯”‘‘rMpxŒ©¶¸¸Ç˯™§—™—©¶¸©¶¸©¶¸—™—š³’¸ÇË·Ê׫¹Ê«¹Ê¸ÇËš³’‰¥—•®²Ã¼Ã˜¨§ojo†Š‡©¶¸±sp“UV±sp±spÕwŒÓTMÕwŒÍ’ëLEÒ9(ð=êI8ëYVæprñK6ð=óE!ì=&ð=óBóE!óBð=ð=óBóBëLEëLEÒ9(×[hÕwŒÓTMÓTMêI8ñK6ñK6ñK6ñK6òJ,óK"óE!óE!óE!óE!óE!óBóE!óBóBóBð=óBòJ,òJ,óE!ì=&ñK6ëLEæprê\eëLEæprëYVóE!óE!òJ,ì=&ì=&×[h²SN²SN“UVl[il[il[i‰¯ª¶uzvUK7ojoüÕ®²‰o®wŠ•˜¨§—™—˜¨§˜¨§·¹·¦©ˆ‰¯”‘¯”‘¯”‘¯™§Ÿx‡—™—Ÿx‡pxŒojol[il[iŒš§‰ÄŒš§ˆ¦§Œš§‡™—«¹Ê•®²•®²•®²ˆ¦§•®²«¹Ê•®²©¶¸©¶¸˜¨§¦©—š³’—™—–šw¦©ˆ·²¦¨w¦©ˆ¦©—¦¨w—˜g§§h§§h§§h¯§V—˜Y™¥h§˜W—˜g–š‡‡˜‡x…XwxWwxW†‰guyguygwxWuygfjVukXwxWuygx†hx†hx†h…Šwwˆwwˆw†Š‡‡—x‡—xz•y‡—xi‡‡wˆwz•‡‰¥—‰¥—‰¥—ȵlȵl´±oÄ°”ȵlȵl´±o·²·²´±oȵlÄ°”´±oȵl´±oȵlÏQÏQÇšH²Š8Ù«9Ù«9ÇšHÇšH«¢;ÇšHÙ«9Ù«9«¢;ÏQÏQ²Š8²Š8²Š8¯§V²Š8®’K§˜W®’Ktn–šw¦©ˆ§˜W¬u/²Š8¬u/²Š8IP,°mSÄ°”°mS¯”‘¸·©©•o®’K´±oÄ°”¸·©·¹·¦©—¯”‘•Šm§¨¨·¹·©¶¸‰•®²·¹·¨µ¨lWRVZVv¤š§¨¨¶Ã²©¶¸©¶¸¸ÇË«¹Ê©¶¸¸ÇË©¶¸—™——™——™—‰tn‰±sp¯™§±sp¯™§ÕwŒÒ9(Ò9(Ò9(Ò9(êI8ëYVñK6ð=ð=óE!ê\eëLEóE!ïTBëLEð=óE!ëLEì=&ê\e×[hêI8×[h×[hÓTMëLEêI8ñK6ëLEê\eïTBñK6òJ,óE!óE!óE!óE!óBóBóBóE!óBóE!óBóE!óE!òJ,ñK6ñK6ì=&ð=òJ,ê\eñK6òJ,íWHòJ,êI8ìdJëLEÓTM±spÍ’“UVtntnl[il[ipxŒwŠ•Œš§pxŒŒš§¯ª¶§¨¨¯™§gy†gyw‰¯ª¶¯ª¶—™—üÃű®¯”‘±sp‰±sp¸¨¨¯”‘tn¯™§pxŒŒš§pxŒOKNl[i‰Ä‰¯ª¶—™—‡™—ˆ¦§«¹Ê©¶¸«¹ÊŽ¬Ì•®²•®²—¨–˜¨§š³’—¨–—¨–—¨–—¨–¦©ˆ¦©—–š‡¦©—¦©ˆ¨µx–š‡†‰g—˜Y©•o™¥h¦¨w¦¨w™¥h—˜g—˜g•Šm†‰g‡—xuygwxW†‰guyguzvuyguyghxguyguyguyguygwˆwwˆw…Šw‡˜‡z•‡wˆwz•y…Šw‡—xz•‡wˆww‰‡z•‡Š¤ˆ‡˜‡‰¥—¸Ãu´±o·²Èµl·²Èµl´±oµÄȵlÄ°”µÄ´±o´±oȵlȵlÏQÏQȵlÇšHÇšHÌ“2ÇšHÇšHÇšHÌ“2ÇšHÙ¸H«¢;«¢;Ù¸HÇšH—ˆI®’K«¢;²Š8«¢;®’K—ˆI—ˆI©•o§˜W¯”‘—ˆIŽr6¬u/P,¬u/Žr6P,°mS¯”‘–šw¦©—¸·©©•oÇšH©•o·²¶Ã²·¹·¯”‘•Šm¯”‘—™—¯ª¶¯™§•®²¸Ç˧¨¨tnOKN—™—©¶¸˜¨§—™—Œš§©¶¸¸Ç˸Ç˸Ç˸ÇË©¶¸©¶¸¸·©˜¨§‰‡™—Ÿx‡—™—¯™§Ä°”±sp²SNÓgVÓTM²SNÓTM×[hëLEì=&ì=&êI8ëLEãvˆêI8ñK6ëLEñK6ð=ñK6ëLEëLEê\eëLEÒ9(×[h×[hëLEÒ9(ëLEëLEëLEê\eëLEñK6òJ,ñK6ïTBñK6óE!òJ,òJ,ð=óBóE!óE!ñK6ëLEëYVïTBòJ,óE!òJ,óE!óE!ïTBïTBñK6ëLEëYVÓgVÍ’ÓTM²SN“UV¯™§tntntnojol[ipxŒojoŒš§˜¨§Œš§¯ª¶§¨¨¦©—§¨¨tn†Š‡¯™§«¹Ê¯ª¶Ã¼ÃÃÍЦ©ˆ©•otn±spl[i¯™§ojoŒš§˜¨§pxŒ†Š‡l[iMYjw‰‡l[iŒš§§¨¨Œš§§¨¨•®²•®²«¹Ê«¹Ê•®²‡™—z•‡‰¥—¨µ¨©¶¸š³’š³’¦©—˜§ˆ–š‡¦©—¦©—Ä°”¸·©¨¶—¨¶—¦¨w´±o´±o§§h´±o©•o©•o—˜gˆ–h†‰g‡—x‡˜‡wˆw‡ˆXwˆw†‰gukXhxguygfjVukXuzvuygwˆw…Šw‡—xŠ¤ˆz•‡wˆwwˆw…Šw‡—x‡˜‡w‰‡w‰‡y–—‡˜‡Š¤ˆy–—´±o·²Èµl·²´±oȵlÄ°”Ä°”·²Èµl¦¨w·²ÈµlȵlÏQ¯§VÏQÇšHÇšHÇšHÇšHÇšHÇšHÇšHÇšHÏQÏQÙ«9Ù¸HÏQ¯§V¬u/¯§V®’KÇšH®’K‘rM‘rM•ŠW‡ˆX§˜W¦©ˆ¬u/Žr6¬u/Žr6Žr6P,P,‘rM¦©—¯”‘·²¯”‘°mS©•o®’KÄ°”ű®·²•Šm©•o±sp—™—¯ª¶©¶¸¸Ç˯”‘‰tn‰—™—ojo‰l[iy–—¸ÇË·Ê×ÃÍЫ¹Ê«¹Ê¸ÇËÃÍЧ¨¨§¨¨…Šw¯ª¶˜¨§¸·©·¹·¯”‘²SN±sp¯”‘²SN×[h²SNÕwŒì=&Ò9(ì=&ÓTMê\eêI8ì=&ê\eëLEð=ì=&êI8ëLEæprëLEëLE²SN×[h×[hÓTMÕwŒ×[h×[hëLEæprê\eñK6ñK6òJ,ñK6òJ,óK"òJ,òJ,ð=óBóBóK"ñK6ñK6êfXê\eñK6ñK6ñK6ñK6íWHëH&ëLEëLEëLEÓTM×[hÍ’ÕwŒ“UV“UVtn¯™§¯™§ojoojo“UVl[i‰uzv‰§¨¨«¹Ê¯ª¶‰¯™§¯ª¶¯”‘¯™§Œš§·¹·Ã¼Ãü÷¹·¯”‘“UVukX“UVŸx‡¯™§¯™§©¶¸uzvojoIYVOKN‰lWRMYj•®²Œš§˜¨§•®²y–—˜¨§©¶¸©¶¸˜¨§˜¨§˜¨§˜¨§©¶¸˜¨§—¨–—¨–¦©ˆ–šw¦¨w¦¨w¦¨w·²ÃÅ¡µÄ¦¨w•ŠW•Šm•Šm§˜W—˜g—˜g™¦w™¥hˆ–hˆ–h‡—x‡—x†‰guyguzvuygojouygfjVuyguyguygz•ywˆwwˆw‡—x‡˜‡w‰‡uzvwˆwz•y‡˜‡‡˜‡w‰‡Š¤ˆy–—z•‡z•‡¸ÃuÄ°”·²·²´±oÄ°”·²Èµl´±o´±o¦©ˆ·²ÈµlȵlȵlÇšHȵlÇšHÏQÇšHÇšHÏQÇšHÏQ¯§VÙ«9ÇšHÇšHÇšHÏQÇšH²Š8ÇšH‘ˆ;ÇšH®’KŽr6‘rM‘rM†yH•Šm´±o‘ˆ;Žr6vi8vi8Žr6vi8Žr6…{W¨¶—·²´±o©•o‘rM©•oÐ…x¸¨¨¸·©¸¨¨©•o•Šmtn¯™§·¹·¸Ç˸¨¨†Š‡—™—¨µ¨–šwUK7VYG‰˜¨§¸ÇË©¶¸¸Ç˸Ǣ¨§¸Ç˸Ç˸·©©¶¸§¨¨§¨¨«¹Ê¸Ç˯ª¶¦©—tntn¯™§±sp±sp±sp±sp±spÒ9(Ò9(Ò9(×[hëLEì=&ëLE×[hð=ì=&êI8ì=&ègg×[hëLEÓTMÒ9(×[h×[hÓTMÍ’Óop×[hêI8ëYVèggëYVïTBóE!óE!òJ,ñT8ñK6óE!óE!òJ,ñT8ðWð=ì=&ñK6ëYVëLEð=óE!ïTB⃌ëYVëYVêfXêI8ëLEÓTM²SN¯™§tntntn¯™§¨µ¨—™—ukXuyglWRlWR—™—ojo§¨¨·¹·¦©—¯™§‰Å±®Ã¼Ã¸¨¨¯™§¯™§Ã¼ÃüÃÃÍз¹·tnl[il[i‰Ÿx‡¯™§©¶¸§¨¨pxŒpxŒF<EwŠ•pxŒMYjŒš§Œš§˜¨§«¹ÊŒš§˜¨§§¨¨—™——¨–¨µ¨˜¨§˜§ˆ§¨¨—¨––š‡¦©—¦©ˆ¦©ˆ´±o·²´±o©•o·²·²¦¨w‰•Y•ŠW•ŠW•ŠW•ŠW…{W‡ˆX—˜g—˜g–šw†‰g†‰g†‰gx†hx†huyguygukXukXukXuyg…Šwwˆwx†h…Šw‡˜‡‡˜‡z•‡uzvuzvwˆw…Šwz•y‡˜‡y–—z•‡z•‡y–—µÄ·²¨¶‡ÈµlÉÄp·²·²·²·²´±o·²ÉÄpȵlÏQ©•oȵl¯§VȵlÇšHÏQȵlÏQ©•oÏQÏQÏQÙ«9ÇšHÌ“2ÇšH®’K²Š8²Š8²Š8¯§V—ˆI‘ˆ;®’K‘rM‘rM—˜g¦¨w¬u/P,oQ/I°g‘ˆ;¬u/¦©ˆÄ°”·²—ˆI±spÇšH©•o¸·©¸¨¨ÃÅ¡¸·©–šw©•otn©¶¸Ã¼Ã·¹·¦©—¯™§§¨¨—™—lWRojo‡™—«¹Ê¶Ã²«¹Ê˜¨§¸ÇË·¹·©¶¸¶Ã²©¶¸–š‡·¹··¹·©¶¸·¹·¨µ¨‰—™—tn—™—¯”‘±spŸx‡±sp¯”‘ÕwŒ²SNÒ9(×[hÕwŒÒ9(ÔM1ÓopêI8ëLEèggì=&ÓTMÕwŒÓTM×[hÓTMÓTMÕwŒÓop×[hÕwŒÓopëLEêI8ëLEãvˆê\eê\eð=òJ,ñK6ñT8ñK6óBóK"êfXèrYêV&òJ,ñK6ñK6ïTBæpròJ,òJ,ëLEèggæpr×[hæprëLEêI8±sp°mS‰Ÿx‡lWRtnŒš§¯™§¨µ¨–š‡—™—tnlWR—™—¯™§—™—ü·¹·¯™§¯”‘üÃüø¨¨¯”‘¯™§·¹·Ã¼Ã·¹·Ÿx‡lWRojo‰OKNOKNŒš§§¨¨‰Œš§pxŒŒš§—™—pxŒŒš§ˆ¦§Œš§§¨¨˜¨§ˆ¦§‡™——™——™—–š‡—¨––š‡˜§ˆ¦©ˆ•Šm–šw¦©ˆ–šw•Šm•Šm•ŠW—˜Y©•o¦©ˆ·²§§h•ŠW•ŠW…{W•ŠW•ŠW‡ˆX…{W•Šm‡—x‡—x…Šwwˆw…{WuyguyguygwxWhxguyguyg†‰gx†huygwˆw…Šw…Šwwˆwuzvwˆwwˆwwˆw…Šw‡˜‡‡™—z•‡w‰‡y–—·²¸Ãu¸Ãuȵl·²·²·²·²©•o·²·²Èµlȵlȵlȵl¯§VÏQ¯§V§˜WÏQÏQ©•o©•oȵlÏQÏQÌ“2ÇšHÇšH—ˆI¬u/²Š8²Š8®’Kȵl©•o®’K®’K¬u/†yH†‰g§˜WŽr6oQ/oQ/Žr6Žr6Žr6•Šm©•o·²´±o¬u/©•o§˜W•Šm¸¨¨Ä°”·²©•o¯”‘‘rM‰Ã¼Ã¸·©—™—¯™§¨µ¨©¶¸‰Œš§«¹Ê«¹Ê¨µ¨˜¨§§¨¨·¹·¯ª¶tn•®²«¹Ê§¨¨¦©—¶Ã²ÃÍиÇ˸·©§¨¨§¨¨§¨¨•Šm§¨¨tntn‰¯”‘¯”‘ÕwŒ²SN²SN±spÕwŒÓTMÓop×[hÒ9(×[h×[hÒ9(ÕwŒ×[h×[h×[hëLEÕwŒÕwŒ×[hÓopÓopÓTMÔM1ì=&ëLEÓopëYV×[hì=&ëLEæprëLEïTBòJ,ì=&ñK6ê\eñK6òJ,ì=&êI8êI8æprëYVñK6êI8ëLEÓopÍ’Í’ÓgV²SN±sp¯”‘tn¯™§tnlWR—™—¯ª¶¯™§¸¨¨¦©—§¨¨tn–š‡·¹·¸·©Ã¼Ã·¹·¸¨¨·¹·±spÍ”¨Ã¼Ãű®¸¨¨±sp¯™§¸¨¨¸¨¨¸¨¨lWRF<EojoOKN5+(l[i¯ª¶‰ojo‡™—Œš§—™—pxŒ˜¨§Œš§uzv†Š‡§¨¨‡™—–š‡‡™——™—˜§ˆ–š‡¦©ˆ–š‡˜§ˆ–šw…{W†yH†yHwv;‘rM…{W‘rM•ŠW•Šm©•o¦©ˆ•ŠW‡ˆX†yH‡‡I‡‡I‡ˆX‡ˆX…{W…{W†‰g…Šwuyguyguzv†‰gukXukXojouygx†hwˆw…Šwhxgx†h‡—x‡˜‡wŠ•wˆwi†xuzvwˆw‡—x‡˜‡z•‡w‰‡uzvz•‡ÈµlÄ°”·²µÄ·²¸·©·²¦©ˆ·²ÈµlȵlȵlÏQ©•o©•o¨µxÏQ©•o®’KÇšH¯§VÇšH§˜WȵlÏQÇšH®’KÇšH²Š8²Š8‘ˆ;²Š8®’K§˜W´±o§˜W®’K—ˆI‘rM‘rM†‰g§˜W¬u/Žr6²Š8²Š8Žr6—ˆI¦©ˆ‘rM–šw©•o®’KÄ°”©•o¸¨¨·¹··²©•o¯”‘¸¨¨¯ª¶¯ª¶·¹·¯”‘‰§¨¨¨µ¨¦©ˆ§¨¨«¹Ê¯ª¶˜¨§‰tnuzv©¶¸§¨¨w‰‡©¶¸§¨¨…Šw«¹Ê¸ÇËüøÇ˨µ¨§¨¨·¹·§¨¨§¨¨¦©——™—˜¨§§¨¨·¹·§¨¨—™—²SN“UV¯”‘Ÿx‡¯™§Í’ÓTM²SNÍ”¨ÓTM±sp¯ª¶±spÕwŒÓTMÒ9(¯™§ÕwŒ²SNÕwŒÓTMÓTMÔM1Ò9(ÔM1ÓopëYV×[hëYVòJ,æprëLEíWHëLEì=&ì=&æprëYVñK6ëLE×[hÕwŒê\eÓopëLEíWH×[h×[h¯”‘Í”¨Í’°mS“UV¯”‘tn‰¸¨¨l[iojo©¶¸—™—¯”‘¯™§¸¨¨¸¨¨¯”‘¯™§Å±®·¹·Å±®¸¨¨·¹·Í’±spÍ”¨¯™§Ã¼Ãtnl[i¯ª¶¯”‘«¹Ê§¨¨lWRpxŒl[i5>hF<E‡™—üÃpxŒŒš§˜¨§Œš§Œš§‡™—Œš§uzvtn˜¨§§¨¨†Š‡†‰g†‰g†‰g…Šw•Šm˜§ˆ–šw–šw•ŠW‡‡I‡‡IŽr6—ˆI•ŠW•ŠW•ŠW©•o˜§ˆ©•o–šw†yH†yH†yH†yH…{WwxWwxW…{WukXuyguygtnuzv…{WuygwxWwxWuygwˆwwˆwwˆwuzvwˆwz•yz•‡z•‡wˆwwŠ•w‰‡wˆwz•‡†Š‡w‰‡wˆwwˆwz•‡¦¨w¨¶‡Ä°”¸·©¨¶—¨¶—·²¨µx´±oȵl´±o´±o´±o©•o´±oȵl¯§V§˜W©•o¯§Vȵl©•oȵlÏQÏQ¯§VÏQ«¢;²Š8¬u/¬u/®’K§˜W©•o§˜W®’KÇšH‘rM†yH†yH•Šm—ˆI²Š8²Š8‘ˆ;²Š8¬u/¦¨w•ŠWvi8©•o°mS®’K´±o¦©—¸·©·²©•o·²©•o¦©—¸¨¨§¨¨¸¨¨•ŠmŸx‡·¹·¯”‘—™—©¶¸•®²˜¨§˜¨§‰†Š‡—™—§¨¨˜¨§‰¸ÇËtn—™—¸Ç˸¨¨¶Ã²·¹·©¶¸·¹·¸ÇË·¹·ÃÍЦ©—©¶¸¯ª¶·¹·©¶¸¯”‘—™—“UVtn¯™§¯”‘¯ª¶±spŸx‡±sp¯™§±sp¯™§Í”¨Í’Í’²SN±spÍ”¨ÕwŒŸx‡Óop°mSÓopÓTMÒ9(ÓTMÕwŒ×[hÓopÓopÒ9(ÓopÕwŒëYVëLEêI8ÓTMÕwŒ×[hêI8êI8ÓTMÕwŒÓTMÐ…xÓTMêI8ÓTM²SN“UV¯™§¸¨¨tnŸx‡uzv¯”‘tn·¹·§¨¨uzv§¨¨¸¨¨¯”‘·¹··¹··¹·¸¨¨¯”‘¯™§·¹·Å±®¸¨¨Ä°”ű®±spŸx‡¯™§Ã¼Ã¯™§lWRŒš§—™——™—«¹Ê§¨¨†Š‡VZVF<EF<EMYj—™—©¶¸©¶¸«¹Ê•®²Œš§‡™—Œš§pxŒuzv…Šw§¨¨–š‡‡—x‡—x‡˜‡–š‡–š‡˜§ˆ˜§ˆ–šw–šw—˜Y—˜Y§§h—˜g•ŠW‡ˆX•ŠW¯”‘¦©ˆ•ŠW–šw•ŠWwv;ujG‡ˆX‡‡IwxWwxWwxWwxWuyguyguygwxWuygx†hx†huyguzvz•yw‰‡wˆwwˆwz•yw‰‡z•‡‡˜‡z•‡w‰‡i‡‡i‡‡wˆw†Š‡wˆwwˆww‰‡wˆw¦©ˆ¦©ˆ·²¨¶—¨¶—·²¦©ˆ·²ÈµlÍ’´±o´±o´±o¦¨w´±oȵl§§h´±o©•o§˜W©•oÇšH©•oȵlȵlÏQ¯§VÇšH²Š8¬u/¯§V©•o—ˆI•ŠW®’K¯§V¯§V—ˆI†yH—ˆI©•oŽr6‘ˆ;‘ˆ;‘ˆ;‘ˆ;®’K¦©ˆP,Žr6¦©ˆ§˜W®’K©•o·¹·Ä°”´±o®’K¯§V¯”‘¯™§¦©—¸·©¦©ˆtn—™—·¹·–š‡—™—˜¨§§¨¨—™—†Š‡ukXl[iŒš§©¶¸¨µ¨«¹Ê§¨¨tn·¹·¸Ç˘¨§¸ÇË«¹Ê¶Ã²©¶¸·¹·ÃÍÐü稨©¶¸¯ª¶·¹·Ã¼Ã—™—¯™§tn‰¯™§¯ª¶¯™§tn¯™§¯”‘¯™§‰¯ª¶¯™§¯”‘¯™§Ÿx‡Ÿx‡¯™§¯™§¯™§¯™§±sp¯”‘ÓTM²SN²SNÍ’×[h²SNÕwŒ²SN±sp¸¨¨ÓopÓTM²SNÓTMÍ’ÓopëLEÓTM²N0ÕwŒÓTMÍ’ÓopÓop×[h²SNP,¯”‘ű®–š‡§¨¨tn¯”‘‰—™—·¹·¯™§§¨¨¸·©¸¨¨¸¨¨Ã¼Ãű®Å±®¯™§¯™§¯”‘ű®Ã¼Ã¸¨¨Í’¯”‘±sp¯™§¸¨¨¯ª¶—™—Œš§§¨¨l[iwŠ•¨µ¨—™—VZV-1239IF<Eojo«¹Ê©¶¸©¶¸‡™—ˆ¦§y–—Œš§Œš§Œš§‰˜¨§©¶¸–š‡‡˜‡–š‡—¨–š³’¦©—˜§ˆ¦©—¦©ˆ¦©ˆ–šw¦¨w§§h¦¨w§§h–šw˜§ˆ–š‡†Š‡•Šm–š‡†‰g…{Wuyg…{WwxW†‰gtnuyguygwxWuygx†huyguygwˆwuzvuygw‰‡wˆwx†hwˆwwˆwwˆwwˆw‡˜‡‡™—w‰‡i†xw‰‡wˆww‰‡wˆwwˆwwŠ•†Š‡–š‡¦©ˆ¦©—š³’·²¨¶‡µÄ·²Èµl¦¨w´±o¦¨w¦©ˆ¦¨w´±o´±o§§h§§h•ŠW¯§V¯§V´±o´±o´±oÏQÏQ«¢;ÇšH²Š8®’K®’K—ˆI—ˆI®’K§˜W§˜W®’K—ˆIŽr6—˜Y§˜W‘ˆ;Žr6‘ˆ;‘ˆ;®’K©•o§˜WŽr6—ˆI§§h®’K…{W—™—·²¯”‘®’K•ŠW¯”‘¯”‘¨µ¨¯”‘©•oŸx‡‰Ã¼Ã¸¨¨¯”‘tn¦©—¨µ¨…ŠwuyglWR‡™—«¹Ê¸Ç˸ÇË©¶¸—™—¯ª¶©¶¸©¶¸¦©—ü鶸¸Ç˸Ç˶òÃÍз¹··¹·¯ª¶·¹·ÃÍз¹·¯ª¶¯”‘Ÿx‡¯ª¶¯”‘¯ª¶Ÿx‡‰¯™§¯ª¶—™—•®²¯ª¶Ÿx‡¯ª¶—™—Ÿx‡˜¨§¯ª¶§¨¨—™—¯ª¶±sp¯™§±spŸx‡±sp¸¨¨±sp±spÍ”¨±sp±spű®Í’±sp²SN±spÍ’ÕwŒ×[hÓopÔM1ÕwŒÓop±spÍ’©•o±sp±sp“UVŸx‡·¹·¯ª¶—¨–‰¯”‘·¹·¯™§Ã¼Ã¯ª¶©¶¸Ã¼Ã·¹·Ä°”¯”‘Ä°”Ð…x¸¨¨Å±®¯”‘¯™§Å±®Å±®¯”‘±spŸx‡Ÿx‡‰Ä¯ª¶«¹Ê‰§¨¨†Š‡l[iŒš§Œš§‡™—ZwvIYVVZVwŠ••®²‰Œš§‡™—y–—Œš§y–—wŠ•‡™—‡™——™—«¹Ê¨µ¨‰¥——¨–—¨–˜¨§š³’¦©—¦©—¦©ˆ¦©—¦©—¨¶‡¦¨w¦©ˆ–šw–šw–š‡•Šm…Šw†‰g—™—–šwˆ–h…Šw†‰gx†huyguyguygukX…{Wwˆwx†huzvuygx†hojoj„hwˆwwˆwuzvw‰‡wˆww‰‡w‰‡w‰‡‡˜‡y–—i†xwˆwi†xz•‡w‰‡w‰‡w‰‡z•‡¦©ˆ¦©—¨¶——¨–¨¶‡·²·²·²¦©—¦©ˆ·²¦©ˆ¦©ˆ¨µx·²§§h—˜g•Šm§˜W©•o©•o©•oÇšHÏQÏQÏQÌ“2ÇšH¬u/‘rM®’K†yH§˜W¯§V§˜W²Š8‘rM®’K§˜W’•I—ˆI—ˆI—ˆI®’K®’K¬u/…{W®’K²Š8§˜W•ŠW“UV–š‡·²·²©•o‘rM©•o•Šm¦©—·²tntn§¨¨¸·©·²©•o‘rM¦©—–š‡¯”‘tn†Š‡Œš§«¹Ê§¨¨©¶¸¸ÇË«¹Ê©¶¸¶Ã²§¨¨‰§¨¨·¹··¹·¶Ã²¸ÇËÃÍÐÃÍз¹··¹·¯ª¶Ã¼Ãüø¨¨Ã¼ÃŸx‡Ÿx‡¯ª¶§¨¨«¹Ê‰¯™§¯ª¶¯ª¶‰§¨¨—™—†Š‡¯ª¶‰†Š‡§¨¨·¹·¯™§Œš§©¶¸—™—«¹Ê—™—¯™§—™—·¹·¯”‘˜¨§·¹·¯”‘±spüø¨¨¯”‘±spŸx‡¸¨¨¯™§²SN±spŸx‡Ÿx‡Ÿx‡Ÿx‡·¹·¯”‘Í’Ÿx‡Ÿx‡Œš§¯ª¶¸Ç˸¨¨¦©—‰¯ª¶¸¨¨Å±®¸¨¨¸¨¨¶Ã²Ã¼Ãű®¯”‘ű®Í’Ð…xüø¨¨¯™§¸¨¨·¹·¸¨¨tntntnŸx‡¯ª¶¯™§¯™§—™—¦©—Wifojo‡™—pxŒŒš§ojowŠ•†Š‡pxŒŒš§Œš§•®²ˆ¦§˜¨§Œš§˜¨§—™—‡™—tn‰¥—üר–—¨–—¨–š³’§¨¨¨¶—¨µ¨¨µ¨¦©—¦©ˆ·²©•o—˜g—˜g–šw—˜g—˜g†‰g…{Wˆ–h¦©ˆ‰•Yx…X…ŠwuygwxWwxWukXuyguygx†hx†hx†hwxWwxWuygwˆwwˆwx†hgywi†x†Š‡w‰‡wˆwwˆww‰‡y–—i†xw‰‡w‰‡j”’w‰‡z•y‡˜‡w‰‡˜§ˆ¦©—¦©—¨¶—·²¦©ˆ¦©ˆ¦©—¦©ˆ·²Ä°”¦©ˆ©•o´±o¦¨w—˜g©•oˆ–h—˜Y—˜g§˜WȵlÏQ¯§V¯§VÏQÇšH®’K®’K§˜W•ŠW‘rM§˜W´±o°mS‘ˆ;‘ˆ;¯§V¯§V—ˆI•ŠW®’K—ˆI§˜W§˜W¬u/†yH‘rM²Š8®’K•ŠWtn¯”‘©•o¦©ˆ‘rM‘rM¯”‘¯”‘¯ª¶©•o–š‡§¨¨¸·©¯”‘–š‡‰¯”‘¦©—–š‡•Šm¦©—§¨¨Œš§•®²§¨¨©¶¸·Êרµ¨©¶¸©¶¸…Šw–š‡—™—˜§ˆ¯”‘•Šm¸¨¨Ã¼Ã¸·©·¹··¹·¯”‘·¹·Ã¼Ã¸·©Å±®Í’¯”‘¯ª¶·¹·¯ª¶‰Ã¼Ã«¹Ê¯ª¶¯™§§¨¨Ÿx‡Œš§·¹·¯™§¯™§§¨¨¯ª¶¯”‘¯™§©¶¸—™—«¹Ê§¨¨¯ª¶§¨¨¯ª¶‰§¨¨¯ª¶§¨¨˜¨§Ã¼Ã·¹·¯™§¯™§¯™§¸¨¨¯ª¶Ÿx‡±sp¯™§¯”‘¸¨¨±sp¯ª¶¯™§¦©—Ÿx‡¯™§¯ª¶§¨¨¨µ¨¸·©¸¨¨¯”‘¸¨¨¸¨¨Ä°”üİ”üÃű®Í’ű®Í’±sp¸¨¨¸¨¨¯™§¯™§·¹·¸·©¯”‘l[ipxŒpxŒ¯™§‰Ä˜¨§˜¨§§¨¨l[iVZV†Š‡pxŒw‰‡§¨¨gywIYVVZVŒš§uzv‰•®²‰pxŒ†Š‡†Š‡tnuygtn§¨¨¸·©˜§ˆ™¦w–šw–šw–šw–šw¦©ˆ¦©ˆ–šw–šw–šw•Šm–šw¦©ˆ¦¨w–šw–šw—˜g•Šm¦©ˆ‡ˆXujGwxW…{WwxWwxWukXwxWwxWuygwxWwxWhvXuygx†hwˆwx”kj„huyguzvz•yz•‡w‰‡wˆwz•‡z•‡wŠ•w‰‡w‰‡wˆww‰‡‡˜‡y–—z•‡˜§ˆ¨¶—·²¦©—¦©ˆ¦©—§¨¨¦©—¦©ˆ·²¦©ˆ©•o´±o·²–šw™¦w•Šm•ŠW©•o¦©ˆÈµl´±oȵl©•oÏQÇšHÇšH®’K§˜W©•o§˜W§˜W´±oÇšH—ˆI°mS²Š8§˜W—ˆI—ˆI®’K§˜W®’K¯§V—ˆIŽr6†yH®’K—ˆI©•o°mS§˜W–š‡©•o¯”‘‘rMtn•Šm§¨¨©•o©•o¸·©¸·©¯”‘‘rM¨¶—¸¨¨¦©ˆ¸¨¨¦©—¯”‘–š‡‰†Š‡©¶¸«¹Ê¸Ç˸LjŠ‡·¹·—™—…Šw©¶¸‘rMuzvtn…{W¦©—¸¨¨¦©—¸¨¨Í”¨¯”‘¸¨¨¯”‘¸¨¨·¹·¯™§¯ª¶¸¨¨¸¨¨¯™§¯ª¶¯ª¶Ã¼Ã¯ª¶Ÿx‡¯™§¯”‘¯ª¶¸¨¨¯™§¯ª¶¯ª¶¸¨¨‰§¨¨¯ª¶¯™§¯ª¶§¨¨¸¨¨¯ª¶¯ª¶‰¯ª¶§¨¨¯”‘§¨¨·¹·¸Ç˧¨¨§¨¨¯ª¶Ÿx‡¸¨¨¯”‘tn¯ª¶±sp¯™§tn§¨¨¯ª¶¯ª¶¯”‘¯ª¶¯ª¶¯™§¸¨¨Ã¼Ã·¹·¸¨¨Í’¸¨¨Å±®Ã¼ÃÄ°”͒ű®Ä°”ű®Ã¼Ãű®¯”‘¯”‘¯™§¯™§¯ª¶—™—§¨¨§¨¨tnpxŒojoŸx‡¯ª¶¯™§—™—§¨¨VZVMYj†Š‡«¹Ê‡™—‡™—uzvOKNMYjgy†ojopxŒ•®²‡™—‡™—†Š‡‡˜‡‡˜‡tn…Šw—™—¶Ã²¦©—˜§ˆ–šw¦©ˆ–š‡‡—x–šw–šw©•o—˜g•Šm•Šm•Šm˜§ˆ•ŠW•ŠW…{W…{WukX–š‡…{W…{WfjVwxWuygukXuygwxWuygwxWwxWwxWuyguygwˆwz•ywˆwuzvojouzvw‰‡wŠ•i‡‡wˆwi‡‡y–—z•‡z•‡wˆwuzvgywz•‡y–—z•‡¦©ˆ·²¦©ˆ¦©—–š‡¦©—˜¨§¦©ˆ·²¦©ˆ©•o¦©ˆ´±o¯”‘˜§ˆ™¦w•Šm—˜Y¨¶‡·²Èµl¯§V´±oÏQ«¢;®’KÇšH§˜W§˜W—˜g—˜g§§h¯§V®’K°mS—ˆI®’K®’K—ˆI§˜WÇšH©•o§˜W®’KŽr6®’K•ŠW—ˆI©•o§˜WŽr6tntn•Šm‘rMtntn–š‡¦©ˆ±sp¸¨¨©•o¯”‘¯”‘tn¦©—¯™§¦©—·¹·¦©—©•o–š‡‰¦©—¸Ç˸Ç˸Ç˧¨¨†Š‡©¶¸…Šw†Š‡‰…{W…ŠwlWRtn·¹·¯™§·¹·¸¨¨©•o¯”‘ű®±sp©•oÍ’±sp·¹·Ã¼Ã¯™§¯”‘¯ª¶¯ª¶Ã¼Ã¯™§±sp¸¨¨¯™§¯™§Í”¨¯™§¯ª¶¸¨¨¯ª¶¯™§¯ª¶¯ª¶¯™§¯™§¯™§¯™§¯ª¶¯ª¶¯”‘©¶¸¯ª¶¸¨¨¯ª¶¸¨¨Ã¼Ã¯ª¶¦©—¯™§“UV¯™§¯™§‰¸¨¨Ÿx‡¸¨¨Ÿx‡¯™§¯ª¶·¹·¸¨¨¸·©Í”¨¯”‘Ä°”üÃű®Å±®¸¨¨Í”¨Å±®Ã¼Ãű®Ä°”ű®Í”¨¯™§Ã¼Ã¯”‘¸¨¨‰l[i¯™§·¹·—™—…Šw©¶¸tnF<Eojol[i‡™—¯ª¶—™—¨µ¨ukXfjgfjg•®²©¶¸‡™—v¥®wŠ•pxŒgywŒš§w‰‡•®²˜¨§Œš§—™—–š‡–š‡‡—x•Šm…Šw§¨¨¸·©¦¨w–šw–šw–šw•Šm–šw•Šm•ŠW‡ˆX…{W†yH•Šm•ŠW…{W…{W•ŠWtn…{W…ŠwtnukXukXukXx†huzv…{WwxWukXwxWukXwxWx†hx†huzvwˆwwˆwuzvhxgwˆww‰‡w‰‡w‰‡i†xw‰‡z•‡‡™—i†xuzvgywgy†hˆ–y–—w‰‡–š‡·²¦©ˆ—™——¨–—™—–š‡¦©—·²¦©ˆ´±o©•o–šw–š‡–š‡•Šm—˜Y¦¨wµÄ´±o©•o¯§VÏQ®’KÇšH«¢;ÇšH—ˆI•Šm•Šm©•o§§h¯§V¯§V§˜W§˜W•ŠW‡ˆX—ˆI¯§V¯§V¯§V®’K†yH‘ˆ;—ˆI®’K®’K§˜WŽr6‘rM…{Wuyg°mS‰tntn¯”‘tn¯”‘©•o©•o©•o±sp–š‡§¨¨¸·©¸·©¦©ˆ©•o¯”‘–š‡§¨¨«¹Ê¸Ç˸ÇË«¹Ê¸¨¨·¹·—™—uyg—¨–tnukXukXlWR—™—ü稨·¹·¦©—‰¸¨¨Å±®Í’Í’±sp×[h¸¨¨Å±®Í’±sp¸¨¨¸¨¨¯ª¶ÕwŒ±sp¸¨¨Í”¨±sp¯”‘¯™§·¹·¯ª¶Å±®¯™§¯™§Œš§¯ª¶¯™§¯ª¶¯ª¶·¹·Ã¼Ã¸¨¨Ã¼ÃüÃüø¨¨¸¨¨¯ª¶·¹·Í’·¹·Ð…x¸¨¨Å±®¯™§¸¨¨¯”‘¯™§±sp¯™§Å±®¸¨¨Å±®¸¨¨ÓopÓopÍ’¸¨¨¸·©Ä°”ű®Óop͒üÃű®Å±®Í”¨¸¨¨¯™§¸·©¯”‘¸¨¨¯™§“UV‰¸Ç˯™§tn¨µ¨¯™§R4'F<El[iOKNŒš§§¨¨˜¨§†Š‡gywOKNl[i•®²Œš§wŠ•wŠ•gy†gywŒš§†Š‡Œš§—™——¨–—¨–—™——™—…Šw•Šm•Šm–šw¸·©¦©—–šwˆ–h•Šm†‰g…{W‡ˆX†‰g•ŠW…{W‡ˆX–šw†yH•ŠW‰•Y‡ˆXwxWukX…Šw•ŠWuyguygfjVukXwxWuyguygwxWfjghvXwwHtnwˆwuygwˆw…Šwuzvhxguzvuzvw‰‡w‰‡w‰‡x†hw‰‡Š¤ˆw‰‡i‡‡gywuzvw‰‡z•‡wŠ•©•o·²—¨–—¨–—™—‡˜‡˜§ˆ¦©—·²¦©ˆ©•o¯”‘—¨–¦©—Š¤ˆ¥u–šw´±o´±o·²Èµl´±o¯§V®’KÏQÏQ®’K•ŠW•Šm™¦w–šw¦¨w¯§V©•o©•o¯§V—˜Y‘rM§˜W¯§V§§h¯§V‘rM†yH—ˆI²Š8‘ˆ;§˜W°mSŽr6Žr6…{Wtn“UV—™—tn•Šm¯”‘¯”‘•ŠW®’K¯”‘tntn¸¨¨¸¨¨¸·©·²©•o©•o¦©ˆ¯ª¶¦©—©¶¸¸ÇË©¶¸¸Ç˸Ç˦©—tn–š‡—™—tnlWRukX‰¸Ç˯ª¶¦©—§¨¨Ÿx‡“UV—™—üø¨¨¸·©Ä°”Ð…xÄ°”Í’±sp±spÍ”¨¸¨¨¸¨¨±sp±spű®Óop°mS±sp¯”‘¯ª¶¯”‘¯™§¯™§¯™§¯™§¯™§¯™§¯ª¶·¹·Ã¼Ã¯™§¯”‘ű®Ã¼Ãű®¸¨¨Å±®¸¨¨·¹·Í’¸¨¨ÕwŒ¯”‘üű®±sp¸¨¨Í’¯”‘ű®Í’ű®Í”¨ÓopÓTMÕwŒÍ’Í”¨Í”¨Å±®Óop²SNű®Ã¼Ãü¯”‘¯”‘¯™§·¹·§¨¨¯”‘Ÿx‡ojo‰¯ª¶l[itn¸¨¨e[GD:+MYjlWRl[i¯ª¶˜¨§©¶¸w‰‡YuhGJF†Š‡‡™—wŠ•wŠ•wŠ•wŠ•‡™—˜¨§˜¨§¦©——¨–—¨–‡—x–šw¦©ˆ†Š‡…Šw–šw¨µ¨¸·©™¦w–šw–šw—˜g†‰g†‰g†‰g—˜g•Šm–šw§§h‡ˆX‡ˆX•ŠW†yH…{WukX…ŠwtnwxW†‰gukXukXukXuyguyghxgwxWhvXukXwxWuzvuyg…Šwz•‡uzvhxgwˆwuzvw‰‡w‰‡w‰‡uzvwˆwz•‡wŠ•pxŒuzvgy†gywgywi‡‡¦©ˆ¦©——¨–‡˜‡‰—¨–¦©—¦©ˆ¦©ˆ¦©ˆ´±o¦¨w¦©ˆ—¨––š‡–šw¦¨w´±o¦¨w¦¨w©•o§˜W©•oÏQȵl®’K§˜W‡ˆX•Šm¦¨w—˜g¦¨wȵl¯§V§˜W¯§V—˜g©•o§˜W§˜W¯§V§˜W†yHŽr6²Š8†yH—ˆI®’K‘ˆ;Žr6P,lWRtnŸx‡¯”‘†Š‡¸¨¨¯”‘°mSP,‰©•o©•o¯”‘¦©—¦©—ű®©•o¦©ˆ¸¨¨¸¨¨·²¯”‘¨µ¨¸ÇË©¶¸¸·©¸ÇË—™—†Š‡§¨¨†Š‡pxŒŒš§¯ª¶«¹Ê·Ê×·¹·—¨–tn†Š‡ukX¯ª¶ÃÍÐüÃű®Ä°”͒ű®Ð…xÓTM¯”‘ü͒ÕwŒÍ’Í’ÓopÓTMÓopÕwŒ¯™§ÕwŒŸx‡ÕwŒÕwŒ¯™§±sp±sp¯™§¯™§·¹·ÕwŒÍ’ű®Ã¼ÃÍ’Í”¨¸¨¨Í’ű®Ð…xÍ’ÓopÍ’Í”¨Í’ű®ÓopÄ°”ÓopÐ…xÍ”¨Óopű®Ä°”⃌ÓTMÓopÕwŒÍ’ű®Í’Óop²SN͒ű®Ã¼Ã¯”‘±sp¯™§Ÿx‡—™—¸·©·¹·¯”‘oQ/lWR¯™§¯”‘uzv˜¨§Ÿx‡D<5GJFl[i5>h‰˜¨§«¹Êˆ¦§gywMYjpxŒpxŒ‰gywŒš§˜¨§†Š‡§¨¨©¶¸§¨¨—¨–˜§ˆ–šw…Šw•Šm¯”‘¦©ˆ™¦w¦©—¨µ¨¨¶‡–šw–šw©•o—˜g©•o¦¨w–šwˆ–h¦©ˆ—˜g‡ˆX†yH…{W‰•Y‡‡I‡ˆX‡ˆXukXukX…{WukXuyguygwxWuyguyghvXhvXukXukXuygx†hz•ywˆwojouzvuzvuzvw‰‡w‰‡w‰‡i†xpxŒwŠ•‡˜‡wŠ•i‡‡gywgywojouzv¦©——™——™—†Š‡‡˜‡—¨–§¨¨¦©ˆ·²¦©ˆ©•o¦©ˆ¦©ˆ—™—Š¤ˆ™¦w¦¨w©•o©•o¦¨w§˜W§˜W©•oÏQÏQ•ŠW°mS•Šm‡—x–šw•Šm¦¨w©•o§§h§§h§§h§§h§˜W§˜W•ŠW©•o©•o†yHŽr6‘rMŽr6’•I’•IŽr6Žr6oQ/ojotntn¦©—§¨¨¦©—‘rM‘rM‘rM¯”‘±sp©•o©•o©•o¸¨¨¸¨¨¯”‘¨¶—·²©•o¦©—¦©—©¶¸¸Ç˸¨¨¨µ¨·¹·–š‡–š‡˜¨§—™—©¶¸©¶¸¯ª¶·¹·©¶¸«¹Ê§¨¨…ŠwŒš§¯ª¶ÃÍÐÃÍÐüÃű®Å±®Ä°”ű®ÓgVÓTM±spÍ”¨Í’±spÕwŒ¯”‘Í’×[hÓTMÓTM±spÍ”¨×[h¯”‘×[hŸx‡Ÿx‡±sp²SNŸx‡Í’Í’²SNÓopű®Å±®Å±®Í’Í’Í’¸¨¨âƒŒÍ’ÓTMÍ’Í”¨Ð…xű®ÓopÐ…xÐ…xÓgVÍ”¨ÓopÍ”¨Ä°”Í’ÓTMÓTMÕwŒâƒŒÍ”¨Í’±sp²SN±sp¯ª¶Å±®Í’“UV¯™§Ÿx‡Ÿx‡‰·¹·‰lWRl4$tn¯™§gy†‡™—·¹·tnGH8MYjojol[i‰Ä©¶¸˜¨§v¥®Wiwgyw‡™—wŠ•Œš§‡™—Œš§—™—Œš§¨µ¨¨µ¨—™—–š‡–š‡—¨––š‡¦¨w¦©—¦©—˜§ˆ¨¶—¨¶—‡—x‡ˆX†‰g—˜g§§h§§h©•o™¦w¨¶—•Šm‡ˆX†‰g…{Wˆ–h‡ˆX†‰gwxWujGujGukXukXukXuyguyguyg…ŠwukXe[GukXukXukXuzvwˆwx†huzvojouzvuygwˆww‰‡w‰‡w‰‡w‰‡w‰‡y–—z•‡w‰‡gywojogywgyw‡™——™——™——™——™——¨–¦©—¦©—¦¨w¦©ˆ¦©ˆ¦©—˜§ˆ‰¥——™—¦¨w¦¨w¦©ˆ¦¨w¦¨w©•o§˜W¯§Vȵl¯§V—˜g•Šm…Šw‡—x–š‡—˜g™¥h§§h§˜W§§h©•o—˜g•ŠW•ŠW•ŠW´±o§˜W—ˆI‘rMŽr6Žr6§˜W—ˆIŽr6oQ/oQ/tntn–š‡—™—¯”‘“UVujG‘rM‘rM©•o•ŠW•ŠW“UV•Šm¸¨¨¸·©¨¶—·²©•o–š‡¦©—§¨¨·¹·©¶¸¦©—¸ÇË·¹·–š‡©¶¸«¹Ê§¨¨•®²—™—‰«¹Ê¯ª¶©¶¸¯™§‰¯™§·¹·Ã¼Ãüø¨¨©•o¯”‘Í’·¹·Í’Í’¯”‘Í’±sp²SNÓopÍ”¨ÓopÓTMÓTMÓTMÓgV¯”‘×[hÕwŒ×[hÕwŒÕwŒ×[hÕwŒÍ’Í’Í’ÓTMÕwŒÅ±®Ã¼ÃÍ”¨×[h¯”‘Í’ÕwŒÓopÓopÓTMÕwŒÍ”¨ÓopÍ”¨ÓopÓopÐ…xìdJÍ’ÓopÐ…xÍ’Ð…xÓopÓTMÓgV±spÍ’Ä°”Í’±sp“UVŸx‡·¹·¯™§“UV‰tnpxŒtn§¨¨Í”¨lWRl[il[i—™—Ÿx‡uzv¸ÇË©¶¸ojoOKNl[iOKNojo©¶¸Œš§Œš§pxŒgyw‰†Š‡•®²uzvuzv˜¨§—™—¨µ¨¨µ¨–š‡˜§ˆ—¨–˜§ˆ—¨–¦©ˆ¦©—§¨¨¦©—¨µ¨¨¶—·²—˜gˆ–h–šw§§h—˜g•ŠW•Šm™¦w•ŠW‡ˆX‡ˆX‡ˆX†yH…{W…{WukXukXukXukXukXwxWukXwxWuygz•‡uygghHfjVukXuzvwˆwuyguzvuzvfjguzvojoi†x†Š‡pxŒw‰‡w‰‡i‡‡z•‡w‰‡pxŒgywpxŒgywgyw—™—˜¨§˜¨§—¨–—¨–—¨–—¨–˜§ˆ¦©ˆ—¨–˜§ˆ¦¨w–š‡Š¤ˆ˜§ˆ•Šm—˜g¦¨w·²¦¨w©•o§˜W§˜WÇšHȵl©•o–šw†‰g–šw–šwˆ–h—˜g©•o§§h©•o§§h—˜g•ŠW•ŠW†‰g©•o§˜W°mS†yH†yH—˜Y—ˆI‘ˆ;Žr6vi8†yH‰¸¨¨·¹·¸·©•ŠmfZ8‘rM‘rM…Šw§˜W‘rMukX“UV•Šm§¨¨¸·©¯”‘©•o§˜W¯”‘§¨¨©¶¸¸Ç˨µ¨¦©—¸Ç˯ª¶©¶¸¸Ç˨µ¨©¶¸§¨¨†Š‡˜¨§«¹Ê§¨¨¯ª¶—™—‰§¨¨«¹Ê¯”‘–š‡tn“UVtn¸¨¨Å±®Ä°”±spÕwŒ±spÕwŒ²N0ÓopÍ’ÓgVìV:ìdJÓTMÓTM×[h×[hÓopÓTMÓopÕwŒÓgVÕwŒÓopÓopÓopÓTMÕwŒ¸¨¨Å±®Í’ÓgVÍ’ÕwŒÓTMÓgVÓopìV:Ð…xÍ’ÓopÄ°”æprÐ…x⃌èrYÍ’èrYÓopÐ…xÐ…xÓopÓgVÓTMÓTM±sp¸¨¨¯”‘±sp“UVtn«¹Êü§¨¨tnl[i†Š‡“UV¯™§lWRl[iojotn¯ª¶l[iŒš§«¹Ê‰pxŒl[il[iF<E‰Œš§wŠ•w‰‡gyw‡™—‡™—wŠ•‰uyg—™—˜¨§˜¨§˜¨§˜§ˆ–š‡–šw–š‡‡˜‡–š‡‡—x–šw–š‡¦©—¨¶—·²¦¨w§§h—˜g•Šm‡ˆX†‰gtn†‰g‡‡I‡ˆX‡ˆX‡ˆXwwHwwH†‰g…{WukXukXukXukXfjVukXuyguyguzvuygfjVukXuygwˆwwˆwuyguzvuyguyguzvuzvuzvuzvpxŒpxŒwˆww‰‡i‡‡wˆwuzvuzvuzvpxŒuzv‡™—˜¨§¦©—š³’¦©—–šw–š‡˜§ˆ—¨–—™—Š¤ˆ–š‡…Šw‡—x–š‡—˜g©•o¦¨w·²—˜g—˜g§˜W©•o´±o´±o¦¨w–šw†‰g–š‡†Š‡—˜g©•o§§h–šw–šw¦¨w•ŠW§˜W©•o‡ˆX—˜Y•ŠW—ˆI—ˆI•ŠW§˜W—ˆIŽr6†yHŽr6…{W¦©—¦©—¦©—tnujGŽr6‘rMtn¯”‘°mS‘rMukX…{W¯”‘©•o·²·²¦¨w¯”‘¸·©·²¨µ¨¸Ç˦©ˆ©¶¸·¹·Ã¼Ã¸ÇË©¶¸©¶¸¨µ¨˜¨§¯ª¶©¶¸«¹Ê©¶¸¯ª¶–š‡§¨¨‰§¨¨‰—™—‰‰¦©—ű®Í”¨±sp±sp¯”‘²SN²SN²SN¯”‘ÓopÓgVêI8ÓTMêI8ÓTMÓTM×[hÓop×[hÓgVèggÓgVÓopÕwŒÓgVèggëYV×[hÍ”¨Í”¨æprëLE⃌ÓgVëLEÓTMÓgVÓTMÐ…x⃌ÓgVÍ’ëYVÓopÍ’ÓgVÍ’ÓgVÓTMÐ…xÍ’Í’ÓgVÓTM²SN°mS¸¨¨Ä°”¯™§±splWR¯™§Ã¼Ãű®·¹·tnlWRojolWR…Šw¯™§lWRl[iojoŒš§¯™§†Š‡¯ª¶˜¨§‡™—wŠ•pxŒl[iojo˜¨§fjgo®wŠ•y–—•®²†Š‡‰¥—…Šwtn˜¨§¦©——™—§¨¨–š‡–š‡–š‡ˆ–h‡—x‡—x‡—x–šw–š‡–š‡–šw–š‡—˜g•ŠW‡ˆX•ŠW—˜Y—˜gˆ–h‡ˆX†‰g‡ˆX†‰g†‰gtn†‰g…{WwxWujGlWRfjVukXuyguyghxgwxWukXfjgwxWuygx†h…Šwuygx†huzvojouyguygwˆwwˆwuzvgywuzvhˆ–wˆwi†xgywgywpxŒhˆ–pxŒ˜¨§¨µ¨¦©—–š‡‡—x†Š‡š³’š³’¦©—–š‡‡™—–šw‡—x–šw–šw§§h¦¨w¦©ˆ¦©ˆ©•o§˜W§˜W§˜W´±o¦¨w–šw‡—x–šw–šw˜§ˆ™¦w©•o©•oˆ–h–šw–šw•ŠW§§h—˜g…{W•Šm—˜g•ŠW—ˆI§˜W—ˆIŽr6†yHvi8ujG…Šw¯”‘•ŠmtnukXujG•ŠW…{W–š‡©•oŽr6‘rM•Šm©•o¯”‘®’KÄ°”¯§V¦©—¸·©·²¦©ˆ·¹·©¶¸¨µ¨·¹·—™—¸ÇË·¹··¹·¨µ¨§¨¨©¶¸¸ÇË©¶¸©¶¸§¨¨©¶¸¯ª¶¦©—Ÿx‡§¨¨tn¦©—‰¸¨¨¯”‘¯™§¯”‘¯”‘Ð…xŸx‡²SN±sp×[h±sp²SNÐ…xêfXÓTMìV:ÔM1ÔM1ÔM1ÓopÓTMÓgVÓTMíWHÓopÓopìdJìdJèggêfXÄ°”Í”¨×[hÓTMÐ…xìdJêI8ÓTMÓgVÓTMÓopÓopÓgVÍ’ÓgVÓopÍ’ÓgVÄ°”ÓgVÓTMÓgVÍ’´±oÓgV²N0²SN²SN©•o¸¨¨¯™§Ÿx‡l[iŸx‡¸ÇËü襁—™—lWRlWRlWRtn¯ª¶Ÿx‡lWRlWRpxŒŒš§‰¯ª¶§¨¨pxŒz•‡w‰‡pxŒojo‰Ä‰gy†‡™—‡™—˜¨§‡˜‡‡˜‡—™—tn…Šw¦©—†Š‡—™—–šw˜§ˆ˜§ˆ¦©ˆ‰•Y‰•Y‰•Yy…JwwHwxW…{W•Šm•ŠW…{WujGujG†yHy…J‡ˆX‡ˆX…{W‡ˆXuyg…{WuygwxW…{WukXe[Ge[GukXukXukXfjVuyguyguygfjVukXuygwˆw…Šwuygz•y…ŠwwˆwuzvojouygwˆwpxŒgywpxŒi‡‡w‰‡w‰‡uzvpxŒpxŒw‰‡i‡‡¨µ¨¨¶—˜§ˆ‰‰‰¥—¨¶—¨µ¨—¨––š‡–š‡–š‡–š‡–š‡–šw¦¨w©•o¦©ˆ¦¨w©•o©•o¯§V©•o©•o¦¨w–š‡–š‡˜§ˆ¦©ˆ–š‡§§h¦¨w–šwˆ–h‡—x–šw•ŠW©•o‡ˆX‡ˆX—˜g¯§V®’K§˜W§˜W†yH†yHŽr6Žr6…{W–š‡‘rM•ŠmukX“UV…{W°mS…{W¯”‘‘rMoQ/‡ˆX•ŠW‘rM©•o®’K¦©ˆ¯”‘·²·²¦©ˆ¸·©¸·©¸·©·¹··²¦©—¸ÇËüæ©—¸·©·¹··¹··¹·¸ÇË©¶¸˜¨§¸ÇË©¶¸¯”‘–š‡¨µ¨—™—¯™§§¨¨¯”‘±sp¯™§¯™§¯™§±sp±sp²SN²N0±sp±spÓopÓopÓTMÔM1ÔM1ÔM1ÓTMÓgVÓTMÔM1ÓgVëYVèrYÓopïTBÔM1ÓgVíWHìdJÍ’Í’êI8ìdJÐ…xÓgVìV:ÓTMÓTMÓgVÐ…xèrYÓopÍ”¨ÓopÐ…xÐ…xÓgVÍ’Ð…xÔM1²SNÐ…xÍ’Óop²N0²N0“UV“UV¸¨¨¸¨¨¯™§l[i†Š‡·¹·¯ª¶¯”‘¯ª¶tn“UVl[ilWRŒš§—™—uzvlWRlWR‡™—˜¨§§¨¨•®²†Š‡VYGojogyw†Š‡Œš§§¨¨w‰‡ˆ¦§‰—™—–š‡…Šw‡™—‡˜‡tn—™—–šw–š‡†‰g–šw¦¨w¦©ˆ¦¨w§§h—˜g•ŠWwwHwv;…{WwwH‡‡I†yH†yHfZ8ujGujGhuIujGukX†yHtn…{WwxWwwHwxWukXghHe[GghHukXfjVukXwxW†‰gx†hghHfjVfjVuzvx†huzvwˆw†Š‡w‰‡w‰‡uzvojouzvwˆwhxggywuzvuzvpxŒwˆwpxŒw‰‡uzvgyw¨µ¨˜¨§—™—ˆ¦§•®²—¨–—¨–—¨–‡™—–š‡—¨–¦©—–š‡–šw–š‡¯”‘–šw¦©ˆ¦¨w§˜W©•o¯§V©•o™¦w–š‡–š‡˜§ˆ˜§ˆ—¨––š‡¦¨w˜§ˆ–š‡–š‡‡—x–šw–šw—˜g•ŠW•Šm©•o§˜W§˜W§˜W•ŠW…{W†yH†yHŽr6‡ˆX•ŠWwxW•ŠmujGoQ/Žr6…{Wuyg©•ovi8Žr6Žr6Žr6±sp°mS•Šm¸¨¨·²´±o´±o©•o·²¸·©§¨¨·¹·§¨¨·¹·¸ÇË·¹··¹··¹··¹··¹·©¶¸¸ÇËü鶸·¹·§¨¨§¨¨—™—©¶¸¯ª¶˜¨§‰‰—™—¯ª¶¯™§¯ª¶¦©ˆ¯”‘²SN²SN¯”‘Ä°”±spÓTMÔM1Ò9(ÓTMÓgVÓopÓgVÓTMÔM1ÓTMÓgVÐ…xÓopêI8ìdJÓgVìV:ÓTM⃌͒êI8ÓTMèrYÓTMÔM1ÓgVÓTMÓgVÍ’ÓgVÓopÍ”¨ÓopÐ…xÐ…xÓopÓopÓgVÓgV²N0±sp¯”‘Ð…x²N0P,“UV“UV‰·¹··¹·‰Ÿx‡—™—«¹Êl[i†Š‡¯”‘lWRlWRlWRŸx‡tn‰“UVlWRojo¯ª¶©¶¸¯ª¶—™—fjVl[il[iw‰‡‡™—•®²—™—‡˜‡…Šw‰§¨¨‰‡˜‡–š‡†Š‡–š‡¦©—†Š‡uyg–šw¦¨w—˜g–šw©•o–šw—˜g©•o‡ˆX•ŠW†‰g‘rM‡‡I†yHwwHwwHwxWwwHujGghHwwH‡ˆX…{WukXwwHukXwwHukXghHukXghHfjVukXukX…Šw…ŠwfjVfjVfjVuyghxguzvuzv†Š‡‡˜‡w‰‡uzvhxguyguzvojoojoojogywpxŒpxŒpxŒi‡‡gy†ojo•®²˜¨§‰¥—Œš§‡™——™—‡™—†Š‡–š‡—¨–—¨–¦©ˆ—™—†Š‡–šw©•o–šw–šw©•o´±o¯§V©•o–š‡¦¨w—¨–˜§ˆ˜§ˆ˜§ˆ¦©——¨–˜§ˆ˜§ˆ—¨––šw…Šw–šw–šw©•o•Šm•Šm©•o©•o§˜W•ŠW•ŠWwwHvi8gg9wxW•Šm—ˆI†‰g…{We[GoQ/†yHujGtntnP,vi8‘rMŽr6…{W¯”‘©•o´±o´±o¯§V®’K©•o¦©ˆ¯ª¶·¹··¹·¨µ¨¸Ç˸ÇË·¹·¸·©·¹·¸Ç˸Ç˸ÇË·¹··¹·¸·©·¹··¹··¹··¹·©¶¸§¨¨§¨¨¯™§¯”‘¯”‘¸¨¨¯”‘—™—¯™§¯”‘±sp±spÐ…x°mS²SN²N0ÔM1ÓopÐ…xÓgVÔM1ÔM1ÓTMÓgV°mSÓgVÓgVÓTMêI8ÔM1ÓTMìdJÓTM͒⃌ÔM1ÓgVÓgVÓgVêI8ÓgVèrYÓgVÍ’ÓopÐ…xÐ…x©•oÐ…xÐ…x©•oÓgV²SN±sp²N0“UV¯”‘¯™§‘rM“UVlWRŸx‡Ÿx‡¯™§§¨¨¯ª¶Ÿx‡pxŒ¯™§tnl[i¯ª¶‰lWRl[i‰pxŒtnŒš§l[il[iˆ¦§¯ª¶¯ª¶‰¥—‡™—fjgfjguzv†Š‡•®²˜¨§‡˜‡–šw–šw‰…{Wtn–š‡tn…{W—™—–š‡–šw‰•Y–šw©•o—˜g—˜g—˜g†‰g…{W…{W‡ˆX—˜g—˜Y—˜Y—˜Y—ˆI‡ˆX•ŠW‡ˆX‡ˆX…{WwxWwxW…{W…{W…{W…{WwxWwxWukXghHujGukXl[ifjVuyg†‰gukXfjVukXojoukXgywuzvw‰‡‡™—wŠ•w‰‡uzvuzvwˆwgywfjgfjggy†gy†wŠ•w‰‡pxŒuzvgyw—¨–y–—‡™—‡˜‡—™—‡˜‡‰‡™—‡™—‡™—‡˜‡—™—¯”‘†Š‡–šw©•o©•o©•o§§h¦¨w´±o©•o¦©ˆ–š‡˜§ˆ¦©——¨–—¨–š³’˜¨§˜§ˆŠ¤ˆ—¨––š‡†Š‡–šw–šw•Šmtn•Šm–šw§§h©•o•ŠW†yH†yHlr9wv;‡ˆX†‰g†yH†‰g•ŠmoQ/oQ/Žr6lWR…Šw‘rMŽr6vi8‘rM‘rM¯”‘©•o†yH´±o©•o®’K¯§V©•o©•o¯ª¶¸Ç˧¨¨¸·©·¹·¸·©¦©—§¨¨¶Ã²·¹·¸·©¸ÇË·¹·©¶¸§¨¨¸Ç˸ÇË·¹·«¹Ê©¶¸©¶¸·¹·¨µ¨¯”‘±sp¯™§Ÿx‡¯™§¸¨¨¯”‘°mS°mS“UV°mS²N0²SN±spÓgVÓTMÔM1Ò9(ÔM1ÔM1ÓgVÓopÓTM²N0ëLEÔM1ÓTMÔM1ÓTMÓTMÍ”¨ÓopÓgVÓopÓgVÓopÔM1×[hÓgVÓgVÐ…xÓgVÐ…xÓop±spű®±sp¯”‘×[h²N0©•o±spP,©•o¸¨¨tntn“UVlWRtn¯™§Ÿx‡¯ª¶¯™§¯™§¯ª¶‰l[iŒš§¯™§‰l[i‰Ÿx‡lWR‰Œš§l[i†Š‡•®²«¹Ê‡™—Œš§hxg…Šw—™—–š‡—™—©¶¸¦©—…Šw–šw¦©—tnujG…ŠwtnoQ/†Š‡¦©—–šwwxW•Šm—˜g•Šm•ŠW—˜g—˜g•ŠWwwHwwH…{W‰•Y†yHwv;wwHwwHujGwxWwxWwxW‡ˆXwxWghHukX…{W…{WwwHwxWghHe[GfjVukXukXukX†‰guyguygfjVfjVukXfjVojoojopxŒy–—†Š‡w‰‡ojouzvuzvuzvfjgfjggywpxŒpxŒpxŒwŠ•gy†uzv‡™—Œš§‡™—‡˜‡–š‡‡˜‡‡˜‡–š‡‡™—–š‡—™—–š‡–š‡‡˜‡‡—x¦¨w§§h¦¨w©•o–šw–šw–šw¦©ˆ–š‡—¨–¦©——¨–—¨–˜¨§•®²˜¨§–š‡˜§ˆ–šw–šw–šw©•o•Šmx…X–šw©•o—˜g©•o—˜g…{WujGujGujGwxW‡ˆX†yH—˜g•ŠmUL-fZ8†yH†yH…{We[Gvi8oQ/tn•Šm•Šm‘rMŽr6¯§V®’K®’KÇšH§˜W–šw·¹··¹··²¶Ã²·²·²¸·©·¹··¹··¹··¹·¶Ã²Ã¼Ã¸·©¸·©¶Ã²¸ÇËü÷¹·¸ÇË·¹·©¶¸¸¨¨tntn¯”‘¦©—¯”‘¯”‘¯”‘°mS°mS±sp²SN²SNÍ’°mSÓTM²SNÓgVÓgVÓgVÔM1ÓTMÓgVÔM1ÔM1ÔM1ÓopÓTMÔM1ÓTM°mSÍ”¨ÓgVÓgVÓgVÔM1ÓgVÓTMÓgVÓgV°mSÍ’ÓTMÓop±sp͒ű®Ð…x¯”‘±sp“UV°mS±sp“UV“UV¸¨¨±sp•Šm“UVlWRtn—™—ojo‰«¹Ê˜¨§§¨¨¯™§ojo‰tnŒš§‰uzvŒš§pxŒtnŒš§¯ª¶wŠ•Œš§«¹Ê©¶¸©¶¸—¨–•Šm–š‡—™——™—˜¨§©¶¸—™—…Šw¦©—¦©ˆ†‰g†‰g†‰g…{Wtn–š‡—˜g†yHvi8†yH•ŠW—˜g•ŠW™¥h—˜Y—˜Y†yHwwHˆ–hy…Jwv;huIwv;ujGfjVwxWwxWx…XuygghHujGwxW…{WwxWwxWfjVe[GukXfjVlWRukXwˆw†‰g†‰gukXojoojouyguyggywuzvpxŒw‰‡pxŒuzvwˆwwˆwuzvgywl[igy†pxŒpxŒwŠ•wŠ•wŠ•gy†Œš§‡™—†Š‡‡™——™—˜¨§–š‡‰‰‡™—‡˜‡–š‡–š‡†Š‡†‰g–šw©•o–šw–šw¦¨w¦©ˆ–š‡¦©ˆ¦©——¨–—™—¨µ¨˜¨§—™—‰¥—‡™——¨–¦©ˆ…Šw…Šw–šw˜§ˆ—˜g•ŠW©•o…Šw–šw©•o¦¨w•ŠmujGukXwxW†‰g•Šm•ŠW—˜g‘rMUL-ujG†yH†yHujGe[G‘rM•Šm§§hP,ojo‘rMŽr6’•I¬u/®’K§˜W¦¨w¨µ¨¶Ã²¸¨¨·²·²·²¸·©¸·©¸·©¶Ã²·¹··¹·Ã¼Ã¶Ã²¸·©¸¨¨Ã¼Ãü÷¹·¸ÇË·¹·¨¶—¦©—¸·©¯”‘¦©ˆ¯ª¶¯”‘±sp¯”‘¸¨¨¯”‘¯”‘©•o¯”‘±sp±sp²SN²SN±sp±spÐ…xÔM1ÔM1ÓgVÓgVìV:ÓTMÓTMÓopÓTMÔM1²SN±spÍ’°mSÓTMÓopÓTMÓTMÓTMÓTMÓgV°mSÐ…xÓgV±sp²SN±spű®¯”‘¯”‘°mS“UV“UV¯”‘“UV“UV¦©—±sptn±sptnl[i‰Ÿx‡ojoü¯ª¶‰uzv—™—tnlWR‡™—‰¯ª¶—™—pxŒ†Š‡Œš§˜¨§•®²˜¨§«¹Ê•®²©¶¸˜§ˆ–šw•Šm—™—¯ª¶¨µ¨§¨¨‰–š‡¨¶—¦©——˜g…{W†‰g…{W‡˜‡•ŠmujGujGwxW‡‡I…{W•Šm‰•Y‰•Y†yH‰•Y‡ˆX‰•Y‡ˆXwwHlr9vi8ujGwwHwxWwwHwwHfjVlWRhuIuygwxWwxWwxWukXe[Ge[GfjgfjgukX…Šw†‰guygl[iukXwˆwuzvojoojoojoojouzvuzvojoojouzvuzvw‰‡fjgojogy†gywojopxŒgywojoŒš§w‰‡y–—˜¨§—¨–˜¨§‡˜‡w‰‡y–—Œš§…Šw–šw–š‡‰‡—x¦©ˆ¦©ˆ¦©ˆ–š‡¦©ˆ¦©ˆ—¨–—¨–˜¨§‰¥—‰¥——¨–—¨–—™—‡™—‰¥——¨–˜§ˆ‡˜‡–š‡–š‡–šw–š‡–š‡–š‡•Šm•Šm–šw–šwtn…{WwxWwxWy…J‰•Y†yH†‰gukXUL-†yHwwHujGOKNfjV•Šm‘rMoQ/R4'lWR—˜Y—ˆI®’K¬u/©•o¯”‘·²¯ª¶¸·©´±o´±o·²´±o·²¸·©Ã¼Ã¸·©¸·©¸·©¶Ã²Ä°”·²¶Ã²¸Ç˶ò¶Ã²¸Ç˸¨¨¸¨¨·¹·«¹Ê·¹··¹·§¨¨¯”‘¯”‘¸¨¨¯”‘¸¨¨Í’¸¨¨Í’©•o±sp±sp“UV©•oÐ…x²SN²SN±spÐ…xÔM1ÔM1ÓgVÓgV°mSÓopÓTMÓopÓop±spÓgV²N0°mSÓgV²N0ÓTM²SNÍ’Ð…xÓop°mSÐ…x±sp±sp¸¨¨¯”‘±sptn•Šm°mS•Šm±sp“UV•Šm¯”‘±sp¯”‘tn“UV‰‰tn¯™§¯ª¶¯ª¶Œš§tn‰Ÿx‡l[il[iŒš§‰Ä˜¨§Œš§Œš§—™—Œš§©¶¸©¶¸«¹Ê¦©——™——¨–—™—–šw—™—¯”‘—¨–¦©—¦©—¦©—¨¶—¦©ˆ¦¨w‘rM‘rM…{W—¨––šwwv;wv;‡‡I†yHwwHwxW•ŠW‡ˆX‰•Y‡‡Iy…J‡‡I•ŠWwwHujGwwHwxWwxWuygwxWwxWghHe[GukXx…XwxWwxWghHghHlWRVYGfjVukXuygwˆw†‰guzvukXl[i‡˜‡wˆwukXojoWiffjgojofjgojofjggywi‡‡w‰‡gywfjgl[iVZVfjggywgywfjgˆ¦§v¥®ˆ¦§‰¥—‰¥—‡˜‡w‰‡w‰‡wŠ•‡™—‡˜‡–š‡–š‡–š‡–š‡–šw¦©ˆ¦©ˆ˜§ˆš³’¨¶—˜§ˆ—¨–Š¤ˆ‰¥—•®²˜¨§‡™——™—‡™—ˆ¦§˜¨§—™—–š‡–š‡–š‡–š‡–šw–š‡–š‡…Šw†‰g‡—x–šw†‰gtnx…XujG‡ˆX‡ˆXwwH†‰gukXvi8†yH“UVukXuzv—˜g‘rMoQ/UK7R4'e[G•ŠmŽr6—ˆI•Šm·²¦©ˆ§§h¨µ¨¦¨w©•o´±o´±o´±oÄ°”ÃÅ¡¶Ã²·²¸¨¨ÃÅ¡·²·²Ä°”·¹·¸Ç˸ÇË·¹··¹·¸·©¸·©·¹··¹··¹··¹·¸¨¨¸¨¨·¹·¸¨¨¸¨¨¸¨¨¸¨¨Ä°”Í’©•oÐ…x°mS©•o±sp±spP,¯”‘Í’°mS°mSÓop±sp±spÐ…xÐ…xÓTMÐ…x°mS±spÓop²N0±spÓop²N0°mS±spÐ…x©•o°mS±spÐ…x¯”‘•ŠmÄ°”¯”‘±sp±sp¯”‘±sp±sp¯”‘°mStn¯™§¯”‘‰Ÿx‡tntn¯™§‰tn¯”‘¸·©§¨¨†Š‡†Š‡‰uzvl[itn§¨¨©¶¸˜¨§˜¨§§¨¨§¨¨§¨¨©¶¸·¹·©¶¸—¨–˜§ˆ—™—–š‡¦©ˆ–š‡–š‡–šw¦©—¦©—¨µ¨©•o—˜g—˜Y…{W•ŠW–š‡š³’†yHvi8wwH‡‡IwwHukXx…X‡ˆX‡‡I‡‡IwwHujG‡ˆXy…JwwHwxWukXhvXhuIhuIhuIfjVghHghHwxWx†hujGVYGghHe[GUK7OKNghHuzvuzvuyguygfjgojo‡˜‡x†huygojol[ifjgfjglWRfjgfjgojopxŒpxŒojofjge[GVZVVZVl[ifjgWiwv¥®•®²•®²‡˜‡w‰‡wŠ•†Š‡pxŒpxŒy–——¨––š‡–š‡†Š‡‡—x–š‡¦©—¦©—˜§ˆ—¨–¦©——™—‡™——¨–‰¥——™—–š‡‡˜‡‡™—˜¨§•®²˜¨§–š‡–š‡Š¤ˆ–šw–š‡…Šw…Šw•Šmtntn‡—x†Š‡x†h…Šw‡ˆX‡ˆX‡ˆX†yHghHwxWukXfZ8e[GwxWtn…{WwwHvi8UL-UL-l4$vi8tnukX—˜g©•o©•o§˜W¦©ˆ·²©•o¯§V´±o´±o·²¸·©¶Ã²Ä°”·²ÃÅ¡·²·²·²¸·©¸ÇËüÃü÷²¸¨¨¯ª¶·¹·¶Ã²·¹··¹·¸¨¨¸¨¨·¹·¸¨¨¯™§¸¨¨¸·©Í”¨¯”‘¯”‘Í’Ð…xÍ’Ð…x©•oÍ’Ð…xÍ’¯”‘ÓgV±sp¯”‘Ð…xÓop¯”‘ÓgV°mSÐ…x²SN©•o±sp²SN®’KÍ’°mS°mSÍ’¯”‘ÕwŒ°mS°mS±spÍ”¨¯”‘¸¨¨¦©ˆ±sp±sp©•o¯”‘©•oÄ°”Ÿx‡±sp¯™§¸¨¨¯”‘¯”‘tntn§¨¨‰“UV‰¸¨¨¯ª¶†Š‡‡˜‡‰†Š‡‰†Š‡Œš§©¶¸¶Ã²¸¨¨¨¶—¨µ¨·¹·©¶¸·¹·¶Ã²¨µ¨¦©ˆ—˜g©•o¦©ˆ•Šm–š‡•Šm–šw–š‡·²¦©ˆ•ŠW—˜g©•o—˜g•Šm¨µ¨†yHfZ8vi8‡‡IwwHwwH…{Wˆ–hx…XwwHwxWwwHwwHy…JwwHwwHujGwwHwwHujGghHujGghHghHukXuygukXe[Ge[Ge[GOKNe[GlWRfjVuzvuygtnuyggyw‰¥—wˆwhxghxgfjgfjgXgWfjVfjVhvXfjghxgojogywVZVVZVOKNF<EOKNVZVfjg•®²•®²‡™—wˆw†‰g…Šwi‡‡wŠ•‡™—ˆ¦§˜¨§‡˜‡‡˜‡—™—–š‡Š¤ˆ˜§ˆ˜§ˆ—¨–—¨–˜¨§‰¥——¨–ˆ¦§‰¥—‰¥—†Š‡uzv‡™—‡™—˜¨§—¨–†Š‡‡—x–š‡Š¤ˆ–š‡…Šw†‰g…Šw…Šwtn‰…Šw…Šw†‰g†‰g‡ˆX•ŠWujGvi8ujGwxWfZ8fjV•Šm…{We[GujG†yHUL-oQ/oQ/fZ8tn…{W—ˆI‘rMŽr6•ŠW¦©ˆ¯”‘©•o—ˆI´±oÐ…x·²Å±®¸·©¶Ã²ÃÅ¡Ä°”©•oű®·¹·Ã¼Ã¶Ã²Ã¼ÃÄ°”¯”‘¨µ¨·¹··¹·Ã¼Ã·¹··¹·¸·©¸·©Å±®¸¨¨¸·©¸¨¨¯”‘¯”‘Ä°”¸¨¨¸¨¨Í’¯”‘ÓopÇšH±sp¯”‘¯”‘©•oÐ…x¯™§Í’¯”‘¯”‘¸¨¨Ð…x¯”‘Í’°mS¯”‘Í’°mS±sp¸¨¨Ð…x©•oÍ’¯”‘Ð…xÐ…xÐ…xÍ’Í”¨Í’¯”‘Í’¯”‘°mS±spÍ”¨Í’¯”‘¸¨¨¯”‘¯”‘ű®¯”‘¸¨¨±sp•Šm¦©——™—ukXtn§¨¨§¨¨§¨¨‡˜‡¯™§‰—™—˜¨§¯ª¶¨µ¨·¹·¶Ã²·²¯”‘¨µ¨¯ª¶Ã¼Ãüø·©¨¶‡—˜g—˜g¦¨w¯”‘–šw…{W•ŠW—˜g·²¨¶‡•ŠW†yH—˜Y§˜W–šwš³’†yHvi8fZ8vi8†yHwwHwxW‡ˆXˆ–hy…JwwHhuIukXy…Jx…XuyghvXhuIwxWfjVfjVghHghHfjVghHuyghvXe[GfjVe[GUK7e[GukXghHuyguzvuzvx†hz•y‡™—wˆwuygojolWRVZVVZVlWRVZVfjVlWRVZVl[ifjgl[ilWROKNUK7OKNOKNVZVˆ¦§z•‡wˆwz•y¥uˆ–hwˆwz•‡‡™—y–—‡™—‡˜‡‰‰¥—˜¨§‡˜‡‡˜‡Š¤ˆ—¨–‰¥—˜¨§˜¨§‡™—ˆ¦§ˆ¦§y–—z•‡uzvwŠ•Œš§‰¥—‡™—–š‡–š‡–š‡†Š‡†Š‡wˆw…Šw…Šw†Š‡†Š‡–š‡…Šw…Šwx†h†‰g‡ˆX‡ˆXwv;fZ8fZ8e[Gtn•ŠmwxWukXwxW…{WujGoQ/oQ/vi8oQ/ukX†yHŽr6‘rM¬u/•Šm–šw©•o®’K—ˆI´±o¦¨wÄ°”¸·©ÃÅ¡·²·²¸·©¸·©·¹·¶Ã²ÃÅ¡¶Ã²¸·©·²¸·©¶Ã²·¹·¶Ã²Ã¼Ã¶Ã²¶Ã²·¹··¹·¸·©¸¨¨·¹·Å±®·²¸¨¨¸¨¨¸¨¨Ä°”¸¨¨Í”¨·²Ð…xÍ’Í”¨¯™§Ð…xÕwŒ¸¨¨Ä°”Í’¸¨¨Í’Ð…xÄ°”¯”‘°mS¯”‘±sp±sp±spÍ”¨±spÍ’¸¨¨¯”‘Ä°”Í’¯”‘Í’¯”‘Í’Í’Ð…xÍ’Ð…xÍ’¸¨¨Ä°”¯”‘ű®Í”¨Ä°”ű®¯”‘¸¨¨¸¨¨¦©—¯™§¯”‘¯”‘‰¸¨¨¯ª¶·¹·¦©—¸¨¨¨µ¨§¨¨¨µ¨·¹·¸·©¸·©¶Ã²·¹·¦©ˆ¦©ˆ¸¨¨¶Ã²¶Ã²¶Ã²·²§§h—˜Y§˜W´±o©•o–šw•ŠW†‰g•ŠW¦©ˆ—˜g†yH†yH…{W—˜Y¦©ˆ†yHy…Jwv;vi8‡‡IwwHwwHwxWy…J‡ˆX‡ˆXwwHwwHwxWx†hx†hwxWhuIoˆVwxWghHhuIghHe[Ge[GuygwxWfjVlWRlWRUK7OKNe[GlWRuzvojoukXwˆw‡˜‡w‰‡fjguyghxgVZVOKNlWRVZVl[ihxghxgVZVVZVWifWiflWROKNF<EOKNOKNOKNy–—z•‡…Šwz•‡‰¥—z•‡w‰‡y–—y–—z•‡‡˜‡‡˜‡—™—‡™—‡˜‡‡˜‡‡—xŠ¤ˆ—™—‰¥—‰¥—Œš§‡™—‡™—‡™—‡™—y–—w‰‡‡™—ˆ¦§‰¥—‡™—˜§ˆ‡—x…Šwuzv†Š‡wˆwuzv…Šw‡—x…Šw†Š‡…Šw…Šwx†h†‰g‡ˆX…{WujGfZ8lWRwxW…{WwwH†‰gˆ–hwxW•ŠW…{WfZ8oQ/gg9fZ8e[G…{WŽr6†yHŽr6•Šm§˜W§˜W°mS‘rM©•o·²ÃÅ¡¸·©·²Ä°”·²¸·©¸·©¸·©¶Ã²¶Ã²ÃÅ¡´±oÄ°”¶Ã²·¹··¹·¶Ã²Ã¼Ã¶Ã²Ã¼Ãüø·©Ã¼Ãű®Ã¼Ã¸¨¨Å±®¸¨¨¸¨¨¸¨¨Å±®¸¨¨Í”¨¯”‘ű®¸¨¨Í”¨Å±®Í”¨¸¨¨Å±®Å±®Å±®Å±®Í’ÓopÄ°”¯”‘±sp¯™§©•o±sp®’KÍ”¨Í’·²Í’Í”¨¸¨¨Í”¨Í’Ä°”Í’¯”‘Í’ÓopÍ”¨Í”¨Í’ű®Å±®Ä°”ű®Å±®Å±®¯™§¯”‘ű®Å±®§¨¨¸¨¨¦©ˆ¯”‘¯™§¯”‘¸·©·¹··¹·¸·©·¹··²·²¸·©¸·©·²¸·©¶Ã²Ä°”¯”‘¦©—¨µ¨¸·©ÃÅ¡Ä°”§§h§˜W’•I¯§V•ŠW¦¨w©•o‡ˆX‡ˆX–šw§§h§˜W—ˆI†yH†yH™¦w’•I‘ˆ;vi8gg9wwHwwHujGhuIhuIwwHhuIwwHwwHx…Xx…XwxWhvXhuIujGhuIe[GfZ8gg9YeHe[GhvXhvXfjVfjVfjVlWRVYGVZVlWRuzvhxghxguyg‡—xuzvXgWfjVfjVfjVlWRVZVl[igywwˆwgywfjVVYGVZVl[iVZVOKNe[GUK7OKNOKN‰¥—‰¥—wŠ•y–—y–—y–—y–—‡˜‡y–—wŠ•†Š‡Š¤ˆ‡™—w‰‡w‰‡‡™—‡˜‡‰¥—–š‡z•‡Œš§‰¥—‡™—‡™—Œš§‰¥—‡™—‰¥—ˆ¦§v¥®‰¥—‡˜‡‡—x†Š‡†Š‡…Šw…Šw†Š‡…Šw‡—x…Šw…Šw…Šw…Šw…Šw†‰g‡ˆX…{W†yHghHe[G…{W…{We[GwxW†‰gwxWghH…{W•ŠWvi8oQ/vi8UL-UK7•ŠmŽr6P,‘rM•Šm—ˆI—ˆI—ˆIvi8•ŠmÄ°”ÃÅ¡´±o·²ÃÅ¡·²µÄÄ°”¸·©¶Ã²Å±®·²·²¶Ã²Ã¼Ã¶Ã²Ã¼ÃÃÅ¡¶Ã²Ã¼Ã¶Ã²Å±®¸·©·¹·¶Ã²ÃÅ¡¶Ã²¸¨¨¸·©·¹·Å±®¸·©¸¨¨¸¨¨Ä°”Í”¨¸¨¨¸¨¨Ä°”¯™§¸¨¨·¹·Å±®¸¨¨Å±®Í’Ä°”Í”¨Í”¨Í”¨¸¨¨Í’Í’Ð…x¸¨¨¸¨¨Í’¸¨¨Ä°”ű®Ä°”Í’Í’Í’Í’Í’·²Å±®Å±®Å±®Å±®Å±®Ä°”Ä°”Ä°”Ä°”Í’Ä°”¸¨¨¸¨¨¦©ˆ¸¨¨¯”‘¯”‘·²¸¨¨·¹··¹··¹··¹·¸·©Ä°”·²ÃÅ¡ÃÅ¡·²¸·©Ãšű®·²·²¸·©¨¶—ÃÅ¡ÃÅ¡´±o¯§V§˜W®’K¯§V—˜Y—˜g§§h†‰g†‰g‡ˆX§˜W•ŠWŽr6†yH—˜g‘ˆ;wv;gg9oQ/lr9ujGvi8fZ8gg9ujGujGZe;ghHwwHujGghHghHhvXe[GghHfZ8e[GWW8e[GghHfjgukXe[GghHfjVe[GVYGe[GfjguzvojoojoukX…ŠwwˆwXgWVZVfjVl[iVZVVZVhxggywojohxgfjgVZVe[GVZVVYGUK7OKNOKNOKNe[G‰¥—wŠ•z•‡‡™—wŠ•wŠ•wŠ•wŠ•wŠ•Œš§–š‡–š‡‡˜‡w‰‡y–—‡™—…Šw‡˜‡‡™—‡™—‡™—‡™—y–—o®y–—ˆ¦§‰Ä•®²ˆ¦§‰¥—‰¥—‡˜‡‡—xz•‡…Šwuzvuzv†Š‡…Šwtn†Š‡†‰g†‰g†‰guygtn†‰gx…XwwHujGuyg…{Wgg9e[GwxWwwHhuIghHujG…{WfZ8vi8vi8vi8R4'ojo•ŠW†yH‘rM…{W‘rM—ˆI‘rMujG¦©—ÃÅ¡´±o©•o¦¨wȵl´±o·²¶Ã²¸·©¶Ã²Ä°”·²Å±®¶Ã²Ãšü÷¹·¶Ã²Ã¼Ã¶Ã²Å±®Ä°”¸·©Ã¼Ãű®¸·©Å±®¸¨¨Å±®Ã¼Ã·¹·Å±®Å±®Å±®¸¨¨¸¨¨¸¨¨Å±®¸¨¨Å±®¸¨¨Å±®¸¨¨¯”‘Í’©•oÍ”¨Í”¨¸¨¨Å±®Å±®Í”¨Ä°”¸¨¨¸¨¨Å±®Ä°”¸¨¨Ä°”Í”¨Í’Í’Ä°”Í’Í’¸¨¨Å±®Å±®Å±®Å±®Å±®Ä°”ű®Í”¨Ä°”Ä°”Ä°”¸¨¨¸¨¨¯”‘¯”‘¯”‘¸¨¨·²¸·©¸·©Å±®Ã¼Ãüöòüø·©·²¸·©ÃÅ¡·²¸·©Ãšű®Ä°”·²¦©—¦©—¸¨¨ÃÅ¡´±o¯§V«¢;—ˆI§˜W§˜W§˜W§§h—ˆI…{W…{W•ŠW•ŠWŽr6Žr6‡ˆX’•I‘ˆ;lr9gg9gg9fZ8WW8Ze;Ze;ghHhuIgg9WW8Ze;Ze;gg9ghH[tXZe;YeHhuIghHZe;WW8YeHhuIfjVlWRVYGfjVlWROKNe[GfjgfjVhvXfjguyg‡˜‡w‰‡fjVVZVfjVfjVWiflWRfjgfjgXgWfjVfjgl[ifjVfjVVYGl[ifjVVZVOKNUK7z•‡wŠ•wŠ•‡™—wŠ•w‰‡w‰‡wŠ•y–—‡™—‡˜‡†Š‡w‰‡wŠ•‡™—Š¤ˆ…Šw‡˜‡‡™—y–—wŠ•y–—wŠ•Œš§Œš§ˆ¦§•®²•®²ˆ¦§‰¥—‰¥—‡™—‡˜‡‡™—‡˜‡uzvwˆwwˆw†Š‡‡™—‡˜‡†Š‡…Šwuyguyg†‰g‡—xwxWwxWwxW†‰gwxWe[GghHujGy…JujGWW8fZ8ujGfZ8wv;†yHoQ/R4'ujG•ŠmP,ukXŽr6oQ/‘rM‘rM•Šm¸·©´±o®’KÇšHȵl¸ÃuȵlÃÅ¡¸·©Ãšű®Ä°”µÄű®Ã¼Ã¶Ã²¶Ã²ÃÅ¡ÃÅ¡¸·©ÃÅ¡Ä°”·²Ã¼Ã¶Ã²¸·©Ã¼ÃÄ°”ÚüÃüÃüÃüø·©¸¨¨¸¨¨Å±®Å±®Å±®Ã¼Ãű®¸¨¨¯”‘Í”¨Ä°”¸¨¨Ä°”¸¨¨¯”‘Í”¨Å±®Å±®Å±®Å±®Å±®Å±®Å±®Í”¨Í”¨Í’Ä°”ű®¸¨¨Í’Ä°”Ä°”ű®Ä°”Ä°”ű®Å±®ÃÅ¡Í”¨Ä°”ű®¯”‘ű®ÃÅ¡Ä°”¯”‘Ä°”·¹·Ä°”¸¨¨Ãšű®ÃÅ¡¸·©¸·©Ãšű®ÃÅ¡·¹·¸·©Å±®ÃÅ¡ÃÅ¡¸·©Ä°”ȵlÄ°”´±o·²·²¦©ˆÃÅ¡´±o¯§V¯§V®’K—ˆI§˜W§˜W¯§V‘ˆ;Žr6wv;ujG•ŠW…{W†yH‡ˆX†yH‡‡Iwv;vi8lr9gg9UL-Ze;WW8gg9vi8gg9fZ8WW8UK7fZ8fZ8ghHghHfZ8ukXVYGUK7VYGYeHlWRfjVVYGlWRfjVfjVVYGfjVuzvfjgfjVfjVhxgwˆwwˆwojoe[GVYGVZVVZVWifl[iVZVVZVOKNVZVVZVVZVVZVVZVWifWifl[ie[GOKNuzvwŠ•‡™—y–—o®wŠ•wŠ•y–—‡™—‡™—z•‡†Š‡w‰‡wŠ•‡™—–š‡‡˜‡‡™—ˆ¦§Œš§y–—y–—y–—Œš§Œš§‰Ä•®²•®²ˆ¦§v¥®‡™—‡˜‡‡™——™—‡™—w‰‡w‰‡uzv‡™—ˆ¦§—™—†Š‡…Šwuyguyg…Šwx”kwxWwwHujGwwHwwHghHghHukX‰•YukXfZ8†yHe[GfZ8ujG†yHvi8UK7vi8•Šm‘rMukXoQ/vi8°mS‘rM¦©—·²®’K®’KÏQȵlÄ°”ȵl·²¸·©ÃÅ¡ÃÅ¡µÄÃÅ¡¸·©¶Ã²¶Ã²ÃÅ¡¸·©¸·©ÃÅ¡ÃÅ¡·²¸·©Ã¼Ãű®¶Ã²Å±®Å±®¶Ã²Ã¼Ãű®¶Ã²ÃÅ¡¸·©Å±®¸·©Å±®Å±®Å±®Ã¼ÃüÃű®¸¨¨Í’Ä°”ű®¯”‘Í’¸¨¨Ä°”ű®¸¨¨Å±®Å±®Å±®Í”¨Å±®Å±®Å±®Ä°”ű®Å±®Í”¨Ä°”Í”¨Ä°”ű®Å±®Ä°”ű®Å±®Å±®Å±®Ä°”ű®Ä°”ű®Å±®Ä°”Ä°”ű®ÃÅ¡ÃÅ¡Ä°”ÃÅ¡Ä°”¸·©Å±®ÃÅ¡Ä°”ÃÅ¡Ä°”ȵlÃÅ¡Ä°”·²Ä°”ÃÅ¡Ä°”ȵlȵlȵl´±o¸·©·²Ä°”ȵl‘ˆ;¯§V§˜W’•I—ˆI’•I§˜W‘ˆ;†yHŽr6vi8†yH—ˆI‡ˆX…{Wwv;wv;lr9gg9lr9gg9UL-Nf9WW8fZ8gg9fZ8gg9UL-UL-UL-WW8Ze;Ze;ghHghHe[GWW8GH8VYGYeHYeHVZVlWRfjVlWRVYGfjVwˆwukXe[GfjVhxguzvw‰‡i†xlWROKNXgWfjge[GlWRVYGOKNOKNlWRl[iVZVlWRVZVl[ifjgfjgVZVUK7Zwvy–—y–—gy†pxŒo®o®o®ˆ¦§w‰‡†Š‡wŠ•i‡‡wŠ•‰¥—–š‡‡˜‡‡™—y–—o®Œš§wŠ•o®ˆ¦§v¤šˆ¦§Ž¬Ì•®²•®²‰¥—z•‡†Š‡z•‡‡™—‡™—†Š‡uzvuzv‡™—•®²‰¥—†Š‡…Šwtnuygwˆwx…XwxWhvXwxWujGwwHghHe[GwxWwxWujGe[G‘rMe[GfZ8‘rM†yH‘rMŽr6Žr6tn…{WujGR4'vi8‘rM¦©ˆ·²‘rM¬u/®’K¯§VȵlȵlȵlÄ°”ÃÅ¡·²·²Ä°”·²ÃšüöòÃÅ¡¸·©¸·©¸·©Ä°”Ä°”¶Ã²·¹·Ã¼Ã¶Ã²¶Ã²ÃšÚű®¶Ã²Å±®Å±®Å±®Ãšű®Å±®¸·©Ä°”ű®Ã¼Ã¶Ã²Å±®Ä°”ű®Å±®Å±®©•o¯”‘¯”‘ű®¸¨¨Å±®Å±®¸·©¸¨¨Å±®Å±®Ä°”ű®Å±®Ä°”Ä°”Ä°”Ä°”ű®Å±®Å±®Å±®Ä°”Ä°”Ä°”ű®Ä°”Úű®Ãšű®¸·©¸·©Å±®¸·©Å±®Ä°”·²¸·©Ä°”ÃÅ¡¸·©Ä°”·²Å±®ÈµlÄ°”¸·©ÈµlÄ°”ÉÄpÄ°”ȵl´±oÄ°”ȵl·²¨¶‡µÄ´±o®’K‘ˆ;«¢;®’K—ˆI’•I—ˆI†yH‘ˆ;wv;vi8Žr6wv;†yHwwHvi8lr9gg9UL-UL-lr9UL-UL-UL-UL-UL-gg9UL-R4'GF-GF-WW8YeHgg9fjVwxWghHfZ8GF-UK7VYGfjVfjVVZVfjVfjVOKNfjVuygVZVVYGVYGuyguzvx†hwˆwfjgVZVfjghxgVZVVYGOKNOKNVYGVZVfjVVZVe[GOKNOKNVYGWiflWRVZVwŠ•y–—w‰‡wŠ•wŠ•wŠ•o®o®y–—‡™—‡˜‡y–—y–—‡™—‡˜‡†Š‡‡™—z•‡y–—wŠ•o®wŠ•wŠ•ˆ¦§ˆ¦§ˆ¦§•®²Ž¬Ì•®²v¥®wŠ•y–—wŠ•w‰‡y–—wŠ•w‰‡uzvpxŒ‡™—‡™—‡˜‡†Š‡j„hx†huyghvXx†h…Šwx…XukXwxWwxWwxWwxWoˆVhuIujGujGUK7fZ8ujGoQ/‘rMŽr6‘rM‘rM•Šm‘rMR4'oQ/‘rM¦©—•ŠW†yH²Š8®’KÇšHȵlȵlÄ°”µÄÄ°”ȵl´±oÄ°”Ä°”ÃÅ¡ÃÅ¡Ä°”¸·©ÃšÚÚÚű®¸·©Ã¼ÃÚÚű®Å±®Å±®ÃšüÃÃÅ¡¸·©Ä°”ű®Ã¼Ã¶Ã²Ä°”Ä°”üöòű®Å±®Ä°”ű®Å±®Å±®Ä°”¯”‘Í’Í”¨Å±®Å±®Å±®Å±®Å±®Ä°”ű®Å±®Å±®Å±®Å±®Å±®Å±®Å±®Å±®Ãšű®Ä°”Ä°”ű®Ä°”ű®Ä°”ű®Å±®Å±®Å±®Å±®ÃšÚű®Å±®Ä°”·²Ãšű®Ä°”Ä°”Ä°”ȵl·²Ä°”ÉÄpÄ°”Ä°”ȵlÉÄpÄ°”ȵlȵlȵlÐ…x¸·©¦¨w·²´±o«¢;‘ˆ;‘ˆ;‘ˆ;˜¥W§˜W‘ˆ;†yH‡‡Iwv;vi8wv;‡‡IwwHwv;y„<gg9Nf9UL-UL-UL-UL-Nf9UL-UL-UL-lr9UL-GF-D:+GF-Ze;fZ8fZ8y…JwxWujGWW8D<5UK7VYGfjVhxgfjVXgWfjVVYGVYGlWRVZVe[GlWRhxguyghxguzvfjVXgWfjgfjglWROKNF<EUK7OKNVYGVYGlWROKNUK7OKNVZVlWRVZVVZVMYj:OQGJFIYVMYjVZVIYVMYjVZVIYVVZVIYVMYjKeWVZVMYjKeWMYjVZVIYVVZVMYjIYVJgnMYj=eeJgnJgnWifMYjVZVVZVVZVIYVIYVIYVOKNOKNF<EOKNVZVVZVOKNGJFGJFGJFGH8IWGVYGGH8GF-GF-UK7IWGIWGJU:GH8GF-D<55+(995D:+86+UL-UL-UL-R4'OKNGJF#D<5e[GukXUL-R4'UK7vi8fZ8vi8ujGukXwwHukXfZ8ukXukXukXuygojoukXuygwxWfjgukXuygojouygukXukXuygojoukXuygojouzv…{WuygukXtnojouygukXojouyguygojoukXojoojoojouyglWRukXukXukXojoojol[i…{WukX“UVl[iukXuygojoukXuyguygtnuygtntnojoukXtnuygtn‘rMuyguyguygukXuygojoojoukXuygukXukXujGuygukXukXujGujGukXujGukXujGukXujGukXukX‘rMujGujGujGhvXujGhuIfZ8oQ/UL-fZ8GF-WW8gg9WW8UL-UL-GF-GF-UL-UL-JU:GF-GF-GF-:F/86+86+GF-86+86+5+(86+86+86+D:+5+()'&)'&86+86+86+GF-GF-D:+86+5+(5+(86+:F/GH8995995D<586+86+9955+(5+(995;F8GH8995GH886+-12995995995D:+5+(5+(5+(5+(5+(5+(5+(-12)'&5+(99586+5+( \ No newline at end of file diff --git a/tutorial/image/tutorial-image-converter.cpp b/tutorial/image/tutorial-image-converter.cpp index 76f55aa9ff4449e271d29351c4aeb5dc9138f255..6b9c9ee49815e25ebebd978dbe15ce3ceaea19a7 100644 --- a/tutorial/image/tutorial-image-converter.cpp +++ b/tutorial/image/tutorial-image-converter.cpp @@ -1,6 +1,6 @@ /*! \example tutorial-image-converter.cpp */ -#include <visp/vpImageIo.h> -#include <visp/vpImageConvert.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageConvert.h> int main() { @@ -8,16 +8,16 @@ int main() try { cv::Mat A; #if (VISP_HAVE_OPENCV_VERSION >= 0x030000) - A = cv::imread("lena.bmp", cv::IMREAD_GRAYSCALE); + A = cv::imread("monkey.bmp", cv::IMREAD_GRAYSCALE); #else - A = cv::imread("lena.bmp", CV_LOAD_IMAGE_GRAYSCALE); + A = cv::imread("monkey.bmp", CV_LOAD_IMAGE_GRAYSCALE); #endif vpImage<unsigned char> I; vpImageConvert::convert(A, I); -# ifdef VISP_HAVE_LIBPNG - vpImageIo::write(I, "lena.png"); // Gray +# ifdef VISP_HAVE_PNG + vpImageIo::write(I, "monkey.png"); // Gray # endif } catch(vpException e) { diff --git a/tutorial/image/tutorial-image-filter.cpp b/tutorial/image/tutorial-image-filter.cpp index c224206f89829114ce4310776582cac8e5d84c27..8e01aeb6ecf19e2b37b85685e70fe55cdd5948a4 100644 --- a/tutorial/image/tutorial-image-filter.cpp +++ b/tutorial/image/tutorial-image-filter.cpp @@ -1,12 +1,12 @@ //! \example tutorial-image-filter.cpp -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageFilter.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageFilter.h> void display(vpImage<unsigned char> &I, const std::string &title); void display(vpImage<double> &D, const std::string &title); diff --git a/tutorial/image/tutorial-image-manipulation.cpp b/tutorial/image/tutorial-image-manipulation.cpp index fe230a7252968d7a9eb79e8f14a986e639b7365d..6f8c459cf16926e1073baf87d28cbeff04529a35 100644 --- a/tutorial/image/tutorial-image-manipulation.cpp +++ b/tutorial/image/tutorial-image-manipulation.cpp @@ -1,5 +1,5 @@ /*! \example tutorial-image-manipulation.cpp */ -#include <visp/vpImage.h> +#include <visp3/core/vpImage.h> int main() { diff --git a/tutorial/image/tutorial-image-reader.cpp b/tutorial/image/tutorial-image-reader.cpp index 109b806601a32101fac90451b44573be6588301a..4c72a3cb4b3e5d66cf8463fe820e6bc8cee0931a 100644 --- a/tutorial/image/tutorial-image-reader.cpp +++ b/tutorial/image/tutorial-image-reader.cpp @@ -1,12 +1,12 @@ /*! \example tutorial-image-reader.cpp */ -#include <visp/vpImageIo.h> +#include <visp3/io/vpImageIo.h> int main() { try { vpImage<vpRGBa> I; - vpImageIo::read(I, "lena.jpeg"); - vpImageIo::write(I, "lena.png"); + vpImageIo::read(I, "monkey.jpeg"); + vpImageIo::write(I, "monkey.png"); } catch(vpException e) { std::cout << e.getMessage() << std::endl; diff --git a/tutorial/image/tutorial-image-viewer.cpp b/tutorial/image/tutorial-image-viewer.cpp index a3a6dfa4d23f4fb349bfbb44e525767efd49a0e4..3f2bea0619a2059bd6efa395dcec7c364e4d1691 100644 --- a/tutorial/image/tutorial-image-viewer.cpp +++ b/tutorial/image/tutorial-image-viewer.cpp @@ -1,15 +1,15 @@ /*! \example tutorial-image-viewer.cpp */ -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpImageIo.h> -#include <visp/vpImagePoint.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImagePoint.h> int main() { try { vpImage<vpRGBa> I; - vpImageIo::read(I, "lena.ppm"); + vpImageIo::read(I, "monkey.ppm"); #if defined(VISP_HAVE_X11) vpDisplayX d(I); @@ -20,7 +20,7 @@ int main() #else std::cout << "No image viewer is available..." << std::endl; #endif - vpDisplay::setTitle(I, "Lena"); + vpDisplay::setTitle(I, "Monkey"); vpDisplay::display(I); vpDisplay::displayRectangle(I, vpImagePoint(90,90), 70, 90, vpColor::red, false, 2); @@ -30,8 +30,8 @@ int main() vpDisplay::getImage(I, O); try { - vpImageIo::write(I, "lena-out.jpg"); - vpImageIo::write(O, "lena-out-with-overlay.jpg"); + vpImageIo::write(I, "monkey-out.jpg"); + vpImageIo::write(O, "monkey-out-with-overlay.jpg"); } catch(...) { std::cout << "Cannot write the image: unsupported format..." << std::endl; diff --git a/tutorial/image/tutorial-undistort.cpp b/tutorial/image/tutorial-undistort.cpp index b26460f3cc00b54e093eeb42609bf9450a2b1da8..dbce3bed1d512dfa12541897e428f9de78dd6583 100644 --- a/tutorial/image/tutorial-undistort.cpp +++ b/tutorial/image/tutorial-undistort.cpp @@ -1,7 +1,7 @@ //! \example tutorial-undistort.cpp -#include <visp/vpImageIo.h> -#include <visp/vpImageTools.h> -#include <visp/vpXmlParserCamera.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpImageTools.h> +#include <visp3/core/vpXmlParserCamera.h> int main() { diff --git a/tutorial/image/tutorial-viewer.cpp b/tutorial/image/tutorial-viewer.cpp index cfd843940e6bbb7c51943a15e017d663f280bf69..2ab5efd48901fdbf5587cc2ff3a795d09127db11 100644 --- a/tutorial/image/tutorial-viewer.cpp +++ b/tutorial/image/tutorial-viewer.cpp @@ -1,13 +1,13 @@ //! \example tutorial-viewer.cpp //! [Include display] -#include <visp/vpDisplayD3D.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayD3D.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> //! [Include display] //! [Include io] -#include <visp/vpImageIo.h> +#include <visp3/io/vpImageIo.h> //! [Include io] int main(int argc, char** argv) @@ -35,12 +35,12 @@ int main(int argc, char** argv) //! [vpDisplay construction] #if defined(VISP_HAVE_X11) vpDisplayX d(I); +#elif defined(VISP_HAVE_GDI) + vpDisplayGDI d(I); #elif defined(VISP_HAVE_OPENCV) vpDisplayOpenCV d(I); #elif defined(VISP_HAVE_GTK) vpDisplayGTK d(I); -#elif defined(VISP_HAVE_GDI) - vpDisplayGDI d(I); #elif defined(VISP_HAVE_D3D9) vpDisplayD3d d(I); #else diff --git a/tutorial/robot/pioneer/CMakeLists.txt b/tutorial/robot/pioneer/CMakeLists.txt index 1de807f35eda1b423be5b5ba5ec75950b87f46ed..8a183308c9de42c38da9ae0897862408bd1d7345 100644 --- a/tutorial/robot/pioneer/CMakeLists.txt +++ b/tutorial/robot/pioneer/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-robot) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_robot visp_vs visp_gui) set(tutorial_cpp tutorial-pioneer-robot.cpp diff --git a/tutorial/robot/pioneer/tutorial-pioneer-robot.cpp b/tutorial/robot/pioneer/tutorial-pioneer-robot.cpp index 40c100848d903bb84952321036d9e1722bedaa46..ba9771248f5a1eac63f558501af0ee9faf105c1b 100644 --- a/tutorial/robot/pioneer/tutorial-pioneer-robot.cpp +++ b/tutorial/robot/pioneer/tutorial-pioneer-robot.cpp @@ -1,6 +1,6 @@ /*! \example tutorial-pioneer-robot.cpp */ #include <iostream> -#include <visp/vpRobotPioneer.h> +#include <visp3/robot/vpRobotPioneer.h> int main() { diff --git a/tutorial/robot/pioneer/tutorial-simu-pioneer-continuous-gain-adaptive.cpp b/tutorial/robot/pioneer/tutorial-simu-pioneer-continuous-gain-adaptive.cpp index 19a028e8f8207d0e27c0f9e93842589ac5101815..54180828b07af5c9bafd7392930cc9653b907323 100644 --- a/tutorial/robot/pioneer/tutorial-simu-pioneer-continuous-gain-adaptive.cpp +++ b/tutorial/robot/pioneer/tutorial-simu-pioneer-continuous-gain-adaptive.cpp @@ -17,14 +17,14 @@ */ #include <iostream> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureDepth.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpPlot.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorPioneer.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureDepth.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/gui/vpPlot.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorPioneer.h> +#include <visp3/core/vpVelocityTwistMatrix.h> int main() { @@ -46,8 +46,7 @@ int main() robot.getPosition(wMc); wMo = wMc * cMo; - vpPoint point; - point.setWorldCoordinates(0,0,0); + vpPoint point(0,0,0); point.track(cMo); vpServo task; diff --git a/tutorial/robot/pioneer/tutorial-simu-pioneer-continuous-gain-constant.cpp b/tutorial/robot/pioneer/tutorial-simu-pioneer-continuous-gain-constant.cpp index e2d7371488dd14ebc714327d1aed58a0a489fba3..d540573f0193b687150f878ae3f59904e7595019 100644 --- a/tutorial/robot/pioneer/tutorial-simu-pioneer-continuous-gain-constant.cpp +++ b/tutorial/robot/pioneer/tutorial-simu-pioneer-continuous-gain-constant.cpp @@ -17,14 +17,14 @@ */ #include <iostream> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureDepth.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpPlot.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorPioneer.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureDepth.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/gui/vpPlot.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorPioneer.h> +#include <visp3/core/vpVelocityTwistMatrix.h> int main() { @@ -46,8 +46,7 @@ int main() robot.getPosition(wMc); wMo = wMc * cMo; - vpPoint point; - point.setWorldCoordinates(0,0,0); + vpPoint point(0,0,0); point.track(cMo); vpServo task; diff --git a/tutorial/robot/pioneer/tutorial-simu-pioneer-pan.cpp b/tutorial/robot/pioneer/tutorial-simu-pioneer-pan.cpp index a3c587bd53080f5a051633f15aca25873b4603d2..9e31ea7027db185ce4ae58a28384d76b5095fe35 100644 --- a/tutorial/robot/pioneer/tutorial-simu-pioneer-pan.cpp +++ b/tutorial/robot/pioneer/tutorial-simu-pioneer-pan.cpp @@ -18,14 +18,14 @@ */ #include <iostream> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureDepth.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpPlot.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorPioneerPan.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureDepth.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/gui/vpPlot.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorPioneerPan.h> +#include <visp3/core/vpVelocityTwistMatrix.h> int main() { @@ -54,8 +54,7 @@ int main() wMo = wMc * cMo; // Define the target - vpPoint point; - point.setWorldCoordinates(0,0,0); // Coordinates in the object frame + vpPoint point(0,0,0); // Coordinates in the object frame point.track(cMo); vpServo task; diff --git a/tutorial/robot/pioneer/tutorial-simu-pioneer.cpp b/tutorial/robot/pioneer/tutorial-simu-pioneer.cpp index 6484c9a6dfc9905d2787cc3ea3e29bdd6f8aa442..32ea393472ada0097932e90f44e5dc879ffab30d 100644 --- a/tutorial/robot/pioneer/tutorial-simu-pioneer.cpp +++ b/tutorial/robot/pioneer/tutorial-simu-pioneer.cpp @@ -17,14 +17,14 @@ */ #include <iostream> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpFeatureDepth.h> -#include <visp/vpFeaturePoint.h> -#include <visp/vpHomogeneousMatrix.h> -#include <visp/vpPlot.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorPioneer.h> -#include <visp/vpVelocityTwistMatrix.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/visual_features/vpFeatureDepth.h> +#include <visp3/visual_features/vpFeaturePoint.h> +#include <visp3/core/vpHomogeneousMatrix.h> +#include <visp3/gui/vpPlot.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorPioneer.h> +#include <visp3/core/vpVelocityTwistMatrix.h> int main() { @@ -46,8 +46,7 @@ int main() robot.getPosition(wMc); wMo = wMc * cMo; - vpPoint point; - point.setWorldCoordinates(0,0,0); + vpPoint point(0,0,0); point.track(cMo); vpServo task; diff --git a/tutorial/simulator/image/CMakeLists.txt b/tutorial/simulator/image/CMakeLists.txt index 82c7927294a799d681a948189f746559a5dd3106..e2d6f97d5068e0defbe967cf9aa1756f6f286a65 100644 --- a/tutorial/simulator/image/CMakeLists.txt +++ b/tutorial/simulator/image/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-simulation-image) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_robot visp_io visp_gui) # set the list of source files set(tutorial_cpp diff --git a/tutorial/simulator/image/tutorial-image-simulator.cpp b/tutorial/simulator/image/tutorial-image-simulator.cpp index 589a6a5d2e820386cd082ca24d2c9ddf0bfd47b9..58230c127df0e8942d5ac1287fecd78124384d5b 100644 --- a/tutorial/simulator/image/tutorial-image-simulator.cpp +++ b/tutorial/simulator/image/tutorial-image-simulator.cpp @@ -1,10 +1,10 @@ //! \example tutorial-image-simulator.cpp -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpImageIo.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/io/vpImageIo.h> //! [Include] -#include <visp/vpImageSimulator.h> +#include <visp3/robot/vpImageSimulator.h> //! [Include] int main() diff --git a/tutorial/trace/CMakeLists.txt b/tutorial/trace/CMakeLists.txt index 8a220820c1749c233c54f3656bfe3c8cd5b703d8..87774e17759c5fc279f14434894d2bf9cf807a13 100644 --- a/tutorial/trace/CMakeLists.txt +++ b/tutorial/trace/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-trace) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core) # set the list of source files set(tutorial_cpp diff --git a/tutorial/trace/tutorial-trace.cpp b/tutorial/trace/tutorial-trace.cpp index 737e285510f7a0286755e99fc3d28b7d10802218..dfbe5fdfd7b8eac09c726b76f302ec35a0705b25 100644 --- a/tutorial/trace/tutorial-trace.cpp +++ b/tutorial/trace/tutorial-trace.cpp @@ -3,7 +3,7 @@ //#define VP_DEBUG // Activate the debug mode #define VP_DEBUG_MODE 2 // Activate debug level 1 and 2 -#include <visp/vpDebug.h> +#include <visp3/core/vpDebug.h> int main() { diff --git a/tutorial/tracking/blob/CMakeLists.txt b/tutorial/tracking/blob/CMakeLists.txt index e2c71499b25e1bea692313d988ed788542c8a762..961a442adc7b4a06a2ebaf965e94ffc5e946626b 100644 --- a/tutorial/tracking/blob/CMakeLists.txt +++ b/tutorial/tracking/blob/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-tracking-blob) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_blob visp_io visp_gui) # set the list of source files set(tutorial_cpp diff --git a/tutorial/tracking/blob/tutorial-blob-auto-tracker.cpp b/tutorial/tracking/blob/tutorial-blob-auto-tracker.cpp index 92e608ab9463f1c5a0f1b919f919b983239e97ac..48c4e6bc8484b71d05b85d2db2410f28f1b2fce2 100644 --- a/tutorial/tracking/blob/tutorial-blob-auto-tracker.cpp +++ b/tutorial/tracking/blob/tutorial-blob-auto-tracker.cpp @@ -1,9 +1,9 @@ //! \example tutorial-blob-auto-tracker.cpp -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDot2.h> -#include <visp/vpImageIo.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/blob/vpDot2.h> +#include <visp3/io/vpImageIo.h> int main() { diff --git a/tutorial/tracking/blob/tutorial-blob-tracker-live-firewire.cpp b/tutorial/tracking/blob/tutorial-blob-tracker-live-firewire.cpp index f893e6613466f9e296e8b48f3ded394b2071e9bb..4fb2b7550e78c4c0e30d9d6501dd081b1a8f75b3 100644 --- a/tutorial/tracking/blob/tutorial-blob-tracker-live-firewire.cpp +++ b/tutorial/tracking/blob/tutorial-blob-tracker-live-firewire.cpp @@ -1,17 +1,20 @@ //! \example tutorial-blob-tracker-live-firewire.cpp -#include <visp/vp1394CMUGrabber.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDot2.h> +#include <visp3/core/vpConfig.h> +#ifdef VISP_HAVE_MODULE_SENSOR +#include <visp3/sensor/vp1394CMUGrabber.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#endif +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/blob/vpDot2.h> int main() { -#if (defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_CMU1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100)) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) +#if (defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100)) && (defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)) vpImage<unsigned char> I; // Create a gray level image container -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vp1394TwoGrabber g(false); g.open(I); #elif defined(VISP_HAVE_CMU1394) @@ -49,7 +52,7 @@ int main() while(1) { try { -#if defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_CMU1394) +#if defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) g.acquire(I); #elif defined(VISP_HAVE_OPENCV) g >> frame; diff --git a/tutorial/tracking/blob/tutorial-blob-tracker-live-v4l2.cpp b/tutorial/tracking/blob/tutorial-blob-tracker-live-v4l2.cpp index 166682c44b0785f3767b9c76e8571dd502fb0a93..cae17dcbd23cd53e7a77c0d4cbc1366ebe6e8483 100644 --- a/tutorial/tracking/blob/tutorial-blob-tracker-live-v4l2.cpp +++ b/tutorial/tracking/blob/tutorial-blob-tracker-live-v4l2.cpp @@ -1,10 +1,13 @@ //! \example tutorial-blob-tracker-live-v4l2.cpp -#include <visp/vpV4l2Grabber.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayGTK.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDot2.h> +#include <visp3/core/vpConfig.h> +#ifdef VISP_HAVE_MODULE_SENSOR +#include <visp3/sensor/vpV4l2Grabber.h> +#endif +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayGTK.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/blob/vpDot2.h> int main() { diff --git a/tutorial/tracking/keypoint/CMakeLists.txt b/tutorial/tracking/keypoint/CMakeLists.txt index 007ac47f07dc462e359cfc4af150c34172acc0f9..f4200081520c76fa113e7dd179e662115fcddd4d 100644 --- a/tutorial/tracking/keypoint/CMakeLists.txt +++ b/tutorial/tracking/keypoint/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-tracking-keypoint) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_vision visp_klt visp_io visp_gui) # set the list of source files set(tutorial_cpp diff --git a/tutorial/tracking/keypoint/tutorial-klt-tracker-live-v4l2.cpp b/tutorial/tracking/keypoint/tutorial-klt-tracker-live-v4l2.cpp index b6f824c93f947c825d27620797060555fa60d247..05ff239c99a0b837fea518eabf21a602bd4b8be1 100644 --- a/tutorial/tracking/keypoint/tutorial-klt-tracker-live-v4l2.cpp +++ b/tutorial/tracking/keypoint/tutorial-klt-tracker-live-v4l2.cpp @@ -1,9 +1,12 @@ /*! \example tutorial-klt-tracker-live-v4l2.cpp */ -#include <visp/vpImageConvert.h> -#include <visp/vpKltOpencv.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpVideoReader.h> -#include <visp/vpV4l2Grabber.h> +#include <visp3/core/vpConfig.h> +#ifdef VISP_HAVE_MODULE_SENSOR +#include <visp3/sensor/vpV4l2Grabber.h> +#endif +#include <visp3/core/vpImageConvert.h> +#include <visp3/klt/vpKltOpencv.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpVideoReader.h> int main(int argc, const char *argv[]) { diff --git a/tutorial/tracking/keypoint/tutorial-klt-tracker-with-reinit.cpp b/tutorial/tracking/keypoint/tutorial-klt-tracker-with-reinit.cpp index 7013c0c85d20c26e2944be96a91832d4c434cb9f..aac16553ef8fd79412b331360b04d35583f8e9ef 100644 --- a/tutorial/tracking/keypoint/tutorial-klt-tracker-with-reinit.cpp +++ b/tutorial/tracking/keypoint/tutorial-klt-tracker-with-reinit.cpp @@ -1,8 +1,8 @@ //! \example tutorial-klt-tracker-with-reinit.cpp -#include <visp/vpImageConvert.h> -#include <visp/vpKltOpencv.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpVideoReader.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/klt/vpKltOpencv.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpVideoReader.h> int main() { diff --git a/tutorial/tracking/keypoint/tutorial-klt-tracker.cpp b/tutorial/tracking/keypoint/tutorial-klt-tracker.cpp index 2dbe100e663f92f949a364c93859bc21299fbca0..cb2a8c965480424ea0b93199bff08e7a7c7c0d97 100644 --- a/tutorial/tracking/keypoint/tutorial-klt-tracker.cpp +++ b/tutorial/tracking/keypoint/tutorial-klt-tracker.cpp @@ -1,9 +1,9 @@ //! \example tutorial-klt-tracker.cpp //! [Include] -#include <visp/vpImageConvert.h> -#include <visp/vpKltOpencv.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpVideoReader.h> +#include <visp3/core/vpImageConvert.h> +#include <visp3/klt/vpKltOpencv.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpVideoReader.h> //! [Include] int main(int argc, const char *argv[]) diff --git a/tutorial/tracking/model-based/edges/CMakeLists.txt b/tutorial/tracking/model-based/edges/CMakeLists.txt index fbad7e2da068c24dc39f203fcd9cd61c371ea3f5..b08bdabea1d56401f02bb593ff9e314aa53d0de0 100644 --- a/tutorial/tracking/model-based/edges/CMakeLists.txt +++ b/tutorial/tracking/model-based/edges/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-tracking-mb-edges) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_mbt visp_io visp_gui) # set the list of source files set(tutorial_cpp diff --git a/tutorial/tracking/model-based/edges/teabox.xml b/tutorial/tracking/model-based/edges/teabox.xml index 386970455ef26a3e67b3a97283d3335ef2543a44..899513062d069974a92707634db03f1fe1e2d56e 100644 --- a/tutorial/tracking/model-based/edges/teabox.xml +++ b/tutorial/tracking/model-based/edges/teabox.xml @@ -13,11 +13,10 @@ <mu1>0.5</mu1> <mu2>0.5</mu2> </contrast> + <sample> + <step>4</step> + </sample> </ecm> - <sample> - <step>4</step> - <nb_sample>250</nb_sample> - </sample> <camera> <u0>325.66776</u0> <v0>243.69727</v0> diff --git a/tutorial/tracking/model-based/edges/tutorial-mb-edge-tracker.cpp b/tutorial/tracking/model-based/edges/tutorial-mb-edge-tracker.cpp index 6d1794f166c5a41572431d4930e2860e6f9dcf43..b405654403937a34fb37c43c442c388725f7b902 100644 --- a/tutorial/tracking/model-based/edges/tutorial-mb-edge-tracker.cpp +++ b/tutorial/tracking/model-based/edges/tutorial-mb-edge-tracker.cpp @@ -1,13 +1,13 @@ //! \example tutorial-mb-edge-tracker.cpp -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> //! [Include] -#include <visp/vpMbEdgeTracker.h> +#include <visp3/mbt/vpMbEdgeTracker.h> //! [Include] -#include <visp/vpVideoReader.h> +#include <visp3/io/vpVideoReader.h> int main(int argc, char** argv) { @@ -85,7 +85,6 @@ int main(int argc, char** argv) me.setMu1(0.5); me.setMu2(0.5); me.setSampleStep(4); - me.setNbTotalSample(250); tracker.setMovingEdge(me); cam.initPersProjWithoutDistortion(839, 839, 325, 243); tracker.setCameraParameters(cam); @@ -104,6 +103,7 @@ int main(int argc, char** argv) } //! [Set ogre] tracker.setOgreVisibilityTest(false); + tracker.setOgreShowConfigDialog(false); //! [Set ogre] //! [Load cao] if(vpIoTools::checkFilename(objectname + ".cao")) @@ -144,14 +144,19 @@ int main(int argc, char** argv) #ifdef VISP_HAVE_XML2 vpXmlParser::cleanup(); #endif -#if defined(VISP_HAVE_COIN) && (COIN_MAJOR_VERSION == 3) +#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3) SoDB::finish(); #endif //! [Cleanup] } catch(vpException e) { - std::cout << "Catch an exception: " << e << std::endl; + std::cout << "Catch a ViSP exception: " << e << std::endl; } +#ifdef VISP_HAVE_OGRE + catch(Ogre::Exception e) { + std::cout << "Catch an Ogre exception: " << e.getDescription() << std::endl; + } +#endif #else (void)argc; (void)argv; diff --git a/tutorial/tracking/model-based/generic/CMakeLists.txt b/tutorial/tracking/model-based/generic/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..0786938d116ba609b3d6721b1d7657b635ce8c05 --- /dev/null +++ b/tutorial/tracking/model-based/generic/CMakeLists.txt @@ -0,0 +1,29 @@ +project(tutorial-tracking-mb) + +cmake_minimum_required(VERSION 2.6) + +find_package(VISP REQUIRED visp_core visp_mbt visp_io visp_gui) + +# set the list of source files +set(tutorial_cpp + tutorial-mb-tracker.cpp + tutorial-mb-tracker-full.cpp) + +list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/teabox.mpg" ) +list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/teabox.cao" ) +list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/teabox.init" ) +list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/teabox.ppm" ) +list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/teabox.wrl" ) +list(APPEND tutorial_data "${CMAKE_CURRENT_SOURCE_DIR}/teabox.xml" ) + +foreach(cpp ${tutorial_cpp}) + visp_add_target(${cpp}) + if(COMMAND visp_add_dependency) + visp_add_dependency(${cpp} "tutorials") + endif() +endforeach() + +# Copy the data files to the same location than the target +foreach(data ${tutorial_data}) + visp_copy_data(tutorial-mb-tracker.cpp ${data}) +endforeach() diff --git a/tutorial/tracking/model-based/generic/teabox.cao b/tutorial/tracking/model-based/generic/teabox.cao new file mode 100644 index 0000000000000000000000000000000000000000..83c1fdf783e68e78dfa381d4c326f07d88fa8d3f --- /dev/null +++ b/tutorial/tracking/model-based/generic/teabox.cao @@ -0,0 +1,27 @@ +V1 +# 3D Points +8 # Number of points +0 0 0 # Point 0: X Y Z +0 0 -0.08 +0.165 0 -0.08 +0.165 0 0 +0.165 0.068 0 +0.165 0.068 -0.08 +0 0.068 -0.08 +0 0.068 0 # Point 7 +# 3D Lines +0 # Number of lines +# Faces from 3D lines +0 # Number of faces +# Faces from 3D points +6 # Number of faces +4 0 1 2 3 # Face 0: [number of points] [index of the 3D points]... +4 1 6 5 2 +4 4 5 6 7 +4 0 3 4 7 +4 5 4 3 2 +4 0 7 6 1 # Face 5 +# 3D cylinders +0 # Number of cylinders +# 3D circles +0 # Number of circles diff --git a/tutorial/tracking/model-based/generic/teabox.init b/tutorial/tracking/model-based/generic/teabox.init new file mode 100644 index 0000000000000000000000000000000000000000..f109800a0eab96b97050f4872839f09b0a0c2bd3 --- /dev/null +++ b/tutorial/tracking/model-based/generic/teabox.init @@ -0,0 +1,5 @@ +4 # Number of points +0 0 0 # Point 0 +0.165 0 0 # Point 3 +0.165 0 -0.08 # Point 2 +0.165 0.068 -0.08 # Point 5 diff --git a/tutorial/tracking/model-based/generic/teabox.mpg b/tutorial/tracking/model-based/generic/teabox.mpg new file mode 100644 index 0000000000000000000000000000000000000000..50fb8ad2d9e245e2bcc06b94d22763a07d9b6191 Binary files /dev/null and b/tutorial/tracking/model-based/generic/teabox.mpg differ diff --git a/tutorial/tracking/model-based/generic/teabox.ppm b/tutorial/tracking/model-based/generic/teabox.ppm new file mode 100644 index 0000000000000000000000000000000000000000..b20630a2d581c73b63e358e21c3892c4dbc9897f --- /dev/null +++ b/tutorial/tracking/model-based/generic/teabox.ppm @@ -0,0 +1,5 @@ +P6 +# CREATOR: GIMP PNM Filter Version 1.1 +320 240 +255 +GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGNNNGGGNNNNNNGGGNNNNNNNNNNNNNNNNNNNNNNNNNNNVVVNNNNNNVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^^^^^^^VVV^^^^^^^^^^^^^^^NNNNNNNNNNNNNNNNNNVVVNNNVVVNNNVVVNNNVVVNNNVVVNNNVVVNNNVVVNNNVVVNNNVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVVVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVNNNVVVVVVVVVNNNVVVNNNNNNVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEGGGEEEEEEEEEEEEEEEEEEGGGGGGGGGNNNGGGNNNGGGNNNGGGNNNGGGNNNGGGNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNVVVVVVNNNVVVNNNVVVVVVNNNVVVVVVVVV^^^VVV^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^VVVNNNNNNNNNNNNVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNVVVVVVVVVVVV^^^VVVVVV^^^VVVVVVVVVVVVNNNVVVVVVVVVVVVVVVVVV^^^^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^^^^^^^^^^^^^fff^^^fffffffff^^^ffffff^^^fff^^^^^^fff^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^ffffff^^^fff^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^^^^^^^VVV^^^^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVVVVVVVNNNVVVVVVNNNVVVVVVNNNVVVNNNVVVNNNVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGGGGNNNNNNGGGNNNNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEGGGEEEGGGEEEEEEEEEEEEGGGNNNNNNNNNNNNGGGNNNNNNNNNGGGNNNNNNNNNGGGNNNGGGGGGGGGNNNGGGVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^VVVNNNNNNNNNVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVV^^^VVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^ffffff^^^fff^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^fff^^^ffffff^^^ffffff^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^^^^^^^fff^^^^^^fff^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVV^^^VVVVVVVVVVVV^^^VVVVVVVVVVVV^^^VVVVVVVVVVVVVVV^^^VVV^^^VVVVVVVVV^^^VVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNNNNNNNNNNNNNVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGGGGGGGGGGGGGNNNGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEENNNNNNGGGNNNNNNNNNNNNNNNNNNNNNNNNEEE============EEEEEEEEEEEEGGGGGGNNNNNNNNNVVVVVVVVVVVVNNNVVVVVVVVVVVVVVV^^^VVV^^^^^^^^^^^^^^^fff^^^^^^^^^ffffff^^^VVVNNNNNNNNNVVVNNNVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVVVV^^^VVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^fff^^^ffffff^^^^^^^^^fff^^^^^^fff^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^ffffff^^^ffffff^^^fff^^^fff^^^ffffff^^^ffffff^^^^^^^^^fff^^^^^^fff^^^^^^^^^^^^^^^fff^^^^^^^^^^^^fff^^^fff^^^fff^^^^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVV^^^VVV^^^VVV^^^^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVNNNVVVNNNVVVNNNNNNVVVNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGGGGGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEGGGEEEGGGGGGGGGEEEEEENNNNNNNNNNNNNNNNNNNNNNNNNNNEEE===333333333333333333333333333333333333===EEEGGGVVVVVVNNNEEEEEEGGGGGGNNNVVVNNNNNNVVV^^^^^^^^^^^^^^^fff^^^^^^^^^fff^^^NNNNNNVVVNNNNNNVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVV^^^VVV^^^VVVVVVVVVVVV^^^VVV^^^^^^VVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^fff^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^fff^^^^^^ffffff^^^^^^fff^^^ffffff^^^fff^^^fff^^^^^^^^^^^^fff^^^ffffff^^^ffffffffffff^^^fff^^^fff^^^fff^^^^^^fff^^^fff^^^ffffff^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^fff^^^fff^^^fff^^^fff^^^fff^^^^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVV^^^VVVVVVVVVVVVVVV^^^VVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVV^^^VVVVVVVVVVVVNNNVVVVVVNNNVVVVVVVVVVVVVVVVVVNNNVVVVVVNNNVVVNNNVVVNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGGGGNNNGGGNNNGGGNNNGGGGGGGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGEEEGGGGGGGGGGGGGGGEEENNNNNNNNNVVVVVVNNNVVVNNNGGG333===EEEGGGGGGEEE===333---""""""---===GGGVVVNNN333333===333EEEVVVNNNEEEVVV^^^^^^^^^fff^^^^^^fff^^^fff^^^^^^VVVNNNNNNVVVNNNVVVVVVNNNVVVNNNVVVVVVNNNVVVVVVVVVVVVVVVVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVV^^^VVV^^^VVVVVVVVVVVV^^^VVV^^^VVV^^^^^^VVV^^^VVV^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ffffff^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^^^^fff^^^fff^^^^^^fff^^^ffffff^^^fff^^^fff^^^^^^^^^^^^^^^fff^^^fffffffff^^^fff^^^ffffff^^^fff^^^fff^^^ffffffffffffffffff^^^ffffff^^^fff^^^fff^^^fff^^^fff^^^^^^^^^fff^^^fff^^^fff^^^fff^^^fff^^^fff^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^VVV^^^VVVVVV^^^VVVVVVVVVVVVVVV^^^VVVVVVVVVVVV^^^VVVVVV^^^VVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVVVVNNNVVVVVVVVVNNNNNNVVVNNNVVVVVVNNNVVVNNNNNNNNNNNNNNNVVVNNNVVVNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNGGGGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGEEEGGGGGGGGGGGGEEEEEEEEEEEEGGGEEENNNVVVNNNNNNVVVVVVNNNNNNEEEEEEGGGNNNNNNNNNNNNNNNEEE333"""---EEENNNGGG333------333===VVVVVVGGGGGGVVVfff^^^fff^^^fffffffffffffff^^^NNNVVVNNNVVVVVVNNNVVVNNNVVVVVVNNNVVVVVVVVVNNNVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVVVVV^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^fff^^^fff^^^^^^^^^^^^^^^^^^fff^^^^^^^^^fff^^^^^^^^^fff^^^^^^fff^^^^^^ffffff^^^^^^^^^fff^^^fff^^^^^^fff^^^^^^^^^^^^fff^^^fff^^^fffffffffffffff^^^fff^^^fff^^^fff^^^ffffffffffff^^^fff^^^fff^^^fff^^^^^^fff^^^fff^^^fff^^^fff^^^fff^^^fff^^^fff^^^fff^^^ffffff^^^fff^^^fff^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVVVVVVVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVV^^^VVVVVV^^^VVVVVVVVVVVVNNNVVVNNNVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVNNNVVVNNNNNNVVVVVVVVVNNNNNNVVVNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEGGGGGGEEEGGGGGGGGGEEEEEEEEEEEEGGGEEENNNVVVVVVVVVNNNVVVVVVNNNGGGVVVVVVVVVVVVVVVVVVVVVGGG333""""""333EEE333"""---"""---===VVV^^^VVVGGGVVVffffff^^^fffffffffffffffffffffNNNVVVVVVNNNVVVVVVNNNVVVNNNVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVV^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^fff^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^^^^^^^fff^^^^^^fff^^^^^^^^^fff^^^^^^fff^^^fff^^^fffffffff^^^^^^^^^^^^fff^^^fff^^^fff^^^^^^fff^^^fffffffffffffffffffff^^^fff^^^fffffffff^^^ffffffffffff^^^fffffffff^^^fff^^^fff^^^ffffff^^^fff^^^fffffffff^^^fff^^^fff^^^fff^^^fff^^^fff^^^fff^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^^^^^^^^^^VVV^^^VVV^^^VVVVVVVVV^^^VVVVVVVVV^^^VVV^^^^^^^^^VVV^^^VVVVVVVVVVVVVVVNNNVVVVVVVVVNNNVVVNNNVVVVVVVVVNNNVVVNNNNNNNNNVVVNNNNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEVVVNNNVVVVVVVVVNNNNNNNNNVVVVVVVVVVVVVVVVVVNNNGGG===---"""""""""""""""---EEEVVVNNNGGGEEE^^^^^^ffffffffffffffffffffffff^^^NNNVVVNNNVVVVVVVVVVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVVVVV^^^VVVVVV^^^VVV^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^fffffffff^^^fff^^^fff^^^^^^fff^^^^^^^^^fff^^^fff^^^ffffff^^^fff^^^fff^^^^^^fff^^^fff^^^^^^fff^^^^^^ffffff^^^fff^^^ffffff^^^fff^^^fff^^^fffffffffffffff^^^fff^^^fff^^^ffffff^^^^^^ffffff^^^fff^^^fff^^^fff^^^fff^^^ffffff^^^fff^^^^^^fff^^^fff^^^ffffff^^^fff^^^fff^^^fff^^^fff^^^^^^fff^^^fff^^^^^^^^^fff^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVV^^^VVVVVVNNNVVVVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNNNNNNNVVVNNNVVVNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGNNNNNNGGGNNNGGGGGGGGGGGGGGGGGGNNNGGGGGGGGGGGGGGGEEEGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEVVVVVVVVVNNNVVVVVVNNNNNNGGGNNNVVVVVVNNNNNN===---""""""""""""---===EEE======NNN^^^ffffffffffffffffffffffffppp^^^NNNVVVNNNVVVVVVNNNVVVNNNVVVNNNVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVV^^^VVV^^^^^^VVVVVV^^^VVVVVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^fff^^^fff^^^fff^^^^^^ffffff^^^fff^^^^^^fff^^^fff^^^fff^^^ffffff^^^fffffffff^^^fff^^^fff^^^ffffffffffff^^^^^^fff^^^ffffffffffffffffff^^^fff^^^ffffff^^^ffffffffffffffffff^^^fff^^^^^^fff^^^fff^^^^^^fffffffffffffff^^^ffffff^^^fff^^^ffffff^^^fffffffff^^^fff^^^fff^^^^^^fff^^^ffffff^^^fff^^^fff^^^^^^fff^^^^^^^^^^^^^^^fff^^^^^^VVV^^^^^^^^^VVV^^^VVV^^^VVV^^^VVVVVVVVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNVVVVVVNNNVVVVVVNNNVVVVVVVVVNNNNNNVVVNNNNNNNNNVVVNNNVVVNNNNNNNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGGGGGGGNNNGGGGGGGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGEEEGGGGGGGGGGGGGGGGGGGGGEEEEEEGGGEEEVVVVVVVVVVVVVVVVVVNNNEEEEEEEEEGGGGGGEEE---""""""333---""""""333---""""""---333EEEGGGNNNfffffffffffffffffffffffffffpppffffffNNNNNNVVVVVVVVVNNNVVVNNNVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^^^^VVV^^^^^^^^^^^^VVV^^^VVVVVVVVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^fff^^^^^^^^^^^^fff^^^ffffff^^^fff^^^ffffff^^^ffffff^^^fff^^^^^^^^^^^^^^^fff^^^fff^^^fffffffffffffff^^^fffffffff^^^fff^^^fffffffffffffffffffffffffffffffff^^^ffffff^^^fff^^^fff^^^ffffff^^^fffffffff^^^fff^^^fff^^^ffffff^^^ffffff^^^ffffff^^^ffffff^^^fff^^^fffffffffffffff^^^fff^^^ffffff^^^fff^^^ffffff^^^fff^^^fff^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^VVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVVNNNVVVVVVNNNVVVNNNVVVNNNVVVVVVNNNVVVVVVNNNVVVNNNVVVNNNVVVNNNVVVNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGGGGNNNGGGGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEGGGGGGGGGEEEGGGEEEEEEEEEVVVVVV^^^VVV^^^VVVNNNEEE===333===333""""""---333---===333===---"""------""""""333EEEGGGVVV^^^fffffffffffffffffffffpppfffpppfffppp^^^NNNNNNVVVNNNVVVVVVVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVV^^^VVV^^^VVVVVV^^^VVVVVV^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^ffffff^^^fff^^^ffffff^^^ffffff^^^fffffffff^^^fffffffffffffffffffffffffffffffff^^^fff^^^ffffff^^^ffffffffffffffffffffffffffffff^^^ffffff^^^fff^^^ffffffffffffffffffffffff^^^^^^ffffff^^^fffffffffffffff^^^ffffff^^^ffffff^^^ffffffffffff^^^ffffff^^^ffffff^^^fff^^^fff^^^ffffff^^^^^^^^^fff^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVVVVVVVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVNNNVVVVVVNNNVVVNNNVVVNNNVVVNNNNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNGGGNNNNNNGGGNNNGGGNNNGGGGGGGGGGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEE^^^VVVVVV^^^VVV^^^VVVEEE333------"""""""""""""""""""""---EEEEEE======GGGVVV^^^ffffffffffffpppfffpppfffpppffffffGGGNNNNNNVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVV^^^VVVVVV^^^VVV^^^VVV^^^VVV^^^^^^VVV^^^VVV^^^VVV^^^^^^VVV^^^VVV^^^^^^VVV^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^ffffff^^^fff^^^ffffff^^^ffffff^^^fff^^^fff^^^fff^^^fff^^^^^^^^^fff^^^fff^^^fff^^^ffffffffffffffffff^^^ffffffffffffffffff^^^ffffffffffffffffffffffff^^^ffffff^^^ffffff^^^fff^^^fff^^^fffffffffffffff^^^fff^^^ffffffffffffffffff^^^fff^^^ffffff^^^ffffffffffff^^^ffffffffffffffffff^^^ffffff^^^fffffffff^^^^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVV^^^VVV^^^VVVVVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVNNNVVVNNNVVVNNNVVVNNNVVVNNNNNNVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEVVV^^^^^^^^^VVVVVVVVVEEE333---"""""""""""""""333333---""""""333NNN^^^ffffffpppfffpppfffppppppppp^^^NNNNNNNNNVVVNNNVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVV^^^^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^VVV^^^VVV^^^^^^^^^^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^fff^^^fff^^^fff^^^ffffff^^^fffffffff^^^fff^^^ffffff^^^fff^^^fffffffffffffffffffffffffffffffff^^^fffffffffffffffffffffffffffffffffffffffffffffffffff^^^fff^^^fffffffff^^^ffffffffffffffffffffffffffffffffffffffffffffffffffffff^^^ffffff^^^fff^^^fffffffffffffffffffffffffff^^^ffffff^^^ffffff^^^fff^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^VVV^^^VVV^^^VVVVVVVVVVVV^^^VVV^^^VVV^^^VVVVVVVVVVVV^^^VVVVVV^^^VVVVVVVVVVVVNNNVVVVVVVVVVVVVVVNNNNNNVVVNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNNNNNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEVVV^^^VVV^^^^^^VVVVVVGGG===---"""""""""---""""""333EEE333"""---VVVpppfffpppfffppppppfffpppffffffGGGNNNVVVNNNNNNVVVNNNVVVNNNVVVVVVVVVVVVNNNVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^^^^VVVVVV^^^VVVVVV^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^fff^^^fff^^^fff^^^ffffffffffff^^^fff^^^^^^fff^^^fff^^^ffffff^^^fff^^^fff^^^^^^fff^^^ffffffffffffffffffffffffffffffffffff^^^ffffff^^^ffffffffffffffffffffffffffffffffffffffffffffffffffffffpppfffffffffffffffffffffffffff^^^fffffffffffffffffffffffffff^^^fffffffff^^^fffffffffffffffffffff^^^fff^^^fff^^^fff^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^VVV^^^VVV^^^^^^VVV^^^VVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVNNNVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNNNNGGGNNNNNNGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEGGGGGGGGGGGGGGGGGGGGGEEEEEEEEE^^^VVV^^^^^^^^^^^^VVVVVVGGG===""""""""""""EEEEEE---"""333EEEGGG---"""333^^^fffpppfffppppppppppppfffppp^^^GGGNNNNNNVVVNNNVVVNNNVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVV^^^VVV^^^VVVVVV^^^^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^fff^^^fffffffff^^^ffffff^^^ffffffffffff^^^ffffff^^^ffffff^^^ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff^^^fffffffffffffffffffffffffffffffffffffffffffffffffffpppfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff^^^fff^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^^^^^^^VVV^^^^^^VVV^^^^^^^^^VVVVVVVVV^^^VVVVVVVVVVVV^^^VVVVVVVVVNNNNNNVVVNNNVVVNNNVVVNNNVVVNNNNNNVVVNNNNNNNNNVVVNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGGGGNNNNNNGGGGGGGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG^^^^^^^^^^^^^^^^^^^^^^^^VVVNNN===------======"""""""""---===VVVGGG------======"""GGGfffpppfffpppfffpppppppppppppppfffGGGNNNVVVNNNVVVNNNVVVNNNVVVVVVNNNVVVNNNVVVVVVVVVVVV^^^VVVVVV^^^VVVVVV^^^^^^VVV^^^^^^VVV^^^VVV^^^VVVVVVVVVVVV^^^VVV^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^fffffffff^^^ffffffffffffffffffffffffffffff^^^fffffffffffffff^^^fff^^^fffffffffffffffffffffffffff^^^ffffffffffffffffffffffffpppfffffffffffffffffffffffffffpppffffffffffff^^^ffffffffffffpppffffffpppfffffffffffffffffffffffffffpppfffffffffffffff^^^fff^^^ffffff^^^ffffffffffff^^^fff^^^ffffff^^^fff^^^fff^^^fff^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVVVVV^^^VVV^^^^^^VVV^^^^^^VVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNVVVNNNVVVNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGNNNGGGGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG^^^^^^^^^^^^^^^^^^fff^^^^^^VVVVVV==="""333GGGGGG===333333EEEVVV^^^GGG---333---^^^pppfffpppppppppfffpppppppppffffffGGGGGGVVVNNNVVVNNNVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVV^^^VVV^^^^^^^^^VVV^^^^^^^^^VVV^^^VVV^^^^^^VVV^^^VVV^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^^^^fff^^^^^^^^^^^^fff^^^fffffffff^^^ffffffffffffffffff^^^ffffffffffffffffffffffffffffff^^^fff^^^ffffffffffffffffffffffffffffffffffffffffffffffffpppfffffffffpppfffffffffppppppfffpppfffpppffffffffffff^^^ffffffffffffffffffffffffffffffffffffffffffffffffffffffpppffffffffffffffffffffffff^^^fffffffffffffff^^^^^^ffffff^^^fff^^^fff^^^fff^^^fff^^^fff^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVVVVV^^^VVV^^^VVVVVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNVVVNNNNNNVVVVVVVVVNNNNNNNNNNNNVVVNNNNNNVVVNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGGGGGGGGGGGGGEEEEEEEEEGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEGGGGGGGGGGGGGGGGGGGGGEEEGGG^^^^^^^^^^^^fff^^^^^^^^^fff^^^^^^NNN---"""======EEE======EEENNN^^^^^^===GGGfffppppppfffppppppppppppppppppppp^^^GGGGGGNNNVVVVVVVVVNNNVVVVVVVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^^^^VVV^^^VVV^^^VVV^^^^^^^^^VVV^^^VVVVVV^^^VVV^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^fff^^^^^^fff^^^^^^fff^^^ffffffffffffffffff^^^fff^^^ffffff^^^ffffff^^^fffffffffffffff^^^ffffff^^^ffffffffffff^^^fffffffffffffffffffffffffffpppffffffffffffpppfffpppffffffffffffpppfffffffffffffffffffffffffffffffffpppfffffffffffffffffffffffffffffffffffffffffffffffffffpppffffffffffff^^^ffffff^^^fff^^^fffffffff^^^^^^^^^fff^^^^^^^^^fff^^^^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^VVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNNNNNNNNNNNNNNNNNNNVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNVVVNNNNNNGGGNNNNNNGGGNNNGGGNNNNNNGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGEEEEEEGGGEEEGGGGGGGGGGGGGGGGGGEEEEEEEEEGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG^^^^^^fff^^^^^^^^^^^^fff^^^fff^^^VVVEEE333333======EEEEEEGGGVVV^^^^^^333333^^^pppppppppppppppppppppppppppppppppfffEEEGGGNNNVVVNNNVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVV^^^^^^^^^VVV^^^^^^^^^VVV^^^^^^VVV^^^^^^^^^VVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^fff^^^^^^fff^^^ffffffffffff^^^fffffffffffffff^^^fff^^^fffffffffffffffffffffffffffffffffffffff^^^ffffffffffffpppfffffffffffffffpppfffffffffpppffffffffffffpppfffpppfffppppppfffpppfffpppffffffffffffffffffffffffffffff^^^ffffffpppffffffpppffffffffffffffffffffffffpppffffffffffff^^^fff^^^fffffffff^^^fffffffff^^^^^^^^^fff^^^fff^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVVVVVVVV^^^VVV^^^VVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNNNNVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNGGGNNNGGGNNNNNNNNNGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEGGGEEEEEEGGGEEEGGGGGGGGGGGGGGG^^^fff^^^ffffffffffff^^^fff^^^fff^^^VVVGGGEEE======EEEEEEGGGVVVVVV^^^NNNEEE"""===---"""NNNppppppfffpppppppppppppppppppppppppppfffEEEGGGNNNNNNVVVNNNVVVNNNVVVVVVVVVVVVNNNVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVV^^^VVV^^^^^^VVV^^^^^^VVV^^^^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^^^^^^^^^^fff^^^^^^^^^fff^^^fffffffff^^^ffffff^^^fff^^^ffffff^^^fffffffffffffffffffff^^^fff^^^fff^^^ffffff^^^ffffffffffff^^^fffffffff^^^^^^ffffffffffff^^^fffffffffffffffpppfffpppfffpppfffffffffffffffffffffpppfffpppffffffpppfffffffffpppfffpppfffffffffffffffpppfffpppffffffffffffffffffffffffpppffffffpppfffffffffffffff^^^^^^ffffffffffff^^^fffffffff^^^^^^^^^^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNNNNGGGNNNNNNGGGGGGNNNNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEGGGfffffffff^^^fff^^^fffffffffffffffffffff^^^VVVNNNGGGGGGNNNVVV^^^^^^fff^^^^^^GGG---333VVVNNNEEE===EEENNNpppfffppppppppppppppppppppppppppppppwwwfffEEEEEENNNNNNNNNVVVNNNVVVVVVVVVNNNVVVVVVVVVVVVVVVVVVVVV^^^VVVVVV^^^VVV^^^VVV^^^VVV^^^^^^^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^fff^^^fff^^^ffffff^^^fffffffffffffffffffffffffff^^^fffffffff^^^fff^^^fffffffffffffffffffffffffffffffff^^^ffffffffffffffffff^^^fffffffffffffffpppfffpppffffffpppffffffffffffpppfffpppfffpppffffffpppffffffffffffffffffpppfffpppffffffffffffpppfffpppfffffffffffffffffffffpppffffffffffffffffffffffff^^^ffffff^^^ffffff^^^fff^^^fff^^^fff^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVV^^^^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVNNNVVVVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNNNNNNNGGGNNNNNNGGGGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGG^^^fffffffffffffffffffff^^^fffffffffffffff^^^fff^^^^^^fff^^^fffffffffffffff^^^NNNGGGVVVffffff^^^^^^ffffffppppppppppppppppppppppppppppppwwwwwwwwwfffEEEEEEGGGNNNVVVNNNVVVNNNVVVVVVVVVVVVNNNVVVVVVVVV^^^VVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^^^^^^^^^^fff^^^fff^^^^^^fff^^^^^^fffffffff^^^ffffffffffff^^^ffffffffffffffffffffffffffffff^^^ffffff^^^fff^^^ffffffffffffffffffffffffffffff^^^ffffffffffff^^^ffffff^^^fffffffffffffffpppfffpppffffffpppfffffffffpppfffpppfffpppfffffffffpppfffffffffpppfffpppfffpppfffpppffffffffffffffffffffffffpppfffffffffffffffffffffffffffffffff^^^fff^^^fffffffffffffff^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^VVV^^^VVV^^^VVVVVV^^^^^^^^^VVVVVVVVVVVVVVVVVVNNNVVVVVVNNNVVVNNNVVVVVVNNNVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGGGGNNNGGGGGGNNNGGGNNNGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEGGGGGGEEEEEEGGGGGGGGGEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEffffffffffffffffff^^^ffffffffffffffffffffffffffffffffffffffffffpppffffffffffff^^^ffffffppppppppppppppppppppppppppppppppppppppppppwwwpppwwwpppwwwfffEEEEEENNNNNNNNNNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVV^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^fff^^^fffffffff^^^ffffffffffffffffffffffffffffff^^^ffffff^^^fffffffffffffffffffffffffffffffffffffffffffff^^^ffffffffffffffffffffffffffffffffffffpppfffpppfffpppffffffpppffffffpppfffpppfffpppfffpppffffffpppffffffpppfffpppffffffffffffffffffffffffpppfffpppfffffffffffffffpppffffffffffff^^^ffffff^^^fff^^^fff^^^ffffffffffff^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^VVV^^^VVV^^^VVVVVVVVV^^^VVVVVVVVVVVVVVVVVVVVVNNNVVVNNNNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGNNNGGGNNNGGGGGGGGGNNNGGGGGGGGGGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEfffffffffVVV^^^ffffffffffffffffffpppfffpppffffffpppfffffffffpppfffpppfffpppfffpppfffpppfffpppffffffpppppppppppppppppppppppppppwwwwwwwwwpppwwwwwwppp======GGGNNNNNNNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVV^^^VVVVVV^^^VVV^^^VVV^^^VVV^^^^^^VVV^^^^^^VVV^^^VVV^^^^^^^^^^^^^^^fff^^^^^^^^^fff^^^^^^ffffff^^^ffffff^^^ffffffffffffffffffffffffffffffffffff^^^ffffffffffffffffffffffffffffffffffffpppfffffffffffffffffffffffffffffffffffffffffffffffffffffffffpppfffffffffffffffffffffpppfffpppfffpppfffpppffffffpppfffffffffffffffppppppfffpppffffffffffffffffffpppfffffffffffffffffffffffffffffffffffffffffffff^^^ffffff^^^fffffffffffffff^^^ffffff^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^VVV^^^^^^VVV^^^VVVVVVVVVVVV^^^VVV^^^VVV^^^VVVVVVNNNVVVNNNVVVNNNNNNNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNNNNNNNGGGNNNGGGNNNNNNGGGNNNGGGGGGGGGNNNGGGNNNGGGGGGGGGGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEfffffffffGGGNNNffffffffffffpppffffffpppfffffffffffffffpppfffpppfffpppfffpppfffpppfffpppfffVVVVVVfffpppppppppwwwppppppwwwpppwwwwwwpppwwwwwwwwwpppfff======GGGNNNNNNNNNVVVVVVNNNVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVV^^^VVVVVV^^^VVV^^^VVVVVV^^^VVV^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^fff^^^fff^^^ffffff^^^ffffff^^^fff^^^^^^ffffff^^^ffffffffffff^^^ffffffffffffffffffffffffpppffffffffffffffffffffffffffffffffffffpppffffffpppffffffpppfffppppppfffpppfffpppfffpppfffpppffffffpppfffpppfffpppfffpppffffffpppfffpppfffffffffpppffffffffffffpppfffffffffffffffpppfffpppfffffffffffffffffffff^^^ffffff^^^ffffffffffffffffffffffffffffff^^^ffffff^^^^^^fff^^^fff^^^^^^^^^fff^^^^^^^^^^^^^^^^^^VVV^^^^^^VVV^^^VVV^^^VVV^^^^^^VVVVVVVVVVVVVVVVVVVVVNNNVVVNNNVVVNNNNNNNNNNNNNNNVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNGGGNNNNNNNNNGGGNNNNNNGGGGGGNNNGGGGGGGGGGGGGGGNNNGGGGGGNNNGGGGGGGGGGGGNNNGGGGGGGGGGGGGGGEEEEEEGGGEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEfffppp^^^===VVVfff^^^^^^^^^^^^fffffffff^^^^^^^^^fff^^^ffffff^^^^^^fffffffffpppffffffffffffGGGGGGpppppppppwwwppppppppppppffffffwwwwwwwwwwwwwwwwwwfff======GGGGGGNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^fff^^^ffffff^^^fffffffff^^^ffffff^^^ffffff^^^ffffff^^^fff^^^fff^^^ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffpppfffpppfffpppfffpppfffpppffffffffffffpppfffppppppfffpppfffpppfffpppfffffffffpppfffpppfffpppfffffffffpppfffffffffffffffpppffffffffffffffffffffffffffffffffffffffffffffffffffffff^^^fffffffffffffff^^^fff^^^fff^^^fff^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^VVVVVVVVVVVVVVV^^^VVVVVV^^^VVVVVVVVVNNNVVVVVVNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNGGGNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNGGGNNNGGGNNNGGGGGGNNNGGGGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEGGGEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGEEEEEEEEEEEEEEEEEEffffff^^^===VVVVVVNNNVVVVVVNNNNNNfffVVVNNNVVVNNNGGGVVVfffNNNVVVVVVVVVNNN^^^fffVVVNNN^^^VVV===GGG^^^VVVppppppVVV^^^^^^^^^VVVpppwwwwwwwwwwwwwwwwwwfff======GGGNNNNNNNNNNNNNNNVVVNNNVVVVVVVVVVVVVVVVVVVVV^^^VVVVVV^^^VVV^^^VVVVVV^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^^^^ffffff^^^fffffffff^^^ffffff^^^^^^^^^^^^^^^fff^^^ffffff^^^ffffffffffff^^^fff^^^ffffffffffffffffffffffffpppfffffffffpppfffpppffffffffffffpppfffppppppfffpppfffpppfffppppppfffpppfffpppfffppppppfffppppppfffpppfffpppffffffpppfffpppfffpppfffpppffffffpppffffffpppfffffffffpppffffffffffffffffffpppffffffffffffffffffffffffffffffffffff^^^ffffff^^^fff^^^fff^^^fff^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVVVVV^^^VVV^^^VVVVVVVVV^^^VVVVVVVVVNNNVVVVVVVVVVVVVVVVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNNNNNNNNNNGGGNNNGGGNNNGGGGGGNNNGGGGGGGGGNNNGGGGGGGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEGGGEEEEEEEEEEEEEEEGGGGGGEEEEEEGGGEEEEEEEEEGGGGGGppppppVVV===NNNEEEVVVfff^^^GGGNNNVVVEEEVVVfff^^^EEEGGGNNNGGG^^^fffVVVEEE^^^NNNEEE^^^ffffffEEENNNVVVGGGfffVVVGGGfffpppfffpppwwwwwwwwwwwwwwwwwwwwwppp333===EEEGGGNNNNNNNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVV^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^ffffff^^^fff^^^ffffffffffff^^^fffffffff^^^fff^^^^^^fff^^^ffffff^^^ffffffffffffffffffffffffffffffffffffffffffffffffpppffffffffffffpppffffffffffffpppfffppppppfffffffffpppffffffpppfffpppfffffffffpppfffpppfffpppfffpppfffpppffffffpppfffpppfffpppfffpppfffffffffffffffpppfffpppffffffpppffffffffffffffffffpppfffpppffffffffffffffffffffffffffffff^^^fff^^^fff^^^fff^^^fff^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVVVVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVNNNNNNVVVNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNGGGNNNGGGNNNGGGGGGGGGNNNGGGNNNGGGNNNGGGGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEGGGEEEEEEEEEGGGEEEpppfffVVV===GGG===fffpppfffGGG^^^NNNGGGfffpppfffEEEGGGEEENNNppppppVVVEEE^^^EEEGGGpppppppppEEEGGGVVVEEE^^^EEEVVVwwwwwwwwwwwwwwwwwwwwwfff333333EEEGGGNNNNNNNNNNNNVVVVVVVVVVVVVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVV^^^VVVVVV^^^VVV^^^VVVVVV^^^VVV^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^fffffffff^^^fffffffff^^^ffffff^^^^^^fff^^^^^^fff^^^ffffff^^^fffffffff^^^ffffffffffffffffffffffffpppfffffffffffffffpppfffffffffffffffffffffffffffpppfffpppffffffpppfffpppfffpppfffpppfffpppfffpppfffppppppfffpppfffpppfffpppfffpppfffffffffpppfffpppfffpppfffffffffpppfffpppffffffpppfffpppfffpppfffffffffpppffffffffffffffffff^^^fff^^^fff^^^ffffff^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVNNNVVVNNNNNNVVVNNNNNNNNNNNNVVVNNNNNNGGGNNNNNNGGGNNNNNNNNNGGGNNNNNNNNNGGGNNNGGGNNNGGGGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGEEEEEEEEEGGGppppppNNNEEENNNGGGfffwwwNNNfffVVVVVVppppppfff===NNNEEENNNfffpppGGGGGG^^^===VVVppppppfffEEENNNNNNEEEVVVEEE^^^wwwwwwwwwwwwwwwwwwwwwppp333333GGGGGGNNNNNNNNNNNNVVVNNNVVVNNNVVVVVVNNNVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVVVVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ffffff^^^ffffffffffffffffff^^^ffffff^^^ffffff^^^ffffff^^^fff^^^fffffffffffffffffffffffffffffffffffffffffffffffffffpppfffffffffffffffffffffpppfffffffffpppfffpppffffffffffffpppfffpppfffpppffffffpppfffpppfffpppppppppfffpppfffpppfffpppfffppppppffffffpppfffpppfffffffffffffffpppffffffpppffffffpppfffpppfffpppfffffffffffffffffffffffffffffffffffffff^^^fff^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^VVVVVV^^^VVV^^^VVVVVVVVVVVVVVVNNNVVVNNNVVVVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNGGGNNNNNNNNNGGGNNNNNNGGGNNNGGGGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGppppppNNNNNNfffVVVfffpppNNNwwwwww^^^pppfffVVV===VVVVVVNNNfffpppEEENNNfffGGGNNNfffppp^^^===NNNNNNGGG^^^GGG^^^pppwwwppp^^^wwwfff333333EEEGGGGGGNNNNNNNNNNNNVVVNNNVVVNNNVVVNNNNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVV^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fffffffff^^^fff^^^fff^^^ffffff^^^fff^^^fff^^^fff^^^fff^^^ffffff^^^ffffffffffffffffffffffffffffffffffffffffffpppffffffffffffffffffpppfffffffffffffffffffffpppffffffffffffpppfffpppfffpppfffpppfffpppffffffpppfffppppppfffpppfffppppppfffpppffffffpppffffffpppfffffffffffffffpppfffpppffffffpppffffffpppfffpppfffpppfffpppffffffffffffffffffffffffffffffffffff^^^^^^fff^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNVVVNNNNNNNNNVVVNNNNNNNNNNNNNNNVVVNNNNNNNNNGGGNNNGGGNNNNNNGGGNNNNNNNNNGGGNNNGGGGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEGGGGGGGGGGGGGGGEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEpppppp^^^fffppppppppppppffffffwwwwwwffffffNNN===^^^fffffffff^^^NNN^^^ppp^^^^^^^^^^^^NNNEEE^^^VVVVVVpppVVVVVVffffffVVV^^^wwwwwwfff---333EEEEEEGGGNNNNNNNNNNNNNNNNNNNNNNNNNNNVVVNNNNNNVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^ffffffffffff^^^fff^^^ffffff^^^ffffffffffff^^^ffffff^^^ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffpppfffpppffffffpppfffpppfffpppfffffffffpppfffpppfffpppfffpppfffpppppppppfffpppfffpppfffpppfffpppffffffffffffffffffffffffpppfffpppffffffpppfffpppfffpppfffffffffffffffffffffffffffffffffffffffffffffffffff^^^^^^^^^fff^^^^^^^^^^^^VVV^^^^^^^^^^^^VVV^^^^^^VVV^^^VVV^^^VVV^^^VVV^^^VVVVVVVVVNNNVVVNNNNNNVVVVVVVVVNNNNNNNNNGGGNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNGGGNNNNNNNNNGGGNNNGGGNNNGGGGGGNNNGGGGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGNNNGGGGGGEEEGGGEEEEEEGGGEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGpppppppppppppppppppppwwwfffpppwwwwwwpppfff^^^VVVGGGpppwwwppppppwwwpppwwwwwwppppppfffffffffppppppppppppwwwppppppppppppfffwwwwww^^^------===EEEGGGGGGGGGGGGNNNGGGNNNNNNNNNNNNNNNNNNVVVNNNVVVNNNVVVNNNVVVNNNVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVV^^^VVV^^^^^^^^^^^^^^^^^^^^^fff^^^ffffff^^^^^^fff^^^^^^ffffff^^^ffffff^^^^^^fff^^^fff^^^fffffffff^^^fff^^^fff^^^ffffffffffffffffff^^^fffffffffffffffffffffffffffffffffffffffffffffffffffpppffffffffffffpppfffpppffffffpppfffpppfffpppfffpppfffppppppffffffppppppfffpppfffpppfffpppfffffffffffffffffffffffffffpppfffpppfffpppfffpppfffpppfffffffffpppffffffffffffffffffffffffffffffffffff^^^ffffff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNVVVVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGNNNNNNGGGNNNGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEGGGEEEEEEEEEEEEGGGEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGGGGGGGppppppwwwpppwwwwwwppppppppppppwwwwwwpppfffppp^^^fffwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww^^^------======EEEEEEGGGGGGGGGGGGGGGGGGNNNGGGNNNNNNNNNNNNNNNVVVNNNNNNNNNVVVNNNNNNVVVNNNVVVNNNNNNNNNVVVVVVVVVVVVVVVVVV^^^VVVVVV^^^VVVVVV^^^^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^^^^^^^ffffffffffffffffff^^^^^^^^^^^^^^^^^^ffffff^^^fff^^^fffffffffffffffffffffffffffffffffffffffffffffpppffffffffffffffffffffffffpppffffffpppfffpppfffpppfffffffffffffffpppfffpppfffpppfffpppfffppppppfffpppfffpppffffffffffffppppppffffffffffffffffffffffffpppfffpppfffpppfffpppfffpppfffffffffffffffpppffffffffffffffffffffffffffffff^^^fff^^^^^^fff^^^fff^^^^^^^^^^^^VVV^^^^^^VVV^^^VVV^^^VVV^^^^^^VVV^^^VVVVVVVVVNNNVVVNNNVVVNNNVVVNNNVVVVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGNNNGGGNNNGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGGGGGGGpppppppppppppppppppppppppppwwwpppppppppwwwpppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww’jj¼@@äú��ú��ú��ú��†††^^^""""""333======EEEEEEEEEEEEGGGGGGGGGEEEGGGGGGGGGGGGNNNGGGNNNNNNNNNNNNNNNGGGNNNNNNNNNNNNNNNNNNNNNNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^fff^^^fff^^^fff^^^^^^fff^^^^^^^^^fff^^^fff^^^fff^^^fff^^^fff^^^fff^^^ffffffffffffffffffffffff^^^fffffffffffffffffffffpppffffffpppfffpppfffpppfffpppffffffpppffffffpppfffpppfffpppfffpppffffffpppfffffffffpppfffpppfffffffffpppfffpppffffffffffffpppfffpppfffpppfffpppfffpppfffpppffffffffffffffffffffffffffffffffffffffffff^^^fff^^^fff^^^^^^^^^^^^^^^^^^VVV^^^^^^VVV^^^VVVVVVVVVVVVVVV^^^VVVVVVVVVVVVNNNVVVNNNVVVNNNVVVNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNGGGNNNGGGNNNGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEGGGEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEEEE^^^fffffffffffffffffffffffffffppppppppppppppppppppppppwwwpppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwú��ú��ú��ú��ú��ú��ú��††††††VVV"""---===============EEE===EEEEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^^^^^^^^^^^^^^^^^^^fff^^^ffffffpppwww‘‘‘––––––†††www^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^^^^ffffff^^^fff^^^ffffffffffffffffff^^^fff^^^ffffffffffff^^^fff^^^fffpppfffpppfffpppfffpppffffffffffffpppfffpppffffffffffffpppfffffffffppppppffffffpppffffffpppfffpppffffffpppffffffpppfffpppffffffpppfffpppfffpppfffpppfffffffffpppfffpppffffffpppffffffffffffffffff^^^ffffff^^^fff^^^ffffff^^^^^^^^^^^^^^^VVV^^^VVVVVV^^^^^^VVV^^^VVVVVVVVVVVVVVVNNNVVVNNNVVVNNNVVVNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGGGGNNNGGGGGGGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGNNNGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEGGGEEEEEEEEEEEEEEEEEEGGGEEEGGGEEEGGGEEEEEEEEE^^^^^^fff^^^ffffffffffffffffff^^^ffffff^^^fffffffffffffffpppfffppppppppppppppppppppppppppppppwwwã´88Œccú��ú��ú��ú��wwwwwwwwwwwwwwwVVVEEEGGGGGGNNNNNNNNNGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEGGGGGGGGGGGGGGGNNNGGGNNNNNNNNNNNNNNNVVVVVVVVVVVV^^^^^^fffpppwww†††‘‘‘‘‘‘–––ªªª°°°¶¶¶¶¶¶ÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇ°°°‘‘‘ppp^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^ffffff^^^fffffffff^^^fff^^^ffffff^^^ffffff^^^fff^^^fffffffffpppfffpppfffffffffffffffpppffffffffffffpppffffffpppfffpppfffpppfffpppfffpppffffffppppppfffpppfffpppfffpppfffffffffpppfffpppfffffffffpppfffpppfffffffffffffffpppfffpppfffffffffffffffffffff^^^ffffff^^^fff^^^ffffff^^^^^^^^^VVV^^^VVV^^^VVV^^^VVVVVV^^^VVVVVV^^^VVVVVVVVVVVVVVVVVVVVVNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEffffff^^^fff^^^^^^fff^^^fff^^^ffffffffffffffffffffffffffffffpppffffffffffffpppffffffpppppppppfffpppppppppú��ú��ú��ú��pppppppppfffppppppfffpppfffVVVVVVú��ú��^^^^^^fff^^^fff^^^^^^^^^^^^VVVVVVVVVVVVVVVNNNNNNNNNGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGGGGGGGNNNNNNVVV^^^fffwww‘‘‘ ªªª°°°¶¶¶ÇÇÇÇÇÇÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÇÇÇÇÇÇ°°°†††ppp^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^^^^^^^^^^^^^^^^fff^^^fff^^^fffffffffffffffffffffffffffffffffpppfffffffffpppffffffffffffffffffffffffpppfffpppfffpppfffpppffffffpppffffffpppffffffpppfffpppfffpppfffpppfffpppffffffpppfffpppffffffffffffffffffpppfffpppffffffffffffffffff^^^ffffffffffff^^^fff^^^^^^^^^VVVVVV^^^VVVVVV^^^VVVVVVVVV^^^VVVVVVVVVVVVVVVVVVNNNNNNNNNVVVNNNVVVNNNVVVNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGNNNGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^ffffff^^^fff^^^ffffff^^^ffffffffffff^^^ffffffffffffffffffffffffffffffffffffpppfffpppfffpppppppppppppppú��ú��ú��ú��wwwppppppwwwpppppppppppppppffffffú��ú��pppfffpppfffppppppfffpppfffpppppppppfffpppfffffffffffffff^^^^^^VVV^^^VVV^^^^^^^^^fffppp††† ªªª°°°ÁÁÁÇÇÇÎÎÎÎÎÎ×××ÎÎÎ×××ÎÎÎ××××××ÎÎÎ×××ÎÎÎ××××××××××××ÎÎÎ×××ÎÎÎÎÎÎÎÎÎÎÎÎ××××××ÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎÇÇÇ°°°†††fff^^^^^^VVV^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^fffffffffffffffpppffffffffffffffffffffffffffffffpppffffffpppfffpppfffppppppfffpppfffffffffpppffffffpppfffpppfffpppfffpppfffpppfffpppfffpppfffpppffffffffffffpppfffffffffffffffpppffffffffffffffffffffffffffffff^^^ffffff^^^fff^^^^^^^^^^^^VVV^^^VVV^^^VVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEGGGEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEfff^^^fff^^^fff^^^fffffffff^^^ffffff^^^ffffff^^^ffffffffffffpppfffffffffffffffpppfffppppppfffppppppppppppú��ú��ú��ú��pppwwwpppwwwwwwwwwpppwwwppppppfffú��ú��fffpppppppppppppppppppppppppppppppppwwwpppwwwwwwpppwwwwww†††––– ªªª°°°¶¶¶ÇÇÇÎÎÎ×××ßßß×××ßßß×××ßßß×××××××××××××××××××××ßßß××××××××××××××××××××××××××××××ÎÎÎ××××××ÎÎÎ×××ÎÎÎÎÎÎ××××××××××××××××××ÎÎÎÎÎÎÁÁÁªªª^^^VVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fffffffffffffffffffffffffffffffffffffffpppfffffffffffffffffffffffffffpppffffffpppffffffffffffpppfffpppfffffffffpppfffpppfffpppfffppppppfffpppfffpppfffffffffpppfffffffffffffffpppfffffffffffffffffffffffffffffffff^^^ffffff^^^^^^^^^^^^^^^VVV^^^VVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGGGGNNNNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEGGGEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^fffffffffffffff^^^fff^^^fff^^^fffffffffffffffffffffffffffffffffpppfffpppffffffppppppfffpppfffpppppppppú��ú��ú��ú��pppwwwwwwwwwwwwwwwwwwwwwpppppppppú��ú��pppppppppppppppppppppwwwpppwwwwww‘‘‘–––ªªª°°°ÁÁÁÁÁÁÎÎÎ×××ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß×××ßßßßßßßßß××××××××××××××××××ÎÎÎÎÎÎÁÁÁ¶¶¶––– ÁÁÁÇÇÇÎÎÎ×××××××××××××××××××××ÎÎÎÇÇǶ¶¶ pppVVVNNNNNNNNNVVVNNNVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^^^^^^^^^^^^^^^^ffffffffffffffffff^^^^^^^^^^^^ffffffffffffffffffpppffffffffffffffffffpppffffffpppffffffffffffffffffpppfffpppfffpppfffpppfffpppfffppppppfffffffffpppfffpppffffffpppfffpppffffffffffffffffffffffffpppffffff^^^fff^^^fff^^^fff^^^^^^^^^^^^VVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGGGGGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEGGGGGGGGGEEEGGGEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEGGGEEEEEEEEEEEEEEEGGGEEEGGGEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEfff^^^fff^^^fff^^^fffffffffffffffffffffffffffffffffffffffffffffpppffffffpppfffppppppfffppppppppppppppppppú��ú��ú��ú��wwwwwwwwwwwwwwwwwwwwwwwwwwwpppfffú��ú��pppppppppwwwwww†††‘‘‘ ªªª¶¶¶ÇÇÇÎÎÎ×××ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß×××ßßßßßßßßß×××ßßßßßßßßßßßß×××××תªª†††fffVVVNNNfffppp ¶¶¶ÎÎÎÎÎÎ××××××××××××××××××ÎÎÎÁÁÁªªªwwwVVVGGGGGGNNNNNNGGGNNNNNNNNNNNNVVVNNNVVVNNNVVVVVVVVVVVVVVVVVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffpppfffpppfffpppfffpppfffpppffffffpppfffpppfffffffffpppffffffpppfffffffffpppffffffffffffffffffffffffffffff^^^ffffff^^^fff^^^^^^^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNNNNVVVNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEGGGEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEffffffffffff^^^ffffff^^^fffffffffffffffffffffpppffffffffffffpppfffpppfffpppfffpppppppppppppppppppppppppppú��ú��ú��ú��wwwwwwwwwwwwwwwpppú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ÇÇÇ×××ßßß×××ÁÁÁÁÁÁÇÇÇÇÇÇÎÎÎßßßßßßßßßßßßÎÎÎ×××ßßßßßßßßßßßßçççßßßçççßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß××××××ÇÇǶ¶¶–––pppVVVGGG===EEE^^^pppffffffppp†††°°°ÎÎÎ××××××ßßßÎÎÎÇÇÇÎÎÎÎÎÎÇÇÇ°°°†††NNNEEEEEEGGGNNNGGGGGGNNNGGGNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^fff^^^ffffffffffffffffffffffffffffffpppfffpppfffpppfffpppfffffffffffffffpppffffffpppfffpppfffpppffffffffffffffffffpppffffff^^^fff^^^fffffffff^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVVVVVVVVVVVVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGEEEEEEGGGEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^fff^^^ffffff^^^fffffffffffffff^^^fffffffffffffffffffffffffffpppfffpppfffpppfffpppfffpppfffppppppppppppú��ú��ú��ú��wwwpppwwwpppwwwwwwú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ßßßßßßçççßß߶¶¶†††–––www‘‘‘ÎÎÎßßßßßßÇÇÇ ÁÁÁ×××çççßßßßßßçççßßßçççßßßçççßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÎÎ涶 fffNNNEEE===333=========------333===NNNwww‘‘‘wwwwww†††ªªªÎÎÎ×××ßßß×××ÎÎÎÇÇÇÇÇÇÁÁÁ°°°–––NNN======GGGVVVVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNNNNNNNNNNVVVNNNVVVVVVNNNVVVVVVNNNVVVVVVVVVVVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ffffff^^^ffffff^^^fffffffffffffffffffffffffffffffffffffffffffffffffffffffffpppfffpppfffpppfffffffffffffffffffffffffffffffffffffff^^^^^^^^^^^^fff^^^^^^^^^^^^VVVVVVVVVVVVVVVVVVNNNVVVNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEGGGEEEEEEEEEEEEEEEEEEGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEfff^^^ffffff^^^ffffffffffffffffffffffffffffffffffffffffffffffffpppffffffpppfffpppfffpppfffpppfffpppppppppú��ú��ú��ú��wwwpppwwwpppwwwpppwwwwwwpppwwwpppú��ú��ÇÇÇççççççççççççççççççßßßßßßçççÇÇÇppppppfff‘‘‘×××çççßßßÎÎΪªª–––ÎÎÎßßßßßßßßßçççßßßçççßßßßßßçççßßßçççßßßçççßßßßßßßßßÁÁÁ wwwNNN===333333---333333333333333333==================GGG^^^www†††††††††¶¶¶××××××ßßß××××××ÎÎÎÁÁÁ°°°–––NNN===333GGG^^^ppppppfffffffff^^^^^^^^^VVVVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNVVVVVVVVVVVVNNNVVVVVVVVVVVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^ffffffffffff^^^ffffffffffffffffffffffffffffffffffffpppfffpppffffffffffffffffffffffffffffff^^^fff^^^^^^fff^^^^^^^^^^^^^^^VVV^^^VVVVVVVVVVVVVVVVVVNNNVVVNNNNNNNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNGGGGGGNNNGGGNNNGGGNNNGGGGGGGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEE^^^fff^^^fff^^^fff^^^ffffffffffffffffffffffffffffffffffffpppffffffpppffffffpppfffpppfffpppfffpppfffppppppú��ú��ú��ú��pppwwwpppwwwpppwwwpppwwwwwwppppppú��ú��VVVÁÁÁçççççççççßßßçççççççççßßßßßß‘‘‘VVV^^^ffffffÁÁÁßßßçççßßßÎÎΪªª†††ÇÇÇßßßßßßßßßççç×××ÎÎÎÇÇÇÎÎÎ××××××ßßßßßßßß߶¶¶wwwGGG333---------------===GGGNNNNNNVVVNNN^^^pppppppppfff^^^^^^^^^VVVVVVppp‘‘‘‘‘‘†††ªªªÎÎÎßßßßßßßßß×××ÎÎΰ°°ªªª–––VVV===333===NNNpppwwwwwwwwwwwwwwwpppwwwpppfffpppffffff^^^^^^VVVVVVVVVVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNVVVVVVVVVVVVVVVVVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^fff^^^fffffffffffffffffffffffffffffffffffffffffffffffffff^^^fff^^^^^^fff^^^^^^^^^^^^^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVNNNVVVNNNVVVVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNNNNGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^fff^^^ffffffffffffffffffffffffffffffffffffffffffffffffffffffpppfffpppffffffpppfffpppfffppppppppppppfffú��ú��ú��ú��pppwwwpppwwwwwwpppwwwwwwpppwwwpppú��ú��===NNN–––×××ççççççççççççççççççßßß°°°^^^wwwwww†††ÎÎÎßßßçççßßßßßßÎÎÎÎÎÎÁÁÁ×××çççßßß×××ÇÇÇÇÇÇÇÇÇÇÇÇÎÎÎ×××××ב‘‘NNN===333333333===333333333===GGGfff††††††‘‘‘–––ªªª ‘‘‘wwwpppfff^^^fffVVVVVVfffpppppp†††°°°×××ßßßßßßßßßßßß×××°°°ªªª–––GGG333333===EEE^^^wwwwwwwwwwwwwwwpppppppppfffffffff^^^^^^VVVVVVVVVVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ffffffffffff^^^fff^^^^^^^^^fff^^^fff^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^VVV^^^^^^VVVVVVVVVVVVVVVVVVVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGGGGNNNGGGGGGNNNGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^fff^^^fff^^^fffffffff^^^fffffffffffffffffffffpppffffffpppfffffffffffffffpppfffpppfffpppfffpppú��ú��ú��ú��ú��ú��ú��ú��ú��ú��pppwwwwwwwwwpppwwwwwwwwwú��ú��===EEEGGGwwwÎÎÎïïïçççççççççççççççÇÇÇ‘‘‘^^^pppppp–––ÇÇÇççççççßßßçççßßßÎÎΪªª°°°ßßßçççßßßßßßçççßßßçççßßßÇÇÇfffVVVGGGEEEGGGVVV^^^^^^VVV^^^NNNGGGGGGNNN^^^fff^^^fffppppppppppppfffNNNGGGNNNfffpppfffppp‘‘‘°°°×××ßßßßßßßßßßßß×××ÎÎΰ°°†††GGGGGGVVVNNNGGGNNNfff††††††††††††††††††wwwwwwwwwwwwppppppffffffffffff^^^VVVVVVVVVNNNVVVVVVNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNVVVNNNNNNVVVNNNVVVVVVVVVVVV^^^VVV^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^VVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGGGGGGGGGGGGGNNNGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGEEEGGGEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEGGGEEEGGGEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEffffff^^^fffffffffffffffffffffffffffffffffffffffffffffpppffffffpppfffpppffffffpppfffpppfffppppppú��ú��ú��ú��ú��ú��ú��ú��ú��ú��wwwpppwwwwwwwwwwwwwwwwwwú��ú��===EEEGGGNNNfff ßßßçççççççççççççççßßßÎÎÎpppffffffNNNwwwÎÎÎßßßçççççççççßßßßßß×××ÇÇÇÎÎÎßßßçççßßßçççßßßßßßÇÇÇ‘‘‘ppp^^^VVVppp–––‘‘‘–––pppGGGNNNNNNVVVNNNVVVEEEVVVwww–––ªªª°°° www^^^GGGEEEGGG^^^^^^^^^pppppp¶¶¶××××××ÎÎÎÎÎÎÎÎÎÇÇÇ°°°–––ffffffffffff^^^VVVGGGGGG^^^ppp†††††††††††††††††††††††††††††††††††††††††††††wwwwwwwwwwwwppppppffffffffffff^^^^^^VVVVVVVVVVVVVVVVVVNNNNNNNNNNNNNNNNNNNNNNNNVVVNNNVVVNNNVVVVVVVVVVVVVVV^^^VVV^^^^^^VVV^^^^^^VVV^^^VVV^^^VVV^^^^^^^^^^^^VVV^^^VVVVVVVVVVVVVVVVVVNNNVVVNNNVVVNNNNNNVVVNNNNNNNNNNNNNNNNNNGGGNNNGGGGGGNNNGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^ffffffffffff^^^ffffffffffffffffffffffffffffffpppfffffffffffffffffffffpppfffppppppfffpppfffppppppfffpppppppppwwwpppwwwpppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwfff===EEEGGGVVVNNNVVVÎÎÎçççççççççççççççßßß×××–––VVVVVVVVVpppÁÁÁßßßßßßçççççççççßßßÎÎΪªª¶¶¶ßßßßßßçççÎÎÎ××××××ÎÎΖ––‘‘‘††††††–––°°°ÁÁÁÁÁÁfffNNNGGGEEEGGG^^^^^^GGG†††¶¶¶ÇÇÇÎÎÎÎÎÎ ppp^^^===GGGppp^^^fff‘‘‘†††wwwwww‘‘‘¶¶¶×××ÁÁÁªªª––––––‘‘‘†††pppfffNNNGGGEEE333333333EEE^^^www††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††wwwwwwwwwwwwwwwpppfffffffffffffff^^^VVVVVVVVVVVVVVVNNNVVVNNNNNNVVVNNNVVVNNNVVVNNNNNNVVVNNNVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNNNNNNNNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGGGGNNNGGGGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEfff^^^fff^^^ffffffffffffffffffffffffffffffffffffffffffffffffpppfffpppfffpppfffpppfffppppppfffppppppppppppppppppppppppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwfff===EEEGGG^^^NNNGGGVVVpppªªªßßßçççççççççççççççÇÇÇfffGGG^^^fffwwwÇÇÇççççççççççççççççççßßßÎÎΰ°°ÇÇÇßßßßßßçççççç××××××××××××ßßßßßß×××ßßß°°°†††wwwfffVVVNNNwww––– –––‘‘‘pppNNNEEE===EEENNNfffwww‘‘‘fffpppfff––– ‘‘‘pppwwwfffVVV^^^fffVVVGGG------------333333EEE^^^††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††wwwwwwwwwwwwppppppffffffffffff^^^VVVVVVVVVVVVNNNVVVNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNVVVVVVVVVVVVNNNVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNGGGNNNGGGNNNGGGGGGGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEfff^^^fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffpppfffpppfffpppfffpppfffpppfffppppppppppppwwwpppwwwwwwpppwwwwwwwwwwwwwwwwwwppp===EEENNN^^^^^^VVVVVVfff^^^†††ÎÎÎçççßßßçççççççççÎÎΖ––fff‘‘‘––– –––ÎÎÎçççßßßççççççççç×××ÎÎΪªªªªªÎÎÎççççççßßßçççßßßçççßßßçççÎÎΪªªªªª¶¶¶ÎÎΪªªwwwwwwpppVVVVVVVVVNNNGGG===EEE ªªª ªªª‘‘‘‘‘‘‘‘‘wwwpppppppppffffffpppppppppwwwffffffVVVNNNVVV^^^VVVGGGEEE===---------333333333EEE^^^www†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††wwwwwwwwwwwwpppppppppffffff^^^^^^^^^VVVVVVVVVVVVVVVNNNVVVNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGGGNNNNNNNNNGGGNNNGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEE^^^fffffffffffffffffffffffffffffffffpppfffffffffffffffffffffpppfffpppfffpppfffpppfffpppfffppppppppppppppppppppppppwwwpppwwwwwwwwwwwwwwwwwwwwwwwwppp===EEENNNfffpppffffffVVVNNNVVVppp¶¶¶ßßßççççççççççççßß߶¶¶–––fffVVVVVVfff°°°ßßßççççççççççççççç××׶¶¶ªªª°°°ßßßççççççççççççççççççÎÎΖ––‘‘‘–––‘‘‘‘‘‘–––‘‘‘‘‘‘wwwpppwwwwwwwww ÎÎÎçççßßßçççßßßßßß×××ÁÁÁªªªªªª¶¶¶ªªª ‘‘‘††††††wwwppp^^^VVV^^^fffVVVNNNGGG===------------333333333333EEE^^^www†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††wwwwwwwwwwwwppppppfffffffffffffff^^^^^^VVVVVVVVVNNNNNNNNNGGGGGGNNNGGGNNNGGGGGGGGGGGGNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGEEEEEEEEEEEEEEEEEEffffffffffffffffffffffffffffffffffffffffffffffffffffffpppffffffpppfffpppfffpppfffpppfffppppppppppppppppppppppppwwwpppwwwwwwwwwwwwwwwwwwwwwppp===EEENNNfffpppfffffffffNNNNNNNNNfff‘‘‘ÎÎÎççççççççççççççç××׆††^^^ppp ßßßçççççççççççççççççç××׶¶¶ªªªÎÎÎçççßßßççççççßßß×××××׶¶¶°°°°°°ÇÇÇ××××××ßßßßßßßßßßßßßßßßßßçççççççççççççççççççççççççççßßßßßßßßßçççÎÎÎ×××××××××ÎÎÎ pppfff^^^ffffffffffff^^^VVVGGG===333333333=========333333333333EEE^^^††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††wwwwwwwwwwwwwwwwwwwwwppppppffffff^^^NNNNNNNNNGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEGGGGGGEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEfffffffff^^^fffffffffffffffffffffpppffffffffffffffffffffffffpppfffpppfffpppfffpppfffppppppppppppppppppppppppwwwpppwwwwwwwwwwwwwwwwwwwwwpppEEEEEENNNfffpppffffffffffffVVVNNNNNN^^^www¶¶¶ßßßççççççççç××ב‘‘VVV===EEENNNwww¶¶¶°°°×××çççççççççççççççßßßÎÎ涶ÎÎÎ×××çççççççççÎÎÎÇÇÇÎÎÎÁÁÁ ––– °°°ÁÁÁ×××ßßßçççççççççççççççççççççßßßççççççßßßççççççççççççççççççßßßçççßßßßßß–––wwwwwwwwwppppppffffffVVVNNNGGGGGGGGGGGGVVVVVV^^^VVV===---333333333===GGGfff†††‘‘‘†††‘‘‘†††††††††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††wwwwwwwwwwwwwwwpppppp^^^NNNGGGEEEGGGGGGGGGGGGGGGGGGGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGGGGGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^fffffffffffffffffffffpppffffffffffffffffffpppffffffpppfffpppfffppppppfffppppppppppppppppppppppppppppppwwwpppwwwwwwwwwwwwwwwwwwpppEEEEEEGGGNNNffffffpppppppppffffffVVV^^^NNNfffªªªßßßççççççßßßÎÎΪªªGGG===NNNwww‘‘‘ªªªÇÇÇÇÇÇ×××ççççççççççççççççççßßßÁÁÁÇÇÇßßßçççßßßßßßßß߶¶¶‘‘‘fffNNNGGGVVV†††ßßßççççççççççççççççççççççççççççççççççççççççççççççççßßßçççßßßÇÇÇ pppVVVVVVppppppfff^^^VVVVVVGGGEEE333333GGGffffffpppNNN333---===333EEEGGGNNNNNNfffppp†††‘‘‘†††‘‘‘†††††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††††††††‘‘‘††††††††††††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††wwwwwwwwwwwwwwwwwwfffGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEffffffffffffffffffffffffffffffffffffffffffffffffpppfffppppppfffpppfffppppppppppppppppppppppppppppppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpppGGGGGGNNNNNNNNN^^^pppppppppwwwppp^^^VVVNNNNNN^^^‘‘‘ÎÎÎßßßççççççßß߶¶¶¶¶¶ÇÇÇ°°°°°°°°°°°°VVV–––ßßßçççççççççççççççÎÎÎ ªªª×××ççççççßßßÇÇÇ°°°ªªª°°°¶¶¶°°°¶¶¶ßßßçççççççççççççççççççççççççççççççççßßßçççççççççççççççßßßßßß fff^^^^^^^^^fffppp^^^GGGEEEGGGGGG333---"""333333=========EEEppp^^^VVVfffppp^^^fff^^^fffppp‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††††††††‘‘‘††††††‘‘‘†††††††††††††††‘‘‘†††††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††wwwwwwpppVVV======EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^ffffff^^^fffffffffffffffffffffpppffffffpppfffpppfffpppfffpppppppppfffpppppppppppppppppppppwwwppppppwwwwwwwwwwwwwwwGGGGGGGGGNNNNNNNNNVVVfffpppppppppfffppp^^^VVVNNNVVVppp ×××çççïïïççççççßßßwww^^^–––¶¶¶ÁÁÁ¶¶¶ÁÁÁ×××ßßßßßßßßßççççççßß߶¶¶ ßßßççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççßßßßßßßßßÎÎÎÁÁÁªªª†††ppppppwwwwwwpppwwwppp^^^NNNGGG===---"""""""""""""""333NNN^^^‘‘‘ppp^^^VVVVVV^^^VVVNNN^^^fffpppwww††††††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††††††††‘‘‘†††‘‘‘††††††††††††‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††wwwfffEEE333333======EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEfffffffffffffffffffffffffffpppfffffffffffffffpppfffpppppppppppppppppppppppppppppppppwwwwwwpppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwGGGGGGNNNNNNNNNNNNNNNVVVwwwppppppwwwwwwwww^^^VVVVVVNNN^^^wwwÇÇÇçççïïïçççççççççÎÎÎÎÎÎçççççççççÎÎΰ°°fff†††‘‘‘ÎÎÎßßßçççßßß×××ÎÎÎßßßßßßßßßççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççßßßßßßÇÇÇ–––†††††††††wwwNNN===VVVppp^^^pppwwwwwwwwwfff^^^NNN===---""""""""""""---333EEENNNpppfffVVVEEE=========EEEEEENNNVVVffffffwww‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††††††††‘‘‘†††‘‘‘††††††‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††††††††wwwGGG333333===============EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEffffffffffffffffffffffffffffffffffffpppfffpppfffppppppfffppppppppppppppppppppppppwwwpppwwwwwwwwwpppwwwwwwwwwwwwwwwGGGNNNNNNNNNNNNNNNNNNNNNVVV^^^wwwwwwwwwwwwwwwfffNNNVVVNNNfff–––×××ïïïïïïçççïïïçççççççççççç××׶¶¶ ‘‘‘‘‘‘pppªªª×××ççççççççç××׶¶¶ÁÁÁßßßççççççççççççïïïçççççççççççççççççççççççççççççççççßßßÁÁÁ ‘‘‘†††pppNNN333333^^^†††^^^pppwwwpppfffpppVVVEEE===333333333---"""------333===333333GGGEEE333333======EEEGGGNNN^^^fffppp†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††††††††www^^^------333333===============EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEE===EEEEEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEffffffffffffffffffpppfffpppfffpppfffppppppfffppppppppppppppppppppppppppppppwwwwwwwwwwwwpppwwwwwwwwwwwwwwwwww††††††GGGNNNVVVNNNNNNNNNVVV^^^NNNVVV^^^pppwwwpppwwwpppVVVVVVVVVVVV^^^www¶¶¶ïïïïïïçççïïïçççïïïçççççççççßß߶¶¶ ––– ¶¶¶ ppp°°°çççççç×××ÎÎÎßßßççççççïïïçççççççççïïïççççççççççççççççççççççççßßßÁÁÁpppfff†††††††††††††††––– ‘‘‘^^^www‘‘‘†††pppVVV†††pppppppppVVVNNNGGGNNNNNNEEE333""""""""""""""""""===NNNEEE=========333333======EEENNN^^^ppp‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††††††††fff==="""---333=====================EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEfffffffffffffffffffffffffffpppfffpppppppppppppppppppppppppppppppppwwwwwwwwwpppwwwwwwwwwwwwwwwwwwwwwwww††††††NNNNNNNNNVVVVVVVVVppp^^^NNNNNNVVVVVVfffwwwpppVVVVVVNNNVVVVVV^^^fff‘‘‘×××ïïïïïïïïïçççïïïçççïïïçççççççççßßßÇÇÇ ¶¶¶çççççççççççççççççççççççççççïïïçççççççççççççççççççççßßß××××××ÇÇÇÎÎÎÎÎÎÎÎÎçççßßßÎÎÎÁÁÁÁÁÁ××××××ßßßÇÇÇ‘‘‘††††††wwwNNNpppwwwfffwwwwww^^^^^^VVVVVVGGGEEE======---------------GGG^^^^^^NNNEEE333333333333333===EEEGGGVVVfffppp†††‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘††††††‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††††††††wwwEEE""""""333===333==================EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEfffffffffpppfffppppppfffpppfffpppfffppppppppppppppppppppppppwwwppppppwwwwwwwwwwwwwwwwwwwwwwwwwww††††††NNNNNNVVVNNNVVV^^^wwwfffVVVNNNNNNNNNVVVppppppwwwwwwVVVVVVVVVVVVVVVVVVVVV^^^wwwÁÁÁçççïïïïïïçççïïïçççïïïçççççççççÎÎÎÇÇÇ ßßßççççççççççççççççççççççççççççççßßßßßß×××ßßß×××ÎÎÎÎÎÎÇÇÇÁÁÁ°°°°°°ÎÎÎ××××××ßßßççççççßßßßßßççççççççççççßßßÇÇÇ‘‘‘fffVVV–––^^^ffffff^^^fffffffffVVVGGGGGGGGG===GGGGGGGGGGGG^^^†††^^^NNNNNNEEE333===333333======EEENNNVVVfff†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘††††††††††††††††††‘‘‘†††††††††††††††††††††VVV---"""---=================================EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEE=========EEEEEE===EEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEffffffffffffpppffffffpppfffppppppppppppppppppppppppppppppwwwpppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww††††††††††††††††††VVVNNNVVVVVVVVVfffppppppfffVVVVVVfff^^^VVVVVVpppwwwVVVVVVVVVVVVVVVVVVVVV^^^VVVfff‘‘‘×××ïïïïïïïïïçççççççççççççççççççççßßß×××ßßßßßßßßß××××××ÎÎÎÇÇÇÁÁÁ¶¶¶°°°°°°¶¶¶ÎÎÎßßßßßßßßß×××ßßßÇÇǪªª––– –––––– ×××çççççççççÎÎÎÇÇÇßßßççççççççç××׶¶¶‘‘‘––––––wwwpppfffpppfff^^^VVVVVVNNNVVVGGG^^^^^^VVVGGGGGGNNNfffwwwpppfffGGG===333333===333333======GGGVVVfffwww‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘††††††‘‘‘†††‘‘‘†††††††††††††††‘‘‘††††††††††††††††††ppp333"""---333===333===333========================EEE=========EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEE===EEE===EEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEfffpppfffpppfffpppfffpppppppppfffppppppppppppppppppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww†††††††††††††††††††††VVVVVVVVVVVVVVVfffwwwpppwwwppp^^^ppppppNNNVVVVVVfffVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^^^^¶¶¶çççïïïçççßßß×××ÎÎÎÇÇǶ¶¶°°°ªªª –––‘‘‘†††pppppppppfffpppwww‘‘‘°°°ÎÎÎßßßÎÎÎ †††††† ¶¶¶×××ßßßÎÎ涶ªªªÇÇÇ×××ßß߶¶¶‘‘‘–––ßßßçççççççççßßß www–––ÁÁÁÁÁÁ –––‘‘‘^^^ffffffwwwppp^^^NNNGGGEEE===GGG^^^^^^pppNNNEEE333===333333===333======NNNfffpppwwwwww††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘††††††‘‘‘†††††††††††††††††††††††††††wwwEEE""""""333333======333===333===========================EEE===EEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEE===EEEEEE===EEE===EEEEEE======EEE===EEEEEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEpppfffpppppppppppppppppppppppppppppppppwwwpppwwwwwwwwwpppwwwwwwwwwwwwwwwwwwwwwwwwwww†††††††††††††††††††††fff^^^VVVVVVVVV^^^pppppp^^^ppp^^^pppwwwfffwwwVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVV^^^fff‘‘‘ÇÇǪªª†††pppfffffffff^^^^^^VVV^^^^^^VVVVVV^^^VVVVVV^^^VVVffffff–––¶¶¶ÎÎÎÎÎÎ ––– ªªªªªªÇÇÇÎÎ涶°°°ÇÇÇßßßçççÁÁÁ°°°ÇÇÇççççççççççççÇÇÇfffppp–––¶¶¶ÎÎÎÎÎÎÎÎÎÁÁÁªªª––– –––†††ppppppVVVGGGEEENNN^^^www†††pppppp^^^NNNEEE===333===333333333===GGG^^^wwwwww‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘††††††‘‘‘††††††‘‘‘†††‘‘‘††††††††††††VVV---"""---333===333===333===333===========================EEE===EEE===EEEEEEEEEEEEEEE===EEE===EEEEEE===EEE===EEE===EEE===EEEEEE===EEEEEEEEEEEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEppppppwwwpppwwwppppppwwwpppwwwpppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww††††††††††††††††††††††††‘‘‘www^^^VVVVVVVVVVVVfffwwwppp^^^wwwppp†††VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^pppwwwfff^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^^^^ppp ¶¶¶×××××׶¶¶ –––ÁÁÁßßßßßß××××××ßßßççççççßßßçççççç×××ÎÎÎ×××ÎÎÎwww†††–––ÁÁÁ×××ççççççßßß×××°°°ªªªªªªªªªªªª pppNNNEEE===VVV‘‘‘ªªªªªª‘‘‘‘‘‘††††††ffffffGGG===333=========EEEVVVwww†††‘‘‘‘‘‘–––‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††††††††††††††††††††fff333""""""===333===333===333===333=================================EEEEEE===EEE======EEE===EEE===EEE======EEE===EEEEEEEEE======EEEEEEEEEEEE===EEEEEE===EEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww††††††††††††††††††††††††††††††††††††––– †††VVVNNNVVVVVVVVV^^^www^^^www†††VVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVVVVV^^^^^^^^^fff¶¶¶¶¶¶www^^^^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^VVVVVVVVVVVVVVV^^^^^^^^^pppwww‘‘‘ °°°°°°¶¶¶×××ßßßççççççççççççççççççççççççççççççÇÇÇÁÁÁÎÎΰ°°–––‘‘‘ÁÁÁßßßçççççççççÎÎΆ††www‘‘‘–––‘‘‘wwwppp^^^^^^VVVGGGNNNVVVppp‘‘‘ªªªªªª‘‘‘pppffffffNNN===333333333333---EEE^^^www‘‘‘°°°ÁÁÁ¶¶¶¶¶¶–––‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘†††‘‘‘†††‘‘‘††††††EEE""""""333333333===333333===333===333=================================EEE===EEE===============EEE=========EEEEEE===EEE======EEE===EEE===EEEEEE===EEE===EEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEwwwwwwpppwwwwwwwwwwwwwwwwww†††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘ ¶¶¶ÁÁÁ–––wwwNNNNNNVVVVVVVVV^^^^^^ppppppfff^^^VVVVVV^^^VVVVVVVVVVVVVVV^^^VVVVVV^^^VVV^^^^^^fff†††°°°‘‘‘fff^^^VVVVVVVVVVVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVV^^^^^^fffppp–––ªªªÁÁÁÎÎÎßßßßßß××××××çççççççççççççççßßß×××ÎÎÎ×××××××××ççççççççççççÇÇdž††††† ÁÁÁÁÁÁ†††VVVGGGVVVfffVVVNNNVVVGGGVVVfffpppfffNNNEEE======333===333333333---333EEENNNppp––– ªªª‘‘‘‘‘‘ªªªªªª–––‘‘‘‘‘‘–––––––––‘‘‘–––‘‘‘–––‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘††††††VVV---"""---333===333===333333===333===333===333==============================EEE======EEE============EEE======EEE=========EEE===EEE===EEE======EEE===EEE===EEEEEE===EEEEEEEEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEwwwwwwwwwwwwwwwwwwwwwwwwwwwwww††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††† –––‘‘‘†††–––fffNNNGGGVVVVVVVVV^^^wwwwww†††wwwfff^^^VVVVVV^^^VVV^^^^^^VVVVVV^^^VVV^^^VVV^^^^^^^^^^^^ppp‘‘‘ªªª^^^^^^VVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNNNNNNNNNNVVVNNNVVVVVV^^^^^^^^^^^^^^^ppp†††°°°ÇÇÇÎÎΰ°° ÁÁÁÎÎÎ×××ÇÇÇÎÎÎßßßççççççßßßççççççßßßßßßßßßççççççßßß×××ÎÎÎ×××ßßßÎÎΪªªppp–––ÇÇǶ¶¶–––pppVVVVVVVVVNNNGGGEEE======333===333333===333333=========GGGfffwwwwww °°°ÁÁÁ°°° –––‘‘‘‘‘‘––––––‘‘‘––––––‘‘‘––––––‘‘‘‘‘‘–––‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘††††††ppp333""""""333333===333===333333===333===333===333============================================================EEE======EEE=========EEE===EEEEEE=========EEE===EEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEpppwwwwwwwwwwwwwwwwwwwwwwww†††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘ †††^^^GGGGGGNNNVVV^^^pppwww^^^wwwfffVVVVVV^^^VVV^^^^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^^^^fffwww –––pppVVVVVVVVVNNNNNNNNNNNNNNNVVVVVVVVVVVVVVVVVVVVV^^^ffffff^^^†††‘‘‘www^^^fffwww–––ªªª––– ªªª¶¶¶ÇÇǶ¶¶°°°ªªª°°°¶¶¶ÇÇÇÎÎÎßßß×××ÎÎÎÁÁÁÇÇÇßßßççççççßßß×××ÎÎÎßßß××××××ßßßçççßßß×××ÇÇǪªª †††pppVVVGGGEEE===333333===333333======333=========GGGfff†††ªªª¶¶¶°°°ÇÇǪªª–––‘‘‘‘‘‘––––––––––––‘‘‘–––––––––‘‘‘–––‘‘‘‘‘‘–––‘‘‘––––––‘‘‘––––––‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††wwwEEE""""""333===333333333===333===333===333333===333================================================EEE=========EEE===EEE======EEE===EEE===EEE======EEE===EEE===EEE======EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEwwwwwwwwwwwwwwwwwwwww†††††††††††††††††††††††††††††††††††††††‘‘‘††††††‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘ªªªªªªwwwppp–––°°°pppVVVNNNGGGNNNVVVVVV^^^www†††‘‘‘www‘‘‘wwwfff^^^VVV^^^VVV^^^^^^VVV^^^^^^^^^VVV^^^^^^^^^^^^^^^fffppp‘‘‘ªªªwww^^^VVVVVVVVVVVV^^^VVVVVVVVV^^^VVV^^^^^^VVV^^^fff‘‘‘www‘‘‘†††fff†††ppp^^^^^^fffwww‘‘‘ ªªªÁÁÁ×××ßßß×××ÇÇÇÇÇÇÎÎÎÇÇÇÁÁÁªªª°°°¶¶¶¶¶¶¶¶¶¶¶¶°°°ÇÇÇÇÇÇÎÎÎßßßßßß×××ççççççßßßçççÇÇÇ°°°ªªªªªª°°°°°°ªªª †††wwwVVVGGG===333===333333===333333===EEEGGGfff†††††††††‘‘‘¶¶¶ÇÇÇÁÁÁ¶¶¶°°°–––‘‘‘–––––– –––––––––––––––‘‘‘–––––––––‘‘‘––––––‘‘‘––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††VVV---"""---333333===333333===333===333333===333===333===============================================================EEE===EEE=========EEE===EEE======EEE===EEE===EEE===EEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEwwwwwwwwwwwwwwwwww†††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘ ªªªffffff ¶¶¶–––fffVVVNNNGGGNNNVVV^^^fffppp†††www^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^fff^^^^^^^^^fff^^^ppp fff^^^^^^VVVVVV^^^VVV^^^VVVVVVVVVVVVVVV^^^^^^fffpppwwwwwwwwwppp††††††fff^^^^^^ppp‘‘‘ªªªÁÁÁ×××ççççççßßßççççççßßßçççßßß×××ÎÎ涶 ªªªªªª––– ÎÎÎççççççßßßççç×××ÁÁÁªªª––– ªªª ––– °°°ªªª‘‘‘www^^^GGGEEE333333===333======GGG^^^‘‘‘††††††‘‘‘ ÁÁÁ¶¶¶ÎÎ涶ªªª ¶¶¶°°° ––––––––––––––––––––––––––––––––––––––––––‘‘‘––––––‘‘‘––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††ppp333""""""333===333===333333333333===333333===333333333===333===========================================================================EEE============EEE===EEE===EEE===EEE===EEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEwwwwwwwwwwwwwwwwww††††††††††††††††††††††††††††††††††††††††††‘‘‘†††‘‘‘††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘––––––ffffff¶¶¶¶¶¶ÁÁÁ†††pppVVVNNNNNNGGGVVVVVVfff†††www†††fff‘‘‘††††††fff^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^fff‘‘‘ªªªfff^^^VVV^^^VVV^^^VVV^^^VVV^^^VVVVVV^^^VVV^^^fff‘‘‘‘‘‘‘‘‘ppp^^^fffVVVVVVVVVfff–––ÁÁÁÎÎÎ×××ßßßçççÎÎΪªªÁÁÁÎÎÎ××××××ÁÁÁ –––‘‘‘ ßßßççççççßßß×××ÁÁÁªªªªªª ªªª –––‘‘‘‘‘‘‘‘‘––– ªªª †††ppp^^^GGGEEE=========EEEGGGfff†††‘‘‘††††††‘‘‘¶¶¶°°°¶¶¶ÎÎΪªª ÇÇÇÇÇǶ¶¶ ––––––––––––––––––––––––––––––––––––––––––‘‘‘––––––‘‘‘–––‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘EEE""""""333333333333===333===333===333333===333===333333======333==================================================================EEE===EEE======EEE===EEE===EEE===EEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEwwwwwwwwwwwwwwwwww†††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘†††‘‘‘‘‘‘–––ppp^^^fff¶¶¶ÇÇÇ×××°°°‘‘‘ppp^^^NNNNNNGGGNNN^^^^^^†††www†††fff‘‘‘‘‘‘^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^fffVVV^^^^^^fffwww ªªª^^^^^^VVVVVV^^^VVVVVVVVV^^^VVVVVVVVVVVV^^^^^^pppwwwwww††††††VVV^^^NNNNNNVVV^^^www–––ÁÁÁßßßßßß×××ÁÁÁÎÎÎßßßÎÎÎÁÁÁÁÁÁªªª–––¶¶¶×××çççççççççÎÎÎÁÁÁ°°°ªªª ––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††††††††††††††‘‘‘‘‘‘†††www^^^NNNEEE===EEENNNfff†††‘‘‘††††††°°°ÁÁÁÁÁÁ°°°ªªª¶¶¶×××ÎÎ涶 ––––––––––––––––––––––––––––––––––––––––––––––––‘‘‘–––‘‘‘‘‘‘–––‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††VVV---"""---333333===333333333===333333333333333333333===333======333======333=============================================EEE==================EEE===EEE===EEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEwwwwwwwwwwww††††††††††††††††††††††††††††††††††††††††††‘‘‘††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††††††††‘‘‘wwwffffff‘‘‘ÁÁÁÇÇÇ××׶¶¶–––ppp^^^NNNNNNGGGNNN^^^^^^pppwwwppp‘‘‘‘‘‘www†††fffffffff^^^^^^fff^^^^^^fff^^^fff^^^fff^^^^^^fffffffffppp‘‘‘ÁÁÁfff^^^VVV^^^VVV^^^VVV^^^^^^^^^VVV^^^VVV^^^fff‘‘‘‘‘‘wwwpppwwwpppfffVVVNNNNNNVVVfffªªªÎÎÎßßßÁÁÁÇÇÇÇÇÇÎÎÎÁÁÁªªªªªª¶¶¶ççççççïïïççç×××ÁÁÁ°°°ªªª –––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††wwwwwwwwwwwwwww‘‘‘ªªª¶¶¶°°°www===333===EEENNNfff†††‘‘‘††††††–––¶¶¶ÁÁÁ¶¶¶ªªª ÎÎÎßßß×××ÁÁÁªªª–––––––––––––––––––––––––––––––––––––––––––––‘‘‘––––––‘‘‘–––––––––––––––‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘ppp333""""""333333333===333===333333333333===333333333333===333333======333=======================================EEE===EEE===EEE==================EEE===EEEEEE======EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEwwwwww†††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘††††††‘‘‘†††‘‘‘†††††††††wwwwww††††††‘‘‘‘‘‘¶¶¶–––ÁÁÁÎÎÎÁÁÁ–––www^^^VVVNNNGGGNNNVVV^^^ffffff‘‘‘–––†††‘‘‘^^^fff^^^fff^^^fff^^^fff^^^fffVVV^^^^^^fffffffffpppwww ‘‘‘pppfffVVV^^^^^^VVVVVV^^^VVV^^^VVVVVV^^^^^^fffpppwww††††††††††††††††††ppp^^^^^^NNNNNNNNN^^^ppp–––¶¶¶ÇÇÇÎÎÎÁÁÁ–––ªªª‘‘‘¶¶¶çççççççççççç×××ÁÁÁªªª –––––––––‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††††††††wwwwwwpppppppppppp–––°°°¶¶¶ VVV333333333333===EEENNNppp†††‘‘‘††††††‘‘‘°°° ªªª°°°¶¶¶ßßßççç×××ÁÁÁªªª––– ––– ––––––––––––––––––––––––––––––––––––––––––‘‘‘––––––‘‘‘––––––‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘EEE""""""---333===333===333333333===333333333333===333333======333======333=============================================EEE===EEE======EEE===EEEEEEEEEEEEEEEEEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEwwwwwwwww†††††††††††††††††††††††††††††††††††††††††††††‘‘‘††††††††††††wwwwwwffffff^^^^^^^^^^^^www°°°¶¶¶ ªªª‘‘‘ °°°ÎÎ涶–––www^^^VVVVVVNNNNNNVVV^^^fffwww†††‘‘‘†††‘‘‘‘‘‘www^^^^^^fff^^^ffffffffffffVVV^^^fffffffffffffffpppwwwªªªÁÁÁ‘‘‘ppp^^^^^^^^^VVV^^^^^^VVV^^^VVVVVVVVV^^^^^^pppwwwpppwww‘‘‘††††††www^^^NNNNNNVVVfffªªªÇÇÇ×××××××××ÎÎÎççççççççççççßßßÇÇǶ¶¶°°°ªªª––––––‘‘‘––––––‘‘‘‘‘‘‘‘‘‘‘‘†††††††††wwwwwwwwwpppwww–––ªªª°°°‘‘‘NNN333333333333===333======EEEVVVppp†††–––††††††‘‘‘°°°ÁÁÁ¶¶¶ÁÁÁÇÇÇßßßççç×××ÁÁÁªªª––––––––––––––––––––––––––––––––––––––––––‘‘‘––––––––––––––––––‘‘‘–––––––––‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘VVV------333333333333===333333333333333===333333===333===333===333===333===333==========================================EEE======EEE===EEE===EEE===EEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEGGGEEEEEEwww††††††††††††††††††††††††††††††††††††††††††††††††††††††wwwpppffffff^^^^^^^^^^^^VVV^^^VVV^^^^^^ppp^^^‘‘‘ÁÁÁ ––– °°°¶¶¶¶¶¶ÎÎÎÁÁÁ–––fff^^^VVVNNNNNNNNN^^^fffpppwww–––†††–––†††‘‘‘††††††fff^^^ffffff^^^fffffffff^^^^^^ffffffffffffffffffwwwÁÁÁïïïçççÇÇdž††^^^^^^^^^VVV^^^VVV^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^–––www†††–––‘‘‘^^^^^^VVVNNNNNN^^^ppp†††°°°ÇÇÇ×××çççççççççççççççßßßßßß×××ÎÎÎÁÁÁªªª ––––––‘‘‘‘‘‘‘‘‘††††††††††††wwwwwwwww–––ªªª°°°‘‘‘VVV333---333333===333======333======GGGVVVwww†††‘‘‘††††††‘‘‘–––ÁÁÁÁÁÁ¶¶¶ÁÁÁßßßßßß××׶¶¶ªªª––– ––– ––– ––– –––––––––––––––––––––––––––––––––––––––––––––‘‘‘–––‘‘‘––––––‘‘‘ppp333""""""333333333===333333333333333===333===333333===333===333333===333=========333=======================================EEE======EEE===EEE===EEEEEEEEEEEE===EEEEEEEEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE††††††††††††††††††††††††††††††††††††††††††wwwpppfff^^^^^^VVVVVVVVVVVV^^^^^^VVVVVVVVV^^^VVV^^^^^^pppNNN^^^––– ‘‘‘–––°°°××× °°°×××ÇÇÇ pppfff^^^VVVNNNNNN^^^^^^ppp††††††–––††††††††††††ffffff^^^fffffffffffffff^^^^^^ffffffffffffpppfff†††ßßßïïïýýýýýýßßß www^^^^^^^^^VVV^^^VVV^^^VVV^^^VVVVVV^^^VVV^^^^^^wwwwww††††††††††††pppVVVVVVNNNNNNVVVppp††† ¶¶¶×××ßßßßßßçççßßßßßßßßßßßßßßß×××ÎÎÎÎÎÎÁÁÁ°°° –––‘‘‘‘‘‘††††††–––°°°°°°–––VVVEEE===EEE============EEEEEEGGGGGG======EEEGGG^^^www‘‘‘†††††† °°°ÁÁÁ¶¶¶°°°°°°ÎÎÎßßßÎÎ涶ªªª–––––– –––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––‘‘‘†††EEE""""""---333333333333333333333333333===333333===333===333===333333===333333======333=======================================EEE======EEE===EEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE††††††††††††††††††††††††††††††††††††††††††††††††wwwpppfff^^^VVVVVVVVVVVVVVVVVVNNNVVV^^^VVV^^^VVV^^^VVVVVV^^^NNNVVVfffVVVGGGfff ††† ªªªÎÎΰ°°ÁÁÁ¶¶¶×××ÎÎΪªª–––†††wwwfffVVVNNNNNN^^^^^^fffwww––– †††††††††††††††ppp^^^ffffffffffff^^^ffffffpppfffffffffppp ïïïýýýýýýýýýýýýïïïÎÎΆ††fff^^^^^^^^^^^^^^^VVV^^^^^^VVVVVV^^^VVV^^^VVV^^^ppp†††–––†††wwwwwwwwwVVVVVVGGGNNNVVV^^^www‘‘‘°°°ÎÎÎßßßßßß×××ßßßßßßßßßçççßßßßßßßßßßßßÎÎÎÁÁÁ¶¶¶ –––‘‘‘†††www†††‘‘‘°°°¶¶¶ªªªfffNNNNNN^^^^^^VVVGGGGGGGGGNNNVVV^^^VVVGGGEEE=========GGG^^^www†††‘‘‘††††††–––ÁÁÁ°°°ªªª°°°¶¶¶¶¶¶××××××ÁÁÁªªª––– ––– ––– ––– ––– ––––––––– ––– ––– –––––––––––––––––––––‘‘‘VVV---"""---333333333333333333333333333333333333333===333===333===333333======333333======333====================================EEE======EEE===EEEEEEEEEEEE===EEEEEEEEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE††††††††††††††††††††††††††††††††††††††††††wwwpppfff^^^^^^VVVVVV^^^^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^VVV^^^VVVVVVVVVNNNVVVNNNfffVVVGGG†††ppp‘‘‘¶¶¶¶¶¶°°°ÇÇÇßß߶¶¶°°°ÎÎÎßßßÁÁÁ°°°–––†††ppp^^^NNNNNNVVVffffff†††††††††‘‘‘‘‘‘†††fffffffffffffff^^^^^^fffffffffppppppwwwÁÁÁïïïýýýýýýýýýýýýýýýýýýçç窪ªwww^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^VVV^^^www†††–––††††††wwwffffffVVVNNNGGGGGGVVV^^^www‘‘‘¶¶¶×××××׶¶¶ÎÎÎ××××××ßßßççççççßßßçççßßßßßß×××ÇÇÇÁÁÁªªª–––†††††††††ªªª¶¶¶ÁÁÁªªª^^^^^^fffpppppppppppp^^^^^^www‘‘‘†††wwwfffNNNEEE============GGG^^^†††–––††††††°°°¶¶¶ –––°°°ÁÁÁ°°°ÁÁÁ×××ÎÎÎ ––– ––– ––– ––––––––– –––––– ––– ––– –––––– ––––––––––––ppp333""""""333333333333333333333333333333333===333333===333===333333===333333===333===333===333=============================================EEE===EEEEEE===EEEEEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE††††††††††††††††††††††††††††††††††††wwwffffff^^^VVVVVVVVV^^^VVV^^^^^^VVV^^^^^^VVV^^^^^^VVV^^^^^^VVV^^^VVVNNNNNNGGGVVVNNNVVVVVVfffNNNNNNfff^^^ °°° ÎÎÎ×××ÁÁÁªªªªªªÎÎÎçççßßßÎÎΰ°°†††ppp^^^^^^VVVVVV^^^fffppp†††‘‘‘–––‘‘‘‘‘‘†††‘‘‘pppffffff^^^fffppppppfffpppfff×××ýýýýýýýýýýýýýýýýýýýýýýýýïïï××ב‘‘fff^^^^^^^^^^^^^^^VVV^^^^^^^^^VVV^^^^^^^^^^^^fff‘‘‘†††††††††‘‘‘†††www^^^VVVVVVNNNGGGGGGVVVfff ÁÁÁÇÇÇÎÎÎ×××ßßßßßß×××ßßßßßßßßßßßßßßßßßßçççßßß×××ÎÎÎÇÇÇ°°° –––fff^^^^^^VVVNNNNNNNNNNNN^^^fffppp‘‘‘ªªª †††ppp^^^VVVGGG============EEENNNfffwww‘‘‘‘‘‘††††††††††††ªªªÁÁÁ¶¶¶°°° ªªª ––– ––– ––– ––– –––––– ––– ––– –––––– –––––––––––––––†††EEE""""""---333333333333333333333333333333333333===333===333333===333333===333=========333======333=================================EEE=========EEE===EEEEEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE†††††††††††††††††††††††††††wwwpppfff^^^VVVVVVVVVVVV^^^^^^^^^^^^^^^VVV^^^^^^VVVVVV^^^VVV^^^VVVVVVVVVNNNGGGGGGGGGGGGNNNNNNVVVVVVVVVfffNNNGGGppppppVVV^^^‘‘‘ ÁÁÁ¶¶¶ÇÇÇÁÁÁ°°° çççïïïßßß××׶¶¶†††wwwppp^^^^^^VVV^^^fffppp†††‘‘‘†††‘‘‘†††ffffff^^^ffffffpppfffpppppp–––ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçç窪ªwww^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^ppp††††††pppfffffffffppppppVVVNNNGGGGGGNNN^^^ppp‘‘‘°°°××××××ÁÁÁ×××ßßßßßßÎÎÎ×××ççç×××××××××ßßßßßß××׶¶¶–––pppfffVVVNNNVVV^^^fffVVVGGGEEEGGGGGGNNNVVVfff‘‘‘ffffffpppVVVGGGGGGEEE===333===EEENNN^^^www†††‘‘‘††††††°°°¶¶¶¶¶¶ÇÇǶ¶¶ ‘‘‘––– ––– ––– ––– ––– ––– ––– ––– ––– –––‘‘‘VVV------333333333333333333333333333333333===333333333===333333333333333333333===333======333=============================================EEE===EEE======EEEEEE===EEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE†††††††††††††††††††††pppppp^^^VVVVVVVVVVVV^^^VVV^^^^^^VVVVVV^^^VVVVVV^^^^^^VVV^^^^^^VVVVVVVVVNNNNNNGGGGGGNNNNNNNNNNNNVVVVVVVVVVVVNNNfffNNNEEEwww‘‘‘^^^fff–––¶¶¶ÇÇÇÎÎ涶¶¶¶ªªªççççççÎÎÎ×××ßßßÁÁÁ–––‘‘‘ppp^^^VVV^^^ffffffwww†††‘‘‘ppp††††††pppfffffffffpppfffppppppwww¶¶¶ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï××ב‘‘fff^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^fffppp‘‘‘www‘‘‘††††††fff^^^^^^NNNGGGGGGVVV^^^www–––°°°ÁÁÁ×××ßßßßßß×××ßßßçççßßßÎÎ涶ªªª–––pppffffff^^^VVVVVVNNNNNNNNN^^^^^^VVVGGGGGGEEEEEEGGGNNNNNN^^^pppwwwwwwwwwppp^^^VVVGGGEEE======333===EEEGGG^^^ppp‘‘‘†††††† ¶¶¶ÁÁÁ¶¶¶ªªª –––––– ––– ––– ––– ––– ––– ––– –––––– ––– –––ppp---""""""---333333333333333333333333333333333333===333333===333===333333===333333===333333===================================================EEE======EEE======EEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE††††††††††††††††††wwwpppfff^^^VVVVVVVVVVVVVVV^^^VVV^^^^^^^^^VVV^^^^^^VVVVVV^^^VVV^^^^^^VVVVVVVVVNNNNNNNNNGGGNNNVVVVVVVVVVVVVVVVVVVVVNNNVVVVVV^^^GGG333VVV†††††††††ffffffªªª×××ßßß°°°°°°ªªªçççççç×××çççÎÎÎßßßÇÇǶ¶¶°°°–––wwwfffVVVVVVffffffppp †††–––ppppppfff^^^fffppppppfffpppÎÎÎïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçç窪ªwwwfff^^^^^^^^^^^^VVV^^^^^^^^^^^^VVV^^^^^^^^^^^^pppwww†††‘‘‘‘‘‘fffVVVNNNGGGNNNVVVfffwww‘‘‘°°°ÎÎÎßßßçççççççççÎÎΪªªwwwffffff^^^fffffffff^^^^^^^^^^^^^^^VVVNNNNNNNNNVVVVVVNNNGGGGGGEEEEEEGGGNNNVVVfffwwwwwwwww^^^NNNGGG======333======EEEGGGNNNVVV^^^www††††††‘‘‘‘‘‘††††††–––ªªª¶¶¶ÁÁÁ ––– ––– ––– ––– ––– ––– †††EEE""""""---333333333333333333333333333333333333333333===333333333333333333333===333333======333333=============================================EEE======EEEEEEEEEEEE===EEE===EEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE†††††††††††††††wwwpppfff^^^VVVVVVVVVVVVVVVVVV^^^VVV^^^VVV^^^^^^VVV^^^VVVVVVVVV^^^VVVVVVVVVVVVNNNNNNNNNNNNNNNVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVNNN^^^GGG333GGGfff––– ‘‘‘ffffff ßß߶¶¶ªªªªªªÇÇÇçççççççççÎÎÎ×××ïïïïïïßßßÇÇǪªªpppVVVVVV^^^pppppp‘‘‘††††††‘‘‘fffffffffpppfffppppppppp†††çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýý×××–––fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff–––‘‘‘†††††††††‘‘‘‘‘‘^^^VVVVVVGGGGGGNNNVVV^^^www†††ªªªÇÇÇßßßßßß fff^^^^^^VVVNNNVVVVVV^^^fff^^^^^^fff^^^^^^VVVVVVVVVVVV^^^VVV^^^VVVNNNEEEEEEGGGNNNNNNVVV^^^ppppppfffVVVGGG===EEEEEEGGG^^^fffppp^^^NNNVVV^^^ppp†††www‘‘‘°°°ÎÎÎÎÎΰ°°‘‘‘––––––––– ––– ––– ––– ––– ––––––‘‘‘VVV"""""""""333333333333333333333333333333333333333===333333===333===333===333333333===333333================================================EEE===EEE======EEE===EEEEEE===EEEEEE===EEE===EEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE††††††wwwpppfff^^^VVVVVVNNNVVVVVVVVVVVVVVV^^^^^^VVV^^^VVVVVVVVVVVV^^^VVVVVVVVVVVVVVVVVVNNNVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVVVV^^^NNN333333GGG –––‘‘‘VVV^^^°°°¶¶¶ÇÇÇ ×××ßßß××××××ïïïïïïïïïïïïïïï×××°°°†††ppp^^^VVV^^^ffffffwww‘‘‘–––†††pppfffffffffpppppppppppp ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÇÇÇfff^^^^^^^^^^^^^^^^^^^^^^^^fffpppfff^^^^^^^^^fff†††wwwwww††††††fffVVVNNNGGGGGGNNNVVV^^^ppp†††ªªªÇÇÇ ppp^^^^^^VVVVVVNNNNNNVVV^^^^^^^^^^^^VVVNNNVVVVVV^^^ffffffNNNGGGVVVVVVNNNNNNNNNGGGEEEGGGNNNNNNVVV^^^^^^fff^^^NNNGGGVVVwwwwwwwwwffffffNNNNNNVVVpppwwwpppwwwwww °°°°°°ÁÁÁÁÁÁªªª–––‘‘‘–––––– ––– –––––– ––– ––––––ppp---""""""---333333333333333333333333333333333333333333===333333333333333===333===333333===333===333=============================================EEE===EEE===EEEEEE===EEEEEE===EEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEwwwppp^^^VVVVVVNNNVVVNNNVVVVVVVVVVVV^^^VVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVNNNNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV333---333NNN‘‘‘ªªª^^^NNNNNNfff ÎÎÎ ÇÇÇÇÇǶ¶¶çççïïïïïïýýýïïïïïïïïïßßß°°°†††pppfffffffffpppfffwww–––pppffffffppppppppppppwwwÁÁÁïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýý××× ppp^^^^^^^^^^^^fffwww††††††‘‘‘ffffff^^^^^^fffwww†††––– –––‘‘‘pppfff^^^VVVGGGGGGGGGNNNVVV^^^ppp‘‘‘ªªª‘‘‘ppp^^^^^^^^^VVVNNNGGGNNNVVVfff^^^^^^NNNGGGVVV^^^^^^^^^NNNGGGNNNNNNNNNVVVNNNNNNVVVNNNGGGGGGGGGNNNVVVVVVfff^^^NNNNNNNNNVVVffffffVVVGGGGGGVVVfffwwwffffffwwwwwwwww†††ªªªÇÇÇ××תªª‘‘‘–––‘‘‘‘‘‘––––––––– ––– ––– ––– ––––––===""""""---333333333333333333333333333333333333333333333333333333===333333333333333===333===333==========================================EEE===EEE============EEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^VVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVVVVV^^^VVV^^^VVVVVVVVVVVVVVVVVV^^^VVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVVVVVVV^^^^^^VVV===------===NNNfff†††VVV^^^GGG^^^ ‘‘‘ÎÎÎ××× ßßßïïïýýýççççççïïïßßßçççßß߶¶¶–––†††wwwppppppfffppppppppppppppppppppppppÎÎÎýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÎÎÎffffff^^^fff‘‘‘‘‘‘†††††††††‘‘‘fff^^^fff––– –––‘‘‘†††‘‘‘––––––fff^^^VVVNNNGGGEEEGGGNNNVVVfffwww–––ªªªªªª‘‘‘wwwfff^^^VVVGGGNNNNNNVVVfff^^^^^^VVVNNNNNNNNNVVV^^^VVV^^^VVVNNNGGGNNN^^^^^^^^^VVVGGGEEEGGGGGGNNNNNNVVV^^^^^^VVVNNNNNNGGGNNNNNN^^^ffffffpppppppppfffVVV^^^fffwwwwww–––°°°ªªªÁÁÁÇÇǪªª‘‘‘‘‘‘‘‘‘–––––– ––– ––– –––‘‘‘NNN"""""""""333333333333333333333333333333333333333333333333333333333333333333333333333===333333============333=============================================EEE===EEEEEEEEEEEEEEE===EEEEEE===EEEEEE===EEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVVVVVVVVVVVVNNNVVVVVVVVV^^^VVVVVV^^^VVVVVVVVV^^^VVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV======333---EEEVVVpppVVV†††‘‘‘VVVNNNVVV‘‘‘×××ççç°°°ßßßïïïïïïïïïÇÇÇÎÎΪªªÁÁÁßßßçççÁÁÁ°°°ªªª°°°ªªª†††wwwppppppfffpppwwwwwwwwwpppwww†††ßßßýýýýýýýýýýýýïïïïïïïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýßßß pppffffffppp††††††‘‘‘‘‘‘†††wwwpppppppppfffpppppp††† ‘‘‘wwwVVVVVVNNNGGGGGGGGGNNN^^^ppp ¶¶¶¶¶¶ wwwffffff^^^^^^^^^^^^NNNVVV^^^fff^^^VVVNNNNNNNNNVVV^^^^^^NNNNNNVVV^^^^^^^^^VVVNNNNNNGGGEEEGGGNNNNNNVVV^^^www‘‘‘ppp^^^ppppppfff^^^wwwwwwwwwwwwpppppp^^^VVV^^^fffwww††† ÁÁÁÇÇÇ pppwww†††‘‘‘––––––––– ––– –––ppp---""""""---333333333333333333333333333333333333333333333333333333333333333333333333333===333===333=========================================================EEE===EEEEEE===EEEEEE===EEE===EEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEENNNVVVVVVVVVVVVVVV^^^^^^VVV^^^VVVVVV^^^VVV^^^VVVVVVVVVVVVNNNNNNNNNNNNVVVVVVVVVVVVVVVVVVNNNVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV======333333333GGGGGGEEE‘‘‘–––†††^^^GGG^^^ªªªßßß×××ïïïýýýïïïççç ªªª‘‘‘¶¶¶ßßßïïïççççççßßßÎÎÎÇÇÇÁÁÁ–––pppppp††††††www ïïïýýýýýýýýýýýýÇÇǪªª ßßßýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÇÇdž††fff^^^ffffffppp‘‘‘–––†††‘‘‘–––fff^^^^^^ppp††† ªªª–––wwwpppppp^^^^^^^^^VVVVVVGGGGGGGGGGGGVVV^^^www‘‘‘°°°ÎÎÎÎÎΪªªpppffffff^^^VVVVVVNNNVVV^^^^^^VVV^^^VVVNNNNNNVVV^^^^^^ffffffNNNVVVVVV^^^fff^^^VVVNNNGGGNNNNNNVVV^^^ †††wwwwwwfffNNNNNNGGGNNNNNNVVVNNNNNNGGGEEEEEEGGGVVVfffwww‘‘‘‘‘‘wwwwwwwwwwwwwww†††––––––––– ––– ===""""""---333333333333333333333333333333333333333===333333333333333333333333333333===333===333======333================================================EEE===EEE===EEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVVVVVV^^^VVV^^^VVVVVVVVVVVVVVV^^^VVVVVVVVVVVVVVVNNNNNNNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVV===EEEGGG===333333GGGGGGppp––––––‘‘‘EEEVVVppp ÎÎÎïïïýýýïïïïïï‘‘‘‘‘‘×××ïïïïïïïïïïïïçççÎÎÎ××××××ÎÎΪªª††††††‘‘‘ªªªªªª–––††††††°°°ïïïýýýýýýýýýýýýÎÎ涶wwwßßßýýýçççïïïýýýýýýýýýýýýçççÁÁÁçççýýýýýýýýýýýýýýýýýýýýýýýýßßߪªªppp^^^^^^fff†††‘‘‘–––‘‘‘ffffffwwwwwwfffffffffffffffpppwwwpppfff^^^VVVNNNGGGGGGGGGNNNVVVpppªªªÇÇÇ×××ÇÇÇ°°°‘‘‘pppfff^^^ffffffVVVVVVGGGVVV^^^^^^^^^VVVVVVNNNVVVfffffffff^^^VVVGGGVVVVVV^^^^^^^^^VVVVVVVVVVVV‘‘‘fff^^^fff^^^NNNGGG===========================EEEGGGfff†††wwwwwwppp^^^fffppp‘‘‘‘‘‘––––––‘‘‘GGG------333333333333333333333333333333333333333333333333333===333333333===333333333333======333================================================EEE===EEEEEEEEE===EEEEEEEEE===EEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVVVVVVVNNNNNNNNNNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNNNNVVVVVV^^^===NNNfffNNN===---333NNN^^^ppp VVV‘‘‘ffffff†††×××ïïïýýýççç fff†††ÎÎÎïïï×××çççïïïïïïïïïïïïÎÎÎ××××××ÁÁÁ¶¶¶ÇÇÇ×××ÎÎÎÁÁÁ –––ÎÎÎïïïýýýýýýýýýýýýýýýççç‘‘‘ççççççwww¶¶¶ÎÎÎßßßýýýýýý°°°GGG‘‘‘ïïïýýýýýýýýýýýýýýýýýýýýýýýýïïïÎÎΆ††ppp^^^fffwww†††–––‘‘‘††††††wwwffffff^^^^^^^^^^^^wwwwww††††††www^^^^^^^^^VVVNNNGGGGGGGGGVVVfffwww–––¶¶¶ÎÎÎßßßßßß°°°†††wwwpppppp^^^VVVNNNNNNGGGNNN^^^^^^^^^^^^VVVfffffffffffffff^^^VVVNNNVVVffffffffffffwww†††^^^GGGEEEEEEGGGGGGEEE===333333333333333333333333======VVV†††ppp^^^^^^VVVVVVGGGGGGVVVVVVffffffwww†††‘‘‘‘‘‘fff---""""""333333333333333333333333333333333333333333333333333333333333333333333===333===333333===333===333===333====================================EEE===EEE===EEE===EEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVVV^^^VVVVVV^^^VVV^^^VVVVVVVVVVVVVVVNNNNNNNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVVVVVNNNNNNVVVNNNVVVNNNVVV^^^EEE^^^ppp^^^EEE333333===NNNfffppp‘‘‘fff‘‘‘–––pppVVVpppÇÇÇïïïïïïÎÎÎpppÎÎÎçççÁÁÁ×××çççýýýýýýççç°°°×××ççççççççççççïïïïïïçççÇÇǶ¶¶ßßßýýýýýýýýýýýýýýýýýýïïï ïïïÎÎÎ^^^–––wwwïïïýýý××× fffýýýïïïÎÎÎïïïýýýýýýýýýýýýýýýýýýýýýßßߪªªwwwfffwwwwwwppp†††††† †††ppp^^^^^^^^^^^^pppppp†††wwwwwwwwwwwwppp^^^^^^VVVGGGGGGGGGNNNVVVpppªªªÁÁÁßßß××׶¶¶°°° pppppp^^^VVVNNNNNNNNNNNNVVVVVVfff^^^fffffffffpppfffffffff^^^fffwww–––¶¶¶ÇÇÇÎÎΪªªpppNNNEEE=========333===333333333333333===---======EEEGGGNNNfffpppfffEEE===333333------NNN^^^^^^^^^^^^fffpppwwwppp333""""""---333333333333333333333333333333===333333===333333333333333===333===333333333===333333===333===333==========================================EEE===EEEEEE===EEE===EEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^VVV^^^VVV^^^VVVVVVVVVNNNVVVNNNVVVVVVVVV^^^VVV^^^^^^VVVVVVVVVNNNVVVNNNVVVVVVNNNNNNVVVNNNVVVNNNVVVVVVVVVNNNVVVNNNVVVVVVVVVVVVVVVNNNVVVVVVVVVNNNVVVVVVVVVVVV^^^GGG^^^ppppppGGGEEE333333===GGGpppfff^^^–––ªªªªªª^^^NNN^^^ÇÇÇïïïÎÎÎwwwÁÁÁÇÇÇ°°°ÎÎÎýýýïïïïïïÁÁÁ–––ßßßïïïïïïïïïçççßßßýýýïïïïïïßßßçççýýýýýýýýýýýýýýýýýýýýý°°°ÎÎÎÎÎÎVVV °°°–––ïïïýýýýýýßßßpppïïïßßßVVVÁÁÁïïïýýýýýýýýýýýýýýýýýýýýýïïïÎÎΆ††pppfff^^^fff†††‘‘‘ www†††wwwpppfff^^^^^^ffffff††††††‘‘‘^^^^^^^^^VVVNNNGGGGGGGGGVVV^^^ppp†††°°°ÇÇÇßßßßßßßßß°°° †††fff^^^^^^^^^fffNNNGGGNNNNNN^^^^^^ffffffffffffpppppp†††ªªªÇÇÇßßßßßßßßßßßßßßß××× fffNNN======333333333===333=========333333===EEE======NNNNNNGGG333"""------"""333VVV^^^^^^^^^^^^^^^^^^^^^^^^NNN===333---333333333333333333333333333333333333===333333333333333===333333333333===333333======333===333===333==========================================EEE===EEE===EEEEEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^^^^VVVVVVNNNNNNNNNNNNNNNNNNVVVVVVVVV^^^VVVVVVVVVVVVVVVNNNVVVVVVNNNVVVNNNNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^EEEVVVwww^^^EEE======333===NNNpppppp °°°ÁÁÁ–––^^^NNNfff¶¶¶×××ÇÇÇ ¶¶¶ÎÎÎïïïýýýïïï°°°ªªªÇÇÇ×××çççýýýïïïçççÎÎÎÎÎÎßßßïïïïïïïïïýýýýýýýýýýýýýýýýýýýýýªªªwww wwwÎÎÎÇÇÇïïïýýýïïï pppïïïÇÇÇEEEwww––––––ýýýýýýýýýýýýýýýýýýýýýýýýßßߪªªwwwfff^^^fffwww†††‘‘‘‘‘‘‘‘‘†††††††††fff^^^^^^^^^ppp†††††††††‘‘‘†††ppp^^^^^^VVVNNNGGGGGGGGGVVVfffwww ÁÁÁßßßççç×××××× ‘‘‘†††pppfff^^^VVVNNNNNNVVVfff^^^fffwww–––°°°ÁÁÁÎÎÎ×××çççßßßçççççççççßßßçççÎÎÎ fffEEE============333333333======333------""""""------""""""333------===VVV^^^^^^^^^^^^^^^VVV^^^VVVVVVNNNGGGGGG======333333333333333333333333333333333333333333===333333===333===333===333===333===333333=========333==========================================EEE===EEE===EEE======EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVVVVVVNNNNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVVVVVNNNVVVNNNVVVNNNNNNNNNVVVNNNVVVNNNVVVVVVVVVVVVVVVVVV^^^VVVVVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^^^^EEEGGGVVVwwwfffEEE=========333===GGGppp‘‘‘°°° ‘‘‘VVVfffªªªßßßçççÁÁÁÎÎÎïïïýýýïïïÇÇǶ¶¶ÁÁÁßßßýýýïïïýýýýýýïïﶶ¶°°°–––ªªªïïïïïïýýýýýýýýýýýýýýýýýýýýý××׆†† www‘‘‘ppp×××ýýýÇÇÇfffªªªýýý¶¶¶=========NNNïïïýýýýýýýýýýýýýýýýýýýýýýýýçççÇÇdž††pppfff^^^fff††††††‘‘‘––––––pppffffff^^^pppwwwwww†††††††††††††††fff^^^^^^^^^VVVNNNGGGGGGNNN^^^www‘‘‘¶¶¶ßßßßßßßß߶¶¶¶¶¶ÎÎÎ××תªª†††pppfffffffffppppppwww†††ªªªÎÎÎßßßßßß×××ßßßßßßççççççççççççßßßßßßßßß×××°°°‘‘‘GGG===333------"""333EEEEEE333"""""""""------"""---===VVV^^^VVV^^^VVVVVV^^^VVVVVV^^^VVVVVVVVVNNNNNNEEE======333333333333333333333333333333333333333===333333333===333===333===333======333===333================================================EEEEEE===EEE===EEE===EEEEEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEENNNNNNVVVVVVVVVVVVVVVVVV^^^^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNNNNVVVNNNVVVVVVVVVVVVVVVVVV^^^^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVV^^^VVVVVV^^^^^^^^^EEEEEEGGGfff^^^EEEEEEEEE======333333EEEppp–––°°° ªªª†††VVV^^^ ÎÎΪªªªªªÇÇÇßßßÇÇÇ‘‘‘ªªªÁÁÁçççïïïýýýýýýýýýýýý×××ÎÎΖ–––––çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïßßßÎÎÎÇÇÇppp×××ýýý wwwçççýýý¶¶¶NNN===333NNNïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýßßß wwwfffffffffppp‘‘‘‘‘‘†††‘‘‘††††††wwwfff^^^fffffffffppppppppppppppp^^^VVV^^^^^^VVVVVVVVVGGGNNNNNNVVVppp‘‘‘¶¶¶ßßß××׶¶¶ÎÎÎßßßßßß×××ÇÇÇ ††† ªªª°°°¶¶¶ÁÁÁÇÇÇßßßççççççßßßßßßççççççßßßççççççßßßÎÎΰ°° pppNNN===333------------"""""""""---"""""""""""""""""""""===VVV^^^VVVVVV^^^VVVVVVVVVVVV^^^VVVVVVVVVVVVVVVVVVNNNGGGEEE===333333===333333333333333333333===333333======333===333===333===333===333===================================================EEE===EEE===EEE===EEE===EEE===EEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVVVVVVVVVVVV^^^VVVVVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVNNNVVVNNNVVVVVVVVVVVVVVVVVVVVVVVV^^^VVV^^^VVVVVVVVV^^^VVV^^^^^^^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^^^^fff^^^ffffffEEEGGGNNNpppNNNEEEEEEGGGEEE======333333EEEwww°°°ªªª‘‘‘wwwNNNwww‘‘‘ªªª °°°ÇÇÇ°°°°°°ÎÎÎïïïýýýýýýýýýýýýýýýïïïççç×××ÇÇÇ°°°ïïïïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççýýýýýý†††NNN–––ïïï°°°^^^NNNVVV^^^çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýý××׆††ppppppwww‘‘‘––––––‘‘‘†††††††††www^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^VVV^^^NNNNNNNNN^^^ppp‘‘‘¶¶¶×××ÁÁÁÁÁÁÁÁÁ×××ßßßÇÇǪªªppppppwwwªªª¶¶¶×××ßßßßßßßßßçççççç×××çççßß߶¶¶ªªª‘‘‘fffGGG===333------333333---""""""""""""EEEVVV^^^VVV^^^^^^VVV^^^VVV^^^VVV^^^VVV^^^^^^VVVVVVVVVVVVNNNGGGEEE===333333333333333333===333333===333333333===333======333===333======333===================================================EEE===EEE===EEE===EEEEEEEEE===EEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVVV^^^^^^^^^VVV^^^VVVVVVNNNVVVVVVVVVVVVVVVVVVNNNVVVVVVNNNVVVVVVVVVVVVVVV^^^^^^^^^VVV^^^VVVVVVVVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ffffffffffffpppffffffGGGVVVfffpppVVVEEE===GGGEEEEEE============GGGppp††††††–––‘‘‘wwwVVV †††www ¶¶¶ÇÇÇÇÇÇßßßýýýýýýýýýýýýïïïýýýýýýççççççïïïçççßßßïïïýýýýýýýýýýýýýýýýýýýýýýýýïïïýýýýýýýýýýýýýýýýýýýýýýýý×××wwwïï着ªwwwwww†††fffÇÇÇ–––ßßßýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýèÇÇËccÔ''êõ÷îÕ%%§TT––––––‘‘‘†††ppppppfff^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^VVV^^^VVVVVVNNNNNNVVVppp‘‘‘¶¶¶ÎÎΰ°°‘‘‘–––†††ppp^^^VVV^^^^^^www ªªª ¶¶¶ßßßÎÎΰ°°‘‘‘pppGGG333---"""333GGGGGG333"""---------EEEVVVVVV^^^^^^^^^VVVVVVVVVVVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^VVVNNNNNNEEE===333333333333333333===333333===333===333===333============333=========================================================EEE===EEE===EEEEEEEEE===EEE===EEE======EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^^^^^^^VVV^^^VVVNNNGGGNNNVVVVVVVVVVVVVVVVVVVVVNNNVVVVVVVVV^^^^^^^^^^^^^^^^^^VVV^^^VVVVVV^^^VVV^^^^^^VVV^^^^^^^^^^^^fff^^^fff^^^fffffffffffffffpppfffffffffffffffppp‘‘‘^^^EEEGGGNNNNNNEEE=========EEEEEEEEEVVVwwwwww†††–––wwwÁÁÁ†††fffppp–––ÁÁÁÇÇÇçççýýýýýýýýýïïïýýýýýýýýýççççççïïïïïïççççççýýýýýýýýýýýýýýýýýýýýýýýý×××çççýýýýýýýýýýýýýýýýýýýýýýýýïïïïïïýýý°°°–––ÎÎΪªªppp××× °°°ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýú��ú��ú��ú��ú��ú��ú��ú��ú��Ù--“ŽŽ†††‘‘‘‘‘‘‘‘‘pppffffff^^^^^^^^^^^^VVV^^^^^^^^^VVV^^^^^^VVV^^^^^^VVVVVV^^^ppp‘‘‘°°°°°°pppwwwppppppfff^^^^^^VVV^^^VVV^^^ppp^^^GGG333---------===GGGVVVVVVVVVNNN333""""""EEEVVV^^^VVV^^^VVVVVVVVV^^^VVV^^^VVVVVVVVV^^^VVVVVVVVV^^^VVV^^^VVVVVVNNNEEE333======333333===333333===333===333===333======333===333===============================================================EEE===EEEEEEEEE===EEEEEEEEE===EEEEEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVVVVVVVVVVVVNNNNNNGGGNNNNNNVVVVVVVVVVVVVVVVVVVVV^^^^^^^^^^^^^^^^^^^^^^^^VVVVVV^^^VVV^^^^^^^^^^^^^^^fff^^^fffffffffffffffffffffpppfffppppppfffpppfffpppfffpppwww‘‘‘ –––^^^VVVwwwNNNEEEEEE===EEEGGGVVVGGGEEEVVVwwwwwwwww °°°‘‘‘^^^^^^†††ÁÁÁßßßçççïïïïïïýýýïïïýýýïïïýýýççççççýýý×××çççýýýýýýýýýýýýýýýýýýýýýýýýßßßÎÎÎçççýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýßßßÎÎÎïïï ¶¶¶www°°° ßßßýýýýýýýýýýýýýýýýýýýýýýýýú��ùû‰‰á³¨¨šVVéú��ú��ú��ºBB‘‘‘‘‘‘‘‘‘‘‘‘––––––†††^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^VVV^^^VVV^^^VVVVVV^^^ppp†††ªªª–––‘‘‘¶¶¶ÎÎÎ ‘‘‘†††fffNNNGGG===333------------333===EEEEEEGGGVVVNNNGGGEEE333""""""""""""""""""NNNVVV^^^^^^VVVVVVVVVVVVVVV^^^VVV^^^^^^VVV^^^^^^VVV^^^VVV^^^VVVVVVVVVNNN======GGGGGGEEE===333===333333===333===333===333======333=========333=========================================================EEEEEE===EEE===EEE===EEEEEE===EEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVVVVVVVVVNNNVVVVVVVVVVVV^^^VVV^^^^^^VVVVVV^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^fff^^^^^^fffffffffffffffffffffpppfffppppppppppppffffffppppppfffpppfffpppfffªªªwww‘‘‘‘‘‘wwwppp†††‘‘‘NNNEEEEEEEEEEEENNN^^^VVVEEEEEEVVVppp^^^fff°°°ÇÇÇ°°°fffpppwww†††ÇÇÇ×××ïïïççç×××ßßßýýýïïïýýýççç×××ïïïÁÁÁçççýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïçççýýýßßßßßßïïïýýýýýýýýýýýýýýýýýýýýýýýýýýý––––––‘‘‘GGGwww‘‘‘VVV°°°çççýýýýýýýýýýýýýýýýýýýýýúZZüïïýýýýýýïïï××ײllú��ú��ú��æ‘‘‘––– –––‘‘‘wwwfffú��ú��^^^^^^^^^VVV^^^^^^^^^^^^VVVVVVVVVVVVVVVNNNNNNVVV^^^ppp‘‘‘ªªª¶¶¶¶¶¶NNNEEE===---------333======EEEEEE======EEE333---333333333333------""""""""""""""""""---VVV^^^VVVVVVVVVVVVVVV^^^VVV^^^^^^VVV^^^VVVVVV^^^VVV^^^VVV^^^VVVVVVGGG======GGGNNNVVVNNNGGGEEE===333===333333333===333===333======333===333=========================================================EEE===EEEEEE===EEE======EEE===EEEEEE======EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVVVVVVVVV^^^VVV^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^VVV^^^ffffffffffffffffffffffffffffffpppppppppppppppppppppfffpppppppppppppppfffpppffffffpppwww†††www‘‘‘www‘‘‘†††VVVEEEEEE===EEEGGGVVVNNNEEE===EEENNNfff^^^†††ªªª†††ppp¶¶¶–––‘‘‘wwwÇÇÇçççïïïççççççïïïýýýçççïïïçççÎÎΪªªçççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýßßß°°°×××ýýýýýýýýýýýýýýýýýýýýýýýýýýýççç××תªªVVV†††–––ÇÇÇ‘‘‘ÇÇÇïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçÝÝú��ú��ú��ö‘‘‘‘‘‘wwwwwwffffff^^^^^^ú��ú��^^^^^^^^^^^^^^^VVVVVVVVVVVVNNNNNNGGGGGGGGGNNNNNNNNNVVVVVVVVVVVVNNNGGGEEE333===EEEEEEEEEEEEEEE===333333------"""""""""---"""------""""""""""""---""""""---VVV^^^^^^VVVVVVNNNVVVVVV^^^^^^^^^^^^VVV^^^VVVVVV^^^VVV^^^^^^VVVNNN======GGGNNNVVVVVVVVVVVVNNNGGGEEE======333===333===333============333===============================================================EEEEEEEEE=========EEE===EEE===EEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEVVV^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^^^^fffffffffffffffffffffpppfffffffffppppppppppppppppppppppppfffppppppppppppppppppffffffffffff^^^www†††‘‘‘†††††† †††^^^EEEEEEEEEEEEEEEGGGGGGEEEEEEEEE===GGG^^^VVVfff–––www¶¶¶°°°^^^fff ×××ÎÎÎçççïïïïïï×××ßßßïï着ª¶¶¶ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýççç×××ßßßýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýý×××www–––†††ÁÁÁçççfffVVVªªªçççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýûÞÞú��ú��ú��ôwwwpppffffff^^^fff^^^^^^ú��ú��^^^^^^^^^VVVVVVNNNNNNGGGGGGGGGGGGNNNGGGNNNGGGEEEEEE=========EEEEEEGGGGGGGGGGGGEEE===333333------""""""""""""""""""""""""""""""---------333"""""""""------""""""===VVV^^^^^^^^^NNNEEEGGGVVV^^^^^^^^^^^^VVVVVV^^^VVV^^^^^^^^^VVVVVVGGGGGGGGGVVV^^^^^^VVV^^^VVV^^^VVVNNNGGGEEE===333===333======333===333======333=========333==============================EEE=========EEE===EEE===EEE=========EEE===EEE===EEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEE^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^^^^^^^fff^^^fffffffffffffffffffffpppfffpppfffppppppppppppppppppppppppwwwppppppwwwpppwwwpppppppppfffffffffffffffpppppppppfffppp‘‘‘†††ppp––– fffGGGEEEEEEEEEEEEEEEEEENNNNNNNNNEEE===GGG^^^VVVVVVfffÁÁÁÇÇÇ°°°†††VVV^^^ªªªÁÁÁïïïïïïßßßÎÎÎïïïÁÁÁÁÁÁïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÇÇÇÇÇÇïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýßßßÎÎΆ††×××çççpppfffNNN–––ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýúwwú��ú��ú��ò†††pppffffff^^^^^^fff^^^ú��ú��VVVVVVNNNGGGNNNGGGNNNGGGNNNGGGGGGGGGEEE======EEEEEEEEEGGGNNNGGGGGGEEE======333------"""""""""""""""""""""""""""""""""""""""NNNEEEGGGNNN"""---333""""""""""""EEEGGG333"""EEE^^^^^^^^^^^^NNNEEEEEEVVV^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^^^^^^^VVVNNNVVVVVV^^^VVV^^^^^^^^^VVV^^^VVVVVVVVVNNNNNNEEE======333======333=====================================================================EEE===EEE===EEE===EEE===EEE===EEEEEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEfffffffffffffff^^^fff^^^^^^^^^fff^^^fff^^^fff^^^fffffffffffffffpppfffpppppppppfffpppppppppppppppppppppppppppwwwwwwpppwwwpppppppppfffffffffffffffpppppppppppppppVVV^^^fffpppppp°°°–––NNNEEEEEE===EEEEEEEEE^^^ppp^^^NNNGGG===EEEVVV^^^pppÎÎÎÇÇǪªª¶¶¶ ^^^fffwwwªªªçççýýýïïïÁÁÁïïïïïïçççïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÎÎΰ°°çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýßßßçççÎÎÎwww†††ppppppïïïýýýýýýýýýýýýýýýýýýýýýýýýü´´ùú��ú��ú��ùIIßßß wwwfffffffff^^^^^^ú��ú��GGGNNNGGGNNNNNNVVVNNNNNNGGGEEEEEEEEEEEEGGGGGGGGGEEEEEEEEE===333333---------""""""---"""""""""""""""---""""""""""""""""""""""""---===GGG---GGG^^^NNNfffGGGEEEVVVVVV333GGGNNN===GGGGGG---"""GGG^^^^^^^^^^^^VVVGGGNNNVVVVVVVVVVVV^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVVVVV^^^VVVVVVVVVVVVVVV^^^VVV^^^^^^VVVVVVVVVNNNGGGEEE======333======333===333=========333================================================EEE===EEE===EEE===EEE===EEEEEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEE^^^fffffffff^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^ffffffffffffppppppppppppfffpppppppppfffpppppppppppppppwwwwwwwwwwwwwwwwwwpppppppppfffffffffpppppppppfffpppfffffffffGGG^^^ffffff wwwªªªVVVEEEEEE===EEEEEE^^^^^^fffVVVEEE===EEENNNwww–––ÁÁÁ×××ÎÎΪªª†††GGGNNNªªªçççïïïÇÇÇïïïýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýý×××çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýÎÎÎwwwpppßß߶¶¶×××ýýýýýýýýýýýýýýýû°°ùú��ú��ú��ú��û¯¯ýýýçççÇÇÇú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��GGGNNNGGGGGGGGGGGGGGGEEE======333333------------"""---""""""---"""""""""---"""---===GGGEEE"""""""""""""""---333333===GGGVVVVVV^^^333EEEVVV^^^EEEGGGNNN333^^^EEENNNVVVNNNGGG^^^GGG===EEE333""""""NNN^^^^^^VVVVVVVVVVVVVVV^^^VVV^^^^^^VVVVVVVVV^^^^^^^^^^^^fff^^^^^^VVV^^^VVVVVV^^^VVVVVVVVVVVVVVVVVVVVV^^^VVVVVVVVVNNNNNNGGGEEE======333===333=========333======================================================EEE===EEE===EEE===EEE===EEE===EEEEEE===EEEEEEEEEEEEEEEEEEEEEEEEEEE===EEEfff^^^^^^fff^^^fff^^^fffffffffffffffffffffppppppfffppppppfffpppfffppppppfffpppppppppppppppppppppwwwwwwwwwwwwwwwppppppppppppfffpppppppppppppppfffpppfffppppppfffGGGVVVwwwfff‘‘‘°°°–––‘‘‘°°°‘‘‘VVVGGGEEEEEEEEEVVVfffpppwww^^^GGGEEE======GGGffffff†††ÇÇÇÁÁÁÇÇÇ°°°VVV===NNNªªªççççççïïïýýýýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýïïﶶ¶°°°ýýýýýýýýýýýýýýýýýýçççÇÇÇçççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçç綶¶fffppp ^^^pppçççýýýýýýýýýû¦¦ùú��ú��ú��ú��úttýýýýýýýýýýýýú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��GGGEEEEEE=========333------------"""---""""""---""""""---"""""""""---===GGGEEE===VVVpppNNN---333===---===VVVVVVGGGVVVffffff^^^fffGGGVVVEEEVVVEEENNN======NNNGGGfffNNN===GGG^^^333---------VVV^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^VVV^^^VVVVVV^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVNNNEEE==============================================================================EEE===EEE===EEE===EEE===EEE===EEEEEEEEEEEEEEEEEEEEE===EEEEEE===EEEEEE^^^fff^^^fff^^^ffffffffffffffffffffffffpppfffppppppfffppppppppppppppppppppppppppppppwwwpppwwwwwwwwwwwwwwwppppppppppppfffppppppfffffffffpppfffpppfffppppppppppppEEEGGGppp†††www–––––––––ªªª¶¶¶–––^^^GGGEEEEEENNN^^^wwwpppfffVVVGGGGGGEEEEEEEEENNN^^^www ¶¶¶ÁÁÁ°°°^^^GGGNNN–––ßßßïïïýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýý×××pppýýýýýýýýýýýýýýýýýýßßß×××ÎÎÎçççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïﶶ¶‘‘‘ppp–––‘‘‘ÁÁÁÁÁÁªªªûœœùú��ú��ú��ùû‰‰ýýýýýýýýýýýýýýýýýýçç綶¶ ú��ú��GGGGGGGGGEEE333333333------------"""---""""""---""""""---""""""---"""---------"""333VVVpppfffVVVpppwwwGGGEEEVVVfffGGGGGGfffEEEEEE^^^NNN^^^NNN^^^GGG^^^GGGVVVEEE^^^333NNNGGGVVVNNN===333EEE^^^===---"""---VVV^^^^^^^^^^^^^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^VVV^^^VVVVVVVVV^^^^^^fff^^^^^^GGGEEE===========================================================================EEE===EEE===EEE===EEE===EEE===EEEEEE===EEE===EEEEEE===EEEEEE===EEEffffffffffffffffffffffffpppfffpppppppppppppppfffppppppppppppppppppwwwwwwpppwwwwwwwwwwwwwwwwwwwwwwwwwwwpppppppppfffpppfffffffffppppppfffpppppppppwwwpppppppppfffGGGGGGVVVwww‘‘‘wwwwwwªªªªªªªªª°°°¶¶¶–––VVVGGGGGGGGGVVVppppppwwwpppVVVNNNGGGEEE======EEENNNfff ¶¶¶ÁÁÁ°°°‘‘‘NNNNNNªªªïïïýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýÇÇÇfffwwwýýýýýýïïïýýýýýýýýýýýýýýýçççÇÇÇ×××ïïïïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýÎÎ涶 ªªª‘‘‘ªªª¥::ùú��ú��ú��ùû››ýýýýýýýýýýýýýýýýýýýýýýýýïïïçç窪ªú��ú��===333333------"""---""""""""""""---""""""---""""""---""""""------===GGGGGG333---333fffwwwppppppppppppNNN===NNNfffNNNVVV^^^---===^^^NNN^^^VVV^^^NNNfff^^^NNN===VVV333VVVEEENNNfffGGGGGG^^^NNN333"""===^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^VVVVVV^^^VVV^^^^^^^^^VVV^^^^^^VVV^^^VVV^^^VVV^^^^^^VVVVVVVVV^^^^^^ffffffpppfffffffffVVVGGGEEE==============================================================================EEEEEE===EEE===EEE===EEEEEEEEE===EEEEEE===EEEEEE===EEEEEEfffpppfffpppfffpppfffpppfffppppppfffpppfffppppppppppppwwwwwwpppppppppwwwpppwwwwwwwwwwwwwwwwwwwwwpppwwwpppfffppppppppppppfffppppppppppppppppppppppppwwwpppppppppNNNGGGNNN^^^‘‘‘www†††¶¶¶ÁÁÁ°°°°°°¶¶¶ fffNNNGGGVVVpppwwwªªªfffVVVNNNGGGEEE=========VVVfff °°°°°°ÎÎÎfffEEEVVV×××ïïïýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýÇÇÇ^^^wwwïïïýýýïïïýýýýýýýýýýýýýýýýýýïïïÇÇÇ°°°ÎÎÎýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïﶶ¶pppfff°°°ÃLLú��ú��ú��ú��ùû§§ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýççç°°°ú��ú��---"""""""""""""""""""""""""""""""""""""""""""""""""""""""""---===VVVppppppGGG---===fffppppppfff^^^pppGGGEEEVVVpppNNN^^^VVV---EEE^^^VVVVVVVVVGGG===VVVNNN------==="""333"""333EEE---===GGG333GGG^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^ffffff^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^VVV^^^VVV^^^^^^^^^fffpppfffpppppppppfffffffffVVVGGGEEE======================================================EEE===EEE======EEE===EEE===EEE======EEE===EEE===EEE===EEEEEEEEE===EEE===EEEfffpppppppppppppppppppppffffffpppppppppppppppppppppppppppppppppwwwwwwwwwwwwwwwwwwppppppwwwppppppppppppfffpppfffpppfffpppppppppwwwwwwwwwwwwwwwwwwwwwppppppwwwppp^^^VVVNNNVVVfffwww††††††ªªªÁÁÁÁÁÁ°°°°°°ÁÁÁÁÁÁfffNNNNNN^^^ppp°°°VVVNNNGGGGGGEEEEEE======NNNNNN ÇÇÇççç–––EEEEEE ïïïïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýßßß‘‘‘fffïïïýýýýýýïïïýýýýýýýýýýýýýýýýýýýýý×××ÎÎÎßßßýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýßßßpppVVVÇÇÇú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ýýýýýýýýýýýýýýýýýý××× ú��ú��"""""""""""""""""""""""""""""""""""""""---""""""""""""""""""---VVV^^^^^^pppGGG---EEEfff^^^ppp^^^VVVpppGGGVVVfffpppNNN^^^NNN---EEENNNGGG===333------""""""GGG^^^^^^^^^^^^fff^^^fff^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^VVV^^^^^^^^^fffpppfffpppfffppppppppppppffffff^^^NNNGGG======================================================EEE======EEE===EEE===EEE======EEE===EEE===EEEEEE===EEEEEE===EEEEEE===EEEpppppppppwwwwwwpppppppppfffpppfffpppppppppppppppppppppwwwwwwwwwwwwwwwwwwwwwppppppppppppppppppfffpppfffpppfffppppppwwwpppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpppwwwppp^^^^^^VVVVVV^^^VVV–––‘‘‘–––¶¶¶ÇÇÇ°°°°°°×××°°°pppNNNVVVVVVwww–––‘‘‘VVVNNNGGGGGGGGGGGGEEE=========GGG†††ßßßÁÁÁpppEEE†††ýýýïïïïïïýýýýýýýýýýýýýýýýýýýýýýýýÎÎÎ^^^VVV‘‘‘ïïïïïïïïïýýýïïïýýýýýýýýýýýýýýýýýýýýýçççÇÇÇÎÎÎßßßïïïýýýýýýýýýýýýýýýýýýýýýýýý×××ÁÁÁßßßú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ýýýýýýýýýýýýýýýýýýÎÎΖ––ú��ú��""""""""""""""""""""""""""""""""""""""""""""""""---"""""""""---NNNEEENNNfffEEE---===pppVVVVVVNNN^^^pppGGGfffffffffEEEGGG===""""""---""""""""""""NNN^^^^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^ffffffffffffpppfffpppfffpppfffppppppfffffffffVVVGGGEEE===========================================================================EEE===EEE===EEEEEEEEEEEE===EEEEEEEEE===EEEEEEppppppppppppppppppfffppppppppppppppppppppppppwwwwwwwwwwwwwwwwwwwwwwwwpppppppppffffffpppfffpppfffpppfffppppppwwwwwwwwwwwwwwwwwwwwwwwwwwwpppwwwpppwwwppppppppp^^^www†††VVV^^^NNNVVV†††ªªª‘‘‘–––ÁÁÁÁÁÁ°°°°°°ÁÁÁ¶¶¶NNNVVVfff‘‘‘†††VVVNNNNNNGGGNNNGGGGGGGGG===333===NNN‘‘‘–––‘‘‘fff–––ïïïççç×××ýýýýýýýýýýýýýýýýýýýýýýýýßßßfffVVVppp ×××ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÎÎÎÁÁÁßßßýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççwwwßßß‘‘‘–––çççïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÎÎΖ––fff333"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---===^^^VVV---"""EEEpppVVVEEEEEE^^^^^^===EEEGGG===------""""""""""""""""""333"""---VVV^^^^^^^^^ffffff^^^fff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^ffffffpppfffffffffpppfffpppfffpppffffffpppffffff^^^^^^VVVGGGEEE==========================================EEE============EEE======EEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEppppppfffpppfffpppfffpppppppppppppppppppppppppppwwwpppwwwpppppppppppppppfffppppppfffpppffffffpppppppppwwwwwwwwwwwwwwwwwwppppppppppppwwwpppppppppppp^^^pppªªªfffNNNNNNppp‘‘‘–––––––––¶¶¶ÇÇÇ°°°°°°ÎÎÎÎÎÎwwwVVVNNNpppwww^^^GGGGGGNNNGGGNNNGGGNNNGGGGGG===EEEfff†††www^^^–––ïïïßß߆††çççýýýýýýýýýýýýýýýýýýýýýïïï–––^^^NNNNNN^^^ÁÁÁïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýßßßçççýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýïïïÁÁÁßßßwwwÁÁÁªªªpppÇÇÇýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýÇÇÇ–––fff---"""""""""""""""""""""""""""""""""""""""""""""---------"""""""""---NNN^^^EEE333---EEEpppNNN333333GGGEEE---------"""""""""""""""""""""""""""""""""""""""------------333---333^^^^^^^^^^^^^^^fff^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fffffffffpppfffpppffffffffffffpppffffffffffffpppfffpppfff^^^^^^NNNEEE=========================================================EEE===EEE===EEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEfffpppppppppwwwpppwwwppppppppppppwwwpppppppppppppppppppppppppppffffffpppfffpppfffpppppppppppppppwwwwwwwwwwwwwwwppppppppppppwwwwwwpppwwwwwwpppffffff¶¶¶¶¶¶wwwVVVGGG^^^www–––ªªª––– ¶¶¶¶¶¶¶¶¶°°°ÇÇÇÇÇdž††VVVVVVffffffNNNGGGNNNNNNGGGNNNNNN^^^†††^^^GGGVVVwww†††VVVpppßßßÇÇÇwwwÇÇÇýýýýýýýýýýýýýýýýýýýýýýýýçççNNN^^^‘‘‘çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÁÁÁÇÇÇýýýýýýýýýýýýýýýýýýýýýýýýýýýçççpppÇÇÇfff^^^ïïïýýýýýýýýýýýýýýýýýýýýýýýýïïïÁÁÁ‘‘‘VVV---""""""""""""""""""""""""""""""""""""""""""---GGGVVV==="""""""""EEEfffVVVNNNGGG---===VVVEEE---------"""---""""""---"""""""""""""""""""""""""""333"""---333333333======""""""333333---===VVVfff^^^^^^^^^^^^fffVVVVVV^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^^^^^^^^^^^^^^^^ffffffffffffpppfffffffffffffffffffffffffffffffffpppfffpppffffffffffff^^^VVVGGGEEE======================================================EEE===EEE===EEEEEEEEEEEEEEEEEEEEEEEE===EEEEEEEEEEEEwwwwwwwwwwwwwwwppppppppppppppppppppppppfffpppfffpppfffffffffpppfffpppfffpppfffppppppwwwwwwwwwwwwwwwwwwpppppppppwwwwwwwwwwwwwwwwwwfffppp¶¶¶¶¶¶–––^^^VVVVVVppp °°° ªªªÎÎΪªª ÁÁÁÁÁÁppp^^^fffNNNGGGGGGNNNNNNNNNNNNwww¶¶¶ ^^^EEENNNppp^^^ppp‘‘‘††††††¶¶¶ýýýýýýýýýýýýýýýýýýýýýýýýïïï–––ªªª×××ïïïýýýýýýïïïïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÎÎÎÇÇÇïïïýýýýýýýýýýýýýýýýýýýýýýýýïïï°°°ÁÁÁVVVNNN^^^ïïïýýýýýýýýýýýýýýýýýýýýýýýýçççÁÁÁ†††NNN---"""""""""""""""""""""""""""""""""---------EEE^^^NNN===""""""---VVVwwwpppfffEEE------------""""""---"""---"""---""""""""""""""""""""""""""""""""""""===EEE======EEE===------""""""333333---"""GGG^^^^^^^^^fff^^^^^^NNNVVV^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^ffffff^^^ffffffffffffffffffffffffpppfffffffffffffffffffffffffffffffffffffffffffffffffff^^^VVVGGGEEE==========================================EEE======EEE===EEEEEEEEEEEEEEEEEEEEE===EEE===EEEEEEEEEEEEwwwwwwwwwpppwwwppppppwwwpppfffpppppppppppppppfffpppppppppfffpppfffpppppppppwwwwwwwwwwwwwwwppppppwwwwwwwwwwwwwww†††^^^^^^ªªª¶¶¶ªªªfffVVVfffppp––– ––––––¶¶¶°°°ªªª–––ªªª¶¶¶ªªª^^^^^^NNNGGGGGGNNNVVVNNN^^^ªªª××׶¶¶†††NNNEEEGGGNNNfff‘‘‘°°°ýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïïïïýýýýýýýýýýýýÁÁÁ‘‘‘ÁÁÁçççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççßßßýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýßßßfff–––¶¶¶ßßß°°°×××ýýýýýýýýýýýýýýýýýýçç綶¶†††GGG---""""""""""""""""""""""""""""""333GGGVVVEEEGGGppp^^^GGG---"""333^^^fffVVVEEE---""""""""""""---"""------"""---""""""""""""""""""""""""""""""------"""""""""---===EEE===333---"""---======333---NNN^^^^^^^^^^^^VVVVVVVVV^^^^^^^^^^^^^^^^^^fff^^^^^^^^^^^^fff^^^ffffff^^^fff^^^^^^fff^^^^^^fff^^^ffffffffffffpppffffffffffffffffffffffffffffffffffffpppfffpppfffffffffffffffpppffffff^^^NNNEEE=============================================EEE===EEEEEEEEEEEEEEE===EEE===EEE===EEE===EEEEEEEEEwwwwwwwwwwwwpppppppppfffppppppfffpppffffffpppppppppfffpppppppppwwwwwwwwwwwwwwwwwwpppppppppwwwwwwpppwwwwww††††††www^^^^^^††† –––fff^^^fffpppwww‘‘‘ªªª ––– ÁÁÁ ‘‘‘ªªªÎÎΆ††wwwNNNNNN^^^fffppp^^^fffÇÇÇÎÎÎÁÁÁ–––pppGGGGGGGGGfff†††‘‘‘ªªªïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïýýýïïï°°°†††ªªªçççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýý×××çççýýýýýýýýýýýýýýýýýýýýýïïï‘‘‘¶¶¶çççÎÎÎVVV†††ýýýïïïýýýýýýýýýýýýçç綶¶‘‘‘EEE""""""""""""""""""---===333"""---GGG^^^pppGGG===NNNppp^^^---"""---EEE===---""""""""""""---""""""---""""""---""""""---""""""---------""""""---===EEE===---333---"""---""""""=========333VVV^^^^^^^^^VVVNNNVVV^^^^^^^^^^^^^^^^^^fffVVV^^^^^^^^^fff^^^fff^^^fff^^^^^^ffffff^^^ffffffffffff^^^fffffffffffffffpppffffffffffffffffffffffffffffffffffffffffffpppfffpppfffppppppffffff^^^VVVGGGEEE====================================EEE===EEE===EEEEEEEEEEEEEEE===EEE=========EEE===EEEEEEwwwwwwwwwwwwpppppppppppppppppppppppppppppppppfffpppppppppwwwwww†††wwwwwwppppppwwwwwwwwwppppppwwwwww†††††††††††††††ppp^^^^^^––––––†††fffffffffpppwww‘‘‘ ‘‘‘ªªª°°°ªªª–––ªªª°°°¶¶¶fffVVVpppwwwwwwpppfff¶¶¶ÎÎÎÎÎÎ †††fffVVVfffppp‘‘‘ ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïﶶ¶‘‘‘ °°°×××ýýýýýýýýýýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýßß߶¶¶×××ýýýýýýýýýýýýýýýýýýýýý××׆††ÁÁÁÁÁÁppp†††çççÇÇÇçççýýýýýýýýýçç綶¶†††===""""""""""""------EEE^^^==="""333^^^fffVVV===EEENNNfffNNN---""""""---""""""---"""""""""""""""---""""""---"""------------"""---=========---333EEEEEE333"""---""""""333======333^^^^^^^^^NNNNNNVVV^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^fff^^^fff^^^fff^^^ffffff^^^fffffffff^^^^^^fffffffffffffffffffffffffffffffffffffffffffffffffffpppfffpppffffffpppffffffffffffpppfffffffff^^^NNNEEE========================EEE==================EEE===EEE===EEE=========EEE======EEE===EEEwwwwwwwwwwwwpppwwwpppwwwpppppppppppppppfffppppppppppppwwwwwwwwwwwwpppwwwwwwwwwwwwwww††††††††††††wwwppp^^^VVV†††ªªªªªª‘‘‘†††^^^ppppppwww‘‘‘ªªª–––††† ¶¶¶°°°–––°°°ÎÎΰ°°ppppppfffpppwwwfff °°°ÁÁÁªªª†††www‘‘‘fffppp‘‘‘–––ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï××× ÁÁÁ¶¶¶×××ýýýýýýýýýýýýýýýýýýýýýýýýïïïýýýýýýýýýýýýýýýßßßßßßýýýïïïýýýïïïýýýýýýýýýýýýïïï××תªªppp¶¶¶ççç ïïïýýýýýýççç°°°===---"""---333======NNNppp333"""===pppfffGGGGGGGGGfffNNN==="""""""""""""""---"""""""""""""""---""""""---"""------333===------===GGGEEE333---333333---""""""""""""---======EEEVVVVVVNNNNNN^^^^^^VVV^^^VVV^^^^^^fff^^^VVV^^^^^^^^^^^^^^^fff^^^fff^^^ffffff^^^ffffffffffff^^^ffffffffffffpppfff^^^fffffffffffffffffffffpppfffpppffffffpppffffffpppfffffffffffffffpppffffffffffff^^^VVVGGG==================EEE===============EEE=========EEEEEE===EEE=========EEE===EEE===EEEwwwwwwwwwwwwwwwwwwppppppwwwppppppfffpppppppppwww††††††wwwwwwwwwwwwwwwwwwwwwwwwwww†††††††††††††††ppp^^^^^^‘‘‘¶¶¶°°°ªªªppp^^^ppppppwww‘‘‘ªªª‘‘‘†††–––ÁÁÁ¶¶¶––– ÎÎÎÇÇÇwww^^^VVVfffwwwfffwww–––†††www–––VVVppp––––––çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççççç–––×××ççç×××ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïïïïßßßÁÁÁïïïýýýýýýýýýýýýïïïVVV°°°çççÁÁÁ‘‘‘çççýýýýýýçç窪ªEEE333---333NNNNNNGGGVVVppp333"""333fffppp^^^GGG===333333""""""""""""""""""""""""""""""""""""""""""---333333---333EEEGGG===333GGGEEE===---"""""""""""""""""""""""""""---"""===333GGGVVVVVVVVVVVVVVVVVV^^^VVV^^^^^^^^^VVVVVV^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^^^^^^^fff^^^ffffffffffffffffffffffffffffff^^^fff^^^fffffffffffffffpppffffffpppfffffffffffffffpppfffffffffpppfffffffff^^^fff^^^^^^GGGEEEEEE===EEE==============================EEE======EEE===EEE=========EEE===EEEEEEwwwwwwwwwwwwwwwppppppfffwwwwwwwwwwwwwwwwwwwwwwwwpppwwwwwwwww††††††††††††††††††www^^^fff––– ¶¶¶†††ffffffpppwww‘‘‘‘‘‘ †††–––ÁÁÁ¶¶¶‘‘‘‘‘‘¶¶¶¶¶¶wwwffffffwww^^^ppp ppp^^^ffffff‘‘‘–––^^^VVV––––––×××ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççßß߆††×××ýýý×××çççýýýýýýýýýýýýïïïýýýýýýýýýïïïýýýýýýýýýýýýýýýýýýýýýïïïççç°°°çççýýýýýýýýýýýýýýý¶¶¶^^^°°°ÎÎÎÎÎÎ×××ýýýýýýýýýßßߪªªwwwGGGEEE======^^^GGGEEENNNpppEEE333EEENNN^^^NNN---""""""""""""""""""""""""""""""""""""""""""---"""---===EEEEEEGGGGGGGGGEEE333---333---"""""""""""""""""""""""""""---333=========---------NNN^^^VVVVVV^^^VVV^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^ffffffffffffffffffpppfffpppfffffffff^^^ffffffffffff^^^fffffffffffffffffffffffffffffffffffffffffffffffffff^^^^^^^^^^^^fffffffff^^^VVVEEEEEE===EEE===EEE========================EEE======EEE======EEE======EEE===EEE†††wwwwwwpppppppppwww††††††wwwwwwwwwwwwwwwpppwwwwwwwwwwwwwwwwwwwwwwww††††††‘‘‘‘‘‘††††††www^^^^^^–––°°°°°°–––wwwfffpppppp†††°°°‘‘‘††† ÁÁÁ°°°‘‘‘†††°°°ªªªpppffffffpppwwwfff^^^^^^ wwwGGG–––ÇÇÇïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýßßßßß߶¶¶ßßßïïïÎÎÎçççýýýýýýýýýïïïÇÇÇ°°°ßßßïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýÇÇǶ¶¶çççßßßýýýýýýýýýïïïßßßçççßßßßßßýýýýýýýýýýýýßßß pppEEEEEE======NNNEEE333GGGppp^^^VVVNNN333---"""""""""""""""""""""""""""---""""""---"""---333333EEEEEEGGGGGGGGGEEE===333------""""""---"""""""""""""""""""""""""""333======EEEEEE===333"""---VVV^^^VVVVVVVVV^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^ffffffffffffffffffffffffffffffffffff^^^fff^^^ffffff^^^ffffffffffffffffffffffffffffffffffffffffffffffff^^^^^^^^^VVV^^^ffffffpppfffpppffffff^^^GGGEEE=======================================EEE===EEE======EEE===EEE===EEE†††††††††wwwwwwwwwwww††††††††††††††††††††††††wwwwwwwwwwwwpppwwwpppwwwwwwwww†††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘††††††www^^^fff†††¶¶¶ÁÁÁ°°°pppfffpppwwwwww†††‘‘‘–––†††ªªª¶¶¶ªªªwwwwww‘‘‘pppwww^^^www†††††††††fffpppppp‘‘‘‘‘‘GGGppp–––¶¶¶ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïﶶ¶°°°°°°çççççç×××ßßßýýýýýýýýýÎÎΆ††††† ÁÁÁïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï×××ÇÇÇÇÇÇïïïýýýýýýýýýýýýýýýïïïïïïýýýýýýýýýýýý××תªªpppEEE333======EEE===333EEEpppfffNNN===""""""------"""------"""""""""---""""""---333EEEEEEGGGGGGGGGGGGEEE333333---""""""---"""""""""""""""""""""""""""""""""""""""""""""""""""333======EEEEEE===333""""""333VVVVVVVVVVVVVVV^^^^^^^^^VVV^^^^^^^^^^^^ffffff^^^^^^^^^fff^^^^^^fff^^^ffffffffffff^^^ffffffffffffffffff^^^ffffff^^^fffffffffffffffffffffffffffffffff^^^fff^^^ffffff^^^fff^^^^^^^^^VVV^^^fffpppfffppppppfffpppppppppfff^^^NNNEEE=======================================EEE===EEEEEE===EEE===EEE===†††www†††‘‘‘‘‘‘†††‘‘‘††††††††††††wwwwwwwwwpppppppppppppppwwwwww††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘††††††www^^^^^^†††ªªª°°°–––pppfffpppwwwpppªªª ‘‘‘‘‘‘ªªª†††wwwppppppwwwwwwppp††††††www‘‘‘†††‘‘‘–––^^^VVV °°°ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçç熆†¶¶¶ªªªçççßßßïïïïïïýýýççç°°°‘‘‘¶¶¶ÇÇǪªªÎÎÎïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÁÁÁÇÇÇïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï××תªªpppEEE333=========333---333GGGEEE---"""---===EEE======333EEE------333333333"""333GGGEEEEEE===333------"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""------333333333"""""""""===VVVVVV^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^fff^^^fffffffff^^^fffffffff^^^^^^^^^ffffffffffff^^^fffffffffpppffffffffffff^^^ffffff^^^fffffffff^^^^^^VVV^^^^^^fffffffffppppppfffppppppfffppppppppppppfffNNNGGG=========EEE===========================EEE===EEE===EEE======EEE††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††wwwwwwwwwpppfffppppppwwwwwwwwwwwwwww††††††††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††wwwfff^^^‘‘‘¶¶¶¶¶¶fffppppppppp–––°°°†††††††††°°°†††††††††fffwwwpppwww––––––‘‘‘–––†††NNN–––¶¶¶ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýÁÁÁ^^^†††wwwfffÁÁÁïïïçççßßßýýýÎÎÎÁÁÁ¶¶¶ÇÇǪªªÁÁÁ ßßßýýýýýýýýýýýýýýýýýýïïïýýýýýýýýýýýýïïï×××ßßßÎÎÎýýýýýýýýýýýýýýýýýýýýýýýýïïï××× pppEEE333333===------"""""""""""""""333EEENNNNNNGGGGGGEEEEEEEEENNNNNNEEE333EEE===------"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---EEEVVV^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^fff^^^fff^^^fffffffff^^^fffffffffVVV^^^^^^ffffffffffffffffff^^^fffffffffffffff^^^fff^^^fffffffffffffff^^^^^^VVV^^^^^^ffffffpppfffpppfffpppppppppppppppppppppppppppfff^^^GGGEEE======EEE=====================EEE===EEE===EEE============††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘††††††wwwwwwwwwfffppppppwwwwwwwwwwwwwwwwwwwwwwww††††††††††††††††††††††††††††††‘‘‘†††‘‘‘‘‘‘‘‘‘†††wwwfff^^^†††°°°†††–––wwwfffppppppppp°°°ªªª††††††°°°°°°–––ªªª‘‘‘ppppppfff^^^www†††‘‘‘–––‘‘‘–––pppÁÁÁýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï–––NNNfff–––ÁÁÁßßßÎÎÎ ïïïççççççÁÁÁ°°°°°°ßßßÁÁÁ¶¶¶ïïïýýýýýýýýýýýýïïïýýýýýýýýýýýýýýýýýýýýýïïïÎÎÎ×××çççýýýýýýýýýýýýýýýýýýïïï××× pppEEE333""""""""""""---333333======GGGVVVVVVNNNGGGGGGEEEEEE===---333===---"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---GGG^^^^^^ffffff^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^fff^^^^^^ffffff^^^fff^^^ffffffffffffffffffffffff^^^ffffff^^^fffffffffffffffffffffpppfffffffff^^^fffffffffffffff^^^^^^VVVVVVfff^^^ffffffpppfffffffffpppfffpppfffpppppppppppppppppppppfff^^^GGGEEEEEE===EEE===EEE======EEE======EEE===EEE===EEE=========‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††††††††††††††wwwwwwpppfffpppwwwwwwwwwwwwwwwwwwwwwwwwwww††††††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††pppfff‘‘‘‘‘‘ªªªªªª‘‘‘pppppppppppp†††°°°ªªª†††‘‘‘ªªª‘‘‘ †††wwwppppppVVVpppwww‘‘‘‘‘‘‘‘‘wwwfffÁÁÁýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïppp^^^‘‘‘°°°ÁÁÁ×××ßßß çççïïïïï着ª‘‘‘‘‘‘¶¶¶ßßßÎÎÎ×××ýýýýýýýýýýýýýýýïïïýýýýýýýýýýýýýýýýýýýýýïïï×××çççýýýýýýýýýýýýýýýýýýïïï××× ^^^===333---"""---333GGGGGGNNNEEE===EEEGGGGGGGGG===333------"""""""""---"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---""""""""""""""""""""""""""""""""""""---VVV^^^^^^^^^^^^^^^ffffffffffff^^^^^^^^^fff^^^^^^fff^^^^^^^^^fff^^^fff^^^fffffffffffffffffffffffffff^^^fffffffffffffffffffffpppfffpppffffff^^^^^^ffffffffffff^^^VVV^^^^^^ffffffffffffffffffpppffffffpppfffpppppppppfffppppppppppppppppppfffNNNEEEEEE===EEE===EEE======EEE=========EEE============EEE‘‘‘–––‘‘‘–––‘‘‘†††‘‘‘†††††††††††††††††††††wwwwwwpppfffpppwwwwwwwwwwwwwwwwwwwwwwww†††††††††††††††††††††††††††‘‘‘‘‘‘–––––––––‘‘‘fff^^^wwwªªª¶¶¶°°°†††fffffffffppp†††ªªª–––wwwwww†††pppfffwwwpppwww^^^pppfffpppwww†††‘‘‘pppwwwÇÇÇýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýÎÎÎppp‘‘‘°°°–––¶¶¶×××^^^¶¶¶ïïïçç綶¶†††ppp‘‘‘ ïïïýýýýýýýýýýýýýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÎÎΖ––NNN======333333---""""""EEENNNVVVVVVGGG===EEEEEE===333---"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---""""""""""""---"""""""""---""""""""""""---333VVVfff^^^^^^fff^^^fff^^^fff^^^fff^^^fff^^^^^^fff^^^fff^^^^^^^^^^^^^^^ffffffpppfffpppfffpppfffffffffffffff^^^fffffffffffffffffffffffffff^^^ffffffffffff^^^^^^VVV^^^^^^ffffffpppfffffffffffffffppppppfffpppfffpppfffpppppppppppppppwwwppppppfffVVVEEEEEE===EEE===EEE=========EEE======EEE============‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††††††††wwwwwwwwwwww†††wwwwwwwwwwwwwwwwwwwwwwwwwwwwww††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘–––––– ––––––†††ppp^^^°°°¶¶¶ªªªpppffffffpppwww–––wwwwwwwwwpppfffwwwpppwww†††ppp^^^pppwww†††‘‘‘‘‘‘‘‘‘°°°çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýÁÁÁffffffppp–––ÁÁÁ‘‘‘VVV°°°ßßßçççßß߶¶¶wwwppp^^^wwwÎÎÎýýýýýýýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÇÇÇ–––NNN=========333333""""""===NNNVVVGGGGGGEEE======333333333"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---"""""""""""""""---"""""""""""""""---""""""""""""""""""EEE^^^^^^^^^fff^^^fff^^^fff^^^fff^^^fff^^^fff^^^fff^^^fff^^^VVV^^^^^^fffffffffffffffffffffffffffffffff^^^fffffffffffffffpppfffffffffffffffffffff^^^fffffffff^^^^^^fffffffffffffffffffffffffffppppppfffpppfffppppppppppppppppppwwwwwwwwwwwwpppppppppVVVGGGEEE===EEE===EEE===EEE======EEE===============‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘wwwwwwpppwww†††††††††wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––––– –––‘‘‘ffffff°°°¶¶¶ wwwffffffpppwwwwwwwwwpppwwwwwwpppwww†††www–––wwwfffpppwww†††‘‘‘–––‘‘‘ªªªÁÁÁÎÎÎïïïýýýýýýýýýýýýýýýýýýýýýýýýÇÇÇNNN^^^VVVNNN^^^¶¶¶–––^^^††† ßßßïïïßßß‘‘‘^^^^^^fff^^^†††ïïïýýýýýýýýýýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÇÇÇ NNN333======333333---"""---333======333============333---""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---""""""""""""---"""""""""""""""---""""""""""""""""""---"""EEEVVV^^^^^^fffffffff^^^^^^fff^^^ffffff^^^fff^^^fff^^^fffVVVVVV^^^^^^fff^^^fffffffffpppfffffffffffffff^^^fff^^^ffffffffffffpppfff^^^ffffff^^^fffffffffffffffffffffffffffffffffpppfffpppfffpppfffppppppppppppppppppppppppwwwpppwwwwwwwwwwwwwwwwwwpppfff^^^GGGEEE===EEE===EEE===EEE======EEE======EEE===‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††wwwwww†††††††††††††††††††††wwwwwwwwwwwwwwwwwwwwwwwwwwwwww†††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––– ––– –––‘‘‘fff^^^ªªª°°°°°°wwwffffffpppwwwwwwwwwppppppwwwpppwww†††fff‘‘‘‘‘‘wwwfffppp‘‘‘†††–––––– çççýýýýýýýýýýýýýýýýýýýýýýýý×××NNNGGGGGGVVV^^^www°°°†††VVVfffpppÇÇÇßßß××× fff^^^^^^VVV^^^×××ýýýýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÇÇÇ NNN======333333------===333333333333333333---""""""""""""""""""""""""""""""""""""---"""""""""""""""""""""""""""""""""""""""---"""""""""""""""---"""""""""""""""---""""""""""""""""""---"""---GGGffffffffffff^^^ffffff^^^fffffffff^^^fff^^^fffffffffVVVNNN^^^^^^fff^^^ffffffffffffffffffffffffffffff^^^ffffffffffffpppfffffffff^^^fffffffffffffffffffffffffffffffffpppfffffffffppppppfffppppppfffpppfffpppppppppwwwpppwwwpppwwwpppwwwwwwwwwpppppppppfff^^^NNNEEEEEE============EEE===EEE=========EEE –––††††††††††††††††††††††††‘‘‘†††††††††††††††††††††wwwwwwwwwwwwwwwwwwwwwwww†††††††††††††††††††††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––– ––– ––––––‘‘‘ppp^^^°°°ÁÁÁ–––wwwffffffpppwwwwwwppppppwwwpppfffppp^^^††††††‘‘‘wwwppp†††–––‘‘‘‘‘‘‘‘‘‘‘‘ÁÁÁïïïýýýýýýýýýýýýýýýýýýýýýïïïfffEEEGGGfff†††www NNNVVVppp¶¶¶ïïïÁÁÁªªª–––www^^^NNNNNN ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÁÁÁ NNN===333------""""""---333333333---""""""""""""""""""""""""""""""""""""""""""---"""---""""""---"""""""""---""""""""""""""""""---"""""""""---""""""---""""""""""""---""""""""""""---"""---"""""""""---VVV^^^ffffffffffff^^^fffffffff^^^ffffff^^^fff^^^ffffffNNNNNN^^^fff^^^ffffffffffffffffffpppffffff^^^^^^fffffffffffffffpppffffffffffff^^^fffffffffffffffffffffffffffpppfffpppfffffffffppppppfffpppfffppppppppppppppppppwwwpppwwwwwwwwwwwwpppwwwppppppwwwppppppfffNNNEEE======EEE===EEEEEE======EEEEEE===‘‘‘‘‘‘‘‘‘††††††††††††‘‘‘‘‘‘††††††‘‘‘†††††††††††††††wwwwwwwwwwww††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘–––––– ––– –––‘‘‘fff^^^†††ªªª¶¶¶¶¶¶wwwffffffppppppppppppppppppffffffVVVppp‘‘‘‘‘‘‘‘‘pppwww‘‘‘‘‘‘–––wwwªªªïïïýýýýýýýýýýýýýýýýýýýýýýýýÁÁÁNNNNNNppp¶¶¶–––pppGGGNNNppp‘‘‘××× °°°†††^^^NNNNNNpppßßßýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÁÁÁ VVV===---"""---------"""---------""""""""""""""""""""""""""""""""""""---"""---"""------------"""""""""""""""""""""---""""""""""""---""""""---""""""---""""""""""""""""""---333===---"""""""""333^^^ffffff^^^fff^^^fffffffffffffff^^^ffffff^^^ffffff^^^GGG^^^^^^fffffffffffffffpppffffffffffffffffff^^^ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffpppfffpppfffpppfffppppppppppppppppppppppppwwwpppppppppwwwwwwpppfffpppppppppppppppfffNNNEEE======EEE===EEE===EEE===EEE===‘‘‘††††††††††††††††††‘‘‘††††††‘‘‘†††‘‘‘‘‘‘†††††††††††††††wwwwww††††††††††††††††††††††††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘––– ––– –––†††wwwfff^^^www¶¶¶ÁÁÁªªªwwwffffffppppppppppppppppppfffNNNVVV‘‘‘†††‘‘‘fffVVVwww†††–––†††ppp‘‘‘çççýýýýýýýýýýýýýýýýýýýýýýýýçççfffGGG××׆††‘‘‘wwwNNNGGGpppfff‘‘‘††† www^^^VVVVVVNNNÁÁÁýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçç綶¶ NNN===---"""---333---""""""------""""""""""""""""""---""""""---"""------"""---"""------333======---""""""---""""""---""""""---"""---""""""---""""""---"""------"""---333333333===333---""""""---===^^^^^^ffffff^^^ffffff^^^fff^^^ffffff^^^ffffffffffffNNNGGG^^^^^^ffffff^^^fffffffffffffffffffff^^^^^^^^^fffffffffffffffffffff^^^fff^^^fffffffffffffffffffffpppffffffffffffpppffffffpppfffpppfffppppppppppppppppppppppppwwwpppwwwpppwwwppppppfffpppfffpppfffpppppppppfffNNNEEEEEE=========EEE===EEE======†††††††††††††††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††‘‘‘†††‘‘‘††††††††††††www†††††††††††††††††††††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––––––––– –––––– –––––––––‘‘‘†††fff^^^wwwªªª¶¶¶ªªªffffffpppppppppppppppfffVVVNNNVVV†††wwwpppGGGNNNfffwwwwww^^^†††ßßßýýýýýýýýýýýýýýýýýýýýýýýýïïïpppNNN ××׶¶¶fff†††wwwNNN^^^VVVVVV†††ªªª–––wwwVVVNNNNNNGGG‘‘‘ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçç綶¶‘‘‘GGG333"""------333---"""""""""---"""---"""------""""""---"""------333------333===---======EEEEEE""""""---""""""---""""""---""""""""""""---""""""---------333===---333EEEEEE===EEE===---"""---"""EEE^^^^^^^^^^^^ffffffffffff^^^ffffff^^^ffffff^^^fffVVVNNNVVVffffff^^^ffffffffffffpppffffffffffff^^^fff^^^^^^ffffff^^^ffffff^^^ffffffffffffffffff^^^ffffffffffffpppffffffpppfffpppffffffpppfffpppppppppppppppfffpppppppppwwwwwwpppwwwwwwpppfffffffffpppfffpppfffpppfffpppfffNNNEEE===EEE===EEE============††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††††††††††††††††††††www††††††††††††††††††‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘––––––––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††fffVVV†††°°°ÁÁÁ¶¶¶ffffffpppfffpppwwwppp^^^NNNNNNfffpppEEEEEEGGGVVVppp^^^pppÇÇÇýýýýýýýýýýýýýýýýýýýýýýýýçççfff^^^¶¶¶ßßßÎÎÎwwwpppVVVVVVªªª°°°†††wwwVVVEEEEEEEEE^^^çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýççç°°°†††EEE------333---------"""---"""------"""---------------"""------"""---------333333======EEE===EEE======EEE---"""""""""---"""---""""""---""""""---""""""---333EEE333EEE===333======333333EEEEEE---""""""---GGG^^^fffffffff^^^fffffffffffffff^^^fff^^^^^^fffVVVNNN^^^^^^fffffffffffffffpppffffffffffffffffff^^^^^^fff^^^fffffffff^^^ffffffffffffffffffffffffffffffffffffpppfffffffffpppfff^^^ffffffppppppfffpppffffffpppppppppppppppwwwwwwwwwwwwpppfffffffffffffffpppfffpppfffpppfffpppfffNNNEEE===EEE===EEE=========†††‘‘‘†††††††††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘††††††††††††www†††††††††††††††††††††††††††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘fffVVVwwwÁÁÁ¶¶¶°°°www^^^ppppppfffwwwwwwfff^^^NNNGGG^^^pppVVV======GGGNNNfff†††–––ïïïýýýýýýýýýïïïïïïýýýýýý×××VVV^^^ÁÁÁßßßçççÇÇÇppp†††www––––––°°° wwwfffNNNEEE======GGGÇÇÇýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýßßß°°°www===------333------------"""---------------333===333---------------===333333EEE===EEE333GGGEEEEEE=========""""""---"""---""""""---"""---"""---"""---------===EEE333GGG333======333333========="""---"""---NNN^^^^^^^^^ffffff^^^fff^^^^^^fff^^^^^^^^^fff^^^^^^^^^^^^fff^^^ffffffpppffffffffffffffffff^^^ffffff^^^ffffffffffffffffffffffffffffffffffffffffffffffffffffffpppfffffffffffffff^^^ffffffppppppffffffppppppfffpppfffpppwwwwwwwwwwwwpppffffffffffffffffffffffffffffffpppfffppppppfffNNNEEE===EEE============–––‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘††††††††††††††††††wwwwww††††††††††††††††††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘–––––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘–––‘‘‘‘‘‘www^^^VVVwwwªªªªªª–––ffffffpppfffpppwwwfff^^^pppGGGNNN^^^GGG===EEENNN^^^ppp†††‘‘‘†††ßßßïïïýýýïïïÎÎÎ×××çççïïï GGG^^^ÁÁÁçççßßßßßß°°°†††pppppp‘‘‘ªªª–––fffVVVGGGEEEEEE===EEE ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýßßߪªªfff333---------------"""---------------"""---======333333333===333EEE===333===GGG===EEE===EEE===EEE---333333---""""""---"""---"""---""""""---"""333======---EEE===---GGG333EEEEEE===333===333---"""""""""333VVV^^^^^^fff^^^fff^^^^^^^^^^^^^^^fff^^^^^^ffffff^^^^^^fff^^^ffffffffffffffffffpppfffffffff^^^ffffffffffffffffff^^^fff^^^fffffffffffffffffffffffffffpppfffffffffffffffppp^^^^^^ffffffpppfffpppfffpppfffpppfffpppppppppwwwwwwwwwwwwfffffffff^^^^^^^^^fff^^^fffpppfffffffffpppfffppp^^^NNNEEE===============‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††‘‘‘†††‘‘‘†††††††††‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††fffVVVfff‘‘‘ªªª^^^pppfffpppfffppppppppppppNNNVVVVVVNNNEEEEEENNNpppwww†††wwwÇÇÇïïïççççç窪ª ßßßÇÇÇpppEEEVVVÁÁÁççççççççç××ב‘‘www^^^VVVfffpppfffVVVGGGEEEEEEEEE======pppïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïßßß ^^^333---"""------"""333------------------333GGGEEE=========EEE333EEEEEE===EEEEEE===GGG======---333---"""---"""---"""---""""""---"""333===333333======GGG===EEE333333EEE---EEEEEE==="""---"""---"""""""""333^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^fffffffff^^^fff^^^fff^^^fffffffffpppffffffffffff^^^fffffffffffffffffffff^^^fff^^^fff^^^fffffffff^^^ffffffffffffffffffffffffffffff^^^fffffffffpppfffpppffffffpppfffpppfffpppppppppwwwppppppfffffffff^^^^^^ffffffffffff^^^ffffffffffffpppfffffffff^^^NNNEEE============†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘††††††‘‘‘†††‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘–––‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘wwwfffVVVppp°°°ffffffpppfffffffffpppppp^^^^^^^^^NNNNNNGGG===GGGfffwwwfffÇÇÇïïïççççççÁÁÁ°°°ÎÎÎ ^^^EEEGGG¶¶¶çççïïïïïïßßß‘‘‘^^^fffNNNNNNNNNVVVGGGEEE======EEEEEE===NNNçççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýý××תªªNNN------------"""---333EEE333333===EEE===333GGG===EEEEEE===GGG333===EEEEEE===EEE---333333---"""---"""---"""---"""---"""---333=========GGGEEE333EEE333GGG333GGG333333GGG333---------""""""""""""""""""===^^^^^^fff^^^^^^^^^VVVVVV^^^fffffffffffffff^^^^^^fff^^^ffffffffffffffffffpppfff^^^^^^fffffffffffffff^^^fff^^^fff^^^fff^^^fff^^^^^^^^^fffpppfffpppffffff^^^ffffffffffff^^^ffffffpppffffffffffffpppfffpppfffppppppppppppppppppfffffffffffffffffffffffffffffffffpppfffpppfffpppfffffffffffffffNNNEEE=========‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘††††††††††††††††††‘‘‘††††††‘‘‘†††‘‘‘†††††††††‘‘‘†††‘‘‘††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘††††††‘‘‘‘‘‘†††wwwfffVVVfff^^^fffpppfffffffffpppfff^^^VVVVVVVVVGGGEEE===EEENNN‘‘‘––– –––×××ïïïßßßçççÇÇǶ¶¶ ^^^EEEGGGwwwÎÎÎïïïïïïççç–––VVV^^^^^^NNNGGGGGGEEE==================EEEÇÇÇýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï××תªªGGG------"""---------EEEGGG===EEEEEEEEEEEE===GGG===GGGEEEEEEEEE===EEE===333333------------"""---"""---"""---"""---333333333EEE===GGG===EEE===EEEEEE===EEE333GGG===---------"""""""""""""""""""""GGG^^^^^^^^^fff^^^^^^^^^fffffffffffffffffffff^^^fff^^^fffffffffffffffpppffffffffffffffffffffffffffffff^^^fff^^^^^^fff^^^^^^^^^fff^^^fffffffffffffffffffffffffffpppfff^^^pppfffpppfffffffffpppffffffpppfffpppfffppppppppppppfffffffffpppfffffffffffffffpppppppppppppppppppppppppppffffffppppppfffNNNEEE======‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘†††‘‘‘†††††††††‘‘‘††††††‘‘‘†††††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘††††††††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘††††††††††††‘‘‘†††‘‘‘‘‘‘†††††††††‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††‘‘‘‘‘‘††††††wwwfffVVV^^^fffpppfffpppffffffppp^^^NNNNNNGGGEEEEEE======EEEfff°°°¶¶¶¶¶¶çççïïïßßßÎÎΰ°°‘‘‘ ÎÎÎpppNNNGGGfff ßßßçççççç°°°VVVGGGffffffNNNEEE===333333333333333333EEE°°°ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï××תªªGGG---"""------------EEEGGG===GGG===EEEEEE===GGG333GGGGGGEEE===---333------------"""------===------------------=========EEEEEE333GGG333EEE===EEEGGGEEE333---------"""---""""""""""""""""""""""""NNN^^^fff^^^^^^^^^fff^^^fff^^^^^^ffffff^^^fff^^^fffffffffffffffffffffffffff^^^fff^^^ffffffpppffffff^^^fff^^^ffffff^^^^^^fff^^^^^^fffffffffffffffffffffffffffpppffffffffffffpppfffpppfffpppfffpppfffppppppfffpppppppppfffffffffffffffffffffpppfffffffffffffffpppppppppwwwpppppppppppppppppppppffffffNNNEEE===‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘††††††††††††‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘††††††‘‘‘†††††††††††††††††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘††††††††††††††††††‘‘‘††††††‘‘‘‘‘‘‘‘‘†††††††††‘‘‘‘‘‘††††††††††††††††††††††††‘‘‘‘‘‘††††††fffVVVVVVfffppppppfff^^^fffpppVVVNNNGGG===============NNN ªªª°°°ÎÎÎçççÁÁÁ–––––––––ªªª×××–––^^^GGG^^^–––ÁÁÁççççççÁÁÁfffEEEVVVwwwVVVGGG===333333333333===–––ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï×××–––EEE------------------EEEGGG===GGG===GGGEEE===EEE333333===333---------------333333------EEEGGG333333===EEE===333GGG---333EEEEEE===GGG333GGG333333===333---"""---""""""""""""""""""""""""""""""---VVV^^^^^^^^^^^^fffffffff^^^fff^^^^^^^^^^^^ffffff^^^ffffffffffffpppffffffffffffffffffffffffpppfff^^^fffffffff^^^fff^^^fff^^^fffffffffffffffffffff^^^ffffffffffffffffffpppffffffffffffffffffffffffpppfffppppppfffpppffffffffffffffffffffffffffffffffffffpppfffpppppppppwwwwwwwwwwwwppppppwwwppppppffffffGGGEEE‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††‘‘‘††††††††††††††††††††††††††††††††††††‘‘‘††††††‘‘‘††††††††††††‘‘‘†††‘‘‘†††††††††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘††††††††††††††††††††††††††††††‘‘‘‘‘‘††††††fffNNN^^^ppppppfffffffffpppfffpppVVVEEEEEE333===EEEVVV†††‘‘‘ªªªÎÎ涶†††‘‘‘ °°°‘‘‘pppVVVVVV†††ªªª×××çççÇÇdž††GGGGGGppp¶¶¶ÇÇÇ pppNNNEEE333333333===wwwïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÎÎΑ‘‘===------------------GGGGGGEEEGGG333EEE===333333------------------"""---333GGGEEE---333GGGNNN333======GGG======EEE------GGG======EEE---===---"""------"""---"""""""""""""""""""""""""""""""""333VVV^^^^^^^^^fff^^^fffffffff^^^^^^^^^VVV^^^fff^^^fffffffffffffffffffffffffff^^^fffffffffffffffffffff^^^ffffffffffff^^^fff^^^ffffffffffffffffff^^^ffffffffffffffffffppppppffffffpppfffpppfffpppfffppppppfffppppppffffffffffffffffffffffffffffffffffffpppfffpppppppppppppppwwwppppppwwwwwwppppppfffpppfff^^^GGG†††‘‘‘‘‘‘††††††‘‘‘†††‘‘‘‘‘‘†††‘‘‘††††††††††††‘‘‘††††††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘†††††††††‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††‘‘‘††††††‘‘‘†††††††††††††††‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘†††fffNNNVVVpppppppppfffpppppp†††ªªªwwwGGGEEE===EEEfff†††††††††°°°×××××× †††††††††–––†††^^^VVVpppªªªÎÎÎßßßÎÎΖ––NNNVVV°°°ßßß×××°°°–––wwwGGG===333===333^^^ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÎÎΆ††===------------------GGGEEE333===333---------------------------"""------===NNNGGG333===NNNGGG333======GGG===EEEEEE------EEE333333333------"""---"""""""""""""""""""""""""""""""""""""""""""""EEE^^^^^^^^^^^^^^^ffffffffffff^^^fffVVVVVV^^^^^^ffffffffffffpppffffffffffffffffffffffffpppfffffffff^^^ffffffffffffffffff^^^ffffff^^^ffffffffffff^^^fffffffffffffffpppfffpppfffffffffffffffffffffpppppppppffffffpppffffffpppfffpppffffffffffffffffffffffffpppppppppppppppwwwpppppppppppppppfffppppppfffpppfff^^^†††††††††‘‘‘††††††‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††‘‘‘‘‘‘†††‘‘‘††††††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘††††††‘‘‘†††‘‘‘†††fffVVVVVVppppppffffffppp‘‘‘¶¶¶ ^^^GGGEEEEEE^^^‘‘‘°°°–––ªªªÁÁÁ×××°°°‘‘‘‘‘‘†††–––°°°‘‘‘ppp–––ppp–––ÁÁÁßßßÎÎΖ––^^^www×××ßßß×××°°°°°°wwwNNNEEE=========VVVïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÎÎÎ333---------"""------333333---------------------------------------------===NNNNNN===EEEGGGGGG333======GGG===EEEEEE------333------"""---"""""""""""""""""""""""""""""""""""""""""""""""""""""""""EEEVVV^^^^^^ffffff^^^fff^^^^^^ffffffVVV^^^^^^fff^^^ffffffffffffffffff^^^ffffffffffffppp^^^ffffffffffffffffffffffff^^^fffffffffffffffffffff^^^ffffffffffffffffffpppfffpppffffffpppffffffffffffppppppfffpppfffpppfffffffffpppfffffffffffffffffffffffffffffffffppppppppppppppppppppppppppppppfffpppppppppppppppppp‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††‘‘‘‘‘‘†††‘‘‘††††††‘‘‘†††††††††††††††††††††††††††††††††††††††‘‘‘‘‘‘†††‘‘‘†††pppVVVVVVpppffffffppp†††ªªª VVV^^^wwwVVVfff ††† ÎÎ涶 ––– ‘‘‘¶¶¶ÁÁÁ‘‘‘ÇÇÇpppwww–––××׶¶¶–––°°°ßßßçççÎÎΰ°°°°°VVVEEE=========NNNçççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÇÇÇ333---------------------------------------333===------------======------EEEGGGNNNGGGEEEGGGEEE===GGGEEEEEE---===333"""---"""---"""---""""""""""""""""""""""""""""""""""""""""""""""""""""""---GGG^^^^^^^^^^^^fff^^^^^^^^^fff^^^^^^^^^^^^fff^^^fff^^^ffffff^^^ffffffffffffffffffffffffffffffffffffffffffffffff^^^fffffffff^^^fffffffffffffffffffffpppfffffffffpppffffffpppfff^^^ffffffpppfffppppppfffpppfffffffffpppfffpppppppppfffffffffffffffffffffffffffffffffppppppppppppwwwpppfffpppppppppppppppwwwpppppp†††‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘††††††‘‘‘†††††††††††††††‘‘‘‘‘‘†††‘‘‘†††††††††††††††‘‘‘‘‘‘†††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††‘‘‘††††††††††††pppVVVVVVpppffffffwww†††‘‘‘^^^wwwªªªwwwppppppwwwªªªÁÁÁ¶¶¶ªªª–––††† ÁÁÁ××× °°°^^^°°°ªªª°°° ÇÇÇçççßßßÇÇÇ ªªªwww^^^GGGEEE======GGG×××ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÇÇÇwww333---------------------------------------======333===============------EEEEEEGGGNNN===GGGEEE===EEE===333---"""------"""---"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---NNN^^^^^^ffffff^^^^^^^^^fff^^^^^^^^^^^^fff^^^fffffffffffffffffffff^^^ffffffffffffffffff^^^fffffffffffffff^^^fffffffffffffffffffff^^^ffffffffffffffffffffffffpppffffffpppffffffffffffpppfffpppfffpppfffpppffffffpppffffffppppppfffpppfffpppffffffffffff^^^fffffffffppppppfffpppffffffppppppppppppwwwppppppfffppp‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘–––‘‘‘‘‘‘‘‘‘–––––––––––––––––––––‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††††††††‘‘‘†††††††††††††††wwwwww††††††††††††††††††††††††††††††‘‘‘††††††‘‘‘‘‘‘†††‘‘‘††††††††††††pppVVVVVVffffffwww†††ppp–––†††pppppp‘‘‘pppªªª¶¶¶ªªª‘‘‘‘‘‘‘‘‘–––ÎÎ涶‘‘‘wwwNNNfff ÁÁÁ–––×××çççßßßÁÁÁ –––www^^^GGGGGGEEE===GGGÇÇÇýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÁÁÁfff333---------------------------------333333EEEEEE===EEE======GGG===------EEE===EEEEEE333EEE333------------"""---"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---VVV^^^fff^^^fff^^^^^^ffffff^^^^^^^^^fff^^^ffffff^^^fffffffffffffffffffffffffffffffffffffffffffffffffff^^^fffffffffppp^^^fffffffffffffffffffffpppffffffpppfffffffffpppfffffffffpppfffpppfffpppffffffffffffffffffppppppfffppppppfffpppfffpppfffffffff^^^^^^^^^fffpppfffpppffffffffffffpppppppppwwwppppppfffffffff‘‘‘†††‘‘‘‘‘‘†††‘‘‘–––––– ‘‘‘‘‘‘–––‘‘‘––––––‘‘‘‘‘‘–––––––––––––––––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘†††††††††††††††††††††††††††††††††www†††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘†††‘‘‘††††††‘‘‘†††††††††pppVVVNNNfffwww‘‘‘^^^www‘‘‘fffppp†††ªªª†††ªªª°°°ªªª‘‘‘‘‘‘ ‘‘‘–––×××ÇÇÇpppVVVVVVppp °°°×××çççßß߶¶¶ ‘‘‘www^^^VVVGGGEEE===EEE¶¶¶ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçç綶¶^^^------------------------------------===EEEGGGEEEEEE=========EEE333------GGG333---333------------"""---""""""""""""""""""""""""""""""""""""""""""""""""""""""---""""""""""""""""""""""""""""""333^^^fffffffff^^^fffffffff^^^^^^^^^ffffff^^^fff^^^fffpppffffffffffffffffffffffff^^^^^^^^^ffffffffffffffffffffffffffffff^^^ffffffffffffpppfffpppffffffpppffffffpppfffpppfffffffffpppffffffffffff^^^^^^fffffffffpppffffffpppppppppfffpppfffpppfffffffff^^^fffffffffffffffffffffffffffffffffpppwwwpppfffffffffffffff†††‘‘‘†††‘‘‘‘‘‘––––––––––––––––––––––––‘‘‘––––––‘‘‘‘‘‘–––––––––––––––––––––––––––‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††††††††‘‘‘‘‘‘†††‘‘‘†††††††††‘‘‘†††‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘††††††‘‘‘††††††‘‘‘†††††††††fffNNNNNN^^^www‘‘‘fffGGGVVVªªªwwwfffwww‘‘‘ –––––––––ÁÁÁÁÁÁ –––ÁÁÁªªª†††pppVVVpppªªª wwwÇÇÇçççÎÎΪªªªªª‘‘‘pppVVVNNNGGGEEE===EEEªªªýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçç綶¶NNN---------------------------------333EEE===EEEEEEGGG===333===333---------333---------"""------"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---"""""""""""""""""""""""""""EEE^^^ffffff^^^fffffffff^^^fffffffff^^^fff^^^^^^ffffffffffff^^^ffffffffffffffffff^^^fffffffffffffffffffffffffffffffff^^^ffffffpppffffffpppfffffffffpppfffpppffffffpppfffffffffpppfffpppfffffffff^^^fff^^^pppfffppppppfffpppppppppppppppfffpppffffff^^^ffffffpppfffffffffffffff^^^ffffffpppppppppppppppfff^^^fffppp†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––– –––––––––––––––––––––‘‘‘––––––––––––––––––––––––––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††††††††††††††‘‘‘††††††‘‘‘††††††††††††wwwfffNNNNNNwww†††GGGNNN–––†††ppp^^^fff‘‘‘wwwppp–––ßßßçççÎÎΰ°°°°°ªªª‘‘‘‘‘‘‘‘‘VVVppp ppp°°°ÁÁÁÁÁÁ°°°¶¶¶‘‘‘^^^NNNGGGEEE======EEE ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçç綶¶NNN---------------------------------===EEEEEE===333EEE333------------------------"""---""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---""""""""""""""""""""""""""""""""""""GGGfff^^^^^^ffffff^^^ffffff^^^fff^^^^^^^^^ffffffffffff^^^ffffffffffffffffffffffff^^^^^^fffffffffffffff^^^fffffffffffffffffffffpppfffpppfffpppfffppppppffffffpppfffpppfffpppffffffffffffffffff^^^fff^^^ffffffpppfffpppppppppppppppppppppffffffffffffffffffppppppfff^^^ffffffffffff^^^ffffffppppppppppppffffffpppfff‘‘‘†††‘‘‘‘‘‘‘‘‘––––––––– ––––––––––––––––––‘‘‘‘‘‘––––––––––––––– ––– ––––––‘‘‘‘‘‘‘‘‘––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘††††††www††††††††††††††††††‘‘‘†††††††††††††††††††††††††††††††††‘‘‘†††††††††‘‘‘†††‘‘‘‘‘‘††††††††††††‘‘‘†††††††††††††††††††††www^^^VVVpppwwwVVVVVVppp†††pppVVVNNNpppwwwfffVVV‘‘‘ßßßýýýïïïÎÎ涶–––‘‘‘–––†††VVVfff†††–––ppp†††ÁÁÁ×××××׶¶¶^^^NNNGGGEEE======EEE ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïçç窪ªGGG---------------------------------333EEE===333------------------------------""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---""""""""""""""""""""""""""""""""""""---NNN^^^ffffff^^^fff^^^^^^^^^fff^^^^^^fff^^^fff^^^ffffff^^^ffffffffffffffffffffffffffffffffffffffffff^^^fffffffffffffffffffffpppfffpppfffpppfffpppffffffpppffffffffffffpppfffpppfffffffff^^^^^^^^^ffffffpppfffppppppfffpppfffpppfffpppfffpppfffffffffffffffpppfff^^^^^^ffffffffffffffffff^^^ffffffpppppppppppppppppp‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––––––––– –––––––––‘‘‘–––‘‘‘‘‘‘––––––‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††††††††‘‘‘††††††††††††††††††‘‘‘†††‘‘‘††††††††††††††††††††††††‘‘‘††††††‘‘‘††††††‘‘‘‘‘‘†††‘‘‘††††††‘‘‘††††††‘‘‘†††††††††††††††‘‘‘‘‘‘†††wwwVVVNNNfff^^^NNNNNN^^^^^^NNNEEENNNfff^^^^^^×××ýýýýýýççç××תªª¶¶¶ wwwffffffppp‘‘‘fff ßßß×××ÇÇǶ¶¶^^^GGGGGGGGGEEE======‘‘‘ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïçç窪ªEEE------------------------------------------------------------------""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---------"""""""""------"""""""""""""""""""""""""""""""""---VVVfff^^^fff^^^ffffff^^^^^^^^^^^^^^^^^^fff^^^fff^^^^^^fffffffffffffffffffffffffffffffffffffffffffffffffffpppfffpppffffffpppfffpppfffpppfffpppfffpppffffffpppffffffpppfffpppffffff^^^ffffff^^^ffffffffffffpppfffppppppfffpppfffpppfffpppfffffffffpppppppppffffff^^^^^^ffffffppppppffffff^^^ffffffpppfffpppfffpppfff‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘–––––– ––––––––––––––––––‘‘‘––– ––––––‘‘‘†††††††††‘‘‘‘‘‘‘‘‘†††††††††‘‘‘†††††††††††††††‘‘‘†††‘‘‘†††††††††††††††‘‘‘††††††††††††††††††‘‘‘††††††‘‘‘‘‘‘††††††††††††††††††††††††‘‘‘††††††††††††pppVVVNNN^^^^^^NNNNNN^^^GGGEEEGGG^^^†††www‘‘‘¶¶¶çççïïïýýýçççÇÇÇÁÁÁ†††wwwppp^^^wwwfff°°°ÇÇÇÁÁÁ°°°ªªª‘‘‘^^^GGGGGGGGG======EEE‘‘‘ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïßßß–––EEE---------------------------------------------------------""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---------===333---"""------------"""""""""""""""""""""---"""""""""333^^^^^^ffffff^^^^^^^^^fff^^^^^^^^^^^^fff^^^^^^^^^^^^fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffpppffffffpppfffffffffpppffffffpppfffpppffffffpppfffpppffffffffffff^^^^^^fff^^^fffpppffffffffffffpppfffpppfffpppfffffffffpppffffffpppffffffVVVNNNVVVfffpppfffpppfffffffff^^^fffffffffpppfffffffff––––––‘‘‘–––‘‘‘‘‘‘‘‘‘––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘––– ––––––––––––––– ––– –––––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘†††††††††††††††††††††††††††††††††‘‘‘†††††††††††††††‘‘‘‘‘‘†††††††††††††††††††††††††††††††††††††††††††††ppp^^^VVV^^^NNNNNNVVVNNNEEEGGGwww‘‘‘www‘‘‘¶¶¶ÎÎÎçççýýýýýýçççÁÁÁ†††ªªªÁÁÁwwwpppppp°°°ÇÇÇ°°°––––––†††fffGGGEEE=========EEE†††ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïßßß‘‘‘===------------------------------------------------""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""333EEEEEEEEE---EEE===333333333333---"""""""""""""""---333===333"""""""""===^^^fff^^^ffffff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^ffffff^^^ffffffffffff^^^fff^^^ffffffffffffpppffffffpppfffpppffffffffffffpppfffffffffppppppfffpppfffpppfffpppffffffpppfffpppfffffffff^^^^^^fffffffffffffffpppfffpppffffffpppfffffffffpppfffffffffppppppffffff^^^GGG===NNNfffpppfffpppffffff^^^^^^^^^fff^^^fffpppffffff‘‘‘–––––––––––––––‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘–––‘‘‘–––––––––––––––––––––––– ––– –––––– ––––––‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘††††††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††wwwVVVVVVVVVNNNGGGGGGGGGEEEfff††††††ÇÇÇßßßßßßïïïýýýýýýÎÎΖ––‘‘‘ ¶¶¶–––°°°¶¶¶ªªª¶¶¶ªªª–––†††pppGGG============EEE‘‘‘ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï××׆††===---------------------------------------"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""------"""---333EEENNN^^^^^^NNN333GGG===EEENNNNNNEEE---""""""------333EEEEEEGGG==="""""""""EEEVVV^^^fff^^^^^^fff^^^fff^^^ffffff^^^^^^ffffffffffffffffffffffff^^^ffffffffffffffffffpppfffffffffffffffffffffpppfffffffffffffffffffffppppppfffffffffffffffppppppfffffffffffffffffffff^^^ffffffffffffpppffffffpppfffffffffffffffffffffffffffpppfffpppfff^^^GGG===EEEffffffppppppffffffffffffffffffffffffpppfffffffff‘‘‘–––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘–––‘‘‘––––––––––––––– ––– ––– ––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††††††††††††††††††††††††††‘‘‘†††‘‘‘‘‘‘†††††††††††††††††††††††††††††††††††††††‘‘‘††††††‘‘‘†††††††††††††††‘‘‘††††††††††††wwwVVVNNNGGGGGGGGGGGGEEEGGG^^^www‘‘‘°°°ÎÎÎ×××ïïïýýýýýýççç××תªª ¶¶¶‘‘‘ªªª¶¶¶ ªªª–––‘‘‘pppfffGGG============EEE‘‘‘ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï××׆††===------------------------------""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---GGGGGGEEEGGGNNN^^^fff^^^^^^GGG333333333GGG^^^VVVEEE------333===GGGGGGEEEEEE333---"""""""""GGGVVV^^^^^^^^^^^^^^^^^^fffffffff^^^^^^fff^^^ffffffffffffffffffffffffffffffpppffffffpppfffffffffpppffffffpppfffpppfffffffffffffffpppfffffffffpppffffffpppfffppppppfffffffffffffff^^^ffffffffffffpppffffffffffffffffffffffffffffffffffffffffffppppppffffffGGG333===^^^pppfffpppfffpppffffffffffffpppfffffffffpppffffff–––‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––‘‘‘–––––– ––– ––– ––––––––––––––––––‘‘‘––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††††††††††††††‘‘‘‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††††††††††††††††††††‘‘‘†††‘‘‘††††††‘‘‘†††pppVVVGGGEEEGGGGGGGGGEEEEEENNN ÁÁÁÁÁÁïïïýýýýýýýýý×××°°° ‘‘‘†††††† –––wwwwwwfffVVVGGGEEE=========EEE–––ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÎÎΆ††333---------------------""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""333333EEE^^^VVVVVVVVV^^^^^^^^^VVVEEE===333---333EEENNNGGG======GGGGGGNNNGGG===---"""---"""""""""---GGGVVVVVVVVVVVV^^^^^^fff^^^fffffffff^^^ffffffffffffffffff^^^ffffffffffffffffffffffffffffffffffffffffffpppffffffffffffffffffppppppfffpppfffpppffffffpppfffpppffffffpppfffpppfffffffffffffffpppfffpppfffpppfffpppffffffffffffffffffffffffffffffpppffffffNNN===EEEVVVppppppppppppffffffffffffffffffpppffffffpppfffffffff‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––––––‘‘‘‘‘‘‘‘‘–––––––––‘‘‘–––‘‘‘–––––– ªªª ––– ––– ––– ––––––‘‘‘–––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††††††††‘‘‘†††††††††††††††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††‘‘‘†††††††††‘‘‘‘‘‘†††wwwpppVVVEEEGGGGGGGGGGGGGGGGGGfff°°°¶¶¶¶¶¶ßßßýýýýýýýýýïïïßßßÇÇÇ–––‘‘‘www^^^fff††††††pppVVVNNNGGG===EEEEEEEEEEEE–––ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÎÎÎwww333------------"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---333===NNNNNNVVVfff^^^fffNNNGGGGGGEEE======333333333===EEENNNNNNEEEGGGNNNGGG333---"""""""""""""""""""""---NNNNNNVVVVVV^^^^^^^^^ffffffffffff^^^fffffffffpppffffff^^^fffffffffffffff^^^fff^^^ffffffffffffffffffpppfffpppfffffffffpppfffpppfffpppfffpppfffpppfffppppppffffffffffffffffff^^^ffffffpppffffffpppfffpppfffpppfffffffffffffffffffff^^^ffffffffffffpppVVV===EEE^^^pppppppppppppppffffffpppfffpppffffffpppfffppppppfffppp‘‘‘‘‘‘––––––––––––––––––––––––––– –––––––––––– ––– ––– –––––– –––––– ––––––––––––––––––––– ––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††††††††‘‘‘†††‘‘‘††††††††††††††††††††††††††††††‘‘‘‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘†††††††††††††††††††††wwwpppVVVGGGGGGNNNNNNGGGGGG^^^–––°°°ÇÇǶ¶¶ïïïýýýýýýïïïïïïçççÎÎΪªªpppfff†††ppp^^^NNNGGGGGG===NNNVVVVVVGGGªªªïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÇÇÇppp---""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""---""""""333===GGGGGGVVVVVV^^^^^^VVVGGG===333333333333333333======EEEGGGVVV^^^NNNEEEGGG===---"""""""""""""""""""""""""""---NNNNNNVVVVVVVVV^^^^^^^^^^^^^^^fff^^^ffffffffffffffffffffffff^^^ffffff^^^fff^^^ffffffffffffffffffffffffpppffffffpppffffffpppfffpppfffffffffffffffpppfffpppfffpppffffffffffff^^^fffpppfffpppfffpppfffpppffffffffffffffffff^^^fff^^^ffffffffffffpppVVV======VVVpppfffpppppppppppppppfffpppfffpppfffffffffppppppfffpppfff–––––– ––– ––– ––– ––– –––––– –––––– ––– ––– ––––––––––––‘‘‘‘‘‘†††‘‘‘††††††††††††††††††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††††††††wwwpppVVVGGGNNNGGGNNNGGGNNNppp–––ÁÁÁªªª×××ýýýýýýïïïýýýïïïïïïßßߪªªÎÎ涶wwwfffVVVNNNGGGEEE===NNNwwwwwwNNNªªªýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÇÇÇ^^^"""""""""""""""""""""""""""""""""""""""""""""""""""---""""""---""""""EEE======EEENNNVVVVVVNNN^^^VVVEEEEEE------"""------------333======GGGNNNVVVNNNGGGEEE333333---333======"""""""""""""""""""""333GGGNNNNNNVVVVVV^^^^^^^^^^^^^^^^^^ffffffffffff^^^fff^^^^^^fffffffff^^^fffffffffffffff^^^ffffffpppfffffffffpppfffpppfffpppfffpppfffffffffffffffpppfffpppffffffffffffffffff^^^fffpppfffpppfffpppfffpppfffpppffffffffffffffffff^^^ffffffffffffffffffGGG===VVVfffpppfffpppfffpppfffppppppfffpppfffpppfffpppppppppppppppfff–––––– ªªª ––– ––––––––– –––––– ––– ––– ––– ––– ––––––‘‘‘‘‘‘‘‘‘†††‘‘‘††††††††††††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††††††††††††††††††††††††††wwwwwwVVVGGGNNNNNNNNNGGGNNNpppªªª¶¶¶ ßßßýýýýýýïïïýýýïïïßß߶¶¶×××ßß߶¶¶‘‘‘fffNNNNNNGGG======GGGfffNNNªªªýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÇÇÇNNN"""""""""""""""""""""""""""""""""""""""""""""---""""""""""""""""""---VVVVVVVVV^^^^^^^^^NNN===333333""""""""""""""""""---"""333GGGNNNNNNNNNGGGEEE333---------333EEEEEEEEEEEE---""""""""""""""""""===GGGNNNNNNVVVVVVVVVVVV^^^^^^^^^^^^fff^^^ffffff^^^°22ú��ú��ú��ú��fffffffff^^^fffffffffffffffffffffpppfffpppffffffpppffffffpppfffpppffffffffffffpppfffpppfffffffffffffffffffffpppffffffpppfffpppfffpppfffffffff^^^ffffffffffff^^^fffffffffffffffNNNEEENNNffffffpppfffppp^^^pppppppppppppppfffpppfffpppfffppppppppppppppp–––––– ––– ––– ªªª–––‘‘‘‘‘‘‘‘‘†††‘‘‘ ––––––––– ––– ––––––‘‘‘–––––––––––– ––––––––––––‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††www††††††††††††††††††††††††††††††wwwVVVGGGGGGNNNNNNGGG^^^†††ªªª–––¶¶¶ïïïýýýïïïýýýýýýçççÎÎÎÁÁÁÇÇÇßßßÎÎÎNNNGGGEEE======EEE^^^wwwVVVªªªýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÇÇÇNNN""""""""""""""""""""""""""""""""""""""""""---""""""---""""""""""""---^^^fffVVV^^^fff^^^===---""""""""""""""""""------333"""===NNNGGGGGG===""""""------======EEENNNEEE------"""""""""""""""""""""EEEGGGGGGNNNNNNVVVVVVVVVVVV^^^^^^^^^^^^^^^ffffffRR÷ú��ú��ú��ú��fffffffffffffffffffffffffffpppffffffffffffpppfffffffffpppfffpppfffpppfffpppfffpppffffffffffffffffffffffffffffffpppfffpppfffpppfffpppfffffffffffffffffffff^^^ffffff^^^ffffffVVVNNNNNNfffffffffpppfff^^^^^^ppppppppppppppppppfffppppppffffffpppfffpppfff ––– –––––––––––––––––––––––––––––– ––– –––––––––––––––––– –––––– –––––––––––––––––––––––– ––––––‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘††††††††††††www††††††††††††††††††††††††††††††††††††††††††ppp^^^GGGNNNNNNNNNppp–––‘‘‘www×××ýýýïïïïïïýýýïïïßßß°°°ÇÇÇ×××××תªªVVVGGGEEE======EEENNNpppNNNªªªïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïçççÁÁÁGGG"""""""""""""""""""""""""""---""""""---""""""---"""""""""---""""""333VVVNNN===EEEVVVEEE---"""""""""""""""---333GGGGGGEEE---333333---""""""---333EEEEEEGGGEEE===333"""""""""""""""""""""EEEGGGGGGNNNNNNNNNNNNVVVVVV^^^^^^^^^fff^^^fffhddÞú��ú��ú��ú��ú��fffffffffffffffffffffffffffpppfffpppfffpppppppppffffffpppfffpppffffffpppfffpppfffffffffffffff^^^ffffffppppppffffffpppfffpppfffffffffpppfffffffffffffffffffffffffff^^^fff^^^VVVVVVfffffffffffffff^^^^^^fffwwwppppppppppppppppppppppppfffpppfffppppppppp–––––––––––– –––––– –––––– –––––– ––– ––– ––– ––– ––– ––––––––––––‘‘‘–––‘‘‘–––––––––‘‘‘‘‘‘––––––––– ––– ––––––––––––‘‘‘‘‘‘††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘†††‘‘‘††††††††††††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††††††††www^^^GGGGGGNNNppp–––ªªªwwwVVV‘‘‘çççýýýïïïýýýýýýçççÎÎΰ°°ÎÎÎ×××ÎÎÎÁÁÁªªªVVVEEE===EEEGGGGGGGGG–––çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýßß߶¶¶GGG""""""""""""---"""""""""---""""""---"""---""""""---"""---"""""""""---333---"""------""""""---"""---333===GGGNNNGGGGGG===---"""""""""---===EEEGGGGGG===333---""""""""""""""""""---EEEú��ú��GGGGGGGGGNNNNNNVVV^^^^^^^^^^^^ffffffµ77ú��çú��ú��ú��ú��fffppppppfffffffffppppppfffpppfffffffffpppfffpppfffpppfffpppfffffffffpppfffpppffffffffffffffffff^^^pppfffpppppppppfffpppffffffpppffffffffffffffffff^^^fffffffffffffff^^^^^^VVVffffffffffffffffffpppppppppppppppppppppppppppppppppfffpppfffpppfffpppfff–––––––––––– –––––– ––––––––––––––– –––––––––––– –––––––––‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘––––––––– –––––––––‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††wwwwww†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††††††††‘‘‘†††††††††††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘††††††††††††fffGGGNNNVVV††† †††^^^VVV¶¶¶ïïïýýýïïïýýýýýýßßßÇÇÇÁÁÁÎÎÎßßßßßßçççÇÇÇ^^^EEEGGGVVVEEE===ßßßýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïßß߶¶¶EEE"""""""""""""""---"""---""""""---""""""---"""---"""""""""---"""---"""""""""""""""""""""---EEEEEEEEEEEEGGGGGG===333"""---333===333---EEEGGGGGGEEE333""""""""""""""""""""""""333EEEú��ú��GGGGGGNNNNNNVVVVVVVVV^^^^^^ffffffSS÷ø��‰MMú��ú��ú��ú��pppfffpppffffffpppfffppppppfffffffffpppfffpppfffpppfffpppffffffpppfffpppffffffffffffpppffffffffffffpppfffppppppffffffpppfffpppfffffffffffffffffffff^^^fff^^^ffffff^^^fff^^^^^^^^^^^^fffpppfffppppppppppppppppppwwwwwwwwwwwwpppppppppppppppfffppppppfff–––––––––––– ––– ––– ªªª ––– ––– ––– ––––––––––––‘‘‘‘‘‘††††††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘––––––––– –––‘‘‘‘‘‘†††‘‘‘‘‘‘†††††††††www†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††††††††††††††††††††‘‘‘†††††††††‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††††††††††††††wwwfffGGGNNN^^^–––°°°pppNNNppp×××ýýýýýýýýýýýýýýýïïï××׶¶¶ÎÎÎÎÎÎÁÁÁ×××°°°†††www^^^EEEEEEwwwÎÎÎïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýý××תªª===""""""---"""---"""""""""---""""""------"""---"""---"""---""""""""""""""""""""""""---======NNNGGGNNN333333---""""""---333NNNNNNEEE---===333---""""""---EEE333"""""""""""""""""""""===GGGú��ú��GGGGGGGGGNNNVVVVVVVVV^^^^^^fffhddÞú��¾00fffú��ú��ú��ú��ppppppfffpppfffppppppffffffffffffppppppffffffppppppffffffppppppppppppffffffpppffffffffffffffffffpppfffppppppfffpppffffffpppffffffffffffffffff^^^fffffffff^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^ffffffppppppppppppfffppppppppppppfffpppppppppfffppppppfffpppppp‘‘‘–––––– ––––––––––––‘‘‘‘‘‘††††††wwwwwwwwwwwwwwwwwwwwwwwwwww††††††‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘††††††††††††www††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††††††††††††††††††††‘‘‘†††††††††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††††††††††††††††††††www^^^NNNVVV–––ªªª†††NNNVVV‘‘‘çççýýýïïïïïïýýýýýýçççÁÁÁ ¶¶¶ÇÇÇ××××××ßßßÁÁÁwwwNNNNNNwwwÇÇÇçççïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï××× ==="""---"""---""""""---"""---"""---"""---------333------------------"""------333---EEEGGGNNNGGG===---"""""""""---===EEENNNNNNGGG==="""""""""---======GGGNNNEEE"""""""""""""""""""""EEEEEEú��ú��GGGGGGNNNNNNNNNVVVVVV^^^^^^fff°22ú��ækbbfffú��ú��ú��ú��pppfffpppfffppppppppppppfffpppppppppfffpppfffppppppfffpppfffpppppppppfffffffffpppffffffffffffpppfffpppfffpppfffppppppfffpppffffffffffffffffff^^^fffffffff^^^^^^^^^^^^^^^^^^VVVVVV^^^^^^ffffffffffff^^^fffpppppppppfffpppfff^^^^^^ffffffffffffpppfffppp‘‘‘‘‘‘†††wwwpppffffff^^^^^^fff^^^ffffffpppfff^^^VVV^^^^^^^^^^^^^^^^^^fffpppwww†††‘‘‘‘‘‘†††††††††††††††††††††††††††wwwwwwwww†††‘‘‘‘‘‘‘‘‘††††††‘‘‘†††‘‘‘†††††††††††††††††††††††††††‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘††††††wwwfffNNNfffVVVNNN^^^°°°ïïïýýýýýýýýýýýýïïï××תªª °°°ÎÎÎßßßßßß°°°wwwÇÇÇÁÁÁ×××ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï×××–––==="""---"""---"""---"""---"""---"""333=====================333333333EEEEEEGGGEEE---EEE===333"""""""""---333===GGGNNNEEEEEE333"""""""""---333EEEGGGGGGGGG==="""""""""""""""""""""---EEEEEEú��ú��GGGGGGNNNNNNVVVVVV^^^^^^^^^SSöø��ŠMMppppppú��ú��ú��ú��pppppppppppppppppppppfffpppfffppppppppppppffffffpppfffpppppppppfffpppfffffffffffffff^^^ffffffpppfffpppfffppppppfffppppppfffpppfffffffff^^^^^^fffffffff^^^fff^^^^^^^^^^^^VVV^^^^^^fff^^^fff^^^VVVNNNVVVfffppppppfffffffffppp^^^^^^^^^^^^fffffffffpppffffff^^^^^^^^^^^^^^^^^^ffffffppppppppppppwwwwwwpppppppppfffffffffffffff^^^^^^VVVfffwww‘‘‘†††wwwppppppfffpppppppppppppppppp†††wwwwwwwww†††‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘†††††††††††††††††††††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘–––––––––‘‘‘‘‘‘‘‘‘–––‘‘‘––––––‘‘‘‘‘‘‘‘‘††††††‘‘‘†††‘‘‘†††pppNNNVVVVVVNNNNNNNNNfffÎÎÎýýýýýýýýýïïïýýýïïïÎÎΰ°°ªªª–––ÎÎÎ×××ÇÇÇ‘‘‘¶¶¶¶¶¶ppp ªªªßßßïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÎÎΖ––333---"""---"""---"""---"""------===GGGGGGEEEEEE=========EEEEEEGGGNNNNNNGGGGGG==="""""""""""""""333EEEGGGNNNGGGEEE333---"""""""""------===NNNEEE===333"""""""""""""""""""""ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��^^^^^^^^^fffàú��»++pppppppppú��ú��ú��ú��fffppppppfffppppppfffppppppppppppppppppfffpppfffpppfffpppppppppffffffffffffffffffffffffppppppfffppppppfffpppfffpppfffppppppfffpppfffVVVNNNffffffffffff^^^^^^VVV^^^^^^VVV^^^^^^^^^^^^^^^VVVVVVNNNNNN^^^ffffff^^^^^^^^^^^^VVV^^^VVVVVV^^^fffppppppVVVVVVVVVVVV^^^^^^^^^^^^fff^^^fffffffff^^^fffffffffffffff^^^fffffffffffffffpppppppppwwwpppfff^^^^^^^^^fff^^^fffffffffpppppp†††††††††††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††††††††‘‘‘†††‘‘‘‘‘‘††††††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––––––––––––––– ––– ––––––––––––‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††pppVVVGGGNNNGGGNNNNNNßßßïïïýýýïïïïïïýýýïïïßßß×××°°°‘‘‘°°°ÎÎ涶ÎÎÎÇÇÇpppwwwÁÁÁçççýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïÎÎΆ††---"""---""""""---"""---"""------GGG^^^NNNNNNGGGGGGGGGNNNVVVNNNNNNGGGEEE------""""""""""""333EEEGGGNNNEEE===333"""""""""---===EEE===---GGG333---""""""""""""""""""ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��^^^^^^ffffffú��èlbbfffppppppú��ú��ú��ú��ppppppfffppppppppppppfffppppppppppppppppppfffpppfffpppfffpppffffffpppfffffffffffffffffffffpppfffpppfffpppfffffffffpppfffppppppffffffVVV^^^pppffffff^^^^^^^^^^^^^^^VVVVVVVVVVVVVVVVVVVVV^^^NNNNNNNNN^^^VVV^^^ffffffNNNEEE333333EEEGGGNNN^^^fffppp^^^^^^wwwwwwpppfffpppfffffffffffffffpppppppppppppppppppppwww††††††‘‘‘†††wwwppp^^^^^^^^^VVV^^^^^^^^^fff^^^pppppppppppppppwwwwww††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––––––––––––––––– ––– ––– –––––––––––––––––––––––––––‘‘‘‘‘‘wwwVVVGGGGGGGGGNNNVVV–––ïïïýýýýýýýýýïïïïïïýýýçç窪ª††††††‘‘‘‘‘‘ÁÁÁÇÇÇ‘‘‘fffªªªçççýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÇÇÇwww------"""---"""---"""---"""---333VVVfffVVVVVVVVVfff^^^NNNGGGEEE333---"""""""""---333"""---GGGEEEEEE333"""""""""---333EEEEEEGGGEEE333---333""""""""""""""""""""""""""""""EEEEEEGGGú��ú��NNNVVVVVV^^^^^^ffffffffffffú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ffffffpppfffppppppfffppppppppppppfffppppppfffppppppfffffffffpppffffffffffffpppffffffpppfffpppffffffpppffffffppppppfffpppfff^^^fffpppfffpppfffffffff^^^^^^VVVVVVVVVVVVVVVVVVVVVVVVVVVNNNNNNVVVVVVVVV^^^VVV^^^EEE"""---"""---333NNNVVVfffpppffffff††††††††††††††††††‘‘‘‘‘‘†††††††††‘‘‘‘‘‘‘‘‘††††††wwwwwwfffffffffVVV^^^VVVVVVVVV^^^^^^^^^^^^^^^ffffffpppfffppppppwwwwww††††††††††††‘‘‘–––‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘–––––––––––––––––––––––– ––––––––– ––– ––––––––––––‘‘‘wwwVVVGGGGGGNNNGGG^^^ÁÁÁïïïýýýýýýýýýïïïïïïïïïÎÎÎÁÁÁªªª†††–––ÇÇǶ¶¶†††°°°çççýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÎÎÎfff---"""---"""---------------===GGGppp^^^VVVfff^^^VVVGGG===""""""---======333===GGGEEE---"""===---"""""""""333===GGGGGGGGGNNN===---""""""""""""""""""""""""""""""""""""---EEEEEEGGGú��ú��VVV^^^^^^ffffffffffffpppfffú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ppppppppppppppppppppppppppppppfffppppppfffpppfffpppfffpppfffffffffffffffpppfffppppppffffffpppfffpppffffffpppfffpppfffffffffppppppfffffffffffffffffffff^^^^^^^^^^^^^^^VVVNNNNNNVVVVVVNNNNNNNNNNNNVVVNNNNNNNNNEEE---""""""------NNN^^^ffffffffffffwwwpppwwwwwwwwwwwwfffppppppppppppwww†††wwwfff^^^^^^VVVVVV^^^^^^^^^^^^^^^^^^^^^^^^VVV^^^^^^ffffffpppwwwwwwwwwwww††††††††††††‘‘‘–––––––––––––––––––––‘‘‘†††‘‘‘†††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘––––––––– ––– ––– ––– ––– ––––––––––––‘‘‘‘‘‘pppVVVGGGGGGNNNNNNpppÎÎÎýýýýýýýýýýýýïïïïïïýýýïïïßßß°°°––– –––°°°†††ÇÇÇçççýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÇÇÇfff------"""------333===EEEEEEVVVfffwwwfff^^^^^^GGG---""""""""""""===NNNNNNGGGNNNGGG===---""""""""""""---EEEEEEEEEEEE========="""""""""""""""""""""""""""""""""""""""---EEEEEEGGGú��ú��^^^^^^fffffffffppppppppppppppppppppppppppppppú��ú��ú��ú��pppfffpppppppppppppppfffpppppppppfffpppfffpppppppppfffpppfffpppffffffffffffpppppppppppppppfffpppfffffffffpppfffppppppfffpppfffpppffffffffffffffffffffffff^^^^^^^^^^^^VVV^^^VVVVVVVVVVVVVVVVVVVVVNNNNNNGGGNNNGGGGGGGGG===333333---===VVVffffff^^^^^^ffffffffffff^^^VVVNNNNNNNNN^^^^^^^^^fffpppppppppfffpppffffffpppfff^^^^^^^^^^^^^^^^^^^^^ffffffffffffpppwwwwwwwww†††††††††‘‘‘–––––––––––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––– ––– ––– ––– ªªª ––––––––––––‘‘‘–––‘‘‘†††fffVVVGGGGGGGGGNNN†††ßßßïïïýýýýýýýýýýýýýýýýýýýýý×××ÁÁÁªªª††††††www–––ßßßýýýýýýýýýýýýýýýýýýýýýýýýýýýçççÇÇÇVVV------"""333GGGGGGNNN^^^^^^wwwppppppVVVNNNEEE333---"""333===---EEENNNNNN===333------"""---333333"""===EEE===---"""""""""""""""""""""""""""""""""""""""""""""""""""""""""===EEEGGGVVVú��ú��ffffffppppppppppppppppppppppppwwwwwwwwwppppppú��ú��ú��ú��fffpppppppppppppppppppppppppppppppppppppppfffppppppfffppppppffffffffffffppppppppppppppppppfffppppppfffffffffpppfffpppfffffffffppppppfffffffffffffffppp^^^^^^^^^^^^^^^fffVVV^^^VVVVVVVVVVVVVVVVVVVVVNNNGGGNNNGGGGGGEEEEEEEEEGGGNNNVVV^^^ffffff^^^fffffffff^^^VVVNNNNNNNNNVVVVVVVVVffffffppppppfffwwwpppppppppfffpppfff^^^^^^^^^fffffffffpppppppppppppppwwwwwwwww†††‘‘‘‘‘‘–––––– –––––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††‘‘‘‘‘‘‘‘‘‘‘‘––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––––– ––– ªªª ªªª ªªªªªª ªªªªªªªªªªªª ––– –––––––––––––––‘‘‘‘‘‘†††wwwNNNGGGGGGNNNVVV–––çççýýýýýýýýýýýýýýýýýýýýýïïïïïïÎÎΖ–– –––‘‘‘çççýýýýýýýýýýýýýýýýýýýýýýýýïïïçççÇÇÇNNN---"""---333VVVNNNVVV^^^ppp^^^^^^NNN===NNNGGGEEEEEEEEEGGGNNN333---333""""""""""""EEEEEEGGGNNNGGG---"""---"""""""""""""""---""""""===333"""""""""""""""""""""333GGGNNN^^^fffú��ú��ppppppppppppppppppppppppwwwwwwwwwppppppppppppú��ú��ú��ú��pppppppppppppppppppppwwwppppppfffppppppppppppfffppppppfffpppfffffffffpppppppppppppppppppppfffpppfffpppfffpppfffpppfffffffffpppffffffffffff^^^^^^ffffff^^^^^^fff^^^fff^^^^^^^^^VVVVVVVVVVVV^^^VVVVVVVVVVVVNNNNNNGGGNNNGGGGGGGGGGGGNNNVVV^^^^^^fff^^^ffffffVVVNNNNNNVVVVVVVVVVVVVVV^^^fff^^^VVVVVV^^^^^^fffffffff^^^fff^^^^^^ffffffppppppwwwwwwwwwpppwwwwwwwww†††††††††‘‘‘–––––– –––––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††††††††††††††‘‘‘‘‘‘–––‘‘‘––––––‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––––––––––– ––– ªªª ªªªªªªªªªªªªªªª ªªªªªªªªªªªªªªª ªªª ––– ––––––––––––‘‘‘‘‘‘†††pppVVVGGGGGGNNN^^^¶¶¶ïïïýýýýýýýýýýýýýýýýýýýýýýýýçççÎÎÎ××תªª‘‘‘‘‘‘çççýýýýýýýýýýýýýýýýýýýýýýýýýýýßßßÁÁÁGGG------"""333GGGGGGEEEEEENNNNNNNNNNNNGGG^^^fffNNNEEENNNGGG===""""""---333---===EEENNNNNNEEE333333""""""""""""""""""""""""333333"""===EEE333""""""""""""""""""333GGG^^^fffppppppwwwpppwwwwwwwwwwwwpppwwwwwwwwwwwwwwwppppppwwwppppppppppppppppppppppppppppppppppppppppppppppppfffppppppffffffpppfffppppppffffffffffffpppppppppwwwppppppppppppfffpppfffppppppfffffffffppppppffffff^^^^^^fff^^^ffffff^^^^^^^^^^^^ffffff^^^^^^^^^^^^^^^^^^VVV^^^^^^^^^VVVVVVVVVVVVNNNNNNGGGEEEEEENNNVVVVVVVVV^^^^^^ffffffppp^^^VVVVVVVVVVVVVVVfffffffffpppfff^^^^^^^^^ffffffpppppppppwwwppppppppppppwwwwww††††††‘‘‘––––––––––––––– ––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘†††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘––– ––––––‘‘‘‘‘‘–––––––––––––––––– ––– ªªª ªªª ªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª ªªª –––‘‘‘‘‘‘††††††pppVVVGGGGGGNNNfffÎÎÎïïïýýýýýýýýýýýýýýýýýýýýýýýýïïïýýýççç×××ÁÁÁÎÎÎýýýýýýýýýýýýýýýýýýýýýýýýïïïßß߶¶¶EEE---""""""---333""""""333VVVNNNVVVfffffffff^^^NNN===---"""""""""333EEEVVVGGGGGGNNN===333"""""""""""""""""""""EEE===GGGEEE"""GGGNNN333"""""""""""""""""""""---===NNNfffppppppwwwwwwpppwwwwwwwwwwwwpppwwwwwwwwwpppwwwpppppppppwwwwwwppppppppppppppppppwwwpppppppppppppppfffpppppppppfffpppppppppfffpppffffffffffffppppppppppppppppppppppppfffppppppfffffffffpppffffffpppffffffppp^^^VVV^^^fff^^^fff^^^^^^^^^^^^^^^fff^^^^^^fff^^^^^^^^^^^^^^^^^^VVV^^^fff^^^^^^VVVVVVNNNNNN===GGGNNNNNNVVVVVV^^^^^^ffffffffffffVVVVVVNNNVVVVVV^^^pppfffpppppppppppppppfffpppppppppwwwwwwwwwppppppwwwwww†††††††††‘‘‘‘‘‘––––––––––––––––––––––––––– ––––––‘‘‘‘‘‘†††††††††††††††‘‘‘‘‘‘–––––––––––– ––– –––––– ––– ––– ––– ––– ––– ªªª ªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°ªªªªªª°°°°°°ªªªªªªªªª –––‘‘‘‘‘‘‘‘‘††††††wwwVVVGGGNNNNNNwww×××ýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýççççççßßßýýýýýýýýýýýýýýýýýýýýýýýýïïïßßß°°°==="""""""""""""""""""""---VVV^^^^^^fff^^^VVVEEE333""""""---333===GGGGGGGGGGGG333---"""""""""""""""""""""""""""---NNNGGGVVVEEE---GGGGGG---""""""""""""333===GGG^^^ffffffpppppppppwwwwwwwwwwwwwwwwwwwwwwwwwwwpppwwwppppppwwwwwwwwwpppppppppppppppppppppwwwpppppppppppppppfffppppppppppppppppppfffpppfff^^^ffffffppppppppppppppppppfffpppppppppffffffpppffffffpppfffpppfffpppffffffVVV^^^fffffffff^^^^^^fff^^^fffffffff^^^fff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^VVVVVVVVVVVVVVVNNNVVVVVVVVVVVV^^^^^^fffpppfff††††††wwwwwwppp^^^fff^^^ffffffwwwwwwwwwwwwpppppppppwwwwwwwwwwww†††††††††††††††††††††‘‘‘‘‘‘––––––‘‘‘–––––––––––––––––– ––––––‘‘‘‘‘‘‘‘‘†††††††††††††††‘‘‘–––––– ––––––––––––––– ––– ––– –––––– ªªª ªªªªªªªªª°°°ªªª ªªªªªªªªªªªª°°°°°°°°°ªªª°°°ªªªªªªªªªªªªªªªªªªªªª ªªª –––‘‘‘‘‘‘‘‘‘†††www^^^GGGGGGVVV‘‘‘ßßßýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï××× ==="""---"""""""""""""""---EEEGGGNNNGGGGGG===333---======EEENNNGGG===------""""""""""""""""""""""""""""""333""""""---"""EEENNNEEEEEE---"""===---"""""""""---===EEENNNVVVffffffppppppppppppwwwpppwwwwwwpppwwwpppwwwppppppwwwpppwwwwwwwwwwwwpppppppppppppppppppppwwwpppwwwpppppppppppppppfffpppppppppfffppppppffffffffffffpppppppppppppppppppppppppppfffpppffffffppppppffffffpppfffpppffffffVVV^^^^^^fffppp^^^^^^ffffff^^^^^^ffffff^^^fff^^^ffffff^^^^^^^^^^^^^^^^^^fff^^^^^^^^^VVVfff^^^VVVVVVVVVVVV^^^^^^ffffffpppfffwwwppppppfffpppppppppwwwwwwwwwwwwwwwwwwwww††††††††††††‘‘‘†††††††††‘‘‘––––––––––––‘‘‘–––––––––––– ––– ––––––†††‘‘‘††††††††††††‘‘‘–––––– ––– ––––––––– ––– ªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°ªªª°°°°°°ªªªªªª°°°ªªªªªª°°°°°°ªªªªªª ªªª –––––––––‘‘‘‘‘‘www^^^GGGNNNVVV çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï×××–––333------""""""""""""""""""---"""333333333EEEEEEEEEGGGVVVGGGEEE---"""""""""""""""""""""""""""""""""---333GGG333"""333"""---333"""""""""""""""""""""---===GGGNNN^^^ffffffpppfffpppfffppppppppppppppppppppppppwwwpppwwwpppppppppppppppwwwppppppppppppppppppwwwwwwpppwwwwwwpppwwwpppfffppppppppppppfffpppfffpppfffffffffwwwppppppppppppppppppppppppfffpppppppppppppppppppppfffpppfffpppfff^^^VVVfffffffff^^^^^^^^^^^^^^^^^^fff^^^ffffff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^^^^^^^VVV^^^VVVVVV^^^fffpppfffffffffpppwwwwwwwwwwwwwwwpppwwwppppppwww††††††††††††††††††††††††‘‘‘†††‘‘‘––––––––––––––––––––––––––– ––––––‘‘‘‘‘‘††††††††††††††††††––– ––– –––––– ––– ªªªªªªªªª ªªª ªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°ªªª°°°°°°°°°°°°°°°ªªª°°°ªªª°°°ªªªªªª°°°ªªª°°°°°°ªªªªªªªªªªªªªªª ––– ‘‘‘†††www^^^NNNNNN^^^°°°çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïï××ב‘‘---------""""""""""""""""""""""""------===EEENNNGGGEEE333---"""""""""""""""""""""""""""""""""333333EEENNNNNN"""------""""""""""""""""""333EEEGGGVVV^^^^^^fffpppffffffpppfffpppppppppppppppppppppwwwpppwwwppppppppppppwwwpppwwwppppppppppppfffpppwwwwwwpppwwwwwwwwwppppppppppppfffpppppppppfffpppppppppffffffpppwwwppppppppppppppppppppppppfffppppppfffpppppppppfffpppfffpppfff^^^VVV^^^fffffffff^^^^^^ffffff^^^ffffffffffffffffff^^^fff^^^^^^^^^^^^^^^^^^^^^^^^^^^fff^^^ffffff^^^^^^^^^VVVVVV^^^fffffffffffffffwwwwwwppppppwwwwwwwwwwww†††††††††††††††††††††††††††††††††††††††‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘––––––‘‘‘––––––––––––––––––‘‘‘††††††‘‘‘††††††‘‘‘‘‘‘ ––– ––– ––– ––– ªªª ªªª ªªªªªª°°°°°°°°°°°°°°°ªªª°°°°°°°°°°°°°°°°°°°°°ªªªªªª°°°°°°ªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶°°°°°°°°°ªªªªªª ––––––‘‘‘†††fffNNNNNNfffÁÁÁïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýççç×××333---""""""---"""333EEE======------"""===EEE===333"""""""""""""""""""""""""""333"""""""""EEENNNVVVGGGEEEEEE"""""""""""""""""""""---===EEENNNVVV^^^^^^ffffffpppffffffpppppppppppppppppppppppppppppppppwwwppppppppppppppppppwwwppppppppppppfffpppwwwppppppwwwppppppppppppppppppppppppppppppppppppppppppffffffppppppwwwppppppppppppppppppfffppppppppppppppppppffffffpppfffpppfff^^^NNN^^^ffffffffffff^^^fff^^^fffffffffffffff^^^fff^^^ffffff^^^^^^^^^^^^^^^^^^^^^fff^^^fffffffff^^^^^^^^^^^^^^^^^^ffffffppppppffffffwwwpppwww†††††††††www††††††‘‘‘††††††††††††‘‘‘‘‘‘‘‘‘††††††††††††††††††††††††††††††‘‘‘‘‘‘‘‘‘––––––‘‘‘––––––––––––‘‘‘‘‘‘‘‘‘††††††††††††††††††––– ––– ––– ––– ––– ––– ªªªªªª ªªª ªªª ªªªªªª°°°ªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°¶¶¶°°°ªªªªªª ––––––‘‘‘fffNNNGGGpppÎÎÎýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýççç×××333------=========NNNVVVVVVEEE""""""---------"""""""""""""""""""""---"""===NNNEEE==="""NNNNNNGGGEEE---"""""""""""""""---===GGGNNNVVV^^^^^^^^^ffffffpppfffffffffpppppppppffffffpppfffppppppppppppppppppppppppppppppwwwpppppppppwwwppppppwwwpppwwwppppppppppppfffppppppppppppppppppfffppppppfffffffffppppppwwwppppppppppppppppppppppppfffpppppppppfffppppppfffpppfffffffffNNNVVV^^^fffffffff^^^^^^fff^^^^^^fffffffffffffff^^^ffffff^^^^^^fff^^^^^^^^^fff^^^^^^fffffffff^^^^^^^^^^^^^^^^^^ffffffpppffffffffffff†††††††††††††††††††††††††††††††††‘‘‘†††††††††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††www†††‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––––––––‘‘‘†††††††††††††††††††††‘‘‘––– ––– ––– ––– ªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°ªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°¶¶¶°°°°°°ªªª°°°°°°ªªª°°°°°°°°°¶¶¶°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶°°°¶¶¶°°°°°°ªªª –––†††wwwfffVVVNNN×××ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýççç×××ppp333333NNNVVVVVV^^^fff^^^GGG---""""""""""""""""""""""""""""""""""""333EEEGGGVVVVVV==="""EEE---""""""""""""""""""333===GGGVVVVVV^^^^^^^^^^^^fffffffffffffffpppfffpppfffppppppppppppppppppppppppppppppfffppppppppppppppppppppppppppppppppppppwwwpppppppppfffppppppppppppppppppfffppppppfffpppffffffpppwwwpppwwwpppppppppppppppwwwpppppppppppppppppppppffffffpppfffffffffVVVNNN^^^fffffffff^^^^^^fff^^^ffffffffffffffffffffffff^^^^^^fff^^^^^^^^^fff^^^fffffffff^^^ffffff^^^^^^^^^^^^^^^ffffffffffffpppfffffffff‘‘‘––––––††††††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––‘‘‘††††††††††††††††††‘‘‘––– ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª¶¶¶°°°°°°ªªª°°°°°°°°°°°°°°°°°°°°°ªªª°°°°°°°°°ªªª°°°ªªª°°°°°°°°°¶¶¶°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°°°° ––––––‘‘‘†††pppVVVNNN†††ßßßýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýßßß×××ppp333NNNpppfffNNNVVV^^^VVVNNNEEE"""---"""333=========EEE======EEENNNNNNVVVGGGGGG---""""""""""""""""""---333EEEGGGVVV^^^^^^^^^^^^^^^fffffffffffffffffffffpppfffpppfffpppfffpppfffppppppfffpppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppffffffppppppppppppwwwppppppppppppppppppfffppppppppppppppppppppppppfffffffff^^^NNN^^^fffffffff^^^^^^fff^^^fff^^^ffffffffffffffffff^^^ffffff^^^ffffff^^^ffffffffffffffffffffffff^^^VVV^^^^^^fffffffffffffffffffffffffff––––––‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††††††††‘‘‘‘‘‘––––––‘‘‘‘‘‘––––––‘‘‘‘‘‘‘‘‘†††††††††††††††–––––– ªªª ªªªªªª ªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°ªªªªªª°°°°°°°°°ªªª°°°ªªª°°°°°°°°°°°°°°°°°°ªªª°°°°°°¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁ¶¶¶¶¶¶°°°ªªªªªª ‘‘‘†††wwwVVVVVV‘‘‘ßßßýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïççç×××fff===VVVfff^^^GGGVVVNNNGGGEEE333"""333===333===GGGNNNGGGVVVVVVVVVGGG^^^VVVVVVEEE333---""""""""""""333===EEEGGGVVV^^^^^^fff^^^fff^^^^^^fffffffffffffffffffffffffffffffffpppfffppppppfffpppppppppfffppppppppppppppppppfffpppfffpppwwwppppppwwwpppwwwppppppppppppppppppppppppppppppppppppffffffppppppwwwpppppppppppppppppppppppppppppppppppppppppppppfffpppffffffppp^^^VVVVVVfffffffff^^^^^^^^^fff^^^fffffffffffffffffffffffffff^^^fff^^^^^^fff^^^ffffff^^^ffffffffffff^^^^^^^^^^^^fff^^^ffffffpppfffffffffffffff––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘ ––– ‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘–––‘‘‘††††††‘‘‘††††††††††††‘‘‘––– ªªªªªªªªª ªªª ªªªªªªªªª°°°ªªªªªªªªªªªªªªªªªª°°°ªªª°°°¶¶¶°°°°°°°°°¶¶¶¶¶¶°°°¶¶¶°°°°°°°°°ªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°ªªª°°°ªªª°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶ªªªªªª–––‘‘‘wwwVVVVVV–––çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïççç×××^^^GGGVVVVVVVVVGGGNNNGGGEEE---"""333GGGNNN======GGGGGGVVVfffGGG^^^GGGGGG===---"""""""""""""""---===EEEGGGNNNVVV^^^^^^^^^ffffff^^^^^^^^^fffffffff^^^fffffffffffffffffffffffffffffffffpppppppppfffpppfffpppppppppppppppppppppfffpppwwwppppppwwwpppwwwpppppppppppppppwwwppppppppppppppppppffffffpppppppppppppppppppppppppppppppppfffppppppppppppppppppfffppppppfffpppfffNNNVVVffffffpppfffffffffffffffffffffffffffffffffpppfff^^^^^^fff^^^ffffff^^^fffffffffffffff^^^fff^^^fff^^^VVV^^^^^^^^^fffpppffffffffffffffffff–––––––––‘‘‘‘‘‘‘‘‘––––––‘‘‘––––––––––––––––––––––––––––––‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––––––††††††‘‘‘†††††††††–––––– ªªªªªª ªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°ªªª°°°ªªªªªª°°°¶¶¶¶¶¶°°°°°°°°°¶¶¶¶¶¶¶¶¶°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶°°°°°°°°°°°°°°°ªªª°°°°°°¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶¶¶¶ÁÁÁ¶¶¶°°°¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ¶¶¶¶¶¶°°° †††www^^^^^^ çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïßßß×××VVVEEEEEEGGGVVVGGGGGGEEE===333---===GGGGGG333---======VVVGGG---===333"""""""""""""""""""""333===GGGGGGNNNVVVVVV^^^ffffffffffff^^^ffffff^^^ffffff^^^^^^fffffffffffffffffffff^^^fffffffffpppffffffffffffppppppppppppppppppppppppppppppppppppppppppwwwpppppppppppppppwwwpppppppppfffpppfffpppfffppppppppppppwwwpppppppppppppppppppppppppppppppppppppppfffppppppfffpppfffVVVVVVffffffpppfffffffffffffffffffffpppfffffffffffffff^^^fff^^^^^^^^^^^^ffffffffffffffffffffffff^^^^^^^^^^^^^^^^^^ffffffffffffpppfffffffffffffff–––––––––‘‘‘‘‘‘‘‘‘ ––––––––––––––––––––––––––––––†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––––––†††††††††††††††††††††‘‘‘–––––– ––– ––– ªªªªªªªªªªªª ªªª ªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°¶¶¶°°°°°°°°°¶¶¶°°°¶¶¶°°°¶¶¶°°°¶¶¶°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶°°°¶¶¶°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶°°°°°°¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁ¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÇÇÇÁÁÁÇÇÇÁÁÁÁÁÁ¶¶¶°°° ‘‘‘^^^^^^°°°ïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýïïïßßßÎÎÎGGG333===GGGVVVGGG333333333333===EEEEEE===333"""---333===333""""""""""""""""""""""""---===EEEGGGNNNVVVVVV^^^^^^^^^ffffffffffff^^^fffffffffffffffffffff^^^ffffffffffffffffff^^^fffffffffpppfffffffffpppppppppppppppppppppppppppppppppwwwpppppppppppppppfffwwwppppppwwwpppppppppppppppfffppppppfffpppppppppwwwwwwpppwwwppppppppppppppppppppppppppppppfffppppppppppppppp^^^NNNfffffffffffffff^^^ffffffffffffpppfffffffffffffffffffff^^^^^^^^^fffffffffpppfffffffffffffff^^^fff^^^^^^^^^^^^^^^fffffffffpppffffffpppffffffppp––––––––––––‘‘‘––– ––– ––––––––––––‘‘‘––––––‘‘‘††††††‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘––––––†††wwwwww††††††††††††–––––– ––– ––– ªªªªªªªªª ªªª ªªªªªªªªªªªªªªªªªªªªª°°°°°°ªªª°°°¶¶¶°°°°°°°°°°°°°°°¶¶¶°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÁÁÁ¶¶¶ÁÁÁ°°°ªªª–––^^^fff¶¶¶çççýýýýýýýýýýýýýýýýýýýýýýýýýýýýýýçççßß߶¶¶EEE===EEENNNNNN---"""------------"""333===333"""""""""""""""""""""""""""""""""333EEEGGGNNNVVVVVV^^^^^^^^^ffffffffffffffffff^^^fffffffffpppffffff^^^ffffffffffffffffff^^^^^^^^^fffffffffffffffffffffppppppfffppppppfffppppppppppppppppppppppppppppppppppppwwwpppwwwpppppppppfffpppfffppppppppppppppppppppppppppppppppppppppppppppppppppppppfffppppppppppppppppppfff^^^VVV^^^ffffffpppffffffffffffpppfffffffffffffffpppfffffffff^^^fff^^^fffffffffpppfffffffffffffff^^^^^^^^^^^^^^^^^^^^^fff^^^fffffffffffffffffffffffffff––– ––––––––––––––– ––– ––––––––––––†††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––wwwwww†††††††††‘‘‘–––––– ––– –––––– ªªªªªªªªª ªªª ªªªªªª ªªªªªª°°°ªªª°°°°°°°°°ªªª°°°°°°¶¶¶¶¶¶°°°°°°°°°°°°¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°¶¶¶°°°¶¶¶°°°¶¶¶¶¶¶°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°°°°¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÁÁÁÇÇÇÇÇÇÁÁÁÁÁÁ°°°ªªª–––^^^fffÇÇÇïïïýýýýýýýýýýýýýýýýýýýýýýýýýýýççç×××–––333EEEGGGNNN333"""""""""---""""""""""""---""""""""""""""""""""""""""""""---===EEENNNVVVVVV^^^^^^^^^^^^^^^fffffffffffffff^^^ffffffffffffpppffffff^^^ffffff^^^fffffffff^^^fffffffffffffffffffffffffffppppppppppppfffpppppppppppppppwwwpppppppppwwwwwwpppwwwpppwwwwwwpppppppppppppppfffpppfffppppppwwwppppppfffppppppppppppppppppfffpppwwwpppppppppfffppppppppppppffffffVVVVVVfffppppppfffffffffffffffffffffppp^^^^^^ffffffffffff^^^fffffffffffffffpppffffffpppffffff^^^fff^^^^^^fff^^^^^^fff^^^ffffffpppfffffffffffffffffffffªªª –––––– –––––– –––‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘––––––pppppp†††††††††‘‘‘‘‘‘–––––– ––– ªªª ªªª ªªª ªªª ªªªªªªªªªªªªªªªªªªªªªªªª°°°¶¶¶°°°°°°°°°°°°°°°¶¶¶¶¶¶°°°¶¶¶°°°¶¶¶°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°°°°¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÇÇÇÇÇÇÁÁÁÁÁÁÁÁÁ¶¶¶ªªª–––†††fffpppÇÇÇïïïýýýýýýýýýýýýýýýýýýýýýýýýççç×××ppp------333333"""""""""""""""""""""""""""""""""""""""""""""""""""---333EEEGGGNNNVVV^^^^^^^^^^^^^^^^^^^^^fff^^^ppppppffffff^^^fff^^^fffffffff^^^fffffffffffffff^^^ffffff^^^fffffffffffffffpppffffffpppppppppfffppppppfffpppppppppppppppwwwwwwppppppppppppwwwpppwwwwwwpppppppppffffffpppfffppppppwwwpppppppppppppppwwwpppwwwpppppppppwwwppppppppppppppppppwwwpppffffffVVVVVVfffpppfffpppfffpppfffpppffffffpppfff^^^ffffffffffff^^^fffffffffpppfffpppfffpppfffffffffffffff^^^^^^^^^^^^^^^^^^ffffffffffffffffffffffffpppfffffffff ––– ––– –––‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––fffpppwww†††††††††‘‘‘––– ––– ––– ªªª ªªª ªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°¶¶¶°°°ªªª°°°°°°°°°¶¶¶¶¶¶¶¶¶°°°°°°¶¶¶°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶°°°°°°°°°¶¶¶°°°¶¶¶¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁ¶¶¶°°°°°°°°°¶¶¶¶¶¶ÁÁÁÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÎÎÎÇÇÇÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÁÁÁÁÁÁÁÁÁ°°° †††pppwwwÇÇÇïïïýýýýýýýýýýýýýýýýýýýýýççç×××^^^---"""---""""""""""""""""""""""""""""""""""""""""""""""""333===EEEGGGVVV^^^^^^^^^^^^^^^fffffffff^^^fffpppfffpppfff^^^^^^fffffffffffffff^^^ffffff^^^fff^^^^^^fffffffffffffffpppfffpppfffpppfffpppfffpppfffpppffffffpppfffpppppppppppppppppppppppppppwwwwwwwwwwwwwwwppppppfffppppppfffppppppwwwwwwwwwppppppwwwwwwpppwwwpppwwwpppwwwpppwwwpppppppppppppppppppppfff^^^NNN^^^fffppppppffffffpppfffffffffffffff^^^^^^fffpppfffffffffffffffpppfffpppffffffpppfffpppfff^^^^^^^^^^^^^^^^^^ffffff^^^^^^fffpppppppppffffffffffffffffff ––––––†††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘ffffffwww†††††††††‘‘‘‘‘‘–––––––––––– ªªª ªªª ªªªªªªªªªªªª ªªª ªªªªªªªªª°°°ªªªªªªªªªªªª°°°°°°°°°¶¶¶°°°¶¶¶°°°°°°°°°¶¶¶°°°°°°°°°°°°°°°°°°°°°¶¶¶°°°°°°¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ¶¶¶ÁÁÁÇÇÇÇÇÇÁÁÁ¶¶¶¶¶¶ÁÁÁÇÇÇÏ££àbbí11õø÷óæ))¾DD}eewwwÎÎÎïïïýýýýýýýýýýýýýýýýýýçççÎÎÎNNN---""""""""""""""""""""""""""""""""""""""""""""""""---333EEEGGGNNNVVV^^^fff^^^ffffff^^^fff^^^fffffffffpppfffpppfff^^^fffffffffffffffffffffffffff^^^^^^fff^^^fff^^^ffffffffffffffffffpppffffffpppfffpppfffffffffppppppppppppppppppppppppppppppfffpppppppppwwwwwwwwwwwwppppppfffppppppfffpppwwwpppwwwppppppwwwwwwwwwwwwppppppwwwwwwpppwwwpppppppppppppppppppppfff^^^VVV^^^fffpppfffpppfffpppffffff^^^fffppp^^^^^^ffffffffffffffffffppppppfffppppppffffffpppfffffffffffffff^^^^^^^^^^^^^^^fffffffffpppffffffpppfffffffffffffff^^^ –––‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘ppp^^^www†††††††††‘‘‘‘‘‘‘‘‘–––––– ªªª ªªª ªªª ªªªªªª°°°ªªª ªªªªªªªªª°°°°°°°°°°°°°°°¶¶¶°°°°°°°°°°°°°°°°°°°°°ªªª°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁ¶¶¶¶¶¶ÁÁÁÁÁÁÇÇÇÁÁÁÁÁÁ¶¶¶ÇÇÇÇÇÇÇÇÇÇÇÇú��ú��ú��ú��ú��ú��ú��ú��ú��ñ “]]wwwÎÎÎïïïýýýýýýýýýýýýïïïçççÇÇÇEEE"""""""""""""""""""""""""""""""""""""""---333EEEGGGVVVVVV^^^^^^^^^ffffffffffffffffffffffffffffffpppfffpppfff^^^ffffffffffffffffffffffff^^^ffffff^^^fff^^^fff^^^fff^^^fffffffffpppffffffpppfffpppfffffffffffffffpppppppppppppppfffppppppfffpppppppppwwwpppwwwppppppfffppppppffffffpppwwwpppwwwpppppppppwwwppppppwwwpppwwwpppwwwppppppwwwppppppwwwpppfffppp^^^VVV^^^fffpppffffffpppffffffffffffffffff^^^VVVfffffffffffffffppppppfffpppfffpppfffpppffffffffffffffffff^^^fff^^^^^^fff^^^ffffffpppfffppppppfffpppfffpppfffffffff –––‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††ppp^^^ppp†††www†††‘‘‘‘‘‘–––––––––––––––––– ––– ªªª –––––– ªªª ––– ªªªªªªªªªªªªªªªªªª°°°°°°°°°ªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°ªªª°°°ªªªªªª°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶°°°°°°¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁ¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁ¶¶¶¶¶¶ÁÁÁÇÇÇÇÇÇÇÇÇÎÎÎÎÎÎð++àxxÕªªÏÇÇØÏÏ×¢¢í00ú��ú��ú��åwwwÎÎÎïïïýýýýýýýýýïïïççç°°°===---"""""""""""""""""""""""""""""""""---===EEENNNVVV^^^^^^^^^^^^ffffffffffffffffffffffff^^^ffffffpppfffffffff^^^fff^^^ffffffffffff^^^ffffffffffff^^^fff^^^^^^^^^fffffffffffffffffffffffffffpppffffffffffffffffffpppppppppppppppppppppppppppfffppppppppppppppppppppppppppppppffffffpppppppppwwwpppppppppwwwppppppwwwpppwwwwwwwwwppppppwwwppppppwwwpppppppppfffVVVVVVfffpppfffppppppfffffffffffffffffffffVVVfffffffffffffffpppppppppffffffffffffffffffpppfffpppfff^^^^^^^^^^^^^^^^^^ffffffffffffpppffffffppppppffffffffffff^^^fff –––‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘†††ppp^^^ppp†††††††††‘‘‘––––––––––––‘‘‘‘‘‘–––––– ªªª ––– ªªªªªªªªªªªªªªªªªª°°°°°°°°°ªªª°°°ªªª°°°ªªªªªª°°°°°°°°°°°°ªªªªªª°°°ªªªªªªªªª°°°°°°°°°¶¶¶¶¶¶¶¶¶°°°¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶°°°°°°°°°¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ¶¶¶ÁÁÁÁÁÁÇÇÇÇÇÇÇÇÇÎÎÎÎÎÎÎÎÎ×××ÎÎÎ××××××ÎÎÎÎÎÎÒ··ú��ú��ú��÷ªªªÎÎÎïïïýýýýýýïïï×××ú��ú��"""""""""""""""""""""""""""---333===GGGVVV^^^^^^ffffffffffff^^^ffffffppppppffffff^^^ffffffffffffpppffffff^^^^^^^^^ffffffffffff^^^ffffffffffffffffffffffff^^^fffffffffffffffffffffffffffpppffffffppppppfffppppppppppppppppppppppppppppppppppppppppppppppppfffppppppppppppffffffpppwwwpppppppppppppppwwwppppppppppppppppppwwwpppwwwpppppppppwwwpppppppppfff^^^NNN^^^fffpppfffffffffffffffffffffffffff^^^^^^fffffffffpppppppppffffffpppffffffpppffffff^^^ffffffffffff^^^^^^^^^^^^ffffffffffffpppfffpppfffpppffffffffffffffffff^^^ –––‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††www^^^fffwwwwwwwww†††‘‘‘‘‘‘––––––––––––‘‘‘†††––––––––– ––– ––––––––– ––– ªªª ªªª ªªªªªªªªªªªªªªªªªª°°°°°°°°°ªªªªªªªªªªªªªªªªªªªªª°°°ªªª°°°ªªªªªªªªªªªªªªª°°°°°°°°°¶¶¶°°°°°°°°°¶¶¶°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°°°°°°°¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁ¶¶¶ÁÁÁÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁ°°°¶¶¶ÁÁÁÇÇÇÇÇÇÎÎÎÎÎÎ×××ÎÎÎ×××ÎÎÎ×××××××××ÎÎÎÎÎÎÚÂÂú��ú��ú��ð%%¶¶¶ªªªwwwÇÇÇïïïýýýïïï×××ú��ú��"""""""""""""""""""""---===EEENNNVVV^^^ffffffffffffffffffffffffppppppfffffffffffffffffffffppppppfff^^^fff^^^fffffffff^^^fffffffff^^^fffffffffffffffffffff^^^^^^fffffffffffffffffffffffffffppppppfffpppppppppfffppppppfffpppfffpppfffpppfffpppppppppppppppppppppppppppffffffppppppwwwpppppppppppppppppppppppppppppppppwwwwwwppppppppppppppppppppppppfff^^^VVV^^^fffpppfffpppfffffffffffffffpppffffff^^^ffffffffffffppppppppppppfffffffffffffff^^^VVV^^^fffffffff^^^fff^^^^^^fff^^^fffpppfffpppffffffpppfffpppfffffffffffffff^^^‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘www^^^fffwww†††wwwwww†††‘‘‘‘‘‘‘‘‘–––‘‘‘–––‘‘‘‘‘‘––––––––– –––––––––––– ªªª ––– ªªª ªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°¶¶¶°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°ÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÎÎÎÎÎÎÎÎÎ×××××××××××××××××××ÔÔÛ··ïBBú��ú��÷ Ù™™ÇÇǶ¶¶ ÁÁÁïïïïïïÎÎÎú��ú��"""""""""""""""---333EEEGGGVVVVVV^^^fffffffffpppfffffffffffffffpppfffpppfffffffffffffffpppfffpppfffffffff^^^fffffffffffffff^^^fff^^^ffffff^^^fffffffff^^^^^^fffffffffpppfffffffff^^^fffffffffpppppppppfffppppppfffpppppppppfffpppfffppppppppppppwwwppppppppppppppppppffffffppppppwwwpppwwwpppppppppwwwpppppppppppppppwwwpppppppppppppppwwwppppppfffffffffVVVVVV^^^pppppppppfffpppffffffffffffffffff^^^fffffffffpppfffpppffffffffffffpppfffffffffNNNGGGffffffffffff^^^^^^fff^^^ffffffpppfffpppppppppfffpppfffpppfffffffffpppfff^^^†††††††††‘‘‘†††‘‘‘‘‘‘‘‘‘www^^^^^^www†††wwwwww††††††‘‘‘‘‘‘‘‘‘–––––––––––––––––– –––––– ––––––––– ––– ––– ªªªªªª ªªªªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶¶¶¶°°°ÁÁÁÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÎÎÎÎÎÎÎÎÎÎÎÎ×××××××××××××××ú��ú��ú��ú��ùëYYÚ¼¼×××ÎÎÎÇÇÇÁÁÁªªª†††ÁÁÁßßßÁÁÁú��ú��"""---333===GGGNNNVVV^^^^^^ffffff^^^fffffffffpppfffpppfffpppfffffffffffffffpppffffffpppfffpppfffffffffffffffffffff^^^fff^^^fff^^^^^^fff^^^fff^^^fffffffffffffffffffff^^^^^^fffffffffffffffffffffpppfffpppfffpppfffpppppppppfffpppppppppppppppppppppfffpppppppppfffffffffpppppppppwwwpppppppppppppppwwwpppppppppppppppwwwpppwwwppppppppppppfffpppfffVVVVVVfffpppfffpppffffffffffffffffffpppfff^^^^^^pppfffpppfffpppfffpppfffpppfffpppffffffVVVNNNVVVfffpppffffff^^^fff^^^fffffffffffffffpppfffpppfffpppfffpppffffff^^^fffffffff†††‘‘‘†††‘‘‘‘‘‘†††fff^^^ppp†††wwwwww††††††‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––––––––––– ––– –––––– –––––– ––– ªªªªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°ªªªªªªªªªªªªªªª°°°°°°°°°ªªª°°°°°°°°°¶¶¶°°°°°°°°°°°°°°°°°°¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁ¶¶¶°°°¶¶¶ÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÇÇÇÇÇÇÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎ×××ÎÎÎ×××ú��ú��ú��ú��ú��øèhh×ÖÖ××××××ÎÎÎÇÇÇ°°°†††ppp°°°†††ú��ú��333333EEENNNVVV^^^^^^fffpppfffffffffffffffffffffppppppfffpppffffffpppffffffffffffpppfffpppffffff^^^^^^ffffffffffffffffff^^^fff^^^fff^^^fff^^^^^^ffffffffffffffffff^^^^^^fff^^^ffffffpppfffpppfffpppfffppppppfffppppppfffpppfffppppppfffpppfffpppfffppppppfffpppfffffffffpppwwwpppwwwppppppwwwppppppwwwpppwwwfffppppppppppppppppppppppppfffpppffffffVVVVVV^^^pppfffppppppffffffffffffppppppfff^^^^^^fffffffffppppppfffpppfffpppfffpppffffff^^^VVVVVVfffffffffppp^^^^^^fff^^^ffffffffffffpppffffffpppfffpppfffpppfff^^^fffffffff^^^‘‘‘‘‘‘‘‘‘††††††ppp^^^ppp†††www††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––––– ––– ––––––––––––––– ––– ªªªªªªªªª ªªªªªª ªªªªªª ªªªªªªªªªªªª°°°ªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°°°°°°°¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°°°°¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶¶¶¶°°°¶¶¶ÁÁÁ¶¶¶ÁÁÁÇÇÇÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÎÎÎÎÎÎÎÎÎÎÎÎÎÎÎ××××××××××ÑÑÞ©©ó((ú��ú��ú��æxxßßß××××××ÎÎÎú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ffffffppppppffffffffffffffffffffffffpppfffffffffffffffpppfffpppfffpppfffffffff^^^ffffff^^^ffffff^^^fff^^^^^^fff^^^fff^^^^^^^^^fffffffffffffffffffffffffff^^^fffpppfffpppffffffpppppppppfffpppppppppfffpppfffppppppppppppppppppppppppfffpppppppppffffffppppppppppppwwwpppppppppppppppppppppfffppppppppppppppppppppppppppppppffffffVVVNNN^^^pppppppppfffpppfffpppffffffpppfff^^^^^^fffffffffpppffffffffffffppppppffffffpppfffNNNVVV^^^fffpppfffffffffffffff^^^^^^fffffffffpppfffffffffpppffffffffffffffffffffffff^^^‘‘‘‘‘‘†††www^^^fffwwwwwwwwwwww†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––––––––– ––– ‘‘‘––––––––– ªªª ––– ªªªªªª ªªªªªªªªªªªªªªª ªªª ªªªªªª°°°°°°ªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°¶¶¶°°°°°°°°°¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶°°°°°°°°°ÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÇÇÇÎÎÎÇÇÇÎÎÎÎÎÎ××××××××××××××××××ݬ¬ú��ú��ú��ö!!××××××ÎÎÎÇÇÇú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��ú��fffpppfffpppfffpppffffffffffffpppfffpppfffffffffpppfffffffffpppfffpppffffffffffff^^^ffffff^^^fff^^^^^^^^^fffffffff^^^^^^^^^^^^ffffffffffffffffff^^^fffffffffpppfffpppfffpppffffffpppfffpppfffpppppppppfffppppppppppppppppppffffffpppfffppppppffffffppppppwwwwwwpppppppppwwwppppppppppppppppppppppppppppppppppppppppppfffffffffVVVVVV^^^fffpppfffpppffffffpppffffffpppfff^^^^^^fffffffffpppfffpppfffpppfffpppffffffpppfffVVVNNN^^^pppfffpppfffffffff^^^^^^ffffff^^^ffffffffffffffffffffffffffffffffffffffffff^^^^^^†††www^^^fffwwwwwwwwwwwwwwwwww††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘––––––––––––––––––––– ––– ªªª ªªªªªªªªªªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶°°°¶¶¶°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ°°°°°°°°°¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÁÁÁÇÇÇÇÇÇÇÇÇÎÎÎÎÎÎÎÎÎÇÇÇÎÎÎ××××××ØÏÏú��ú��ú��ø×××ÇÇÇÇÇÇÁÁÁÁÁÁ¶¶¶¶¶¶ªªª‘‘‘ú��ú��††††††wwwwwwwwwpppppppppfffpppfffpppppppppfffppppppppppppppppppfffffffffffffffffffff^^^fff^^^^^^fffffffff^^^fff^^^^^^^^^^^^ffffffffffff^^^^^^ffffffpppfffffffffffffffpppffffffppppppffffffpppfffpppfffpppppppppppppppfffpppppppppppppppfffffffffpppppppppwwwppppppppppppppppppppppppppppppppppppfffppppppppppppppppppfffpppVVVVVVVVVfffpppfffpppfffpppfffffffffffffff^^^^^^fff^^^ppppppfffffffffppppppppppppfffpppppp^^^GGGVVVfffppppppfffpppfffffffffffffffffffff^^^ffffffffffffffffffffffffffffff^^^fff^^^fff^^^^^^^^^pppwwwwwwwwwwwwwwwwww†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––––––––––– ––– –––––– ––– ªªª ªªª ªªªªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°ªªª°°°°°°ªªª°°°°°°°°°°°°°°°¶¶¶¶¶¶°°°¶¶¶°°°¶¶¶°°°¶¶¶¶¶¶°°°°°°ªªª°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°°°°¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÇÎÎÎÎÎÎÎÎÎÎÎÎÞ¥¥ú��ú��ú��ôÇÇÇÁÁÁÁÁÁÁÁÁÁÁÁ¶¶¶°°°ªªª–––ú��ú��†††††††††††††††††††††††††††wwwwwwpppwwwwwwwwwwwwppppppppppppppppppfffpppfffpppfffpppfffpppfff^^^fff^^^fffffffffffffffffffffffffffffffffpppfffffffffffffffpppfffpppffffffffffffpppfffpppfffpppppppppfffppppppppppppppppppppppppfffpppfffpppfffffffffpppppppppppppppfffpppppppppfffwwwppppppfffwwwppppppppppppppppppppppppfffpppVVVVVV^^^fffpppppppppfffpppfffffffffpppppp^^^^^^ffffffffffffpppffffffffffffpppwwwppppppppppppNNNGGGfffpppffffffpppfffffffffffffffffffffffffffpppfffffffffffffffffffffffffffffffff^^^^^^^^^wwwwwwwwwwwwwwwwwwwwwwww††††††‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––– ‘‘‘‘‘‘‘‘‘––––––––– ––– ––––––––––––––– ––– ªªª ªªª ªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª ªªªªªª°°°°°°°°°°°°°°°ªªªªªª°°°°°°°°°¶¶¶¶¶¶°°°¶¶¶°°°°°°¶¶¶°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶°°°°°°°°°°°°¶¶¶°°°¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁ¶¶¶¶¶¶ÁÁÁÇÇÇÁÁÁÇÇÇÁÁÁÁÁÁî++ÛvvΨ¨ÈÁÁÐÂÂÚ““ôú��ú��ú��Ý__ÁÁÁÁÁÁÁÁÁÁÁÁ¶¶¶¶¶¶°°°ªªª–––ú��ú��†††‘‘‘††††††‘‘‘‘‘‘‘‘‘†††††††††www†††wwwwwwwwwwwwwwwwwwppppppppppppppppppppppppfffffffffffffffffffffffffffpppfffffffffppppppppppppffffffpppfffpppffffffpppfffppppppppppppppppppfffpppfffppppppppppppppppppwwwwwwfffpppppppppffffffffffffppppppppppppppppppfffppppppppppppfffppppppwwwppppppppppppppppppppppppppp^^^NNN^^^fffppppppfffpppfffpppfffffffffpppfff^^^ffffffffffffpppfffffffffffffffpppfffppppppwww^^^GGG^^^pppfffffffffpppffffff^^^ffffffffffffppppppffffffffffffpppfffffffffffffff^^^ffffffffffffwwwwwwwwwwwwwwwwwwwwwwww††††††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––‘‘‘‘‘‘––––––‘‘‘–––––––––––––––––––––––– ªªª ªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªª ªªªªªª°°°°°°°°°°°°ªªª°°°ªªª°°°°°°°°°°°°¶¶¶¶¶¶°°°¶¶¶°°°¶¶¶°°°°°°ªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶ªªª°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁú��ú��ú��ú��ú��ú��ú��ú��ú��è<<·±±ÁÁÁÁÁÁ¶¶¶ÁÁÁ¶¶¶°°°ªªª –––ú��ú��‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††††††††www†††††††††††††††††††††††††††wwwwwwwwwwwwwwwpppwwwwwwppppppwwwpppwwwpppwwwpppfffpppfffpppppppppfffppppppfffpppppppppppppppppppppfffppppppppppppppppppppppppppppppppppppwwwwwwwwwwwwppppppppppppppppppffffffppppppppppppppppppppppppppppppppppppfffppppppwwwpppwwwppppppwwwppppppfffppp^^^NNNVVVfffwwwpppfffppppppfffpppfffppppppffffffffffffffffffffffffffffffpppffffffffffffpppwwwfffNNN^^^pppfffpppfffppppppffffffffffffffffffpppppppppffffffpppfffffffffffffffffffff^^^fff^^^ffffffwwwwwwwwwwwwwwwwww†††††††††‘‘‘†††††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘––––––––––––––––––––––––‘‘‘––––––––– ––––––––––––––– ªªª ªªª ªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°ªªªªªªªªª°°°°°°°°°°°°¶¶¶¶¶¶°°°°°°°°°°°°¶¶¶°°°ªªª ªªª°°°°°°ªªª°°°ªªªªªª°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁË››ßXXï))öù÷ òåEEщ‰¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁ¶¶¶¶¶¶°°°ªªª –––ú��ú��‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††††††††www†††‘‘‘†††††††††††††††††††††††††††wwwwwwwwwwwwwwwpppwwwwwwpppppppppfffppppppwwwpppppppppfffpppppppppppppppppppppppppppwwwpppppppppppppppwwwppppppppppppwwwwwwwwwwwwppppppppppppppppppfffpppppppppppppppppppppppppppppppppppppppfffppppppwwwwwwpppppppppwwwpppppppppppp^^^NNNNNNfffppppppppppppfffpppfffpppfffpppffffffffffffffffffppppppffffffpppfffffffffffffffppp^^^GGGVVVfffppppppfffppppppffffffffffffppppppfffppppppfff^^^fffppppppfffffffffffffffVVV^^^^^^^^^fff^^^wwwwwwwww†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘––––––––––––––––––‘‘‘––––––––––––––––––––––––‘‘‘–––––– ––– ªªª ªªªªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°¶¶¶°°°°°°°°°ªªª°°°°°°°°°ªªªªªª°°°°°°ªªª°°°ªªª °°°ªªª°°°°°°ªªª°°°°°°°°°°°°°°°ªªª°°°°°°°°°°°°¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁ¶¶¶ÁÁÁÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÇÇÇÇÇÇÁÁÁÁÁÁ¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶°°°ªªªªªª –––––––––––––––‘‘‘‘‘‘†††‘‘‘††††††††††††‘‘‘†††‘‘‘†††††††††‘‘‘‘‘‘††††††††††††††††††††††††wwwwwwpppwwwwwwpppwwwwwwwwwwwwwwwpppwwwpppppppppwwwppppppwwwwwwwwwwwwwwwpppwwwpppwwwwwwwwwpppppppppwwwwwwwwwwwwwwwpppwwwpppwwwwwwppppppppppppwwwppppppwwwwwwwwwpppppppppwwwppppppppppppwwwwwwppppppwwwppppppppppppffffffVVVNNNfffwwwppppppfffpppppppppfffppppppppppppfffpppffffffpppfffpppfffffffffffffffffffffffffffGGGEEE^^^ppppppfffpppfffffffffffffffffffffpppfffpppffffff^^^pppffffffppppppfffffffffVVV^^^ffffff^^^fffpppwww††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––‘‘‘––––––––––––––– –––––––––‘‘‘–––––––––––– –––––– ––– ––– ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°ªªªªªª°°°°°°°°°°°°°°°°°°ªªªªªª°°°ªªª °°°°°°ªªª°°°°°°°°°ªªªªªªªªªªªª ªªªªªª°°°°°°¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶¶¶¶°°°°°°ªªª ––––––––––––‘‘‘††††††‘‘‘††††††‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘††††††††††††‘‘‘†††††††††www†††wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwppppppfffpppwwwpppwwwwwwwwwwwwwwwpppwwwwwwpppppppppwwwwwwwwwwwwwwwwwwwwwwwwppppppfffVVVVVVfffpppppppppppppppppppppfffpppppppppppppppfffppppppfffppppppfffpppfffffffff^^^fffppppppVVV===GGGfffpppfffpppppppppfff^^^fffffffffpppfffffffffpppfffffffffffffffffffffffffff^^^^^^^^^ffffffffffff††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––––––––‘‘‘‘‘‘‘‘‘––––––––– ––– –––––– ––– ––– ªªª°°°°°°ªªªªªªªªª ªªªªªªªªªªªªªªªªªª ªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°ªªªªªªªªªªªª°°°°°°ªªª°°°ªªªªªªªªªªªª ªªª°°°°°°°°°°°°¶¶¶°°°ªªª–––†††–––ªªªªªªªªª°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁ¶¶¶ÁÁÁÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁ¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ªªªªªªªªª –––‘‘‘†††‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††‘‘‘†††‘‘‘‘‘‘†††††††††††††††‘‘‘††††††††††††††††††††††††††††††wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpppppppppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwppppppwwwwwwwwwwwwwwwwwwwwwpppppp^^^VVV^^^pppwwwpppppppppwwwpppppppppppppppppppppppppppfffppppppffffffpppppppppffffffffffffppp^^^EEEEEEfffpppfffffffffpppfff^^^ffffffpppffffffffffffpppfff^^^fffppppppfffffffffffffffffffff^^^fff^^^ffffff††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘––––––––––––––––––‘‘‘‘‘‘––––––––– ––– ––– ––– ªªªªªªªªªªªªªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°ªªª°°°ªªªªªªªªªªªª°°°°°°°°°°°°ªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°–––†††‘‘‘ªªª°°°°°°°°°°°°°°°¶¶¶°°°¶¶¶¶¶¶°°°¶¶¶¶¶¶°°°¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶ÁÁÁÁÁÁ¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°ªªªªªª ––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘††††††‘‘‘††††††‘‘‘†††††††††††††††††††††††††††††††††‘‘‘–––‘‘‘†††www††††††wwwwwwwwwwwwwwwpppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpppppp^^^VVV^^^ppppppwwwpppwwwwwwppppppppppppwwwpppfffpppfffpppfffpppppppppppppppfffpppffffffppppppfffGGG===^^^pppfffffffffppppppfff^^^ffffffffffffffffffffffffffffffffffffppppppfffffffffpppfffffffffffffffffffff†††‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘–––‘‘‘–––‘‘‘–––––––––‘‘‘‘‘‘‘‘‘‘‘‘–––––––––––– ––––––––– –––––– ªªªªªªªªª ªªª ªªªªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°ªªª°°°°°°°°°°°°ªªªªªªªªªªªª°°°°°°ªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°ªªªªªª †††www†††–––ªªª°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶°°°°°°¶¶¶¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶ÁÁÁ¶¶¶ÁÁÁÁÁÁÁÁÁ¶¶¶¶¶¶°°°¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°ªªªªªªªªª ªªª ––––––––––––‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††††††††–––‘‘‘†††††††††††††††††††††††††††wwwpppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpppVVVVVVpppwwwwwwwwwwwwpppwwwppppppwwwwwwwwwpppppppppppppppppppppfffpppppppppppp^^^fffppppppwwwVVV===VVVppppppfffpppppppppfff^^^fff^^^^^^^^^^^^NNN^^^fffffffff^^^^^^pppfffffffffffffffppppppffffffpppppppppppp‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘–––––––––‘‘‘––––––––– ––– ––– ªªªªªª ªªªªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªª°°°ªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°ªªªªªªªªªªªªªªªªªªªªª°°°ªªªªªª°°°°°°°°°°°°°°°°°°°°°°°° †††fffwww‘‘‘ °°°ªªª°°°°°°°°°°°°¶¶¶°°°°°°°°°°°°¶¶¶°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ¶¶¶¶¶¶ÁÁÁÁÁÁÁÁÁ¶¶¶¶¶¶¶¶¶°°°°°°°°°¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶°°°¶¶¶°°°°°°ªªªªªªªªª°°°ªªªªªª ––– –––––– –––––––––‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††wwwwww†††www†††wwwwwwwwwwwwwwwwwwpppVVVVVVpppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwppppppwwwppppppwwwppppppfffppppppfff^^^ppppppwwwpppGGGNNNpppwwwppppppwwwpppppp^^^^^^^^^^^^fffffffff^^^fffffffffffffffffffffppppppffffffpppfffpppppppppfffppppppppp†††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––––––––––––––––––––– ––– ªªªªªª ªªª ªªªªªª ªªª ªªªªªªªªªªªª°°°ªªªªªª°°°ªªª°°°°°°°°°ªªª°°°°°° ªªª ªªªªªªªªª°°°ªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°†††fff^^^–––ªªª°°°ªªª°°°°°°°°°¶¶¶¶¶¶¶¶¶°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶ÁÁÁ°°°¶¶¶¶¶¶¶¶¶¶¶¶°°°°°°°°°°°°¶¶¶°°°°°°°°°¶¶¶¶¶¶¶¶¶¶¶¶°°°°°°°°°ªªªªªª ªªª ––– ––– –––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††††††††www††††††††††††††††††††††††wwwwwwwwwppp^^^VVVpppwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpppwwwpppwwwwwwwwwppppppppppppppp^^^fffwwwwwwwwwfffVVVppppppwwwwwwpppwwwwwwfff^^^^^^^^^ffffffffffffppppppppp^^^fffffffffffffffffffffffffffffffffpppfffpppppppppppp‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––––––‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘–––‘‘‘–––––––––––––––‘‘‘––– ªªªªªªªªª ªªª ªªª ªªªªªªªªªªªªªªª°°°ªªª°°°ªªª°°°°°°ªªªªªª°°°ªªªªªª ªªªªªªªªªªªªªªª ªªªªªª°°°°°°°°°ªªªªªª‘‘‘ppp^^^fff‘‘‘ ªªª°°°ªªª°°°°°°°°°°°°¶¶¶°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶¶¶¶°°°¶¶¶¶¶¶°°°¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶°°°¶¶¶°°°°°°°°°ªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶°°°°°°°°°°°°ªªªªªªªªª ––– –––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††††††††‘‘‘††††††‘‘‘††††††††††††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘‘‘‘††††††††††††‘‘‘††††††‘‘‘††††††††††††††††††††††††‘‘‘‘‘‘††††††††††††††††††††††††wwwwwwfffVVVfffwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww†††pppppppppppp^^^fffwwwwwwwwwpppffffffwwwpppwwwwwwwwwwwwffffff^^^^^^^^^ffffff^^^fffpppfffffffffffffffffffffffffff^^^^^^fffpppfffffffffpppfffpppppp‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘–––‘‘‘–––––––––‘‘‘–––––– ªªª ªªª ªªª ªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°ªªªªªªªªªªªªªªªªªª ªªª ––––––‘‘‘–––ªªªªªª°°°°°°°°°°°°–––wwwVVVVVVwww ªªª°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶°°°°°°°°°°°°°°°¶¶¶°°°°°°¶¶¶°°°¶¶¶°°°¶¶¶°°°¶¶¶°°°°°°¶¶¶¶¶¶°°°¶¶¶°°°¶¶¶°°°ªªª°°°°°°°°°ªªª°°°°°°°°°°°°°°°°°°¶¶¶°°°¶¶¶°°°¶¶¶°°°¶¶¶°°°ªªªªªª ––– ––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––––––‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††††††††‘‘‘†††‘‘‘††††††††††††††††††††††††††††††‘‘‘†††‘‘‘††††††††††††‘‘‘†††††††††‘‘‘†††††††††††††††‘‘‘†††††††††††††††††††††††††††‘‘‘‘‘‘†††‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††www^^^fffwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpppppppppfff^^^wwwwwwfffpppppppppwwwwwwwwwwwwpppfffVVVVVV^^^^^^VVV^^^fffffffff^^^fffffffffpppfffffffffffffffpppfffpppffffffffffffppppppppp‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––‘‘‘‘‘‘–––––––––‘‘‘–––––––––––– ªªª ªªª ªªª ªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°ªªªªªªªªª –––‘‘‘†††––– °°°°°°°°°°°°ªªªVVVNNNfff††† ªªªªªª°°°°°°°°°°°°¶¶¶°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶°°°°°°¶¶¶°°°¶¶¶°°°¶¶¶°°°¶¶¶¶¶¶°°°°°°¶¶¶°°°°°°ªªªªªª°°°ªªª°°°°°°°°°ªªª°°°°°°°°°°°°¶¶¶°°°°°°°°°°°°°°°°°°°°°°°°ªªªªªª ªªª –––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††††††††‘‘‘††††††††††††‘‘‘‘‘‘††††††††††††††††††‘‘‘††††††††††††‘‘‘††††††††††††‘‘‘†††††††††††††††††††††‘‘‘†††††††††††††††wwwwww†††‘‘‘‘‘‘†††‘‘‘†††††††††††††††††††††††††††‘‘‘‘‘‘††††††††††††††††††††††††wwwppp†††wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwpppwwwwwwpppfffwwwwwwpppppppppwwwwwwwwwwwwwwwppp^^^VVV^^^^^^^^^^^^^^^^^^ffffff^^^^^^fffffffff^^^ffffffffffffpppffffffppp^^^ffffffppppppppp††††††‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘––––––‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘–––––––––––– ––– ªªªªªªªªªªªªªªªªªªªªªªªª ªªª ªªªªªªªªªªªªªªªªªª –––––––––†††wwwffffffwww‘‘‘ªªªªªª°°°°°°ªªª–––fffVVV^^^––– ªªª°°°°°°°°°°°°°°°¶¶¶°°°°°°¶¶¶°°°°°°¶¶¶°°°¶¶¶°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶°°°¶¶¶°°°¶¶¶¶¶¶°°°°°°°°°ªªªªªª°°°ªªª°°°°°°ªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°ªªªªªª ªªªªªª –––––––––‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††††††††††††††‘‘‘††††††††††††††††††††††††††††††††††††††††††‘‘‘†††‘‘‘†††††††††††††††‘‘‘††††††††††††††††††††††††††††††††††††www†††‘‘‘†††‘‘‘††††††††††††‘‘‘‘‘‘‘‘‘†††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††††††††‘‘‘†††††††††pppwww†††††††††wwwwwwwwwwwwwwwwwwfff^^^wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwffffffpppfffffffff^^^fff^^^ffffff^^^fff^^^VVV^^^^^^^^^ffffffffffffffffffppp^^^fffppppppffffff†††‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––– ––– ªªªªªª ªªªªªªªªªªªªªªªªªª ªªªªªªªªªªªªªªª–––‘‘‘†††ppp^^^VVV^^^www ªªªªªª°°°°°° www^^^^^^www‘‘‘ ªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶°°°°°°°°°°°°°°°¶¶¶°°°¶¶¶°°°°°°°°°¶¶¶°°°°°°¶¶¶¶¶¶°°°ªªªªªªªªª°°°ªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°ªªª°°°°°°°°°°°°°°°°°°°°°ªªªªªªªªª ªªª ––– –––‘‘‘––––––––––––‘‘‘‘‘‘††††††‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††††††††††††††††††††‘‘‘†††††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘††††††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘††††††††††††‘‘‘‘‘‘†††‘‘‘†††wwwwww†††††††††††††††wwwwwwwwwwwwwwwVVVNNNwwwwwwwwwwwwwwwwww†††wwwfffppppppwwwpppppppppfffffffffffffffffffff^^^^^^^^^^^^^^^ffffffffffffffffffffffffpppppppppfff††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘–––––– ––– ªªª ªªªªªªªªªªªªªªª ªªª ––– ªªª ªªªªªª †††pppfff^^^NNNVVVfff††† °°°ªªª°°° †††fffVVVppp‘‘‘ ªªªªªªªªªªªª°°°°°°°°°°°°ªªª°°°¶¶¶°°°°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶°°°¶¶¶°°°¶¶¶°°°°°°°°°¶¶¶°°°¶¶¶ªªªªªªªªªªªª°°°ªªªªªªªªªªªªªªªªªª°°°ªªªªªªªªªªªª°°°ªªªªªªªªª°°°°°°°°°°°°ªªª°°°ªªªªªªªªª ––– –––––– –––––––––‘‘‘†††‘‘‘‘‘‘‘‘‘††††††‘‘‘†††‘‘‘†††‘‘‘††††††††††††††††††††††††www††††††††††††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††www†††‘‘‘†††‘‘‘††††††††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††††††††www†††††††††††††††wwwwwwwwwwwwwwwwwwGGGGGGwwwwwwwwwwwwwwwwwwwwwwww†††wwwpppwww†††‘‘‘††††††wwwwwwwwwffffffffffff^^^^^^VVV^^^^^^^^^fffppppppfffpppffffffpppfffpppffffff‘‘‘††††††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘†††††††††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––– ––– ––– ªªªªªªªªªªªªªªªªªªªªª ªªªªªªªªªªªªªªª †††wwwfff^^^VVVVVVNNNNNNppp‘‘‘ªªª°°°°°° †††ppp^^^fff††† ªªªªªªªªªªªªªªªªªª°°°°°°ªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°ªªª°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶°°°¶¶¶¶¶¶°°°¶¶¶ªªª °°°ªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°ªªª°°°ªªª°°°ªªªªªªªªªªªªªªª ––– –––––– –––––––––‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘†††††††††††††††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘††††††‘‘‘††††††††††††††††††‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††††††††‘‘‘‘‘‘††††††‘‘‘††††††††††††‘‘‘†††‘‘‘†††‘‘‘††††††††††††††††††††††††††††††wwwwwwpppGGGEEEpppwwwwwwwwwwwwwwwwww†††††††††††††††‘‘‘–––––––––‘‘‘††††††wwwwwwwwwpppfff^^^VVVVVVVVV^^^^^^fffffffffpppffffffppppppppppppfff†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘†††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘–––––– ––– ªªªªªªªªªªªª ªªªªªª ªªª ªªª ––– †††www^^^NNNVVVVVVNNNNNNVVV ªªªªªªªªª‘‘‘ppp^^^^^^www‘‘‘ ªªªªªªªªªªªªªªªªªªªªª°°°°°°ªªª°°°ªªªªªªªªª°°°°°°°°°°°°ªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶°°°¶¶¶¶¶¶°°°ªªªªªªªªªªªª°°°ªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªª ªªªªªª°°°ªªª°°°°°°ªªª°°°°°°ªªªªªª ªªª –––––– –––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘‘‘‘†††‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘††††††‘‘‘‘‘‘†††††††††††††††‘‘‘†††‘‘‘††††††††††††††††††‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘††††††††††††wwwwwwwww†††www^^^NNNfffpppwww‘‘‘–––‘‘‘‘‘‘––– ––––––‘‘‘††††††wwwwwwfff^^^^^^VVV^^^VVV^^^ffffffffffffpppfffpppfffppp^^^^^^††††††‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘–––––– ––– ––– ªªª ªªªªªªªªªªªª ªªªªªª ªªª ªªª ––––––‘‘‘www^^^VVVNNNNNNNNNNNNNNNfff‘‘‘ ªªªªªª–––^^^^^^ppp†††––– ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°ªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°ªªª°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶°°°°°°ªªªªªªªªªªªªªªªªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°ªªª°°°ªªª°°°°°°°°°°°°ªªªªªª ––– ––– ––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––††††††††††††††††††‘‘‘†††‘‘‘††††††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††††††††www††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††‘‘‘†††‘‘‘‘‘‘†††††††††‘‘‘††††††††††††††††††††††††‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††††††††wwwwww††††††wwwffffffpppwwwwww††††††††††††––– –––––– ––––––‘‘‘††††††††††††wwwfff^^^^^^^^^^^^^^^^^^^^^ffffffpppppppppffffffffffff‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––– –––––– ––– ªªª ªªªªªªªªªªªª ªªª –––––––––‘‘‘www^^^NNNNNNNNNNNNNNNNNNVVV–––ªªªªªª–––†††fff^^^ppp†††––– ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°ªªª°°°ªªª°°°°°°°°°°°°°°°°°°¶¶¶°°°°°°°°°°°°ªªªªªªªªªªªªªªªªªªªªªªªª ªªªªªªªªªªªª°°°ªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª ––– ––– –––––– –––‘‘‘–––‘‘‘–––‘‘‘–––‘‘‘††††††††††††‘‘‘‘‘‘†††‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘††††††www††††††‘‘‘‘‘‘‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††††††††‘‘‘‘‘‘‘‘‘†††††††††‘‘‘‘‘‘††††††††††††††††††††††††‘‘‘‘‘‘†††‘‘‘††††††‘‘‘†††‘‘‘‘‘‘‘‘‘www††††††††††††wwwwwwwwwwww†††††††††††††††‘‘‘––– ªªª –––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††ppppppfffffffff^^^^^^VVV^^^fffpppfffpppppp^^^^^^^^^††††††‘‘‘†††‘‘‘‘‘‘†††††††††‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘–––––– ––– –––––– ªªª –––––––––‘‘‘www^^^NNNGGGNNNNNNNNNNNNNNN^^^‘‘‘ ªªª †††ppp^^^fff‘‘‘––– ªªªªªªªªª ªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°¶¶¶¶¶¶¶¶¶°°°°°°ªªªªªªªªª°°°ªªªªªª ªªªªªªªªª ªªªªªªªªªªªªªªªªªª ªªªªªªªªª ªªª ªªª ªªªªªªªªªªªª ªªª ––– ‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††www††††††–––‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘–––‘‘‘††††††‘‘‘††††††‘‘‘†††††††††‘‘‘†††††††††††††††††††††‘‘‘‘‘‘‘‘‘‘‘‘††††††‘‘‘†††††††††††††††††††††††††††††††††††††††www††††††‘‘‘††††††††††††‘‘‘‘‘‘––––––ªªª –––––––––‘‘‘–––‘‘‘††††††wwwwwwffffff^^^^^^^^^ffffffpppppppppffffff^^^^^^‘‘‘†††‘‘‘†††††††††††††††‘‘‘†††‘‘‘‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––– ––– ––– ––– –––––– ªªª ªªª ––––––†††www^^^NNNGGGNNNVVVNNNNNNNNNVVVwww––– ªªª‘‘‘ppp^^^^^^www‘‘‘‘‘‘––– ––– ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°ªªªªªªªªª°°°ªªª ªªªªªª ªªªªªªªªª ªªªªªªªªªªªª ªªªªªªªªªªªªªªªªªª ªªªªªª ªªªªªªªªªªªª ––– ––– ––––––––––––––––––‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††††††††††††††††††††††††††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††www‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††††††††‘‘‘‘‘‘†††††††††‘‘‘†††‘‘‘††††††††††††‘‘‘†††††††††‘‘‘†††††††††‘‘‘††††††‘‘‘††††††‘‘‘†††††††††††††††††††††††††††††††††††††††‘‘‘††††††††††††‘‘‘‘‘‘‘‘‘www††† ªªª ––––––––––––‘‘‘‘‘‘‘‘‘wwwwwwppp^^^^^^fffffffffwwwpppffffffffffff^^^†††‘‘‘†††††††††††††††‘‘‘‘‘‘††††††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––––– ––– ––––––––– ªªª ªªª ––––––†††wwwfffNNNGGGNNNVVVVVVNNNNNNNNNfff‘‘‘ –––^^^VVVfff†††‘‘‘––––––––– ––– ªªªªªª ªªªªªªªªª ªªªªªª ªªªªªªªªªªªªªªª°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°ªªªªªªªªªªªªªªª ªªªªªªªªªªªªªªª ªªª ªªª ªªªªªª ªªªªªª ªªªªªª ªªªªªªªªªªªª ––– ––––––––––––‘‘‘–––‘‘‘–––‘‘‘‘‘‘‘‘‘†††‘‘‘††††††††††††‘‘‘‘‘‘††††††‘‘‘†††‘‘‘†††‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††‘‘‘††††††††††††††††††‘‘‘†††‘‘‘‘‘‘††††††‘‘‘†††‘‘‘†††‘‘‘††††††††††††††††††‘‘‘†††‘‘‘††††††††††††††††††††††††‘‘‘††††††††††††††††††††††††††††††‘‘‘‘‘‘––––––www††† ªªªªªª ªªª –––––––––––––––‘‘‘––––––‘‘‘‘‘‘†††‘‘‘†††wwwppppppffffffppppppwwwfff^^^fffffffff†††††††††††††††††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘––––––––– ––– ªªª ªªª –––‘‘‘wwwfffNNNGGGNNNNNNNNNVVVNNNNNN^^^www–––ªªª †††ppp^^^fffwww‘‘‘‘‘‘––– –––––– ––– ªªªªªªªªª ªªªªªªªªªªªª ªªªªªªªªªªªªªªªªªªªªª°°°ªªª°°°ªªª°°°°°°°°°°°°°°°°°°ªªªªªªªªªªªªªªªªªª ªªªªªª ªªª ªªªªªª ––– ªªªªªªªªªªªª ªªª ªªªªªªªªªªªª ––– ªªª ––––––––––––––––––––––––‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘†††‘‘‘††††††‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘†††www‘‘‘‘‘‘–––‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘†††††††††††††††††††††‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††††††††††††††††††††††††††‘‘‘†††‘‘‘††††††††††††‘‘‘‘‘‘‘‘‘†††‘‘‘††††††††††††††††††††††††‘‘‘††††††††††††‘‘‘––– ––– ––– ªªªªªªªªª ªªª ––– ––––––‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘wwwpppppppppwwwpppfff^^^fffffffff††††††††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––– ––– ––– –––‘‘‘wwwfffNNNGGGGGGNNNNNNNNNVVVNNNVVVppp‘‘‘ ‘‘‘wwwfffppp†††––––––––– ––– ––– ––– ªªªªªªªªªªªªªªªªªª ªªªªªªªªªªªªªªªªªªªªªªªªªªª°°°ªªª°°°°°°°°°°°°°°°ªªªªªªªªªªªªªªªªªªªªª ªªª ªªªªªªªªªªªªªªª ªªªªªª ªªª ªªª ªªªªªªªªª ªªªªªªªªª ––– –––––– ––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††‘‘‘††††††††††††††††††††††††‘‘‘†††††††††††††††††††††††††††††††††††††††www†††‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘††††††††††††‘‘‘††††††‘‘‘‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘††††††‘‘‘††††††††††††‘‘‘‘‘‘††††††††††††††††††‘‘‘†††‘‘‘††††††††††††††††††††††††††††††††††††††††††††††††‘‘‘––– ªªª ªªªªªªªªª ––– –––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††wwwpppwwwwwwpppfffffffffffffff†††††††††‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††‘‘‘‘‘‘‘‘‘––––––––– ––– ––– ––– –––‘‘‘fffNNNGGGGGGNNNVVVVVVVVVNNNNNN^^^–––ªªª †††pppfff––– ªªªªªªªªª ––– ªªªªªªªªªªªªªªªªªªªªªªªª ªªª ªªªªªªªªªªªªªªªªªªªªªªªª°°°°°°ªªª°°°°°°ªªªªªªªªªªªª°°°ªªªªªªªªª ªªªªªª ªªªªªªªªªªªªªªªªªª ªªªªªª ªªªªªªªªª ªªª ªªª ––––––––––––––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘†††‘‘‘†††‘‘‘†††‘‘‘††††††††††††‘‘‘††††††‘‘‘†††‘‘‘†††††††††††††††††††††wwwwww‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘–––––––––‘‘‘‘‘‘‘‘‘††††††‘‘‘†††‘‘‘†††††††††‘‘‘†††‘‘‘††††††††††††‘‘‘†††‘‘‘††††††‘‘‘‘‘‘‘‘‘†††††††††††††††‘‘‘††††††‘‘‘††††††††††††‘‘‘†††‘‘‘†††‘‘‘†††††††††††††††††††††††††††††††††††††††††††††††††††–––––– ªªª ––– ––– ––––––––––––‘‘‘www††††††wwwwwwwwwwwwpppfffpppffffff^^^^^^††††††‘‘‘‘‘‘††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘–––––––––––– ––– ––– ––– ––– ––––––‘‘‘pppVVVGGGGGGNNNVVVVVVVVVVVVNNNVVVppp‘‘‘ ªªª‘‘‘ppp‘‘‘––– °°°°°° ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª ªªªªªªªªªªªª ªªªªªªªªªªªª°°°ªªªªªª°°°°°°°°°°°°ªªªªªªªªªªªªªªª°°°ªªªªªª ªªª ªªªªªªªªªªªª °°°ªªªªªªªªªªªªªªª ªªªªªªªªªªªª ªªªªªª ªªª ªªªªªªªªª ––– ––– –––––––––‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘‘‘‘–––‘‘‘‘‘‘††††††‘‘‘‘‘‘‘‘‘†††‘‘‘††††††††††††††††††‘‘‘‘‘‘†††‘‘‘††††††‘‘‘†††††††††††††††††††††www†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘––––––––––––‘‘‘‘‘‘‘‘‘‘‘‘–––‘‘‘†††‘‘‘†††‘‘‘–––‘‘‘†††††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘†††‘‘‘††††††‘‘‘†††††††††‘‘‘††††††‘‘‘††††††††††††‘‘‘†††‘‘‘†††††††††††††††‘‘‘††††††‘‘‘††††††††††††††††††††††††‘‘‘–––––– ªªª –––––– ªªª ––– –––††††††††††††wwwpppffffffpppffffff^^^†††‘‘‘†††††††††‘‘‘†††‘‘‘†††‘‘‘‘‘‘–––––––––––– ––– ––––––––– ––– ––– ªªªªªª ––––––†††pppVVVGGGGGGNNNVVVVVVVVVVVVVVVNNN^^^––– †††www†††––– ªªª ªªªªªª°°°ªªª°°°°°°ªªªªªªªªª ªªª ªªªªªª ªªªªªª ªªªªªªªªª°°°°°°°°°°°°°°°ªªªªªªªªª°°°ªªªªªªªªªªªªªªª ªªª ªªªªªªªªªªªª ––– ªªª°°°ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª ªªªªªª ªªª ªªªªªªªªª ªªª ––– –––‘‘‘‘‘‘‘‘‘–––‘‘‘‘‘‘†††‘‘‘–––‘‘‘‘‘‘†††‘‘‘‘‘‘‘‘‘†††††††††††††††‘‘‘†††††††††††††††‘‘‘†††‘‘‘††††††‘‘‘†††††††††††††††www††††††††††††wwwwww††††††‘‘‘‘‘‘‘‘‘‘‘‘––––––‘‘‘–––––––––‘‘‘‘‘‘‘‘‘––––––‘‘‘†††‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘‘††††††‘‘‘‘‘‘†††‘‘‘†††‘‘‘‘‘‘‘‘‘†††‘‘‘†††††††††‘‘‘††††††‘‘‘†††††††††‘‘‘‘‘‘†††‘‘‘†††††††††††††††‘‘‘††††††‘‘‘‘‘‘††††††††††††††††††††††††††††††–––––– –––––– ––– ªªª ªªª –––––– –––‘‘‘‘‘‘‘‘‘‘‘‘†††wwwffffffffffffppppppfff \ No newline at end of file diff --git a/tutorial/tracking/model-based/generic/teabox.wrl b/tutorial/tracking/model-based/generic/teabox.wrl new file mode 100644 index 0000000000000000000000000000000000000000..a452ea0b7c54d955211974b893b38cf1e3df1eed --- /dev/null +++ b/tutorial/tracking/model-based/generic/teabox.wrl @@ -0,0 +1,33 @@ +#VRML V2.0 utf8 + +DEF fst_0 Group { +children [ + +# Object "teabox" +Shape { + +geometry DEF cube IndexedFaceSet { + +coord Coordinate { +point [ +0 0 0 , +0 0 -0.08, +0.165 0 -0.08, +0.165 0 0 , +0.165 0.068 0 , +0.165 0.068 -0.08, +0 0.068 -0.08, +0 0.068 0 ] +} + +coordIndex [ + 0,1,2,3,-1, + 1,6,5,2,-1, + 4,5,6,7,-1, + 0,3,4,7,-1, + 5,4,3,2,-1, + 0,7,6,1,-1]} +} + +] +} diff --git a/tutorial/tracking/model-based/generic/teabox.xml b/tutorial/tracking/model-based/generic/teabox.xml new file mode 100644 index 0000000000000000000000000000000000000000..5efcd38af728bf363112900aee9ce23db037ed61 --- /dev/null +++ b/tutorial/tracking/model-based/generic/teabox.xml @@ -0,0 +1,44 @@ +<?xml version="1.0"?> +<conf> + <ecm> + <mask> + <size>5</size> + <nb_mask>180</nb_mask> + </mask> + <range> + <tracking>8</tracking> + </range> + <contrast> + <edge_threshold>10000</edge_threshold> + <mu1>0.5</mu1> + <mu2>0.5</mu2> + </contrast> + <sample> + <step>4</step> + </sample> + </ecm> + <klt> + <mask_border>5</mask_border> + <max_features>300</max_features> + <window_size>5</window_size> + <quality>0.015</quality> + <min_distance>8</min_distance> + <harris>0.01</harris> + <size_block>3</size_block> + <pyramid_lvl>3</pyramid_lvl> + </klt> + <camera> + <u0>325.66776</u0> + <v0>243.69727</v0> + <px>839.21470</px> + <py>839.44555</py> + </camera> + <face> + <angle_appear>70</angle_appear> + <angle_disappear>80</angle_disappear> + <near_clipping>0.1</near_clipping> + <far_clipping>100</far_clipping> + <fov_clipping>1</fov_clipping> + </face> +</conf> + diff --git a/tutorial/tracking/model-based/generic/tutorial-mb-tracker-full.cpp b/tutorial/tracking/model-based/generic/tutorial-mb-tracker-full.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8434c332a0f1d09fb5a2e50539de24c474f329f3 --- /dev/null +++ b/tutorial/tracking/model-based/generic/tutorial-mb-tracker-full.cpp @@ -0,0 +1,213 @@ +//! \example tutorial-mb-tracker-full.cpp +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +//! [Include] +#include <visp3/mbt/vpMbEdgeTracker.h> +#include <visp3/mbt/vpMbEdgeKltTracker.h> +//! [Include] +#include <visp3/io/vpVideoReader.h> + +int main(int argc, char** argv) +{ +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) + + try { + std::string opt_videoname = "teabox.mpg"; + int opt_tracker = 0; + + for (int i=0; i<argc; i++) { + if (std::string(argv[i]) == "--name") + opt_videoname = std::string(argv[i+1]); + if (std::string(argv[i]) == "--tracker") + opt_tracker = atoi(argv[i+1]); + else if (std::string(argv[i]) == "--help") { + std::cout << "\nUsage: " << argv[0] << " [--name <video name>] [--tracker <0=egde|1=keypoint|2=hybrid>] [--help]\n" << std::endl; + return 0; + } + } + std::string parentname = vpIoTools::getParent(opt_videoname); + std::string objectname = vpIoTools::getNameWE(opt_videoname); + + if(! parentname.empty()) + objectname = parentname + "/" + objectname; + + std::cout << "Video name: " << opt_videoname << std::endl; + std::cout << "Tracker requested config files: " << objectname + << ".[init," +#ifdef VISP_HAVE_XML2 + << "xml," +#endif + << "cao or wrl]" << std::endl; + std::cout << "Tracker optional config files: " << objectname << ".[ppm]" << std::endl; + + //! [Image] + vpImage<unsigned char> I; + vpCameraParameters cam; + //! [Image] + //! [cMo] + vpHomogeneousMatrix cMo; + //! [cMo] + + vpVideoReader g; + g.setFileName(opt_videoname); + g.open(I); + + vpDisplay *display = NULL; +#if defined(VISP_HAVE_X11) + display = new vpDisplayX; +#elif defined(VISP_HAVE_GDI) + display = new vpDisplayGDI; +#else + display = new vpDisplayOpenCV; +#endif + display->init(I, 100, 100, "Model-based tracker"); + + //! [Constructor] + vpMbTracker *tracker; + if (opt_tracker == 0) + tracker = new vpMbEdgeTracker; +#ifdef VISP_HAVE_MODULE_KLT + else if (opt_tracker == 1) + tracker = new vpMbKltTracker; + else + tracker = new vpMbEdgeKltTracker; +#else + else { + std::cout << "klt and hybrid model-based tracker are not available since visp_klt module is missing" << std::endl; + return 0; + } +#endif + //! [Constructor] + + bool usexml = false; + //! [Load xml] +#ifdef VISP_HAVE_XML2 + if(vpIoTools::checkFilename(objectname + ".xml")) { + tracker->loadConfigFile(objectname + ".xml"); + usexml = true; + } +#endif + //! [Load xml] + + if (! usexml) { + //! [Set parameters] + if (opt_tracker == 0 || opt_tracker == 2) { + //! [Set moving-edges parameters] + vpMe me; + me.setMaskSize(5); + me.setMaskNumber(180); + me.setRange(8); + me.setThreshold(10000); + me.setMu1(0.5); + me.setMu2(0.5); + me.setSampleStep(4); + dynamic_cast<vpMbEdgeTracker*>(tracker)->setMovingEdge(me); + //! [Set moving-edges parameters] + } + +#ifdef VISP_HAVE_MODULE_KLT + if (opt_tracker == 1 || opt_tracker == 2) { + //! [Set klt parameters] + vpKltOpencv klt_settings; + klt_settings.setMaxFeatures(300); + klt_settings.setWindowSize(5); + klt_settings.setQuality(0.015); + klt_settings.setMinDistance(8); + klt_settings.setHarrisFreeParameter(0.01); + klt_settings.setBlockSize(3); + klt_settings.setPyramidLevels(3); + dynamic_cast<vpMbKltTracker*>(tracker)->setKltOpencv(klt_settings); + dynamic_cast<vpMbKltTracker*>(tracker)->setMaskBorder(5); + //! [Set klt parameters] + } +#endif + + //! [Set camera parameters] + cam.initPersProjWithoutDistortion(839.21470, 839.44555, 325.66776, 243.69727); + tracker->setCameraParameters(cam); + //! [Set camera parameters] + + //! [Set angles] + tracker->setAngleAppear( vpMath::rad(70) ); + tracker->setAngleDisappear( vpMath::rad(80) ); + //! [Set angles] + //! [Set clipping distance] + tracker->setNearClippingDistance(0.1); + tracker->setFarClippingDistance(100.0); + //! [Set clipping distance] + //! [Set clipping fov] + tracker->setClipping(tracker->getClipping() | vpMbtPolygon::FOV_CLIPPING); + //! [Set clipping fov] + + //! [Set ogre] + tracker->setOgreVisibilityTest(false); + tracker->setOgreShowConfigDialog(false); + //! [Set ogre] + + //! [Set parameters] + } + + //! [Load cao] + if(vpIoTools::checkFilename(objectname + ".cao")) + tracker->loadModel(objectname + ".cao"); + //! [Load cao] + //! [Load wrl] + else if(vpIoTools::checkFilename(objectname + ".wrl")) + tracker->loadModel(objectname + ".wrl"); + //! [Load wrl] + //! [Set display] + tracker->setDisplayFeatures(true); + //! [Set display] + //! [Init] + tracker->initClick(I, objectname + ".init", true); + //! [Init] + + while(! g.end()){ + g.acquire(I); + vpDisplay::display(I); + //! [Track] + tracker->track(I); + //! [Track] + //! [Get pose] + tracker->getPose(cMo); + //! [Get pose] + //! [Display] + tracker->getCameraParameters(cam); + tracker->display(I, cMo, cam, vpColor::red, 2, true); + //! [Display] + vpDisplay::displayFrame(I, cMo, cam, 0.025, vpColor::none, 3); + vpDisplay::displayText(I, 10, 10, "A click to exit...", vpColor::red); + vpDisplay::flush(I); + + if (vpDisplay::getClick(I, false)) + break; + } + vpDisplay::getClick(I); + //! [Cleanup] +#ifdef VISP_HAVE_XML2 + vpXmlParser::cleanup(); +#endif +#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3) + SoDB::finish(); +#endif + delete display; + delete tracker; + //! [Cleanup] + } + catch(vpException e) { + std::cout << "Catch a ViSP exception: " << e << std::endl; + } +#ifdef VISP_HAVE_OGRE + catch(Ogre::Exception e) { + std::cout << "Catch an Ogre exception: " << e.getDescription() << std::endl; + } +#endif +#else + (void)argc; + (void)argv; + std::cout << "Install OpenCV and rebuild ViSP to use this example." << std::endl; +#endif +} diff --git a/tutorial/tracking/model-based/generic/tutorial-mb-tracker.cpp b/tutorial/tracking/model-based/generic/tutorial-mb-tracker.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7f88a34861ed2221e94fac2a0143fe09c68050d9 --- /dev/null +++ b/tutorial/tracking/model-based/generic/tutorial-mb-tracker.cpp @@ -0,0 +1,159 @@ +//! \example tutorial-mb-tracker.cpp +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +//! [Include] +#include <visp3/mbt/vpMbEdgeTracker.h> +#include <visp3/mbt/vpMbEdgeKltTracker.h> +//! [Include] +#include <visp3/io/vpVideoReader.h> + +int main(int argc, char** argv) +{ +#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) + + try { + std::string opt_videoname = "teabox.mpg"; + int opt_tracker = 0; + + for (int i=0; i<argc; i++) { + if (std::string(argv[i]) == "--name") + opt_videoname = std::string(argv[i+1]); + if (std::string(argv[i]) == "--tracker") + opt_tracker = atoi(argv[i+1]); + else if (std::string(argv[i]) == "--help") { + std::cout << "\nUsage: " << argv[0] << " [--name <video name>] [--tracker <0=egde|1=keypoint|2=hybrid>] [--help]\n" << std::endl; + return 0; + } + } + std::string parentname = vpIoTools::getParent(opt_videoname); + std::string objectname = vpIoTools::getNameWE(opt_videoname); + + if(! parentname.empty()) + objectname = parentname + "/" + objectname; + + std::cout << "Video name: " << opt_videoname << std::endl; + std::cout << "Tracker requested config files: " << objectname + << ".[init, cao]" << std::endl; + std::cout << "Tracker optional config files: " << objectname << ".[ppm]" << std::endl; + + //! [Image] + vpImage<unsigned char> I; + vpCameraParameters cam; + //! [Image] + //! [cMo] + vpHomogeneousMatrix cMo; + //! [cMo] + + vpVideoReader g; + g.setFileName(opt_videoname); + g.open(I); + + vpDisplay *display = NULL; +#if defined(VISP_HAVE_X11) + display = new vpDisplayX; +#elif defined(VISP_HAVE_GDI) + display = new vpDisplayGDI; +#else + display = new vpDisplayOpenCV; +#endif + display->init(I, 100, 100, "Model-based tracker"); + + //! [Constructor] + vpMbTracker *tracker; + if (opt_tracker == 0) + tracker = new vpMbEdgeTracker; +#ifdef VISP_HAVE_MODULE_KLT + else if (opt_tracker == 1) + tracker = new vpMbKltTracker; + else + tracker = new vpMbEdgeKltTracker; +#else + else { + std::cout << "klt and hybrid model-based tracker are not available since visp_klt module is missing" << std::endl; + return 0; + } +#endif + //! [Constructor] + + //! [Set parameters] + if (opt_tracker == 0 || opt_tracker == 2) { + vpMe me; + me.setMaskSize(5); + me.setMaskNumber(180); + me.setRange(8); + me.setThreshold(10000); + me.setMu1(0.5); + me.setMu2(0.5); + me.setSampleStep(4); + dynamic_cast<vpMbEdgeTracker*>(tracker)->setMovingEdge(me); + } + +#ifdef VISP_HAVE_MODULE_KLT + if (opt_tracker == 1 || opt_tracker == 2) { + vpKltOpencv klt_settings; + klt_settings.setMaxFeatures(300); + klt_settings.setWindowSize(5); + klt_settings.setQuality(0.015); + klt_settings.setMinDistance(8); + klt_settings.setHarrisFreeParameter(0.01); + klt_settings.setBlockSize(3); + klt_settings.setPyramidLevels(3); + dynamic_cast<vpMbKltTracker*>(tracker)->setKltOpencv(klt_settings); + dynamic_cast<vpMbKltTracker*>(tracker)->setMaskBorder(5); + } +#endif + + //! [Set camera parameters] + cam.initPersProjWithoutDistortion(839, 839, 325, 243); + //! [Set camera parameters] + tracker->setCameraParameters(cam); + //! [Set parameters] + + //! [Load cao] + tracker->loadModel(objectname + ".cao"); + //! [Load cao] + //! [Set display] + tracker->setDisplayFeatures(true); + //! [Set display] + //! [Init] + tracker->initClick(I, objectname + ".init", true); + //! [Init] + + while(! g.end()){ + g.acquire(I); + vpDisplay::display(I); + //! [Track] + tracker->track(I); + //! [Track] + //! [Get pose] + tracker->getPose(cMo); + //! [Get pose] + //! [Display] + tracker->getCameraParameters(cam); + tracker->display(I, cMo, cam, vpColor::red, 2, true); + //! [Display] + vpDisplay::displayFrame(I, cMo, cam, 0.025, vpColor::none, 3); + vpDisplay::displayText(I, 10, 10, "A click to exit...", vpColor::red); + vpDisplay::flush(I); + + if (vpDisplay::getClick(I, false)) + break; + } + vpDisplay::getClick(I); + //! [Cleanup] + delete display; + delete tracker; + //! [Cleanup] + } + catch(vpException e) { + std::cout << "Catch a ViSP exception: " << e << std::endl; + } +#else + (void)argc; + (void)argv; + std::cout << "Install OpenCV and rebuild ViSP to use this example." << std::endl; +#endif +} diff --git a/tutorial/tracking/model-based/hybrid/CMakeLists.txt b/tutorial/tracking/model-based/hybrid/CMakeLists.txt index c126946c59cac6a851e526c00b571b9d36e13b71..67428b9c56f50a34b78e47fb479368c66ff68d0a 100644 --- a/tutorial/tracking/model-based/hybrid/CMakeLists.txt +++ b/tutorial/tracking/model-based/hybrid/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-tracking-mb-hybrid) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_mbt visp_klt visp_io visp_gui) # set the list of source files set(tutorial_cpp diff --git a/tutorial/tracking/model-based/hybrid/teabox.xml b/tutorial/tracking/model-based/hybrid/teabox.xml index 41a1afbf8e84411727a564d89507b0e32e571735..5efcd38af728bf363112900aee9ce23db037ed61 100644 --- a/tutorial/tracking/model-based/hybrid/teabox.xml +++ b/tutorial/tracking/model-based/hybrid/teabox.xml @@ -13,11 +13,10 @@ <mu1>0.5</mu1> <mu2>0.5</mu2> </contrast> + <sample> + <step>4</step> + </sample> </ecm> - <sample> - <step>4</step> - <nb_sample>250</nb_sample> - </sample> <klt> <mask_border>5</mask_border> <max_features>300</max_features> diff --git a/tutorial/tracking/model-based/hybrid/tutorial-mb-hybrid-tracker.cpp b/tutorial/tracking/model-based/hybrid/tutorial-mb-hybrid-tracker.cpp index 3bdd6ed0c1bbbdc38ce6b40c1c65ca1fc8f5255e..641cad1f483446ed8d556317838edb3ee842617c 100644 --- a/tutorial/tracking/model-based/hybrid/tutorial-mb-hybrid-tracker.cpp +++ b/tutorial/tracking/model-based/hybrid/tutorial-mb-hybrid-tracker.cpp @@ -1,11 +1,11 @@ /*! \example tutorial-mb-hybrid-tracker.cpp */ -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpMbEdgeKltTracker.h> -#include <visp/vpVideoReader.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/mbt/vpMbEdgeKltTracker.h> +#include <visp3/io/vpVideoReader.h> int main(int argc, char** argv) { @@ -72,9 +72,7 @@ int main(int argc, char** argv) me.setMu1(0.5); me.setMu2(0.5); me.setSampleStep(4); - me.setNbTotalSample(250); tracker.setMovingEdge(me); - tracker.setMaskBorder(5); vpKltOpencv klt_settings; klt_settings.setMaxFeatures(300); klt_settings.setWindowSize(5); @@ -84,6 +82,7 @@ int main(int argc, char** argv) klt_settings.setBlockSize(3); klt_settings.setPyramidLevels(3); tracker.setKltOpencv(klt_settings); + tracker.setMaskBorder(5); cam.initPersProjWithoutDistortion(839, 839, 325, 243); tracker.setCameraParameters(cam); tracker.setAngleAppear( vpMath::rad(70) ); @@ -93,6 +92,7 @@ int main(int argc, char** argv) tracker.setClipping(tracker.getClipping() | vpMbtPolygon::FOV_CLIPPING); } tracker.setOgreVisibilityTest(true); + tracker.setOgreShowConfigDialog(false); tracker.loadModel(objectname + ".cao"); tracker.setDisplayFeatures(true); tracker.initClick(I, objectname + ".init", true); @@ -116,13 +116,18 @@ int main(int argc, char** argv) #ifdef VISP_HAVE_XML2 vpXmlParser::cleanup(); #endif -#if defined(VISP_HAVE_COIN) && (COIN_MAJOR_VERSION == 3) +#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3) SoDB::finish(); #endif } catch(vpException e) { - std::cout << "Catch an exception: " << e << std::endl; + std::cout << "Catch a ViSP exception: " << e << std::endl; } +#ifdef VISP_HAVE_OGRE + catch(Ogre::Exception e) { + std::cout << "Catch an Ogre exception: " << e.getDescription() << std::endl; + } +#endif #else (void)argc; (void)argv; diff --git a/tutorial/tracking/model-based/keypoint/CMakeLists.txt b/tutorial/tracking/model-based/keypoint/CMakeLists.txt index 9723f386ed876edc88c1a571cc34053e649c25ff..e58383ec4baffb65e57c18a19be10ec0f36364d7 100644 --- a/tutorial/tracking/model-based/keypoint/CMakeLists.txt +++ b/tutorial/tracking/model-based/keypoint/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-tracking-mb-keypoint) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_mbt visp_klt visp_gui) # set the list of source files set(tutorial_cpp diff --git a/tutorial/tracking/model-based/keypoint/tutorial-mb-klt-tracker.cpp b/tutorial/tracking/model-based/keypoint/tutorial-mb-klt-tracker.cpp index b2620b638ace086427eeb01f8cf3352193cfa4ee..55e6ce887ee723001410d73ca1daefba62b986bf 100644 --- a/tutorial/tracking/model-based/keypoint/tutorial-mb-klt-tracker.cpp +++ b/tutorial/tracking/model-based/keypoint/tutorial-mb-klt-tracker.cpp @@ -1,11 +1,11 @@ /*! \example tutorial-mb-klt-tracker.cpp */ -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpImageIo.h> -#include <visp/vpIoTools.h> -#include <visp/vpMbKltTracker.h> -#include <visp/vpVideoReader.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/core/vpIoTools.h> +#include <visp3/mbt/vpMbKltTracker.h> +#include <visp3/io/vpVideoReader.h> int main(int argc, char** argv) { @@ -89,6 +89,7 @@ int main(int argc, char** argv) //! [Set parameters] } tracker.setOgreVisibilityTest(true); + tracker.setOgreShowConfigDialog(false); tracker.loadModel(objectname + "-triangle.cao"); tracker.setDisplayFeatures(true); tracker.initClick(I, objectname + ".init", true); @@ -112,13 +113,18 @@ int main(int argc, char** argv) #ifdef VISP_HAVE_XML2 vpXmlParser::cleanup(); #endif -#if defined(VISP_HAVE_COIN) && (COIN_MAJOR_VERSION == 3) +#if defined(VISP_HAVE_COIN3D) && (COIN_MAJOR_VERSION == 3) SoDB::finish(); #endif } catch(vpException e) { - std::cout << "Catch an exception: " << e << std::endl; + std::cout << "Catch a ViSP exception: " << e << std::endl; } +#ifdef VISP_HAVE_OGRE + catch(Ogre::Exception e) { + std::cout << "Catch an Ogre exception: " << e.getDescription() << std::endl; + } +#endif #else (void)argc; (void)argv; diff --git a/tutorial/tracking/moving-edges/CMakeLists.txt b/tutorial/tracking/moving-edges/CMakeLists.txt index 590ef19aca73f298e6c2d7502da19f041fc4676f..b9d4ea9fc007b6cbe88177af6247999655731d17 100644 --- a/tutorial/tracking/moving-edges/CMakeLists.txt +++ b/tutorial/tracking/moving-edges/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-tracking-me) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_me visp_io visp_gui) # set the list of source files set(tutorial_cpp diff --git a/tutorial/tracking/moving-edges/tutorial-me-ellipse-tracker.cpp b/tutorial/tracking/moving-edges/tutorial-me-ellipse-tracker.cpp index 38d5bc13ede2ffd4b2ee2a8039047069bc026609..22dce75b6f54b1822cf588c2fc1fc0343d062b27 100644 --- a/tutorial/tracking/moving-edges/tutorial-me-ellipse-tracker.cpp +++ b/tutorial/tracking/moving-edges/tutorial-me-ellipse-tracker.cpp @@ -1,27 +1,42 @@ /*! \example tutorial-me-ellipse-tracker.cpp */ -#include <visp/vp1394CMUGrabber.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpV4l2Grabber.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpMeEllipse.h> +#include <visp3/core/vpConfig.h> +#ifdef VISP_HAVE_MODULE_SENSOR +#include <visp3/sensor/vp1394CMUGrabber.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#endif +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/me/vpMeEllipse.h> int main() { -#if (defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_CMU1394) || defined(VISP_HAVE_V4L2)) +#if (defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) || defined(VISP_HAVE_V4L2) || (VISP_HAVE_OPENCV_VERSION >= 0x020100)) try { vpImage<unsigned char> I; -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vp1394TwoGrabber g(false); #elif defined(VISP_HAVE_CMU1394) vp1394CMUGrabber g; #elif defined(VISP_HAVE_V4L2) vpV4l2Grabber g; +#elif defined(VISP_HAVE_OPENCV) + cv::VideoCapture g(0); // open the default camera + if(!g.isOpened()) { // check if we succeeded + std::cout << "Failed to open the camera" << std::endl; + return -1; + } + cv::Mat frame; #endif - g.open(I); + +#if defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) g.acquire(I); +#elif defined(VISP_HAVE_OPENCV) + g >> frame; // get a new frame from camera + vpImageConvert::convert(frame, I); +#endif #if defined(VISP_HAVE_X11) vpDisplayX d(I, 0, 0, "Camera view"); @@ -47,7 +62,12 @@ int main() ellipse.initTracking(I); while(1) { +#if defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) g.acquire(I); +#elif defined(VISP_HAVE_OPENCV) + g >> frame; + vpImageConvert::convert(frame, I); +#endif vpDisplay::display(I); ellipse.track(I); ellipse.display(I, vpColor::red); diff --git a/tutorial/tracking/moving-edges/tutorial-me-line-tracker.cpp b/tutorial/tracking/moving-edges/tutorial-me-line-tracker.cpp index 5c6657edb7ed1a6f271acd209c9801f8d9d27da4..783192b1cebea39203c0819fa315e1a8bb9b5b9b 100644 --- a/tutorial/tracking/moving-edges/tutorial-me-line-tracker.cpp +++ b/tutorial/tracking/moving-edges/tutorial-me-line-tracker.cpp @@ -1,24 +1,36 @@ /*! \example tutorial-me-line-tracker.cpp */ -#include <visp/vp1394CMUGrabber.h> -#include <visp/vp1394TwoGrabber.h> -#include <visp/vpV4l2Grabber.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpMeLine.h> +#include <visp3/core/vpConfig.h> +#ifdef VISP_HAVE_MODULE_SENSOR +#include <visp3/sensor/vp1394CMUGrabber.h> +#include <visp3/sensor/vp1394TwoGrabber.h> +#include <visp3/sensor/vpV4l2Grabber.h> +#endif +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/me/vpMeLine.h> int main() { -#if (defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_CMU1394) || defined(VISP_HAVE_V4L2)) +#if (defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_CMU1394) || defined(VISP_HAVE_V4L2)) try { vpImage<unsigned char> I; -#if defined(VISP_HAVE_DC1394_2) +#if defined(VISP_HAVE_DC1394) vp1394TwoGrabber g(false); #elif defined(VISP_HAVE_CMU1394) vp1394CMUGrabber g; #elif defined(VISP_HAVE_V4L2) vpV4l2Grabber g; +#elif defined(VISP_HAVE_OPENCV) + cv::VideoCapture g(0); // open the default camera + if(!g.isOpened()) { // check if we succeeded + std::cout << "Failed to open the camera" << std::endl; + return -1; + } + cv::Mat frame; + g >> frame; // get a new frame from camera + vpImageConvert::convert(frame, I); #endif g.open(I); g.acquire(I); @@ -47,7 +59,12 @@ int main() line.initTracking(I); while(1) { +#if defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) g.acquire(I); +#elif defined(VISP_HAVE_OPENCV) + g >> frame; + vpImageConvert::convert(frame, I); +#endif vpDisplay::display(I); line.track(I); line.display(I, vpColor::red); diff --git a/tutorial/tracking/template-tracker/CMakeLists.txt b/tutorial/tracking/template-tracker/CMakeLists.txt index d2b69576da54202d6bc665d4e656586ca3b3dee5..68f470a384f4f44144bdf2a1115151ab5968049f 100644 --- a/tutorial/tracking/template-tracker/CMakeLists.txt +++ b/tutorial/tracking/template-tracker/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-tracking-template) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_tt visp_io visp_gui) # set the list of source files set(tutorial_cpp diff --git a/tutorial/tracking/template-tracker/tutorial-template-tracker.cpp b/tutorial/tracking/template-tracker/tutorial-template-tracker.cpp index 921e5622399153dae088a0d70f4e7286c399a805..63d64ed996dadb69903bae97dfd90a7c6047a311 100644 --- a/tutorial/tracking/template-tracker/tutorial-template-tracker.cpp +++ b/tutorial/tracking/template-tracker/tutorial-template-tracker.cpp @@ -1,11 +1,11 @@ /*! \example tutorial-template-tracker.cpp */ -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpVideoReader.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/io/vpVideoReader.h> //! [Include] -#include <visp/vpTemplateTrackerSSDInverseCompositional.h> -#include <visp/vpTemplateTrackerWarpHomography.h> +#include <visp3/tt/vpTemplateTrackerSSDInverseCompositional.h> +#include <visp3/tt/vpTemplateTrackerWarpHomography.h> //! [Include] int main(int argc, char** argv) diff --git a/tutorial/visual-servo/ibvs/CMakeLists.txt b/tutorial/visual-servo/ibvs/CMakeLists.txt index 06edb2c835322fd7609f693a11867d737a3fde72..3a710924eecc92853d5f26cddc2459a98d256dde 100644 --- a/tutorial/visual-servo/ibvs/CMakeLists.txt +++ b/tutorial/visual-servo/ibvs/CMakeLists.txt @@ -2,7 +2,7 @@ project(tutorial-visual-servo-ibvs) cmake_minimum_required(VERSION 2.6) -find_package(VISP REQUIRED) +find_package(VISP REQUIRED visp_core visp_robot visp_vs visp_blob visp_vision visp_io visp_gui) # set the list of source files set(tutorial_cpp diff --git a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-display.cpp b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-display.cpp index ccae30d6d32ad59bcd4bdd9aa94c21009ad33a89..1f29b19f2db2a9712509af265d188852d1b8ac54 100644 --- a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-display.cpp +++ b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-display.cpp @@ -1,12 +1,12 @@ /*! \example tutorial-ibvs-4pts-display.cpp */ -#include <visp/vpFeatureBuilder.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpProjectionDisplay.h> -#include <visp/vpServoDisplay.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpProjectionDisplay.h> +#include <visp3/vs/vpServoDisplay.h> void display_trajectory(const vpImage<unsigned char> &I, std::vector<vpPoint> &point, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam); @@ -36,11 +36,11 @@ int main() vpHomogeneousMatrix cMo(0.15, -0.1, 1., vpMath::rad(10), vpMath::rad(-10), vpMath::rad(50)); - std::vector<vpPoint> point(4) ; - point[0].setWorldCoordinates(-0.1,-0.1, 0); - point[1].setWorldCoordinates( 0.1,-0.1, 0); - point[2].setWorldCoordinates( 0.1, 0.1, 0); - point[3].setWorldCoordinates(-0.1, 0.1, 0); + std::vector<vpPoint> point; + point.push_back( vpPoint(-0.1,-0.1, 0) ); + point.push_back( vpPoint( 0.1,-0.1, 0) ); + point.push_back( vpPoint( 0.1, 0.1, 0) ); + point.push_back( vpPoint(-0.1, 0.1, 0) ); vpServo task ; task.setServo(vpServo::EYEINHAND_CAMERA); diff --git a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-image-tracking.cpp b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-image-tracking.cpp index 09ac68f4b2455d150a44f495973058460f271c4f..0359ce9c261ee9ea2f21b9a11120a500e376b556 100644 --- a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-image-tracking.cpp +++ b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-image-tracking.cpp @@ -1,13 +1,13 @@ /*! \example tutorial-ibvs-4pts-image-tracking.cpp */ -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpImageIo.h> -#include <visp/vpImageSimulator.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/io/vpImageIo.h> +#include <visp3/robot/vpImageSimulator.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/robot/vpSimulatorCamera.h> void display_trajectory(const vpImage<unsigned char> &I, const std::vector<vpDot2> &dot); @@ -90,11 +90,11 @@ int main() vpImage<unsigned char> I(480, 640, 255); vpCameraParameters cam(840, 840, I.getWidth()/2, I.getHeight()/2); - std::vector<vpPoint> point(4) ; - point[0].setWorldCoordinates(-0.1,-0.1, 0); - point[1].setWorldCoordinates( 0.1,-0.1, 0); - point[2].setWorldCoordinates( 0.1, 0.1, 0); - point[3].setWorldCoordinates(-0.1, 0.1, 0); + std::vector<vpPoint> point; + point.push_back( vpPoint(-0.1,-0.1, 0) ); + point.push_back( vpPoint( 0.1,-0.1, 0) ); + point.push_back( vpPoint( 0.1, 0.1, 0) ); + point.push_back( vpPoint(-0.1, 0.1, 0) ); vpServo task ; task.setServo(vpServo::EYEINHAND_CAMERA); diff --git a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-ogre-tracking.cpp b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-ogre-tracking.cpp index 2253fb2581979c37203bfd171bf3d94b0b3f1267..8ce12138edc8674d5f2604ddf1e5a88737740b51 100644 --- a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-ogre-tracking.cpp +++ b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-ogre-tracking.cpp @@ -1,13 +1,17 @@ /*! \example tutorial-ibvs-4pts-ogre-tracking.cpp */ -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpAROgre.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpPose.h> -#include <visp/vpServo.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/core/vpConfig.h> +#ifdef VISP_HAVE_MODULE_AR +#include <visp3/ar/vpAROgre.h> +#endif +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/vision/vpPose.h> +#include <visp3/vs/vpServo.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/blob/vpDot2.h> void display_trajectory(const vpImage<unsigned char> &I, const std::vector<vpDot2> &dot, unsigned int thickness); #if defined(VISP_HAVE_OGRE) @@ -58,11 +62,11 @@ int main() vpCameraParameters cam(840, 840, background.getWidth()/2, background.getHeight()/2); // Define the target as 4 points - std::vector<vpPoint> point(4) ; - point[0].setWorldCoordinates(-0.1,-0.1, 0); - point[1].setWorldCoordinates( 0.1,-0.1, 0); - point[2].setWorldCoordinates( 0.1, 0.1, 0); - point[3].setWorldCoordinates(-0.1, 0.1, 0); + std::vector<vpPoint> point; + point.push_back( vpPoint(-0.1,-0.1, 0) ); + point.push_back( vpPoint( 0.1,-0.1, 0) ); + point.push_back( vpPoint( 0.1, 0.1, 0) ); + point.push_back( vpPoint(-0.1, 0.1, 0) ); // Our object // A simulator with the camera parameters defined above, diff --git a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-ogre.cpp b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-ogre.cpp index 0328d7aea020de3b551b8fa3c4d102dcfe8c17ab..37f3b3554572c73d9fd16756e0ecc660371b529a 100644 --- a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-ogre.cpp +++ b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-ogre.cpp @@ -1,9 +1,11 @@ /*! \example tutorial-ibvs-4pts-ogre.cpp */ - -#include <visp/vpAROgre.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/core/vpConfig.h> +#ifdef VISP_HAVE_MODULE_AR +#include <visp3/ar/vpAROgre.h> +#endif +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> int main() { diff --git a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp index beef4d088ad28ce69a86b86c58d41949dd9b50ae..30ba49f58e8e5cbc4479fc4bee13f485fa48dafd 100644 --- a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp +++ b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp @@ -1,8 +1,8 @@ /*! \example tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp */ -#include <visp/vpFeatureBuilder.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> -#include <visp/vpPlot.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/gui/vpPlot.h> int main() { diff --git a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-plotter-gain-adaptive.cpp b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-plotter-gain-adaptive.cpp index d3d0a7b806d3a7bd27eb004c93c48eed4a1cfd2a..7789b6166e23a35bfa19798b26acb5676d196921 100644 --- a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-plotter-gain-adaptive.cpp +++ b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-plotter-gain-adaptive.cpp @@ -1,8 +1,8 @@ /*! \example tutorial-ibvs-4pts-plotter-gain-adaptive.cpp */ -#include <visp/vpFeatureBuilder.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> -#include <visp/vpPlot.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/gui/vpPlot.h> int main() { diff --git a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-plotter.cpp b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-plotter.cpp index df01839ddb190d6b5ed8da353f9d496460a97792..fad7a47d786535fa82097ccb6510969582920945 100644 --- a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-plotter.cpp +++ b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-plotter.cpp @@ -1,8 +1,8 @@ /*! \example tutorial-ibvs-4pts-plotter.cpp */ -#include <visp/vpFeatureBuilder.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> -#include <visp/vpPlot.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/gui/vpPlot.h> int main() { diff --git a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-wireframe-camera.cpp b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-wireframe-camera.cpp index 5378468a66a2e054367e62160c4a95cbfa160308..ecd0689723aabcd953dc491537b14dc58f9e5ccc 100644 --- a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-wireframe-camera.cpp +++ b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-wireframe-camera.cpp @@ -1,13 +1,13 @@ /*! \example tutorial-ibvs-4pts-wireframe-camera.cpp */ -#include <visp/vpFeatureBuilder.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> -#include <visp/vpDisplayX.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayGDI.h> -#include <visp/vpProjectionDisplay.h> -#include <visp/vpServoDisplay.h> -#include <visp/vpWireFrameSimulator.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpProjectionDisplay.h> +#include <visp3/vs/vpServoDisplay.h> +#include <visp3/robot/vpWireFrameSimulator.h> void display_trajectory(const vpImage<unsigned char> &I, std::vector<vpPoint> &point, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam); diff --git a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-wireframe-robot-afma6.cpp b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-wireframe-robot-afma6.cpp index 016b07c1f24f80b720d94f14c8351f1c5065fc13..8039778aadc1e675ef1d114f31342d45e478593e 100644 --- a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-wireframe-robot-afma6.cpp +++ b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-wireframe-robot-afma6.cpp @@ -1,10 +1,10 @@ /*! \example tutorial-ibvs-4pts-wireframe-robot-afma6.cpp */ -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorAfma6.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorAfma6.h> void display_trajectory(const vpImage<unsigned char> &I, std::vector<vpPoint> &point, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam); @@ -60,11 +60,11 @@ int main() */ vpHomogeneousMatrix wMo(0, 0, 1., 0, 0, 0); - std::vector<vpPoint> point(4) ; - point[0].setWorldCoordinates(-0.1,-0.1, 0); - point[1].setWorldCoordinates( 0.1,-0.1, 0); - point[2].setWorldCoordinates( 0.1, 0.1, 0); - point[3].setWorldCoordinates(-0.1, 0.1, 0); + std::vector<vpPoint> point; + point.push_back( vpPoint(-0.1,-0.1, 0) ); + point.push_back( vpPoint( 0.1,-0.1, 0) ); + point.push_back( vpPoint( 0.1, 0.1, 0) ); + point.push_back( vpPoint(-0.1, 0.1, 0) ); vpServo task ; task.setServo(vpServo::EYEINHAND_CAMERA); diff --git a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-wireframe-robot-viper.cpp b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-wireframe-robot-viper.cpp index adb8ade575dffb1e80aa01e66112a317162816e8..3cfd6ab9acd91000af35ae4a38191670097ea315 100644 --- a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-wireframe-robot-viper.cpp +++ b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts-wireframe-robot-viper.cpp @@ -1,10 +1,10 @@ /*! \example tutorial-ibvs-4pts-wireframe-robot-viper.cpp */ -#include <visp/vpDisplayGDI.h> -#include <visp/vpDisplayOpenCV.h> -#include <visp/vpDisplayX.h> -#include <visp/vpFeatureBuilder.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorViper850.h> +#include <visp3/gui/vpDisplayGDI.h> +#include <visp3/gui/vpDisplayOpenCV.h> +#include <visp3/gui/vpDisplayX.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorViper850.h> void display_trajectory(const vpImage<unsigned char> &I, std::vector<vpPoint> &point, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam); @@ -60,11 +60,11 @@ int main() vpHomogeneousMatrix wMo(vpTranslationVector(0.40, 0, -0.15), vpRotationMatrix(vpRxyzVector(-M_PI, 0, M_PI/2.))); - std::vector<vpPoint> point(4) ; - point[0].setWorldCoordinates(-0.1,-0.1, 0); - point[1].setWorldCoordinates( 0.1,-0.1, 0); - point[2].setWorldCoordinates( 0.1, 0.1, 0); - point[3].setWorldCoordinates(-0.1, 0.1, 0); + std::vector<vpPoint> point; + point.push_back( vpPoint(-0.1,-0.1, 0) ); + point.push_back( vpPoint( 0.1,-0.1, 0) ); + point.push_back( vpPoint( 0.1, 0.1, 0) ); + point.push_back( vpPoint(-0.1, 0.1, 0) ); vpServo task ; task.setServo(vpServo::EYEINHAND_CAMERA); diff --git a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts.cpp b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts.cpp index 1d676a727b8daced0d6740b3a4a1a129eb1d3a5f..b041086621a5c1ccc964890341c768effca99575 100644 --- a/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts.cpp +++ b/tutorial/visual-servo/ibvs/tutorial-ibvs-4pts.cpp @@ -1,7 +1,7 @@ /*! \example tutorial-ibvs-4pts.cpp */ -#include <visp/vpFeatureBuilder.h> -#include <visp/vpServo.h> -#include <visp/vpSimulatorCamera.h> +#include <visp3/visual_features/vpFeatureBuilder.h> +#include <visp3/vs/vpServo.h> +#include <visp3/robot/vpSimulatorCamera.h> int main() {