Commit 680a4418 authored by Marina Kolpakova's avatar Marina Kolpakova

merged the trunk r8704:8716

parent 2777ebb8
......@@ -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)
......
......@@ -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}
......
......@@ -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")
......
......@@ -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 --------------------------------------
......
......@@ -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)
......
......@@ -30,10 +30,7 @@
# 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
#
# ===================================================================================
#
......@@ -41,6 +38,13 @@
# - 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)
......
......@@ -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
......
......@@ -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;
......
......@@ -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;
......
......@@ -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();
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,145 +2,147 @@
#include "opencv2/contrib/contrib.hpp"
#ifdef WIN32
#include <windows.h>
#include <tchar.h>
#include <windows.h>
#include <tchar.h>
#else
#include <dirent.h>
#include <dirent.h>
#endif
namespace cv
{
std::vector<std::string> Directory::GetListFiles( const std::string& path, const std::string & exten, bool addPath )
{
std::vector<std::string> list;
list.clear();
std::string path_f = path + "/" + exten;
#ifdef WIN32
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
hFind = FindFirstFile((LPCSTR)path_f.c_str(), &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
{
return list;
}
else
{
do
{
if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_NORMAL ||
FindFileData.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE ||
FindFileData.dwFileAttributes == FILE_ATTRIBUTE_HIDDEN ||
FindFileData.dwFileAttributes == FILE_ATTRIBUTE_SYSTEM ||
FindFileData.dwFileAttributes == FILE_ATTRIBUTE_READONLY)
{
if (addPath)
list.push_back(path + "/" + FindFileData.cFileName);
else
list.push_back(FindFileData.cFileName);
}
}
while(FindNextFile(hFind, &FindFileData));
FindClose(hFind);
}
#else
DIR *dp;
struct dirent *dirp;
if((dp = opendir(path.c_str())) == NULL)
{
return list;
}
while ((dirp = readdir(dp)) != NULL)
{
if (dirp->d_type == DT_REG)
{
if (exten.compare("*") == 0)
list.push_back(static_cast<std::string>(dirp->d_name));
else
if (std::string(dirp->d_name).find(exten) != std::string::npos)
list.push_back(static_cast<std::string>(dirp->d_name));
}
}
closedir(dp);
#endif
return list;
}
std::vector<std::string> Directory::GetListFolders( const std::string& path, const std::string & exten, bool addPath )
{
std::vector<std::string> list;
std::string path_f = path + "/" + exten;
list.clear();
#ifdef WIN32
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
hFind = FindFirstFile((LPCSTR)path_f.c_str(), &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
{
return list;
}
else
{
do
{
if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY &&
strcmp(FindFileData.cFileName, ".") != 0 &&
strcmp(FindFileData.cFileName, "..") != 0)
{
if (addPath)
list.push_back(path + "/" + FindFileData.cFileName);
else
list.push_back(FindFileData.cFileName);
}
}
while(FindNextFile(hFind, &FindFileData));
FindClose(hFind);
}
#else
DIR *dp;
struct dirent *dirp;
if((dp = opendir(path_f.c_str())) == NULL)
{
return list;
}
while ((dirp = readdir(dp)) != NULL)
{
if (dirp->d_type == DT_DIR &&
strcmp(dirp->d_name, ".") != 0 &&
strcmp(dirp->d_name, "..") != 0 )
{
if (exten.compare("*") == 0)
list.push_back(static_cast<std::string>(dirp->d_name));
else
if (std::string(dirp->d_name).find(exten) != std::string::npos)
list.push_back(static_cast<std::string>(dirp->d_name));
}
}
closedir(dp);
#endif
return list;
}
std::vector<std::string> Directory::GetListFilesR ( const std::string& path, const std::string & exten, bool addPath )
{
std::vector<std::string> list = Directory::GetListFiles(path, exten, addPath);
std::vector<std::string> dirs = Directory::GetListFolders(path, exten, addPath);
std::vector<std::string>::const_iterator it;
for (it = dirs.begin(); it != dirs.end(); ++it)
{
std::vector<std::string> cl = Directory::GetListFiles(*it, exten, addPath);
list.insert(list.end(), cl.begin(), cl.end());
}
return list;
}
std::vector<std::string> Directory::GetListFiles( const std::string& path, const std::string & exten, bool addPath )
{
std::vector<std::string> list;
list.clear();
std::string path_f = path + "/" + exten;
#ifdef WIN32
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
hFind = FindFirstFile((LPCSTR)path_f.c_str(), &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
{
return list;
}
else
{
do
{
if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_NORMAL ||
FindFileData.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE ||
FindFileData.dwFileAttributes == FILE_ATTRIBUTE_HIDDEN ||
FindFileData.dwFileAttributes == FILE_ATTRIBUTE_SYSTEM ||
FindFileData.dwFileAttributes == FILE_ATTRIBUTE_READONLY)
{
if (addPath)
list.push_back(path + "/" + FindFileData.cFileName);
else
list.push_back(FindFileData.cFileName);
}
}
while(FindNextFile(hFind, &FindFileData));
FindClose(hFind);
}
#else
(void)addPath;
DIR *dp;
struct dirent *dirp;
if((dp = opendir(path.c_str())) == NULL)
{
return list;
}
while ((dirp = readdir(dp)) != NULL)
{
if (dirp->d_type == DT_REG)
{
if (exten.compare("*") == 0)
list.push_back(static_cast<std::string>(dirp->d_name));
else
if (std::string(dirp->d_name).find(exten) != std::string::npos)
list.push_back(static_cast<std::string>(dirp->d_name));
}
}
closedir(dp);
#endif
return list;
}
std::vector<std::string> Directory::GetListFolders( const std::string& path, const std::string & exten, bool addPath )
{
std::vector<std::string> list;
std::string path_f = path + "/" + exten;
list.clear();
#ifdef WIN32
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
hFind = FindFirstFile((LPCSTR)path_f.c_str(), &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
{
return list;
}
else
{
do
{
if (FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY &&
strcmp(FindFileData.cFileName, ".") != 0 &&
strcmp(FindFileData.cFileName, "..") != 0)
{
if (addPath)
list.push_back(path + "/" + FindFileData.cFileName);
else
list.push_back(FindFileData.cFileName);
}
}
while(FindNextFile(hFind, &FindFileData));
FindClose(hFind);
}
#else
(void)addPath;
DIR *dp;
struct dirent *dirp;
if((dp = opendir(path_f.c_str())) == NULL)
{
return list;
}
while ((dirp = readdir(dp)) != NULL)
{
if (dirp->d_type == DT_DIR &&
strcmp(dirp->d_name, ".") != 0 &&
strcmp(dirp->d_name, "..") != 0 )
{
if (exten.compare("*") == 0)
list.push_back(static_cast<std::string>(dirp->d_name));
else
if (std::string(dirp->d_name).find(exten) != std::string::npos)
list.push_back(static_cast<std::string>(dirp->d_name));
}
}
closedir(dp);
#endif
return list;
}
std::vector<std::string> Directory::GetListFilesR ( const std::string& path, const std::string & exten, bool addPath )
{
std::vector<std::string> list = Directory::GetListFiles(path, exten, addPath);
std::vector<std::string> dirs = Directory::GetListFolders(path, exten, addPath);
std::vector<std::string>::const_iterator it;
for (it = dirs.begin(); it != dirs.end(); ++it)
{
std::vector<std::string> cl = Directory::GetListFiles(*it, exten, addPath);
list.insert(list.end(), cl.begin(), cl.end());
}
return list;
}
}
This diff is collapsed.
......@@ -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
......
......@@ -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
......
......@@ -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)
......
/*#******************************************************************************
** 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;
......
This diff is collapsed.
This diff is collapsed.
......@@ -59,7 +59,14 @@
#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)
......
......@@ -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_*/
......@@ -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
{
......
......@@ -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
......@@ -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-;")
......
......@@ -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)
{
#ifndef HAVE_CUBLAS
(void)src1; (void)src2; (void)alpha; (void)src3; (void)beta; (void)dst; (void)flags; (void)stream;
CV_Error(CV_StsNotImplemented, "The library was build without CUBLAS");
#else
......
......@@ -748,6 +748,7 @@ namespace cv { namespace gpu { namespace device
const DevMem2Db& trainIdx, const DevMem2Db& distance,
int cc, cudaStream_t stream)
{
(void)cc;
if (query.cols <= 64)
{
matchUnrolledCached<16, 64, Dist>(query, train, mask, static_cast< DevMem2D_<int2> >(trainIdx), static_cast< DevMem2D_<float2> > (distance), stream);
......@@ -779,6 +780,7 @@ namespace cv { namespace gpu { namespace device
const DevMem2Db& trainIdx, const DevMem2Db& imgIdx, const DevMem2Db& distance,
int cc, cudaStream_t stream)
{
(void)cc;
if (query.cols <= 64)
{
matchUnrolledCached<16, 64, Dist>(query, trains, n, mask, static_cast< DevMem2D_<int2> >(trainIdx), static_cast< DevMem2D_<int2> >(imgIdx), static_cast< DevMem2D_<float2> > (distance), stream);
......@@ -943,6 +945,7 @@ namespace cv { namespace gpu { namespace device
const DevMem2Df& allDist,
int cc, cudaStream_t stream)
{
(void)cc;
if (query.cols <= 64)
{
calcDistanceUnrolled<16, 64, Dist>(query, train, mask, allDist, stream);
......
......@@ -567,6 +567,7 @@ namespace cv { namespace gpu { namespace device
const DevMem2Di& trainIdx, const DevMem2Df& distance,
int cc, cudaStream_t stream)
{
(void)cc;
if (query.cols <= 64)
{
matchUnrolledCached<16, 64, Dist>(query, train, mask, trainIdx, distance, stream);
......@@ -598,6 +599,7 @@ namespace cv { namespace gpu { namespace device
const DevMem2Di& trainIdx, const DevMem2Di& imgIdx, const DevMem2Df& distance,
int cc, cudaStream_t stream)
{
(void)cc;
if (query.cols <= 64)
{
matchUnrolledCached<16, 64, Dist>(query, trains, n, mask, trainIdx, imgIdx, distance, stream);
......
......@@ -281,6 +281,7 @@ namespace cv { namespace gpu { namespace device
const DevMem2Di& trainIdx, const DevMem2Df& distance, const DevMem2D_<unsigned int>& nMatches,
int cc, cudaStream_t stream)
{
(void)cc;
if (query.cols <= 64)
{
matchUnrolled<16, 64, Dist>(query, train, maxDistance, mask, trainIdx, distance, nMatches, stream);
......@@ -312,6 +313,7 @@ namespace cv { namespace gpu { namespace device
const DevMem2Di& trainIdx, const DevMem2Di& imgIdx, const DevMem2Df& distance, const DevMem2D_<unsigned int>& nMatches,
int cc, cudaStream_t stream)
{
(void)cc;
if (query.cols <= 64)
{
matchUnrolled<16, 64, Dist>(query, trains, n, maxDistance, masks, trainIdx, imgIdx, distance, nMatches, stream);
......
......@@ -619,6 +619,7 @@ namespace cv { namespace gpu { namespace device
void compute_gradients_8UC4(int nbins, int height, int width, const DevMem2Db& img,
float angle_scale, DevMem2Df grad, DevMem2Db qangle, bool correct_gamma)
{
(void)nbins;
const int nthreads = 256;
dim3 bdim(nthreads, 1);
......@@ -691,6 +692,7 @@ namespace cv { namespace gpu { namespace device
void compute_gradients_8UC1(int nbins, int height, int width, const DevMem2Db& img,
float angle_scale, DevMem2Df grad, DevMem2Db qangle, bool correct_gamma)
{
(void)nbins;
const int nthreads = 256;
dim3 bdim(nthreads, 1);
......
......@@ -87,6 +87,9 @@ namespace cv { namespace gpu { namespace device
{
static void call(DevMem2D_<T> src, DevMem2D_<T> srcWhole, int xoff, int yoff, DevMem2Df mapx, DevMem2Df mapy, DevMem2D_<T> dst, const float* borderValue, int)
{
(void)srcWhole;
(void)xoff;
(void)yoff;
typedef typename TypeVec<float, VecTraits<T>::cn>::vec_type work_type;
dim3 block(32, 8);
......
......@@ -132,6 +132,10 @@ namespace cv { namespace gpu { namespace device
{
static void call(DevMem2D_<T> src, DevMem2D_<T> srcWhole, int xoff, int yoff, float fx, float fy, DevMem2D_<T> dst)
{
(void)srcWhole;
(void)xoff;
(void)yoff;
dim3 block(32, 8);
dim3 grid(divUp(dst.cols, block.x), divUp(dst.rows, block.y));
......@@ -220,6 +224,9 @@ namespace cv { namespace gpu { namespace device
{
static void call(DevMem2D_<T> src, DevMem2D_<T> srcWhole, int xoff, int yoff, float fx, float fy, DevMem2D_<T> dst, cudaStream_t stream)
{
(void)srcWhole;
(void)xoff;
(void)yoff;
int iscale_x = round(fx);
int iscale_y = round(fy);
......
......@@ -158,6 +158,10 @@ namespace cv { namespace gpu { namespace device
{
static void call(DevMem2D_<T> src, DevMem2D_<T> srcWhole, int xoff, int yoff, DevMem2D_<T> dst, const float* borderValue, int)
{
(void)xoff;
(void)yoff;
(void)srcWhole;
typedef typename TypeVec<float, VecTraits<T>::cn>::vec_type work_type;
dim3 block(32, 8);
......
......@@ -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) );
ScaleVector(ptrVNew->ptr(), ptrVNew->ptr(), 1.0f/scale_factor, ns * nh, stream);
ncvAssertCUDALastErrorReturn(NCV_CUDA_ERROR);
ncvAssertCUDALastErrorReturn((int)NCV_CUDA_ERROR);
cv::gpu::device::swap<FloatVector*>(ptrU, ptrUNew);
cv::gpu::device::swap<FloatVector*>(ptrV, ptrVNew);
......@@ -1145,17 +1145,17 @@ NCVStatus NCVBroxOpticalFlow(const NCVBroxOpticalFlowDescriptor desc,
}
// end of warping iterations
ncvAssertCUDAReturn(cudaStreamSynchronize(stream), NCV_CUDA_ERROR);
ncvAssertCUDAReturn(cudaStreamSynchronize(stream), (int)NCV_CUDA_ERROR);
ncvAssertCUDAReturn( cudaMemcpy2DAsync
(uOut.ptr(), uOut.pitch(), ptrU->ptr(),
kSourcePitch, kSourceWidth*sizeof(float), kSourceHeight, cudaMemcpyDeviceToDevice, stream), NCV_CUDA_ERROR );
kSourcePitch, kSourceWidth*sizeof(float), kSourceHeight, cudaMemcpyDeviceToDevice, stream), (int)NCV_CUDA_ERROR );
ncvAssertCUDAReturn( cudaMemcpy2DAsync
(vOut.ptr(), vOut.pitch(), ptrV->ptr(),
kSourcePitch, kSourceWidth*sizeof(float), kSourceHeight, cudaMemcpyDeviceToDevice, stream), NCV_CUDA_ERROR );
kSourcePitch, kSourceWidth*sizeof(float), kSourceHeight, cudaMemcpyDeviceToDevice, stream), (int)NCV_CUDA_ERROR );
ncvAssertCUDAReturn(cudaStreamSynchronize(stream), NCV_CUDA_ERROR);
ncvAssertCUDAReturn(cudaStreamSynchronize(stream), (int)NCV_CUDA_ERROR);
}
return NCV_SUCCESS;
......
......@@ -687,6 +687,7 @@ struct applyHaarClassifierAnchorParallelFunctor
template<class TList>
void call(TList tl)
{
(void)tl;
applyHaarClassifierAnchorParallel <
Loki::TL::TypeAt<TList, 0>::Result::value,
Loki::TL::TypeAt<TList, 1>::Result::value,
......@@ -796,6 +797,7 @@ struct applyHaarClassifierClassifierParallelFunctor
template<class TList>
void call(TList tl)
{
(void)tl;
applyHaarClassifierClassifierParallel <
Loki::TL::TypeAt<TList, 0>::Result::value,
Loki::TL::TypeAt<TList, 1>::Result::value,
......@@ -876,6 +878,7 @@ struct initializeMaskVectorFunctor
template<class TList>
void call(TList tl)
{
(void)tl;
initializeMaskVector <
Loki::TL::TypeAt<TList, 0>::Result::value,
Loki::TL::TypeAt<TList, 1>::Result::value >
......
......@@ -854,6 +854,7 @@ static NCVStatus drawRectsWrapperDevice(T *d_dst,
T color,
cudaStream_t cuStream)
{
(void)cuStream;
ncvAssertReturn(d_dst != NULL && d_rects != NULL, NCV_NULL_PTR);
ncvAssertReturn(dstWidth > 0 && dstHeight > 0, NCV_DIMENSIONS_INVALID);
ncvAssertReturn(dstStride >= dstWidth, NCV_INVALID_STEP);
......
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// 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.
......@@ -461,7 +461,7 @@ public:
virtual NcvBool isInitialized(void) const = 0;
virtual NcvBool isCounting(void) const = 0;
virtual NCVMemoryType memType(void) const = 0;
virtual Ncv32u alignment(void) const = 0;
virtual size_t maxSize(void) const = 0;
......@@ -585,11 +585,11 @@ public:
}
else
{
ncvAssertReturn(dst._length * sizeof(T) >= howMuch &&
ncvAssertReturn(dst._length * sizeof(T) >= howMuch &&
this->_length * sizeof(T) >= howMuch &&
howMuch > 0, NCV_MEM_COPY_ERROR);
}
ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) &&
ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) &&
(dst._ptr != NULL || dst._memtype == NCVMemoryTypeNone), NCV_NULL_PTR);
NCVStatus ncvStat = NCV_SUCCESS;
......@@ -766,18 +766,18 @@ public:
}
else
{
ncvAssertReturn(dst._pitch * dst._height >= howMuch &&
ncvAssertReturn(dst._pitch * dst._height >= howMuch &&
this->_pitch * this->_height >= howMuch &&
howMuch > 0, NCV_MEM_COPY_ERROR);
}
ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) &&
ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) &&
(dst._ptr != NULL || dst._memtype == NCVMemoryTypeNone), NCV_NULL_PTR);
NCVStatus ncvStat = NCV_SUCCESS;
if (this->_memtype != NCVMemoryTypeNone)
{
ncvStat = memSegCopyHelper(dst._ptr, dst._memtype,
this->_ptr, this->_memtype,
ncvStat = memSegCopyHelper(dst._ptr, dst._memtype,
this->_ptr, this->_memtype,
howMuch, cuStream);
}
......@@ -788,7 +788,7 @@ public:
{
ncvAssertReturn(this->width() >= roi.width && this->height() >= roi.height &&
dst.width() >= roi.width && dst.height() >= roi.height, NCV_MEM_COPY_ERROR);
ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) &&
ncvAssertReturn((this->_ptr != NULL || this->_memtype == NCVMemoryTypeNone) &&
(dst._ptr != NULL || dst._memtype == NCVMemoryTypeNone), NCV_NULL_PTR);
NCVStatus ncvStat = NCV_SUCCESS;
......@@ -802,7 +802,7 @@ public:
return ncvStat;
}
T &at(Ncv32u x, Ncv32u y) const
T& at(Ncv32u x, Ncv32u y) const
{
NcvBool bOutRange = (x >= this->_width || y >= this->_height);
ncvAssertPrintCheck(!bOutRange, "Error addressing matrix at [" << x << ", " << y << "]");
......
......@@ -211,6 +211,7 @@ namespace NCVRuntimeTemplateBool
static void call(Func &functor, std::vector<int> &templateParams)
{
(void)templateParams;
functor.call(TList());
}
};
......
......@@ -55,7 +55,12 @@ namespace cv { namespace gpu { namespace device
typedef typename Ptr2D::elem_type elem_type;
typedef float index_type;
explicit __host__ __device__ __forceinline__ PointFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) : src(src_) {}
explicit __host__ __device__ __forceinline__ PointFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f)
: src(src_)
{
(void)fx;
(void)fy;
}
__device__ __forceinline__ elem_type operator ()(float y, float x) const
{
......@@ -70,8 +75,12 @@ namespace cv { namespace gpu { namespace device
typedef typename Ptr2D::elem_type elem_type;
typedef float index_type;
explicit __host__ __device__ __forceinline__ LinearFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) : src(src_) {}
explicit __host__ __device__ __forceinline__ LinearFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f)
: src(src_)
{
(void)fx;
(void)fy;
}
__device__ __forceinline__ elem_type operator ()(float y, float x) const
{
typedef typename TypeVec<float, VecTraits<elem_type>::cn>::vec_type work_type;
......@@ -107,7 +116,12 @@ namespace cv { namespace gpu { namespace device
typedef float index_type;
typedef typename TypeVec<float, VecTraits<elem_type>::cn>::vec_type work_type;
explicit __host__ __device__ __forceinline__ CubicFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f) : src(src_) {}
explicit __host__ __device__ __forceinline__ CubicFilter(const Ptr2D& src_, float fx = 0.f, float fy = 0.f)
: src(src_)
{
(void)fx;
(void)fy;
}
static __device__ __forceinline__ float bicubicCoeff(float x_)
{
......
......@@ -470,7 +470,7 @@ namespace cv { namespace gpu { namespace device
template <typename T> struct thresh_trunc_func : unary_function<T, T>
{
explicit __host__ __device__ __forceinline__ thresh_trunc_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {}
explicit __host__ __device__ __forceinline__ thresh_trunc_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {(void)maxVal_;}
__device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const
{
......@@ -487,7 +487,7 @@ namespace cv { namespace gpu { namespace device
template <typename T> struct thresh_to_zero_func : unary_function<T, T>
{
explicit __host__ __device__ __forceinline__ thresh_to_zero_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {}
explicit __host__ __device__ __forceinline__ thresh_to_zero_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {(void)maxVal_;}
__device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const
{
......@@ -503,7 +503,7 @@ namespace cv { namespace gpu { namespace device
template <typename T> struct thresh_to_zero_inv_func : unary_function<T, T>
{
explicit __host__ __device__ __forceinline__ thresh_to_zero_inv_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {}
explicit __host__ __device__ __forceinline__ thresh_to_zero_inv_func(T thresh_, T maxVal_ = 0) : thresh(thresh_) {(void)maxVal_;}
__device__ __forceinline__ T operator()(typename TypeTraits<T>::ParameterType src) const
{
......
......@@ -56,20 +56,6 @@ void cv::gpu::resize(const GpuMat& src, GpuMat& dst, Size dsize, double fx, doub
throw_nogpu();
}
void cv::gpu::resize(const GpuMat& src, GpuMat& dst,GpuMat& buffer, Size dsize,
double fx, double fy, int interpolation, Stream& s)
{
(void)src;
(void)dst;
(void)dsize;
(void)fx;
(void)fy;
(void)interpolation;
(void)buffer;
(void)s;
throw_nogpu();
}
#else // HAVE_CUDA
......
/*
* Copyright 1993-2010 NVIDIA Corporation. All rights reserved.
*
* NVIDIA Corporation and its licensors retain all intellectual
* property and proprietary rights in and to this software and
* related documentation and any modifications thereto.
* Any use, reproduction, disclosure, or distribution of this
* software and related documentation without an express license
* NVIDIA Corporation and its licensors retain all intellectual
* property and proprietary rights in and to this software and
* related documentation and any modifications thereto.
* Any use, reproduction, disclosure, or distribution of this
* software and related documentation without an express license
* agreement from NVIDIA Corporation is strictly prohibited.
*/
......@@ -13,14 +13,14 @@
#include "NCVHaarObjectDetection.hpp"
TestHypothesesFilter::TestHypothesesFilter(std::string testName, NCVTestSourceProvider<Ncv32u> &src,
Ncv32u numDstRects, Ncv32u minNeighbors, Ncv32f eps)
TestHypothesesFilter::TestHypothesesFilter(std::string testName, NCVTestSourceProvider<Ncv32u> &src_,
Ncv32u numDstRects_, Ncv32u minNeighbors_, Ncv32f eps_)
:
NCVTestProvider(testName),
src(src),
numDstRects(numDstRects),
minNeighbors(minNeighbors),
eps(eps)
src(src_),
numDstRects(numDstRects_),
minNeighbors(minNeighbors_),
eps(eps_)
{
}
......@@ -94,11 +94,11 @@ bool TestHypothesesFilter::process()
for (Ncv32u j=0; j<numNeighbors; j++)
{
randVal = (1.0 * h_random32u.ptr()[randCnt++]) / 0xFFFFFFFF; randCnt = randCnt % h_random32u.length();
h_vecSrc.ptr()[srcSlotSize * i + j].x =
h_vecSrc.ptr()[srcSlotSize * i + j].x =
h_vecDst_groundTruth.ptr()[i].x +
(Ncv32s)(h_vecDst_groundTruth.ptr()[i].width * this->eps * (randVal - 0.5));
randVal = (1.0 * h_random32u.ptr()[randCnt++]) / 0xFFFFFFFF; randCnt = randCnt % h_random32u.length();
h_vecSrc.ptr()[srcSlotSize * i + j].y =
h_vecSrc.ptr()[srcSlotSize * i + j].y =
h_vecDst_groundTruth.ptr()[i].y +
(Ncv32s)(h_vecDst_groundTruth.ptr()[i].height * this->eps * (randVal - 0.5));
h_vecSrc.ptr()[srcSlotSize * i + j].width = h_vecDst_groundTruth.ptr()[i].width;
......@@ -109,11 +109,11 @@ bool TestHypothesesFilter::process()
for (Ncv32u j=numNeighbors; j<srcSlotSize; j++)
{
randVal = (1.0 * h_random32u.ptr()[randCnt++]) / 0xFFFFFFFF; randCnt = randCnt % h_random32u.length();
h_vecSrc.ptr()[srcSlotSize * i + j].x =
h_vecSrc.ptr()[srcSlotSize * i + j].x =
this->canvasWidth + h_vecDst_groundTruth.ptr()[i].x +
(Ncv32s)(h_vecDst_groundTruth.ptr()[i].width * this->eps * (randVal - 0.5));
randVal = (1.0 * h_random32u.ptr()[randCnt++]) / 0xFFFFFFFF; randCnt = randCnt % h_random32u.length();
h_vecSrc.ptr()[srcSlotSize * i + j].y =
h_vecSrc.ptr()[srcSlotSize * i + j].y =
this->canvasHeight + h_vecDst_groundTruth.ptr()[i].y +
(Ncv32s)(h_vecDst_groundTruth.ptr()[i].height * this->eps * (randVal - 0.5));
h_vecSrc.ptr()[srcSlotSize * i + j].width = h_vecDst_groundTruth.ptr()[i].width;
......@@ -124,8 +124,8 @@ bool TestHypothesesFilter::process()
//shuffle
for (Ncv32u i=0; i<this->numDstRects*srcSlotSize-1; i++)
{
Ncv32u randVal = h_random32u.ptr()[randCnt++]; randCnt = randCnt % h_random32u.length();
Ncv32u secondSwap = randVal % (this->numDstRects*srcSlotSize-1 - i);
Ncv32u randValLocal = h_random32u.ptr()[randCnt++]; randCnt = randCnt % h_random32u.length();
Ncv32u secondSwap = randValLocal % (this->numDstRects*srcSlotSize-1 - i);
NcvRect32u tmp = h_vecSrc.ptr()[i + secondSwap];
h_vecSrc.ptr()[i + secondSwap] = h_vecSrc.ptr()[i];
h_vecSrc.ptr()[i] = tmp;
......
/*
* Copyright 1993-2010 NVIDIA Corporation. All rights reserved.
*
* NVIDIA Corporation and its licensors retain all intellectual
* property and proprietary rights in and to this software and
* related documentation and any modifications thereto.
* Any use, reproduction, disclosure, or distribution of this
* software and related documentation without an express license
* NVIDIA Corporation and its licensors retain all intellectual
* property and proprietary rights in and to this software and
* related documentation and any modifications thereto.
* Any use, reproduction, disclosure, or distribution of this
* software and related documentation without an express license
* agreement from NVIDIA Corporation is strictly prohibited.
*/
......@@ -15,15 +15,15 @@
template <class T>
TestResize<T>::TestResize(std::string testName, NCVTestSourceProvider<T> &src,
Ncv32u width, Ncv32u height, Ncv32u scaleFactor, NcvBool bTextureCache)
TestResize<T>::TestResize(std::string testName, NCVTestSourceProvider<T> &src_,
Ncv32u width_, Ncv32u height_, Ncv32u scaleFactor_, NcvBool bTextureCache_)
:
NCVTestProvider(testName),
src(src),
width(width),
height(height),
scaleFactor(scaleFactor),
bTextureCache(bTextureCache)
src(src_),
width(width_),
height(height_),
scaleFactor(scaleFactor_),
bTextureCache(bTextureCache_)
{
}
......
......@@ -248,6 +248,7 @@ void generateHaarLoaderTests(NCVAutoTestLister &testLister)
void generateHaarApplicationTests(NCVAutoTestLister &testLister, NCVTestSourceProvider<Ncv8u> &src,
Ncv32u maxWidth, Ncv32u maxHeight)
{
(void)maxHeight;
for (Ncv32u i=20; i<512; i+=11)
{
for (Ncv32u j=20; j<128; j+=5)
......@@ -268,11 +269,12 @@ void generateHaarApplicationTests(NCVAutoTestLister &testLister, NCVTestSourcePr
static void devNullOutput(const std::string& msg)
{
(void)msg;
}
bool nvidia_NPPST_Integral_Image(const std::string& test_data_path, OutputLevel outputLevel)
{
path = test_data_path;
path = test_data_path.c_str();
ncvSetDebugOutputHandler(devNullOutput);
NCVAutoTestLister testListerII("NPPST Integral Image", outputLevel);
......@@ -374,6 +376,7 @@ bool nvidia_NCV_Vector_Operations(const std::string& test_data_path, OutputLevel
generateVectorTests(testListerVectorOperations, testSrcRandom_32u, 4096*4096);
return testListerVectorOperations.invoke();
}
bool nvidia_NCV_Haar_Cascade_Loader(const std::string& test_data_path, OutputLevel outputLevel)
......
......@@ -58,15 +58,15 @@ struct NVidiaTest : TestWithParam<cv::gpu::DeviceInfo>
{
cv::gpu::DeviceInfo devInfo;
std::string path;
std::string _path;
virtual void SetUp()
{
devInfo = GetParam();
cv::gpu::setDevice(devInfo.deviceID());
path = std::string(TS::ptr()->get_data_path()) + "haarcascade/";
_path = TS::ptr()->get_data_path().c_str();
_path = _path + "haarcascade/";
}
};
......@@ -84,63 +84,63 @@ OutputLevel nvidiaTestOutputLevel = OutputLevelCompact;
TEST_P(NPPST, SquaredIntegral)
{
bool res = nvidia_NPPST_Squared_Integral_Image(path, nvidiaTestOutputLevel);
bool res = nvidia_NPPST_Squared_Integral_Image(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NPPST, RectStdDev)
{
bool res = nvidia_NPPST_RectStdDev(path, nvidiaTestOutputLevel);
bool res = nvidia_NPPST_RectStdDev(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NPPST, Resize)
{
bool res = nvidia_NPPST_Resize(path, nvidiaTestOutputLevel);
bool res = nvidia_NPPST_Resize(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NPPST, VectorOperations)
{
bool res = nvidia_NPPST_Vector_Operations(path, nvidiaTestOutputLevel);
bool res = nvidia_NPPST_Vector_Operations(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NPPST, Transpose)
{
bool res = nvidia_NPPST_Transpose(path, nvidiaTestOutputLevel);
bool res = nvidia_NPPST_Transpose(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NCV, VectorOperations)
{
bool res = nvidia_NCV_Vector_Operations(path, nvidiaTestOutputLevel);
bool res = nvidia_NCV_Vector_Operations(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NCV, HaarCascadeLoader)
{
bool res = nvidia_NCV_Haar_Cascade_Loader(path, nvidiaTestOutputLevel);
bool res = nvidia_NCV_Haar_Cascade_Loader(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NCV, HaarCascadeApplication)
{
bool res = nvidia_NCV_Haar_Cascade_Application(path, nvidiaTestOutputLevel);
bool res = nvidia_NCV_Haar_Cascade_Application(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
TEST_P(NCV, HypothesesFiltration)
{
bool res = nvidia_NCV_Hypotheses_Filtration(path, nvidiaTestOutputLevel);
bool res = nvidia_NCV_Hypotheses_Filtration(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
......@@ -148,7 +148,7 @@ TEST_P(NCV, HypothesesFiltration)
TEST_P(NCV, Visualization)
{
// this functionality doesn't used in gpu module
bool res = nvidia_NCV_Visualization(path, nvidiaTestOutputLevel);
bool res = nvidia_NCV_Visualization(_path, nvidiaTestOutputLevel);
ASSERT_TRUE(res);
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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}"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -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
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -486,6 +486,7 @@ endo: ; // end search for this o
}
return rc;
#else
(void)im;
deque <CvDataMatrixCode> rc;
return rc;
#endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment