merged the trunk r8704:8716
authorMarina Kolpakova <no@email>
Thu, 28 Jun 2012 16:13:29 +0000 (16:13 +0000)
committerMarina Kolpakova <no@email>
Thu, 28 Jun 2012 16:13:29 +0000 (16:13 +0000)
83 files changed:
3rdparty/libjasper/CMakeLists.txt
3rdparty/libjpeg/CMakeLists.txt
3rdparty/libtiff/CMakeLists.txt
apps/traincascade/features.cpp
cmake/OpenCVCompilerOptions.cmake
cmake/OpenCVConfig.cmake
cmake/OpenCVUtils.cmake
modules/androidcamera/src/camera_activity.cpp
modules/contrib/include/opencv2/contrib/hybridtracker.hpp
modules/contrib/src/basicretinafilter.cpp
modules/contrib/src/basicretinafilter.hpp
modules/contrib/src/hybridtracker.cpp
modules/contrib/src/imagelogpolprojection.hpp
modules/contrib/src/inputoutput.cpp
modules/contrib/src/magnoretinafilter.hpp
modules/contrib/src/parvoretinafilter.hpp
modules/contrib/src/retinacolor.cpp
modules/contrib/src/retinacolor.hpp
modules/contrib/src/retinafilter.cpp
modules/contrib/src/retinafilter.hpp
modules/contrib/src/templatebuffer.hpp
modules/core/src/persistence.cpp
modules/core/src/precomp.hpp
modules/flann/include/opencv2/flann/any.h
modules/flann/src/flann.cpp
modules/gpu/CMakeLists.txt
modules/gpu/src/arithm.cpp
modules/gpu/src/cuda/bf_knnmatch.cu
modules/gpu/src/cuda/bf_match.cu
modules/gpu/src/cuda/bf_radius_match.cu
modules/gpu/src/cuda/hog.cu
modules/gpu/src/cuda/remap.cu
modules/gpu/src/cuda/resize.cu
modules/gpu/src/cuda/warp.cu
modules/gpu/src/nvidia/NCVBroxOpticalFlow.cu
modules/gpu/src/nvidia/NCVHaarObjectDetection.cu
modules/gpu/src/nvidia/core/NCV.cu
modules/gpu/src/nvidia/core/NCV.hpp
modules/gpu/src/nvidia/core/NCVRuntimeTemplates.hpp
modules/gpu/src/opencv2/gpu/device/filters.hpp
modules/gpu/src/opencv2/gpu/device/functional.hpp
modules/gpu/src/resize.cpp
modules/gpu/test/nvidia/TestHypothesesFilter.cpp
modules/gpu/test/nvidia/TestResize.cpp
modules/gpu/test/nvidia/main_nvidia.cpp
modules/gpu/test/test_nvidia.cpp
modules/highgui/src/grfmt_jpeg.cpp
modules/highgui/src/grfmt_png.cpp
modules/highgui/src/window.cpp
modules/java/CMakeLists.txt
modules/java/android_test/src/org/opencv/test/core/MatTest.java
modules/java/gen_java.py
modules/java/src/cpp/Mat.cpp
modules/java/src/cpp/VideoCapture.cpp
modules/java/src/cpp/jni_part.cpp
modules/java/src/cpp/utils.cpp
modules/java/src/java/core+Mat.java
modules/legacy/src/blobtrackanalysistrackdist.cpp
modules/legacy/src/calonder.cpp
modules/legacy/src/lee.cpp
modules/legacy/src/texture.cpp
modules/legacy/test/test_em.cpp
modules/ml/test/test_emknearestkmeans.cpp
modules/ml/test/test_mltests2.cpp
modules/objdetect/src/datamatrix.cpp
modules/python/src2/cv2.cpp
modules/stitching/perf/perf_stich.cpp
modules/stitching/src/blenders.cpp
modules/stitching/src/matchers.cpp
modules/ts/src/ts_func.cpp
samples/android/face-detection/jni/DetectionBasedTracker_jni.cpp
samples/android/hello-android/main.cpp
samples/android/tutorial-3-native/jni/jni_part.cpp
samples/android/tutorial-4-mixed/jni/jni_part.cpp
samples/c/blobtrack_sample.cpp
samples/c/contours.c
samples/c/delaunay.c
samples/c/fback_c.c
samples/c/morphology.c
samples/c/pyramid_segmentation.c
samples/cpp/stitching.cpp
samples/gpu/cascadeclassifier_nvidia_api.cpp
samples/gpu/opticalflow_nvidia_api.cpp

index 2c98a23..ab505d5 100644 (file)
@@ -23,7 +23,7 @@ if(MSVC)
   add_definitions(-DJAS_WIN_MSVC_BUILD)
 endif()
 
-ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes -Wmissing-declarations -Wunused -Wshadow
+ocv_warnings_disable(CMAKE_C_FLAGS -Wno-implicit-function-declaration -Wno-uninitialized -Wmissing-prototypes -Wmissing-declarations -Wunused -Wshadow -Wsign-compare
                                    /wd4013 /wd4018 /wd4715 /wd4244 /wd4101 /wd4267)
 
 if(UNIX)
index be2b417..46eaab1 100644 (file)
@@ -25,7 +25,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
   set_source_files_properties(jcdctmgr.c PROPERTIES COMPILE_FLAGS "-O1")
 endif()
 
-ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align -Wshadow)
+ocv_warnings_disable(CMAKE_C_FLAGS -Wcast-align -Wshadow -Wunused)
 
 set_target_properties(${JPEG_LIBRARY}
   PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY}
index 69dd5ff..991df08 100644 (file)
@@ -81,18 +81,15 @@ set(lib_srcs
 
 if(UNIX)
   list(APPEND lib_srcs tif_unix.c)
-  if(CMAKE_COMPILER_IS_GNUCXX AND NOT ENABLE_NOISY_WARNINGS)
-    set_source_files_properties(tif_unix.c PROPERTIES COMPILE_FLAGS "-w")
-  endif()
 endif()
 
 if(WIN32)
   list(APPEND lib_srcs tif_win32.c)
 endif(WIN32)
 
-ocv_warnings_disable(CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-prototypes -Wmissing-declarations -Wundef
+ocv_warnings_disable(CMAKE_C_FLAGS -Wno-unused-but-set-variable -Wmissing-prototypes -Wmissing-declarations -Wundef -Wunused -Wsign-compare
                                    -Wcast-align -Wshadow -Wno-maybe-uninitialized -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast)
-ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations /wd4100 /wd4244 /wd4706 /wd4127 /wd4701 /wd4018 /wd4267 /wd4306 /wd4305 /wd4312 /wd4311)
+ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations -Wunused-parameter /wd4100 /wd4244 /wd4706 /wd4127 /wd4701 /wd4018 /wd4267 /wd4306 /wd4305 /wd4312 /wd4311)
 
 if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR CV_ICC))
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
index 8ecdfcc..effa4dc 100644 (file)
@@ -24,7 +24,7 @@ CvParams::CvParams() : name( "params" ) {}
 void CvParams::printDefaults() const
 { cout << "--" << name << "--" << endl; }
 void CvParams::printAttrs() const {}
-bool CvParams::scanAttr( const String prmName, const String val ) { return false; }
+bool CvParams::scanAttr( const String, const String ) { return false; }
 
 
 //---------------------------- FeatureParams --------------------------------------
index dc74aa7..a09be72 100644 (file)
@@ -62,6 +62,7 @@ endif()
 
 if(CMAKE_COMPILER_IS_GNUCXX)
   # High level of warnings.
+  add_extra_compiler_option(-W)
   add_extra_compiler_option(-Wall)
   add_extra_compiler_option(-Werror=return-type)
   if(OPENCV_CAN_BREAK_BINARY_COMPATIBILITY)
@@ -78,6 +79,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
   add_extra_compiler_option(-Winit-self)
   add_extra_compiler_option(-Wpointer-arith)
   add_extra_compiler_option(-Wshadow)
+  add_extra_compiler_option(-Wsign-promo)
 
   if(ENABLE_NOISY_WARNINGS)
     add_extra_compiler_option(-Wcast-align)
@@ -87,6 +89,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
     add_extra_compiler_option(-Wno-delete-non-virtual-dtor)
     add_extra_compiler_option(-Wno-unnamed-type-template-args)
   endif()
+  add_extra_compiler_option(-fdiagnostics-show-option)
 
   # The -Wno-long-long is required in 64bit systems when including sytem headers.
   if(X86_64)
index cb055cf..0b29ced 100644 (file)
 #    Advanced variables:
 #      - OpenCV_SHARED
 #      - OpenCV_CONFIG_PATH
-#      - OpenCV_INSTALL_PATH  (not set on Windows)
 #      - OpenCV_LIB_COMPONENTS
-#      - OpenCV_USE_MANGLED_PATHS
-#      - OpenCV_HAVE_ANDROID_CAMERA
 #
 # ===================================================================================
 #
 #      - OpenCV_STATIC
 #      - OpenCV_CUDA
 
+if(CMAKE_VERSION VERSION_GREATER 2.6)
+  get_property(OpenCV_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
+  if(NOT ";${OpenCV_LANGUAGES};" MATCHES ";CXX;")
+    enable_language(CXX)
+  endif()
+endif()
+
 if(NOT DEFINED OpenCV_STATIC)
   # look for global setting
   if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
index 8c20906..8698024 100644 (file)
@@ -34,6 +34,7 @@ endmacro()
 
 set(OCV_COMPILER_FAIL_REGEX
     "command line option .* is valid for .* but not for C\\+\\+" # GNU
+    "command line option .* is valid for .* but not for C" # GNU
     "unrecognized .*option"                     # GNU
     "unknown .*option"                          # Clang
     "ignoring unknown option"                   # MSVC
index 6c77a3a..23b39a1 100644 (file)
@@ -340,7 +340,7 @@ CameraActivity::~CameraActivity()
         disconnect();
 }
 
-bool CameraActivity::onFrameBuffer(void* buffer, int bufferSize)
+bool CameraActivity::onFrameBuffer(void* /*buffer*/, int /*bufferSize*/)
 {
     LOGD("CameraActivity::onFrameBuffer - empty callback");
     return true;
index 418a7b8..3a1f722 100644 (file)
@@ -59,151 +59,151 @@ namespace cv
 // To add Kalman filter
 struct CV_EXPORTS CvMotionModel
 {
-       enum {LOW_PASS_FILTER = 0, KALMAN_FILTER = 1, EM = 2};
+    enum {LOW_PASS_FILTER = 0, KALMAN_FILTER = 1, EM = 2};
 
-       CvMotionModel()
-       {
-       }
+    CvMotionModel()
+    {
+    }
 
-       float low_pass_gain;    // low pass gain
+    float low_pass_gain;    // low pass gain
 };
 
 // Mean Shift Tracker parameters for specifying use of HSV channel and CamShift parameters.
 struct CV_EXPORTS CvMeanShiftTrackerParams
 {
-       enum {  H = 0, HS = 1, HSV = 2  };
-       CvMeanShiftTrackerParams(int tracking_type = CvMeanShiftTrackerParams::HS,
-                       CvTermCriteria term_crit = CvTermCriteria());
-
-       int tracking_type;
-       vector<float> h_range;
-       vector<float> s_range;
-       vector<float> v_range;
-       CvTermCriteria term_crit;
+    enum {  H = 0, HS = 1, HSV = 2  };
+    CvMeanShiftTrackerParams(int tracking_type = CvMeanShiftTrackerParams::HS,
+            CvTermCriteria term_crit = CvTermCriteria());
+
+    int tracking_type;
+    vector<float> h_range;
+    vector<float> s_range;
+    vector<float> v_range;
+    CvTermCriteria term_crit;
 };
 
 // Feature tracking parameters
 struct CV_EXPORTS CvFeatureTrackerParams
 {
-       enum {  SIFT = 0, SURF = 1, OPTICAL_FLOW = 2 };
-       CvFeatureTrackerParams(int featureType = 0, int windowSize = 0)
-       {
-               featureType = 0;
-               windowSize = 0;
-       }
-
-       int feature_type; // Feature type to use
-       int window_size; // Window size in pixels around which to search for new window
+    enum {  SIFT = 0, SURF = 1, OPTICAL_FLOW = 2 };
+    CvFeatureTrackerParams(int featureType = 0, int windowSize = 0)
+    {
+        feature_type = featureType;
+        window_size = windowSize;
+    }
+
+    int feature_type; // Feature type to use
+    int window_size; // Window size in pixels around which to search for new window
 };
 
 // Hybrid Tracking parameters for specifying weights of individual trackers and motion model.
 struct CV_EXPORTS CvHybridTrackerParams
 {
-       CvHybridTrackerParams(float ft_tracker_weight = 0.5, float ms_tracker_weight = 0.5,
-                       CvFeatureTrackerParams ft_params = CvFeatureTrackerParams(),
-                       CvMeanShiftTrackerParams ms_params = CvMeanShiftTrackerParams(),
-                       CvMotionModel model = CvMotionModel());
-
-       float ft_tracker_weight;
-       float ms_tracker_weight;
-       CvFeatureTrackerParams ft_params;
-       CvMeanShiftTrackerParams ms_params;
-       int motion_model;
-       float low_pass_gain;
+    CvHybridTrackerParams(float ft_tracker_weight = 0.5, float ms_tracker_weight = 0.5,
+            CvFeatureTrackerParams ft_params = CvFeatureTrackerParams(),
+            CvMeanShiftTrackerParams ms_params = CvMeanShiftTrackerParams(),
+            CvMotionModel model = CvMotionModel());
+
+    float ft_tracker_weight;
+    float ms_tracker_weight;
+    CvFeatureTrackerParams ft_params;
+    CvMeanShiftTrackerParams ms_params;
+    int motion_model;
+    float low_pass_gain;
 };
 
 // Performs Camshift using parameters from MeanShiftTrackerParams
 class CV_EXPORTS CvMeanShiftTracker
 {
 private:
-       Mat hsv, hue;
-       Mat backproj;
-       Mat mask, maskroi;
-       MatND hist;
-       Rect prev_trackwindow;
-       RotatedRect prev_trackbox;
-       Point2f prev_center;
+    Mat hsv, hue;
+    Mat backproj;
+    Mat mask, maskroi;
+    MatND hist;
+    Rect prev_trackwindow;
+    RotatedRect prev_trackbox;
+    Point2f prev_center;
 
 public:
-       CvMeanShiftTrackerParams params;
-
-       CvMeanShiftTracker();
-       explicit CvMeanShiftTracker(CvMeanShiftTrackerParams _params);
-       ~CvMeanShiftTracker();
-       void newTrackingWindow(Mat image, Rect selection);
-       RotatedRect updateTrackingWindow(Mat image);
-       Mat getHistogramProjection(int type);
-       void setTrackingWindow(Rect _window);
-       Rect getTrackingWindow();
-       RotatedRect getTrackingEllipse();
-       Point2f getTrackingCenter();
+    CvMeanShiftTrackerParams params;
+
+    CvMeanShiftTracker();
+    explicit CvMeanShiftTracker(CvMeanShiftTrackerParams _params);
+    ~CvMeanShiftTracker();
+    void newTrackingWindow(Mat image, Rect selection);
+    RotatedRect updateTrackingWindow(Mat image);
+    Mat getHistogramProjection(int type);
+    void setTrackingWindow(Rect _window);
+    Rect getTrackingWindow();
+    RotatedRect getTrackingEllipse();
+    Point2f getTrackingCenter();
 };
 
 // Performs SIFT/SURF feature tracking using parameters from FeatureTrackerParams
 class CV_EXPORTS CvFeatureTracker
 {
 private:
-       Ptr<Feature2D> dd;
-       Ptr<DescriptorMatcher> matcher;
-       vector<DMatch> matches;
+    Ptr<Feature2D> dd;
+    Ptr<DescriptorMatcher> matcher;
+    vector<DMatch> matches;
 
-       Mat prev_image;
-       Mat prev_image_bw;
-       Rect prev_trackwindow;
-       Point2d prev_center;
+    Mat prev_image;
+    Mat prev_image_bw;
+    Rect prev_trackwindow;
+    Point2d prev_center;
 
-       int ittr;
-       vector<Point2f> features[2];
+    int ittr;
+    vector<Point2f> features[2];
 
 public:
-       Mat disp_matches;
-       CvFeatureTrackerParams params;
-
-       CvFeatureTracker();
-       explicit CvFeatureTracker(CvFeatureTrackerParams params);
-       ~CvFeatureTracker();
-       void newTrackingWindow(Mat image, Rect selection);
-       Rect updateTrackingWindow(Mat image);
-       Rect updateTrackingWindowWithSIFT(Mat image);
-       Rect updateTrackingWindowWithFlow(Mat image);
-       void setTrackingWindow(Rect _window);
-       Rect getTrackingWindow();
-       Point2f getTrackingCenter();
+    Mat disp_matches;
+    CvFeatureTrackerParams params;
+
+    CvFeatureTracker();
+    explicit CvFeatureTracker(CvFeatureTrackerParams params);
+    ~CvFeatureTracker();
+    void newTrackingWindow(Mat image, Rect selection);
+    Rect updateTrackingWindow(Mat image);
+    Rect updateTrackingWindowWithSIFT(Mat image);
+    Rect updateTrackingWindowWithFlow(Mat image);
+    void setTrackingWindow(Rect _window);
+    Rect getTrackingWindow();
+    Point2f getTrackingCenter();
 };
 
 // Performs Hybrid Tracking and combines individual trackers using EM or filters
 class CV_EXPORTS CvHybridTracker
 {
 private:
-       CvMeanShiftTracker* mstracker;
-       CvFeatureTracker* fttracker;
+    CvMeanShiftTracker* mstracker;
+    CvFeatureTracker* fttracker;
 
-       CvMat* samples;
-       CvMat* labels;
+    CvMat* samples;
+    CvMat* labels;
 
-       Rect prev_window;
-       Point2f prev_center;
-       Mat prev_proj;
-       RotatedRect trackbox;
+    Rect prev_window;
+    Point2f prev_center;
+    Mat prev_proj;
+    RotatedRect trackbox;
 
-       int ittr;
-       Point2f curr_center;
+    int ittr;
+    Point2f curr_center;
 
-       inline float getL2Norm(Point2f p1, Point2f p2);
-       Mat getDistanceProjection(Mat image, Point2f center);
-       Mat getGaussianProjection(Mat image, int ksize, double sigma, Point2f center);
-       void updateTrackerWithEM(Mat image);
-       void updateTrackerWithLowPassFilter(Mat image);
+    inline float getL2Norm(Point2f p1, Point2f p2);
+    Mat getDistanceProjection(Mat image, Point2f center);
+    Mat getGaussianProjection(Mat image, int ksize, double sigma, Point2f center);
+    void updateTrackerWithEM(Mat image);
+    void updateTrackerWithLowPassFilter(Mat image);
 
 public:
-       CvHybridTrackerParams params;
-       CvHybridTracker();
-       explicit CvHybridTracker(CvHybridTrackerParams params);
-       ~CvHybridTracker();
-
-       void newTracker(Mat image, Rect selection);
-       void updateTracker(Mat image);
-       Rect getTrackingWindow();
+    CvHybridTrackerParams params;
+    CvHybridTracker();
+    explicit CvHybridTracker(CvHybridTrackerParams params);
+    ~CvHybridTracker();
+
+    void newTracker(Mat image, Rect selection);
+    void updateTracker(Mat image);
+    Rect getTrackingWindow();
 };
 
 typedef CvMotionModel MotionModel;
index e49e9d8..06320f8 100644 (file)
@@ -426,7 +426,7 @@ void BasicRetinaFilter::_spatiotemporalLPfilter(const float *inputFrame, float *
 }
 
 // run SQUARING LP filter for a new frame input and save result at a specific output adress
-const float BasicRetinaFilter::_squaringSpatiotemporalLPfilter(const float *inputFrame, float *outputFrame, const unsigned int filterIndex)
+float BasicRetinaFilter::_squaringSpatiotemporalLPfilter(const float *inputFrame, float *outputFrame, const unsigned int filterIndex)
 {
        unsigned int coefTableOffset=filterIndex*3;
        /**********/
@@ -597,7 +597,7 @@ void BasicRetinaFilter::_squaringHorizontalCausalFilter(const float *inputFrame,
 }
 
 //  vertical anticausal filter that returns the mean value of its result
-const float BasicRetinaFilter::_verticalAnticausalFilter_returnMeanValue(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd)
+float BasicRetinaFilter::_verticalAnticausalFilter_returnMeanValue(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd)
 {
        register float meanValue=0;
        float* offset=outputFrame+_filterOutput.getNBpixels()-_filterOutput.getNBcolumns();
index 481ad2b..a8f61f1 100644 (file)
@@ -1,55 +1,55 @@
 /*#******************************************************************************
 ** IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-** 
+**
 ** By downloading, copying, installing or using the software you agree to this license.
 ** If you do not agree to this license, do not download, install,
 ** copy or use the software.
-** 
-** 
+**
+**
 ** HVStools : interfaces allowing OpenCV users to integrate Human Vision System models. Presented models originate from Jeanny Herault's original research and have been reused and adapted by the author&collaborators for computed vision applications since his thesis with Alice Caplier at Gipsa-Lab.
 ** Use: extract still images & image sequences features, from contours details to motion spatio-temporal features, etc. for high level visual scene analysis. Also contribute to image enhancement/compression such as tone mapping.
-** 
+**
 ** Maintainers : Listic lab (code author current affiliation & applications) and Gipsa Lab (original research origins & applications)
-** 
+**
 **  Creation - enhancement process 2007-2011
 **      Author: Alexandre Benoit (benoit.alexandre.vision@gmail.com), LISTIC lab, Annecy le vieux, France
-** 
+**
 ** Theses algorithm have been developped by Alexandre BENOIT since his thesis with Alice Caplier at Gipsa-Lab (www.gipsa-lab.inpg.fr) and the research he pursues at LISTIC Lab (www.listic.univ-savoie.fr).
 ** Refer to the following research paper for more information:
 ** Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
 ** This work have been carried out thanks to Jeanny Herault who's research and great discussions are the basis of all this work, please take a look at his book:
 ** Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891.
-** 
+**
 ** The retina filter includes the research contributions of phd/research collegues from which code has been redrawn by the author :
 ** _take a look at the retinacolor.hpp module to discover Brice Chaix de Lavarene color mosaicing/demosaicing and the reference paper:
 ** ====> B. Chaix de Lavarene, D. Alleysson, B. Durette, J. Herault (2007). "Efficient demosaicing through recursive filtering", IEEE International Conference on Image Processing ICIP 2007
 ** _take a look at imagelogpolprojection.hpp to discover retina spatial log sampling which originates from Barthelemy Durette phd with Jeanny Herault. A Retina / V1 cortex projection is also proposed and originates from Jeanny's discussions.
 ** ====> more informations in the above cited Jeanny Heraults's book.
-** 
+**
 **                          License Agreement
 **               For Open Source Computer Vision Library
-** 
+**
 ** Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
 ** Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.
-** 
+**
 **               For Human Visual System tools (hvstools)
 ** Copyright (C) 2007-2011, LISTIC Lab, Annecy le Vieux and GIPSA Lab, Grenoble, France, all rights reserved.
-** 
+**
 ** Third party copyrights are property of their respective owners.
-** 
+**
 ** Redistribution and use in source and binary forms, with or without modification,
 ** are permitted provided that the following conditions are met:
-** 
+**
 ** * Redistributions of source code must retain the above copyright notice,
 **    this list of conditions and the following disclaimer.
-** 
+**
 ** * Redistributions in binary form must reproduce the above copyright notice,
 **    this list of conditions and the following disclaimer in the documentation
 **    and/or other materials provided with the distribution.
-** 
+**
 ** * The name of the copyright holders may not be used to endorse or promote products
 **    derived from this software without specific prior written permission.
-** 
+**
 ** This software is provided by the copyright holders and contributors "as is" and
 ** any express or implied warranties, including, but not limited to, the implied
 ** warranties of merchantability and fitness for a particular purpose are disclaimed.
 namespace cv
 {
 class BasicRetinaFilter
-{ 
+{
 public:
 
-       /**
-       * constructor of the base bio-inspired toolbox, parameters are only linked to imae input size and number of filtering capabilities of the object
-       * @param NBrows: number of rows of the input image
-       * @param NBcolumns: number of columns of the input image
-       * @param parametersListSize: specifies the number of parameters set (each parameters set represents a specific low pass spatio-temporal filter)
-       * @param useProgressiveFilter: specifies if the filter has irreguar (progressive) filtering capabilities (this can be activated later using setProgressiveFilterConstants_xxx methods)
-       */
-       BasicRetinaFilter(const unsigned int NBrows, const unsigned int NBcolumns, const unsigned int parametersListSize=1, const bool useProgressiveFilter=false);
-
-       /**
-       * standrad destructore
-       */
-       ~BasicRetinaFilter();
-
-       /**
-       * function which clears the output buffer of the object
-       */
-       inline void clearOutputBuffer(){_filterOutput=0;};
-
-       /**
-       * function which clears the secondary buffer of the object
-       */
-       inline void clearSecondaryBuffer(){_localBuffer=0;};
-
-       /**
-       * function which clears the output and the secondary buffer of the object
-       */
-       inline void clearAllBuffers(){clearOutputBuffer();clearSecondaryBuffer();};
-
-       /**
-       * resize basic retina filter object (resize all allocated buffers
-       * @param NBrows: the new height size
-       * @param NBcolumns: the new width size
-       */
-       void resize(const unsigned int NBrows, const unsigned int NBcolumns);
-
-       /**
-       * forbiden method inherited from parent std::valarray
-       * prefer not to use this method since the filter matrix become vectors
-       */
-       void resize(const unsigned int){std::cerr<<"error, not accessible method"<<std::endl;};
-
-       /**
-       *  low pass filter call and run (models the homogeneous cells network at the retina level, for example horizontal cells or photoreceptors)
-       * @param inputFrame: the input image to be processed
-       * @param filterIndex: the offset which specifies the parameter set that should be used for the filtering
-       * @return the processed image, the output is reachable later by using function getOutput()
-       */
-       const std::valarray<float> &runFilter_LPfilter(const std::valarray<float> &inputFrame, const unsigned int filterIndex=0); // run the LP filter for a new frame input and save result in _filterOutput
-
-       /**
-       * low pass filter call and run (models the homogeneous cells network at the retina level, for example horizontal cells or photoreceptors)
-       * @param inputFrame: the input image to be processed
-       * @param outputFrame: the output buffer in which the result is writed
-       * @param filterIndex: the offset which specifies the parameter set that should be used for the filtering
-       */
-       void runFilter_LPfilter(const std::valarray<float> &inputFrame, std::valarray<float> &outputFrame, const unsigned int filterIndex=0); // run LP filter on a specific output adress
-
-       /**
-       *  low pass filter call and run (models the homogeneous cells network at the retina level, for example horizontal cells or photoreceptors)
-       * @param inputOutputFrame: the input image to be processed on which the result is rewrited
-       * @param filterIndex: the offset which specifies the parameter set that should be used for the filtering
-       */
-       void runFilter_LPfilter_Autonomous(std::valarray<float> &inputOutputFrame, const unsigned int filterIndex=0);// run LP filter on the input data and rewrite it
-
-       /**
-       *  local luminance adaptation call and run (contrast enhancement property of the photoreceptors)
-       * @param inputOutputFrame: the input image to be processed
-       * @param localLuminance: an image which represents the local luminance of the inputFrame parameter, in general, it is its low pass spatial filtering
-       * @return the processed image, the output is reachable later by using function getOutput()
-       */
-       const std::valarray<float> &runFilter_LocalAdapdation(const std::valarray<float> &inputOutputFrame, const std::valarray<float> &localLuminance);// run local adaptation filter and save result in _filterOutput
-
-       /**
-       *  local luminance adaptation call and run (contrast enhancement property of the photoreceptors)
-       * @param inputFrame: the input image to be processed
-       * @param localLuminance: an image which represents the local luminance of the inputFrame parameter, in general, it is its low pass spatial filtering
-       * @param outputFrame: the output buffer in which the result is writed
-       */
-       void runFilter_LocalAdapdation(const std::valarray<float> &inputFrame, const std::valarray<float> &localLuminance, std::valarray<float> &outputFrame); // run local adaptation filter on a specific output adress
-
-       /**
-       *  local luminance adaptation call and run (contrast enhancement property of the photoreceptors)
-       * @param inputFrame: the input image to be processed
-       * @return the processed image, the output is reachable later by using function getOutput()
-       */
-       const std::valarray<float> &runFilter_LocalAdapdation_autonomous(const std::valarray<float> &inputFrame);// run local adaptation filter and save result in _filterOutput
-
-       /**
-       *  local luminance adaptation call and run (contrast enhancement property of the photoreceptors)
-       * @param inputFrame: the input image to be processed
-       * @param outputFrame: the output buffer in which the result is writen
-       */
-       void runFilter_LocalAdapdation_autonomous(const std::valarray<float> &inputFrame, std::valarray<float> &outputFrame); // run local adaptation filter on a specific output adress
-
-       /**
-       * run low pass filtering with progressive parameters (models the retina log sampling of the photoreceptors and its low pass filtering effect consequence: more powerfull low pass filtering effect on the corners)
-       * @param inputFrame: the input image to be processed
-       * @param filterIndex: the index which specifies the parameter set that should be used for the filtering
-       * @return the processed image, the output is reachable later by using function getOutput() if outputFrame is NULL
-       */
-       inline void runProgressiveFilter(std::valarray<float> &inputFrame, const unsigned int filterIndex=0){_spatiotemporalLPfilter_Irregular(&inputFrame[0], filterIndex);};
-
-       /**
-       * run low pass filtering with progressive parameters (models the retina log sampling of the photoreceptors and its low pass filtering effect consequence: more powerfull low pass filtering effect on the corners)
-       * @param inputFrame: the input image to be processed
-       * @param outputFrame: the output buffer in which the result is writen
-       * @param filterIndex: the index which specifies the parameter set that should be used for the filtering
-       */
-       inline void runProgressiveFilter(const std::valarray<float> &inputFrame,
-                                                                        std::valarray<float> &outputFrame,
-                                                                        const unsigned int filterIndex=0)
-       {_spatiotemporalLPfilter_Irregular(get_data(inputFrame), &outputFrame[0], filterIndex);};
-
-       /**
-       * first order spatio-temporal low pass filter setup function
-       * @param beta: gain of the filter (generally set to zero)
-       * @param tau: time constant of the filter (unit is frame for video processing)
-       * @param k: spatial constant of the filter (unit is pixels)
-       * @param filterIndex: the index which specifies the parameter set that should be used for the filtering
-       */
-       void setLPfilterParameters(const float beta, const float tau, const float k, const unsigned int filterIndex=0); // change the parameters of the filter
-
-       /**
-       * first order spatio-temporal low pass filter setup function
-       * @param beta: gain of the filter (generally set to zero)
-       * @param tau: time constant of the filter (unit is frame for video processing)
-       * @param alpha0: spatial constant of the filter (unit is pixels) on the border of the image
-       * @param filterIndex: the index which specifies the parameter set that should be used for the filtering
-       */
-       void setProgressiveFilterConstants_CentredAccuracy(const float beta, const float tau, const float alpha0, const unsigned int filterIndex=0);
-
-       /**
-       * first order spatio-temporal low pass filter setup function
-       * @param beta: gain of the filter (generally set to zero)
-       * @param tau: time constant of the filter (unit is frame for video processing)
-       * @param alpha0: spatial constant of the filter (unit is pixels) on the border of the image
-       * @param accuracyMap an image (float format) which values range is between 0 and 1, where 0 means, apply no filtering and 1 means apply the filtering as specified in the parameters set, intermediate values allow to smooth variations of the filtering strenght
-       * @param filterIndex: the index which specifies the parameter set that should be used for the filtering
-       */
-       void setProgressiveFilterConstants_CustomAccuracy(const float beta, const float tau, const float alpha0, const std::valarray<float> &accuracyMap, const unsigned int filterIndex=0);
-
-       /**
-       * local luminance adaptation setup, this function should be applied for normal local adaptation (not for tone mapping operation)
-       * @param v0: compression effect for the local luminance adaptation processing, set a value between 0.6 and 0.9 for best results, a high value yields to a high compression effect
-       * @param maxInputValue: the maximum amplitude value measured after local adaptation processing (c.f. function runFilter_LocalAdapdation & runFilter_LocalAdapdation_autonomous)
-       * @param meanLuminance: the a priori meann luminance of the input data (should be 128 for 8bits images but can vary greatly in case of High Dynamic Range Images (HDRI)
-       */
-       void setV0CompressionParameter(const float v0, const float maxInputValue, const float){ _v0=v0*maxInputValue; _localLuminanceFactor=v0; _localLuminanceAddon=maxInputValue*(1.0f-v0); _maxInputValue=maxInputValue;};
-
-       /**
-       * update local luminance adaptation setup, initial maxInputValue is kept. This function should be applied for normal local adaptation (not for tone mapping operation)
-       * @param v0: compression effect for the local luminance adaptation processing, set a value between 0.6 and 0.9 for best results, a high value yields to a high compression effect
-       * @param meanLuminance: the a priori meann luminance of the input data (should be 128 for 8bits images but can vary greatly in case of High Dynamic Range Images (HDRI)
-       */
-       void setV0CompressionParameter(const float v0, const float meanLuminance){ this->setV0CompressionParameter(v0, _maxInputValue, meanLuminance);};
-
-       /**
-       * local luminance adaptation setup, this function should be applied for normal local adaptation (not for tone mapping operation)
-       * @param v0: compression effect for the local luminance adaptation processing, set a value between 0.6 and 0.9 for best results, a high value yields to a high compression effect
-       */
-       void setV0CompressionParameter(const float v0){ _v0=v0*_maxInputValue; _localLuminanceFactor=v0; _localLuminanceAddon=_maxInputValue*(1.0f-v0);};
-
-       /**
-       * local luminance adaptation setup, this function should be applied for local adaptation applied to tone mapping operation
-       * @param v0: compression effect for the local luminance adaptation processing, set a value between 0.6 and 0.9 for best results, a high value yields to a high compression effect
-       * @param maxInputValue: the maximum amplitude value measured after local adaptation processing (c.f. function runFilter_LocalAdapdation & runFilter_LocalAdapdation_autonomous)
-       * @param meanLuminance: the a priori meann luminance of the input data (should be 128 for 8bits images but can vary greatly in case of High Dynamic Range Images (HDRI)
-       */
-       void setV0CompressionParameterToneMapping(const float v0, const float maxInputValue, const float meanLuminance=128.0f){ _v0=v0*maxInputValue; _localLuminanceFactor=1.0f; _localLuminanceAddon=meanLuminance*_v0; _maxInputValue=maxInputValue;};
-
-       /**
-       * update compression parameters while keeping v0 parameter value
-       * @param meanLuminance the input frame mean luminance
-       */
-       inline void updateCompressionParameter(const float meanLuminance){_localLuminanceFactor=1; _localLuminanceAddon=meanLuminance*_v0;};
-
-       /**
-       * @return the v0 compression parameter used to compute the local adaptation
-       */
-       const float getV0CompressionParameter(){ return _v0/_maxInputValue;};
-
-       /**
-       * @return the output result of the object
-       */
-       inline const std::valarray<float> &getOutput() const {return _filterOutput;};
-
-       /**
-       * @return number of rows of the filter
-       */
-       inline const unsigned int getNBrows(){return _filterOutput.getNBrows();};
-
-       /**
-       * @return number of columns of the filter
-       */
-       inline const unsigned int getNBcolumns(){return _filterOutput.getNBcolumns();};
-
-       /**
-       * @return number of pixels of the filter
-       */
-       inline const unsigned int getNBpixels(){return _filterOutput.getNBpixels();};
-
-       /**
-       * force filter output to be normalized between 0 and maxValue
-       * @param maxValue: the maximum output value that is required
-       */
-       inline void normalizeGrayOutput_0_maxOutputValue(const float maxValue){_filterOutput.normalizeGrayOutput_0_maxOutputValue(maxValue);};
-
-       /**
-       * force filter output to be normalized around 0 and rescaled with a sigmoide effect (extrem values saturation)
-       * @param maxValue: the maximum output value that is required
-       */
-       inline void normalizeGrayOutputCentredSigmoide(){_filterOutput.normalizeGrayOutputCentredSigmoide();};
-
-       /**
-       * force filter output to be normalized : data centering and std normalisation
-       * @param maxValue: the maximum output value that is required
-       */
-       inline void centerReductImageLuminance(){_filterOutput.centerReductImageLuminance();};
-
-       /**
-       * @return the maximum input buffer value
-       */
-       inline const float getMaxInputValue(){return this->_maxInputValue;};
-
-       /**
-       * @return the maximum input buffer value
-       */
-       inline void setMaxInputValue(const float newMaxInputValue){this->_maxInputValue=newMaxInputValue;};
+    /**
+    * constructor of the base bio-inspired toolbox, parameters are only linked to imae input size and number of filtering capabilities of the object
+    * @param NBrows: number of rows of the input image
+    * @param NBcolumns: number of columns of the input image
+    * @param parametersListSize: specifies the number of parameters set (each parameters set represents a specific low pass spatio-temporal filter)
+    * @param useProgressiveFilter: specifies if the filter has irreguar (progressive) filtering capabilities (this can be activated later using setProgressiveFilterConstants_xxx methods)
+    */
+    BasicRetinaFilter(const unsigned int NBrows, const unsigned int NBcolumns, const unsigned int parametersListSize=1, const bool useProgressiveFilter=false);
+
+    /**
+    * standrad destructore
+    */
+    ~BasicRetinaFilter();
+
+    /**
+    * function which clears the output buffer of the object
+    */
+    inline void clearOutputBuffer(){_filterOutput=0;};
+
+    /**
+    * function which clears the secondary buffer of the object
+    */
+    inline void clearSecondaryBuffer(){_localBuffer=0;};
+
+    /**
+    * function which clears the output and the secondary buffer of the object
+    */
+    inline void clearAllBuffers(){clearOutputBuffer();clearSecondaryBuffer();};
+
+    /**
+    * resize basic retina filter object (resize all allocated buffers
+    * @param NBrows: the new height size
+    * @param NBcolumns: the new width size
+    */
+    void resize(const unsigned int NBrows, const unsigned int NBcolumns);
+
+    /**
+    * forbiden method inherited from parent std::valarray
+    * prefer not to use this method since the filter matrix become vectors
+    */
+    void resize(const unsigned int){std::cerr<<"error, not accessible method"<<std::endl;};
+
+    /**
+    *  low pass filter call and run (models the homogeneous cells network at the retina level, for example horizontal cells or photoreceptors)
+    * @param inputFrame: the input image to be processed
+    * @param filterIndex: the offset which specifies the parameter set that should be used for the filtering
+    * @return the processed image, the output is reachable later by using function getOutput()
+    */
+    const std::valarray<float> &runFilter_LPfilter(const std::valarray<float> &inputFrame, const unsigned int filterIndex=0); // run the LP filter for a new frame input and save result in _filterOutput
+
+    /**
+    * low pass filter call and run (models the homogeneous cells network at the retina level, for example horizontal cells or photoreceptors)
+    * @param inputFrame: the input image to be processed
+    * @param outputFrame: the output buffer in which the result is writed
+    * @param filterIndex: the offset which specifies the parameter set that should be used for the filtering
+    */
+    void runFilter_LPfilter(const std::valarray<float> &inputFrame, std::valarray<float> &outputFrame, const unsigned int filterIndex=0); // run LP filter on a specific output adress
+
+    /**
+    *  low pass filter call and run (models the homogeneous cells network at the retina level, for example horizontal cells or photoreceptors)
+    * @param inputOutputFrame: the input image to be processed on which the result is rewrited
+    * @param filterIndex: the offset which specifies the parameter set that should be used for the filtering
+    */
+    void runFilter_LPfilter_Autonomous(std::valarray<float> &inputOutputFrame, const unsigned int filterIndex=0);// run LP filter on the input data and rewrite it
+
+    /**
+    *  local luminance adaptation call and run (contrast enhancement property of the photoreceptors)
+    * @param inputOutputFrame: the input image to be processed
+    * @param localLuminance: an image which represents the local luminance of the inputFrame parameter, in general, it is its low pass spatial filtering
+    * @return the processed image, the output is reachable later by using function getOutput()
+    */
+    const std::valarray<float> &runFilter_LocalAdapdation(const std::valarray<float> &inputOutputFrame, const std::valarray<float> &localLuminance);// run local adaptation filter and save result in _filterOutput
+
+    /**
+    *  local luminance adaptation call and run (contrast enhancement property of the photoreceptors)
+    * @param inputFrame: the input image to be processed
+    * @param localLuminance: an image which represents the local luminance of the inputFrame parameter, in general, it is its low pass spatial filtering
+    * @param outputFrame: the output buffer in which the result is writed
+    */
+    void runFilter_LocalAdapdation(const std::valarray<float> &inputFrame, const std::valarray<float> &localLuminance, std::valarray<float> &outputFrame); // run local adaptation filter on a specific output adress
+
+    /**
+    *  local luminance adaptation call and run (contrast enhancement property of the photoreceptors)
+    * @param inputFrame: the input image to be processed
+    * @return the processed image, the output is reachable later by using function getOutput()
+    */
+    const std::valarray<float> &runFilter_LocalAdapdation_autonomous(const std::valarray<float> &inputFrame);// run local adaptation filter and save result in _filterOutput
+
+    /**
+    *  local luminance adaptation call and run (contrast enhancement property of the photoreceptors)
+    * @param inputFrame: the input image to be processed
+    * @param outputFrame: the output buffer in which the result is writen
+    */
+    void runFilter_LocalAdapdation_autonomous(const std::valarray<float> &inputFrame, std::valarray<float> &outputFrame); // run local adaptation filter on a specific output adress
+
+    /**
+    * run low pass filtering with progressive parameters (models the retina log sampling of the photoreceptors and its low pass filtering effect consequence: more powerfull low pass filtering effect on the corners)
+    * @param inputFrame: the input image to be processed
+    * @param filterIndex: the index which specifies the parameter set that should be used for the filtering
+    * @return the processed image, the output is reachable later by using function getOutput() if outputFrame is NULL
+    */
+    inline void runProgressiveFilter(std::valarray<float> &inputFrame, const unsigned int filterIndex=0){_spatiotemporalLPfilter_Irregular(&inputFrame[0], filterIndex);};
+
+    /**
+    * run low pass filtering with progressive parameters (models the retina log sampling of the photoreceptors and its low pass filtering effect consequence: more powerfull low pass filtering effect on the corners)
+    * @param inputFrame: the input image to be processed
+    * @param outputFrame: the output buffer in which the result is writen
+    * @param filterIndex: the index which specifies the parameter set that should be used for the filtering
+    */
+    inline void runProgressiveFilter(const std::valarray<float> &inputFrame,
+                                     std::valarray<float> &outputFrame,
+                                     const unsigned int filterIndex=0)
+    {_spatiotemporalLPfilter_Irregular(get_data(inputFrame), &outputFrame[0], filterIndex);};
+
+    /**
+    * first order spatio-temporal low pass filter setup function
+    * @param beta: gain of the filter (generally set to zero)
+    * @param tau: time constant of the filter (unit is frame for video processing)
+    * @param k: spatial constant of the filter (unit is pixels)
+    * @param filterIndex: the index which specifies the parameter set that should be used for the filtering
+    */
+    void setLPfilterParameters(const float beta, const float tau, const float k, const unsigned int filterIndex=0); // change the parameters of the filter
+
+    /**
+    * first order spatio-temporal low pass filter setup function
+    * @param beta: gain of the filter (generally set to zero)
+    * @param tau: time constant of the filter (unit is frame for video processing)
+    * @param alpha0: spatial constant of the filter (unit is pixels) on the border of the image
+    * @param filterIndex: the index which specifies the parameter set that should be used for the filtering
+    */
+    void setProgressiveFilterConstants_CentredAccuracy(const float beta, const float tau, const float alpha0, const unsigned int filterIndex=0);
+
+    /**
+    * first order spatio-temporal low pass filter setup function
+    * @param beta: gain of the filter (generally set to zero)
+    * @param tau: time constant of the filter (unit is frame for video processing)
+    * @param alpha0: spatial constant of the filter (unit is pixels) on the border of the image
+    * @param accuracyMap an image (float format) which values range is between 0 and 1, where 0 means, apply no filtering and 1 means apply the filtering as specified in the parameters set, intermediate values allow to smooth variations of the filtering strenght
+    * @param filterIndex: the index which specifies the parameter set that should be used for the filtering
+    */
+    void setProgressiveFilterConstants_CustomAccuracy(const float beta, const float tau, const float alpha0, const std::valarray<float> &accuracyMap, const unsigned int filterIndex=0);
+
+    /**
+    * local luminance adaptation setup, this function should be applied for normal local adaptation (not for tone mapping operation)
+    * @param v0: compression effect for the local luminance adaptation processing, set a value between 0.6 and 0.9 for best results, a high value yields to a high compression effect
+    * @param maxInputValue: the maximum amplitude value measured after local adaptation processing (c.f. function runFilter_LocalAdapdation & runFilter_LocalAdapdation_autonomous)
+    * @param meanLuminance: the a priori meann luminance of the input data (should be 128 for 8bits images but can vary greatly in case of High Dynamic Range Images (HDRI)
+    */
+    void setV0CompressionParameter(const float v0, const float maxInputValue, const float){ _v0=v0*maxInputValue; _localLuminanceFactor=v0; _localLuminanceAddon=maxInputValue*(1.0f-v0); _maxInputValue=maxInputValue;};
+
+    /**
+    * update local luminance adaptation setup, initial maxInputValue is kept. This function should be applied for normal local adaptation (not for tone mapping operation)
+    * @param v0: compression effect for the local luminance adaptation processing, set a value between 0.6 and 0.9 for best results, a high value yields to a high compression effect
+    * @param meanLuminance: the a priori meann luminance of the input data (should be 128 for 8bits images but can vary greatly in case of High Dynamic Range Images (HDRI)
+    */
+    void setV0CompressionParameter(const float v0, const float meanLuminance){ this->setV0CompressionParameter(v0, _maxInputValue, meanLuminance);};
+
+    /**
+    * local luminance adaptation setup, this function should be applied for normal local adaptation (not for tone mapping operation)
+    * @param v0: compression effect for the local luminance adaptation processing, set a value between 0.6 and 0.9 for best results, a high value yields to a high compression effect
+    */
+    void setV0CompressionParameter(const float v0){ _v0=v0*_maxInputValue; _localLuminanceFactor=v0; _localLuminanceAddon=_maxInputValue*(1.0f-v0);};
+
+    /**
+    * local luminance adaptation setup, this function should be applied for local adaptation applied to tone mapping operation
+    * @param v0: compression effect for the local luminance adaptation processing, set a value between 0.6 and 0.9 for best results, a high value yields to a high compression effect
+    * @param maxInputValue: the maximum amplitude value measured after local adaptation processing (c.f. function runFilter_LocalAdapdation & runFilter_LocalAdapdation_autonomous)
+    * @param meanLuminance: the a priori meann luminance of the input data (should be 128 for 8bits images but can vary greatly in case of High Dynamic Range Images (HDRI)
+    */
+    void setV0CompressionParameterToneMapping(const float v0, const float maxInputValue, const float meanLuminance=128.0f){ _v0=v0*maxInputValue; _localLuminanceFactor=1.0f; _localLuminanceAddon=meanLuminance*_v0; _maxInputValue=maxInputValue;};
+
+    /**
+    * update compression parameters while keeping v0 parameter value
+    * @param meanLuminance the input frame mean luminance
+    */
+    inline void updateCompressionParameter(const float meanLuminance){_localLuminanceFactor=1; _localLuminanceAddon=meanLuminance*_v0;};
+
+    /**
+    * @return the v0 compression parameter used to compute the local adaptation
+    */
+    float getV0CompressionParameter(){ return _v0/_maxInputValue;};
+
+    /**
+    * @return the output result of the object
+    */
+    inline const std::valarray<float> &getOutput() const {return _filterOutput;};
+
+    /**
+    * @return number of rows of the filter
+    */
+    inline unsigned int getNBrows(){return _filterOutput.getNBrows();};
+
+    /**
+    * @return number of columns of the filter
+    */
+    inline unsigned int getNBcolumns(){return _filterOutput.getNBcolumns();};
+
+    /**
+    * @return number of pixels of the filter
+    */
+    inline unsigned int getNBpixels(){return _filterOutput.getNBpixels();};
+
+    /**
+    * force filter output to be normalized between 0 and maxValue
+    * @param maxValue: the maximum output value that is required
+    */
+    inline void normalizeGrayOutput_0_maxOutputValue(const float maxValue){_filterOutput.normalizeGrayOutput_0_maxOutputValue(maxValue);};
+
+    /**
+    * force filter output to be normalized around 0 and rescaled with a sigmoide effect (extrem values saturation)
+    * @param maxValue: the maximum output value that is required
+    */
+    inline void normalizeGrayOutputCentredSigmoide(){_filterOutput.normalizeGrayOutputCentredSigmoide();};
+
+    /**
+    * force filter output to be normalized : data centering and std normalisation
+    * @param maxValue: the maximum output value that is required
+    */
+    inline void centerReductImageLuminance(){_filterOutput.centerReductImageLuminance();};
+
+    /**
+    * @return the maximum input buffer value
+    */
+    inline float getMaxInputValue(){return this->_maxInputValue;};
+
+    /**
+    * @return the maximum input buffer value
+    */
+    inline void setMaxInputValue(const float newMaxInputValue){this->_maxInputValue=newMaxInputValue;};
 
 protected:
 
-       /////////////////////////
-       // data buffers
-       TemplateBuffer<float> _filterOutput; // primary buffer (contains processing outputs)
-       std::valarray<float> _localBuffer; // local secondary buffer
-       /////////////////////////
-       // PARAMETERS
-       unsigned int _halfNBrows;
-       unsigned int _halfNBcolumns;
-
-       // parameters buffers
-       std::valarray <float>_filteringCoeficientsTable;
-       std::valarray <float>_progressiveSpatialConstant;// pointer to a local table containing local spatial constant (allocated with the object)
-       std::valarray <float>_progressiveGain;// pointer to a local table containing local spatial constant (allocated with the object)
-
-       // local adaptation filtering parameters
-       float _v0; //value used for local luminance adaptation function
-       float _maxInputValue;
-       float _meanInputValue;
-       float _localLuminanceFactor;
-       float _localLuminanceAddon;
-
-       // protected data related to standard low pass filters parameters
-       float _a;
-       float _tau;
-       float _gain;
-
-       /////////////////////////
-       // FILTERS METHODS
-
-       // Basic low pass spation temporal low pass filter used by each retina filters
-       void _spatiotemporalLPfilter(const float *inputFrame, float *LPfilterOutput, const unsigned int coefTableOffset=0);
-       const float _squaringSpatiotemporalLPfilter(const float *inputFrame, float *outputFrame, const unsigned int filterIndex=0);
-
-       // LP filter with an irregular spatial filtering
-
-       // -> rewrites the input buffer
-       void _spatiotemporalLPfilter_Irregular(float *inputOutputFrame, const unsigned int filterIndex=0);
-       // writes the output on another buffer
-       void _spatiotemporalLPfilter_Irregular(const float *inputFrame, float *outputFrame, const unsigned int filterIndex=0);
-       // LP filter that squares the input and computes the output ONLY on the areas where the integrationAreas map are TRUE
-       void _localSquaringSpatioTemporalLPfilter(const float *inputFrame, float *LPfilterOutput, const unsigned int *integrationAreas, const unsigned int filterIndex=0);
-
-       // local luminance adaptation of the input in regard of localLuminance buffer
-       void _localLuminanceAdaptation(const float *inputFrame, const float *localLuminance, float *outputFrame);
-       // local luminance adaptation of the input in regard of localLuminance buffer, the input is rewrited and becomes the output
-       void _localLuminanceAdaptation(float *inputOutputFrame, const float *localLuminance);
-       // local adaptation applied on a range of values which can be positive and negative
-       void _localLuminanceAdaptationPosNegValues(const float *inputFrame, const float *localLuminance, float *outputFrame);
-
-
-       //////////////////////////////////////////////////////////////
-       // 1D directional filters used for the 2D low pass filtering
-
-       // 1D filters with image input
-       void _horizontalCausalFilter_addInput(const float *inputFrame, float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
-       // 1D filters  with image input that is squared in the function
-       void _squaringHorizontalCausalFilter(const float *inputFrame, float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
-       //  vertical anticausal filter that returns the mean value of its result
-       const float _verticalAnticausalFilter_returnMeanValue(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd);
-
-       // most simple functions: only perform 1D filtering with output=input (no add on)
-       void _horizontalCausalFilter(float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
-       void _horizontalAnticausalFilter(float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
-       void _verticalCausalFilter(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd);
-       void _verticalAnticausalFilter(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd);
-
-       // perform 1D filtering with output with varrying spatial coefficient
-       void _horizontalCausalFilter_Irregular(float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
-       void _horizontalCausalFilter_Irregular_addInput(const float *inputFrame, float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
-       void _horizontalAnticausalFilter_Irregular(float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
-       void _verticalCausalFilter_Irregular(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd);
-       void _verticalAnticausalFilter_Irregular_multGain(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd);
-
-
-       // 1D filters in which the output is multiplied by _gain
-       void _verticalAnticausalFilter_multGain(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd); // this functions affects _gain at the output
-       void _horizontalAnticausalFilter_multGain(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd); // this functions affects _gain at the output
-
-       // LP filter on specific parts of the picture instead of all the image
-       // same functions (some of them) but take a binary flag to allow integration, false flag means, 0 at the output...
-       void _local_squaringHorizontalCausalFilter(const float *inputFrame, float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd, const unsigned int *integrationAreas);
-       void _local_horizontalAnticausalFilter(float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd, const unsigned int *integrationAreas);
-       void _local_verticalCausalFilter(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd, const unsigned int *integrationAreas);
-       void _local_verticalAnticausalFilter_multGain(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd, const unsigned int *integrationAreas); // this functions affects _gain at the output
+    /////////////////////////
+    // data buffers
+    TemplateBuffer<float> _filterOutput; // primary buffer (contains processing outputs)
+    std::valarray<float> _localBuffer; // local secondary buffer
+    /////////////////////////
+    // PARAMETERS
+    unsigned int _halfNBrows;
+    unsigned int _halfNBcolumns;
+
+    // parameters buffers
+    std::valarray <float>_filteringCoeficientsTable;
+    std::valarray <float>_progressiveSpatialConstant;// pointer to a local table containing local spatial constant (allocated with the object)
+    std::valarray <float>_progressiveGain;// pointer to a local table containing local spatial constant (allocated with the object)
+
+    // local adaptation filtering parameters
+    float _v0; //value used for local luminance adaptation function
+    float _maxInputValue;
+    float _meanInputValue;
+    float _localLuminanceFactor;
+    float _localLuminanceAddon;
+
+    // protected data related to standard low pass filters parameters
+    float _a;
+    float _tau;
+    float _gain;
+
+    /////////////////////////
+    // FILTERS METHODS
+
+    // Basic low pass spation temporal low pass filter used by each retina filters
+    void _spatiotemporalLPfilter(const float *inputFrame, float *LPfilterOutput, const unsigned int coefTableOffset=0);
+    float _squaringSpatiotemporalLPfilter(const float *inputFrame, float *outputFrame, const unsigned int filterIndex=0);
+
+    // LP filter with an irregular spatial filtering
+
+    // -> rewrites the input buffer
+    void _spatiotemporalLPfilter_Irregular(float *inputOutputFrame, const unsigned int filterIndex=0);
+    // writes the output on another buffer
+    void _spatiotemporalLPfilter_Irregular(const float *inputFrame, float *outputFrame, const unsigned int filterIndex=0);
+    // LP filter that squares the input and computes the output ONLY on the areas where the integrationAreas map are TRUE
+    void _localSquaringSpatioTemporalLPfilter(const float *inputFrame, float *LPfilterOutput, const unsigned int *integrationAreas, const unsigned int filterIndex=0);
+
+    // local luminance adaptation of the input in regard of localLuminance buffer
+    void _localLuminanceAdaptation(const float *inputFrame, const float *localLuminance, float *outputFrame);
+    // local luminance adaptation of the input in regard of localLuminance buffer, the input is rewrited and becomes the output
+    void _localLuminanceAdaptation(float *inputOutputFrame, const float *localLuminance);
+    // local adaptation applied on a range of values which can be positive and negative
+    void _localLuminanceAdaptationPosNegValues(const float *inputFrame, const float *localLuminance, float *outputFrame);
+
+
+    //////////////////////////////////////////////////////////////
+    // 1D directional filters used for the 2D low pass filtering
+
+    // 1D filters with image input
+    void _horizontalCausalFilter_addInput(const float *inputFrame, float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
+    // 1D filters  with image input that is squared in the function
+    void _squaringHorizontalCausalFilter(const float *inputFrame, float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
+    //  vertical anticausal filter that returns the mean value of its result
+    float _verticalAnticausalFilter_returnMeanValue(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd);
+
+    // most simple functions: only perform 1D filtering with output=input (no add on)
+    void _horizontalCausalFilter(float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
+    void _horizontalAnticausalFilter(float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
+    void _verticalCausalFilter(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd);
+    void _verticalAnticausalFilter(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd);
+
+    // perform 1D filtering with output with varrying spatial coefficient
+    void _horizontalCausalFilter_Irregular(float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
+    void _horizontalCausalFilter_Irregular_addInput(const float *inputFrame, float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
+    void _horizontalAnticausalFilter_Irregular(float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd);
+    void _verticalCausalFilter_Irregular(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd);
+    void _verticalAnticausalFilter_Irregular_multGain(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd);
+
+
+    // 1D filters in which the output is multiplied by _gain
+    void _verticalAnticausalFilter_multGain(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd); // this functions affects _gain at the output
+    void _horizontalAnticausalFilter_multGain(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd); // this functions affects _gain at the output
+
+    // LP filter on specific parts of the picture instead of all the image
+    // same functions (some of them) but take a binary flag to allow integration, false flag means, 0 at the output...
+    void _local_squaringHorizontalCausalFilter(const float *inputFrame, float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd, const unsigned int *integrationAreas);
+    void _local_horizontalAnticausalFilter(float *outputFrame, unsigned int IDrowStart, unsigned int IDrowEnd, const unsigned int *integrationAreas);
+    void _local_verticalCausalFilter(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd, const unsigned int *integrationAreas);
+    void _local_verticalAnticausalFilter_multGain(float *outputFrame, unsigned int IDcolumnStart, unsigned int IDcolumnEnd, const unsigned int *integrationAreas); // this functions affects _gain at the output
 
 };
 
index b4ed708..362de7c 100644 (file)
@@ -46,20 +46,20 @@ using namespace cv;
 using namespace std;
 
 CvHybridTrackerParams::CvHybridTrackerParams(float _ft_tracker_weight, float _ms_tracker_weight,
-                       CvFeatureTrackerParams _ft_params,
-                       CvMeanShiftTrackerParams _ms_params,
-                       CvMotionModel)
+            CvFeatureTrackerParams _ft_params,
+            CvMeanShiftTrackerParams _ms_params,
+            CvMotionModel)
 {
-       ft_tracker_weight = _ft_tracker_weight;
-       ms_tracker_weight = _ms_tracker_weight;
-       ft_params = _ft_params;
-       ms_params = _ms_params;
+    ft_tracker_weight = _ft_tracker_weight;
+    ms_tracker_weight = _ms_tracker_weight;
+    ft_params = _ft_params;
+    ms_params = _ms_params;
 }
 
 CvMeanShiftTrackerParams::CvMeanShiftTrackerParams(int _tracking_type, CvTermCriteria _term_crit)
 {
-       tracking_type = _tracking_type;
-       term_crit = _term_crit;
+    tracking_type = _tracking_type;
+    term_crit = _term_crit;
 }
 
 CvHybridTracker::CvHybridTracker() {
@@ -67,171 +67,171 @@ CvHybridTracker::CvHybridTracker() {
 }
 
 CvHybridTracker::CvHybridTracker(HybridTrackerParams _params) :
-       params(_params) {
-       params.ft_params.feature_type = CvFeatureTrackerParams::SIFT;
-       mstracker = new CvMeanShiftTracker(params.ms_params);
-       fttracker = new CvFeatureTracker(params.ft_params);
+    params(_params) {
+    params.ft_params.feature_type = CvFeatureTrackerParams::SIFT;
+    mstracker = new CvMeanShiftTracker(params.ms_params);
+    fttracker = new CvFeatureTracker(params.ft_params);
 }
 
 CvHybridTracker::~CvHybridTracker() {
-       if (mstracker != NULL)
-               delete mstracker;
-       if (fttracker != NULL)
-               delete fttracker;
+    if (mstracker != NULL)
+        delete mstracker;
+    if (fttracker != NULL)
+        delete fttracker;
 }
 
 inline float CvHybridTracker::getL2Norm(Point2f p1, Point2f p2) {
-       float distance = (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y
-                       - p2.y);
-       return sqrt(distance);
+    float distance = (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y
+            - p2.y);
+    return sqrt(distance);
 }
 
 Mat CvHybridTracker::getDistanceProjection(Mat image, Point2f center) {
-       Mat hist(image.size(), CV_64F);
+    Mat hist(image.size(), CV_64F);
 
-       double lu = getL2Norm(Point(0, 0), center);
-       double ru = getL2Norm(Point(0, image.size().width), center);
-       double rd = getL2Norm(Point(image.size().height, image.size().width),
-                       center);
-       double ld = getL2Norm(Point(image.size().height, 0), center);
+    double lu = getL2Norm(Point(0, 0), center);
+    double ru = getL2Norm(Point(0, image.size().width), center);
+    double rd = getL2Norm(Point(image.size().height, image.size().width),
+            center);
+    double ld = getL2Norm(Point(image.size().height, 0), center);
 
-       double max = (lu < ru) ? lu : ru;
-       max = (max < rd) ? max : rd;
-       max = (max < ld) ? max : ld;
+    double max = (lu < ru) ? lu : ru;
+    max = (max < rd) ? max : rd;
+    max = (max < ld) ? max : ld;
 
-       for (int i = 0; i < hist.rows; i++)
-               for (int j = 0; j < hist.cols; j++)
-                       hist.at<double> (i, j) = 1.0 - (getL2Norm(Point(i, j), center)
-                                       / max);
+    for (int i = 0; i < hist.rows; i++)
+        for (int j = 0; j < hist.cols; j++)
+            hist.at<double> (i, j) = 1.0 - (getL2Norm(Point(i, j), center)
+                    / max);
 
-       return hist;
+    return hist;
 }
 
 Mat CvHybridTracker::getGaussianProjection(Mat image, int ksize, double sigma,
-               Point2f center) {
-       Mat kernel = getGaussianKernel(ksize, sigma, CV_64F);
-       double max = kernel.at<double> (ksize / 2);
-
-       Mat hist(image.size(), CV_64F);
-       for (int i = 0; i < hist.rows; i++)
-               for (int j = 0; j < hist.cols; j++) {
-                       int pos = cvRound(getL2Norm(Point(i, j), center));
-                       if (pos < ksize / 2.0)
-                               hist.at<double> (i, j) = 1.0 - (kernel.at<double> (pos) / max);
-               }
-
-       return hist;
+        Point2f center) {
+    Mat kernel = getGaussianKernel(ksize, sigma, CV_64F);
+    double max = kernel.at<double> (ksize / 2);
+
+    Mat hist(image.size(), CV_64F);
+    for (int i = 0; i < hist.rows; i++)
+        for (int j = 0; j < hist.cols; j++) {
+            int pos = cvRound(getL2Norm(Point(i, j), center));
+            if (pos < ksize / 2.0)
+                hist.at<double> (i, j) = 1.0 - (kernel.at<double> (pos) / max);
+        }
+
+    return hist;
 }
 
 void CvHybridTracker::newTracker(Mat image, Rect selection) {
-       prev_proj = Mat::zeros(image.size(), CV_64FC1);
-       prev_center = Point2f(selection.x + selection.width / 2.0f, selection.y
-                       + selection.height / 2.0f);
-       prev_window = selection;
+    prev_proj = Mat::zeros(image.size(), CV_64FC1);
+    prev_center = Point2f(selection.x + selection.width / 2.0f, selection.y
+            + selection.height / 2.0f);
+    prev_window = selection;
 
-       mstracker->newTrackingWindow(image, selection);
-       fttracker->newTrackingWindow(image, selection);
+    mstracker->newTrackingWindow(image, selection);
+    fttracker->newTrackingWindow(image, selection);
 
-       samples = cvCreateMat(2, 1, CV_32FC1);
-       labels = cvCreateMat(2, 1, CV_32SC1);
+    samples = cvCreateMat(2, 1, CV_32FC1);
+    labels = cvCreateMat(2, 1, CV_32SC1);
 
-       ittr = 0;
+    ittr = 0;
 }
 
 void CvHybridTracker::updateTracker(Mat image) {
-       ittr++;
+    ittr++;
 
-       //copy over clean images: TODO
-       mstracker->updateTrackingWindow(image);
-       fttracker->updateTrackingWindowWithFlow(image);
+    //copy over clean images: TODO
+    mstracker->updateTrackingWindow(image);
+    fttracker->updateTrackingWindowWithFlow(image);
 
-       if (params.motion_model == CvMotionModel::EM)
-               updateTrackerWithEM(image);
-       else
-               updateTrackerWithLowPassFilter(image);
+    if (params.motion_model == CvMotionModel::EM)
+        updateTrackerWithEM(image);
+    else
+        updateTrackerWithLowPassFilter(image);
 
-       // Regression to find new weights
-       Point2f ms_center = mstracker->getTrackingEllipse().center;
-       Point2f ft_center = fttracker->getTrackingCenter();
+    // Regression to find new weights
+    Point2f ms_center = mstracker->getTrackingEllipse().center;
+    Point2f ft_center = fttracker->getTrackingCenter();
 
 #ifdef DEBUG_HYTRACKER
-       circle(image, ms_center, 3, Scalar(0, 0, 255), -1, 8);
-       circle(image, ft_center, 3, Scalar(255, 0, 0), -1, 8);
-       putText(image, "ms", Point(ms_center.x+2, ms_center.y), FONT_HERSHEY_PLAIN, 0.75, Scalar(255, 255, 255));
-       putText(image, "ft", Point(ft_center.x+2, ft_center.y), FONT_HERSHEY_PLAIN, 0.75, Scalar(255, 255, 255));
+    circle(image, ms_center, 3, Scalar(0, 0, 255), -1, 8);
+    circle(image, ft_center, 3, Scalar(255, 0, 0), -1, 8);
+    putText(image, "ms", Point(ms_center.x+2, ms_center.y), FONT_HERSHEY_PLAIN, 0.75, Scalar(255, 255, 255));
+    putText(image, "ft", Point(ft_center.x+2, ft_center.y), FONT_HERSHEY_PLAIN, 0.75, Scalar(255, 255, 255));
 #endif
 
-       double ms_len = getL2Norm(ms_center, curr_center);
-       double ft_len = getL2Norm(ft_center, curr_center);
-       double total_len = ms_len + ft_len;
+    double ms_len = getL2Norm(ms_center, curr_center);
+    double ft_len = getL2Norm(ft_center, curr_center);
+    double total_len = ms_len + ft_len;
 
-       params.ms_tracker_weight *= (ittr - 1);
-       params.ms_tracker_weight += (float)((ms_len / total_len));
-       params.ms_tracker_weight /= ittr;
-       params.ft_tracker_weight *= (ittr - 1);
-       params.ft_tracker_weight += (float)((ft_len / total_len));
-       params.ft_tracker_weight /= ittr;
+    params.ms_tracker_weight *= (ittr - 1);
+    params.ms_tracker_weight += (float)((ms_len / total_len));
+    params.ms_tracker_weight /= ittr;
+    params.ft_tracker_weight *= (ittr - 1);
+    params.ft_tracker_weight += (float)((ft_len / total_len));
+    params.ft_tracker_weight /= ittr;
 
-       circle(image, prev_center, 3, Scalar(0, 0, 0), -1, 8);
-       circle(image, curr_center, 3, Scalar(255, 255, 255), -1, 8);
+    circle(image, prev_center, 3, Scalar(0, 0, 0), -1, 8);
+    circle(image, curr_center, 3, Scalar(255, 255, 255), -1, 8);
 
-       prev_center = curr_center;
-       prev_window.x = (int)(curr_center.x-prev_window.width/2.0);
-       prev_window.y = (int)(curr_center.y-prev_window.height/2.0);
+    prev_center = curr_center;
+    prev_window.x = (int)(curr_center.x-prev_window.width/2.0);
+    prev_window.y = (int)(curr_center.y-prev_window.height/2.0);
 
-       mstracker->setTrackingWindow(prev_window);
-       fttracker->setTrackingWindow(prev_window);
+    mstracker->setTrackingWindow(prev_window);
+    fttracker->setTrackingWindow(prev_window);
 }
 
 void CvHybridTracker::updateTrackerWithEM(Mat image) {
-       Mat ms_backproj = mstracker->getHistogramProjection(CV_64F);
-       Mat ms_distproj = getDistanceProjection(image, mstracker->getTrackingCenter());
-       Mat ms_proj = ms_backproj.mul(ms_distproj);
-
-       float dist_err = getL2Norm(mstracker->getTrackingCenter(), fttracker->getTrackingCenter());
-       Mat ft_gaussproj = getGaussianProjection(image, cvRound(dist_err), -1, fttracker->getTrackingCenter());
-       Mat ft_distproj = getDistanceProjection(image, fttracker->getTrackingCenter());
-       Mat ft_proj = ft_gaussproj.mul(ft_distproj);
-
-       Mat proj = params.ms_tracker_weight * ms_proj + params.ft_tracker_weight * ft_proj + prev_proj;
-
-       int sample_count = countNonZero(proj);
-       cvReleaseMat(&samples);
-       cvReleaseMat(&labels);
-       samples = cvCreateMat(sample_count, 2, CV_32FC1);
-       labels = cvCreateMat(sample_count, 1, CV_32SC1);
-
-       int count = 0;
-       for (int i = 0; i < proj.rows; i++)
-               for (int j = 0; j < proj.cols; j++)
-                       if (proj.at<double> (i, j) > 0) {
-                               samples->data.fl[count * 2] = (float)i;
-                               samples->data.fl[count * 2 + 1] = (float)j;
-                               count++;
-                       }
+    Mat ms_backproj = mstracker->getHistogramProjection(CV_64F);
+    Mat ms_distproj = getDistanceProjection(image, mstracker->getTrackingCenter());
+    Mat ms_proj = ms_backproj.mul(ms_distproj);
+
+    float dist_err = getL2Norm(mstracker->getTrackingCenter(), fttracker->getTrackingCenter());
+    Mat ft_gaussproj = getGaussianProjection(image, cvRound(dist_err), -1, fttracker->getTrackingCenter());
+    Mat ft_distproj = getDistanceProjection(image, fttracker->getTrackingCenter());
+    Mat ft_proj = ft_gaussproj.mul(ft_distproj);
+
+    Mat proj = params.ms_tracker_weight * ms_proj + params.ft_tracker_weight * ft_proj + prev_proj;
+
+    int sample_count = countNonZero(proj);
+    cvReleaseMat(&samples);
+    cvReleaseMat(&labels);
+    samples = cvCreateMat(sample_count, 2, CV_32FC1);
+    labels = cvCreateMat(sample_count, 1, CV_32SC1);
+
+    int count = 0;
+    for (int i = 0; i < proj.rows; i++)
+        for (int j = 0; j < proj.cols; j++)
+            if (proj.at<double> (i, j) > 0) {
+                samples->data.fl[count * 2] = (float)i;
+                samples->data.fl[count * 2 + 1] = (float)j;
+                count++;
+            }
 
     cv::Mat lbls;
-    
+
     EM em_model(1, EM::COV_MAT_SPHERICAL, TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 10000, 0.001));
     em_model.train(cvarrToMat(samples), noArray(), lbls);
     if(labels)
         lbls.copyTo(cvarrToMat(labels));
 
     Mat em_means = em_model.get<Mat>("means");
-       curr_center.x = (float)em_means.at<float>(0, 0);
-       curr_center.y = (float)em_means.at<float>(0, 1);
+    curr_center.x = (float)em_means.at<float>(0, 0);
+    curr_center.y = (float)em_means.at<float>(0, 1);
 }
 
-void CvHybridTracker::updateTrackerWithLowPassFilter(Mat image) {
-       RotatedRect ms_track = mstracker->getTrackingEllipse();
-       Point2f ft_center = fttracker->getTrackingCenter();
+void CvHybridTracker::updateTrackerWithLowPassFilter(Mat) {
+    RotatedRect ms_track = mstracker->getTrackingEllipse();
+    Point2f ft_center = fttracker->getTrackingCenter();
 
-       float a = params.low_pass_gain;
-       curr_center.x = (1 - a) * prev_center.x + a * (params.ms_tracker_weight * ms_track.center.x + params.ft_tracker_weight * ft_center.x);
-       curr_center.y = (1 - a) * prev_center.y + a * (params.ms_tracker_weight * ms_track.center.y + params.ft_tracker_weight * ft_center.y);
+    float a = params.low_pass_gain;
+    curr_center.x = (1 - a) * prev_center.x + a * (params.ms_tracker_weight * ms_track.center.x + params.ft_tracker_weight * ft_center.x);
+    curr_center.y = (1 - a) * prev_center.y + a * (params.ms_tracker_weight * ms_track.center.y + params.ft_tracker_weight * ft_center.y);
 }
 
 Rect CvHybridTracker::getTrackingWindow() {
-       return prev_window;
+    return prev_window;
 }
 
index e7350e0..1572ee8 100644 (file)
@@ -1,55 +1,55 @@
 /*#******************************************************************************
 ** IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-** 
+**
 ** By downloading, copying, installing or using the software you agree to this license.
 ** If you do not agree to this license, do not download, install,
 ** copy or use the software.
-** 
-** 
+**
+**
 ** HVStools : interfaces allowing OpenCV users to integrate Human Vision System models. Presented models originate from Jeanny Herault's original research and have been reused and adapted by the author&collaborators for computed vision applications since his thesis with Alice Caplier at Gipsa-Lab.
 ** Use: extract still images & image sequences features, from contours details to motion spatio-temporal features, etc. for high level visual scene analysis. Also contribute to image enhancement/compression such as tone mapping.
-** 
+**
 ** Maintainers : Listic lab (code author current affiliation & applications) and Gipsa Lab (original research origins & applications)
-** 
+**
 **  Creation - enhancement process 2007-2011
 **      Author: Alexandre Benoit (benoit.alexandre.vision@gmail.com), LISTIC lab, Annecy le vieux, France
-** 
+**
 ** Theses algorithm have been developped by Alexandre BENOIT since his thesis with Alice Caplier at Gipsa-Lab (www.gipsa-lab.inpg.fr) and the research he pursues at LISTIC Lab (www.listic.univ-savoie.fr).
 ** Refer to the following research paper for more information:
 ** Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
 ** This work have been carried out thanks to Jeanny Herault who's research and great discussions are the basis of all this work, please take a look at his book:
 ** Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891.
-** 
+**
 ** The retina filter includes the research contributions of phd/research collegues from which code has been redrawn by the author :
 ** _take a look at the retinacolor.hpp module to discover Brice Chaix de Lavarene color mosaicing/demosaicing and the reference paper:
 ** ====> B. Chaix de Lavarene, D. Alleysson, B. Durette, J. Herault (2007). "Efficient demosaicing through recursive filtering", IEEE International Conference on Image Processing ICIP 2007
 ** _take a look at imagelogpolprojection.hpp to discover retina spatial log sampling which originates from Barthelemy Durette phd with Jeanny Herault. A Retina / V1 cortex projection is also proposed and originates from Jeanny's discussions.
 ** ====> more informations in the above cited Jeanny Heraults's book.
-** 
+**
 **                          License Agreement
 **               For Open Source Computer Vision Library
-** 
+**
 ** Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
 ** Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.
-** 
+**
 **               For Human Visual System tools (hvstools)
 ** Copyright (C) 2007-2011, LISTIC Lab, Annecy le Vieux and GIPSA Lab, Grenoble, France, all rights reserved.
-** 
+**
 ** Third party copyrights are property of their respective owners.
-** 
+**
 ** Redistribution and use in source and binary forms, with or without modification,
 ** are permitted provided that the following conditions are met:
-** 
+**
 ** * Redistributions of source code must retain the above copyright notice,
 **    this list of conditions and the following disclaimer.
-** 
+**
 ** * Redistributions in binary form must reproduce the above copyright notice,
 **    this list of conditions and the following disclaimer in the documentation
 **    and/or other materials provided with the distribution.
-** 
+**
 ** * The name of the copyright holders may not be used to endorse or promote products
 **    derived from this software without specific prior written permission.
-** 
+**
 ** This software is provided by the copyright holders and contributors "as is" and
 ** any express or implied warranties, including, but not limited to, the implied
 ** warranties of merchantability and fitness for a particular purpose are disclaimed.
@@ -108,131 +108,131 @@ class ImageLogPolProjection:public BasicRetinaFilter
 {
 public:
 
-       enum PROJECTIONTYPE{RETINALOGPROJECTION, CORTEXLOGPOLARPROJECTION};
-
-       /**
-       * constructor, just specifies the image input size and the projection type, no projection initialisation is done
-       * -> use initLogRetinaSampling() or initLogPolarCortexSampling() for that
-       * @param nbRows: number of rows of the input image
-       * @param nbColumns: number of columns of the input image
-       * @param projection: the type of projection, RETINALOGPROJECTION or CORTEXLOGPOLARPROJECTION
-       * @param colorMode: specifies if the projection is applied on a grayscale image (false) or color images (3 layers) (true)
-       */
-       ImageLogPolProjection(const unsigned int nbRows, const unsigned int nbColumns, const PROJECTIONTYPE projection, const bool colorMode=false);
-
-       /**
-       * standard destructor
-       */
-       virtual ~ImageLogPolProjection();
-
-       /**
-       * function that clears all buffers of the object
-       */
-       void clearAllBuffers();
-
-       /**
-       * resize retina color filter object (resize all allocated buffers)
-       * @param NBrows: the new height size
-       * @param NBcolumns: the new width size
-       */
-       void resize(const unsigned int NBrows, const unsigned int NBcolumns);
-
-       /**
-       * init function depending on the projection type
-       * @param reductionFactor: the size reduction factor of the ouptup image in regard of the size of the input image, must be superior to 1
-       * @param samplingStrenght: specifies the strenght of the log compression effect (magnifying coefficient)
-       * @return true if the init was performed without any errors
-       */
-       bool initProjection(const double reductionFactor, const double samplingStrenght);
-
-       /**
-       * main funtion of the class: run projection function
-       * @param inputFrame: the input frame to be processed
-        * @param colorMode: the input buffer color mode: false=gray levels, true = 3 color channels mode 
-       * @return the output frame
-       */
-       std::valarray<float> &runProjection(const std::valarray<float> &inputFrame, const bool colorMode=false);
-
-       /**
-       * @return the numbers of rows (height) of the images OUTPUTS of the object
-       */
-       inline const unsigned int getOutputNBrows(){return _outputNBrows;};
-
-       /**
-       * @return the numbers of columns (width) of the images OUTPUTS of the object
-       */
-       inline const unsigned int getOutputNBcolumns(){return _outputNBcolumns;};
-
-       /**
-       * main funtion of the class: run projection function
-       * @param size: one of the input frame initial dimensions to be processed
-       * @return the output frame dimension
-       */
-       inline static const unsigned int predictOutputSize(const unsigned int size, const double reductionFactor){return (unsigned int)((double)size/reductionFactor);};
-
-       /**
-       * @return the output of the filter which applies an irregular Low Pass spatial filter to the imag input (see function
-       */
-       inline const std::valarray<float> &getIrregularLPfilteredInputFrame() const {return _irregularLPfilteredFrame;};
-
-       /**
-       * function which allows to retrieve the output frame which was updated after the "runProjection(...) function BasicRetinaFilter::runProgressiveFilter(...)
-       * @return the projection result
-       */
-       inline const std::valarray<float> &getSampledFrame() const {return _sampledFrame;};
-
-       /**
-       * function which allows gives the tranformation table, its size is (getNBrows()*getNBcolumns()*2)
-       * @return the transformation matrix [outputPixIndex_i, inputPixIndex_i, outputPixIndex_i+1, inputPixIndex_i+1....]
-       */
-       inline const std::valarray<unsigned int> &getSamplingMap() const {return _transformTable;};
-
-       inline const double getOriginalRadiusLength(const double projectedRadiusLength){return _azero/(_alim-projectedRadiusLength*2.0/_minDimension);};
-
-       //    unsigned int getInputPixelIndex(const unsigned int ){ return  _transformTable[index*2+1]};
+    enum PROJECTIONTYPE{RETINALOGPROJECTION, CORTEXLOGPOLARPROJECTION};
+
+    /**
+    * constructor, just specifies the image input size and the projection type, no projection initialisation is done
+    * -> use initLogRetinaSampling() or initLogPolarCortexSampling() for that
+    * @param nbRows: number of rows of the input image
+    * @param nbColumns: number of columns of the input image
+    * @param projection: the type of projection, RETINALOGPROJECTION or CORTEXLOGPOLARPROJECTION
+    * @param colorMode: specifies if the projection is applied on a grayscale image (false) or color images (3 layers) (true)
+    */
+    ImageLogPolProjection(const unsigned int nbRows, const unsigned int nbColumns, const PROJECTIONTYPE projection, const bool colorMode=false);
+
+    /**
+    * standard destructor
+    */
+    virtual ~ImageLogPolProjection();
+
+    /**
+    * function that clears all buffers of the object
+    */
+    void clearAllBuffers();
+
+    /**
+    * resize retina color filter object (resize all allocated buffers)
+    * @param NBrows: the new height size
+    * @param NBcolumns: the new width size
+    */
+    void resize(const unsigned int NBrows, const unsigned int NBcolumns);
+
+    /**
+    * init function depending on the projection type
+    * @param reductionFactor: the size reduction factor of the ouptup image in regard of the size of the input image, must be superior to 1
+    * @param samplingStrenght: specifies the strenght of the log compression effect (magnifying coefficient)
+    * @return true if the init was performed without any errors
+    */
+    bool initProjection(const double reductionFactor, const double samplingStrenght);
+
+    /**
+    * main funtion of the class: run projection function
+    * @param inputFrame: the input frame to be processed
+        * @param colorMode: the input buffer color mode: false=gray levels, true = 3 color channels mode
+    * @return the output frame
+    */
+    std::valarray<float> &runProjection(const std::valarray<float> &inputFrame, const bool colorMode=false);
+
+    /**
+    * @return the numbers of rows (height) of the images OUTPUTS of the object
+    */
+    inline unsigned int getOutputNBrows(){return _outputNBrows;};
+
+    /**
+    * @return the numbers of columns (width) of the images OUTPUTS of the object
+    */
+    inline unsigned int getOutputNBcolumns(){return _outputNBcolumns;};
+
+    /**
+    * main funtion of the class: run projection function
+    * @param size: one of the input frame initial dimensions to be processed
+    * @return the output frame dimension
+    */
+    inline static unsigned int predictOutputSize(const unsigned int size, const double reductionFactor){return (unsigned int)((double)size/reductionFactor);};
+
+    /**
+    * @return the output of the filter which applies an irregular Low Pass spatial filter to the imag input (see function
+    */
+    inline const std::valarray<float> &getIrregularLPfilteredInputFrame() const {return _irregularLPfilteredFrame;};
+
+    /**
+    * function which allows to retrieve the output frame which was updated after the "runProjection(...) function BasicRetinaFilter::runProgressiveFilter(...)
+    * @return the projection result
+    */
+    inline const std::valarray<float> &getSampledFrame() const {return _sampledFrame;};
+
+    /**
+    * function which allows gives the tranformation table, its size is (getNBrows()*getNBcolumns()*2)
+    * @return the transformation matrix [outputPixIndex_i, inputPixIndex_i, outputPixIndex_i+1, inputPixIndex_i+1....]
+    */
+    inline const std::valarray<unsigned int> &getSamplingMap() const {return _transformTable;};
+
+    inline double getOriginalRadiusLength(const double projectedRadiusLength){return _azero/(_alim-projectedRadiusLength*2.0/_minDimension);};
+
+    //    unsigned int getInputPixelIndex(const unsigned int ){ return  _transformTable[index*2+1]};
 
 private:
-       PROJECTIONTYPE _selectedProjection;
-
-       // size of the image output
-       unsigned int _outputNBrows;
-       unsigned int _outputNBcolumns;
-       unsigned int _outputNBpixels;
-       unsigned int _outputDoubleNBpixels;
-       unsigned int _inputDoubleNBpixels;
-
-       // is the object able to manage color flag
-       bool _colorModeCapable;
-       // sampling strenght factor
-       double _samplingStrenght;
-       // sampling reduction factor
-       double _reductionFactor;
-
-       // log sampling parameters
-       double _azero;
-       double _alim;
-       double _minDimension;
-
-       // template buffers
-       std::valarray<float>_sampledFrame;
-       std::valarray<float>&_tempBuffer;
-       std::valarray<unsigned int>_transformTable;
-
-       std::valarray<float> &_irregularLPfilteredFrame; // just a reference for easier understanding
-       unsigned int _usefullpixelIndex;
-
-       // init transformation tables
-       bool _computeLogProjection();
-       bool _computeLogPolarProjection();
-
-       // specifies if init was done correctly
-       bool _initOK;
-       // private init projections functions called by "initProjection(...)" function
-       bool _initLogRetinaSampling(const double reductionFactor, const double samplingStrenght);
-       bool _initLogPolarCortexSampling(const double reductionFactor, const double samplingStrenght);
-
-       ImageLogPolProjection(const ImageLogPolProjection&);
-       ImageLogPolProjection& operator=(const ImageLogPolProjection&);
+    PROJECTIONTYPE _selectedProjection;
+
+    // size of the image output
+    unsigned int _outputNBrows;
+    unsigned int _outputNBcolumns;
+    unsigned int _outputNBpixels;
+    unsigned int _outputDoubleNBpixels;
+    unsigned int _inputDoubleNBpixels;
+
+    // is the object able to manage color flag
+    bool _colorModeCapable;
+    // sampling strenght factor
+    double _samplingStrenght;
+    // sampling reduction factor
+    double _reductionFactor;
+
+    // log sampling parameters
+    double _azero;
+    double _alim;
+    double _minDimension;
+
+    // template buffers
+    std::valarray<float>_sampledFrame;
+    std::valarray<float>&_tempBuffer;
+    std::valarray<unsigned int>_transformTable;
+
+    std::valarray<float> &_irregularLPfilteredFrame; // just a reference for easier understanding
+    unsigned int _usefullpixelIndex;
+
+    // init transformation tables
+    bool _computeLogProjection();
+    bool _computeLogPolarProjection();
+
+    // specifies if init was done correctly
+    bool _initOK;
+    // private init projections functions called by "initProjection(...)" function
+    bool _initLogRetinaSampling(const double reductionFactor, const double samplingStrenght);
+    bool _initLogPolarCortexSampling(const double reductionFactor, const double samplingStrenght);
+
+    ImageLogPolProjection(const ImageLogPolProjection&);
+    ImageLogPolProjection& operator=(const ImageLogPolProjection&);
 
 };
 
index aac2187..babe99b 100644 (file)
 #include "opencv2/contrib/contrib.hpp"\r
 \r
 #ifdef WIN32\r
-       #include <windows.h>\r
-       #include <tchar.h>\r
+    #include <windows.h>\r
+    #include <tchar.h>\r
 #else\r
-       #include <dirent.h>\r
+    #include <dirent.h>\r
 #endif\r
 \r
 namespace cv\r
 {\r
-       std::vector<std::string> Directory::GetListFiles(  const std::string& path, const std::string & exten, bool addPath )\r
-       {\r
-               std::vector<std::string> list;\r
-               list.clear();\r
-               std::string path_f = path + "/" + exten;\r
-               #ifdef WIN32\r
-                       WIN32_FIND_DATA FindFileData;\r
-                       HANDLE hFind;\r
-\r
-                       hFind = FindFirstFile((LPCSTR)path_f.c_str(), &FindFileData);\r
-                       if (hFind == INVALID_HANDLE_VALUE) \r
-                       {\r
-                               return list;\r
-                       }\r
-                       else\r
-                       {\r
-                               do\r
-                               {\r
-                                       if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_NORMAL  || \r
-                                               FindFileData.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE || \r
-                                               FindFileData.dwFileAttributes == FILE_ATTRIBUTE_HIDDEN  || \r
-                                               FindFileData.dwFileAttributes == FILE_ATTRIBUTE_SYSTEM  || \r
-                                               FindFileData.dwFileAttributes == FILE_ATTRIBUTE_READONLY)\r
-                                       {\r
-                                               if (addPath)\r
-                                                       list.push_back(path + "/" + FindFileData.cFileName);\r
-                                               else\r
-                                                       list.push_back(FindFileData.cFileName);\r
-                                       }\r
-                               } \r
-                               while(FindNextFile(hFind, &FindFileData));\r
-                               FindClose(hFind);  \r
-                       }\r
-               #else\r
-                       DIR *dp;\r
-                       struct dirent *dirp;\r
-                       if((dp = opendir(path.c_str())) == NULL) \r
-                       {\r
-                               return list;\r
-                       }\r
-\r
-                       while ((dirp = readdir(dp)) != NULL) \r
-                       {\r
-                               if (dirp->d_type == DT_REG)\r
-                               {\r
-                                       if (exten.compare("*") == 0)\r
-                                               list.push_back(static_cast<std::string>(dirp->d_name));\r
-                                       else\r
-                                               if (std::string(dirp->d_name).find(exten) != std::string::npos)\r
-                                                       list.push_back(static_cast<std::string>(dirp->d_name));\r
-                               }\r
-                       }\r
-                       closedir(dp);\r
-               #endif\r
-\r
-               return list;\r
-       }\r
-\r
-       std::vector<std::string> Directory::GetListFolders( const std::string& path, const std::string & exten, bool addPath )\r
-       {\r
-               std::vector<std::string> list;\r
-               std::string path_f = path + "/" + exten;\r
-               list.clear();\r
-               #ifdef WIN32\r
-                       WIN32_FIND_DATA FindFileData;\r
-                       HANDLE hFind;\r
-\r
-                       hFind = FindFirstFile((LPCSTR)path_f.c_str(), &FindFileData);\r
-                       if (hFind == INVALID_HANDLE_VALUE) \r
-                       {\r
-                               return list;\r
-                       }\r
-                       else\r
-                       {\r
-                               do\r
-                               {\r
-                                       if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY && \r
-                                               strcmp(FindFileData.cFileName, ".") != 0 && \r
-                                               strcmp(FindFileData.cFileName, "..") != 0)\r
-                                       {\r
-                                               if (addPath)\r
-                                                       list.push_back(path + "/" + FindFileData.cFileName);\r
-                                               else\r
-                                                       list.push_back(FindFileData.cFileName);\r
-                                       }\r
-                               } \r
-                               while(FindNextFile(hFind, &FindFileData));\r
-                               FindClose(hFind);  \r
-                       }\r
-\r
-               #else\r
-                       DIR *dp;\r
-                       struct dirent *dirp;\r
-                       if((dp = opendir(path_f.c_str())) == NULL) \r
-                       {\r
-                               return list;\r
-                       }\r
-\r
-                       while ((dirp = readdir(dp)) != NULL) \r
-                       {\r
-                               if (dirp->d_type == DT_DIR &&\r
-                                       strcmp(dirp->d_name, ".") != 0 && \r
-                                       strcmp(dirp->d_name, "..") != 0 )\r
-                               {\r
-                                       if (exten.compare("*") == 0)\r
-                                               list.push_back(static_cast<std::string>(dirp->d_name));\r
-                                       else\r
-                                               if (std::string(dirp->d_name).find(exten) != std::string::npos)\r
-                                                       list.push_back(static_cast<std::string>(dirp->d_name));\r
-                               }\r
-                       }\r
-                       closedir(dp);\r
-               #endif\r
-\r
-               return list;\r
-       }\r
-\r
-       std::vector<std::string> Directory::GetListFilesR ( const std::string& path, const std::string & exten, bool addPath )\r
-       {\r
-               std::vector<std::string> list = Directory::GetListFiles(path, exten, addPath);\r
-\r
-               std::vector<std::string> dirs = Directory::GetListFolders(path, exten, addPath);\r
-\r
-               std::vector<std::string>::const_iterator it;\r
-               for (it = dirs.begin(); it != dirs.end(); ++it)\r
-               {\r
-                       std::vector<std::string> cl = Directory::GetListFiles(*it, exten, addPath);\r
-                       list.insert(list.end(), cl.begin(), cl.end());\r
-               }\r
-\r
-               return list;\r
-       }\r
+    std::vector<std::string> Directory::GetListFiles(  const std::string& path, const std::string & exten, bool addPath )\r
+    {\r
+        std::vector<std::string> list;\r
+        list.clear();\r
+        std::string path_f = path + "/" + exten;\r
+        #ifdef WIN32\r
+            WIN32_FIND_DATA FindFileData;\r
+            HANDLE hFind;\r
+\r
+            hFind = FindFirstFile((LPCSTR)path_f.c_str(), &FindFileData);\r
+            if (hFind == INVALID_HANDLE_VALUE)\r
+            {\r
+                return list;\r
+            }\r
+            else\r
+            {\r
+                do\r
+                {\r
+                    if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_NORMAL  ||\r
+                        FindFileData.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE ||\r
+                        FindFileData.dwFileAttributes == FILE_ATTRIBUTE_HIDDEN  ||\r
+                        FindFileData.dwFileAttributes == FILE_ATTRIBUTE_SYSTEM  ||\r
+                        FindFileData.dwFileAttributes == FILE_ATTRIBUTE_READONLY)\r
+                    {\r
+                        if (addPath)\r
+                            list.push_back(path + "/" + FindFileData.cFileName);\r
+                        else\r
+                            list.push_back(FindFileData.cFileName);\r
+                    }\r
+                }\r
+                while(FindNextFile(hFind, &FindFileData));\r
+                FindClose(hFind);\r
+            }\r
+        #else\r
+            (void)addPath;\r
+            DIR *dp;\r
+            struct dirent *dirp;\r
+            if((dp = opendir(path.c_str())) == NULL)\r
+            {\r
+                return list;\r
+            }\r
+\r
+            while ((dirp = readdir(dp)) != NULL)\r
+            {\r
+                if (dirp->d_type == DT_REG)\r
+                {\r
+                    if (exten.compare("*") == 0)\r
+                        list.push_back(static_cast<std::string>(dirp->d_name));\r
+                    else\r
+                        if (std::string(dirp->d_name).find(exten) != std::string::npos)\r
+                            list.push_back(static_cast<std::string>(dirp->d_name));\r
+                }\r
+            }\r
+            closedir(dp);\r
+        #endif\r
+\r
+        return list;\r
+    }\r
+\r
+    std::vector<std::string> Directory::GetListFolders( const std::string& path, const std::string & exten, bool addPath )\r
+    {\r
+        std::vector<std::string> list;\r
+        std::string path_f = path + "/" + exten;\r
+        list.clear();\r
+        #ifdef WIN32\r
+            WIN32_FIND_DATA FindFileData;\r
+            HANDLE hFind;\r
+\r
+            hFind = FindFirstFile((LPCSTR)path_f.c_str(), &FindFileData);\r
+            if (hFind == INVALID_HANDLE_VALUE)\r
+            {\r
+                return list;\r
+            }\r
+            else\r
+            {\r
+                do\r
+                {\r
+                    if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY &&\r
+                        strcmp(FindFileData.cFileName, ".") != 0 &&\r
+                        strcmp(FindFileData.cFileName, "..") != 0)\r
+                    {\r
+                        if (addPath)\r
+                            list.push_back(path + "/" + FindFileData.cFileName);\r
+                        else\r
+                            list.push_back(FindFileData.cFileName);\r
+                    }\r
+                }\r
+                while(FindNextFile(hFind, &FindFileData));\r
+                FindClose(hFind);\r
+            }\r
+\r
+        #else\r
+            (void)addPath;\r
+            DIR *dp;\r
+            struct dirent *dirp;\r
+            if((dp = opendir(path_f.c_str())) == NULL)\r
+            {\r
+                return list;\r
+            }\r
+\r
+            while ((dirp = readdir(dp)) != NULL)\r
+            {\r
+                if (dirp->d_type == DT_DIR &&\r
+                    strcmp(dirp->d_name, ".") != 0 &&\r
+                    strcmp(dirp->d_name, "..") != 0 )\r
+                {\r
+                    if (exten.compare("*") == 0)\r
+                        list.push_back(static_cast<std::string>(dirp->d_name));\r
+                    else\r
+                        if (std::string(dirp->d_name).find(exten) != std::string::npos)\r
+                            list.push_back(static_cast<std::string>(dirp->d_name));\r
+                }\r
+            }\r
+            closedir(dp);\r
+        #endif\r
+\r
+        return list;\r
+    }\r
+\r
+    std::vector<std::string> Directory::GetListFilesR ( const std::string& path, const std::string & exten, bool addPath )\r
+    {\r
+        std::vector<std::string> list = Directory::GetListFiles(path, exten, addPath);\r
+\r
+        std::vector<std::string> dirs = Directory::GetListFolders(path, exten, addPath);\r
+\r
+        std::vector<std::string>::const_iterator it;\r
+        for (it = dirs.begin(); it != dirs.end(); ++it)\r
+        {\r
+            std::vector<std::string> cl = Directory::GetListFiles(*it, exten, addPath);\r
+            list.insert(list.end(), cl.begin(), cl.end());\r
+        }\r
+\r
+        return list;\r
+    }\r
 \r
 }\r
index 6227d9b..b5c9015 100644 (file)
@@ -1,55 +1,55 @@
 /*#******************************************************************************
 ** IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-** 
+**
 ** By downloading, copying, installing or using the software you agree to this license.
 ** If you do not agree to this license, do not download, install,
 ** copy or use the software.
-** 
-** 
+**
+**
 ** HVStools : interfaces allowing OpenCV users to integrate Human Vision System models. Presented models originate from Jeanny Herault's original research and have been reused and adapted by the author&collaborators for computed vision applications since his thesis with Alice Caplier at Gipsa-Lab.
 ** Use: extract still images & image sequences features, from contours details to motion spatio-temporal features, etc. for high level visual scene analysis. Also contribute to image enhancement/compression such as tone mapping.
-** 
+**
 ** Maintainers : Listic lab (code author current affiliation & applications) and Gipsa Lab (original research origins & applications)
-** 
+**
 **  Creation - enhancement process 2007-2011
 **      Author: Alexandre Benoit (benoit.alexandre.vision@gmail.com), LISTIC lab, Annecy le vieux, France
-** 
+**
 ** Theses algorithm have been developped by Alexandre BENOIT since his thesis with Alice Caplier at Gipsa-Lab (www.gipsa-lab.inpg.fr) and the research he pursues at LISTIC Lab (www.listic.univ-savoie.fr).
 ** Refer to the following research paper for more information:
 ** Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
 ** This work have been carried out thanks to Jeanny Herault who's research and great discussions are the basis of all this work, please take a look at his book:
 ** Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891.
-** 
+**
 ** The retina filter includes the research contributions of phd/research collegues from which code has been redrawn by the author :
 ** _take a look at the retinacolor.hpp module to discover Brice Chaix de Lavarene color mosaicing/demosaicing and the reference paper:
 ** ====> B. Chaix de Lavarene, D. Alleysson, B. Durette, J. Herault (2007). "Efficient demosaicing through recursive filtering", IEEE International Conference on Image Processing ICIP 2007
 ** _take a look at imagelogpolprojection.hpp to discover retina spatial log sampling which originates from Barthelemy Durette phd with Jeanny Herault. A Retina / V1 cortex projection is also proposed and originates from Jeanny's discussions.
 ** ====> more informations in the above cited Jeanny Heraults's book.
-** 
+**
 **                          License Agreement
 **               For Open Source Computer Vision Library
-** 
+**
 ** Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
 ** Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.
-** 
+**
 **               For Human Visual System tools (hvstools)
 ** Copyright (C) 2007-2011, LISTIC Lab, Annecy le Vieux and GIPSA Lab, Grenoble, France, all rights reserved.
-** 
+**
 ** Third party copyrights are property of their respective owners.
-** 
+**
 ** Redistribution and use in source and binary forms, with or without modification,
 ** are permitted provided that the following conditions are met:
-** 
+**
 ** * Redistributions of source code must retain the above copyright notice,
 **    this list of conditions and the following disclaimer.
-** 
+**
 ** * Redistributions in binary form must reproduce the above copyright notice,
 **    this list of conditions and the following disclaimer in the documentation
 **    and/or other materials provided with the distribution.
-** 
+**
 ** * The name of the copyright holders may not be used to endorse or promote products
 **    derived from this software without specific prior written permission.
-** 
+**
 ** This software is provided by the copyright holders and contributors "as is" and
 ** any express or implied warranties, including, but not limited to, the implied
 ** warranties of merchantability and fitness for a particular purpose are disclaimed.
@@ -103,95 +103,95 @@ namespace cv
 class MagnoRetinaFilter: public BasicRetinaFilter
 {
 public:
-       /**
-       * constructor parameters are only linked to image input size
-       * @param NBrows: number of rows of the input image
-       * @param NBcolumns: number of columns of the input image
-       */
-       MagnoRetinaFilter(const unsigned int NBrows, const unsigned int NBcolumns);
-
-
-       /**
-       * destructor
-       */
-       virtual ~MagnoRetinaFilter();
-
-       /**
-       * function that clears all buffers of the object
-       */
-       void clearAllBuffers();
-
-       /**
-       * resize retina magno filter object (resize all allocated buffers)
-       * @param NBrows: the new height size
-       * @param NBcolumns: the new width size
-       */
-       void resize(const unsigned int NBrows, const unsigned int NBcolumns);
-
-       /**
-       * set parameters values
-       * @param parasolCells_beta: the low pass filter gain used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), typical value is 0
-       * @param parasolCells_tau: the low pass filter time constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical value is 0 (immediate response)
-       * @param parasolCells_k: the low pass filter spatial constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical value is 5
-       * @param amacrinCellsTemporalCutFrequency: the time constant of the first order high pass fiter of the magnocellular way (motion information channel), unit is frames, tipicall value is 5
-       * @param localAdaptIntegration_tau: specifies the temporal constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation
-       * @param localAdaptIntegration_k: specifies the spatial constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation
-       */
-       void setCoefficientsTable(const float parasolCells_beta, const float parasolCells_tau, const float parasolCells_k, const float amacrinCellsTemporalCutFrequency, const float localAdaptIntegration_tau, const float localAdaptIntegration_k);
-
-       /**
-       * launch filter that runs all the IPL magno filter (model of the magnocellular channel of the Inner Plexiform Layer of the retina)
-       * @param OPL_ON: the output of the bipolar ON cells of the retina (available from the ParvoRetinaFilter class (getBipolarCellsON() function)
-       * @param OPL_OFF: the output of the bipolar OFF cells of the retina (available from the ParvoRetinaFilter class (getBipolarCellsOFF() function)
-       * @return the processed result without post-processing
-       */
-       const std::valarray<float> &runFilter(const std::valarray<float> &OPL_ON, const std::valarray<float> &OPL_OFF);
-
-       /**
-       * @return the Magnocellular ON channel filtering output
-       */
-       inline const std::valarray<float> &getMagnoON() const {return _magnoXOutputON;};
-
-       /**
-       * @return the Magnocellular OFF channel filtering output
-       */
-       inline const std::valarray<float> &getMagnoOFF() const {return _magnoXOutputOFF;};
-
-       /**
-       * @return the Magnocellular Y (sum of the ON and OFF magno channels) filtering output
-       */
-       inline const std::valarray<float> &getMagnoYsaturated() const {return *_magnoYsaturated;};
-
-       /**
-       * applies an image normalization which saturates the high output values by the use of an assymetric sigmoide
-       */
-       inline void normalizeGrayOutputNearZeroCentreredSigmoide(){_filterOutput.normalizeGrayOutputNearZeroCentreredSigmoide(&(*_magnoYOutput)[0], &(*_magnoYsaturated)[0]);};
-
-       /**
-       * @return the horizontal cells' temporal constant
-       */
-       inline const float getTemporalConstant(){return this->_filteringCoeficientsTable[2];};
+    /**
+    * constructor parameters are only linked to image input size
+    * @param NBrows: number of rows of the input image
+    * @param NBcolumns: number of columns of the input image
+    */
+    MagnoRetinaFilter(const unsigned int NBrows, const unsigned int NBcolumns);
+
+
+    /**
+    * destructor
+    */
+    virtual ~MagnoRetinaFilter();
+
+    /**
+    * function that clears all buffers of the object
+    */
+    void clearAllBuffers();
+
+    /**
+    * resize retina magno filter object (resize all allocated buffers)
+    * @param NBrows: the new height size
+    * @param NBcolumns: the new width size
+    */
+    void resize(const unsigned int NBrows, const unsigned int NBcolumns);
+
+    /**
+    * set parameters values
+    * @param parasolCells_beta: the low pass filter gain used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), typical value is 0
+    * @param parasolCells_tau: the low pass filter time constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical value is 0 (immediate response)
+    * @param parasolCells_k: the low pass filter spatial constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical value is 5
+    * @param amacrinCellsTemporalCutFrequency: the time constant of the first order high pass fiter of the magnocellular way (motion information channel), unit is frames, tipicall value is 5
+    * @param localAdaptIntegration_tau: specifies the temporal constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation
+    * @param localAdaptIntegration_k: specifies the spatial constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation
+    */
+    void setCoefficientsTable(const float parasolCells_beta, const float parasolCells_tau, const float parasolCells_k, const float amacrinCellsTemporalCutFrequency, const float localAdaptIntegration_tau, const float localAdaptIntegration_k);
+
+    /**
+    * launch filter that runs all the IPL magno filter (model of the magnocellular channel of the Inner Plexiform Layer of the retina)
+    * @param OPL_ON: the output of the bipolar ON cells of the retina (available from the ParvoRetinaFilter class (getBipolarCellsON() function)
+    * @param OPL_OFF: the output of the bipolar OFF cells of the retina (available from the ParvoRetinaFilter class (getBipolarCellsOFF() function)
+    * @return the processed result without post-processing
+    */
+    const std::valarray<float> &runFilter(const std::valarray<float> &OPL_ON, const std::valarray<float> &OPL_OFF);
+
+    /**
+    * @return the Magnocellular ON channel filtering output
+    */
+    inline const std::valarray<float> &getMagnoON() const {return _magnoXOutputON;};
+
+    /**
+    * @return the Magnocellular OFF channel filtering output
+    */
+    inline const std::valarray<float> &getMagnoOFF() const {return _magnoXOutputOFF;};
+
+    /**
+    * @return the Magnocellular Y (sum of the ON and OFF magno channels) filtering output
+    */
+    inline const std::valarray<float> &getMagnoYsaturated() const {return *_magnoYsaturated;};
+
+    /**
+    * applies an image normalization which saturates the high output values by the use of an assymetric sigmoide
+    */
+    inline void normalizeGrayOutputNearZeroCentreredSigmoide(){_filterOutput.normalizeGrayOutputNearZeroCentreredSigmoide(&(*_magnoYOutput)[0], &(*_magnoYsaturated)[0]);};
+
+    /**
+    * @return the horizontal cells' temporal constant
+    */
+    inline float getTemporalConstant(){return this->_filteringCoeficientsTable[2];};
 
 private:
 
-       // related pointers to these buffers
-       std::valarray<float> _previousInput_ON;
-       std::valarray<float> _previousInput_OFF;
-       std::valarray<float> _amacrinCellsTempOutput_ON;
-       std::valarray<float> _amacrinCellsTempOutput_OFF;
-       std::valarray<float> _magnoXOutputON;
-       std::valarray<float> _magnoXOutputOFF;
-       std::valarray<float> _localProcessBufferON;
-       std::valarray<float> _localProcessBufferOFF;
-       // reference to parent buffers and allow better readability
-       TemplateBuffer<float> *_magnoYOutput;
-       std::valarray<float> *_magnoYsaturated;
-
-       // varialbles
-       float _temporalCoefficient;
-
-       // amacrine cells filter : high pass temporal filter
-       void _amacrineCellsComputing(const float *ONinput, const float *OFFinput);
+    // related pointers to these buffers
+    std::valarray<float> _previousInput_ON;
+    std::valarray<float> _previousInput_OFF;
+    std::valarray<float> _amacrinCellsTempOutput_ON;
+    std::valarray<float> _amacrinCellsTempOutput_OFF;
+    std::valarray<float> _magnoXOutputON;
+    std::valarray<float> _magnoXOutputOFF;
+    std::valarray<float> _localProcessBufferON;
+    std::valarray<float> _localProcessBufferOFF;
+    // reference to parent buffers and allow better readability
+    TemplateBuffer<float> *_magnoYOutput;
+    std::valarray<float> *_magnoYsaturated;
+
+    // varialbles
+    float _temporalCoefficient;
+
+    // amacrine cells filter : high pass temporal filter
+    void _amacrineCellsComputing(const float *ONinput, const float *OFFinput);
 
 
 };
index 9938a88..54521b1 100644 (file)
@@ -195,12 +195,12 @@ public:
        /**
        * @return the photoreceptors's temporal constant
        */
-       inline const float getPhotoreceptorsTemporalConstant(){return this->_filteringCoeficientsTable[2];};
+       inline float getPhotoreceptorsTemporalConstant(){return this->_filteringCoeficientsTable[2];};
 
        /**
        * @return the horizontal cells' temporal constant
        */
-       inline const float getHcellsTemporalConstant(){return this->_filteringCoeficientsTable[5];};
+       inline float getHcellsTemporalConstant(){return this->_filteringCoeficientsTable[5];};
 
 private:
        // template buffers
index 6418620..f98b050 100644 (file)
@@ -687,7 +687,7 @@ void RetinaColor::_computeGradient(const float *luminance)
        }
 
 }
-const bool RetinaColor::applyKrauskopfLMS2Acr1cr2Transform(std::valarray<float> &result)
+bool RetinaColor::applyKrauskopfLMS2Acr1cr2Transform(std::valarray<float> &result)
 {
        bool processSuccess=true;
        // basic preliminary error check
@@ -703,7 +703,7 @@ const bool RetinaColor::applyKrauskopfLMS2Acr1cr2Transform(std::valarray<float>
        return processSuccess;
 }
 
-const bool RetinaColor::applyLMS2LabTransform(std::valarray<float> &result)
+bool RetinaColor::applyLMS2LabTransform(std::valarray<float> &result)
 {
        bool processSuccess=true;
        // basic preliminary error check
index 3aa96cd..622f9a0 100644 (file)
@@ -163,14 +163,14 @@ public:
        * @param result: the input buffer to fill with the transformed colorspace retina output
        * @return true if process ended successfully
        */
-       const bool applyKrauskopfLMS2Acr1cr2Transform(std::valarray<float> &result);
+       bool applyKrauskopfLMS2Acr1cr2Transform(std::valarray<float> &result);
 
        /**
        * apply to the retina color output the CIE Lab color transformation
        * @param result: the input buffer to fill with the transformed colorspace retina output
        * @return true if process ended successfully
        */
-       const bool applyLMS2LabTransform(std::valarray<float> &result);
+       bool applyLMS2LabTransform(std::valarray<float> &result);
 
        /**
        * @return the multiplexed frame result (use this after function runColorMultiplexing)
index c187776..2d29dc4 100644 (file)
@@ -1,55 +1,55 @@
 /*#******************************************************************************
 ** IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-** 
+**
 ** By downloading, copying, installing or using the software you agree to this license.
 ** If you do not agree to this license, do not download, install,
 ** copy or use the software.
-** 
-** 
+**
+**
 ** HVStools : interfaces allowing OpenCV users to integrate Human Vision System models. Presented models originate from Jeanny Herault's original research and have been reused and adapted by the author&collaborators for computed vision applications since his thesis with Alice Caplier at Gipsa-Lab.
 ** Use: extract still images & image sequences features, from contours details to motion spatio-temporal features, etc. for high level visual scene analysis. Also contribute to image enhancement/compression such as tone mapping.
-** 
+**
 ** Maintainers : Listic lab (code author current affiliation & applications) and Gipsa Lab (original research origins & applications)
-** 
+**
 **  Creation - enhancement process 2007-2011
 **      Author: Alexandre Benoit (benoit.alexandre.vision@gmail.com), LISTIC lab, Annecy le vieux, France
-** 
+**
 ** Theses algorithm have been developped by Alexandre BENOIT since his thesis with Alice Caplier at Gipsa-Lab (www.gipsa-lab.inpg.fr) and the research he pursues at LISTIC Lab (www.listic.univ-savoie.fr).
 ** Refer to the following research paper for more information:
 ** Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
 ** This work have been carried out thanks to Jeanny Herault who's research and great discussions are the basis of all this work, please take a look at his book:
 ** Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891.
-** 
+**
 ** The retina filter includes the research contributions of phd/research collegues from which code has been redrawn by the author :
 ** _take a look at the retinacolor.hpp module to discover Brice Chaix de Lavarene color mosaicing/demosaicing and the reference paper:
 ** ====> B. Chaix de Lavarene, D. Alleysson, B. Durette, J. Herault (2007). "Efficient demosaicing through recursive filtering", IEEE International Conference on Image Processing ICIP 2007
 ** _take a look at imagelogpolprojection.hpp to discover retina spatial log sampling which originates from Barthelemy Durette phd with Jeanny Herault. A Retina / V1 cortex projection is also proposed and originates from Jeanny's discussions.
 ** ====> more informations in the above cited Jeanny Heraults's book.
-** 
+**
 **                          License Agreement
 **               For Open Source Computer Vision Library
-** 
+**
 ** Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
 ** Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.
-** 
+**
 **               For Human Visual System tools (hvstools)
 ** Copyright (C) 2007-2011, LISTIC Lab, Annecy le Vieux and GIPSA Lab, Grenoble, France, all rights reserved.
-** 
+**
 ** Third party copyrights are property of their respective owners.
-** 
+**
 ** Redistribution and use in source and binary forms, with or without modification,
 ** are permitted provided that the following conditions are met:
-** 
+**
 ** * Redistributions of source code must retain the above copyright notice,
 **    this list of conditions and the following disclaimer.
-** 
+**
 ** * Redistributions in binary form must reproduce the above copyright notice,
 **    this list of conditions and the following disclaimer in the documentation
 **    and/or other materials provided with the distribution.
-** 
+**
 ** * The name of the copyright holders may not be used to endorse or promote products
 **    derived from this software without specific prior written permission.
-** 
+**
 ** This software is provided by the copyright holders and contributors "as is" and
 ** any express or implied warranties, including, but not limited to, the implied
 ** warranties of merchantability and fitness for a particular purpose are disclaimed.
@@ -126,7 +126,7 @@ namespace cv
         clearAllBuffers();
 
 
-        //     std::cout<<"RetinaFilter::size( "<<this->getNBrows()<<", "<<this->getNBcolumns()<<")"<<_filterOutput.size()<<" =? "<<_filterOutput.getNBpixels()<<std::endl;
+        //  std::cout<<"RetinaFilter::size( "<<this->getNBrows()<<", "<<this->getNBcolumns()<<")"<<_filterOutput.size()<<" =? "<<_filterOutput.getNBpixels()<<std::endl;
 
     }
 
@@ -240,7 +240,7 @@ namespace cv
         _setInitPeriodCount();
     }
 
-    const bool RetinaFilter::checkInput(const std::valarray<float> &input, const bool)
+    bool RetinaFilter::checkInput(const std::valarray<float> &input, const bool)
     {
 
         BasicRetinaFilter *inputTarget=&_photoreceptorsPrefilter;
@@ -259,7 +259,7 @@ namespace cv
     }
 
     // main function that runs the filter for a given input frame
-    const bool RetinaFilter::runFilter(const std::valarray<float> &imageInput, const bool useAdaptiveFiltering, const bool processRetinaParvoMagnoMapping, const bool useColorMode, const bool inputIsColorMultiplexed)
+    bool RetinaFilter::runFilter(const std::valarray<float> &imageInput, const bool useAdaptiveFiltering, const bool processRetinaParvoMagnoMapping, const bool useColorMode, const bool inputIsColorMultiplexed)
     {
         // preliminary check
         bool processSuccess=true;
@@ -488,7 +488,7 @@ namespace cv
 
     }
 
-    const bool RetinaFilter::getParvoFoveaResponse(std::valarray<float> &parvoFovealResponse)
+    bool RetinaFilter::getParvoFoveaResponse(std::valarray<float> &parvoFovealResponse)
     {
         if (!_useParvoOutput)
             return false;
@@ -508,7 +508,7 @@ namespace cv
     }
 
     // method to retrieve the parafoveal magnocellular pathway response (no energy motion in fovea)
-    const bool RetinaFilter::getMagnoParaFoveaResponse(std::valarray<float> &magnoParafovealResponse)
+    bool RetinaFilter::getMagnoParaFoveaResponse(std::valarray<float> &magnoParafovealResponse)
     {
         if (!_useMagnoOutput)
             return false;
index 5b3d229..7fa2a07 100644 (file)
@@ -1,55 +1,55 @@
 /*#******************************************************************************
 ** IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-** 
+**
 ** By downloading, copying, installing or using the software you agree to this license.
 ** If you do not agree to this license, do not download, install,
 ** copy or use the software.
-** 
-** 
+**
+**
 ** HVStools : interfaces allowing OpenCV users to integrate Human Vision System models. Presented models originate from Jeanny Herault's original research and have been reused and adapted by the author&collaborators for computed vision applications since his thesis with Alice Caplier at Gipsa-Lab.
 ** Use: extract still images & image sequences features, from contours details to motion spatio-temporal features, etc. for high level visual scene analysis. Also contribute to image enhancement/compression such as tone mapping.
-** 
+**
 ** Maintainers : Listic lab (code author current affiliation & applications) and Gipsa Lab (original research origins & applications)
-** 
+**
 **  Creation - enhancement process 2007-2011
 **      Author: Alexandre Benoit (benoit.alexandre.vision@gmail.com), LISTIC lab, Annecy le vieux, France
-** 
+**
 ** Theses algorithm have been developped by Alexandre BENOIT since his thesis with Alice Caplier at Gipsa-Lab (www.gipsa-lab.inpg.fr) and the research he pursues at LISTIC Lab (www.listic.univ-savoie.fr).
 ** Refer to the following research paper for more information:
 ** Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
 ** This work have been carried out thanks to Jeanny Herault who's research and great discussions are the basis of all this work, please take a look at his book:
 ** Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891.
-** 
+**
 ** The retina filter includes the research contributions of phd/research collegues from which code has been redrawn by the author :
 ** _take a look at the retinacolor.hpp module to discover Brice Chaix de Lavarene color mosaicing/demosaicing and the reference paper:
 ** ====> B. Chaix de Lavarene, D. Alleysson, B. Durette, J. Herault (2007). "Efficient demosaicing through recursive filtering", IEEE International Conference on Image Processing ICIP 2007
 ** _take a look at imagelogpolprojection.hpp to discover retina spatial log sampling which originates from Barthelemy Durette phd with Jeanny Herault. A Retina / V1 cortex projection is also proposed and originates from Jeanny's discussions.
 ** ====> more informations in the above cited Jeanny Heraults's book.
-** 
+**
 **                          License Agreement
 **               For Open Source Computer Vision Library
-** 
+**
 ** Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
 ** Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.
-** 
+**
 **               For Human Visual System tools (hvstools)
 ** Copyright (C) 2007-2011, LISTIC Lab, Annecy le Vieux and GIPSA Lab, Grenoble, France, all rights reserved.
-** 
+**
 ** Third party copyrights are property of their respective owners.
-** 
+**
 ** Redistribution and use in source and binary forms, with or without modification,
 ** are permitted provided that the following conditions are met:
-** 
+**
 ** * Redistributions of source code must retain the above copyright notice,
 **    this list of conditions and the following disclaimer.
-** 
+**
 ** * Redistributions in binary form must reproduce the above copyright notice,
 **    this list of conditions and the following disclaimer in the documentation
 **    and/or other materials provided with the distribution.
-** 
+**
 ** * The name of the copyright holders may not be used to endorse or promote products
 **    derived from this software without specific prior written permission.
-** 
+**
 ** This software is provided by the copyright holders and contributors "as is" and
 ** any express or implied warranties, including, but not limited to, the implied
 ** warranties of merchantability and fitness for a particular purpose are disclaimed.
@@ -116,427 +116,427 @@ class RetinaFilter//: public BasicRetinaFilter
 {
 public:
 
-       /**
-       * constructor of the retina filter model with log sampling of the input frame (models the photoreceptors log sampling (central high resolution fovea and lower precision borders))
-       * @param sizeRows: number of rows of the input image
-       * @param sizeColumns: number of columns of the input image
-       * @param colorMode: specifies if the retina works with color (true) of stays in grayscale processing (false), can be adjusted online by the use of setColorMode method
-       * @param samplingMethod: specifies which kind of color sampling will be used
-       * @param useRetinaLogSampling: activate retina log sampling, if true, the 2 following parameters can be used
-       * @param reductionFactor: only usefull if param useRetinaLogSampling=true, specifies the reduction factor of the output frame (as the center (fovea) is high resolution and corners can be underscaled, then a reduction of the output is allowed without precision leak
-       * @param samplingStrenght: only usefull if param useRetinaLogSampling=true, specifies the strenght of the log scale that is applied
-       */
-       RetinaFilter(const unsigned int sizeRows, const unsigned int sizeColumns, const bool colorMode=false, const RETINA_COLORSAMPLINGMETHOD samplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0);
-
-       /**
-       * standard destructor
-       */
-       ~RetinaFilter();
-
-       /**
-       * function that clears all buffers of the object
-       */
-       void clearAllBuffers();
-
-       /**
-       * resize retina parvo filter object (resize all allocated buffers)
-       * @param NBrows: the new height size
-       * @param NBcolumns: the new width size
-       */
-       void resize(const unsigned int NBrows, const unsigned int NBcolumns);
-
-       /**
-       * Input buffer checker: allows to check if the passed image buffer corresponds to retina filter expectations
-       * @param input: the input image buffer
-       * @param colorMode: specifiy if the input should be considered by the retina as colored of not
-       * @return false if not compatible or it returns true if OK
-       */
-       const bool checkInput(const std::valarray<float> &input, const bool colorMode);
-
-       /**
-       * run the initilized retina filter, after this call all retina outputs are updated
-       * @param imageInput: image input buffer, can be grayscale or RGB image respecting the size specified at the constructor level
-       * @param useAdaptiveFiltering: set true if you want to use adaptive color demultilexing (solve some color artefact problems), see RetinaColor for citation references
-       * @param processRetinaParvoMagnoMapping: tels if the main outputs takes into account the mapping of the Parvo and Magno channels on the retina (centred parvo (fovea) and magno outside (parafovea))
-       * @param useColorMode: color information is used if true, warning, if input is only gray level, a buffer overflow error will occur
-       -> note that if color mode is activated and processRetinaParvoMagnoMapping==true, then the demultiplexed color frame (accessible throw getColorOutput() will be a color contours frame in the fovea and gray level moving contours outside
-       @param inputIsColorMultiplexed: set trus if the input data is a multiplexed color image (using Bayer sampling for example), the color sampling method must correspond to the RETINA_COLORSAMPLINGMETHOD passed at constructor!
-       * @return true if process ran well, false in case of failure
-       */
-       const bool runFilter(const std::valarray<float> &imageInput, const bool useAdaptiveFiltering=true, const bool processRetinaParvoMagnoMapping=false, const bool useColorMode=false, const bool inputIsColorMultiplexed=false);
-
-       /**
-       * run the initilized retina filter in order to perform color tone mapping applied on an RGB image, after this call the color output of the retina is updated (use function getColorOutput() to grab it)
-       * the algorithm is based on David Alleyson, Sabine Susstruck and Laurence Meylan's work, please cite:
-       * -> Meylan L., Alleysson D., and S�sstrunk S., A Model of Retinal Local Adaptation for the Tone Mapping of Color Filter Array Images, Journal of Optical Society of America, A, Vol. 24, N� 9, September, 1st, 2007, pp. 2807-2816
-       * get the resulting gray frame by calling function getParvoColor()
-       * @param grayImageInput: RGB image input buffer respecting the size specified at the constructor level
-       * @param PhotoreceptorsCompression: sets the log compression parameters applied at the photoreceptors level (enhance luminance in dark areas)
-       * @param ganglionCellsCompression: sets the log compression applied at the gnaglion cells output (enhance contrast)
-       */
-       void runGrayToneMapping(const std::valarray<float> &grayImageInput, std::valarray<float> &grayImageOutput, const float PhotoreceptorsCompression=0.6, const float ganglionCellsCompression=0.6);
-
-       /**
-       * run the initilized retina filter in order to perform color tone mapping applied on an RGB image, after this call the color output of the retina is updated (use function getColorOutput() to grab it)
-       * the algorithm is based on David Alleyson, Sabine Susstruck and Laurence Meylan's work, please cite:
-       * -> Meylan L., Alleysson D., and S�sstrunk S., A Model of Retinal Local Adaptation for the Tone Mapping of Color Filter Array Images, Journal of Optical Society of America, A, Vol. 24, N� 9, September, 1st, 2007, pp. 2807-2816
-       * get the resulting RGB frame by calling function getParvoColor()
-       * @param RGBimageInput: RGB image input buffer respecting the size specified at the constructor level
-       * @param useAdaptiveFiltering: set true if you want to use adaptive color demultilexing (solve some color artefact problems), see RetinaColor for citation references
-       * @param PhotoreceptorsCompression: sets the log compression parameters applied at the photoreceptors level (enhance luminance in dark areas)
-       * @param ganglionCellsCompression: sets the log compression applied at the ganglion cells output (enhance contrast)
-       */
-       void runRGBToneMapping(const std::valarray<float> &RGBimageInput, std::valarray<float> &imageOutput, const bool useAdaptiveFiltering, const float PhotoreceptorsCompression=0.6, const float ganglionCellsCompression=0.6);
-
-       /**
-       * run the initilized retina filter in order to perform color tone mapping applied on an RGB image, after this call the color output of the retina is updated (use function getColorOutput() to grab it)
-       * get the resulting RGB frame by calling function getParvoColor()
-       * @param LMSimageInput: RGB image input buffer respecting the size specified at the constructor level
-       * @param useAdaptiveFiltering: set true if you want to use adaptive color demultilexing (solve some color artefact problems), see RetinaColor for citation references
-       * @param PhotoreceptorsCompression: sets the log compression parameters applied at the photoreceptors level (enhance luminance in dark areas)
-       * @param ganglionCellsCompression: sets the log compression applied at the gnaglion cells output (enhance contrast)
-       */
-       void runLMSToneMapping(const std::valarray<float> &LMSimageInput, std::valarray<float> &imageOutput, const bool useAdaptiveFiltering, const float PhotoreceptorsCompression=0.6, const float ganglionCellsCompression=0.6);
-
-       /**
-       * set up function of the retina filter: all the retina is initialized at this step, some specific parameters are set by default, use setOPLandParvoCoefficientsTable() and setMagnoCoefficientsTable in order to setup the retina with more options
-       * @param OPLspatialResponse1: (equal to k1 in setOPLandParvoCoefficientsTable() function) the spatial constant of the first order low pass filter of the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is pixels, typical value is 1 pixel
-       * @param OPLtemporalresponse1: (equal to tau1 in setOPLandParvoCoefficientsTable() function) the time constant of the first order low pass filter of the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is frames, typical value is 1 frame
-       * @param OPLassymetryGain: (equal to beta2 in setOPLandParvoCoefficientsTable() function) gain of the horizontal cells network, if 0, then the mean value of the output is zero, if the parameter is near 1, then, the luminance is not filtered and is still reachable at the output, typicall value is 0
-       * @param OPLspatialResponse2: (equal to k2 in setOPLandParvoCoefficientsTable() function) the spatial constant of the first order low pass filter of the horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels, typical value is 5 pixel
-       * @param OPLtemporalresponse2: (equal to tau2 in setOPLandParvoCoefficientsTable() function) the time constant of the first order low pass filter of the horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is frames, typical value is 1 frame, as the photoreceptors
-       * @param LPfilterSpatialResponse: (equal to parasolCells_k in setMagnoCoefficientsTable() function) the low pass filter spatial constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical value is 5
-       * @param LPfilterGain: (equal to parasolCells_beta in setMagnoCoefficientsTable() function) the low pass filter gain used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), typical value is 0
-       * @param LPfilterTemporalresponse: (equal to parasolCells_tau in setMagnoCoefficientsTable() function) the low pass filter time constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical value is 0 (immediate response)
-       * @param MovingContoursExtractorCoefficient: (equal to amacrinCellsTemporalCutFrequency in setMagnoCoefficientsTable() function)the time constant of the first order high pass fiter of the magnocellular way (motion information channel), unit is frames, tipicall value is 5
-       * @param normalizeParvoOutput_0_maxOutputValue: specifies if the Parvo cellular output should be normalized between 0 and maxOutputValue (true) or not (false) in order to remain at a null mean value, true value is recommended for visualisation
-       * @param normalizeMagnoOutput_0_maxOutputValue: specifies if the Magno cellular output should be normalized between 0 and maxOutputValue (true) or not (false), setting true may be hazardous because it can enhace the noise response when nothing is moving
-       * @param maxOutputValue: the maximum amplitude value of the normalized outputs (generally 255 for 8bit per channel pictures)
-       * @param maxInputValue: the maximum pixel value of the input picture (generally 255 for 8bit per channel pictures), specify it in other case (for example High Dynamic Range Images)
-       * @param meanValue: the global mean value of the input data usefull for local adaptation setup
-       */
-       void setGlobalParameters(const float OPLspatialResponse1=0.7, const float OPLtemporalresponse1=1, const float OPLassymetryGain=0, const float OPLspatialResponse2=5, const float OPLtemporalresponse2=1, const float LPfilterSpatialResponse=5, const float LPfilterGain=0, const float LPfilterTemporalresponse=0, const float MovingContoursExtractorCoefficient=5, const bool normalizeParvoOutput_0_maxOutputValue=false, const bool normalizeMagnoOutput_0_maxOutputValue=false, const float maxOutputValue=255.0, const float maxInputValue=255.0, const float meanValue=128.0);
-
-       /**
-       * setup the local luminance adaptation capability
-       * @param V0CompressionParameter: the compression strengh of the photoreceptors local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 160
-       */
-       inline void setPhotoreceptorsLocalAdaptationSensitivity(const float V0CompressionParameter){_photoreceptorsPrefilter.setV0CompressionParameter(1-V0CompressionParameter);_setInitPeriodCount();};
-
-       /**
-       * setup the local luminance adaptation capability
-       * @param V0CompressionParameter: the compression strengh of the parvocellular pathway (details) local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 160
-       */
-       inline void setParvoGanglionCellsLocalAdaptationSensitivity(const float V0CompressionParameter){_ParvoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount();};
-
-       /**
-       * setup the local luminance adaptation area of integration
-       * @param spatialResponse: the spatial constant of the low pass filter applied on the bipolar cells output in order to compute local contrast mean values
-       * @param temporalResponse: the spatial constant of the low pass filter applied on the bipolar cells output in order to compute local contrast mean values (generally set to zero: immediate response)
-       */
-       inline void setGanglionCellsLocalAdaptationLPfilterParameters(const float spatialResponse, const float temporalResponse){_ParvoRetinaFilter.setGanglionCellsLocalAdaptationLPfilterParameters(temporalResponse, spatialResponse);_setInitPeriodCount();};
-
-       /**
-       * setup the local luminance adaptation capability
-       * @param V0CompressionParameter: the compression strengh of the magnocellular pathway (motion) local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 160
-       */
-       inline void setMagnoGanglionCellsLocalAdaptationSensitivity(const float V0CompressionParameter){_MagnoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount();};
-
-       /**
-       * setup the OPL and IPL parvo channels
-       * @param beta1: gain of the horizontal cells network, if 0, then the mean value of the output is zero (default value), if the parameter is near 1, the amplitude is boosted but it should only be used for values rescaling... if needed
-       * @param tau1: the time constant of the first order low pass filter of the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is frames, typical value is 1 frame
-       * @param k1: the spatial constant of the first order low pass filter of the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is pixels, typical value is 1 pixel
-       * @param beta2: gain of the horizontal cells network, if 0, then the mean value of the output is zero, if the parameter is near 1, then, the luminance is not filtered and is still reachable at the output, typicall value is 0
-       * @param tau2: the time constant of the first order low pass filter of the horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is frames, typical value is 1 frame, as the photoreceptors
-       * @param k2: the spatial constant of the first order low pass filter of the horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels, typical value is 5 pixel, this value is also used for local contrast computing when computing the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular channel model)
-       * @param V0CompressionParameter: the compression strengh of the ganglion cells local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 230
-       */
-       void setOPLandParvoParameters(const float beta1, const float tau1, const float k1, const float beta2, const float tau2, const float k2, const float V0CompressionParameter){_ParvoRetinaFilter.setOPLandParvoFiltersParameters(beta1, tau1, k1, beta2, tau2, k2);_ParvoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount();};
-
-       /**
-       * set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel
-       * @param parasolCells_beta: the low pass filter gain used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), typical value is 0
-       * @param parasolCells_tau: the low pass filter time constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical value is 0 (immediate response)
-       * @param parasolCells_k: the low pass filter spatial constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical value is 5
-       * @param amacrinCellsTemporalCutFrequency: the time constant of the first order high pass fiter of the magnocellular way (motion information channel), unit is frames, tipicall value is 5
-       * @param V0CompressionParameter: the compression strengh of the ganglion cells local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 200
-       * @param localAdaptintegration_tau: specifies the temporal constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation
-       * @param localAdaptintegration_k: specifies the spatial constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation
-       */
-       void setMagnoCoefficientsTable(const float parasolCells_beta, const float parasolCells_tau, const float parasolCells_k, const float amacrinCellsTemporalCutFrequency, const float V0CompressionParameter, const float localAdaptintegration_tau, const float localAdaptintegration_k){_MagnoRetinaFilter.setCoefficientsTable(parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, localAdaptintegration_tau, localAdaptintegration_k);_MagnoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount();};
-
-       /**
-       * set if the parvo output should be or not normalized between 0 and 255 (for display purpose generally)
-       * @param normalizeParvoOutput_0_maxOutputValue: true if normalization should be done
-       */
-       inline void activateNormalizeParvoOutput_0_maxOutputValue(const bool normalizeParvoOutput_0_maxOutputValue){_normalizeParvoOutput_0_maxOutputValue=normalizeParvoOutput_0_maxOutputValue;};
-
-       /**
-       * set if the magno output should be or not normalized between 0 and 255 (for display purpose generally), take care, if nothing is moving, then, the noise will be enanced !!!
-       * @param normalizeMagnoOutput_0_maxOutputValue: true if normalization should be done
-       */
-       inline void activateNormalizeMagnoOutput_0_maxOutputValue(const bool normalizeMagnoOutput_0_maxOutputValue){_normalizeMagnoOutput_0_maxOutputValue=normalizeMagnoOutput_0_maxOutputValue;};
-
-       /**
-       * setup the maximum amplitude value of the normalized outputs (generally 255 for 8bit per channel pictures)
-       * @param maxOutputValue: maximum amplitude value of the normalized outputs (generally 255 for 8bit per channel pictures)
-       */
-       inline void setMaxOutputValue(const float maxOutputValue){_maxOutputValue=maxOutputValue;};
-
-       /**
-       * sets the color mode of the frame grabber
-       * @param desiredColorMode: true if the user needs color information, false for graylevels
-       */
-       void setColorMode(const bool desiredColorMode){_useColorMode=desiredColorMode;};
-
-       /**
-       * activate color saturation as the final step of the color demultiplexing process
-       * -> this saturation is a sigmoide function applied to each channel of the demultiplexed image.
-       * @param saturateColors: boolean that activates color saturation (if true) or desactivate (if false)
-       * @param colorSaturationValue: the saturation factor
-       * */
-       inline void setColorSaturation(const bool saturateColors=true, const float colorSaturationValue=4.0){_colorEngine.setColorSaturation(saturateColors, colorSaturationValue);};
-
-       /////////////////////////////////////////////////////////////////
-       // function that retrieve the main retina outputs, one by one, or all in a structure
-
-       /**
-       * @return the input image sampled by the photoreceptors spatial sampling
-       */
-       inline const std::valarray<float> &getPhotoreceptorsSampledFrame() const
+    /**
+    * constructor of the retina filter model with log sampling of the input frame (models the photoreceptors log sampling (central high resolution fovea and lower precision borders))
+    * @param sizeRows: number of rows of the input image
+    * @param sizeColumns: number of columns of the input image
+    * @param colorMode: specifies if the retina works with color (true) of stays in grayscale processing (false), can be adjusted online by the use of setColorMode method
+    * @param samplingMethod: specifies which kind of color sampling will be used
+    * @param useRetinaLogSampling: activate retina log sampling, if true, the 2 following parameters can be used
+    * @param reductionFactor: only usefull if param useRetinaLogSampling=true, specifies the reduction factor of the output frame (as the center (fovea) is high resolution and corners can be underscaled, then a reduction of the output is allowed without precision leak
+    * @param samplingStrenght: only usefull if param useRetinaLogSampling=true, specifies the strenght of the log scale that is applied
+    */
+    RetinaFilter(const unsigned int sizeRows, const unsigned int sizeColumns, const bool colorMode=false, const RETINA_COLORSAMPLINGMETHOD samplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0);
+
+    /**
+    * standard destructor
+    */
+    ~RetinaFilter();
+
+    /**
+    * function that clears all buffers of the object
+    */
+    void clearAllBuffers();
+
+    /**
+    * resize retina parvo filter object (resize all allocated buffers)
+    * @param NBrows: the new height size
+    * @param NBcolumns: the new width size
+    */
+    void resize(const unsigned int NBrows, const unsigned int NBcolumns);
+
+    /**
+    * Input buffer checker: allows to check if the passed image buffer corresponds to retina filter expectations
+    * @param input: the input image buffer
+    * @param colorMode: specifiy if the input should be considered by the retina as colored of not
+    * @return false if not compatible or it returns true if OK
+    */
+    bool checkInput(const std::valarray<float> &input, const bool colorMode);
+
+    /**
+    * run the initilized retina filter, after this call all retina outputs are updated
+    * @param imageInput: image input buffer, can be grayscale or RGB image respecting the size specified at the constructor level
+    * @param useAdaptiveFiltering: set true if you want to use adaptive color demultilexing (solve some color artefact problems), see RetinaColor for citation references
+    * @param processRetinaParvoMagnoMapping: tels if the main outputs takes into account the mapping of the Parvo and Magno channels on the retina (centred parvo (fovea) and magno outside (parafovea))
+    * @param useColorMode: color information is used if true, warning, if input is only gray level, a buffer overflow error will occur
+    -> note that if color mode is activated and processRetinaParvoMagnoMapping==true, then the demultiplexed color frame (accessible throw getColorOutput() will be a color contours frame in the fovea and gray level moving contours outside
+    @param inputIsColorMultiplexed: set trus if the input data is a multiplexed color image (using Bayer sampling for example), the color sampling method must correspond to the RETINA_COLORSAMPLINGMETHOD passed at constructor!
+    * @return true if process ran well, false in case of failure
+    */
+    bool runFilter(const std::valarray<float> &imageInput, const bool useAdaptiveFiltering=true, const bool processRetinaParvoMagnoMapping=false, const bool useColorMode=false, const bool inputIsColorMultiplexed=false);
+
+    /**
+    * run the initilized retina filter in order to perform color tone mapping applied on an RGB image, after this call the color output of the retina is updated (use function getColorOutput() to grab it)
+    * the algorithm is based on David Alleyson, Sabine Susstruck and Laurence Meylan's work, please cite:
+    * -> Meylan L., Alleysson D., and S�sstrunk S., A Model of Retinal Local Adaptation for the Tone Mapping of Color Filter Array Images, Journal of Optical Society of America, A, Vol. 24, N� 9, September, 1st, 2007, pp. 2807-2816
+    * get the resulting gray frame by calling function getParvoColor()
+    * @param grayImageInput: RGB image input buffer respecting the size specified at the constructor level
+    * @param PhotoreceptorsCompression: sets the log compression parameters applied at the photoreceptors level (enhance luminance in dark areas)
+    * @param ganglionCellsCompression: sets the log compression applied at the gnaglion cells output (enhance contrast)
+    */
+    void runGrayToneMapping(const std::valarray<float> &grayImageInput, std::valarray<float> &grayImageOutput, const float PhotoreceptorsCompression=0.6, const float ganglionCellsCompression=0.6);
+
+    /**
+    * run the initilized retina filter in order to perform color tone mapping applied on an RGB image, after this call the color output of the retina is updated (use function getColorOutput() to grab it)
+    * the algorithm is based on David Alleyson, Sabine Susstruck and Laurence Meylan's work, please cite:
+    * -> Meylan L., Alleysson D., and S�sstrunk S., A Model of Retinal Local Adaptation for the Tone Mapping of Color Filter Array Images, Journal of Optical Society of America, A, Vol. 24, N� 9, September, 1st, 2007, pp. 2807-2816
+    * get the resulting RGB frame by calling function getParvoColor()
+    * @param RGBimageInput: RGB image input buffer respecting the size specified at the constructor level
+    * @param useAdaptiveFiltering: set true if you want to use adaptive color demultilexing (solve some color artefact problems), see RetinaColor for citation references
+    * @param PhotoreceptorsCompression: sets the log compression parameters applied at the photoreceptors level (enhance luminance in dark areas)
+    * @param ganglionCellsCompression: sets the log compression applied at the ganglion cells output (enhance contrast)
+    */
+    void runRGBToneMapping(const std::valarray<float> &RGBimageInput, std::valarray<float> &imageOutput, const bool useAdaptiveFiltering, const float PhotoreceptorsCompression=0.6, const float ganglionCellsCompression=0.6);
+
+    /**
+    * run the initilized retina filter in order to perform color tone mapping applied on an RGB image, after this call the color output of the retina is updated (use function getColorOutput() to grab it)
+    * get the resulting RGB frame by calling function getParvoColor()
+    * @param LMSimageInput: RGB image input buffer respecting the size specified at the constructor level
+    * @param useAdaptiveFiltering: set true if you want to use adaptive color demultilexing (solve some color artefact problems), see RetinaColor for citation references
+    * @param PhotoreceptorsCompression: sets the log compression parameters applied at the photoreceptors level (enhance luminance in dark areas)
+    * @param ganglionCellsCompression: sets the log compression applied at the gnaglion cells output (enhance contrast)
+    */
+    void runLMSToneMapping(const std::valarray<float> &LMSimageInput, std::valarray<float> &imageOutput, const bool useAdaptiveFiltering, const float PhotoreceptorsCompression=0.6, const float ganglionCellsCompression=0.6);
+
+    /**
+    * set up function of the retina filter: all the retina is initialized at this step, some specific parameters are set by default, use setOPLandParvoCoefficientsTable() and setMagnoCoefficientsTable in order to setup the retina with more options
+    * @param OPLspatialResponse1: (equal to k1 in setOPLandParvoCoefficientsTable() function) the spatial constant of the first order low pass filter of the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is pixels, typical value is 1 pixel
+    * @param OPLtemporalresponse1: (equal to tau1 in setOPLandParvoCoefficientsTable() function) the time constant of the first order low pass filter of the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is frames, typical value is 1 frame
+    * @param OPLassymetryGain: (equal to beta2 in setOPLandParvoCoefficientsTable() function) gain of the horizontal cells network, if 0, then the mean value of the output is zero, if the parameter is near 1, then, the luminance is not filtered and is still reachable at the output, typicall value is 0
+    * @param OPLspatialResponse2: (equal to k2 in setOPLandParvoCoefficientsTable() function) the spatial constant of the first order low pass filter of the horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels, typical value is 5 pixel
+    * @param OPLtemporalresponse2: (equal to tau2 in setOPLandParvoCoefficientsTable() function) the time constant of the first order low pass filter of the horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is frames, typical value is 1 frame, as the photoreceptors
+    * @param LPfilterSpatialResponse: (equal to parasolCells_k in setMagnoCoefficientsTable() function) the low pass filter spatial constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical value is 5
+    * @param LPfilterGain: (equal to parasolCells_beta in setMagnoCoefficientsTable() function) the low pass filter gain used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), typical value is 0
+    * @param LPfilterTemporalresponse: (equal to parasolCells_tau in setMagnoCoefficientsTable() function) the low pass filter time constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical value is 0 (immediate response)
+    * @param MovingContoursExtractorCoefficient: (equal to amacrinCellsTemporalCutFrequency in setMagnoCoefficientsTable() function)the time constant of the first order high pass fiter of the magnocellular way (motion information channel), unit is frames, tipicall value is 5
+    * @param normalizeParvoOutput_0_maxOutputValue: specifies if the Parvo cellular output should be normalized between 0 and maxOutputValue (true) or not (false) in order to remain at a null mean value, true value is recommended for visualisation
+    * @param normalizeMagnoOutput_0_maxOutputValue: specifies if the Magno cellular output should be normalized between 0 and maxOutputValue (true) or not (false), setting true may be hazardous because it can enhace the noise response when nothing is moving
+    * @param maxOutputValue: the maximum amplitude value of the normalized outputs (generally 255 for 8bit per channel pictures)
+    * @param maxInputValue: the maximum pixel value of the input picture (generally 255 for 8bit per channel pictures), specify it in other case (for example High Dynamic Range Images)
+    * @param meanValue: the global mean value of the input data usefull for local adaptation setup
+    */
+    void setGlobalParameters(const float OPLspatialResponse1=0.7, const float OPLtemporalresponse1=1, const float OPLassymetryGain=0, const float OPLspatialResponse2=5, const float OPLtemporalresponse2=1, const float LPfilterSpatialResponse=5, const float LPfilterGain=0, const float LPfilterTemporalresponse=0, const float MovingContoursExtractorCoefficient=5, const bool normalizeParvoOutput_0_maxOutputValue=false, const bool normalizeMagnoOutput_0_maxOutputValue=false, const float maxOutputValue=255.0, const float maxInputValue=255.0, const float meanValue=128.0);
+
+    /**
+    * setup the local luminance adaptation capability
+    * @param V0CompressionParameter: the compression strengh of the photoreceptors local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 160
+    */
+    inline void setPhotoreceptorsLocalAdaptationSensitivity(const float V0CompressionParameter){_photoreceptorsPrefilter.setV0CompressionParameter(1-V0CompressionParameter);_setInitPeriodCount();};
+
+    /**
+    * setup the local luminance adaptation capability
+    * @param V0CompressionParameter: the compression strengh of the parvocellular pathway (details) local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 160
+    */
+    inline void setParvoGanglionCellsLocalAdaptationSensitivity(const float V0CompressionParameter){_ParvoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount();};
+
+    /**
+    * setup the local luminance adaptation area of integration
+    * @param spatialResponse: the spatial constant of the low pass filter applied on the bipolar cells output in order to compute local contrast mean values
+    * @param temporalResponse: the spatial constant of the low pass filter applied on the bipolar cells output in order to compute local contrast mean values (generally set to zero: immediate response)
+    */
+    inline void setGanglionCellsLocalAdaptationLPfilterParameters(const float spatialResponse, const float temporalResponse){_ParvoRetinaFilter.setGanglionCellsLocalAdaptationLPfilterParameters(temporalResponse, spatialResponse);_setInitPeriodCount();};
+
+    /**
+    * setup the local luminance adaptation capability
+    * @param V0CompressionParameter: the compression strengh of the magnocellular pathway (motion) local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 160
+    */
+    inline void setMagnoGanglionCellsLocalAdaptationSensitivity(const float V0CompressionParameter){_MagnoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount();};
+
+    /**
+    * setup the OPL and IPL parvo channels
+    * @param beta1: gain of the horizontal cells network, if 0, then the mean value of the output is zero (default value), if the parameter is near 1, the amplitude is boosted but it should only be used for values rescaling... if needed
+    * @param tau1: the time constant of the first order low pass filter of the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is frames, typical value is 1 frame
+    * @param k1: the spatial constant of the first order low pass filter of the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is pixels, typical value is 1 pixel
+    * @param beta2: gain of the horizontal cells network, if 0, then the mean value of the output is zero, if the parameter is near 1, then, the luminance is not filtered and is still reachable at the output, typicall value is 0
+    * @param tau2: the time constant of the first order low pass filter of the horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is frames, typical value is 1 frame, as the photoreceptors
+    * @param k2: the spatial constant of the first order low pass filter of the horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels, typical value is 5 pixel, this value is also used for local contrast computing when computing the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular channel model)
+    * @param V0CompressionParameter: the compression strengh of the ganglion cells local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 230
+    */
+    void setOPLandParvoParameters(const float beta1, const float tau1, const float k1, const float beta2, const float tau2, const float k2, const float V0CompressionParameter){_ParvoRetinaFilter.setOPLandParvoFiltersParameters(beta1, tau1, k1, beta2, tau2, k2);_ParvoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount();};
+
+    /**
+    * set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel
+    * @param parasolCells_beta: the low pass filter gain used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), typical value is 0
+    * @param parasolCells_tau: the low pass filter time constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical value is 0 (immediate response)
+    * @param parasolCells_k: the low pass filter spatial constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical value is 5
+    * @param amacrinCellsTemporalCutFrequency: the time constant of the first order high pass fiter of the magnocellular way (motion information channel), unit is frames, tipicall value is 5
+    * @param V0CompressionParameter: the compression strengh of the ganglion cells local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 200
+    * @param localAdaptintegration_tau: specifies the temporal constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation
+    * @param localAdaptintegration_k: specifies the spatial constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation
+    */
+    void setMagnoCoefficientsTable(const float parasolCells_beta, const float parasolCells_tau, const float parasolCells_k, const float amacrinCellsTemporalCutFrequency, const float V0CompressionParameter, const float localAdaptintegration_tau, const float localAdaptintegration_k){_MagnoRetinaFilter.setCoefficientsTable(parasolCells_beta, parasolCells_tau, parasolCells_k, amacrinCellsTemporalCutFrequency, localAdaptintegration_tau, localAdaptintegration_k);_MagnoRetinaFilter.setV0CompressionParameter(V0CompressionParameter);_setInitPeriodCount();};
+
+    /**
+    * set if the parvo output should be or not normalized between 0 and 255 (for display purpose generally)
+    * @param normalizeParvoOutput_0_maxOutputValue: true if normalization should be done
+    */
+    inline void activateNormalizeParvoOutput_0_maxOutputValue(const bool normalizeParvoOutput_0_maxOutputValue){_normalizeParvoOutput_0_maxOutputValue=normalizeParvoOutput_0_maxOutputValue;};
+
+    /**
+    * set if the magno output should be or not normalized between 0 and 255 (for display purpose generally), take care, if nothing is moving, then, the noise will be enanced !!!
+    * @param normalizeMagnoOutput_0_maxOutputValue: true if normalization should be done
+    */
+    inline void activateNormalizeMagnoOutput_0_maxOutputValue(const bool normalizeMagnoOutput_0_maxOutputValue){_normalizeMagnoOutput_0_maxOutputValue=normalizeMagnoOutput_0_maxOutputValue;};
+
+    /**
+    * setup the maximum amplitude value of the normalized outputs (generally 255 for 8bit per channel pictures)
+    * @param maxOutputValue: maximum amplitude value of the normalized outputs (generally 255 for 8bit per channel pictures)
+    */
+    inline void setMaxOutputValue(const float maxOutputValue){_maxOutputValue=maxOutputValue;};
+
+    /**
+    * sets the color mode of the frame grabber
+    * @param desiredColorMode: true if the user needs color information, false for graylevels
+    */
+    void setColorMode(const bool desiredColorMode){_useColorMode=desiredColorMode;};
+
+    /**
+    * activate color saturation as the final step of the color demultiplexing process
+    * -> this saturation is a sigmoide function applied to each channel of the demultiplexed image.
+    * @param saturateColors: boolean that activates color saturation (if true) or desactivate (if false)
+    * @param colorSaturationValue: the saturation factor
+    * */
+    inline void setColorSaturation(const bool saturateColors=true, const float colorSaturationValue=4.0){_colorEngine.setColorSaturation(saturateColors, colorSaturationValue);};
+
+    /////////////////////////////////////////////////////////////////
+    // function that retrieve the main retina outputs, one by one, or all in a structure
+
+    /**
+    * @return the input image sampled by the photoreceptors spatial sampling
+    */
+    inline const std::valarray<float> &getPhotoreceptorsSampledFrame() const
     {
         CV_Assert(_photoreceptorsLogSampling);
         return _photoreceptorsLogSampling->getSampledFrame();
     };
 
-       /**
-       * @return photoreceptors output, locally adapted luminance only, no high frequency spatio-temporal noise reduction at the next retina processing stages, use getPhotoreceptors method to get complete photoreceptors output
-       */
-       inline const std::valarray<float> &getLocalAdaptation() const {return _photoreceptorsPrefilter.getOutput();};
-
-       /**
-       * @return photoreceptors output: locally adapted luminance and high frequency spatio-temporal noise reduction, high luminance is a little saturated at this stage, but this is corrected naturally at the next retina processing stages
-       */
-       inline const std::valarray<float> &getPhotoreceptors() const {return _ParvoRetinaFilter.getPhotoreceptorsLPfilteringOutput();};
-
-       /**
-       * @return the local luminance of the processed frame (it is the horizontal cells output)
-       */
-       inline const std::valarray<float> &getHorizontalCells() const {return _ParvoRetinaFilter.getHorizontalCellsOutput();};
-
-       ///////// CONTOURS part, PARVOCELLULAR RETINA PATHWAY
-       /**
-       * @return true if Parvocellular output is activated, false if not
-       */
-       inline const bool areContoursProcessed(){return _useParvoOutput;};
-
-       /**
-       *  method to retrieve the foveal parvocellular pathway response (no details energy in parafovea)
-       * @param parvoParafovealResponse: buffer that will be filled with the response of the magnocellular pathway in the parafoveal area
-       * @return true if process succeeded (if buffer exists, is its size matches retina size, if magno channel is activated and if mapping is initialized
-       */
-       const bool getParvoFoveaResponse(std::valarray<float> &parvoFovealResponse);
-
-       /**
-       * @param useParvoOutput: true if Parvocellular output should be activated, false if not
-       */
-       inline void activateContoursProcessing(const bool useParvoOutput){_useParvoOutput=useParvoOutput;};
-
-       /**
-       * @return the parvocellular contours information (details), should be used at the fovea level
-       */
-       const std::valarray<float> &getContours(); // Parvocellular output
-
-       /**
-       * @return the parvocellular contours ON information (details), should be used at the fovea level
-       */
-       inline const std::valarray<float> &getContoursON() const {return _ParvoRetinaFilter.getParvoON();};// Parvocellular ON output
-
-       /**
-       * @return the parvocellular contours OFF information (details), should be used at the fovea level
-       */
-       inline const std::valarray<float> &getContoursOFF() const {return _ParvoRetinaFilter.getParvoOFF();};// Parvocellular OFF output
-
-       ///////// MOVING CONTOURS part, MAGNOCELLULAR RETINA PATHWAY
-       /**
-       * @return true if Magnocellular output is activated, false if not
-       */
-       inline const bool areMovingContoursProcessed(){return _useMagnoOutput;};
-
-       /**
-       *  method to retrieve the parafoveal magnocellular pathway response (no motion energy in fovea)
-       * @param magnoParafovealResponse: buffer that will be filled with the response of the magnocellular pathway in the parafoveal area
-       * @return true if process succeeded (if buffer exists, is its size matches retina size, if magno channel is activated and if mapping is initialized
-       */
-       const bool getMagnoParaFoveaResponse(std::valarray<float> &magnoParafovealResponse);
-
-       /**
-       * @param useMagnoOutput: true if Magnoocellular output should be activated, false if not
-       */
-       inline void activateMovingContoursProcessing(const bool useMagnoOutput){_useMagnoOutput=useMagnoOutput;};
-
-       /**
-       * @return the magnocellular moving contours information (motion), should be used at the parafovea level without post-processing
-       */
-       inline const std::valarray<float> &getMovingContours() const {return _MagnoRetinaFilter.getOutput();};// Magnocellular output
-
-       /**
-       * @return the magnocellular moving contours information (motion), should be used at the parafovea level with assymetric sigmoide post-processing which saturates motion information
-       */
-       inline const std::valarray<float> &getMovingContoursSaturated() const {return _MagnoRetinaFilter.getMagnoYsaturated();};// Saturated Magnocellular output
-
-       /**
-       * @return the magnocellular moving contours ON information (motion), should be used at the parafovea level without post-processing
-       */
-       inline const std::valarray<float> &getMovingContoursON() const {return _MagnoRetinaFilter.getMagnoON();};// Magnocellular ON output
-
-       /**
-       * @return the magnocellular moving contours OFF information (motion), should be used at the parafovea level without post-processing
-       */
-       inline const std::valarray<float> &getMovingContoursOFF() const {return _MagnoRetinaFilter.getMagnoOFF();};// Magnocellular OFF output
-
-       /**
-       * @return a gray level image with center Parvo and peripheral Magno X channels, WARNING, the result will be ok if you called previously fucntion runFilter(imageInput, processRetinaParvoMagnoMapping=true);
-       *    -> will be accessible even if color mode is activated (but the image is color sampled so quality is poor), but get the same thing but in color by the use of function getParvoColor()
-       */
-       inline const std::valarray<float> &getRetinaParvoMagnoMappedOutput() const {return _retinaParvoMagnoMappedFrame;};// return image with center Parvo and peripheral Magno channels
-
-       /**
-       * color processing dedicated functions
-       * @return the parvo channel (contours, details) of the processed frame, grayscale output
-       */
-       inline const std::valarray<float> &getParvoContoursChannel() const {return _colorEngine.getLuminance();};
-
-       /**
-       * color processing dedicated functions
-       * @return the chrominance of the processed frame (same colorspace as the input output, usually RGB)
-       */
-       inline const std::valarray<float> &getParvoChrominance() const {return _colorEngine.getChrominance();}; // only retreive chrominance
-
-       /**
-       * color processing dedicated functions
-       * @return the parvo + chrominance channels of the processed frame (same colorspace as the input output, usually RGB)
-       */
-       inline const std::valarray<float> &getColorOutput() const {return _colorEngine.getDemultiplexedColorFrame();};// retrieve luminance+chrominance
-
-       /**
-       * apply to the retina color output the Krauskopf transformation which leads to an opponent color system: output colorspace if Acr1cr2 if input of the retina was LMS color space
-       * @param result: the input buffer to fill with the transformed colorspace retina output
-       * @return true if process ended successfully
-       */
-       inline const bool applyKrauskopfLMS2Acr1cr2Transform(std::valarray<float> &result){return _colorEngine.applyKrauskopfLMS2Acr1cr2Transform(result);};
-
-       /**
-       * apply to the retina color output the Krauskopf transformation which leads to an opponent color system: output colorspace if Acr1cr2 if input of the retina was LMS color space
-       * @param result: the input buffer to fill with the transformed colorspace retina output
-       * @return true if process ended successfully
-       */
-       inline const bool applyLMS2LabTransform(std::valarray<float> &result){return _colorEngine.applyLMS2LabTransform(result);};
-
-       /**
-       * color processing dedicated functions
-       * @return the retina initialized mode, true if color mode (RGB), false if grayscale
-       */
-       inline const bool isColorMode(){return _useColorMode;}; // return true if RGB mode, false if gray level mode
-
-       /**
-       * @return the irregular low pass filter ouput at the photoreceptors level
-       */
-       inline const std::valarray<float> &getIrregularLPfilteredInputFrame() const {return _photoreceptorsLogSampling->getIrregularLPfilteredInputFrame();};
-
-       /**
-       * @return true if color mode is activated, false if gray levels processing
-       */
-       const bool getColorMode(){return _useColorMode;};
-
-       /**
-       *
-       * @return true if a sufficient number of processed frames has been done since the last parameters update in order to get the stable state (r�gime permanent)
-       */
-       inline const bool isInitTransitionDone(){if (_ellapsedFramesSinceLastReset<_globalTemporalConstant)return false; return true;};
-
-       /**
-       * find a distance in the image input space when the distance is known in the retina log sampled space...read again if it is not clear enough....sorry, i should sleep
-       * @param projectedRadiusLength: the distance to image center in the retina log sampled space
-       * @return the distance to image center in the input image space
-       */
-       inline const float getRetinaSamplingBackProjection(const float projectedRadiusLength)
-       {
-               if (_photoreceptorsLogSampling)
-                       return (float)_photoreceptorsLogSampling->getOriginalRadiusLength(projectedRadiusLength);
-               return projectedRadiusLength;
-       };
-
-       /////////////////:
-       // retina dimensions getters
-
-       /**
-       * @return number of rows of the filter
-       */
-       inline const unsigned int getInputNBrows(){if (_photoreceptorsLogSampling) return _photoreceptorsLogSampling->getNBrows();else return _photoreceptorsPrefilter.getNBrows();};
-
-       /**
-       * @return number of columns of the filter
-       */
-       inline const unsigned int getInputNBcolumns(){if (_photoreceptorsLogSampling) return _photoreceptorsLogSampling->getNBcolumns();else return _photoreceptorsPrefilter.getNBcolumns();};
-
-       /**
-       * @return number of pixels of the filter
-       */
-       inline const unsigned int getInputNBpixels(){if (_photoreceptorsLogSampling) return _photoreceptorsLogSampling->getNBpixels();else return _photoreceptorsPrefilter.getNBpixels();};
-
-       /**
-       * @return the height of the frame output
-       */
-       inline const unsigned int getOutputNBrows(){return _photoreceptorsPrefilter.getNBrows();};
-
-       /**
-       * @return the width of the frame output
-       */
-       inline const unsigned int getOutputNBcolumns(){return _photoreceptorsPrefilter.getNBcolumns();};
-
-       /**
-       * @return the numbers of output pixels (width*height) of the images used by the object
-       */
-       inline const unsigned int getOutputNBpixels(){return _photoreceptorsPrefilter.getNBpixels();};
+    /**
+    * @return photoreceptors output, locally adapted luminance only, no high frequency spatio-temporal noise reduction at the next retina processing stages, use getPhotoreceptors method to get complete photoreceptors output
+    */
+    inline const std::valarray<float> &getLocalAdaptation() const {return _photoreceptorsPrefilter.getOutput();};
+
+    /**
+    * @return photoreceptors output: locally adapted luminance and high frequency spatio-temporal noise reduction, high luminance is a little saturated at this stage, but this is corrected naturally at the next retina processing stages
+    */
+    inline const std::valarray<float> &getPhotoreceptors() const {return _ParvoRetinaFilter.getPhotoreceptorsLPfilteringOutput();};
+
+    /**
+    * @return the local luminance of the processed frame (it is the horizontal cells output)
+    */
+    inline const std::valarray<float> &getHorizontalCells() const {return _ParvoRetinaFilter.getHorizontalCellsOutput();};
+
+    ///////// CONTOURS part, PARVOCELLULAR RETINA PATHWAY
+    /**
+    * @return true if Parvocellular output is activated, false if not
+    */
+    inline bool areContoursProcessed(){return _useParvoOutput;};
+
+    /**
+    *  method to retrieve the foveal parvocellular pathway response (no details energy in parafovea)
+    * @param parvoParafovealResponse: buffer that will be filled with the response of the magnocellular pathway in the parafoveal area
+    * @return true if process succeeded (if buffer exists, is its size matches retina size, if magno channel is activated and if mapping is initialized
+    */
+    bool getParvoFoveaResponse(std::valarray<float> &parvoFovealResponse);
+
+    /**
+    * @param useParvoOutput: true if Parvocellular output should be activated, false if not
+    */
+    inline void activateContoursProcessing(const bool useParvoOutput){_useParvoOutput=useParvoOutput;};
+
+    /**
+    * @return the parvocellular contours information (details), should be used at the fovea level
+    */
+    const std::valarray<float> &getContours(); // Parvocellular output
+
+    /**
+    * @return the parvocellular contours ON information (details), should be used at the fovea level
+    */
+    inline const std::valarray<float> &getContoursON() const {return _ParvoRetinaFilter.getParvoON();};// Parvocellular ON output
+
+    /**
+    * @return the parvocellular contours OFF information (details), should be used at the fovea level
+    */
+    inline const std::valarray<float> &getContoursOFF() const {return _ParvoRetinaFilter.getParvoOFF();};// Parvocellular OFF output
+
+    ///////// MOVING CONTOURS part, MAGNOCELLULAR RETINA PATHWAY
+    /**
+    * @return true if Magnocellular output is activated, false if not
+    */
+    inline bool areMovingContoursProcessed(){return _useMagnoOutput;};
+
+    /**
+    *  method to retrieve the parafoveal magnocellular pathway response (no motion energy in fovea)
+    * @param magnoParafovealResponse: buffer that will be filled with the response of the magnocellular pathway in the parafoveal area
+    * @return true if process succeeded (if buffer exists, is its size matches retina size, if magno channel is activated and if mapping is initialized
+    */
+    bool getMagnoParaFoveaResponse(std::valarray<float> &magnoParafovealResponse);
+
+    /**
+    * @param useMagnoOutput: true if Magnoocellular output should be activated, false if not
+    */
+    inline void activateMovingContoursProcessing(const bool useMagnoOutput){_useMagnoOutput=useMagnoOutput;};
+
+    /**
+    * @return the magnocellular moving contours information (motion), should be used at the parafovea level without post-processing
+    */
+    inline const std::valarray<float> &getMovingContours() const {return _MagnoRetinaFilter.getOutput();};// Magnocellular output
+
+    /**
+    * @return the magnocellular moving contours information (motion), should be used at the parafovea level with assymetric sigmoide post-processing which saturates motion information
+    */
+    inline const std::valarray<float> &getMovingContoursSaturated() const {return _MagnoRetinaFilter.getMagnoYsaturated();};// Saturated Magnocellular output
+
+    /**
+    * @return the magnocellular moving contours ON information (motion), should be used at the parafovea level without post-processing
+    */
+    inline const std::valarray<float> &getMovingContoursON() const {return _MagnoRetinaFilter.getMagnoON();};// Magnocellular ON output
+
+    /**
+    * @return the magnocellular moving contours OFF information (motion), should be used at the parafovea level without post-processing
+    */
+    inline const std::valarray<float> &getMovingContoursOFF() const {return _MagnoRetinaFilter.getMagnoOFF();};// Magnocellular OFF output
+
+    /**
+    * @return a gray level image with center Parvo and peripheral Magno X channels, WARNING, the result will be ok if you called previously fucntion runFilter(imageInput, processRetinaParvoMagnoMapping=true);
+    *    -> will be accessible even if color mode is activated (but the image is color sampled so quality is poor), but get the same thing but in color by the use of function getParvoColor()
+    */
+    inline const std::valarray<float> &getRetinaParvoMagnoMappedOutput() const {return _retinaParvoMagnoMappedFrame;};// return image with center Parvo and peripheral Magno channels
+
+    /**
+    * color processing dedicated functions
+    * @return the parvo channel (contours, details) of the processed frame, grayscale output
+    */
+    inline const std::valarray<float> &getParvoContoursChannel() const {return _colorEngine.getLuminance();};
+
+    /**
+    * color processing dedicated functions
+    * @return the chrominance of the processed frame (same colorspace as the input output, usually RGB)
+    */
+    inline const std::valarray<float> &getParvoChrominance() const {return _colorEngine.getChrominance();}; // only retreive chrominance
+
+    /**
+    * color processing dedicated functions
+    * @return the parvo + chrominance channels of the processed frame (same colorspace as the input output, usually RGB)
+    */
+    inline const std::valarray<float> &getColorOutput() const {return _colorEngine.getDemultiplexedColorFrame();};// retrieve luminance+chrominance
+
+    /**
+    * apply to the retina color output the Krauskopf transformation which leads to an opponent color system: output colorspace if Acr1cr2 if input of the retina was LMS color space
+    * @param result: the input buffer to fill with the transformed colorspace retina output
+    * @return true if process ended successfully
+    */
+    inline bool applyKrauskopfLMS2Acr1cr2Transform(std::valarray<float> &result){return _colorEngine.applyKrauskopfLMS2Acr1cr2Transform(result);};
+
+    /**
+    * apply to the retina color output the Krauskopf transformation which leads to an opponent color system: output colorspace if Acr1cr2 if input of the retina was LMS color space
+    * @param result: the input buffer to fill with the transformed colorspace retina output
+    * @return true if process ended successfully
+    */
+    inline bool applyLMS2LabTransform(std::valarray<float> &result){return _colorEngine.applyLMS2LabTransform(result);};
+
+    /**
+    * color processing dedicated functions
+    * @return the retina initialized mode, true if color mode (RGB), false if grayscale
+    */
+    inline bool isColorMode(){return _useColorMode;}; // return true if RGB mode, false if gray level mode
+
+    /**
+    * @return the irregular low pass filter ouput at the photoreceptors level
+    */
+    inline const std::valarray<float> &getIrregularLPfilteredInputFrame() const {return _photoreceptorsLogSampling->getIrregularLPfilteredInputFrame();};
+
+    /**
+    * @return true if color mode is activated, false if gray levels processing
+    */
+    bool getColorMode(){return _useColorMode;};
+
+    /**
+    *
+    * @return true if a sufficient number of processed frames has been done since the last parameters update in order to get the stable state (r�gime permanent)
+    */
+    inline bool isInitTransitionDone(){if (_ellapsedFramesSinceLastReset<_globalTemporalConstant)return false; return true;};
+
+    /**
+    * find a distance in the image input space when the distance is known in the retina log sampled space...read again if it is not clear enough....sorry, i should sleep
+    * @param projectedRadiusLength: the distance to image center in the retina log sampled space
+    * @return the distance to image center in the input image space
+    */
+    inline float getRetinaSamplingBackProjection(const float projectedRadiusLength)
+    {
+        if (_photoreceptorsLogSampling)
+            return (float)_photoreceptorsLogSampling->getOriginalRadiusLength(projectedRadiusLength);
+        return projectedRadiusLength;
+    };
+
+    /////////////////:
+    // retina dimensions getters
+
+    /**
+    * @return number of rows of the filter
+    */
+    inline unsigned int getInputNBrows(){if (_photoreceptorsLogSampling) return _photoreceptorsLogSampling->getNBrows();else return _photoreceptorsPrefilter.getNBrows();};
+
+    /**
+    * @return number of columns of the filter
+    */
+    inline unsigned int getInputNBcolumns(){if (_photoreceptorsLogSampling) return _photoreceptorsLogSampling->getNBcolumns();else return _photoreceptorsPrefilter.getNBcolumns();};
+
+    /**
+    * @return number of pixels of the filter
+    */
+    inline unsigned int getInputNBpixels(){if (_photoreceptorsLogSampling) return _photoreceptorsLogSampling->getNBpixels();else return _photoreceptorsPrefilter.getNBpixels();};
+
+    /**
+    * @return the height of the frame output
+    */
+    inline unsigned int getOutputNBrows(){return _photoreceptorsPrefilter.getNBrows();};
+
+    /**
+    * @return the width of the frame output
+    */
+    inline unsigned int getOutputNBcolumns(){return _photoreceptorsPrefilter.getNBcolumns();};
+
+    /**
+    * @return the numbers of output pixels (width*height) of the images used by the object
+    */
+    inline unsigned int getOutputNBpixels(){return _photoreceptorsPrefilter.getNBpixels();};
 
 
 private:
 
-       // processing activation flags
-       bool _useParvoOutput;
-       bool _useMagnoOutput;
+    // processing activation flags
+    bool _useParvoOutput;
+    bool _useMagnoOutput;
 
 
-       // filter stability controls
-       unsigned int _ellapsedFramesSinceLastReset;
-       unsigned int _globalTemporalConstant;
+    // filter stability controls
+    unsigned int _ellapsedFramesSinceLastReset;
+    unsigned int _globalTemporalConstant;
 
-       // private template buffers and related access pointers
-       std::valarray<float> _retinaParvoMagnoMappedFrame;
-       std::valarray<float> _retinaParvoMagnoMapCoefTable;
-       // private objects of the class
-       BasicRetinaFilter _photoreceptorsPrefilter;
-       ParvoRetinaFilter _ParvoRetinaFilter;
-       MagnoRetinaFilter _MagnoRetinaFilter;
-       RetinaColor       _colorEngine;
-       ImageLogPolProjection *_photoreceptorsLogSampling;
+    // private template buffers and related access pointers
+    std::valarray<float> _retinaParvoMagnoMappedFrame;
+    std::valarray<float> _retinaParvoMagnoMapCoefTable;
+    // private objects of the class
+    BasicRetinaFilter _photoreceptorsPrefilter;
+    ParvoRetinaFilter _ParvoRetinaFilter;
+    MagnoRetinaFilter _MagnoRetinaFilter;
+    RetinaColor       _colorEngine;
+    ImageLogPolProjection *_photoreceptorsLogSampling;
 
-       bool _useMinimalMemoryForToneMappingONLY;
+    bool _useMinimalMemoryForToneMappingONLY;
 
-       bool _normalizeParvoOutput_0_maxOutputValue;
-       bool _normalizeMagnoOutput_0_maxOutputValue;
-       float _maxOutputValue;
-       bool _useColorMode;
+    bool _normalizeParvoOutput_0_maxOutputValue;
+    bool _normalizeMagnoOutput_0_maxOutputValue;
+    float _maxOutputValue;
+    bool _useColorMode;
 
 
 
-       // private functions
-       void _setInitPeriodCount();
-       void _createHybridTable();
-       void _processRetinaParvoMagnoMapping();
-       void _runGrayToneMapping(const std::valarray<float> &grayImageInput, std::valarray<float> &grayImageOutput ,const float PhotoreceptorsCompression=0.6, const float ganglionCellsCompression=0.6);
+    // private functions
+    void _setInitPeriodCount();
+    void _createHybridTable();
+    void _processRetinaParvoMagnoMapping();
+    void _runGrayToneMapping(const std::valarray<float> &grayImageInput, std::valarray<float> &grayImageOutput ,const float PhotoreceptorsCompression=0.6, const float ganglionCellsCompression=0.6);
 
 
 };
index 69d2699..06a519e 100644 (file)
@@ -1,55 +1,55 @@
 /*#******************************************************************************
 ** IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
-** 
+**
 ** By downloading, copying, installing or using the software you agree to this license.
 ** If you do not agree to this license, do not download, install,
 ** copy or use the software.
-** 
-** 
+**
+**
 ** HVStools : interfaces allowing OpenCV users to integrate Human Vision System models. Presented models originate from Jeanny Herault's original research and have been reused and adapted by the author&collaborators for computed vision applications since his thesis with Alice Caplier at Gipsa-Lab.
 ** Use: extract still images & image sequences features, from contours details to motion spatio-temporal features, etc. for high level visual scene analysis. Also contribute to image enhancement/compression such as tone mapping.
-** 
+**
 ** Maintainers : Listic lab (code author current affiliation & applications) and Gipsa Lab (original research origins & applications)
-** 
+**
 **  Creation - enhancement process 2007-2011
 **      Author: Alexandre Benoit (benoit.alexandre.vision@gmail.com), LISTIC lab, Annecy le vieux, France
-** 
+**
 ** Theses algorithm have been developped by Alexandre BENOIT since his thesis with Alice Caplier at Gipsa-Lab (www.gipsa-lab.inpg.fr) and the research he pursues at LISTIC Lab (www.listic.univ-savoie.fr).
 ** Refer to the following research paper for more information:
 ** Benoit A., Caplier A., Durette B., Herault, J., "USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING", Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011
 ** This work have been carried out thanks to Jeanny Herault who's research and great discussions are the basis of all this work, please take a look at his book:
 ** Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891.
-** 
+**
 ** The retina filter includes the research contributions of phd/research collegues from which code has been redrawn by the author :
 ** _take a look at the retinacolor.hpp module to discover Brice Chaix de Lavarene color mosaicing/demosaicing and the reference paper:
 ** ====> B. Chaix de Lavarene, D. Alleysson, B. Durette, J. Herault (2007). "Efficient demosaicing through recursive filtering", IEEE International Conference on Image Processing ICIP 2007
 ** _take a look at imagelogpolprojection.hpp to discover retina spatial log sampling which originates from Barthelemy Durette phd with Jeanny Herault. A Retina / V1 cortex projection is also proposed and originates from Jeanny's discussions.
 ** ====> more informations in the above cited Jeanny Heraults's book.
-** 
+**
 **                          License Agreement
 **               For Open Source Computer Vision Library
-** 
+**
 ** Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
 ** Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.
-** 
+**
 **               For Human Visual System tools (hvstools)
 ** Copyright (C) 2007-2011, LISTIC Lab, Annecy le Vieux and GIPSA Lab, Grenoble, France, all rights reserved.
-** 
+**
 ** Third party copyrights are property of their respective owners.
-** 
+**
 ** Redistribution and use in source and binary forms, with or without modification,
 ** are permitted provided that the following conditions are met:
-** 
+**
 ** * Redistributions of source code must retain the above copyright notice,
 **    this list of conditions and the following disclaimer.
-** 
+**
 ** * Redistributions in binary form must reproduce the above copyright notice,
 **    this list of conditions and the following disclaimer in the documentation
 **    and/or other materials provided with the distribution.
-** 
+**
 ** * The name of the copyright holders may not be used to endorse or promote products
 **    derived from this software without specific prior written permission.
-** 
+**
 ** This software is provided by the copyright holders and contributors "as is" and
 ** any express or implied warranties, including, but not limited to, the implied
 ** warranties of merchantability and fitness for a particular purpose are disclaimed.
@@ -85,303 +85,303 @@ template <class type> class TemplateBuffer : public std::valarray<type>
 {
 public:
 
-       /**
-       * constructor for monodimensional array
-       * @param dim: the size of the vector
-       */
-       TemplateBuffer(const size_t dim=0)
-       : std::valarray<type>((type)0, dim)
-         {
-               _NBrows=1;
-               _NBcolumns=dim;
-               _NBdepths=1;
-               _NBpixels=dim;
-               _doubleNBpixels=2*dim;
-         }
-
-       /**
-       * constructor by copy for monodimensional array
-       * @param pVal: the pointer to a buffer to copy
-       * @param dim: the size of the vector
-       */
-       TemplateBuffer(const type* pVal, const size_t dim)
-       : std::valarray<type>(pVal, dim)
-         {
-               _NBrows=1;
-               _NBcolumns=dim;
-               _NBdepths=1;
-               _NBpixels=dim;
-               _doubleNBpixels=2*dim;
-         }
-
-       /**
-       * constructor for bidimensional array
-       * @param dimRows: the size of the vector
-       * @param dimColumns: the size of the vector
-       * @param depth: the number of layers of the buffer in its third dimension (3 of color images, 1 for gray images.
-       */
-       TemplateBuffer(const size_t dimRows, const size_t dimColumns, const size_t depth=1)
-       : std::valarray<type>((type)0, dimRows*dimColumns*depth)
-         {
+    /**
+    * constructor for monodimensional array
+    * @param dim: the size of the vector
+    */
+    TemplateBuffer(const size_t dim=0)
+    : std::valarray<type>((type)0, dim)
+      {
+        _NBrows=1;
+        _NBcolumns=dim;
+        _NBdepths=1;
+        _NBpixels=dim;
+        _doubleNBpixels=2*dim;
+      }
+
+    /**
+    * constructor by copy for monodimensional array
+    * @param pVal: the pointer to a buffer to copy
+    * @param dim: the size of the vector
+    */
+    TemplateBuffer(const type* pVal, const size_t dim)
+    : std::valarray<type>(pVal, dim)
+      {
+        _NBrows=1;
+        _NBcolumns=dim;
+        _NBdepths=1;
+        _NBpixels=dim;
+        _doubleNBpixels=2*dim;
+      }
+
+    /**
+    * constructor for bidimensional array
+    * @param dimRows: the size of the vector
+    * @param dimColumns: the size of the vector
+    * @param depth: the number of layers of the buffer in its third dimension (3 of color images, 1 for gray images.
+    */
+    TemplateBuffer(const size_t dimRows, const size_t dimColumns, const size_t depth=1)
+    : std::valarray<type>((type)0, dimRows*dimColumns*depth)
+      {
 #ifdef TEMPLATEBUFFERDEBUG
-               std::cout<<"TemplateBuffer::TemplateBuffer: new buffer, size="<<dimRows<<", "<<dimColumns<<", "<<depth<<"valarraySize="<<this->size()<<std::endl;
+        std::cout<<"TemplateBuffer::TemplateBuffer: new buffer, size="<<dimRows<<", "<<dimColumns<<", "<<depth<<"valarraySize="<<this->size()<<std::endl;
 #endif
-               _NBrows=dimRows;
-               _NBcolumns=dimColumns;
-               _NBdepths=depth;
-               _NBpixels=dimRows*dimColumns;
-               _doubleNBpixels=2*dimRows*dimColumns;
-               //_createTableIndex();
+        _NBrows=dimRows;
+        _NBcolumns=dimColumns;
+        _NBdepths=depth;
+        _NBpixels=dimRows*dimColumns;
+        _doubleNBpixels=2*dimRows*dimColumns;
+        //_createTableIndex();
 #ifdef TEMPLATEBUFFERDEBUG
-               std::cout<<"TemplateBuffer::TemplateBuffer: construction successful"<<std::endl;
+        std::cout<<"TemplateBuffer::TemplateBuffer: construction successful"<<std::endl;
 #endif
 
-         }
-
-       /**
-       * copy constructor
-       * @param toCopy
-       * @return thenconstructed instance
-       *emplateBuffer(const TemplateBuffer &toCopy)
-       :_NBrows(toCopy.getNBrows()),_NBcolumns(toCopy.getNBcolumns()),_NBdepths(toCopy.getNBdephs()), _NBpixels(toCopy.getNBpixels()), _doubleNBpixels(toCopy.getNBpixels()*2)
-       //std::valarray<type>(toCopy)
-       {
-       memcpy(Buffer(), toCopy.Buffer(), this->size());
-       }*/
-       /**
-       * destructor
-       */
-       virtual ~TemplateBuffer()
-       {
+      }
+
+    /**
+    * copy constructor
+    * @param toCopy
+    * @return thenconstructed instance
+    *emplateBuffer(const TemplateBuffer &toCopy)
+    :_NBrows(toCopy.getNBrows()),_NBcolumns(toCopy.getNBcolumns()),_NBdepths(toCopy.getNBdephs()), _NBpixels(toCopy.getNBpixels()), _doubleNBpixels(toCopy.getNBpixels()*2)
+    //std::valarray<type>(toCopy)
+    {
+    memcpy(Buffer(), toCopy.Buffer(), this->size());
+    }*/
+    /**
+    * destructor
+    */
+    virtual ~TemplateBuffer()
+    {
 #ifdef TEMPLATEBUFFERDEBUG
-               std::cout<<"~TemplateBuffer"<<std::endl;
+        std::cout<<"~TemplateBuffer"<<std::endl;
 #endif
-       }
-
-       /**
-       * delete the buffer content (set zeros)
-       */
-       inline void setZero(){std::valarray<type>::operator=(0);};//memset(Buffer(), 0, sizeof(type)*_NBpixels);};
-
-       /**
-       * @return the numbers of rows (height) of the images used by the object
-       */
-       inline unsigned int getNBrows(){return (unsigned int)_NBrows;};
-
-       /**
-       * @return the numbers of columns (width) of the images used by the object
-       */
-       inline unsigned int getNBcolumns(){return (unsigned int)_NBcolumns;};
-
-       /**
-       * @return the numbers of pixels (width*height) of the images used by the object
-       */
-       inline unsigned int getNBpixels(){return (unsigned int)_NBpixels;};
-
-       /**
-       * @return the numbers of pixels (width*height) of the images used by the object
-       */
-       inline unsigned int getDoubleNBpixels(){return (unsigned int)_doubleNBpixels;};
-
-       /**
-       * @return the numbers of depths (3rd dimension: 1 for gray images, 3 for rgb images) of the images used by the object
-       */
-       inline unsigned int getDepthSize(){return (unsigned int)_NBdepths;};
-
-       /**
-       * resize the buffer and recompute table index etc.
-       */
-       void resizeBuffer(const size_t dimRows, const size_t dimColumns, const size_t depth=1)
-       {
-               this->resize(dimRows*dimColumns*depth);
-               _NBrows=dimRows;
-               _NBcolumns=dimColumns;
-               _NBdepths=depth;
-               _NBpixels=dimRows*dimColumns;
-               _doubleNBpixels=2*dimRows*dimColumns;
-       }
-
-       inline TemplateBuffer<type> & operator=(const std::valarray<type> &b)
-       {
-               //std::cout<<"TemplateBuffer<type> & operator= affect vector: "<<std::endl;
-               std::valarray<type>::operator=(b);
-               return *this;
-       }
-
-       inline TemplateBuffer<type> & operator=(const type &b)
-       {
-               //std::cout<<"TemplateBuffer<type> & operator= affect value: "<<b<<std::endl;
-               std::valarray<type>::operator=(b);
-               return *this;
-       }
-
-       /*  inline const type  &operator[](const unsigned int &b)
+    }
+
+    /**
+    * delete the buffer content (set zeros)
+    */
+    inline void setZero(){std::valarray<type>::operator=(0);};//memset(Buffer(), 0, sizeof(type)*_NBpixels);};
+
+    /**
+    * @return the numbers of rows (height) of the images used by the object
+    */
+    inline unsigned int getNBrows(){return (unsigned int)_NBrows;};
+
+    /**
+    * @return the numbers of columns (width) of the images used by the object
+    */
+    inline unsigned int getNBcolumns(){return (unsigned int)_NBcolumns;};
+
+    /**
+    * @return the numbers of pixels (width*height) of the images used by the object
+    */
+    inline unsigned int getNBpixels(){return (unsigned int)_NBpixels;};
+
+    /**
+    * @return the numbers of pixels (width*height) of the images used by the object
+    */
+    inline unsigned int getDoubleNBpixels(){return (unsigned int)_doubleNBpixels;};
+
+    /**
+    * @return the numbers of depths (3rd dimension: 1 for gray images, 3 for rgb images) of the images used by the object
+    */
+    inline unsigned int getDepthSize(){return (unsigned int)_NBdepths;};
+
+    /**
+    * resize the buffer and recompute table index etc.
+    */
+    void resizeBuffer(const size_t dimRows, const size_t dimColumns, const size_t depth=1)
+    {
+        this->resize(dimRows*dimColumns*depth);
+        _NBrows=dimRows;
+        _NBcolumns=dimColumns;
+        _NBdepths=depth;
+        _NBpixels=dimRows*dimColumns;
+        _doubleNBpixels=2*dimRows*dimColumns;
+    }
+
+    inline TemplateBuffer<type> & operator=(const std::valarray<type> &b)
+    {
+        //std::cout<<"TemplateBuffer<type> & operator= affect vector: "<<std::endl;
+        std::valarray<type>::operator=(b);
+        return *this;
+    }
+
+    inline TemplateBuffer<type> & operator=(const type &b)
+    {
+        //std::cout<<"TemplateBuffer<type> & operator= affect value: "<<b<<std::endl;
+        std::valarray<type>::operator=(b);
+        return *this;
+    }
+
+    /*  inline const type  &operator[](const unsigned int &b)
   {
-         return (*this)[b];
+      return (*this)[b];
   }
-        */
-       /**
-       * @return the buffer adress in non const mode
-       */
-       inline type*    Buffer()            {    return &(*this)[0];    }
-
-       ///////////////////////////////////////////////////////
-       // Standard Image manipulation functions
-
-       /**
-       * standard 0 to 255 image normalization function
-       * @param inputOutputBuffer: the image to be normalized (rewrites the input), if no parameter, then, the built in buffer reachable by getOutput() function is normalized
-       * @param nbPixels: specifies the number of pixel on which the normalization should be performed, if 0, then all pixels specified in the constructor are processed
-       * @param maxOutputValue: the maximum output value
-       */
-       static void normalizeGrayOutput_0_maxOutputValue(type *inputOutputBuffer, const size_t nbPixels, const type maxOutputValue=(type)255.0);
-
-       /**
-       * standard 0 to 255 image normalization function
-       * @param inputOutputBuffer: the image to be normalized (rewrites the input), if no parameter, then, the built in buffer reachable by getOutput() function is normalized
-       * @param nbPixels: specifies the number of pixel on which the normalization should be performed, if 0, then all pixels specified in the constructor are processed
-       * @param maxOutputValue: the maximum output value
-       */
-       void normalizeGrayOutput_0_maxOutputValue(const type maxOutputValue=(type)255.0){normalizeGrayOutput_0_maxOutputValue(this->Buffer(), this->size(), maxOutputValue);};
-
-       /**
-       * sigmoide image normalization function (saturates min and max values)
-       * @param meanValue: specifies the mean value of th pixels to be processed
-       * @param sensitivity: strenght of the sigmoide
-       * @param inputPicture: the image to be normalized if no parameter, then, the built in buffer reachable by getOutput() function is normalized
-       * @param outputBuffer: the ouput buffer on which the result is writed, if no parameter, then, the built in buffer reachable by getOutput() function is normalized
-       * @param maxOutputValue: the maximum output value
-       */
-       static void normalizeGrayOutputCentredSigmoide(const type meanValue, const type sensitivity, const type maxOutputValue, type *inputPicture, type *outputBuffer, const unsigned int nbPixels);
-
-       /**
-       * sigmoide image normalization function on the current buffer (saturates min and max values)
-       * @param meanValue: specifies the mean value of th pixels to be processed
-       * @param sensitivity: strenght of the sigmoide
-       * @param maxOutputValue: the maximum output value
-       */
-       inline void normalizeGrayOutputCentredSigmoide(const type meanValue=(type)0.0, const type sensitivity=(type)2.0, const type maxOutputValue=(type)255.0){ (void)maxOutputValue; normalizeGrayOutputCentredSigmoide(meanValue, sensitivity, 255.0, this->Buffer(), this->Buffer(), this->getNBpixels());};
-
-       /**
-       * sigmoide image normalization function (saturates min and max values), in this function, the sigmoide is centered on low values (high saturation of the medium and high values
-       * @param inputPicture: the image to be normalized if no parameter, then, the built in buffer reachable by getOutput() function is normalized
-       * @param outputBuffer: the ouput buffer on which the result is writed, if no parameter, then, the built in buffer reachable by getOutput() function is normalized
-       * @param sensitivity: strenght of the sigmoide
-       * @param maxOutputValue: the maximum output value
-       */
-       void normalizeGrayOutputNearZeroCentreredSigmoide(type *inputPicture=(type*)NULL, type *outputBuffer=(type*)NULL, const type sensitivity=(type)40, const type maxOutputValue=(type)255.0);
-
-       /**
-       * center and reduct the image (image-mean)/std
-       * @param inputOutputBuffer: the image to be normalized if no parameter, the result is rewrited on it
-       */
-       void centerReductImageLuminance(type *inputOutputBuffer=(type*)NULL);
-
-       /**
-       * @return standard deviation of the buffer
-       */
-       const double getStandardDeviation()
-       {
-               double standardDeviation=0;
-               double meanValue=getMean();
-
-               type *bufferPTR=Buffer();
-               for (unsigned int i=0;i<this->size();++i)
-               {
-                       double diff=(*(bufferPTR++)-meanValue);
-                       standardDeviation+=diff*diff;
-               }
-               return sqrt(standardDeviation/this->size());
-       };
-
-       /**
-       * Clip buffer histogram
-       * @param minRatio: the minimum ratio of the lower pixel values, range=[0,1] and lower than maxRatio
-       * @param maxRatio: the aximum ratio of the higher pixel values, range=[0,1] and higher than minRatio
-       */
-       void clipHistogram(double minRatio, double maxRatio, double maxOutputValue)
-       {
-
-               if (minRatio>=maxRatio)
-               {
-                       std::cerr<<"TemplateBuffer::clipHistogram: minRatio must be inferior to maxRatio, buffer unchanged"<<std::endl;
-                       return;
-               }
-
-               /*    minRatio=min(max(minRatio, 1.0),0.0);
+     */
+    /**
+    * @return the buffer adress in non const mode
+    */
+    inline type*    Buffer()            {    return &(*this)[0];    }
+
+    ///////////////////////////////////////////////////////
+    // Standard Image manipulation functions
+
+    /**
+    * standard 0 to 255 image normalization function
+    * @param inputOutputBuffer: the image to be normalized (rewrites the input), if no parameter, then, the built in buffer reachable by getOutput() function is normalized
+    * @param nbPixels: specifies the number of pixel on which the normalization should be performed, if 0, then all pixels specified in the constructor are processed
+    * @param maxOutputValue: the maximum output value
+    */
+    static void normalizeGrayOutput_0_maxOutputValue(type *inputOutputBuffer, const size_t nbPixels, const type maxOutputValue=(type)255.0);
+
+    /**
+    * standard 0 to 255 image normalization function
+    * @param inputOutputBuffer: the image to be normalized (rewrites the input), if no parameter, then, the built in buffer reachable by getOutput() function is normalized
+    * @param nbPixels: specifies the number of pixel on which the normalization should be performed, if 0, then all pixels specified in the constructor are processed
+    * @param maxOutputValue: the maximum output value
+    */
+    void normalizeGrayOutput_0_maxOutputValue(const type maxOutputValue=(type)255.0){normalizeGrayOutput_0_maxOutputValue(this->Buffer(), this->size(), maxOutputValue);};
+
+    /**
+    * sigmoide image normalization function (saturates min and max values)
+    * @param meanValue: specifies the mean value of th pixels to be processed
+    * @param sensitivity: strenght of the sigmoide
+    * @param inputPicture: the image to be normalized if no parameter, then, the built in buffer reachable by getOutput() function is normalized
+    * @param outputBuffer: the ouput buffer on which the result is writed, if no parameter, then, the built in buffer reachable by getOutput() function is normalized
+    * @param maxOutputValue: the maximum output value
+    */
+    static void normalizeGrayOutputCentredSigmoide(const type meanValue, const type sensitivity, const type maxOutputValue, type *inputPicture, type *outputBuffer, const unsigned int nbPixels);
+
+    /**
+    * sigmoide image normalization function on the current buffer (saturates min and max values)
+    * @param meanValue: specifies the mean value of th pixels to be processed
+    * @param sensitivity: strenght of the sigmoide
+    * @param maxOutputValue: the maximum output value
+    */
+    inline void normalizeGrayOutputCentredSigmoide(const type meanValue=(type)0.0, const type sensitivity=(type)2.0, const type maxOutputValue=(type)255.0){ (void)maxOutputValue; normalizeGrayOutputCentredSigmoide(meanValue, sensitivity, 255.0, this->Buffer(), this->Buffer(), this->getNBpixels());};
+
+    /**
+    * sigmoide image normalization function (saturates min and max values), in this function, the sigmoide is centered on low values (high saturation of the medium and high values
+    * @param inputPicture: the image to be normalized if no parameter, then, the built in buffer reachable by getOutput() function is normalized
+    * @param outputBuffer: the ouput buffer on which the result is writed, if no parameter, then, the built in buffer reachable by getOutput() function is normalized
+    * @param sensitivity: strenght of the sigmoide
+    * @param maxOutputValue: the maximum output value
+    */
+    void normalizeGrayOutputNearZeroCentreredSigmoide(type *inputPicture=(type*)NULL, type *outputBuffer=(type*)NULL, const type sensitivity=(type)40, const type maxOutputValue=(type)255.0);
+
+    /**
+    * center and reduct the image (image-mean)/std
+    * @param inputOutputBuffer: the image to be normalized if no parameter, the result is rewrited on it
+    */
+    void centerReductImageLuminance(type *inputOutputBuffer=(type*)NULL);
+
+    /**
+    * @return standard deviation of the buffer
+    */
+    double getStandardDeviation()
+    {
+        double standardDeviation=0;
+        double meanValue=getMean();
+
+        type *bufferPTR=Buffer();
+        for (unsigned int i=0;i<this->size();++i)
+        {
+            double diff=(*(bufferPTR++)-meanValue);
+            standardDeviation+=diff*diff;
+        }
+        return sqrt(standardDeviation/this->size());
+    };
+
+    /**
+    * Clip buffer histogram
+    * @param minRatio: the minimum ratio of the lower pixel values, range=[0,1] and lower than maxRatio
+    * @param maxRatio: the aximum ratio of the higher pixel values, range=[0,1] and higher than minRatio
+    */
+    void clipHistogram(double minRatio, double maxRatio, double maxOutputValue)
+    {
+
+        if (minRatio>=maxRatio)
+        {
+            std::cerr<<"TemplateBuffer::clipHistogram: minRatio must be inferior to maxRatio, buffer unchanged"<<std::endl;
+            return;
+        }
+
+        /*    minRatio=min(max(minRatio, 1.0),0.0);
     maxRatio=max(max(maxRatio, 0.0),1.0);
-                */
-
-               // find the pixel value just above the threshold
-               const double maxThreshold=this->max()*maxRatio;
-               const double minThreshold=(this->max()-this->min())*minRatio+this->min();
-
-               type *bufferPTR=this->Buffer();
-
-               double deltaH=maxThreshold;
-               double deltaL=maxThreshold;
-
-               double updatedHighValue=maxThreshold;
-               double updatedLowValue=maxThreshold;
-
-               for (unsigned int i=0;i<this->size();++i)
-               {
-                       double curentValue=(double)*(bufferPTR++);
-
-                       // updating "closest to the high threshold" pixel value
-                       double highValueTest=maxThreshold-curentValue;
-                       if (highValueTest>0)
-                       {
-                               if (deltaH>highValueTest)
-                               {
-                                       deltaH=highValueTest;
-                                       updatedHighValue=curentValue;
-                               }
-                       }
-
-                       // updating "closest to the low threshold" pixel value
-                       double lowValueTest=curentValue-minThreshold;
-                       if (lowValueTest>0)
-                       {
-                               if (deltaL>lowValueTest)
-                               {
-                                       deltaL=lowValueTest;
-                                       updatedLowValue=curentValue;
-                               }
-                       }
-               }
-
-               std::cout<<"Tdebug"<<std::endl;
-               std::cout<<"deltaL="<<deltaL<<", deltaH="<<deltaH<<std::endl;
-               std::cout<<"this->max()"<<this->max()<<"maxThreshold="<<maxThreshold<<"updatedHighValue="<<updatedHighValue<<std::endl;
-               std::cout<<"this->min()"<<this->min()<<"minThreshold="<<minThreshold<<"updatedLowValue="<<updatedLowValue<<std::endl;
-               // clipping values outside than the updated thresholds
-               bufferPTR=this->Buffer();
-               for (unsigned int i=0;i<this->size();++i, ++bufferPTR)
-               {
-                       if (*bufferPTR<updatedLowValue)
-                               *bufferPTR=updatedLowValue;
-                       else if (*bufferPTR>updatedHighValue)
-                               *bufferPTR=updatedHighValue;
-               }
-
-               normalizeGrayOutput_0_maxOutputValue(this->Buffer(), this->size(), maxOutputValue);
-
-       }
-
-       /**
-       * @return the mean value of the vector
-       */
-       inline const double getMean(){return this->sum()/this->size();};
+         */
+
+        // find the pixel value just above the threshold
+        const double maxThreshold=this->max()*maxRatio;
+        const double minThreshold=(this->max()-this->min())*minRatio+this->min();
+
+        type *bufferPTR=this->Buffer();
+
+        double deltaH=maxThreshold;
+        double deltaL=maxThreshold;
+
+        double updatedHighValue=maxThreshold;
+        double updatedLowValue=maxThreshold;
+
+        for (unsigned int i=0;i<this->size();++i)
+        {
+            double curentValue=(double)*(bufferPTR++);
+
+            // updating "closest to the high threshold" pixel value
+            double highValueTest=maxThreshold-curentValue;
+            if (highValueTest>0)
+            {
+                if (deltaH>highValueTest)
+                {
+                    deltaH=highValueTest;
+                    updatedHighValue=curentValue;
+                }
+            }
+
+            // updating "closest to the low threshold" pixel value
+            double lowValueTest=curentValue-minThreshold;
+            if (lowValueTest>0)
+            {
+                if (deltaL>lowValueTest)
+                {
+                    deltaL=lowValueTest;
+                    updatedLowValue=curentValue;
+                }
+            }
+        }
+
+        std::cout<<"Tdebug"<<std::endl;
+        std::cout<<"deltaL="<<deltaL<<", deltaH="<<deltaH<<std::endl;
+        std::cout<<"this->max()"<<this->max()<<"maxThreshold="<<maxThreshold<<"updatedHighValue="<<updatedHighValue<<std::endl;
+        std::cout<<"this->min()"<<this->min()<<"minThreshold="<<minThreshold<<"updatedLowValue="<<updatedLowValue<<std::endl;
+        // clipping values outside than the updated thresholds
+        bufferPTR=this->Buffer();
+        for (unsigned int i=0;i<this->size();++i, ++bufferPTR)
+        {
+            if (*bufferPTR<updatedLowValue)
+                *bufferPTR=updatedLowValue;
+            else if (*bufferPTR>updatedHighValue)
+                *bufferPTR=updatedHighValue;
+        }
+
+        normalizeGrayOutput_0_maxOutputValue(this->Buffer(), this->size(), maxOutputValue);
+
+    }
+
+    /**
+    * @return the mean value of the vector
+    */
+    inline double getMean(){return this->sum()/this->size();};
 
 protected:
-       size_t _NBrows;
-       size_t _NBcolumns;
-       size_t _NBdepths;
-       size_t _NBpixels;
-       size_t _doubleNBpixels;
-       // utilities
-       static type _abs(const type x);
+    size_t _NBrows;
+    size_t _NBcolumns;
+    size_t _NBdepths;
+    size_t _NBpixels;
+    size_t _doubleNBpixels;
+    // utilities
+    static type _abs(const type x);
 
 };
 
@@ -390,48 +390,48 @@ protected:
 template <class type>
 void TemplateBuffer<type>::normalizeGrayOutput_0_maxOutputValue(type *inputOutputBuffer, const size_t processedPixels, const type maxOutputValue)
 {
-       type maxValue=inputOutputBuffer[0], minValue=inputOutputBuffer[0];
-
-       // get the min and max value
-       register type *inputOutputBufferPTR=inputOutputBuffer;
-       for (register size_t j = 0; j<processedPixels; ++j)
-       {
-               type pixValue = *(inputOutputBufferPTR++);
-               if (maxValue < pixValue)
-                       maxValue = pixValue;
-               else if (minValue > pixValue)
-                       minValue = pixValue;
-       }
-       // change the range of the data to 0->255
-
-       type factor = maxOutputValue/(maxValue-minValue);
-       type offset = (type)(-minValue*factor);
-
-       inputOutputBufferPTR=inputOutputBuffer;
-       for (register size_t j = 0; j < processedPixels; ++j, ++inputOutputBufferPTR)
-               *inputOutputBufferPTR=*(inputOutputBufferPTR)*factor+offset;
+    type maxValue=inputOutputBuffer[0], minValue=inputOutputBuffer[0];
+
+    // get the min and max value
+    register type *inputOutputBufferPTR=inputOutputBuffer;
+    for (register size_t j = 0; j<processedPixels; ++j)
+    {
+        type pixValue = *(inputOutputBufferPTR++);
+        if (maxValue < pixValue)
+            maxValue = pixValue;
+        else if (minValue > pixValue)
+            minValue = pixValue;
+    }
+    // change the range of the data to 0->255
+
+    type factor = maxOutputValue/(maxValue-minValue);
+    type offset = (type)(-minValue*factor);
+
+    inputOutputBufferPTR=inputOutputBuffer;
+    for (register size_t j = 0; j < processedPixels; ++j, ++inputOutputBufferPTR)
+        *inputOutputBufferPTR=*(inputOutputBufferPTR)*factor+offset;
 
 }
 // normalize data with a sigmoide close to 0 (saturates values for those superior to 0)
 template <class type>
 void TemplateBuffer<type>::normalizeGrayOutputNearZeroCentreredSigmoide(type *inputBuffer, type *outputBuffer, const type sensitivity, const type maxOutputValue)
 {
-       if (inputBuffer==NULL)
-               inputBuffer=Buffer();
-       if (outputBuffer==NULL)
-               outputBuffer=Buffer();
+    if (inputBuffer==NULL)
+        inputBuffer=Buffer();
+    if (outputBuffer==NULL)
+        outputBuffer=Buffer();
 
-       type X0cube=sensitivity*sensitivity*sensitivity;
+    type X0cube=sensitivity*sensitivity*sensitivity;
 
-       register type *inputBufferPTR=inputBuffer;
-       register type *outputBufferPTR=outputBuffer;
+    register type *inputBufferPTR=inputBuffer;
+    register type *outputBufferPTR=outputBuffer;
 
-       for (register size_t j = 0; j < _NBpixels; ++j, ++inputBufferPTR)
-       {
+    for (register size_t j = 0; j < _NBpixels; ++j, ++inputBufferPTR)
+    {
 
-               type currentCubeLuminance=*inputBufferPTR**inputBufferPTR**inputBufferPTR;
-               *(outputBufferPTR++)=maxOutputValue*currentCubeLuminance/(currentCubeLuminance+X0cube);
-       }
+        type currentCubeLuminance=*inputBufferPTR**inputBufferPTR**inputBufferPTR;
+        *(outputBufferPTR++)=maxOutputValue*currentCubeLuminance/(currentCubeLuminance+X0cube);
+    }
 }
 
 // normalize and adjust luminance with a centered to 128 sigmode
@@ -439,20 +439,20 @@ template <class type>
 void TemplateBuffer<type>::normalizeGrayOutputCentredSigmoide(const type meanValue, const type sensitivity, const type maxOutputValue, type *inputBuffer, type *outputBuffer, const unsigned int nbPixels)
 {
 
-       if (sensitivity==1.0)
-       {
-               std::cerr<<"TemplateBuffer::TemplateBuffer<type>::normalizeGrayOutputCentredSigmoide error: 2nd parameter (sensitivity) must not equal 0, copying original data..."<<std::endl;
-               memcpy(outputBuffer, inputBuffer, sizeof(type)*nbPixels);
-               return;
-       }
+    if (sensitivity==1.0)
+    {
+        std::cerr<<"TemplateBuffer::TemplateBuffer<type>::normalizeGrayOutputCentredSigmoide error: 2nd parameter (sensitivity) must not equal 0, copying original data..."<<std::endl;
+        memcpy(outputBuffer, inputBuffer, sizeof(type)*nbPixels);
+        return;
+    }
 
-       type X0=maxOutputValue/(sensitivity-(type)1.0);
+    type X0=maxOutputValue/(sensitivity-(type)1.0);
 
-       register type *inputBufferPTR=inputBuffer;
-       register type *outputBufferPTR=outputBuffer;
+    register type *inputBufferPTR=inputBuffer;
+    register type *outputBufferPTR=outputBuffer;
 
-       for (register size_t j = 0; j < nbPixels; ++j, ++inputBufferPTR)
-               *(outputBufferPTR++)=(meanValue+(meanValue+X0)*(*(inputBufferPTR)-meanValue)/(_abs(*(inputBufferPTR)-meanValue)+X0));
+    for (register size_t j = 0; j < nbPixels; ++j, ++inputBufferPTR)
+        *(outputBufferPTR++)=(meanValue+(meanValue+X0)*(*(inputBufferPTR)-meanValue)/(_abs(*(inputBufferPTR)-meanValue)+X0));
 
 }
 
@@ -460,29 +460,29 @@ void TemplateBuffer<type>::normalizeGrayOutputCentredSigmoide(const type meanVal
 template <class type>
 void TemplateBuffer<type>::centerReductImageLuminance(type *inputOutputBuffer)
 {
-       // if outputBuffer unsassigned, the rewrite the buffer
-       if (inputOutputBuffer==NULL)
-               inputOutputBuffer=Buffer();
-       type meanValue=0, stdValue=0;
-
-       // compute mean value
-       for (register size_t j = 0; j < _NBpixels; ++j)
-               meanValue+=inputOutputBuffer[j];
-       meanValue/=((type)_NBpixels);
-
-       // compute std value
-       register type *inputOutputBufferPTR=inputOutputBuffer;
-       for (size_t index=0;index<_NBpixels;++index)
-       {
-               type inputMinusMean=*(inputOutputBufferPTR++)-meanValue;
-               stdValue+=inputMinusMean*inputMinusMean;
-       }
-
-       stdValue=sqrt(stdValue/((type)_NBpixels));
-       // adjust luminance in regard of mean and std value;
-       inputOutputBufferPTR=inputOutputBuffer;
-       for (size_t index=0;index<_NBpixels;++index, ++inputOutputBufferPTR)
-               *inputOutputBufferPTR=(*(inputOutputBufferPTR)-meanValue)/stdValue;
+    // if outputBuffer unsassigned, the rewrite the buffer
+    if (inputOutputBuffer==NULL)
+        inputOutputBuffer=Buffer();
+    type meanValue=0, stdValue=0;
+
+    // compute mean value
+    for (register size_t j = 0; j < _NBpixels; ++j)
+        meanValue+=inputOutputBuffer[j];
+    meanValue/=((type)_NBpixels);
+
+    // compute std value
+    register type *inputOutputBufferPTR=inputOutputBuffer;
+    for (size_t index=0;index<_NBpixels;++index)
+    {
+        type inputMinusMean=*(inputOutputBufferPTR++)-meanValue;
+        stdValue+=inputMinusMean*inputMinusMean;
+    }
+
+    stdValue=sqrt(stdValue/((type)_NBpixels));
+    // adjust luminance in regard of mean and std value;
+    inputOutputBufferPTR=inputOutputBuffer;
+    for (size_t index=0;index<_NBpixels;++index, ++inputOutputBufferPTR)
+        *inputOutputBufferPTR=(*(inputOutputBufferPTR)-meanValue)/stdValue;
 }
 
 
@@ -490,27 +490,27 @@ template <class type>
 type TemplateBuffer<type>::_abs(const type x)
 {
 
-       if (x>0)
-               return x;
-       else
-               return -x;
+    if (x>0)
+        return x;
+    else
+        return -x;
 }
 
 template < >
 inline int TemplateBuffer<int>::_abs(const int x)
 {
-       return std::abs(x);
+    return std::abs(x);
 }
 template < >
 inline double TemplateBuffer<double>::_abs(const double x)
 {
-       return std::fabs(x);
+    return std::fabs(x);
 }
 
 template < >
 inline float TemplateBuffer<float>::_abs(const float x)
 {
-       return std::fabs(x);
+    return std::fabs(x);
 }
 
 }
index edaadc8..049b7fb 100644 (file)
 #endif
 
 #if USE_ZLIB
-#include <zlib.h>
+#  undef HAVE_UNISTD_H //to avoid redefinition
+#  ifndef _LFS64_LARGEFILE
+#    define _LFS64_LARGEFILE 0
+#  endif
+#  ifndef _FILE_OFFSET_BITS
+#    define _FILE_OFFSET_BITS 0
+#  endif
+#  include <zlib.h>
 #endif
 
 /****************************************************************************************\
@@ -257,11 +264,11 @@ typedef struct CvFileStorage
     CvWriteString write_string;
     CvWriteComment write_comment;
     CvStartNextStream start_next_stream;
-    
+
     const char* strbuf;
     size_t strbufsize, strbufpos;
     std::deque<char>* outbuf;
-    
+
     bool is_opened;
 }
 CvFileStorage;
@@ -543,10 +550,10 @@ icvClose( CvFileStorage* fs, std::string* out )
 {
     if( out )
         out->clear();
-    
+
     if( !fs )
         CV_Error( CV_StsNullPtr, "NULL double pointer to file storage" );
-    
+
     if( fs->is_opened )
     {
         if( fs->write_mode && (fs->file || fs->gzfile || fs->outbuf) )
@@ -560,10 +567,10 @@ icvClose( CvFileStorage* fs, std::string* out )
             if( fs->fmt == CV_STORAGE_FORMAT_XML )
                 icvPuts( fs, "</opencv_storage>\n" );
         }
-        
+
         icvCloseFile(fs);
     }
-        
+
     if( fs->outbuf && out )
     {
         out->resize(fs->outbuf->size());
@@ -578,21 +585,21 @@ cvReleaseFileStorage( CvFileStorage** p_fs )
 {
     if( !p_fs )
         CV_Error( CV_StsNullPtr, "NULL double pointer to file storage" );
-    
+
     if( *p_fs )
     {
         CvFileStorage* fs = *p_fs;
         *p_fs = 0;
-        
+
         icvClose(fs, 0);
-        
-        cvReleaseMemStorage( &fs->strstorage );        
+
+        cvReleaseMemStorage( &fs->strstorage );
         cvFree( &fs->buffer_start );
         cvReleaseMemStorage( &fs->memstorage );
-        
+
         if( fs->outbuf )
             delete fs->outbuf;
-        
+
         memset( fs, 0, sizeof(*fs) );
         cvFree( &fs );
     }
@@ -2697,7 +2704,7 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co
     }
     else
         fnamelen = strlen(filename);
-    
+
     if( mem && append )
         CV_Error( CV_StsBadFlag, "CV_STORAGE_APPEND and CV_STORAGE_MEMORY are not currently compatible" );
 
@@ -2709,7 +2716,7 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co
 
     fs->flags = CV_FILE_STORAGE;
     fs->write_mode = write_mode;
-    
+
     if( !mem )
     {
         fs->filename = (char*)cvMemStorageAlloc( fs->memstorage, fnamelen+1 );
@@ -2747,7 +2754,7 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co
             #endif
         }
     }
-    
+
     fs->roots = 0;
     fs->struct_indent = 0;
     fs->struct_flags = 0;
@@ -2756,10 +2763,10 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co
     if( fs->write_mode )
     {
         int fmt = flags & CV_STORAGE_FORMAT_MASK;
-        
+
         if( mem )
             fs->outbuf = new std::deque<char>;
-        
+
         if( fmt == CV_STORAGE_FORMAT_AUTO && filename )
         {
             const char* dot_pos = filename + fnamelen - (isGZ ? 7 : 4);
@@ -2769,7 +2776,7 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co
         }
         else
             fs->fmt = fmt != CV_STORAGE_FORMAT_AUTO ? fmt : CV_STORAGE_FORMAT_XML;
-        
+
         // we use factor=6 for XML (the longest characters (' and ") are encoded with 6 bytes (&apos; and &quot;)
         // and factor=4 for YAML ( as we use 4 bytes for non ASCII characters (e.g. \xAB))
         int buf_size = CV_FS_MAX_LEN*(fs->fmt == CV_STORAGE_FORMAT_XML ? 6 : 4) + 1024;
@@ -2871,7 +2878,7 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co
             fs->strbuf = filename;
             fs->strbufsize = fnamelen;
         }
-        
+
         size_t buf_size = 1 << 20;
         const char* yaml_signature = "%YAML:";
         char buf[16];
@@ -2917,7 +2924,7 @@ cvOpenFileStorage( const char* filename, CvMemStorage* dststorage, int flags, co
         fs->buffer = fs->buffer_end = 0;
     }
     fs->is_opened = true;
-    
+
 _exit_:
     if( fs )
     {
@@ -3120,7 +3127,7 @@ cvWriteRawData( CvFileStorage* fs, const void* _data, int len, const char* dt )
 
     if( !len )
         return;
-    
+
     if( !data0 )
         CV_Error( CV_StsNullPtr, "Null data pointer" );
 
@@ -3564,7 +3571,7 @@ icvReadMat( CvFileStorage* fs, CvFileNode* node )
     cols = cvReadIntByName( fs, node, "cols", -1 );
     dt = cvReadStringByName( fs, node, "dt", 0 );
 
-    if( rows < 0 || cols < 0 || dt < 0 )
+    if( rows < 0 || cols < 0 || !dt )
         CV_Error( CV_StsError, "Some of essential matrix attributes are absent" );
 
     elem_type = icvDecodeSimpleFormat( dt );
@@ -4632,7 +4639,7 @@ icvReadGraph( CvFileStorage* fs, CvFileNode* node )
     if( header_dt )
         header_size = icvCalcElemSize( header_dt, header_size );
 
-    if( vtx_dt > 0 )
+    if( vtx_dt )
     {
         src_vtx_size = icvCalcElemSize( vtx_dt, 0 );
         vtx_size = icvCalcElemSize( vtx_dt, vtx_size );
@@ -5192,7 +5199,7 @@ void FileStorage::release()
 
 string FileStorage::releaseAndGetString()
 {
-       string buf;
+    string buf;
     if( fs.obj && fs.obj->outbuf )
         icvClose(fs.obj, &buf);
     
@@ -5496,7 +5503,7 @@ void write( FileStorage& fs, const string& name, const SparseMat& value )
     Ptr<CvSparseMat> mat = (CvSparseMat*)value;
     cvWrite( *fs, name.size() ? name.c_str() : 0, mat );
 }
-    
+
 
 WriteStructContext::WriteStructContext(FileStorage& _fs, const string& name,
                    int flags, const string& typeName) : fs(&_fs)
index 3046b23..77bc4c3 100644 (file)
@@ -43,7 +43,7 @@
 #ifndef __OPENCV_PRECOMP_H__
 #define __OPENCV_PRECOMP_H__
 
-#ifdef HAVE_CVCONFIG_H 
+#ifdef HAVE_CVCONFIG_H
 #include "cvconfig.h"
 #endif
 
@@ -196,9 +196,9 @@ inline bool checkScalar(const Mat& sc, int atype, int sckind, int akind)
     return sc.size() == Size(1, 1) || sc.size() == Size(1, cn) || sc.size() == Size(cn, 1) ||
            (sc.size() == Size(1, 4) && sc.type() == CV_64F && cn <= 4);
 }
-    
+
 void convertAndUnrollScalar( const Mat& sc, int buftype, uchar* scbuf, size_t blocksize );
-    
+
 }
 
 #endif /*_CXCORE_INTERNAL_H_*/
index 3febc68..89189c6 100644 (file)
@@ -12,6 +12,7 @@
  * Adapted for FLANN by Marius Muja
  */
 
+#include "defines.h"
 #include <stdexcept>
 #include <ostream>
 #include <typeinfo>
@@ -98,6 +99,16 @@ struct big_any_policy : typed_base_any_policy<T>
     virtual void print(std::ostream& out, void* const* src) { out << *reinterpret_cast<T const*>(*src); }
 };
 
+template<> inline void big_any_policy<flann_centers_init_t>::print(std::ostream& out, void* const* src)
+{
+    out << int(*reinterpret_cast<flann_centers_init_t const*>(*src));
+}
+
+template<> inline void big_any_policy<flann_algorithm_t>::print(std::ostream& out, void* const* src)
+{
+    out << int(*reinterpret_cast<flann_algorithm_t const*>(*src));
+}
+
 template<typename T>
 struct choose_policy
 {
index 36ee669..fa1fdaf 100644 (file)
@@ -36,7 +36,7 @@ namespace cvflann
     */
     flann_distance_t flann_distance_type_ = FLANN_DIST_L2;
     flann_distance_t flann_distance_type() { return flann_distance_type_; }
-    
+
     /**
      * Set distance type to used
      * \deprecated
@@ -52,6 +52,6 @@ namespace cvflann
         }
         flann_distance_type_ = distance_type;
     }
-    
+
     void dummyfunc() {}
 }
\ No newline at end of file
index 7f776d6..55e6400 100644 (file)
@@ -30,6 +30,7 @@ if (HAVE_CUDA)
   source_group("Src\\NVidia" FILES ${ncv_files})
   ocv_include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS})
   ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations /wd4211 /wd4201 /wd4100 /wd4505 /wd4408)
+  string(REPLACE "-Wsign-promo" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 
   #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-keep")
   #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;")
index 2a0dfee..45196a5 100644 (file)
@@ -68,7 +68,7 @@ void cv::gpu::polarToCart(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, bool,
 void cv::gpu::gemm(const GpuMat& src1, const GpuMat& src2, double alpha, const GpuMat& src3, double beta, GpuMat& dst, int flags, Stream& stream)\r
 {\r
 #ifndef HAVE_CUBLAS\r
-\r
+    (void)src1; (void)src2; (void)alpha; (void)src3; (void)beta; (void)dst; (void)flags; (void)stream;\r
     CV_Error(CV_StsNotImplemented, "The library was build without CUBLAS");\r
 \r
 #else\r
index 19dc9df..8ee3c26 100644 (file)
@@ -748,6 +748,7 @@ namespace cv { namespace gpu { namespace device
                               const DevMem2Db& trainIdx, const DevMem2Db& distance,\r
                               int cc, cudaStream_t stream)\r
         {\r
+            (void)cc;\r
             if (query.cols <= 64)\r
             {\r
                 matchUnrolledCached<16, 64, Dist>(query, train, mask, static_cast< DevMem2D_<int2> >(trainIdx), static_cast< DevMem2D_<float2> > (distance), stream);\r
@@ -779,6 +780,7 @@ namespace cv { namespace gpu { namespace device
                               const DevMem2Db& trainIdx, const DevMem2Db& imgIdx, const DevMem2Db& distance,\r
                               int cc, cudaStream_t stream)\r
         {\r
+            (void)cc;\r
             if (query.cols <= 64)\r
             {\r
                 matchUnrolledCached<16, 64, Dist>(query, trains, n, mask, static_cast< DevMem2D_<int2> >(trainIdx), static_cast< DevMem2D_<int2> >(imgIdx), static_cast< DevMem2D_<float2> > (distance), stream);\r
@@ -943,6 +945,7 @@ namespace cv { namespace gpu { namespace device
                                     const DevMem2Df& allDist,\r
                                     int cc, cudaStream_t stream)\r
         {\r
+            (void)cc;\r
             if (query.cols <= 64)\r
             {\r
                 calcDistanceUnrolled<16, 64, Dist>(query, train, mask, allDist, stream);\r
index 0248dbf..3068c81 100644 (file)
@@ -567,6 +567,7 @@ namespace cv { namespace gpu { namespace device
                              const DevMem2Di& trainIdx, const DevMem2Df& distance,\r
                              int cc, cudaStream_t stream)\r
         {\r
+            (void)cc;\r
             if (query.cols <= 64)\r
             {\r
                 matchUnrolledCached<16, 64, Dist>(query, train, mask, trainIdx, distance, stream);\r
@@ -598,6 +599,7 @@ namespace cv { namespace gpu { namespace device
                              const DevMem2Di& trainIdx, const DevMem2Di& imgIdx, const DevMem2Df& distance,\r
                              int cc, cudaStream_t stream)\r
         {\r
+            (void)cc;\r
             if (query.cols <= 64)\r
             {\r
                 matchUnrolledCached<16, 64, Dist>(query, trains, n, mask, trainIdx, imgIdx, distance, stream);\r
index 015ac0b..0aa7191 100644 (file)
@@ -281,6 +281,7 @@ namespace cv { namespace gpu { namespace device
                              const DevMem2Di& trainIdx, const DevMem2Df& distance, const DevMem2D_<unsigned int>& nMatches,\r
                              int cc, cudaStream_t stream)\r
         {\r
+            (void)cc;\r
             if (query.cols <= 64)\r
             {\r
                 matchUnrolled<16, 64, Dist>(query, train, maxDistance, mask, trainIdx, distance, nMatches, stream);\r
@@ -312,6 +313,7 @@ namespace cv { namespace gpu { namespace device
                              const DevMem2Di& trainIdx, const DevMem2Di& imgIdx, const DevMem2Df& distance, const DevMem2D_<unsigned int>& nMatches,\r
                              int cc, cudaStream_t stream)\r
         {\r
+            (void)cc;\r
             if (query.cols <= 64)\r
             {\r
                 matchUnrolled<16, 64, Dist>(query, trains, n, maxDistance, masks, trainIdx, imgIdx, distance, nMatches, stream);\r
index 27c550f..8150bf9 100644 (file)
@@ -619,6 +619,7 @@ namespace cv { namespace gpu { namespace device
         void compute_gradients_8UC4(int nbins, int height, int width, const DevMem2Db& img,\r
                                     float angle_scale, DevMem2Df grad, DevMem2Db qangle, bool correct_gamma)\r
         {\r
+            (void)nbins;\r
             const int nthreads = 256;\r
 \r
             dim3 bdim(nthreads, 1);\r
@@ -691,6 +692,7 @@ namespace cv { namespace gpu { namespace device
         void compute_gradients_8UC1(int nbins, int height, int width, const DevMem2Db& img,\r
                                     float angle_scale, DevMem2Df grad, DevMem2Db qangle, bool correct_gamma)\r
         {\r
+            (void)nbins;\r
             const int nthreads = 256;\r
 \r
             dim3 bdim(nthreads, 1);\r
index 80bdb2f..a0b1e0d 100644 (file)
@@ -87,6 +87,9 @@ namespace cv { namespace gpu { namespace device
         {\r
             static void call(DevMem2D_<T> src, DevMem2D_<T> srcWhole, int xoff, int yoff, DevMem2Df mapx, DevMem2Df mapy, DevMem2D_<T> dst, const float* borderValue, int)\r
             {\r
+                (void)srcWhole;\r
+                (void)xoff;\r
+                (void)yoff;\r
                 typedef typename TypeVec<float, VecTraits<T>::cn>::vec_type work_type;\r
 \r
                 dim3 block(32, 8);\r
index 7bcb5a3..6bf2291 100644 (file)
@@ -132,6 +132,10 @@ namespace cv { namespace gpu { namespace device
         {\r
             static void call(DevMem2D_<T> src, DevMem2D_<T> srcWhole, int xoff, int yoff, float fx, float fy, DevMem2D_<T> dst)\r
             {\r
+                (void)srcWhole;\r
+                (void)xoff;\r
+                (void)yoff;\r
+\r
                 dim3 block(32, 8);\r
                 dim3 grid(divUp(dst.cols, block.x), divUp(dst.rows, block.y));\r
 \r
@@ -220,6 +224,9 @@ namespace cv { namespace gpu { namespace device
         {\r
             static void call(DevMem2D_<T> src, DevMem2D_<T> srcWhole, int xoff, int yoff, float fx, float fy, DevMem2D_<T> dst, cudaStream_t stream)\r
             {\r
+                (void)srcWhole;\r
+                (void)xoff;\r
+                (void)yoff;\r
                 int iscale_x = round(fx);\r
                 int iscale_y = round(fy);\r
 \r
index d40029e..4757f9b 100644 (file)
@@ -158,6 +158,10 @@ namespace cv { namespace gpu { namespace device
         {\r
             static void call(DevMem2D_<T> src, DevMem2D_<T> srcWhole, int xoff, int yoff, DevMem2D_<T> dst, const float* borderValue, int)\r
             {\r
+                (void)xoff;\r
+                (void)yoff;\r
+                (void)srcWhole;\r
+\r
                 typedef typename TypeVec<float, VecTraits<T>::cn>::vec_type work_type;\r
 \r
                 dim3 block(32, 8);\r
index 6ade899..e04ec84 100644 (file)
@@ -1136,7 +1136,7 @@ NCVStatus NCVBroxOpticalFlow(const NCVBroxOpticalFlowDescriptor desc,
                     ptrVNew->ptr(), dstSize, ns * sizeof (float), dstROI, 1.0f/scale_factor, 1.0f/scale_factor, nppStBicubic) );\r
 \r
                 ScaleVector(ptrVNew->ptr(), ptrVNew->ptr(), 1.0f/scale_factor, ns * nh, stream);\r
-                ncvAssertCUDALastErrorReturn(NCV_CUDA_ERROR);\r
+                ncvAssertCUDALastErrorReturn((int)NCV_CUDA_ERROR);\r
 \r
                 cv::gpu::device::swap<FloatVector*>(ptrU, ptrUNew);\r
                 cv::gpu::device::swap<FloatVector*>(ptrV, ptrVNew);\r
@@ -1145,17 +1145,17 @@ NCVStatus NCVBroxOpticalFlow(const NCVBroxOpticalFlowDescriptor desc,
         }\r
 \r
         // end of warping iterations\r
-        ncvAssertCUDAReturn(cudaStreamSynchronize(stream), NCV_CUDA_ERROR);\r
+        ncvAssertCUDAReturn(cudaStreamSynchronize(stream), (int)NCV_CUDA_ERROR);\r
 \r
         ncvAssertCUDAReturn( cudaMemcpy2DAsync\r
             (uOut.ptr(), uOut.pitch(), ptrU->ptr(),\r
-            kSourcePitch, kSourceWidth*sizeof(float), kSourceHeight, cudaMemcpyDeviceToDevice, stream), NCV_CUDA_ERROR );\r
+            kSourcePitch, kSourceWidth*sizeof(float), kSourceHeight, cudaMemcpyDeviceToDevice, stream), (int)NCV_CUDA_ERROR );\r
 \r
         ncvAssertCUDAReturn( cudaMemcpy2DAsync\r
             (vOut.ptr(), vOut.pitch(), ptrV->ptr(),\r
-            kSourcePitch, kSourceWidth*sizeof(float), kSourceHeight, cudaMemcpyDeviceToDevice, stream), NCV_CUDA_ERROR );\r
+            kSourcePitch, kSourceWidth*sizeof(float), kSourceHeight, cudaMemcpyDeviceToDevice, stream), (int)NCV_CUDA_ERROR );\r
 \r
-        ncvAssertCUDAReturn(cudaStreamSynchronize(stream), NCV_CUDA_ERROR);\r
+        ncvAssertCUDAReturn(cudaStreamSynchronize(stream), (int)NCV_CUDA_ERROR);\r
     }\r
 \r
     return NCV_SUCCESS;\r
index ad072eb..3355503 100644 (file)
@@ -687,6 +687,7 @@ struct applyHaarClassifierAnchorParallelFunctor
     template<class TList>\r
     void call(TList tl)\r
     {\r
+        (void)tl;\r
         applyHaarClassifierAnchorParallel <\r
             Loki::TL::TypeAt<TList, 0>::Result::value,\r
             Loki::TL::TypeAt<TList, 1>::Result::value,\r
@@ -796,6 +797,7 @@ struct applyHaarClassifierClassifierParallelFunctor
     template<class TList>\r
     void call(TList tl)\r
     {\r
+        (void)tl;\r
         applyHaarClassifierClassifierParallel <\r
             Loki::TL::TypeAt<TList, 0>::Result::value,\r
             Loki::TL::TypeAt<TList, 1>::Result::value,\r
@@ -876,6 +878,7 @@ struct initializeMaskVectorFunctor
     template<class TList>\r
     void call(TList tl)\r
     {\r
+        (void)tl;\r
         initializeMaskVector <\r
             Loki::TL::TypeAt<TList, 0>::Result::value,\r
             Loki::TL::TypeAt<TList, 1>::Result::value >\r
index 7a2d73e..1102689 100644 (file)
@@ -854,6 +854,7 @@ static NCVStatus drawRectsWrapperDevice(T *d_dst,
                                         T color,\r
                                         cudaStream_t cuStream)\r
 {\r
+    (void)cuStream;\r
     ncvAssertReturn(d_dst != NULL && d_rects != NULL, NCV_NULL_PTR);\r
     ncvAssertReturn(dstWidth > 0 && dstHeight > 0, NCV_DIMENSIONS_INVALID);\r
     ncvAssertReturn(dstStride >= dstWidth, NCV_INVALID_STEP);\r
index 19003e3..b359806 100644 (file)
@@ -1,7 +1,7 @@
 /*M///////////////////////////////////////////////////////////////////////////////////////\r
 //\r
-// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. \r
-// \r
+// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\r
+//\r
 //  By downloading, copying, installing or using the software you agree to this license.\r
 //  If you do not agree to this license, do not download, install,\r
 //  copy or use the software.\r
@@ -461,7 +461,7 @@ public:
 \r
     virtual NcvBool isInitialized(void) const = 0;\r
     virtual NcvBool isCounting(void) const = 0;\r
-    \r
+\r
     virtual NCVMemoryType memType(void) const = 0;\r
     virtual Ncv32u alignment(void) const = 0;\r
     virtual size_t maxSize(void) const = 0;\r
@@ -585,11 +585,11 @@ public:
         }\r
         else\r
         {\r
-            ncvAssertReturn(dst._length * sizeof(T) >= howMuch && \r
+            ncvAssertReturn(dst._length * sizeof(T) >= howMuch &&\r
                 this->_length * sizeof(T) >= howMuch &&\r
                 howMuch > 0, NCV_MEM_COPY_ERROR);\r
         }\r
-        ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) && \r
+        ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) &&\r
                         (dst._ptr != NULL || dst._memtype == NCVMemoryTypeNone), NCV_NULL_PTR);\r
 \r
         NCVStatus ncvStat = NCV_SUCCESS;\r
@@ -766,18 +766,18 @@ public:
         }\r
         else\r
         {\r
-            ncvAssertReturn(dst._pitch * dst._height >= howMuch && \r
+            ncvAssertReturn(dst._pitch * dst._height >= howMuch &&\r
                             this->_pitch * this->_height >= howMuch &&\r
                             howMuch > 0, NCV_MEM_COPY_ERROR);\r
         }\r
-        ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) && \r
+        ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) &&\r
                         (dst._ptr != NULL || dst._memtype == NCVMemoryTypeNone), NCV_NULL_PTR);\r
 \r
         NCVStatus ncvStat = NCV_SUCCESS;\r
         if (this->_memtype != NCVMemoryTypeNone)\r
         {\r
-            ncvStat = memSegCopyHelper(dst._ptr, dst._memtype, \r
-                                       this->_ptr, this->_memtype, \r
+            ncvStat = memSegCopyHelper(dst._ptr, dst._memtype,\r
+                                       this->_ptr, this->_memtype,\r
                                        howMuch, cuStream);\r
         }\r
 \r
@@ -788,7 +788,7 @@ public:
     {\r
         ncvAssertReturn(this->width() >= roi.width && this->height() >= roi.height &&\r
                         dst.width() >= roi.width && dst.height() >= roi.height, NCV_MEM_COPY_ERROR);\r
-        ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) && \r
+        ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) &&\r
                         (dst._ptr != NULL || dst._memtype == NCVMemoryTypeNone), NCV_NULL_PTR);\r
 \r
         NCVStatus ncvStat = NCV_SUCCESS;\r
@@ -802,7 +802,7 @@ public:
         return ncvStat;\r
     }\r
 \r
-    T &at(Ncv32u x, Ncv32u y) const\r
+    Tat(Ncv32u x, Ncv32u y) const\r
     {\r
         NcvBool bOutRange = (x >= this->_width || y >= this->_height);\r
         ncvAssertPrintCheck(!bOutRange, "Error addressing matrix at [" << x << ", " << y << "]");\r
index a13d344..6d8277f 100644 (file)
@@ -211,6 +211,7 @@ namespace NCVRuntimeTemplateBool
 \r
         static void call(Func &functor, std::vector<int> &templateParams)\r
         {\r
+            (void)templateParams;\r
             functor.call(TList());\r
         }\r
     };\r
index 9294b55..c33a088 100644 (file)
@@ -55,7 +55,12 @@ namespace cv { namespace gpu { namespace device
         typedef typename Ptr2D::elem_type elem_type;\r
         typedef float index_type;\r
 \r
-        explicit __host__ __device__ __forceinline__ PointFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) : src(src_) {}\r
+        explicit __host__ __device__ __forceinline__ PointFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f)\r
+        : src(src_)\r
+        {\r
+            (void)fx;\r
+            (void)fy;\r
+        }\r
 \r
         __device__ __forceinline__ elem_type operator ()(float y, float x) const\r
         {\r
@@ -70,8 +75,12 @@ namespace cv { namespace gpu { namespace device
         typedef typename Ptr2D::elem_type elem_type;\r
         typedef float index_type;\r
 \r
-        explicit __host__ __device__ __forceinline__ LinearFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) : src(src_) {}\r
-\r
+        explicit __host__ __device__ __forceinline__ LinearFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f)\r
+        : src(src_)\r
+        {\r
+            (void)fx;\r
+            (void)fy;\r
+        }\r
         __device__ __forceinline__ elem_type operator ()(float y, float x) const\r
         {\r
             typedef typename TypeVec<float, VecTraits<elem_type>::cn>::vec_type work_type;\r
@@ -107,7 +116,12 @@ namespace cv { namespace gpu { namespace device
         typedef float index_type;\r
         typedef typename TypeVec<float, VecTraits<elem_type>::cn>::vec_type work_type;\r
 \r
-        explicit __host__ __device__ __forceinline__ CubicFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) : src(src_) {}\r
+        explicit __host__ __device__ __forceinline__ CubicFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) \r
+        : src(src_)\r
+        {\r
+            (void)fx;\r
+            (void)fy;\r
+        }\r
 \r
         static __device__ __forceinline__ float bicubicCoeff(float x_)\r
         {\r
index 32e6d0e..1b836c7 100644 (file)
@@ -470,7 +470,7 @@ namespace cv { namespace gpu { namespace device
 \r
     template <typename T> struct thresh_trunc_func : unary_function<T, T>\r
     {\r
-        explicit __host__ __device__ __forceinline__ thresh_trunc_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {}\r
+        explicit __host__ __device__ __forceinline__ thresh_trunc_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {(void)maxVal_;}\r
 \r
         __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\r
         {\r
@@ -487,7 +487,7 @@ namespace cv { namespace gpu { namespace device
 \r
     template <typename T> struct thresh_to_zero_func : unary_function<T, T>\r
     {\r
-        explicit __host__ __device__ __forceinline__ thresh_to_zero_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {}\r
+        explicit __host__ __device__ __forceinline__ thresh_to_zero_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {(void)maxVal_;}\r
 \r
         __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\r
         {\r
@@ -503,7 +503,7 @@ namespace cv { namespace gpu { namespace device
 \r
     template <typename T> struct thresh_to_zero_inv_func : unary_function<T, T>\r
     {\r
-        explicit __host__ __device__ __forceinline__ thresh_to_zero_inv_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {}\r
+        explicit __host__ __device__ __forceinline__ thresh_to_zero_inv_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {(void)maxVal_;}\r
 \r
         __device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const\r
         {\r
index 626f5aa..241068d 100644 (file)
@@ -56,20 +56,6 @@ void cv::gpu::resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx, doub
 \r
     throw_nogpu();\r
 }\r
-void cv::gpu::resize(const GpuMat& src, GpuMat& dst,GpuMat& buffer, Size dsize,\r
-            double fx, double fy, int interpolation, Stream& s)\r
-{\r
-    (void)src;\r
-    (void)dst;\r
-    (void)dsize;\r
-    (void)fx;\r
-    (void)fy;\r
-    (void)interpolation;\r
-    (void)buffer;\r
-    (void)s;\r
-\r
-    throw_nogpu();\r
-}\r
 \r
 #else // HAVE_CUDA\r
 \r
index 4785aba..bc60a5e 100644 (file)
@@ -1,11 +1,11 @@
 /*\r
  * Copyright 1993-2010 NVIDIA Corporation.  All rights reserved.\r
  *\r
- * NVIDIA Corporation and its licensors retain all intellectual \r
- * property and proprietary rights in and to this software and \r
- * related documentation and any modifications thereto.  \r
- * Any use, reproduction, disclosure, or distribution of this \r
- * software and related documentation without an express license \r
+ * NVIDIA Corporation and its licensors retain all intellectual\r
+ * property and proprietary rights in and to this software and\r
+ * related documentation and any modifications thereto.\r
+ * Any use, reproduction, disclosure, or distribution of this\r
+ * software and related documentation without an express license\r
  * agreement from NVIDIA Corporation is strictly prohibited.\r
  */\r
 \r
 #include "NCVHaarObjectDetection.hpp"\r
 \r
 \r
-TestHypothesesFilter::TestHypothesesFilter(std::string testName, NCVTestSourceProvider<Ncv32u> &src,\r
-                                           Ncv32u numDstRects, Ncv32u minNeighbors, Ncv32f eps)\r
+TestHypothesesFilter::TestHypothesesFilter(std::string testName, NCVTestSourceProvider<Ncv32u> &src_,\r
+                                           Ncv32u numDstRects_, Ncv32u minNeighbors_, Ncv32f eps_)\r
     :\r
     NCVTestProvider(testName),\r
-    src(src),\r
-    numDstRects(numDstRects),\r
-    minNeighbors(minNeighbors),\r
-    eps(eps)\r
+    src(src_),\r
+    numDstRects(numDstRects_),\r
+    minNeighbors(minNeighbors_),\r
+    eps(eps_)\r
 {\r
 }\r
 \r
@@ -94,11 +94,11 @@ bool TestHypothesesFilter::process()
         for (Ncv32u j=0; j<numNeighbors; j++)\r
         {\r
             randVal = (1.0 * h_random32u.ptr()[randCnt++]) / 0xFFFFFFFF; randCnt = randCnt % h_random32u.length();\r
-            h_vecSrc.ptr()[srcSlotSize * i + j].x = \r
+            h_vecSrc.ptr()[srcSlotSize * i + j].x =\r
                 h_vecDst_groundTruth.ptr()[i].x +\r
                 (Ncv32s)(h_vecDst_groundTruth.ptr()[i].width * this->eps * (randVal - 0.5));\r
             randVal = (1.0 * h_random32u.ptr()[randCnt++]) / 0xFFFFFFFF; randCnt = randCnt % h_random32u.length();\r
-            h_vecSrc.ptr()[srcSlotSize * i + j].y = \r
+            h_vecSrc.ptr()[srcSlotSize * i + j].y =\r
                 h_vecDst_groundTruth.ptr()[i].y +\r
                 (Ncv32s)(h_vecDst_groundTruth.ptr()[i].height * this->eps * (randVal - 0.5));\r
             h_vecSrc.ptr()[srcSlotSize * i + j].width = h_vecDst_groundTruth.ptr()[i].width;\r
@@ -109,11 +109,11 @@ bool TestHypothesesFilter::process()
         for (Ncv32u j=numNeighbors; j<srcSlotSize; j++)\r
         {\r
             randVal = (1.0 * h_random32u.ptr()[randCnt++]) / 0xFFFFFFFF; randCnt = randCnt % h_random32u.length();\r
-            h_vecSrc.ptr()[srcSlotSize * i + j].x = \r
+            h_vecSrc.ptr()[srcSlotSize * i + j].x =\r
                 this->canvasWidth + h_vecDst_groundTruth.ptr()[i].x +\r
                 (Ncv32s)(h_vecDst_groundTruth.ptr()[i].width * this->eps * (randVal - 0.5));\r
             randVal = (1.0 * h_random32u.ptr()[randCnt++]) / 0xFFFFFFFF; randCnt = randCnt % h_random32u.length();\r
-            h_vecSrc.ptr()[srcSlotSize * i + j].y = \r
+            h_vecSrc.ptr()[srcSlotSize * i + j].y =\r
                 this->canvasHeight + h_vecDst_groundTruth.ptr()[i].y +\r
                 (Ncv32s)(h_vecDst_groundTruth.ptr()[i].height * this->eps * (randVal - 0.5));\r
             h_vecSrc.ptr()[srcSlotSize * i + j].width = h_vecDst_groundTruth.ptr()[i].width;\r
@@ -124,8 +124,8 @@ bool TestHypothesesFilter::process()
     //shuffle\r
     for (Ncv32u i=0; i<this->numDstRects*srcSlotSize-1; i++)\r
     {\r
-        Ncv32u randVal = h_random32u.ptr()[randCnt++]; randCnt = randCnt % h_random32u.length();\r
-        Ncv32u secondSwap = randVal % (this->numDstRects*srcSlotSize-1 - i);\r
+        Ncv32u randValLocal = h_random32u.ptr()[randCnt++]; randCnt = randCnt % h_random32u.length();\r
+        Ncv32u secondSwap = randValLocal % (this->numDstRects*srcSlotSize-1 - i);\r
         NcvRect32u tmp = h_vecSrc.ptr()[i + secondSwap];\r
         h_vecSrc.ptr()[i + secondSwap] = h_vecSrc.ptr()[i];\r
         h_vecSrc.ptr()[i] = tmp;\r
index ff75770..c99c333 100644 (file)
@@ -1,11 +1,11 @@
 /*\r
  * Copyright 1993-2010 NVIDIA Corporation.  All rights reserved.\r
  *\r
- * NVIDIA Corporation and its licensors retain all intellectual \r
- * property and proprietary rights in and to this software and \r
- * related documentation and any modifications thereto.  \r
- * Any use, reproduction, disclosure, or distribution of this \r
- * software and related documentation without an express license \r
+ * NVIDIA Corporation and its licensors retain all intellectual\r
+ * property and proprietary rights in and to this software and\r
+ * related documentation and any modifications thereto.\r
+ * Any use, reproduction, disclosure, or distribution of this\r
+ * software and related documentation without an express license\r
  * agreement from NVIDIA Corporation is strictly prohibited.\r
  */\r
 \r
 \r
 \r
 template <class T>\r
-TestResize<T>::TestResize(std::string testName, NCVTestSourceProvider<T> &src,\r
-                          Ncv32u width, Ncv32u height, Ncv32u scaleFactor, NcvBool bTextureCache)\r
+TestResize<T>::TestResize(std::string testName, NCVTestSourceProvider<T> &src_,\r
+                          Ncv32u width_, Ncv32u height_, Ncv32u scaleFactor_, NcvBool bTextureCache_)\r
     :\r
     NCVTestProvider(testName),\r
-    src(src),\r
-    width(width),\r
-    height(height),\r
-    scaleFactor(scaleFactor),\r
-    bTextureCache(bTextureCache)\r
+    src(src_),\r
+    width(width_),\r
+    height(height_),\r
+    scaleFactor(scaleFactor_),\r
+    bTextureCache(bTextureCache_)\r
 {\r
 }\r
 \r
index 9957fda..bb61608 100644 (file)
@@ -248,6 +248,7 @@ void generateHaarLoaderTests(NCVAutoTestLister &testLister)
 void generateHaarApplicationTests(NCVAutoTestLister &testLister, NCVTestSourceProvider<Ncv8u> &src,\r
                                   Ncv32u maxWidth, Ncv32u maxHeight)\r
 {\r
+    (void)maxHeight;\r
     for (Ncv32u i=20; i<512; i+=11)\r
     {\r
         for (Ncv32u j=20; j<128; j+=5)\r
@@ -268,11 +269,12 @@ void generateHaarApplicationTests(NCVAutoTestLister &testLister, NCVTestSourcePr
 \r
 static void devNullOutput(const std::string& msg)\r
 {\r
+    (void)msg;\r
 }\r
 \r
 bool nvidia_NPPST_Integral_Image(const std::string& test_data_path, OutputLevel outputLevel)\r
 {\r
-    path = test_data_path;\r
+    path = test_data_path.c_str();\r
     ncvSetDebugOutputHandler(devNullOutput);\r
 \r
     NCVAutoTestLister testListerII("NPPST Integral Image", outputLevel);\r
@@ -374,6 +376,7 @@ bool nvidia_NCV_Vector_Operations(const std::string& test_data_path, OutputLevel
     generateVectorTests(testListerVectorOperations, testSrcRandom_32u, 4096*4096);\r
 \r
     return testListerVectorOperations.invoke();\r
+\r
 }\r
 \r
 bool nvidia_NCV_Haar_Cascade_Loader(const std::string& test_data_path, OutputLevel outputLevel)\r
index 7ce3192..386a66c 100644 (file)
@@ -58,15 +58,15 @@ struct NVidiaTest : TestWithParam<cv::gpu::DeviceInfo>
 {\r
     cv::gpu::DeviceInfo devInfo;\r
 \r
-    std::string path;\r
+    std::string _path;\r
 \r
     virtual void SetUp()\r
     {\r
         devInfo = GetParam();\r
 \r
         cv::gpu::setDevice(devInfo.deviceID());\r
-\r
-        path = std::string(TS::ptr()->get_data_path()) + "haarcascade/";\r
+        _path = TS::ptr()->get_data_path().c_str();\r
+        _path = _path + "haarcascade/";\r
     }\r
 };\r
 \r
@@ -84,63 +84,63 @@ OutputLevel nvidiaTestOutputLevel = OutputLevelCompact;
 \r
 TEST_P(NPPST, SquaredIntegral)\r
 {\r
-    bool res = nvidia_NPPST_Squared_Integral_Image(path, nvidiaTestOutputLevel);\r
+    bool res = nvidia_NPPST_Squared_Integral_Image(_path, nvidiaTestOutputLevel);\r
 \r
     ASSERT_TRUE(res);\r
 }\r
 \r
 TEST_P(NPPST, RectStdDev)\r
 {\r
-    bool res = nvidia_NPPST_RectStdDev(path, nvidiaTestOutputLevel);\r
+    bool res = nvidia_NPPST_RectStdDev(_path, nvidiaTestOutputLevel);\r
 \r
     ASSERT_TRUE(res);\r
 }\r
 \r
 TEST_P(NPPST, Resize)\r
 {\r
-    bool res = nvidia_NPPST_Resize(path, nvidiaTestOutputLevel);\r
+    bool res = nvidia_NPPST_Resize(_path, nvidiaTestOutputLevel);\r
 \r
     ASSERT_TRUE(res);\r
 }\r
 \r
 TEST_P(NPPST, VectorOperations)\r
 {\r
-    bool res = nvidia_NPPST_Vector_Operations(path, nvidiaTestOutputLevel);\r
+    bool res = nvidia_NPPST_Vector_Operations(_path, nvidiaTestOutputLevel);\r
 \r
     ASSERT_TRUE(res);\r
 }\r
 \r
 TEST_P(NPPST, Transpose)\r
 {\r
-    bool res = nvidia_NPPST_Transpose(path, nvidiaTestOutputLevel);\r
+    bool res = nvidia_NPPST_Transpose(_path, nvidiaTestOutputLevel);\r
 \r
     ASSERT_TRUE(res);\r
 }\r
 \r
 TEST_P(NCV, VectorOperations)\r
 {\r
-    bool res = nvidia_NCV_Vector_Operations(path, nvidiaTestOutputLevel);\r
+    bool res = nvidia_NCV_Vector_Operations(_path, nvidiaTestOutputLevel);\r
 \r
     ASSERT_TRUE(res);\r
 }\r
 \r
 TEST_P(NCV, HaarCascadeLoader)\r
 {\r
-    bool res = nvidia_NCV_Haar_Cascade_Loader(path, nvidiaTestOutputLevel);\r
+    bool res = nvidia_NCV_Haar_Cascade_Loader(_path, nvidiaTestOutputLevel);\r
 \r
     ASSERT_TRUE(res);\r
 }\r
 \r
 TEST_P(NCV, HaarCascadeApplication)\r
 {\r
-    bool res = nvidia_NCV_Haar_Cascade_Application(path, nvidiaTestOutputLevel);\r
+    bool res = nvidia_NCV_Haar_Cascade_Application(_path, nvidiaTestOutputLevel);\r
 \r
     ASSERT_TRUE(res);\r
 }\r
 \r
 TEST_P(NCV, HypothesesFiltration)\r
 {\r
-    bool res = nvidia_NCV_Hypotheses_Filtration(path, nvidiaTestOutputLevel);\r
+    bool res = nvidia_NCV_Hypotheses_Filtration(_path, nvidiaTestOutputLevel);\r
 \r
     ASSERT_TRUE(res);\r
 }\r
@@ -148,7 +148,7 @@ TEST_P(NCV, HypothesesFiltration)
 TEST_P(NCV, Visualization)\r
 {\r
     // this functionality doesn't used in gpu module\r
-    bool res = nvidia_NCV_Visualization(path, nvidiaTestOutputLevel);\r
+    bool res = nvidia_NCV_Visualization(_path, nvidiaTestOutputLevel);\r
 \r
     ASSERT_TRUE(res);\r
 }\r
index c1f7518..5b4c9e8 100644 (file)
@@ -380,7 +380,6 @@ int my_jpeg_load_dht (struct jpeg_decompress_struct *info, unsigned char *dht,
 bool  JpegDecoder::readData( Mat& img )
 {
     bool result = false;
-    uchar* data = img.data;
     int step = (int)img.step;
     bool color = img.channels() > 1;
     JpegState* state = (JpegState*)m_state;
@@ -439,6 +438,7 @@ bool  JpegDecoder::readData( Mat& img )
             buffer = (*cinfo->mem->alloc_sarray)((j_common_ptr)cinfo,
                                               JPOOL_IMAGE, m_width*4, 1 );
 
+            uchar* data = img.data;
             for( ; m_height--; data += step )
             {
                 jpeg_read_scanlines( cinfo, buffer, 1 );
@@ -533,21 +533,15 @@ ImageEncoder JpegEncoder::newEncoder() const
 
 bool  JpegEncoder::write( const Mat& img, const vector<int>& params )
 {
-    int quality = 95;
-
-    for( size_t i = 0; i < params.size(); i += 2 )
+    struct fileWrapper
     {
-        if( params[i] == CV_IMWRITE_JPEG_QUALITY )
-        {
-            quality = params[i+1];
-            quality = MIN(MAX(quality, 0), 100);
-        }
-    }
+        FILE* f;
 
+        fileWrapper() : f(0) {}
+        ~fileWrapper() { if(f) fclose(f); }
+    };
     bool result = false;
-    FILE* f = 0;
-    int _channels = img.channels();
-    int channels = _channels > 1 ? 3 : 1;
+    fileWrapper fw;
     int width = img.cols, height = img.rows;
 
     vector<uchar> out_buf(1 << 12);
@@ -564,10 +558,10 @@ bool  JpegEncoder::write( const Mat& img, const vector<int>& params )
 
     if( !m_buf )
     {
-        f = fopen( m_filename.c_str(), "wb" );
-        if( !f )
+        fw.f = fopen( m_filename.c_str(), "wb" );
+        if( !fw.f )
             goto _exit_;
-        jpeg_stdio_dest( &cinfo, f );
+        jpeg_stdio_dest( &cinfo, fw.f );
     }
     else
     {
@@ -584,9 +578,23 @@ bool  JpegEncoder::write( const Mat& img, const vector<int>& params )
     {
         cinfo.image_width = width;
         cinfo.image_height = height;
+
+        int _channels = img.channels();
+        int channels = _channels > 1 ? 3 : 1;
         cinfo.input_components = channels;
         cinfo.in_color_space = channels > 1 ? JCS_RGB : JCS_GRAYSCALE;
 
+        int quality = 95;
+
+        for( size_t i = 0; i < params.size(); i += 2 )
+        {
+            if( params[i] == CV_IMWRITE_JPEG_QUALITY )
+            {
+                quality = params[i+1];
+                quality = MIN(MAX(quality, 0), 100);
+            }
+        }
+
         jpeg_set_defaults( &cinfo );
         jpeg_set_quality( &cinfo, quality,
                           TRUE /* limit to baseline-JPEG values */ );
@@ -619,7 +627,6 @@ bool  JpegEncoder::write( const Mat& img, const vector<int>& params )
     }
 
 _exit_:
-    if(f) fclose(f);
     jpeg_destroy_compress( &cinfo );
 
     return result;
index 7b6665c..8f9df83 100644 (file)
     and png2bmp sample from libpng distribution (Copyright (C) 1999-2001 MIYASAKA Masaru)
 \****************************************************************************************/
 
+#undef HAVE_UNISTD_H //to avoid redefinition
+#ifndef _LFS64_LARGEFILE
+#  define _LFS64_LARGEFILE 0
+#endif
+#ifndef _FILE_OFFSET_BITS
+#  define _FILE_OFFSET_BITS 0
+#endif
+
 #ifdef HAVE_LIBPNG_PNG_H
 #include <libpng/png.h>
 #else
 #include <png.h>
 #endif
 #include <zlib.h>
+
 #include "grfmt_png.hpp"
 
 #if defined _MSC_VER && _MSC_VER >= 1200
@@ -317,23 +326,6 @@ void PngEncoder::flushBuf(void*)
 
 bool  PngEncoder::write( const Mat& img, const vector<int>& params )
 {
-    int compression_level = 0;
-    int compression_strategy = Z_RLE;
-
-    for( size_t i = 0; i < params.size(); i += 2 )
-    {
-        if( params[i] == CV_IMWRITE_PNG_COMPRESSION )
-        {
-            compression_level = params[i+1];
-            compression_level = MIN(MAX(compression_level, 0), MAX_MEM_LEVEL);
-        }
-        if( params[i] == CV_IMWRITE_PNG_STRATEGY )
-        {
-            compression_strategy = params[i+1];
-            compression_strategy = MIN(MAX(compression_strategy, 0), Z_FIXED);
-        }
-    }
-
     png_structp png_ptr = png_create_write_struct( PNG_LIBPNG_VER_STRING, 0, 0, 0 );
     png_infop info_ptr = 0;
     FILE* f = 0;
@@ -365,6 +357,23 @@ bool  PngEncoder::write( const Mat& img, const vector<int>& params )
                         png_init_io( png_ptr, f );
                 }
 
+                int compression_level = 0;
+                int compression_strategy = Z_RLE;
+
+                for( size_t i = 0; i < params.size(); i += 2 )
+                {
+                    if( params[i] == CV_IMWRITE_PNG_COMPRESSION )
+                    {
+                        compression_level = params[i+1];
+                        compression_level = MIN(MAX(compression_level, 0), MAX_MEM_LEVEL);
+                    }
+                    if( params[i] == CV_IMWRITE_PNG_STRATEGY )
+                    {
+                        compression_strategy = params[i+1];
+                        compression_strategy = MIN(MAX(compression_strategy, 0), Z_FIXED);
+                    }
+                }
+
                 if( m_buf || f )
                 {
                     if( compression_level > 0 )
index 8d85f94..e0d6525 100644 (file)
@@ -635,9 +635,9 @@ cvCreateTrackbar( const char*, const char*,
 }
 
 CV_IMPL int
-cvCreateTrackbar2( const char* trackbar_name, const char* window_name,
-                   int* val, int count, CvTrackbarCallback2 on_notify2,
-                   void* userdata )
+cvCreateTrackbar2( const char* /*trackbar_name*/, const char* /*window_name*/,
+                   int* /*val*/, int /*count*/, CvTrackbarCallback2 /*on_notify2*/,
+                   void* /*userdata*/ )
 {
     CV_NO_GUI_ERROR( "cvCreateTrackbar2" );
     return -1;
@@ -678,7 +678,7 @@ CV_IMPL int cvWaitKey( int )
     return -1;
 }
 
-CV_IMPL int cvInitSystem( int argc, char** argv )
+CV_IMPL int cvInitSystem( int , char** )
 {
 
     CV_NO_GUI_ERROR( "cvInitSystem" );
@@ -693,23 +693,24 @@ CV_IMPL int cvStartWindowThread()
 }
 
 //-------- Qt ---------
-CV_IMPL void cvAddText( const CvArr*, const char*, CvPoint org, CvFont* font)
+CV_IMPL void cvAddText( const CvArr*, const char*, CvPoint , CvFont* )
 {
     CV_NO_GUI_ERROR("cvAddText");
 }
 
-CV_IMPL void cvDisplayStatusBar(const char* name, const char* arg2, int arg3)
+CV_IMPL void cvDisplayStatusBar(const char* , const char* , int )
 {
     CV_NO_GUI_ERROR("cvDisplayStatusBar");
 }
 
-CV_IMPL void cvDisplayOverlay(const char* name, const char* text, int delayms)
+CV_IMPL void cvDisplayOverlay(const char* , const char* , int )
 {
     CV_NO_GUI_ERROR("cvNamedWindow");
 }
 
-CV_IMPL int cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[])
+CV_IMPL int cvStartLoop(int (*)(int argc, char *argv[]), int , char* argv[])
 {
+    (void)argv;
     CV_NO_GUI_ERROR("cvStartLoop");
     return -1;
 }
@@ -719,7 +720,7 @@ CV_IMPL void cvStopLoop()
     CV_NO_GUI_ERROR("cvStopLoop");
 }
 
-CV_IMPL void cvSaveWindowParameters(const char* name)
+CV_IMPL void cvSaveWindowParameters(const char* )
 {
     CV_NO_GUI_ERROR("cvSaveWindowParameters");
 }
index 23b93c5..2bcc397 100644 (file)
@@ -162,8 +162,6 @@ else()
 endif()
 add_dependencies(${the_module} ${api_target})
 
-ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations)
-
 # Additional target properties
 set_target_properties(${the_module} PROPERTIES
     OUTPUT_NAME "${the_module}"
index 105815a..2e4a300 100644 (file)
@@ -569,12 +569,27 @@ public class MatTest extends OpenCVTestCase {
     }
 
     public void testMatMatRect() {
-        dst = new Mat(gray255_32f, new Rect(2, 2, 7, 7));
-
-        truth = new Mat(7, 7, CvType.CV_32FC1, new Scalar(255));
+        Mat m = new Mat(7, 6, CvType.CV_32SC1);
+        m.put(0,  0, 
+                        0,  1,  2,  3,  4,  5,
+                       10, 11, 12, 13, 14, 15,
+                       20, 21, 22, 23, 24, 25,
+                       30, 31, 32, 33, 34, 35,
+                       40, 41, 42, 43, 44, 45,
+                       50, 51, 52, 53, 54, 55,
+                       60, 61, 62, 63, 64, 65 );
+
+        dst = new Mat(m, new Rect(1, 2, 3, 4));
+
+        truth = new Mat(4, 3, CvType.CV_32SC1);
+        truth.put(0,  0, 
+                       21, 22, 23,
+                       31, 32, 33,
+                       41, 42, 43,
+                       51, 52, 53 );
 
         assertFalse(dst.empty());
-        assertMatEqual(truth, dst, EPS);
+        assertMatEqual(truth, dst);
     }
 
     public void testMatSizeInt() {
index ca0ddfe..55609b5 100644 (file)
@@ -11,10 +11,6 @@ class_ignore_list = (
     "FileNode", "FileStorage", "KDTree",\r
     #highgui\r
     "VideoWriter", "VideoCapture",\r
-    #features2d\r
-    #"KeyPoint", "MSER", "StarDetector", "SURF", "DMatch",\r
-    #ml\r
-    #"EM",\r
 )\r
 \r
 const_ignore_list = (\r
@@ -364,9 +360,10 @@ ManualFuncs = {
             'cpp_code' :\r
 """\r
 // C++: minMaxLoc(Mat src, double* minVal, double* maxVal=0, Point* minLoc=0, Point* maxLoc=0, InputArray mask=noArray())\r
+JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual (JNIEnv*, jclass, jlong, jlong);\r
 \r
 JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual\r
-  (JNIEnv* env, jclass cls, jlong src_nativeObj, jlong mask_nativeObj)\r
+  (JNIEnv* env, jclass, jlong src_nativeObj, jlong mask_nativeObj)\r
 {\r
     try {\r
         LOGD("Core::n_1minMaxLoc()");\r
@@ -434,9 +431,10 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual
             'cpp_code' :\r
 """\r
 // C++: Size getTextSize(const string& text, int fontFace, double fontScale, int thickness, int* baseLine);\r
+JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1getTextSize (JNIEnv*, jclass, jstring, jint, jdouble, jint, jintArray);\r
 \r
 JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1getTextSize\r
-  (JNIEnv* env, jclass cls, jstring text, jint fontFace, jdouble fontScale, jint thickness, jintArray baseLine)\r
+  (JNIEnv* env, jclass, jstring text, jint fontFace, jdouble fontScale, jint thickness, jintArray baseLine)\r
 {\r
     try {\r
         LOGD("Core::n_1getTextSize()");\r
@@ -1014,7 +1012,7 @@ extern "C" {
              # java native method args\r
             jn_args = []\r
             # jni (cpp) function args\r
-            jni_args = [ArgInfo([ "env", "env", "", [], "" ]), ArgInfo([ "cls", "cls", "", [], "" ])]\r
+            jni_args = [ArgInfo([ "env", "env", "", [], "" ]), ArgInfo([ "cls", "", "", [], "" ])]\r
             j_prologue = []\r
             j_epilogue = []\r
             c_prologue = []\r
@@ -1252,6 +1250,7 @@ extern "C" {
                 clazz = self.classes[fi.classname].jname\r
             cpp_code.write ( Template( \\r
 """\r
+JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname ($argst);\r
 \r
 JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname\r
   ($args)\r
@@ -1282,7 +1281,8 @@ JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname
         module = self.module, \\r
         clazz = clazz.replace('_', '_1'), \\r
         fname = (fi.jname + '_' + str(suffix_counter)).replace('_', '_1'), \\r
-        args = ", ".join(["%s %s" % (type_dict[a.ctype].get("jni_type"), a.name) for a in jni_args]), \\r
+        args  = ", ".join(["%s %s" % (type_dict[a.ctype].get("jni_type"), a.name) for a in jni_args]), \\r
+        argst = ", ".join([type_dict[a.ctype].get("jni_type") for a in jni_args]), \\r
         prologue = "\n        ".join(c_prologue), \\r
         epilogue = "  ".join(c_epilogue), \\r
         ret = ret, \\r
@@ -1374,14 +1374,15 @@ JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname
 //  native support for java finalize()\r
 //  static void %(cls)s::delete( __int64 self )\r
 //\r
+JNIEXPORT void JNICALL Java_org_opencv_%(module)s_%(j_cls)s_delete(JNIEnv*, jclass, jlong);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_%(module)s_%(j_cls)s_delete\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv*, jclass, jlong self)\r
 {\r
     delete (%(cls)s*) self;\r
 }\r
 \r
-""" % {"module" : module, "cls" : name, "j_cls" : ci.jname}\r
+""" % {"module" : module, "cls" : name, "j_cls" : ci.jname.replace('_', '_1')}\r
             )\r
 \r
 \r
index 5e82abc..344c38d 100644 (file)
@@ -24,7 +24,10 @@ extern "C" {
 \r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__\r
-  (JNIEnv* env, jclass cls)\r
+  (JNIEnv*, jclass);\r
+\r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__\r
+  (JNIEnv*, jclass)\r
 {\r
     LOGD("Mat::n_1Mat__()");\r
     return (jlong) new cv::Mat();\r
@@ -36,15 +39,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__
 //   Mat::Mat(int rows, int cols, int type)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__III\r
+  (JNIEnv* env, jclass, jint rows, jint cols, jint type);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__III\r
-  (JNIEnv* env, jclass cls, jint rows, jint cols, jint type)\r
+  (JNIEnv* env, jclass, jint rows, jint cols, jint type)\r
 {\r
     try {\r
         LOGD("Mat::n_1Mat__III()");\r
-        \r
+\r
         Mat* _retval_ = new Mat( rows, cols, type );\r
-        \r
+\r
         return (jlong) _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1Mat__III() catched cv::Exception: %s", e.what());\r
@@ -66,15 +71,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__III
 //   Mat::Mat(Size size, int type)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__DDI\r
+  (JNIEnv* env, jclass, jdouble size_width, jdouble size_height, jint type);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__DDI\r
-  (JNIEnv* env, jclass cls, jdouble size_width, jdouble size_height, jint type)\r
+  (JNIEnv* env, jclass, jdouble size_width, jdouble size_height, jint type)\r
 {\r
     try {\r
         LOGD("Mat::n_1Mat__DDI()");\r
         Size size((int)size_width, (int)size_height);\r
         Mat* _retval_ = new Mat( size, type );\r
-        \r
+\r
         return (jlong) _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1Mat__DDI() catched cv::Exception: %s", e.what());\r
@@ -96,15 +103,18 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__DDI
 //   Mat::Mat(int rows, int cols, int type, Scalar s)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__IIIDDDD\r
+  (JNIEnv* env, jclass, jint rows, jint cols, jint type, jdouble s_val0, jdouble s_val1, jdouble s_val2, jdouble s_val3);\r
+\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__IIIDDDD\r
-  (JNIEnv* env, jclass cls, jint rows, jint cols, jint type, jdouble s_val0, jdouble s_val1, jdouble s_val2, jdouble s_val3)\r
+  (JNIEnv* env, jclass, jint rows, jint cols, jint type, jdouble s_val0, jdouble s_val1, jdouble s_val2, jdouble s_val3)\r
 {\r
     try {\r
         LOGD("Mat::n_1Mat__IIIDDDD()");\r
         Scalar s(s_val0, s_val1, s_val2, s_val3);\r
         Mat* _retval_ = new Mat( rows, cols, type, s );\r
-        \r
+\r
         return (jlong) _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1Mat__IIIDDDD() catched cv::Exception: %s", e.what());\r
@@ -126,16 +136,18 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__IIIDDDD
 //   Mat::Mat(Size size, int type, Scalar s)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__DDIDDDD\r
+  (JNIEnv* env, jclass, jdouble size_width, jdouble size_height, jint type, jdouble s_val0, jdouble s_val1, jdouble s_val2, jdouble s_val3);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__DDIDDDD\r
-  (JNIEnv* env, jclass cls, jdouble size_width, jdouble size_height, jint type, jdouble s_val0, jdouble s_val1, jdouble s_val2, jdouble s_val3)\r
+  (JNIEnv* env, jclass, jdouble size_width, jdouble size_height, jint type, jdouble s_val0, jdouble s_val1, jdouble s_val2, jdouble s_val3)\r
 {\r
     try {\r
         LOGD("Mat::n_1Mat__DDIDDDD()");\r
         Size size((int)size_width, (int)size_height);\r
         Scalar s(s_val0, s_val1, s_val2, s_val3);\r
         Mat* _retval_ = new Mat( size, type, s );\r
-        \r
+\r
         return (jlong) _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1Mat__DDIDDDD() catched cv::Exception: %s", e.what());\r
@@ -157,16 +169,18 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__DDIDDDD
 //   Mat::Mat(Mat m, Range rowRange, Range colRange = Range::all())\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__JIIII\r
+  (JNIEnv* env, jclass, jlong m_nativeObj, jint rowRange_start, jint rowRange_end, jint colRange_start, jint colRange_end);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__JIIII\r
-  (JNIEnv* env, jclass cls, jlong m_nativeObj, jint rowRange_start, jint rowRange_end, jint colRange_start, jint colRange_end)\r
+  (JNIEnv* env, jclass, jlong m_nativeObj, jint rowRange_start, jint rowRange_end, jint colRange_start, jint colRange_end)\r
 {\r
     try {\r
         LOGD("Mat::n_1Mat__JIIII()");\r
         Range rowRange(rowRange_start, rowRange_end);\r
         Range colRange(colRange_start, colRange_end);\r
         Mat* _retval_ = new Mat( (*(Mat*)m_nativeObj), rowRange, colRange );\r
-        \r
+\r
         return (jlong) _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1Mat__JIIII() catched cv::Exception: %s", e.what());\r
@@ -183,16 +197,18 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__JIIII
 }\r
 \r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__JII\r
+  (JNIEnv* env, jclass, jlong m_nativeObj, jint rowRange_start, jint rowRange_end);\r
 \r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__JII\r
-  (JNIEnv* env, jclass cls, jlong m_nativeObj, jint rowRange_start, jint rowRange_end)\r
+  (JNIEnv* env, jclass, jlong m_nativeObj, jint rowRange_start, jint rowRange_end)\r
 {\r
     try {\r
         LOGD("Mat::n_1Mat__JII()");\r
         Range rowRange(rowRange_start, rowRange_end);\r
         Mat* _retval_ = new Mat( (*(Mat*)m_nativeObj), rowRange );\r
-        \r
+\r
         return (jlong) _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1Mat__JII() catched cv::Exception: %s", e.what());\r
@@ -213,15 +229,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1Mat__JII
 //  Mat Mat::adjustROI(int dtop, int dbottom, int dleft, int dright)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1adjustROI\r
+  (JNIEnv* env, jclass, jlong self, jint dtop, jint dbottom, jint dleft, jint dright);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1adjustROI\r
-  (JNIEnv* env, jclass cls, jlong self, jint dtop, jint dbottom, jint dleft, jint dright)\r
+  (JNIEnv* env, jclass, jlong self, jint dtop, jint dbottom, jint dleft, jint dright)\r
 {\r
     try {\r
         LOGD("Mat::n_1adjustROI()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat _retval_ = me->adjustROI( dtop, dbottom, dleft, dright );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1adjustROI() catched cv::Exception: %s", e.what());\r
@@ -243,15 +261,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1adjustROI
 //  void Mat::assignTo(Mat m, int type = -1)\r
 //\r
 \r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1assignTo__JJI\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj, jint type);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1assignTo__JJI\r
-  (JNIEnv* env, jclass cls, jlong self, jlong m_nativeObj, jint type)\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj, jint type)\r
 {\r
     try {\r
         LOGD("Mat::n_1assignTo__JJI()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         me->assignTo( (*(Mat*)m_nativeObj), type );\r
-        \r
+\r
         return;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1assignTo__JJI() catched cv::Exception: %s", e.what());\r
@@ -268,16 +288,17 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1assignTo__JJI
 }\r
 \r
 \r
-\r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1assignTo__JJ\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1assignTo__JJ\r
-  (JNIEnv* env, jclass cls, jlong self, jlong m_nativeObj)\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj)\r
 {\r
     try {\r
         LOGD("Mat::n_1assignTo__JJ()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         me->assignTo( (*(Mat*)m_nativeObj) );\r
-        \r
+\r
         return;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1assignTo__JJ() catched cv::Exception: %s", e.what());\r
@@ -299,15 +320,17 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1assignTo__JJ
 //  int Mat::channels()\r
 //\r
 \r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1channels\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1channels\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1channels()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         int _retval_ = me->channels(  );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1channels() catched cv::Exception: %s", e.what());\r
@@ -329,15 +352,17 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1channels
 //  int Mat::checkVector(int elemChannels, int depth = -1, bool requireContinuous = true)\r
 //\r
 \r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1checkVector__JIIZ\r
+  (JNIEnv* env, jclass, jlong self, jint elemChannels, jint depth, jboolean requireContinuous);\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1checkVector__JIIZ\r
-  (JNIEnv* env, jclass cls, jlong self, jint elemChannels, jint depth, jboolean requireContinuous)\r
+  (JNIEnv* env, jclass, jlong self, jint elemChannels, jint depth, jboolean requireContinuous)\r
 {\r
     try {\r
         LOGD("Mat::n_1checkVector__JIIZ()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         int _retval_ = me->checkVector( elemChannels, depth, requireContinuous );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1checkVector__JIIZ() catched cv::Exception: %s", e.what());\r
@@ -355,15 +380,17 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1checkVector__JIIZ
 \r
 \r
 \r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1checkVector__JII\r
+  (JNIEnv* env, jclass, jlong self, jint elemChannels, jint depth);\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1checkVector__JII\r
-  (JNIEnv* env, jclass cls, jlong self, jint elemChannels, jint depth)\r
+  (JNIEnv* env, jclass, jlong self, jint elemChannels, jint depth)\r
 {\r
     try {\r
         LOGD("Mat::n_1checkVector__JII()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         int _retval_ = me->checkVector( elemChannels, depth );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1checkVector__JII() catched cv::Exception: %s", e.what());\r
@@ -380,16 +407,18 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1checkVector__JII
 }\r
 \r
 \r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1checkVector__JI\r
+  (JNIEnv* env, jclass, jlong self, jint elemChannels);\r
 \r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1checkVector__JI\r
-  (JNIEnv* env, jclass cls, jlong self, jint elemChannels)\r
+  (JNIEnv* env, jclass, jlong self, jint elemChannels)\r
 {\r
     try {\r
         LOGD("Mat::n_1checkVector__JI()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         int _retval_ = me->checkVector( elemChannels );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1checkVector__JI() catched cv::Exception: %s", e.what());\r
@@ -411,15 +440,18 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1checkVector__JI
 //  Mat Mat::clone()\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1clone\r
+  (JNIEnv* env, jclass, jlong self);\r
+\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1clone\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1clone()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat _retval_ = me->clone(  );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1clone() catched cv::Exception: %s", e.what());\r
@@ -441,15 +473,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1clone
 //  Mat Mat::col(int x)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1col\r
+  (JNIEnv* env, jclass, jlong self, jint x);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1col\r
-  (JNIEnv* env, jclass cls, jlong self, jint x)\r
+  (JNIEnv* env, jclass, jlong self, jint x)\r
 {\r
     try {\r
         LOGD("Mat::n_1col()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat _retval_ = me->col( x );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1col() catched cv::Exception: %s", e.what());\r
@@ -471,15 +505,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1col
 //  Mat Mat::colRange(int startcol, int endcol)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1colRange\r
+  (JNIEnv* env, jclass, jlong self, jint startcol, jint endcol);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1colRange\r
-  (JNIEnv* env, jclass cls, jlong self, jint startcol, jint endcol)\r
+  (JNIEnv* env, jclass, jlong self, jint startcol, jint endcol)\r
 {\r
     try {\r
         LOGD("Mat::n_1colRange()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat _retval_ = me->colRange( startcol, endcol );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1colRange() catched cv::Exception: %s", e.what());\r
@@ -501,15 +537,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1colRange
 //  int Mat::cols()\r
 //\r
 \r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1cols\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1cols\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1cols()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         int _retval_ = me->cols;\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1cols() catched cv::Exception: %s", e.what());\r
@@ -531,16 +569,18 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1cols
 //  void Mat::convertTo(Mat& m, int rtype, double alpha = 1, double beta = 0)\r
 //\r
 \r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1convertTo__JJIDD\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj, jint rtype, jdouble alpha, jdouble beta);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1convertTo__JJIDD\r
-  (JNIEnv* env, jclass cls, jlong self, jlong m_nativeObj, jint rtype, jdouble alpha, jdouble beta)\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj, jint rtype, jdouble alpha, jdouble beta)\r
 {\r
     try {\r
         LOGD("Mat::n_1convertTo__JJIDD()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat& m = *((Mat*)m_nativeObj);\r
         me->convertTo( m, rtype, alpha, beta );\r
-        \r
+\r
         return;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1convertTo__JJIDD() catched cv::Exception: %s", e.what());\r
@@ -557,17 +597,18 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1convertTo__JJIDD
 }\r
 \r
 \r
-\r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1convertTo__JJID\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj, jint rtype, jdouble alpha);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1convertTo__JJID\r
-  (JNIEnv* env, jclass cls, jlong self, jlong m_nativeObj, jint rtype, jdouble alpha)\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj, jint rtype, jdouble alpha)\r
 {\r
     try {\r
         LOGD("Mat::n_1convertTo__JJID()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat& m = *((Mat*)m_nativeObj);\r
         me->convertTo( m, rtype, alpha );\r
-        \r
+\r
         return;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1convertTo__JJID() catched cv::Exception: %s", e.what());\r
@@ -584,17 +625,18 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1convertTo__JJID
 }\r
 \r
 \r
-\r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1convertTo__JJI\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj, jint rtype);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1convertTo__JJI\r
-  (JNIEnv* env, jclass cls, jlong self, jlong m_nativeObj, jint rtype)\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj, jint rtype)\r
 {\r
     try {\r
         LOGD("Mat::n_1convertTo__JJI()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat& m = *((Mat*)m_nativeObj);\r
         me->convertTo( m, rtype );\r
-        \r
+\r
         return;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1convertTo__JJI() catched cv::Exception: %s", e.what());\r
@@ -616,16 +658,18 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1convertTo__JJI
 //  void Mat::copyTo(Mat& m)\r
 //\r
 \r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1copyTo__JJ\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1copyTo__JJ\r
-  (JNIEnv* env, jclass cls, jlong self, jlong m_nativeObj)\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj)\r
 {\r
     try {\r
         LOGD("Mat::n_1copyTo__JJ()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat& m = *((Mat*)m_nativeObj);\r
         me->copyTo( m );\r
-        \r
+\r
         return;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1copyTo__JJ() catched cv::Exception: %s", e.what());\r
@@ -647,9 +691,11 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1copyTo__JJ
 //  void Mat::copyTo(Mat& m, Mat mask)\r
 //\r
 \r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1copyTo__JJJ\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj, jlong mask_nativeObj);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1copyTo__JJJ\r
-  (JNIEnv* env, jclass cls, jlong self, jlong m_nativeObj, jlong mask_nativeObj)\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj, jlong mask_nativeObj)\r
 {\r
     try {\r
         LOGD("Mat::n_1copyTo__JJJ()");\r
@@ -657,7 +703,7 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1copyTo__JJJ
         Mat& m = *((Mat*)m_nativeObj);\r
         Mat& mask = *((Mat*)mask_nativeObj);\r
         me->copyTo( m, mask );\r
-        \r
+\r
         return;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1copyTo__JJJ() catched cv::Exception: %s", e.what());\r
@@ -679,15 +725,17 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1copyTo__JJJ
 //  void Mat::create(int rows, int cols, int type)\r
 //\r
 \r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1create__JIII\r
+  (JNIEnv* env, jclass, jlong self, jint rows, jint cols, jint type);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1create__JIII\r
-  (JNIEnv* env, jclass cls, jlong self, jint rows, jint cols, jint type)\r
+  (JNIEnv* env, jclass, jlong self, jint rows, jint cols, jint type)\r
 {\r
     try {\r
         LOGD("Mat::n_1create__JIII()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         me->create( rows, cols, type );\r
-        \r
+\r
         return;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1create__JIII() catched cv::Exception: %s", e.what());\r
@@ -709,16 +757,18 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1create__JIII
 //  void Mat::create(Size size, int type)\r
 //\r
 \r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1create__JDDI\r
+  (JNIEnv* env, jclass, jlong self, jdouble size_width, jdouble size_height, jint type);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1create__JDDI\r
-  (JNIEnv* env, jclass cls, jlong self, jdouble size_width, jdouble size_height, jint type)\r
+  (JNIEnv* env, jclass, jlong self, jdouble size_width, jdouble size_height, jint type)\r
 {\r
     try {\r
         LOGD("Mat::n_1create__JDDI()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Size size((int)size_width, (int)size_height);\r
         me->create( size, type );\r
-        \r
+\r
         return;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1create__JDDI() catched cv::Exception: %s", e.what());\r
@@ -740,16 +790,18 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1create__JDDI
 //  Mat Mat::cross(Mat m)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1cross\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1cross\r
-  (JNIEnv* env, jclass cls, jlong self, jlong m_nativeObj)\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj)\r
 {\r
     try {\r
         LOGD("Mat::n_1cross()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat& m = *((Mat*)m_nativeObj);\r
         Mat _retval_ = me->cross( m );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1cross() catched cv::Exception: %s", e.what());\r
@@ -771,9 +823,11 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1cross
 //  long Mat::dataAddr()\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1dataAddr\r
+  (JNIEnv*, jclass, jlong self);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1dataAddr\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv*, jclass, jlong self)\r
 {\r
     LOGD("Mat::n_1dataAddr()");\r
     Mat* me = (Mat*) self; //TODO: check for NULL\r
@@ -786,15 +840,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1dataAddr
 //  int Mat::depth()\r
 //\r
 \r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1depth\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1depth\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1depth()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         int _retval_ = me->depth(  );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1depth() catched cv::Exception: %s", e.what());\r
@@ -816,15 +872,17 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1depth
 //  Mat Mat::diag(int d = 0)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1diag__JI\r
+  (JNIEnv* env, jclass, jlong self, jint d);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1diag__JI\r
-  (JNIEnv* env, jclass cls, jlong self, jint d)\r
+  (JNIEnv* env, jclass, jlong self, jint d)\r
 {\r
     try {\r
         LOGD("Mat::n_1diag__JI()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat _retval_ = me->diag( d );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1diag__JI() catched cv::Exception: %s", e.what());\r
@@ -847,15 +905,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1diag__JI
 // static Mat Mat::diag(Mat d)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1diag__J\r
+  (JNIEnv* env, jclass, jlong d_nativeObj);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1diag__J\r
-  (JNIEnv* env, jclass cls, jlong d_nativeObj)\r
+  (JNIEnv* env, jclass, jlong d_nativeObj)\r
 {\r
     try {\r
         LOGD("Mat::n_1diag__J()");\r
-        \r
+\r
         Mat _retval_ = Mat::diag( (*(Mat*)d_nativeObj) );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1diag__J() catched cv::Exception: %s", e.what());\r
@@ -877,16 +937,18 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1diag__J
 //  double Mat::dot(Mat m)\r
 //\r
 \r
+JNIEXPORT jdouble JNICALL Java_org_opencv_core_Mat_n_1dot\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj);\r
 \r
 JNIEXPORT jdouble JNICALL Java_org_opencv_core_Mat_n_1dot\r
-  (JNIEnv* env, jclass cls, jlong self, jlong m_nativeObj)\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj)\r
 {\r
     try {\r
         LOGD("Mat::n_1dot()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat& m = *((Mat*)m_nativeObj);\r
         double _retval_ = me->dot( m );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1dot() catched cv::Exception: %s", e.what());\r
@@ -908,15 +970,17 @@ JNIEXPORT jdouble JNICALL Java_org_opencv_core_Mat_n_1dot
 //  size_t Mat::elemSize()\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1elemSize\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1elemSize\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1elemSize()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         size_t _retval_ = me->elemSize(  );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1elemSize() catched cv::Exception: %s", e.what());\r
@@ -938,15 +1002,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1elemSize
 //  size_t Mat::elemSize1()\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1elemSize1\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1elemSize1\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1elemSize1()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         size_t _retval_ = me->elemSize1(  );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1elemSize1() catched cv::Exception: %s", e.what());\r
@@ -968,15 +1034,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1elemSize1
 //  bool Mat::empty()\r
 //\r
 \r
+JNIEXPORT jboolean JNICALL Java_org_opencv_core_Mat_n_1empty\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jboolean JNICALL Java_org_opencv_core_Mat_n_1empty\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1empty()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         bool _retval_ = me->empty(  );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1empty() catched cv::Exception: %s", e.what());\r
@@ -998,15 +1066,17 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_core_Mat_n_1empty
 // static Mat Mat::eye(int rows, int cols, int type)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1eye__III\r
+  (JNIEnv* env, jclass, jint rows, jint cols, jint type);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1eye__III\r
-  (JNIEnv* env, jclass cls, jint rows, jint cols, jint type)\r
+  (JNIEnv* env, jclass, jint rows, jint cols, jint type)\r
 {\r
     try {\r
         LOGD("Mat::n_1eye__III()");\r
-        \r
+\r
         Mat _retval_ = Mat::eye( rows, cols, type );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1eye__III() catched cv::Exception: %s", e.what());\r
@@ -1028,15 +1098,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1eye__III
 // static Mat Mat::eye(Size size, int type)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1eye__DDI\r
+  (JNIEnv* env, jclass, jdouble size_width, jdouble size_height, jint type);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1eye__DDI\r
-  (JNIEnv* env, jclass cls, jdouble size_width, jdouble size_height, jint type)\r
+  (JNIEnv* env, jclass, jdouble size_width, jdouble size_height, jint type)\r
 {\r
     try {\r
         LOGD("Mat::n_1eye__DDI()");\r
         Size size((int)size_width, (int)size_height);\r
         Mat _retval_ = Mat::eye( size, type );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1eye__DDI() catched cv::Exception: %s", e.what());\r
@@ -1058,15 +1130,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1eye__DDI
 //  Mat Mat::inv(int method = DECOMP_LU)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1inv__JI\r
+  (JNIEnv* env, jclass, jlong self, jint method);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1inv__JI\r
-  (JNIEnv* env, jclass cls, jlong self, jint method)\r
+  (JNIEnv* env, jclass, jlong self, jint method)\r
 {\r
     try {\r
         LOGD("Mat::n_1inv__JI()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat _retval_ = me->inv( method );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1inv__JI() catched cv::Exception: %s", e.what());\r
@@ -1083,16 +1157,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1inv__JI
 }\r
 \r
 \r
-\r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1inv__J\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1inv__J\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1inv__J()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat _retval_ = me->inv(  );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1inv__J() catched cv::Exception: %s", e.what());\r
@@ -1114,15 +1189,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1inv__J
 //  bool Mat::isContinuous()\r
 //\r
 \r
+JNIEXPORT jboolean JNICALL Java_org_opencv_core_Mat_n_1isContinuous\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jboolean JNICALL Java_org_opencv_core_Mat_n_1isContinuous\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1isContinuous()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         bool _retval_ = me->isContinuous(  );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1isContinuous() catched cv::Exception: %s", e.what());\r
@@ -1144,15 +1221,17 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_core_Mat_n_1isContinuous
 //  bool Mat::isSubmatrix()\r
 //\r
 \r
+JNIEXPORT jboolean JNICALL Java_org_opencv_core_Mat_n_1isSubmatrix\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jboolean JNICALL Java_org_opencv_core_Mat_n_1isSubmatrix\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1isSubmatrix()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         bool _retval_ = me->isSubmatrix(  );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1isSubmatrix() catched cv::Exception: %s", e.what());\r
@@ -1174,9 +1253,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_core_Mat_n_1isSubmatrix
 //  void Mat::locateROI(Size wholeSize, Point ofs)\r
 //\r
 \r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_locateROI_10\r
+  (JNIEnv* env, jclass, jlong self, jdoubleArray wholeSize_out, jdoubleArray ofs_out);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_locateROI_10\r
-  (JNIEnv* env, jclass cls, jlong self, jdoubleArray wholeSize_out, jdoubleArray ofs_out)\r
+  (JNIEnv* env, jclass, jlong self, jdoubleArray wholeSize_out, jdoubleArray ofs_out)\r
 {\r
     try {\r
         LOGD("core::locateROI_10()");\r
@@ -1206,16 +1287,18 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_locateROI_10
 //  Mat Mat::mul(Mat m, double scale = 1)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1mul__JJD\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj, jdouble scale);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1mul__JJD\r
-  (JNIEnv* env, jclass cls, jlong self, jlong m_nativeObj, jdouble scale)\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj, jdouble scale)\r
 {\r
     try {\r
         LOGD("Mat::n_1mul__JJD()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat& m = *((Mat*)m_nativeObj);\r
         Mat _retval_ = me->mul( m, scale );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1mul__JJD() catched cv::Exception: %s", e.what());\r
@@ -1233,16 +1316,18 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1mul__JJD
 \r
 \r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1mul__JJ\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1mul__JJ\r
-  (JNIEnv* env, jclass cls, jlong self, jlong m_nativeObj)\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj)\r
 {\r
     try {\r
         LOGD("Mat::n_1mul__JJ()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat& m = *((Mat*)m_nativeObj);\r
         Mat _retval_ = me->mul( m );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1mul__JJ() catched cv::Exception: %s", e.what());\r
@@ -1264,15 +1349,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1mul__JJ
 // static Mat Mat::ones(int rows, int cols, int type)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1ones__III\r
+  (JNIEnv* env, jclass, jint rows, jint cols, jint type);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1ones__III\r
-  (JNIEnv* env, jclass cls, jint rows, jint cols, jint type)\r
+  (JNIEnv* env, jclass, jint rows, jint cols, jint type)\r
 {\r
     try {\r
         LOGD("Mat::n_1ones__III()");\r
-        \r
+\r
         Mat _retval_ = Mat::ones( rows, cols, type );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1ones__III() catched cv::Exception: %s", e.what());\r
@@ -1294,15 +1381,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1ones__III
 // static Mat Mat::ones(Size size, int type)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1ones__DDI\r
+  (JNIEnv* env, jclass, jdouble size_width, jdouble size_height, jint type);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1ones__DDI\r
-  (JNIEnv* env, jclass cls, jdouble size_width, jdouble size_height, jint type)\r
+  (JNIEnv* env, jclass, jdouble size_width, jdouble size_height, jint type)\r
 {\r
     try {\r
         LOGD("Mat::n_1ones__DDI()");\r
         Size size((int)size_width, (int)size_height);\r
         Mat _retval_ = Mat::ones( size, type );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1ones__DDI() catched cv::Exception: %s", e.what());\r
@@ -1324,15 +1413,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1ones__DDI
 //  void Mat::push_back(Mat m)\r
 //\r
 \r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1push_1back\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1push_1back\r
-  (JNIEnv* env, jclass cls, jlong self, jlong m_nativeObj)\r
+  (JNIEnv* env, jclass, jlong self, jlong m_nativeObj)\r
 {\r
     try {\r
         LOGD("Mat::n_1push_1back()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         me->push_back( (*(Mat*)m_nativeObj) );\r
-        \r
+\r
         return;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1push_1back() catched cv::Exception: %s", e.what());\r
@@ -1354,15 +1445,17 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1push_1back
 //  void Mat::release()\r
 //\r
 \r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1release\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1release\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1release()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         me->release(  );\r
-        \r
+\r
         return;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1release() catched cv::Exception: %s", e.what());\r
@@ -1384,15 +1477,17 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1release
 //  Mat Mat::reshape(int cn, int rows = 0)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1reshape__JII\r
+  (JNIEnv* env, jclass, jlong self, jint cn, jint rows);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1reshape__JII\r
-  (JNIEnv* env, jclass cls, jlong self, jint cn, jint rows)\r
+  (JNIEnv* env, jclass, jlong self, jint cn, jint rows)\r
 {\r
     try {\r
         LOGD("Mat::n_1reshape__JII()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat _retval_ = me->reshape( cn, rows );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1reshape__JII() catched cv::Exception: %s", e.what());\r
@@ -1410,15 +1505,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1reshape__JII
 \r
 \r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1reshape__JI\r
+  (JNIEnv* env, jclass, jlong self, jint cn);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1reshape__JI\r
-  (JNIEnv* env, jclass cls, jlong self, jint cn)\r
+  (JNIEnv* env, jclass, jlong self, jint cn)\r
 {\r
     try {\r
         LOGD("Mat::n_1reshape__JI()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat _retval_ = me->reshape( cn );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1reshape__JI() catched cv::Exception: %s", e.what());\r
@@ -1440,15 +1537,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1reshape__JI
 //  Mat Mat::row(int y)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1row\r
+  (JNIEnv* env, jclass, jlong self, jint y);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1row\r
-  (JNIEnv* env, jclass cls, jlong self, jint y)\r
+  (JNIEnv* env, jclass, jlong self, jint y)\r
 {\r
     try {\r
         LOGD("Mat::n_1row()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat _retval_ = me->row( y );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1row() catched cv::Exception: %s", e.what());\r
@@ -1470,15 +1569,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1row
 //  Mat Mat::rowRange(int startrow, int endrow)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1rowRange\r
+  (JNIEnv* env, jclass, jlong self, jint startrow, jint endrow);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1rowRange\r
-  (JNIEnv* env, jclass cls, jlong self, jint startrow, jint endrow)\r
+  (JNIEnv* env, jclass, jlong self, jint startrow, jint endrow)\r
 {\r
     try {\r
         LOGD("Mat::n_1rowRange()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat _retval_ = me->rowRange( startrow, endrow );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1rowRange() catched cv::Exception: %s", e.what());\r
@@ -1500,15 +1601,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1rowRange
 //  int Mat::rows()\r
 //\r
 \r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1rows\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1rows\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1rows()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         int _retval_ = me->rows;\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1rows() catched cv::Exception: %s", e.what());\r
@@ -1530,16 +1633,18 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1rows
 //  Mat Mat::operator =(Scalar s)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JDDDD\r
+  (JNIEnv* env, jclass, jlong self, jdouble s_val0, jdouble s_val1, jdouble s_val2, jdouble s_val3);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JDDDD\r
-  (JNIEnv* env, jclass cls, jlong self, jdouble s_val0, jdouble s_val1, jdouble s_val2, jdouble s_val3)\r
+  (JNIEnv* env, jclass, jlong self, jdouble s_val0, jdouble s_val1, jdouble s_val2, jdouble s_val3)\r
 {\r
     try {\r
         LOGD("Mat::n_1setTo__JDDDD()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Scalar s(s_val0, s_val1, s_val2, s_val3);\r
         Mat _retval_ = me->operator =( s );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1setTo__JDDDD() catched cv::Exception: %s", e.what());\r
@@ -1561,9 +1666,11 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JDDDD
 //  Mat Mat::setTo(Scalar value, Mat mask = Mat())\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JDDDDJ\r
+  (JNIEnv* env, jclass, jlong self, jdouble s_val0, jdouble s_val1, jdouble s_val2, jdouble s_val3, jlong mask_nativeObj);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JDDDDJ\r
-  (JNIEnv* env, jclass cls, jlong self, jdouble s_val0, jdouble s_val1, jdouble s_val2, jdouble s_val3, jlong mask_nativeObj)\r
+  (JNIEnv* env, jclass, jlong self, jdouble s_val0, jdouble s_val1, jdouble s_val2, jdouble s_val3, jlong mask_nativeObj)\r
 {\r
     try {\r
         LOGD("Mat::n_1setTo__JDDDDJ()");\r
@@ -1571,7 +1678,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JDDDDJ
         Scalar s(s_val0, s_val1, s_val2, s_val3);\r
         Mat& mask = *((Mat*)mask_nativeObj);\r
         Mat _retval_ = me->setTo( s, mask );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1setTo__JDDDDJ() catched cv::Exception: %s", e.what());\r
@@ -1593,9 +1700,11 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JDDDDJ
 //  Mat Mat::setTo(Mat value, Mat mask = Mat())\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JJJ\r
+  (JNIEnv* env, jclass, jlong self, jlong value_nativeObj, jlong mask_nativeObj);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JJJ\r
-  (JNIEnv* env, jclass cls, jlong self, jlong value_nativeObj, jlong mask_nativeObj)\r
+  (JNIEnv* env, jclass, jlong self, jlong value_nativeObj, jlong mask_nativeObj)\r
 {\r
     try {\r
         LOGD("Mat::n_1setTo__JJJ()");\r
@@ -1603,7 +1712,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JJJ
         Mat& value = *((Mat*)value_nativeObj);\r
         Mat& mask = *((Mat*)mask_nativeObj);\r
         Mat _retval_ = me->setTo( value, mask );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1setTo__JJJ() catched cv::Exception: %s", e.what());\r
@@ -1621,16 +1730,18 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JJJ
 \r
 \r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JJ\r
+  (JNIEnv* env, jclass, jlong self, jlong value_nativeObj);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JJ\r
-  (JNIEnv* env, jclass cls, jlong self, jlong value_nativeObj)\r
+  (JNIEnv* env, jclass, jlong self, jlong value_nativeObj)\r
 {\r
     try {\r
         LOGD("Mat::n_1setTo__JJ()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat& value = *((Mat*)value_nativeObj);\r
         Mat _retval_ = me->setTo( value );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1setTo__JJ() catched cv::Exception: %s", e.what());\r
@@ -1652,9 +1763,11 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1setTo__JJ
 //  Size Mat::size()\r
 //\r
 \r
+JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Mat_n_1size\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Mat_n_1size\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1size()");\r
@@ -1682,15 +1795,17 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Mat_n_1size
 //  size_t Mat::step1(int i = 0)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1step1__JI\r
+  (JNIEnv* env, jclass, jlong self, jint i);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1step1__JI\r
-  (JNIEnv* env, jclass cls, jlong self, jint i)\r
+  (JNIEnv* env, jclass, jlong self, jint i)\r
 {\r
     try {\r
         LOGD("Mat::n_1step1__JI()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         size_t _retval_ = me->step1( i );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1step1__JI() catched cv::Exception: %s", e.what());\r
@@ -1708,15 +1823,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1step1__JI
 \r
 \r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1step1__J\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1step1__J\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1step1__J()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         size_t _retval_ = me->step1(  );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1step1__J() catched cv::Exception: %s", e.what());\r
@@ -1736,9 +1853,11 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1step1__J
 //  Mat Mat::operator()(Range rowRange, Range colRange)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1submat_1rr\r
+  (JNIEnv* env, jclass, jlong self, jint rowRange_start, jint rowRange_end, jint colRange_start, jint colRange_end);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1submat_1rr\r
-  (JNIEnv* env, jclass cls, jlong self, jint rowRange_start, jint rowRange_end, jint colRange_start, jint colRange_end)\r
+  (JNIEnv* env, jclass, jlong self, jint rowRange_start, jint rowRange_end, jint colRange_start, jint colRange_end)\r
 {\r
     try {\r
         LOGD("Mat::n_1submat_1rr()");\r
@@ -1746,7 +1865,7 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1submat_1rr
         Range rowRange(rowRange_start, rowRange_end);\r
         Range colRange(colRange_start, colRange_end);\r
         Mat _retval_ = me->operator()( rowRange, colRange );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1submat_1rr() catched cv::Exception: %s", e.what());\r
@@ -1768,16 +1887,18 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1submat_1rr
 //  Mat Mat::operator()(Rect roi)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1submat\r
+  (JNIEnv* env, jclass, jlong self, jint roi_x, jint roi_y, jint roi_width, jint roi_height);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1submat\r
-  (JNIEnv* env, jclass cls, jlong self, jint roi_x, jint roi_y, jint roi_width, jint roi_height)\r
+  (JNIEnv* env, jclass, jlong self, jint roi_x, jint roi_y, jint roi_width, jint roi_height)\r
 {\r
     try {\r
         LOGD("Mat::n_1submat()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Rect roi(roi_x, roi_y, roi_width, roi_height);\r
         Mat _retval_ = me->operator()( roi );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1submat() catched cv::Exception: %s", e.what());\r
@@ -1799,15 +1920,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1submat
 //  Mat Mat::t()\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1t\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1t\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1t()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         Mat _retval_ = me->t(  );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1t() catched cv::Exception: %s", e.what());\r
@@ -1829,15 +1952,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1t
 //  size_t Mat::total()\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1total\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1total\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1total()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         size_t _retval_ = me->total(  );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1total() catched cv::Exception: %s", e.what());\r
@@ -1859,15 +1984,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1total
 //  int Mat::type()\r
 //\r
 \r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1type\r
+  (JNIEnv* env, jclass, jlong self);\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1type\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv* env, jclass, jlong self)\r
 {\r
     try {\r
         LOGD("Mat::n_1type()");\r
         Mat* me = (Mat*) self; //TODO: check for NULL\r
         int _retval_ = me->type(  );\r
-        \r
+\r
         return _retval_;\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1type() catched cv::Exception: %s", e.what());\r
@@ -1889,15 +2016,17 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1type
 // static Mat Mat::zeros(int rows, int cols, int type)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1zeros__III\r
+  (JNIEnv* env, jclass, jint rows, jint cols, jint type);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1zeros__III\r
-  (JNIEnv* env, jclass cls, jint rows, jint cols, jint type)\r
+  (JNIEnv* env, jclass, jint rows, jint cols, jint type)\r
 {\r
     try {\r
         LOGD("Mat::n_1zeros__III()");\r
-        \r
+\r
         Mat _retval_ = Mat::zeros( rows, cols, type );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1zeros__III() catched cv::Exception: %s", e.what());\r
@@ -1919,15 +2048,17 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1zeros__III
 // static Mat Mat::zeros(Size size, int type)\r
 //\r
 \r
+JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1zeros__DDI\r
+  (JNIEnv* env, jclass, jdouble size_width, jdouble size_height, jint type);\r
 \r
 JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1zeros__DDI\r
-  (JNIEnv* env, jclass cls, jdouble size_width, jdouble size_height, jint type)\r
+  (JNIEnv* env, jclass, jdouble size_width, jdouble size_height, jint type)\r
 {\r
     try {\r
         LOGD("Mat::n_1zeros__DDI()");\r
         Size size((int)size_width, (int)size_height);\r
         Mat _retval_ = Mat::zeros( size, type );\r
-        \r
+\r
         return (jlong) new Mat(_retval_);\r
     } catch(cv::Exception e) {\r
         LOGD("Mat::n_1zeros__DDI() catched cv::Exception: %s", e.what());\r
@@ -1951,7 +2082,10 @@ JNIEXPORT jlong JNICALL Java_org_opencv_core_Mat_n_1zeros__DDI
 //\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1delete\r
-  (JNIEnv* env, jclass cls, jlong self)\r
+  (JNIEnv*, jclass, jlong self);\r
+\r
+JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1delete\r
+  (JNIEnv*, jclass, jlong self)\r
 {\r
     delete (Mat*) self;\r
 }\r
@@ -1960,7 +2094,10 @@ JNIEXPORT void JNICALL Java_org_opencv_core_Mat_n_1delete
 #define PUT_ITEM(T, R, C) { T*dst = (T*)me->ptr(R, C); for(int ch=0; ch<me->channels() && count>0; count--,ch++,src++,dst++) *dst = cv::saturate_cast<T>(*src); }\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutD\r
-    (JNIEnv* env, jclass cls, jlong self, jint row, jint col, jint count, jdoubleArray vals)\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jdoubleArray vals);\r
+\r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutD\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jdoubleArray vals)\r
 {\r
     try {\r
         LOGD("Mat::nPutD()");\r
@@ -2054,7 +2191,10 @@ template<typename T> static int mat_put(cv::Mat* m, int row, int col, int count,
 extern "C" {\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutB\r
-    (JNIEnv* env, jclass cls, jlong self, jint row, jint col, jint count, jbyteArray vals)\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jbyteArray vals);\r
+\r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutB\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jbyteArray vals)\r
 {\r
     try {\r
         LOGD("Mat::nPutB()");\r
@@ -2062,7 +2202,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutB
         if(! self) return 0; // no native object behind\r
         if(me->depth() != CV_8U && me->depth() != CV_8S) return 0; // incompatible type\r
         if(me->rows<=row || me->cols<=col) return 0; // indexes out of range\r
-        \r
+\r
         char* values = (char*)env->GetPrimitiveArrayCritical(vals, 0);\r
         int res = mat_put<char>(me, row, col, count, values);\r
         env->ReleasePrimitiveArrayCritical(vals, values, 0);\r
@@ -2082,7 +2222,10 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutB
 }\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutS\r
-    (JNIEnv* env, jclass cls, jlong self, jint row, jint col, jint count, jshortArray vals)\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jshortArray vals);\r
+\r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutS\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jshortArray vals)\r
 {\r
     try {\r
         LOGD("Mat::nPutS()");\r
@@ -2090,7 +2233,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutS
         if(! self) return 0; // no native object behind\r
         if(me->depth() != CV_16U && me->depth() != CV_16S) return 0; // incompatible type\r
         if(me->rows<=row || me->cols<=col) return 0; // indexes out of range\r
-        \r
+\r
         char* values = (char*)env->GetPrimitiveArrayCritical(vals, 0);\r
         int res = mat_put<short>(me, row, col, count, values);\r
         env->ReleasePrimitiveArrayCritical(vals, values, 0);\r
@@ -2110,7 +2253,10 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutS
 }\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutI\r
-    (JNIEnv* env, jclass cls, jlong self, jint row, jint col, jint count, jintArray vals)\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jintArray vals);\r
+\r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutI\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jintArray vals)\r
 {\r
     try {\r
         LOGD("Mat::nPutI()");\r
@@ -2118,7 +2264,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutI
         if(! self) return 0; // no native object behind\r
         if(me->depth() != CV_32S) return 0; // incompatible type\r
         if(me->rows<=row || me->cols<=col) return 0; // indexes out of range\r
-        \r
+\r
         char* values = (char*)env->GetPrimitiveArrayCritical(vals, 0);\r
         int res = mat_put<int>(me, row, col, count, values);\r
         env->ReleasePrimitiveArrayCritical(vals, values, 0);\r
@@ -2138,7 +2284,10 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutI
 }\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutF\r
-    (JNIEnv* env, jclass cls, jlong self, jint row, jint col, jint count, jfloatArray vals)\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jfloatArray vals);\r
+\r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutF\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jfloatArray vals)\r
 {\r
     try {\r
         LOGD("Mat::nPutF()");\r
@@ -2146,7 +2295,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nPutF
         if(! self) return 0; // no native object behind\r
         if(me->depth() != CV_32F) return 0; // incompatible type\r
         if(me->rows<=row || me->cols<=col) return 0; // indexes out of range\r
-        \r
+\r
         char* values = (char*)env->GetPrimitiveArrayCritical(vals, 0);\r
         int res = mat_put<float>(me, row, col, count, values);\r
         env->ReleasePrimitiveArrayCritical(vals, values, 0);\r
@@ -2201,7 +2350,10 @@ template<typename T> int mat_get(cv::Mat* m, int row, int col, int count, char*
 extern "C" {\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetB\r
-    (JNIEnv* env, jclass cls, jlong self, jint row, jint col, jint count, jbyteArray vals)\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jbyteArray vals);\r
+\r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetB\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jbyteArray vals)\r
 {\r
     try {\r
         LOGD("Mat::nGetB()");\r
@@ -2209,7 +2361,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetB
         if(! self) return 0; // no native object behind\r
         if(me->depth() != CV_8U && me->depth() != CV_8S) return 0; // incompatible type\r
         if(me->rows<=row || me->cols<=col) return 0; // indexes out of range\r
-        \r
+\r
         char* values = (char*)env->GetPrimitiveArrayCritical(vals, 0);\r
         int res = mat_get<char>(me, row, col, count, values);\r
         env->ReleasePrimitiveArrayCritical(vals, values, 0);\r
@@ -2229,7 +2381,10 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetB
 }\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetS\r
-    (JNIEnv* env, jclass cls, jlong self, jint row, jint col, jint count, jshortArray vals)\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jshortArray vals);\r
+\r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetS\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jshortArray vals)\r
 {\r
     try {\r
         LOGD("Mat::nGetS()");\r
@@ -2237,7 +2392,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetS
         if(! self) return 0; // no native object behind\r
         if(me->depth() != CV_16U && me->depth() != CV_16S) return 0; // incompatible type\r
         if(me->rows<=row || me->cols<=col) return 0; // indexes out of range\r
-        \r
+\r
         char* values = (char*)env->GetPrimitiveArrayCritical(vals, 0);\r
         int res = mat_get<short>(me, row, col, count, values);\r
         env->ReleasePrimitiveArrayCritical(vals, values, 0);\r
@@ -2257,7 +2412,10 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetS
 }\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetI\r
-    (JNIEnv* env, jclass cls, jlong self, jint row, jint col, jint count, jintArray vals)\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jintArray vals);\r
+\r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetI\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jintArray vals)\r
 {\r
     try {\r
         LOGD("Mat::nGetI()");\r
@@ -2265,7 +2423,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetI
         if(! self) return 0; // no native object behind\r
         if(me->depth() != CV_32S) return 0; // incompatible type\r
         if(me->rows<=row || me->cols<=col) return 0; // indexes out of range\r
-        \r
+\r
         char* values = (char*)env->GetPrimitiveArrayCritical(vals, 0);\r
         int res = mat_get<int>(me, row, col, count, values);\r
         env->ReleasePrimitiveArrayCritical(vals, values, 0);\r
@@ -2285,7 +2443,10 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetI
 }\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetF\r
-    (JNIEnv* env, jclass cls, jlong self, jint row, jint col, jint count, jfloatArray vals)\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jfloatArray vals);\r
+\r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetF\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jfloatArray vals)\r
 {\r
     try {\r
         LOGD("Mat::nGetF()");\r
@@ -2293,7 +2454,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetF
         if(! self) return 0; // no native object behind\r
         if(me->depth() != CV_32F) return 0; // incompatible type\r
         if(me->rows<=row || me->cols<=col) return 0; // indexes out of range\r
-        \r
+\r
         char* values = (char*)env->GetPrimitiveArrayCritical(vals, 0);\r
         int res = mat_get<float>(me, row, col, count, values);\r
         env->ReleasePrimitiveArrayCritical(vals, values, 0);\r
@@ -2313,7 +2474,10 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetF
 }\r
 \r
 JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetD\r
-    (JNIEnv* env, jclass cls, jlong self, jint row, jint col, jint count, jdoubleArray vals)\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jdoubleArray vals);\r
+\r
+JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetD\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col, jint count, jdoubleArray vals)\r
 {\r
     try {\r
         LOGD("Mat::nGetD()");\r
@@ -2321,7 +2485,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetD
         if(! self) return 0; // no native object behind\r
         if(me->depth() != CV_64F) return 0; // incompatible type\r
         if(me->rows<=row || me->cols<=col) return 0; // indexes out of range\r
-        \r
+\r
         char* values = (char*)env->GetPrimitiveArrayCritical(vals, 0);\r
         int res = mat_get<double>(me, row, col, count, values);\r
         env->ReleasePrimitiveArrayCritical(vals, values, 0);\r
@@ -2341,7 +2505,10 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_nGetD
 }\r
 \r
 JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Mat_nGet\r
-    (JNIEnv* env, jclass cls, jlong self, jint row, jint col, jint count)\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col);\r
+\r
+JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Mat_nGet\r
+    (JNIEnv* env, jclass, jlong self, jint row, jint col)\r
 {\r
     try {\r
         LOGD("Mat::nGet()");\r
@@ -2380,13 +2547,16 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Mat_nGet
 }\r
 \r
 JNIEXPORT jstring JNICALL Java_org_opencv_core_Mat_nDump\r
-  (JNIEnv *env, jclass cls, jlong self)\r
+  (JNIEnv *env, jclass, jlong self);\r
+\r
+JNIEXPORT jstring JNICALL Java_org_opencv_core_Mat_nDump\r
+  (JNIEnv *env, jclass, jlong self)\r
 {\r
     cv::Mat* me = (cv::Mat*) self; //TODO: check for NULL\r
     std::stringstream s;\r
     try {\r
             LOGD("Mat::nDump()");\r
-    \r
+\r
             s << *me;\r
             return env->NewStringUTF(s.str().c_str());\r
         } catch(cv::Exception e) {\r
index 5222bfe..fbe5592 100644 (file)
@@ -20,17 +20,19 @@ extern "C" {
 //   VideoCapture::VideoCapture()
 //
 
+JNIEXPORT jlong JNICALL Java_org_opencv_highgui_VideoCapture_n_1VideoCapture__
+  (JNIEnv* env, jclass);
 
 JNIEXPORT jlong JNICALL Java_org_opencv_highgui_VideoCapture_n_1VideoCapture__
-  (JNIEnv* env, jclass cls)
+  (JNIEnv* env, jclass)
 {
     try {
 #ifdef DEBUG
         LOGD("highgui::VideoCapture_n_1VideoCapture__()");
 #endif // DEBUG
-        
+
         VideoCapture* _retval_ = new VideoCapture(  );
-        
+
         return (jlong) _retval_;
     } catch(cv::Exception e) {
 #ifdef DEBUG
@@ -55,17 +57,19 @@ JNIEXPORT jlong JNICALL Java_org_opencv_highgui_VideoCapture_n_1VideoCapture__
 //   VideoCapture::VideoCapture(int device)
 //
 
+JNIEXPORT jlong JNICALL Java_org_opencv_highgui_VideoCapture_n_1VideoCapture__I
+  (JNIEnv* env, jclass, jint device);
 
 JNIEXPORT jlong JNICALL Java_org_opencv_highgui_VideoCapture_n_1VideoCapture__I
-  (JNIEnv* env, jclass cls, jint device)
+  (JNIEnv* env, jclass, jint device)
 {
     try {
 #ifdef DEBUG
         LOGD("highgui::VideoCapture_n_1VideoCapture__I()");
 #endif // DEBUG
-        
+
         VideoCapture* _retval_ = new VideoCapture( device );
-        
+
         return (jlong) _retval_;
     } catch(cv::Exception e) {
 #ifdef DEBUG
@@ -91,9 +95,11 @@ JNIEXPORT jlong JNICALL Java_org_opencv_highgui_VideoCapture_n_1VideoCapture__I
 //  double VideoCapture::get(int propId)
 //
 
+JNIEXPORT jdouble JNICALL Java_org_opencv_highgui_VideoCapture_n_1get
+  (JNIEnv* env, jclass, jlong self, jint propId);
 
 JNIEXPORT jdouble JNICALL Java_org_opencv_highgui_VideoCapture_n_1get
-  (JNIEnv* env, jclass cls, jlong self, jint propId)
+  (JNIEnv* env, jclass, jlong self, jint propId)
 {
     try {
 #ifdef DEBUG
@@ -101,7 +107,7 @@ JNIEXPORT jdouble JNICALL Java_org_opencv_highgui_VideoCapture_n_1get
 #endif // DEBUG
         VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
         double _retval_ = me->get( propId );
-        
+
         return _retval_;
     } catch(cv::Exception e) {
 #ifdef DEBUG
@@ -127,9 +133,11 @@ JNIEXPORT jdouble JNICALL Java_org_opencv_highgui_VideoCapture_n_1get
 //  bool VideoCapture::grab()
 //
 
+JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1grab
+  (JNIEnv* env, jclass, jlong self);
 
 JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1grab
-  (JNIEnv* env, jclass cls, jlong self)
+  (JNIEnv* env, jclass, jlong self)
 {
     try {
 #ifdef DEBUG
@@ -137,7 +145,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1grab
 #endif // DEBUG
         VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
         bool _retval_ = me->grab(  );
-        
+
         return _retval_;
     } catch(cv::Exception e) {
 #ifdef DEBUG
@@ -163,9 +171,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1grab
 //  bool VideoCapture::isOpened()
 //
 
+JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1isOpened
+  (JNIEnv* env, jclass, jlong self);
 
 JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1isOpened
-  (JNIEnv* env, jclass cls, jlong self)
+  (JNIEnv* env, jclass, jlong self)
 {
     try {
 #ifdef DEBUG
@@ -173,7 +183,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1isOpened
 #endif // DEBUG
         VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
         bool _retval_ = me->isOpened(  );
-        
+
         return _retval_;
     } catch(cv::Exception e) {
 #ifdef DEBUG
@@ -198,9 +208,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1isOpened
 //  bool VideoCapture::open(int device)
 //
 
+JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1open__JI
+  (JNIEnv* env, jclass, jlong self, jint device);
 
 JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1open__JI
-  (JNIEnv* env, jclass cls, jlong self, jint device)
+  (JNIEnv* env, jclass, jlong self, jint device)
 {
     try {
 #ifdef DEBUG
@@ -208,7 +220,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1open__JI
 #endif // DEBUG
         VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
         bool _retval_ = me->open( device );
-        
+
         return _retval_;
     } catch(cv::Exception e) {
 #ifdef DEBUG
@@ -234,9 +246,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1open__JI
 //  bool VideoCapture::read(Mat image)
 //
 
+JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1read
+  (JNIEnv* env, jclass, jlong self, jlong image_nativeObj);
 
 JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1read
-  (JNIEnv* env, jclass cls, jlong self, jlong image_nativeObj)
+  (JNIEnv* env, jclass, jlong self, jlong image_nativeObj)
 {
     try {
 #ifdef DEBUG
@@ -245,7 +259,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1read
         VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
         Mat& image = *((Mat*)image_nativeObj);
         bool _retval_ = me->read( image );
-        
+
         return _retval_;
     } catch(cv::Exception e) {
 #ifdef DEBUG
@@ -271,9 +285,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1read
 //  void VideoCapture::release()
 //
 
+JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1release
+  (JNIEnv* env, jclass, jlong self);
 
 JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1release
-  (JNIEnv* env, jclass cls, jlong self)
+  (JNIEnv* env, jclass, jlong self)
 {
     try {
 #ifdef DEBUG
@@ -281,7 +297,7 @@ JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1release
 #endif // DEBUG
         VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
         me->release(  );
-        
+
         return;
     } catch(cv::Exception e) {
 #ifdef DEBUG
@@ -307,9 +323,11 @@ JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1release
 //  bool VideoCapture::retrieve(Mat image, int channel = 0)
 //
 
+JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJI
+  (JNIEnv* env, jclass, jlong self, jlong image_nativeObj, jint channel);
 
 JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJI
-  (JNIEnv* env, jclass cls, jlong self, jlong image_nativeObj, jint channel)
+  (JNIEnv* env, jclass, jlong self, jlong image_nativeObj, jint channel)
 {
     try {
 #ifdef DEBUG
@@ -318,7 +336,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJI
         VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
         Mat& image = *((Mat*)image_nativeObj);
         bool _retval_ = me->retrieve( image, channel );
-        
+
         return _retval_;
     } catch(cv::Exception e) {
 #ifdef DEBUG
@@ -340,9 +358,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJI
 
 
 
+JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJ
+  (JNIEnv* env, jclass, jlong self, jlong image_nativeObj);
 
 JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJ
-  (JNIEnv* env, jclass cls, jlong self, jlong image_nativeObj)
+  (JNIEnv* env, jclass, jlong self, jlong image_nativeObj)
 {
     try {
 #ifdef DEBUG
@@ -351,7 +371,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJ
         VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
         Mat& image = *((Mat*)image_nativeObj);
         bool _retval_ = me->retrieve( image );
-        
+
         return _retval_;
     } catch(cv::Exception e) {
 #ifdef DEBUG
@@ -377,9 +397,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJ
 //  bool VideoCapture::set(int propId, double value)
 //
 
+JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1set
+  (JNIEnv* env, jclass, jlong self, jint propId, jdouble value);
 
 JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1set
-  (JNIEnv* env, jclass cls, jlong self, jint propId, jdouble value)
+  (JNIEnv* env, jclass, jlong self, jint propId, jdouble value)
 {
     try {
 #ifdef DEBUG
@@ -387,7 +409,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1set
 #endif // DEBUG
         VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
         bool _retval_ = me->set( propId, value );
-        
+
         return _retval_;
     } catch(cv::Exception e) {
 #ifdef DEBUG
@@ -408,14 +430,17 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1set
 }
 
 JNIEXPORT jstring JNICALL Java_org_opencv_highgui_VideoCapture_n_1getSupportedPreviewSizes
-  (JNIEnv *env, jclass cls, jlong self)
+  (JNIEnv *env, jclass, jlong self);
+
+JNIEXPORT jstring JNICALL Java_org_opencv_highgui_VideoCapture_n_1getSupportedPreviewSizes
+  (JNIEnv *env, jclass, jlong self)
 {
     try {
 #ifdef DEBUG
         LOGD("highgui::VideoCapture_n_1set()");
 #endif // DEBUG
         VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
-               union {double prop; const char* name;} u;
+        union {double prop; const char* name;} u;
         u.prop = me->get(CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING);
         return env->NewStringUTF(u.name);
     } catch(cv::Exception e) {
@@ -444,7 +469,10 @@ JNIEXPORT jstring JNICALL Java_org_opencv_highgui_VideoCapture_n_1getSupportedPr
 //
 
 JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1delete
-  (JNIEnv* env, jclass cls, jlong self)
+  (JNIEnv*, jclass, jlong self);
+
+JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1delete
+  (JNIEnv*, jclass, jlong self)
 {
     delete (VideoCapture*) self;
 }
index 4a0df4f..102157c 100644 (file)
@@ -21,7 +21,7 @@
 extern "C" {
 
 JNIEXPORT jint JNICALL
-JNI_OnLoad(JavaVM* vm, void* reserved)
+JNI_OnLoad(JavaVM* vm, void* )
 {
     JNIEnv* env;
     if (vm->GetEnv((void**) &env, JNI_VERSION_1_6) != JNI_OK)
@@ -51,7 +51,7 @@ JNI_OnLoad(JavaVM* vm, void* reserved)
 }
 
 JNIEXPORT void JNICALL
-JNI_OnUnload(JavaVM *vm, void *reserved)
+JNI_OnUnload(JavaVM*, void*)
 {
   //do nothing
 }
index f137e8e..51fca4b 100644 (file)
@@ -25,7 +25,10 @@ extern "C" {
  */\r
 \r
 JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat\r
-  (JNIEnv * env, jclass cls, jobject bitmap, jlong m_addr)\r
+  (JNIEnv * env, jclass, jobject bitmap, jlong m_addr);\r
+\r
+JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat\r
+  (JNIEnv * env, jclass, jobject bitmap, jlong m_addr)\r
 {\r
     AndroidBitmapInfo  info;\r
     void*              pixels = 0;\r
@@ -73,7 +76,10 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat
  * Method:    void nMatToBitmap(long m_addr, Bitmap b)\r
  */\r
 JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap\r
-  (JNIEnv * env, jclass cls, jlong m_addr, jobject bitmap)\r
+  (JNIEnv * env, jclass, jlong m_addr, jobject bitmap);\r
+\r
+JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap\r
+  (JNIEnv * env, jclass, jlong m_addr, jobject bitmap)\r
 {\r
     AndroidBitmapInfo  info;\r
     void*              pixels = 0;\r
index a4a2dd4..e1166ad 100644 (file)
@@ -108,7 +108,7 @@ public class Mat {
     public Mat(Mat m, Rect roi)\r
     {\r
 \r
-        nativeObj = n_Mat(m.nativeObj, roi.x, roi.x + roi.width, roi.y, roi.y + roi.height);\r
+        nativeObj = n_Mat(m.nativeObj, roi.y, roi.y + roi.height, roi.x, roi.x + roi.width);\r
 \r
         return;\r
     }\r
index be34ab1..9e93ca2 100644 (file)
@@ -75,7 +75,7 @@ public:
     };
     inline void AddPoint(float x, float y, float r)
     {
-        DefTrackPoint   p = {x,y,r,0};
+        DefTrackPoint   p = {x,y,r,0,0,0};
         int             Num = GetPointNum();
 
         if(Num > 0)
index bdd3df8..b53e7d8 100644 (file)
@@ -273,6 +273,9 @@ inline void sum_50t_176c(uchar **pp, uchar *sig, unsigned short *temp)
   ssig[9] =_mm_packus_epi16(_mm_srai_epi16(ttemp[18],2),_mm_srai_epi16(ttemp[19],2));
   ssig[10] =_mm_packus_epi16(_mm_srai_epi16(ttemp[20],2),_mm_srai_epi16(ttemp[21],2));
 #else
+  (void)pp;
+  (void)sig;
+  (void)temp;
   CV_Error( CV_StsNotImplemented, "Not supported without SSE2" );
 #endif
 }
index 9a20fa5..85fe497 100644 (file)
@@ -3078,8 +3078,8 @@ static int _cvFindOppositSiteCW(pCvVoronoiHole pHole, CvVoronoiDiagramInt* pVoro
     pCvVoronoiEdge pEdge_left = pSite_left->edge2->next_edge;
     pCvVoronoiEdge pEdge_right = &Edge_right;
 
-    CvVoronoiEdgeInt Edge = {NULL,pNode,pSite_right,NULL,NULL,NULL,NULL,NULL};
-    CvVoronoiEdgeInt Edge_cur = {NULL,NULL,NULL,NULL,NULL,NULL,NULL};
+    CvVoronoiEdgeInt Edge     = {NULL,pNode,pSite_right,NULL,NULL,NULL,NULL,NULL};
+    CvVoronoiEdgeInt Edge_cur = {NULL,NULL, NULL,       NULL,NULL,NULL,NULL,NULL};
     pCvVoronoiEdge pEdge = &Edge;
 
     float radius1, radius2,dist1, dist2;
@@ -3133,8 +3133,8 @@ static int _cvFindOppositSiteCCW(pCvVoronoiHole pHole,CvVoronoiDiagramInt* pVoro
     pCvVoronoiEdge pEdge_left = &Edge_left;
     pCvVoronoiEdge pEdge_right = pSite_right->edge1->prev_edge;
 
-    CvVoronoiEdgeInt Edge = {NULL,pNode,pSite_left,NULL,NULL,NULL,NULL};
-    CvVoronoiEdgeInt Edge_cur = {NULL,NULL,NULL,NULL,NULL,NULL,NULL};
+    CvVoronoiEdgeInt Edge     = {NULL,pNode,pSite_left,NULL,NULL,NULL,NULL,NULL};
+    CvVoronoiEdgeInt Edge_cur = {NULL,NULL, NULL,      NULL,NULL,NULL,NULL,NULL};
     pCvVoronoiEdge pEdge = &Edge;
 
     double dist1, dist2;
index 0aceea6..4b7cb06 100644 (file)
@@ -469,7 +469,7 @@ icvCreateGLCMDescriptors_AllowDoubleNest( CvGLCM* destGLCM, int matrixIndex )
             descriptors[ CV_GLCMDESC_ENERGY ] += entryValue*entryValue;
         }
 
-        if( marginalProbability>0 )
+        if( marginalProbability[ actualSideLoop1 ] > 0 )
             marginalProbabilityEntropy += marginalProbability[ actualSideLoop1 ]*log(marginalProbability[ actualSideLoop1 ]);
     }
 
index 823561a..84b3af5 100644 (file)
@@ -105,7 +105,9 @@ void generateData( Mat& data, Mat& labels, const vector<int>& sizes, const Mat&
             else if( labelType == CV_32SC1 )
                 labels.at<int>(p, 0) = l;
             else
+            {
                 CV_DbgAssert(0);
+            }
         }
     }
 }
index a6a6f08..9f85608 100644 (file)
@@ -105,7 +105,9 @@ void generateData( Mat& data, Mat& labels, const vector<int>& sizes, const Mat&
             else if( labelType == CV_32SC1 )
                 labels.at<int>(p, 0) = l;
             else
+            {
                 CV_DbgAssert(0);
+            }
         }
     }
 }
index a5dfbe8..80776b4 100644 (file)
@@ -52,7 +52,7 @@ void nbayes_check_data( CvMLData* _data )
         CV_Error( CV_StsBadArg, "missing values are not supported" );
     const CvMat* var_types = _data->get_var_types();
     bool is_classifier = var_types->data.ptr[var_types->cols-1] == CV_VAR_CATEGORICAL;
-    if( ( fabs( cvNorm( var_types, 0, CV_L1 ) - 
+    if( ( fabs( cvNorm( var_types, 0, CV_L1 ) -
         (var_types->rows + var_types->cols - 2)*CV_VAR_ORDERED - CV_VAR_CATEGORICAL ) > FLT_EPSILON ) ||
         !is_classifier )
         CV_Error( CV_StsBadArg, "incorrect types of predictors or responses" );
@@ -89,7 +89,7 @@ float nbayes_calc_error( CvNormalBayesClassifier* nbayes, CvMLData* _data, int t
     {
         CvMat sample;
         int si = sidx ? sidx[i] : i;
-        cvGetRow( values, &sample, si ); 
+        cvGetRow( values, &sample, si );
         float r = (float)nbayes->predict( &sample, 0 );
         if( pred_resp )
             pred_resp[i] = r;
@@ -151,7 +151,7 @@ float knearest_calc_error( CvKNearest* knearest, CvMLData* _data, int k, int typ
         {
             CvMat sample;
             int si = sidx ? sidx[i] : i;
-            cvGetRow( &predictors, &sample, si ); 
+            cvGetRow( &predictors, &sample, si );
             float r = knearest->find_nearest( &sample, k );
             if( pred_resp )
                 pred_resp[i] = r;
@@ -166,14 +166,14 @@ float knearest_calc_error( CvKNearest* knearest, CvMLData* _data, int k, int typ
         {
             CvMat sample;
             int si = sidx ? sidx[i] : i;
-            cvGetRow( &predictors, &sample, si ); 
+            cvGetRow( &predictors, &sample, si );
             float r = knearest->find_nearest( &sample, k );
             if( pred_resp )
                 pred_resp[i] = r;
             float d = r - response->data.fl[si*r_step];
             err += d*d;
         }
-        err = sample_count ? err / (float)sample_count : -FLT_MAX;    
+        err = sample_count ? err / (float)sample_count : -FLT_MAX;
     }
     return err;
 }
@@ -239,7 +239,7 @@ bool svm_train_auto( CvSVM* svm, CvMLData* _data, CvSVMParams _params,
     const CvMat* _responses = _data->get_responses();
     const CvMat* _var_idx = _data->get_var_idx();
     const CvMat* _sample_idx = _data->get_train_sample_idx();
-    return svm->train_auto( _train_data, _responses, _var_idx, 
+    return svm->train_auto( _train_data, _responses, _var_idx,
         _sample_idx, _params, k_fold, C_grid, gamma_grid, p_grid, nu_grid, coef_grid, degree_grid );
 }
 float svm_calc_error( CvSVM* svm, CvMLData* _data, int type, vector<float> *resp )
@@ -268,7 +268,7 @@ float svm_calc_error( CvSVM* svm, CvMLData* _data, int type, vector<float> *resp
         {
             CvMat sample;
             int si = sidx ? sidx[i] : i;
-            cvGetRow( values, &sample, si ); 
+            cvGetRow( values, &sample, si );
             float r = svm->predict( &sample );
             if( pred_resp )
                 pred_resp[i] = r;
@@ -290,7 +290,7 @@ float svm_calc_error( CvSVM* svm, CvMLData* _data, int type, vector<float> *resp
             float d = r - response->data.fl[si*r_step];
             err += d*d;
         }
-        err = sample_count ? err / (float)sample_count : -FLT_MAX;    
+        err = sample_count ? err / (float)sample_count : -FLT_MAX;
     }
     return err;
 }
@@ -395,7 +395,7 @@ float ann_calc_error( CvANN_MLP* ann, CvMLData* _data, map<int, int>& cls_map, i
     {
         CvMat sample;
         int si = sidx ? sidx[i] : i;
-        cvGetRow( &predictors, &sample, si ); 
+        cvGetRow( &predictors, &sample, si );
         ann->predict( &sample, &_output );
         CvPoint best_cls = {0,0};
         cvMinMaxLoc( &_output, 0, 0, 0, &best_cls, 0 );
@@ -417,7 +417,7 @@ int str_to_boost_type( string& str )
     if ( !str.compare("DISCRETE") )
         return CvBoost::DISCRETE;
     if ( !str.compare("REAL") )
-        return CvBoost::REAL;    
+        return CvBoost::REAL;
     if ( !str.compare("LOGIT") )
         return CvBoost::LOGIT;
     if ( !str.compare("GENTLE") )
@@ -480,7 +480,7 @@ CV_MLBaseTest::~CV_MLBaseTest()
         validationFS.release();
     if( nbayes )
         delete nbayes;
-    if( knearest ) 
+    if( knearest )
         delete knearest;
     if( svm )
         delete svm;
@@ -519,15 +519,14 @@ int CV_MLBaseTest::read_params( CvFileStorage* _fs )
     return cvtest::TS::OK;;
 }
 
-void CV_MLBaseTest::run( int start_from )
+void CV_MLBaseTest::run( int )
 {
     string filename = ts->get_data_path();
     filename += get_validation_filename();
     validationFS.open( filename, FileStorage::READ );
     read_params( *validationFS );
-    
+
     int code = cvtest::TS::OK;
-    start_from = 0;
     for (int i = 0; i < test_case_count; i++)
     {
         int temp_code = run_test_case( i );
@@ -594,7 +593,7 @@ string& CV_MLBaseTest::get_validation_filename()
 int CV_MLBaseTest::train( int testCaseIdx )
 {
     bool is_trained = false;
-    FileNode modelParamsNode = 
+    FileNode modelParamsNode =
         validationFS.getFirstTopLevelNode()["validation"][modelName][dataSetNames[testCaseIdx]]["model_params"];
 
     if( !modelName.compare(CV_NBAYES) )
@@ -651,7 +650,7 @@ int CV_MLBaseTest::train( int testCaseIdx )
         modelParamsNode["max_categories"] >> MAX_CATEGORIES;
         modelParamsNode["cv_folds"] >> CV_FOLDS;
         modelParamsNode["is_pruned"] >> IS_PRUNED;
-        is_trained = dtree->train( &data, 
+        is_trained = dtree->train( &data,
             CvDTreeParams(MAX_DEPTH, MIN_SAMPLE_COUNT, REG_ACCURACY, USE_SURROGATE,
             MAX_CATEGORIES, CV_FOLDS, false, IS_PRUNED, 0 )) != 0;
     }
@@ -683,7 +682,7 @@ int CV_MLBaseTest::train( int testCaseIdx )
         modelParamsNode["is_pruned"] >> IS_PRUNED;
         modelParamsNode["nactive_vars"] >> NACTIVE_VARS;
         modelParamsNode["max_trees_num"] >> MAX_TREES_NUM;
-        is_trained = rtrees->train( &data, CvRTParams( MAX_DEPTH, MIN_SAMPLE_COUNT, REG_ACCURACY,
+        is_trained = rtrees->train( &data, CvRTParams(  MAX_DEPTH, MIN_SAMPLE_COUNT, REG_ACCURACY,
             USE_SURROGATE, MAX_CATEGORIES, 0, true, // (calc_var_importance == true) <=> RF processes variable importance
             NACTIVE_VARS, MAX_TREES_NUM, OOB_EPS, CV_TERMCRIT_ITER)) != 0;
     }
@@ -713,7 +712,7 @@ int CV_MLBaseTest::train( int testCaseIdx )
     return cvtest::TS::OK;
 }
 
-float CV_MLBaseTest::get_error( int testCaseIdx, int type, vector<float> *resp )
+float CV_MLBaseTest::get_error( int /*testCaseIdx*/, int type, vector<float> *resp )
 {
     float err = 0;
     if( !modelName.compare(CV_NBAYES) )
@@ -721,8 +720,8 @@ float CV_MLBaseTest::get_error( int testCaseIdx, int type, vector<float> *resp )
     else if( !modelName.compare(CV_KNEAREST) )
     {
         assert( 0 );
-        testCaseIdx = 0;
-        /*int k = 2;
+        /*testCaseIdx = 0;
+        int k = 2;
         validationFS.getFirstTopLevelNode()["validation"][modelName][dataSetNames[testCaseIdx]]["model_params"]["k"] >> k;
         err = knearest->calc_error( &data, k, type, resp );*/
     }
index 39f3616..9388ab6 100644 (file)
@@ -486,6 +486,7 @@ endo: ; // end search for this o
   }
   return rc;
 #else
+  (void)im;
   deque <CvDataMatrixCode> rc;
   return rc;
 #endif
index ebef099..4924e9b 100644 (file)
@@ -181,7 +181,7 @@ public:
         datastart = data = (uchar*)PyArray_DATA(o);
     }
 
-    void deallocate(int* refcount, uchar* datastart, uchar* data)
+    void deallocate(int* refcount, uchar*, uchar*)
     {
         PyEnsureGIL gil;
         if( !refcount )
@@ -349,6 +349,7 @@ static PyObject* pyopencv_from(bool value)
 
 static bool pyopencv_to(PyObject* obj, bool& value, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     int _val = PyObject_IsTrue(obj);
@@ -365,6 +366,7 @@ static PyObject* pyopencv_from(size_t value)
 
 static bool pyopencv_to(PyObject* obj, size_t& value, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     value = (int)PyLong_AsUnsignedLong(obj);
@@ -376,8 +378,19 @@ static PyObject* pyopencv_from(int value)
     return PyInt_FromLong(value);
 }
 
+static PyObject* pyopencv_from(cvflann_flann_algorithm_t value)
+{
+    return PyInt_FromLong(int(value));
+}
+
+static PyObject* pyopencv_from(cvflann_flann_distance_t value)
+{
+    return PyInt_FromLong(int(value));
+}
+
 static bool pyopencv_to(PyObject* obj, int& value, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     value = (int)PyInt_AsLong(obj);
@@ -391,6 +404,7 @@ static PyObject* pyopencv_from(uchar value)
 
 static bool pyopencv_to(PyObject* obj, uchar& value, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     int ivalue = (int)PyInt_AsLong(obj);
@@ -405,6 +419,7 @@ static PyObject* pyopencv_from(double value)
 
 static bool pyopencv_to(PyObject* obj, double& value, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     if(PyInt_CheckExact(obj))
@@ -421,6 +436,7 @@ static PyObject* pyopencv_from(float value)
 
 static bool pyopencv_to(PyObject* obj, float& value, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     if(PyInt_CheckExact(obj))
@@ -442,6 +458,7 @@ static PyObject* pyopencv_from(const string& value)
 
 static bool pyopencv_to(PyObject* obj, string& value, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     char* str = PyString_AsString(obj);
@@ -453,6 +470,7 @@ static bool pyopencv_to(PyObject* obj, string& value, const char* name = "<unkno
 
 static inline bool pyopencv_to(PyObject* obj, Size& sz, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     return PyArg_ParseTuple(obj, "ii", &sz.width, &sz.height) > 0;
@@ -465,6 +483,7 @@ static inline PyObject* pyopencv_from(const Size& sz)
 
 static inline bool pyopencv_to(PyObject* obj, Rect& r, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     return PyArg_ParseTuple(obj, "iiii", &r.x, &r.y, &r.width, &r.height) > 0;
@@ -477,6 +496,7 @@ static inline PyObject* pyopencv_from(const Rect& r)
 
 static inline bool pyopencv_to(PyObject* obj, Range& r, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     if(PyObject_Size(obj) == 0)
@@ -494,6 +514,7 @@ static inline PyObject* pyopencv_from(const Range& r)
 
 static inline bool pyopencv_to(PyObject* obj, CvSlice& r, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     if(PyObject_Size(obj) == 0)
@@ -511,6 +532,7 @@ static inline PyObject* pyopencv_from(const CvSlice& r)
 
 static inline bool pyopencv_to(PyObject* obj, Point& p, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     if(PyComplex_CheckExact(obj))
@@ -525,6 +547,7 @@ static inline bool pyopencv_to(PyObject* obj, Point& p, const char* name = "<unk
 
 static inline bool pyopencv_to(PyObject* obj, Point2f& p, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj || obj == Py_None)
         return true;
     if(PyComplex_CheckExact(obj))
@@ -549,6 +572,7 @@ static inline PyObject* pyopencv_from(const Point2f& p)
 
 static inline bool pyopencv_to(PyObject* obj, Vec3d& v, const char* name = "<unknown>")
 {
+    (void)name;
     if(!obj)
         return true;
     return PyArg_ParseTuple(obj, "ddd", &v[0], &v[1], &v[2]) > 0;
@@ -792,6 +816,7 @@ template<> struct pyopencvVecConverter<string>
 
 static inline bool pyopencv_to(PyObject *obj, CvTermCriteria& dst, const char *name="<unknown>")
 {
+    (void)name;
     if(!obj)
         return true;
     return PyArg_ParseTuple(obj, "iid", &dst.type, &dst.max_iter, &dst.epsilon) > 0;
@@ -804,6 +829,7 @@ static inline PyObject* pyopencv_from(const CvTermCriteria& src)
 
 static inline bool pyopencv_to(PyObject *obj, TermCriteria& dst, const char *name="<unknown>")
 {
+    (void)name;
     if(!obj)
         return true;
     return PyArg_ParseTuple(obj, "iid", &dst.type, &dst.maxCount, &dst.epsilon) > 0;
@@ -816,6 +842,7 @@ static inline PyObject* pyopencv_from(const TermCriteria& src)
 
 static inline bool pyopencv_to(PyObject *obj, RotatedRect& dst, const char *name="<unknown>")
 {
+    (void)name;
     if(!obj)
         return true;
     return PyArg_ParseTuple(obj, "(ff)(ff)f", &dst.center.x, &dst.center.y, &dst.size.width, &dst.size.height, &dst.angle) > 0;
@@ -847,6 +874,7 @@ static inline PyObject* pyopencv_from(const CvDTreeNode* node)
 
 static bool pyopencv_to(PyObject *o, cv::flann::IndexParams& p, const char *name="<unknown>")
 {
+    (void)name;
     bool ok = false;
     PyObject* keys = PyObject_CallMethod(o,(char*)"keys",0);
     PyObject* values = PyObject_CallMethod(o,(char*)"values",0);
@@ -927,7 +955,7 @@ static void OnMouse(int event, int x, int y, int flags, void* param)
     PyGILState_Release(gstate);
 }
 
-static PyObject *pycvSetMouseCallback(PyObject *self, PyObject *args, PyObject *kw)
+static PyObject *pycvSetMouseCallback(PyObject*, PyObject *args, PyObject *kw)
 {
     const char *keywords[] = { "window_name", "on_mouse", "param", NULL };
     char* name;
@@ -961,7 +989,7 @@ static void OnChange(int pos, void *param)
     PyGILState_Release(gstate);
 }
 
-static PyObject *pycvCreateTrackbar(PyObject *self, PyObject *args)
+static PyObject *pycvCreateTrackbar(PyObject*, PyObject *args)
 {
     PyObject *on_change;
     char* trackbar_name;
@@ -983,6 +1011,11 @@ static PyObject *pycvCreateTrackbar(PyObject *self, PyObject *args)
 
 #define MKTYPE2(NAME) pyopencv_##NAME##_specials(); if (!to_ok(&pyopencv_##NAME##_Type)) return
 
+#ifdef __GNUC__
+#  pragma GCC diagnostic ignored "-Wunused-parameter"
+#  pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
 #include "pyopencv_generated_types.h"
 #include "pyopencv_generated_funcs.h"
 
index 4c734b1..bf62f86 100644 (file)
@@ -1,5 +1,4 @@
 #include "perf_precomp.hpp"\r
-\r
 #include "opencv2/highgui/highgui.hpp"\r
 #include "opencv2/core/internal.hpp"\r
 #include "opencv2/flann/flann.hpp"\r
index 346460b..2ec9e13 100644 (file)
@@ -94,7 +94,7 @@ void Blender::feed(const Mat &img, const Mat &mask, Point tl)
 \r
         for (int x = 0; x < img.cols; ++x)\r
         {\r
-            if (mask_row[x]) \r
+            if (mask_row[x])\r
                 dst_row[dx + x] = src_row[x];\r
             dst_mask_row[dx + x] |= mask_row[x];\r
         }\r
@@ -136,7 +136,7 @@ void FeatherBlender::feed(const Mat &img, const Mat &mask, Point tl)
         const float* weight_row = weight_map_.ptr<float>(y);\r
         float* dst_weight_row = dst_weight_map_.ptr<float>(dy + y);\r
 \r
-        for (int x = 0; x < img.cols; ++x)               \r
+        for (int x = 0; x < img.cols; ++x)\r
         {\r
             dst_row[dx + x].x += static_cast<short>(src_row[x].x * weight_row[x]);\r
             dst_row[dx + x].y += static_cast<short>(src_row[x].y * weight_row[x]);\r
@@ -157,7 +157,7 @@ void FeatherBlender::blend(Mat &dst, Mat &dst_mask)
 \r
 Rect FeatherBlender::createWeightMaps(const vector<Mat> &masks, const vector<Point> &corners,\r
                                       vector<Mat> &weight_maps)\r
-{    \r
+{\r
     weight_maps.resize(masks.size());\r
     for (size_t i = 0; i < masks.size(); ++i)\r
         createWeightMap(masks[i], sharpness_, weight_maps[i]);\r
@@ -168,14 +168,14 @@ Rect FeatherBlender::createWeightMaps(const vector<Mat> &masks, const vector<Poi
 \r
     for (size_t i = 0; i < weight_maps.size(); ++i)\r
     {\r
-        Rect roi(corners[i].x - dst_roi.x, corners[i].y - dst_roi.y, \r
+        Rect roi(corners[i].x - dst_roi.x, corners[i].y - dst_roi.y,\r
                  weight_maps[i].cols, weight_maps[i].rows);\r
         weights_sum(roi) += weight_maps[i];\r
     }\r
 \r
     for (size_t i = 0; i < weight_maps.size(); ++i)\r
     {\r
-        Rect roi(corners[i].x - dst_roi.x, corners[i].y - dst_roi.y, \r
+        Rect roi(corners[i].x - dst_roi.x, corners[i].y - dst_roi.y,\r
                  weight_maps[i].cols, weight_maps[i].rows);\r
         Mat tmp = weights_sum(roi);\r
         tmp.setTo(1, tmp < numeric_limits<float>::epsilon());\r
@@ -192,6 +192,7 @@ MultiBandBlender::MultiBandBlender(int try_gpu, int num_bands, int weight_type)
 #ifdef HAVE_OPENCV_GPU\r
     can_use_gpu_ = try_gpu && gpu::getCudaEnabledDeviceCount();\r
 #else\r
+    (void)try_gpu;\r
     can_use_gpu_ = false;\r
 #endif\r
     CV_Assert(weight_type == CV_32F || weight_type == CV_16S);\r
@@ -222,7 +223,7 @@ void MultiBandBlender::prepare(Rect dst_roi)
 \r
     for (int i = 1; i <= num_bands_; ++i)\r
     {\r
-        dst_pyr_laplace_[i].create((dst_pyr_laplace_[i - 1].rows + 1) / 2, \r
+        dst_pyr_laplace_[i].create((dst_pyr_laplace_[i - 1].rows + 1) / 2,\r
                                    (dst_pyr_laplace_[i - 1].cols + 1) / 2, CV_16SC3);\r
         dst_band_weights_[i].create((dst_band_weights_[i - 1].rows + 1) / 2,\r
                                     (dst_band_weights_[i - 1].cols + 1) / 2, weight_type_);\r
@@ -239,15 +240,15 @@ void MultiBandBlender::feed(const Mat &img, const Mat &mask, Point tl)
 \r
     // Keep source image in memory with small border\r
     int gap = 3 * (1 << num_bands_);\r
-    Point tl_new(max(dst_roi_.x, tl.x - gap), \r
+    Point tl_new(max(dst_roi_.x, tl.x - gap),\r
                  max(dst_roi_.y, tl.y - gap));\r
-    Point br_new(min(dst_roi_.br().x, tl.x + img.cols + gap), \r
+    Point br_new(min(dst_roi_.br().x, tl.x + img.cols + gap),\r
                  min(dst_roi_.br().y, tl.y + img.rows + gap));\r
 \r
-    // Ensure coordinates of top-left, bottom-right corners are divided by (1 << num_bands_). \r
+    // Ensure coordinates of top-left, bottom-right corners are divided by (1 << num_bands_).\r
     // After that scale between layers is exactly 2.\r
     //\r
-    // We do it to avoid interpolation problems when keeping sub-images only. There is no such problem when \r
+    // We do it to avoid interpolation problems when keeping sub-images only. There is no such problem when\r
     // image is bordered to have size equal to the final image size, but this is too memory hungry approach.\r
     tl_new.x = dst_roi_.x + (((tl_new.x - dst_roi_.x) >> num_bands_) << num_bands_);\r
     tl_new.y = dst_roi_.y + (((tl_new.y - dst_roi_.y) >> num_bands_) << num_bands_);\r
@@ -507,6 +508,10 @@ void createLaplacePyrGpu(const Mat &img, int num_levels, vector<Mat> &pyr)
     }\r
 \r
     gpu_pyr[num_levels].download(pyr[num_levels]);\r
+#else\r
+    (void)img;\r
+    (void)num_levels;\r
+    (void)pyr;\r
 #endif\r
 }\r
 \r
@@ -542,6 +547,8 @@ void restoreImageFromLaplacePyrGpu(vector<Mat> &pyr)
     }\r
 \r
     gpu_pyr[0].download(pyr[0]);\r
+#else\r
+    (void)pyr;\r
 #endif\r
 }\r
 \r
index 4614922..d7e89c5 100644 (file)
@@ -534,6 +534,8 @@ BestOf2NearestMatcher::BestOf2NearestMatcher(bool try_use_gpu, float match_conf,
     if (try_use_gpu && getCudaEnabledDeviceCount() > 0)\r
         impl_ = new GpuMatcher(match_conf);\r
     else\r
+#else\r
+    (void)try_use_gpu;\r
 #endif\r
         impl_ = new CpuMatcher(match_conf);\r
 \r
index 81d49fa..41f32e4 100644 (file)
@@ -1129,26 +1129,26 @@ norm_(const _Tp* src, size_t total, int cn, int normType, double startval, const
     {
         if( !mask )
             for( i = 0; i < total; i++ )
-                result = std::max(result, (double)std::abs(src[i]));
+                result = std::max(result, (double)std::abs(int(src[i])));
         else
             for( int c = 0; c < cn; c++ )
             {
                 for( i = 0; i < total; i++ )
                     if( mask[i] )
-                        result = std::max(result, (double)std::abs(src[i*cn + c]));
+                        result = std::max(result, (double)std::abs(int(src[i*cn + c])));
             }
     }
     else if( normType == NORM_L1 )
     {
         if( !mask )
             for( i = 0; i < total; i++ )
-                result += std::abs(src[i]);
+                result += std::abs(int(src[i]));
         else
             for( int c = 0; c < cn; c++ )
             {
                 for( i = 0; i < total; i++ )
                     if( mask[i] )
-                        result += std::abs(src[i*cn + c]);
+                        result += std::abs(int(src[i*cn + c]));
             }
     }
     else
index b03961e..9f45a60 100644 (file)
@@ -19,161 +19,161 @@ inline void vector_Rect_to_Mat(vector<Rect>& v_rect, Mat& mat)
 }
 
 JNIEXPORT jlong JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeCreateObject
-(JNIEnv * jenv, jclass jobj, jstring jFileName, jint faceSize)
+(JNIEnv * jenv, jclass, jstring jFileName, jint faceSize)
 {
-    const char* jnamestr = jenv->GetStringUTFChars(jFileName, NULL);    
+    const char* jnamestr = jenv->GetStringUTFChars(jFileName, NULL);
     string stdFileName(jnamestr);
     jlong result = 0;
-    
+
     try
     {
-       DetectionBasedTracker::Parameters DetectorParams;
-       if (faceSize > 0)
-           DetectorParams.minObjectSize = faceSize;
-       result = (jlong)new DetectionBasedTracker(stdFileName, DetectorParams);
+    DetectionBasedTracker::Parameters DetectorParams;
+    if (faceSize > 0)
+        DetectorParams.minObjectSize = faceSize;
+    result = (jlong)new DetectionBasedTracker(stdFileName, DetectorParams);
     }
     catch(cv::Exception e)
     {
-       LOGD("nativeCreateObject catched cv::Exception: %s", e.what());
-       jclass je = jenv->FindClass("org/opencv/core/CvException");
-       if(!je) 
-           je = jenv->FindClass("java/lang/Exception");
-       jenv->ThrowNew(je, e.what());
+    LOGD("nativeCreateObject catched cv::Exception: %s", e.what());
+    jclass je = jenv->FindClass("org/opencv/core/CvException");
+    if(!je)
+        je = jenv->FindClass("java/lang/Exception");
+    jenv->ThrowNew(je, e.what());
     }
     catch (...)
     {
-       LOGD("nativeCreateObject catched unknown exception");
-       jclass je = jenv->FindClass("java/lang/Exception");
-       jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
-       return 0;
+    LOGD("nativeCreateObject catched unknown exception");
+    jclass je = jenv->FindClass("java/lang/Exception");
+    jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
+    return 0;
     }
-    
+
     return result;
 }
 
 JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeDestroyObject
-(JNIEnv * jenv, jclass jobj, jlong thiz)
+(JNIEnv * jenv, jclass, jlong thiz)
 {
     try
     {
-       ((DetectionBasedTracker*)thiz)->stop();
-       delete (DetectionBasedTracker*)thiz;
+    ((DetectionBasedTracker*)thiz)->stop();
+    delete (DetectionBasedTracker*)thiz;
     }
     catch(cv::Exception e)
     {
-       LOGD("nativeestroyObject catched cv::Exception: %s", e.what());
-       jclass je = jenv->FindClass("org/opencv/core/CvException");
-       if(!je) 
-           je = jenv->FindClass("java/lang/Exception");
-       jenv->ThrowNew(je, e.what());
+    LOGD("nativeestroyObject catched cv::Exception: %s", e.what());
+    jclass je = jenv->FindClass("org/opencv/core/CvException");
+    if(!je)
+        je = jenv->FindClass("java/lang/Exception");
+    jenv->ThrowNew(je, e.what());
     }
     catch (...)
     {
-       LOGD("nativeDestroyObject catched unknown exception");
-       jclass je = jenv->FindClass("java/lang/Exception");
-       jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
-    }    
+    LOGD("nativeDestroyObject catched unknown exception");
+    jclass je = jenv->FindClass("java/lang/Exception");
+    jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
+    }
 }
 
 JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeStart
-(JNIEnv * jenv, jclass jobj, jlong thiz)
+(JNIEnv * jenv, jclass, jlong thiz)
 {
     try
     {
-       ((DetectionBasedTracker*)thiz)->run();
+    ((DetectionBasedTracker*)thiz)->run();
     }
     catch(cv::Exception e)
     {
-       LOGD("nativeStart catched cv::Exception: %s", e.what());
-       jclass je = jenv->FindClass("org/opencv/core/CvException");
-       if(!je) 
-           je = jenv->FindClass("java/lang/Exception");
-       jenv->ThrowNew(je, e.what());
+    LOGD("nativeStart catched cv::Exception: %s", e.what());
+    jclass je = jenv->FindClass("org/opencv/core/CvException");
+    if(!je)
+        je = jenv->FindClass("java/lang/Exception");
+    jenv->ThrowNew(je, e.what());
     }
     catch (...)
     {
-       LOGD("nativeStart catched unknown exception");
-       jclass je = jenv->FindClass("java/lang/Exception");
-       jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
-    }     
+    LOGD("nativeStart catched unknown exception");
+    jclass je = jenv->FindClass("java/lang/Exception");
+    jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
+    }
 }
 
 JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeStop
-(JNIEnv * jenv, jclass jobj, jlong thiz)
+(JNIEnv * jenv, jclass, jlong thiz)
 {
     try
     {
-       ((DetectionBasedTracker*)thiz)->stop();
+    ((DetectionBasedTracker*)thiz)->stop();
     }
     catch(cv::Exception e)
     {
-       LOGD("nativeStop catched cv::Exception: %s", e.what());
-       jclass je = jenv->FindClass("org/opencv/core/CvException");
-       if(!je) 
-           je = jenv->FindClass("java/lang/Exception");
-       jenv->ThrowNew(je, e.what());
+    LOGD("nativeStop catched cv::Exception: %s", e.what());
+    jclass je = jenv->FindClass("org/opencv/core/CvException");
+    if(!je)
+        je = jenv->FindClass("java/lang/Exception");
+    jenv->ThrowNew(je, e.what());
     }
     catch (...)
     {
-       LOGD("nativeStop catched unknown exception");
-       jclass je = jenv->FindClass("java/lang/Exception");
-       jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
-    }  
+    LOGD("nativeStop catched unknown exception");
+    jclass je = jenv->FindClass("java/lang/Exception");
+    jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
+    }
 }
 
 JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeSetFaceSize
-(JNIEnv * jenv, jclass jobj, jlong thiz, jint faceSize)
+(JNIEnv * jenv, jclass, jlong thiz, jint faceSize)
 {
     try
     {
-       if (faceSize > 0)
-       {
-           DetectionBasedTracker::Parameters DetectorParams = \
-               ((DetectionBasedTracker*)thiz)->getParameters();
-           DetectorParams.minObjectSize = faceSize;
-           ((DetectionBasedTracker*)thiz)->setParameters(DetectorParams);
-       }
+    if (faceSize > 0)
+    {
+        DetectionBasedTracker::Parameters DetectorParams = \
+        ((DetectionBasedTracker*)thiz)->getParameters();
+        DetectorParams.minObjectSize = faceSize;
+        ((DetectionBasedTracker*)thiz)->setParameters(DetectorParams);
+    }
 
     }
     catch(cv::Exception e)
     {
-       LOGD("nativeStop catched cv::Exception: %s", e.what());
-       jclass je = jenv->FindClass("org/opencv/core/CvException");
-       if(!je) 
-           je = jenv->FindClass("java/lang/Exception");
-       jenv->ThrowNew(je, e.what());
+    LOGD("nativeStop catched cv::Exception: %s", e.what());
+    jclass je = jenv->FindClass("org/opencv/core/CvException");
+    if(!je)
+        je = jenv->FindClass("java/lang/Exception");
+    jenv->ThrowNew(je, e.what());
     }
     catch (...)
     {
-       LOGD("nativeSetFaceSize catched unknown exception");
-       jclass je = jenv->FindClass("java/lang/Exception");
-       jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
+    LOGD("nativeSetFaceSize catched unknown exception");
+    jclass je = jenv->FindClass("java/lang/Exception");
+    jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
     }
 }
 
 
 JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeDetect
-(JNIEnv * jenv, jclass jobj, jlong thiz, jlong imageGray, jlong faces)
+(JNIEnv * jenv, jclass, jlong thiz, jlong imageGray, jlong faces)
 {
     try
     {
-       vector<Rect> RectFaces;
-       ((DetectionBasedTracker*)thiz)->process(*((Mat*)imageGray));
-       ((DetectionBasedTracker*)thiz)->getObjects(RectFaces);
-       vector_Rect_to_Mat(RectFaces, *((Mat*)faces));
+    vector<Rect> RectFaces;
+    ((DetectionBasedTracker*)thiz)->process(*((Mat*)imageGray));
+    ((DetectionBasedTracker*)thiz)->getObjects(RectFaces);
+    vector_Rect_to_Mat(RectFaces, *((Mat*)faces));
     }
     catch(cv::Exception e)
     {
-       LOGD("nativeCreateObject catched cv::Exception: %s", e.what());
-       jclass je = jenv->FindClass("org/opencv/core/CvException");
-       if(!je)
-           je = jenv->FindClass("java/lang/Exception");
-       jenv->ThrowNew(je, e.what());
+    LOGD("nativeCreateObject catched cv::Exception: %s", e.what());
+    jclass je = jenv->FindClass("org/opencv/core/CvException");
+    if(!je)
+        je = jenv->FindClass("java/lang/Exception");
+    jenv->ThrowNew(je, e.what());
     }
     catch (...)
     {
-       LOGD("nativeDetect catched unknown exception");
-       jclass je = jenv->FindClass("java/lang/Exception");
-       jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
+    LOGD("nativeDetect catched unknown exception");
+    jclass je = jenv->FindClass("java/lang/Exception");
+    jenv->ThrowNew(je, "Unknown exception in JNI code {highgui::VideoCapture_n_1VideoCapture__()}");
     }
 }
\ No newline at end of file
index cfe6a30..449bc12 100644 (file)
@@ -6,9 +6,10 @@ const char* message = "Hello Android!";
 \r
 int main(int argc, char* argv[])\r
 {\r
+  (void)argc; (void)argv;\r
   // print message to console\r
   printf("%s\n", message);\r
-  \r
+\r
   // put message to simple image\r
   Size textsize = getTextSize(message, CV_FONT_HERSHEY_COMPLEX, 3, 5, 0);\r
   Mat img(textsize.height + 20, textsize.width + 20, CV_32FC1, Scalar(230,230,230));\r
index 1a2b53d..f2e98e0 100644 (file)
@@ -8,7 +8,7 @@ using namespace std;
 using namespace cv;
 
 extern "C" {
-JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial3_Sample3View_FindFeatures(JNIEnv* env, jobject thiz, jint width, jint height, jbyteArray yuv, jintArray bgra)
+JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial3_Sample3View_FindFeatures(JNIEnv* env, jobject, jint width, jint height, jbyteArray yuv, jintArray bgra)
 {
     jbyte* _yuv  = env->GetByteArrayElements(yuv, 0);
     jint*  _bgra = env->GetIntArrayElements(bgra, 0);
index dd989e6..43015df 100644 (file)
@@ -8,7 +8,7 @@ using namespace std;
 using namespace cv;
 
 extern "C" {
-JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_Sample4View_FindFeatures(JNIEnv* env, jobject thiz, jlong addrGray, jlong addrRgba)
+JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_Sample4View_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba)
 {
     Mat* pMatGr=(Mat*)addrGray;
     Mat* pMatRgb=(Mat*)addrRgba;
index fe57092..d8209fa 100644 (file)
@@ -368,7 +368,7 @@ static void print_params(CvVSModule* pM, const char* module, const char* log_nam
 int main(int argc, char* argv[])
 {   /* Main function: */
     CvCapture*                  pCap = NULL;
-    CvBlobTrackerAutoParam1     param = {0};
+    CvBlobTrackerAutoParam1     param = {0,0,0,0,0,0,0,0};
     CvBlobTrackerAuto*          pTracker = NULL;
 
     //float       scale = 1;
index 2125d16..58939e4 100644 (file)
@@ -22,6 +22,8 @@ static void on_trackbar(int pos)
     IplImage* cnt_img = cvCreateImage( cvSize(w,w), 8, 3 );
     CvSeq* _contours = contours;
     int _levels = levels - 3;
+    (void)pos;
+
     if( _levels <= 0 ) // get to the nearest face to make it look more funny
         _contours = _contours->h_next->h_next->h_next;
     cvZero( cnt_img );
@@ -58,6 +60,8 @@ int main(int argc, char* argv[])
     IplImage* img32f = cvCreateImage( cvSize(w,w), IPL_DEPTH_32F, 1 );
     IplImage* img32s = cvCreateImage( cvSize(w,w), IPL_DEPTH_32S, 1 );
     IplImage* img3 = cvCreateImage( cvSize(w,w), 8, 3 );
+    (void)argc; (void)argv;
+
     help();
     cvZero( img );
 
index 579041f..1ca60df 100644 (file)
@@ -231,9 +231,7 @@ static void run(void)
 
 int main( int argc, char** argv )
 {
-#ifdef _MSC_VER
-    argc, argv;
-#endif
+    (void)argc; (void)argv;
     help();
     run();
     return 0;
index 25d718e..af613d2 100644 (file)
@@ -17,6 +17,7 @@ static void drawOptFlowMap(const CvMat* flow, CvMat* cflowmap, int step,
                     double scale, CvScalar color)
 {
     int x, y;
+    (void)scale;
     for( y = 0; y < cflowmap->rows; y += step)
         for( x = 0; x < cflowmap->cols; x += step)
         {
@@ -31,6 +32,7 @@ int main( int argc, char** argv )
 {
     CvCapture* capture = cvCreateCameraCapture(0);
     CvMat* prevgray = 0, *gray = 0, *flow = 0, *cflow = 0;
+    (void)argc; (void)argv;
 
     help();
 
index c904dd9..3071490 100644 (file)
@@ -19,6 +19,8 @@ static void OpenClose(int pos)
 {
     int n = open_close_pos - max_iters;
     int an = n > 0 ? n : -n;
+    (void)pos;
+
     element = cvCreateStructuringElementEx( an*2+1, an*2+1, an, an, element_shape, 0 );
     if( n < 0 )
     {
@@ -39,6 +41,8 @@ static void ErodeDilate(int pos)
 {
     int n = erode_dilate_pos - max_iters;
     int an = n > 0 ? n : -n;
+    (void)pos;
+
     element = cvCreateStructuringElementEx( an*2+1, an*2+1, an, an, element_shape, 0 );
     if( n < 0 )
     {
index 5f9b381..3b5a1a9 100644 (file)
@@ -34,6 +34,7 @@ CvPoint pt1, pt2;
 
 static void ON_SEGMENT(int a)
 {
+    (void)a;
     cvPyrSegmentation(image0, image1, storage, &comp,
                       level, threshold1+1, threshold2+1);
 
index 4908abf..b498050 100644 (file)
@@ -66,7 +66,7 @@ int main(int argc, char* argv[])
 
     if (status != Stitcher::OK)
     {
-        cout << "Can't stitch images, error code = " << status << endl;
+        cout << "Can't stitch images, error code = " << int(status) << endl;
         return -1;
     }
 
index bc12bf5..349476d 100644 (file)
@@ -18,7 +18,7 @@ using namespace cv;
 \r
 \r
 #if !defined(HAVE_CUDA)\r
-int main( int argc, const char** argv )\r
+int main( int, const char** )\r
 {\r
     cout << "Please compile the library with CUDA support" << endl;\r
     return -1;\r
index e40f059..f48b13a 100644 (file)
@@ -20,7 +20,7 @@
 #endif\r
 \r
 #if !defined(HAVE_CUDA)\r
-int main( int argc, const char** argv )\r
+int main( int, const char** )\r
 {\r
     std::cout << "Please compile the library with CUDA support" << std::endl;\r
     return -1;\r