Commit 8f4c7db3 authored by Anatoly Baksheev's avatar Anatoly Baksheev

~40 warnings under VS2008

HAVE_CONFIG_H -> HAVE_CVCONFIG_H
parent dc8572dc
......@@ -32,7 +32,7 @@
* script.
*/
#ifdef PNG_CONFIGURE_LIBPNG
# ifdef HAVE_CONFIG_H
# ifdef HAVE_CVCONFIG_H
# include "config.h"
# endif
#endif
......
......@@ -683,7 +683,7 @@ if (WITH_TBB)
endif()
if (NOT HAVE_TBB)
set(TBB_DEFAULT_INCLUDE_DIRS "/opt/intel/tbb" "/usr/local/include" "/usr/include" "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
set(TBB_DEFAULT_INCLUDE_DIRS "/opt/intel/tbb" "/usr/local/include" "/usr/include" "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB" "C:/Program Files (x86)/TBB")
find_path(TBB_INCLUDE_DIR "tbb/tbb.h" PATHS ${TBB_DEFAULT_INCLUDE_DIRS} DOC "The path to TBB headers")
if (TBB_INCLUDE_DIR)
......@@ -913,7 +913,7 @@ set(BUILD_DOCS ON CACHE BOOL "Build OpenCV Reference Manual")
# A directory will be created for each platform so the "cvconfig.h" file is
# not overwritten if cmake generates code in the same path.
# ----------------------------------------------------------------------------
add_definitions(-DHAVE_CONFIG_H)
add_definitions(-DHAVE_CVCONFIG_H)
set(OPENCV_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/" CACHE PATH "Where to create the platform-dependant cvconfig.h")
......
......@@ -1914,9 +1914,9 @@ bool cv::findChessboardCorners( InputArray _image, Size patternSize,
namespace
{
int quiet_error(int status, const char* func_name,
const char* err_msg, const char* file_name,
int line, void* userdata )
int quiet_error(int /*status*/, const char* /*func_name*/,
const char* /*err_msg*/, const char* /*file_name*/,
int /*line*/, void* /*userdata*/ )
{
return 0;
}
......
......@@ -46,7 +46,7 @@
#pragma warning( disable: 4251 4710 4711 4514 4996 )
#endif
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -344,60 +344,65 @@ void LevMarqSparse::run( int num_points_, //number of points
errNorm = cvNorm( err, 0, CV_L2 );
}
void LevMarqSparse::ask_for_proj(CvMat &_vis,bool once) {
//given parameter P, compute measurement hX
int ind = 0;
for (int i = 0; i < num_points; i++ ) {
CvMat point_mat;
cvGetSubRect( P, &point_mat, cvRect( 0, num_cams * num_cam_param + num_point_param * i, 1, num_point_param ));
for (int j = 0; j < num_cams; j++ ) {
//CvMat* Aij = ((CvMat**)(A->data.ptr + A->step * i))[j];
CvMat* Aij = A[j+i*num_cams];
if (Aij ) { //visible
CvMat cam_mat;
cvGetSubRect( P, &cam_mat, cvRect( 0, j * num_cam_param, 1, num_cam_param ));
CvMat measur_mat;
cvGetSubRect( hX, &measur_mat, cvRect( 0, ind * num_err_param, 1, num_err_param ));
Mat _point_mat(&point_mat), _cam_mat(&cam_mat), _measur_mat(&measur_mat);
func( i, j, _point_mat, _cam_mat, _measur_mat, data);
assert( ind*num_err_param == ((int*)(Vis_index->data.ptr + i * Vis_index->step))[j]);
ind+=1;
}
}
}
void LevMarqSparse::ask_for_proj(CvMat &/*_vis*/,bool once) {
(void)once;
//given parameter P, compute measurement hX
int ind = 0;
for (int i = 0; i < num_points; i++ ) {
CvMat point_mat;
cvGetSubRect( P, &point_mat, cvRect( 0, num_cams * num_cam_param + num_point_param * i, 1, num_point_param ));
for (int j = 0; j < num_cams; j++ ) {
//CvMat* Aij = ((CvMat**)(A->data.ptr + A->step * i))[j];
CvMat* Aij = A[j+i*num_cams];
if (Aij ) { //visible
CvMat cam_mat;
cvGetSubRect( P, &cam_mat, cvRect( 0, j * num_cam_param, 1, num_cam_param ));
CvMat measur_mat;
cvGetSubRect( hX, &measur_mat, cvRect( 0, ind * num_err_param, 1, num_err_param ));
Mat _point_mat(&point_mat), _cam_mat(&cam_mat), _measur_mat(&measur_mat);
func( i, j, _point_mat, _cam_mat, _measur_mat, data);
assert( ind*num_err_param == ((int*)(Vis_index->data.ptr + i * Vis_index->step))[j]);
ind+=1;
}
}
}
}
//iteratively asks for Jacobians for every camera_point pair
void LevMarqSparse::ask_for_projac(CvMat &_vis) { //should be evaluated at point prevP
// compute jacobians Aij and Bij
for (int i = 0; i < num_points; i++ ) {
CvMat point_mat;
cvGetSubRect( prevP, &point_mat, cvRect( 0, num_cams * num_cam_param + num_point_param * i, 1, num_point_param ));
//CvMat** A_line = (CvMat**)(A->data.ptr + A->step * i);
//CvMat** B_line = (CvMat**)(B->data.ptr + B->step * i);
for( int j = 0; j < num_cams; j++ ) {
//CvMat* Aij = A_line[j];
//if( Aij ) //Aij is not zero
CvMat* Aij = A[j+i*num_cams];
CvMat* Bij = B[j+i*num_cams];
if(Aij) {
//CvMat** A_line = (CvMat**)(A->data.ptr + A->step * i);
//CvMat** B_line = (CvMat**)(B->data.ptr + B->step * i);
//CvMat* Aij = A_line[j];
//CvMat* Aij = ((CvMat**)(A->data.ptr + A->step * i))[j];
CvMat cam_mat;
cvGetSubRect( prevP, &cam_mat, cvRect( 0, j * num_cam_param, 1, num_cam_param ));
//CvMat* Bij = B_line[j];
//CvMat* Bij = ((CvMat**)(B->data.ptr + B->step * i))[j];
Mat _point_mat(&point_mat), _cam_mat(&cam_mat), _Aij(Aij), _Bij(Bij);
(*fjac)(i, j, _point_mat, _cam_mat, _Aij, _Bij, data);
}
void LevMarqSparse::ask_for_projac(CvMat &/*_vis*/) //should be evaluated at point prevP
{
// compute jacobians Aij and Bij
for (int i = 0; i < num_points; i++ )
{
CvMat point_mat;
cvGetSubRect( prevP, &point_mat, cvRect( 0, num_cams * num_cam_param + num_point_param * i, 1, num_point_param ));
//CvMat** A_line = (CvMat**)(A->data.ptr + A->step * i);
//CvMat** B_line = (CvMat**)(B->data.ptr + B->step * i);
for( int j = 0; j < num_cams; j++ )
{
//CvMat* Aij = A_line[j];
//if( Aij ) //Aij is not zero
CvMat* Aij = A[j+i*num_cams];
CvMat* Bij = B[j+i*num_cams];
if(Aij)
{
//CvMat** A_line = (CvMat**)(A->data.ptr + A->step * i);
//CvMat** B_line = (CvMat**)(B->data.ptr + B->step * i);
//CvMat* Aij = A_line[j];
//CvMat* Aij = ((CvMat**)(A->data.ptr + A->step * i))[j];
CvMat cam_mat;
cvGetSubRect( prevP, &cam_mat, cvRect( 0, j * num_cam_param, 1, num_cam_param ));
//CvMat* Bij = B_line[j];
//CvMat* Bij = ((CvMat**)(B->data.ptr + B->step * i))[j];
Mat _point_mat(&point_mat), _cam_mat(&cam_mat), _Aij(Aij), _Bij(Bij);
(*fjac)(i, j, _point_mat, _cam_mat, _Aij, _Bij, data);
}
}
}
}
}
void LevMarqSparse::optimize(CvMat &_vis) { //main function that runs minimization
......@@ -1086,7 +1091,7 @@ void LevMarqSparse::bundleAdjust( vector<Point3d>& points, //positions of points
CvMat point_mat;
cvGetSubRect( levmar.P, &point_mat, cvRect( 0, levmar.num_cams * levmar.num_cam_param+ levmar.num_point_param * i, 1, levmar.num_point_param ));
CvScalar x = cvGet2D(&point_mat,0,0); CvScalar y = cvGet2D(&point_mat,1,0); CvScalar z = cvGet2D(&point_mat,2,0);
points.push_back(Point3f(x.val[0],y.val[0],z.val[0]));
points.push_back(Point3d(x.val[0],y.val[0],z.val[0]));
//std::cerr<<"point"<<points[points.size()-1].x<<","<<points[points.size()-1].y<<","<<points[points.size()-1].z<<std::endl;
}
//fill camera params
......
......@@ -47,7 +47,7 @@
#pragma warning( disable: 4251 4710 4711 4514 4996 )
#endif
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -235,7 +235,7 @@ static _Tp fromStringNumber(const std::string& str)//the default conversion func
}
template<>
bool CommandLineParser::get<bool>(const std::string& name, const bool& default_value)
bool CommandLineParser::get<bool>(const std::string& name, const bool& /*default_value*/)
{
if (!has(name))
return false;
......
......@@ -48,7 +48,7 @@
#pragma warning( disable: 4251 4711 4710 4514 )
#endif
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -2023,7 +2023,14 @@ void Core_GraphScanTest::run( int )
event = "End of procedure";
break;
default:
#if _MSC_VER >= 1200
#pragma warning( push )
#pragma warning( disable : 4127 )
#endif
CV_TS_SEQ_CHECK_CONDITION( 0, "Invalid code appeared during graph scan" );
#if _MSC_VER >= 1200
#pragma warning( pop )
#endif
}
ts->printf( cvtest::TS::LOG, "%s", event );
......
This diff is collapsed.
......@@ -47,7 +47,7 @@
#pragma warning( disable: 4251 4512 4710 4711 4514 4996 )
#endif
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -1111,7 +1111,7 @@ static double*** descr_hist( IplImage* img, int r, int c, double ori,
bins_per_rad = n / PI2;
exp_denom = d * d * 0.5;
hist_width = SIFT_DESCR_SCL_FCTR * scl;
radius = hist_width * sqrt(2.0) * ( d + 1.0 ) * 0.5 + 0.5;
radius = (int)(hist_width * sqrt(2.0) * ( d + 1.0 ) * 0.5 + 0.5);
for( i = -radius; i <= radius; i++ )
for( j = -radius; j <= radius; j++ )
{
......@@ -1191,7 +1191,7 @@ static void hist_to_descr( double*** hist, int d, int n, struct feature* feat )
/* convert floating-point descriptor to integer valued descriptor */
for( i = 0; i < k; i++ )
{
int_val = SIFT_INT_DESCR_FCTR * feat->descr[i];
int_val = (int)(SIFT_INT_DESCR_FCTR * feat->descr[i]);
feat->descr[i] = MIN( 255, int_val );
}
}
......@@ -1207,7 +1207,7 @@ static void hist_to_descr( double*** hist, int d, int n, struct feature* feat )
@return Returns 1 if feat1's scale is greater than feat2's, -1 if vice versa,
and 0 if their scales are equal
*/
static int feature_cmp( void* feat1, void* feat2, void* param )
static int feature_cmp( void* feat1, void* feat2, void* /*param*/ )
{
struct feature* f1 = (struct feature*) feat1;
struct feature* f2 = (struct feature*) feat2;
......@@ -1478,9 +1478,9 @@ struct SiftParams
inline KeyPoint featureToKeyPoint( const feature& feat )
{
float size = feat.scl * SIFT::DescriptorParams::GET_DEFAULT_MAGNIFICATION() * 4; // 4==NBP
float angle = feat.ori * a_180divPI;
return KeyPoint( feat.x, feat.y, size, angle, 0, feat.feature_data->octv, 0 );
float size = (float)(feat.scl * SIFT::DescriptorParams::GET_DEFAULT_MAGNIFICATION() * 4); // 4==NBP
float angle = (float)(feat.ori * a_180divPI);
return KeyPoint( (float)feat.x, (float)feat.y, size, angle, 0, feat.feature_data->octv, 0 );
}
static void fillFeatureData( feature& feat, const SiftParams& params )
......@@ -1551,7 +1551,7 @@ static void fillFeatureData( feature& feat, const SiftParams& params )
float s, phi;
phi = static_cast<float>(log( sigma / params.sigma0 ) / log(2.0));
o = std::floor( phi - (float(params.smin)+.5)/params.S );
o = (int)std::floor( phi - (float(params.smin)+.5)/params.S );
o = std::min(o, params.omin+params.O-1);
o = std::max(o, params.omin);
s = params.S * (phi - o);
......@@ -1640,7 +1640,7 @@ void SIFT::operator()(const Mat& image, const Mat& mask,
ImagePyrData pyrImages( &img, commParams.nOctaves, commParams.nOctaveLayers, SIFT_SIGMA, SIFT_IMG_DBL );
int feature_count = 0;
compute_features( &pyrImages, &features, feature_count, detectorParams.threshold, detectorParams.edgeThreshold );
compute_features( &pyrImages, &features, feature_count, detectorParams.threshold, (int)detectorParams.edgeThreshold );
// convert to KeyPoint structure
keypoints.resize( feature_count );
......
......@@ -1047,7 +1047,7 @@ TEST( Features2d_DescriptorExtractor_SURF, regression )
TEST( Features2d_DescriptorExtractor_ORB, regression )
{
// TODO adjust the parameters below
CV_DescriptorExtractorTest<Hamming> test( "descriptor-orb", 1.0f,
CV_DescriptorExtractorTest<Hamming> test( "descriptor-orb", (CV_DescriptorExtractorTest<Hamming>::DistanceType)1.0f,
DescriptorExtractor::create("ORB"), 0.010f );
test.safe_run();
}
......
......@@ -87,6 +87,8 @@ namespace cv
__CV_GPU_HOST_DEVICE__ T* ptr(int y = 0) { return (T*)( (char*)data + y * step ); }
__CV_GPU_HOST_DEVICE__ const T* ptr(int y = 0) const { return (const T*)( (const char*)data + y * step ); }
__CV_GPU_HOST_DEVICE__ operator T*() const { return data; }
#if defined(__DEVCLASES_ADD_THRUST_BEGIN_END__)
thrust::device_ptr<T> begin() const { return thrust::device_ptr<T>(data); }
thrust::device_ptr<T> end() const { return thrust::device_ptr<T>(data) + cols * rows; }
......
......@@ -1176,7 +1176,7 @@ namespace cv
/////////////////////////// DisparityBilateralFilter ///////////////////////////
// Disparity map refinement using joint bilateral filtering given a single color image.
// Qingxiong Yang, Liang Wang, Narendra Ahuja
// Qingxiong Yang, Liang Wang, Narendra Ahuja
// http://vision.ai.uiuc.edu/~qyang6/
class CV_EXPORTS DisparityBilateralFilter
......
......@@ -46,7 +46,7 @@
#pragma warning( disable: 4251 4710 4711 4514 4996 )
#endif
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -39,7 +39,7 @@
//
//M*/
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -244,10 +244,6 @@ set(lib_srcs ${highgui_srcs} ${grfmt_srcs})
# ----------------------------------------------------------------------------------
set(the_target "opencv_highgui")
if (BUILD_SHARED_LIBS)
add_definitions(-DHIGHGUI_EXPORTS -DCVAPI_EXPORTS)
endif()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}/../core/include"
"${CMAKE_CURRENT_SOURCE_DIR}/../imgproc/include"
......@@ -260,6 +256,15 @@ endif()
add_library(${the_target} ${lib_srcs} ${highgui_hdrs} ${grfmt_hdrs} ${highgui_ext_hdrs})
if (BUILD_SHARED_LIBS)
add_definitions(-DHIGHGUI_EXPORTS)
if(MSVC)
set_target_properties(${the_target} PROPERTIES DEFINE_SYMBOL CVAPI_EXPORTS)
else()
add_definitions(-DCVAPI_EXPORTS)
endif()
endif()
if(PCHSupport_FOUND AND USE_PRECOMPILED_HEADERS)
set(pch_header ${CMAKE_CURRENT_SOURCE_DIR}/src/precomp.hpp)
if(${CMAKE_GENERATOR} MATCHES "Visual*" OR ${CMAKE_GENERATOR} MATCHES "Xcode*")
......
......@@ -1469,7 +1469,7 @@ cvFindContours( void* img, CvMemStorage* storage,
return count;
}
void cv::findContours( const InputOutputArray _image, OutputArrayOfArrays _contours,
void cv::findContours( InputOutputArray _image, OutputArrayOfArrays _contours,
OutputArray _hierarchy, int mode, int method, Point offset )
{
Mat image = _image.getMat();
......
......@@ -48,7 +48,7 @@
#pragma warning( disable: 4251 4711 4710 4514 )
#endif
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -45,7 +45,7 @@
#pragma warning( disable: 4251 4710 4711 4514 4996 )
#endif
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -847,7 +847,7 @@ void CvEM::init_auto( const CvVectors& train_data )
void CvEM::kmeans( const CvVectors& train_data, int nclusters, CvMat* labels,
CvTermCriteria termcrit, const CvMat* centers0 )
CvTermCriteria termcrit, const CvMat* /*centers0*/ )
{
int i, nsamples = train_data.count, dims = train_data.dims;
cv::Ptr<CvMat> temp_mat = cvCreateMat(nsamples, dims, CV_32F);
......
......@@ -45,7 +45,7 @@
#pragma warning( disable: 4251 4514 4710 4711 4710 )
#endif
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -532,6 +532,8 @@ namespace
putText(image, code_text, code.corners[0], CV_FONT_HERSHEY_SIMPLEX, 0.8, c2, 1, CV_AA, false);
}
cv::Mat& image;
DrawDataMatrixCode& operator=(const DrawDataMatrixCode&);
};
}
......
......@@ -277,6 +277,8 @@ struct TrainImageQuantizer
// Result matrix
Mat* quantizedImage;
TrainImageQuantizer& operator=(const TrainImageQuantizer&);
};
static void quantizeToTrain( const Mat& _magnitudesExt, const Mat& _anglesExt, const Mat& maskExt,
......@@ -360,6 +362,8 @@ struct DetectImageQuantizer
// Result matrix
Mat* quantizedImage;
DetectImageQuantizer& operator=(const DetectImageQuantizer&);
};
static void quantizeToDetect( const Mat& _magnitudes, const Mat& angles,
......@@ -902,6 +906,8 @@ struct TemplateComparator
vector<ConcurrentRectVector>* concurrRectsPtr;
vector<ConcurrentFloatVector>* concurrRatiosPtr;
vector<ConcurrentIntVector>* concurrTemplateIndicesPtr;
TemplateComparator& operator=(const TemplateComparator&);
};
void DOTDetector::detectQuantized( const Mat& queryQuantizedImage, float minRatio,
......
......@@ -47,7 +47,7 @@
#pragma warning( disable: 4251 4710 4711 4514 4996 )
#endif
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -44,7 +44,7 @@
#include <string>
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -42,7 +42,7 @@
#ifndef __OPENCV_STITCHING_PRECOMP_H__
#define __OPENCV_STITCHING_PRECOMP_H__
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -1293,7 +1293,14 @@ void BackgroundSubtractorMOG2::operator()(InputArray _image, OutputArray _fgmask
void BackgroundSubtractorMOG2::getBackgroundImage(OutputArray backgroundImage) const
{
#if _MSC_VER >= 1200
#pragma warning( push )
#pragma warning( disable : 4127 )
#endif
CV_Assert(CV_BGFG_MOG2_NDMAX == 3);
#if _MSC_VER >= 1200
#pragma warning( pop )
#endif
Mat meanBackground(frameSize, CV_8UC3, Scalar::all(0));
int firstGaussianIdx = 0;
......
......@@ -47,7 +47,7 @@
#pragma warning( disable: 4251 4710 4711 4514 4996 )
#endif
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include "cvconfig.h"
#endif
......
......@@ -2,7 +2,7 @@
#include "opencv2/highgui/highgui.hpp"
#include <stdio.h>
#ifdef HAVE_CONFIG_H
#ifdef HAVE_CVCONFIG_H
#include <cvconfig.h>
#endif
#ifdef HAVE_TBB
......
......@@ -539,7 +539,7 @@ void DetectorQualityEvaluator::readAlgorithm ()
}
}
int update_progress( const string& name, int progress, int test_case_idx, int count, double dt )
int update_progress( const string& /*name*/, int progress, int test_case_idx, int count, double dt )
{
int width = 60 /*- (int)name.length()*/;
if( count > 0 )
......
......@@ -3,7 +3,7 @@
using namespace cv;
int main( int argc, char** argv )
int main( int /*argc*/, char** /*argv*/ )
{
const int N = 4;
const int N1 = (int)sqrt((double)N);
......
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