Fix x64 build warnings
This commit is contained in:
parent
2a6fb2867e
commit
d586f4a103
@ -869,7 +869,7 @@ int calcDiffElemCountImpl(const vector<Mat>& mv, const Mat& m)
|
||||
for(int x = 0; x < m.cols; x++)
|
||||
{
|
||||
const ElemType* mElem = &m.at<ElemType>(y,x*mChannels);
|
||||
int loc = 0;
|
||||
size_t loc = 0;
|
||||
for(size_t i = 0; i < mv.size(); i++)
|
||||
{
|
||||
const size_t mvChannel = mv[i].channels();
|
||||
@ -879,7 +879,7 @@ int calcDiffElemCountImpl(const vector<Mat>& mv, const Mat& m)
|
||||
diffElemCount++;
|
||||
loc += mvChannel;
|
||||
}
|
||||
CV_Assert(loc == mChannels);
|
||||
CV_Assert(loc == (size_t)mChannels);
|
||||
}
|
||||
}
|
||||
return diffElemCount;
|
||||
|
@ -1306,7 +1306,7 @@ public:
|
||||
int dcn = dst.channels();
|
||||
int dcn2 = dcn<<1;
|
||||
int start_with_green = Start_with_green, blue = Blue;
|
||||
int sstep = src.step / src.elemSize1(), dstep = dst.step / dst.elemSize1();
|
||||
int sstep = int(src.step / src.elemSize1()), dstep = int(dst.step / dst.elemSize1());
|
||||
SIMDInterpolator vecOp;
|
||||
|
||||
const T* S = reinterpret_cast<const T*>(src.data + (range.start + 1) * src.step) + 1;
|
||||
@ -1415,7 +1415,7 @@ static void Bayer2RGB_EdgeAware_T(const Mat& src, Mat& dst, int code)
|
||||
}
|
||||
size = dst.size();
|
||||
size.width *= dst.channels();
|
||||
int dstep = dst.step / dst.elemSize1();
|
||||
size_t dstep = dst.step / dst.elemSize1();
|
||||
T* firstRow = reinterpret_cast<T*>(dst.data);
|
||||
T* lastRow = reinterpret_cast<T*>(dst.data) + (size.height-1) * dstep;
|
||||
|
||||
@ -1423,8 +1423,8 @@ static void Bayer2RGB_EdgeAware_T(const Mat& src, Mat& dst, int code)
|
||||
{
|
||||
for (int x = 0; x < size.width; ++x)
|
||||
{
|
||||
firstRow[x] = firstRow[dstep+x];
|
||||
lastRow[x] = lastRow[-dstep+x];
|
||||
firstRow[x] = (firstRow+dstep)[x];
|
||||
lastRow[x] = (lastRow-dstep)[x];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -505,14 +505,15 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask,
|
||||
|
||||
if( is_simple )
|
||||
{
|
||||
int elem_size = img.elemSize();
|
||||
size_t elem_size = img.elemSize();
|
||||
const uchar* seed_ptr = img.data + img.step*seedPoint.y + elem_size*seedPoint.x;
|
||||
|
||||
for(i = 0; i < elem_size; i++)
|
||||
if (seed_ptr[i] != nv_buf.b[i])
|
||||
size_t k = 0;
|
||||
for(; k < elem_size; k++)
|
||||
if (seed_ptr[k] != nv_buf.b[k])
|
||||
break;
|
||||
|
||||
if( i != elem_size )
|
||||
if( k != elem_size )
|
||||
{
|
||||
if( type == CV_8UC1 )
|
||||
floodFill_CnIR(img, seedPoint, nv_buf.b[0], &comp, flags, &buffer);
|
||||
|
@ -46,7 +46,7 @@ namespace cv
|
||||
{
|
||||
|
||||
static const uchar*
|
||||
adjustRect( const uchar* src, int src_step, int pix_size,
|
||||
adjustRect( const uchar* src, size_t src_step, int pix_size,
|
||||
Size src_size, Size win_size,
|
||||
Point ip, Rect* pRect )
|
||||
{
|
||||
@ -127,8 +127,8 @@ struct nop
|
||||
|
||||
|
||||
template<typename _Tp, typename _DTp, typename _WTp, class ScaleOp, class CastOp>
|
||||
void getRectSubPix_Cn_(const _Tp* src, int src_step, Size src_size,
|
||||
_DTp* dst, int dst_step, Size win_size, Point2f center, int cn )
|
||||
void getRectSubPix_Cn_(const _Tp* src, size_t src_step, Size src_size,
|
||||
_DTp* dst, size_t dst_step, Size win_size, Point2f center, int cn )
|
||||
{
|
||||
ScaleOp scale_op;
|
||||
CastOp cast_op;
|
||||
@ -217,8 +217,8 @@ void getRectSubPix_Cn_(const _Tp* src, int src_step, Size src_size,
|
||||
|
||||
|
||||
static void getRectSubPix_8u32f
|
||||
( const uchar* src, int src_step, Size src_size,
|
||||
float* dst, int dst_step, Size win_size, Point2f center0, int cn )
|
||||
( const uchar* src, size_t src_step, Size src_size,
|
||||
float* dst, size_t dst_step, Size win_size, Point2f center0, int cn )
|
||||
{
|
||||
Point2f center = center0;
|
||||
Point ip;
|
||||
@ -269,8 +269,8 @@ static void getRectSubPix_8u32f
|
||||
|
||||
|
||||
static void
|
||||
getQuadrangleSubPix_8u32f_CnR( const uchar* src, int src_step, Size src_size,
|
||||
float* dst, int dst_step, Size win_size,
|
||||
getQuadrangleSubPix_8u32f_CnR( const uchar* src, size_t src_step, Size src_size,
|
||||
float* dst, size_t dst_step, Size win_size,
|
||||
const double *matrix, int cn )
|
||||
{
|
||||
int x, y, k;
|
||||
|
@ -148,9 +148,9 @@ void cv::watershed( InputArray _src, InputOutputArray _markers )
|
||||
CV_Assert( src.size() == dst.size() );
|
||||
|
||||
const uchar* img = src.data;
|
||||
int istep = src.step/sizeof(img[0]);
|
||||
int istep = int(src.step/sizeof(img[0]));
|
||||
int* mask = dst.ptr<int>();
|
||||
int mstep = dst.step / sizeof(mask[0]);
|
||||
int mstep = int(dst.step / sizeof(mask[0]));
|
||||
|
||||
for( i = 0; i < 256; i++ )
|
||||
subs_tab[i] = 0;
|
||||
|
@ -1,2 +1,3 @@
|
||||
set(the_description "Soft Cascade detection and training")
|
||||
ocv_define_module(softcascade opencv_core opencv_imgproc opencv_ml)
|
||||
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4310)
|
@ -52,6 +52,7 @@ namespace cv { namespace softcascade { namespace internal
|
||||
struct Random
|
||||
{
|
||||
typedef std::mt19937 engine;
|
||||
typedef engine::result_type seed_type;
|
||||
typedef std::uniform_int<int> uniform;
|
||||
};
|
||||
|
||||
@ -67,6 +68,7 @@ namespace cv { namespace softcascade { namespace internal
|
||||
struct Random
|
||||
{
|
||||
typedef std::mt19937 engine;
|
||||
typedef engine::result_type seed_type;
|
||||
// True if we're using C++11.
|
||||
#if __cplusplus >= 201103L
|
||||
// C++11 removes uniform_int.
|
||||
@ -86,6 +88,7 @@ namespace cv { namespace softcascade { namespace internal
|
||||
struct Random
|
||||
{
|
||||
typedef std::tr1::mt19937 engine;
|
||||
typedef engine::result_type seed_type;
|
||||
typedef std::tr1::uniform_int<int> uniform;
|
||||
};
|
||||
|
||||
@ -125,6 +128,7 @@ private:
|
||||
struct Random
|
||||
{
|
||||
typedef rnd::engine engine;
|
||||
typedef uint64 seed_type;
|
||||
typedef rnd::uniform_int<int> uniform;
|
||||
};
|
||||
|
||||
|
@ -217,7 +217,7 @@ void ChannelFeaturePool::fill(int desired)
|
||||
int nfeatures = std::min(desired, maxPoolSize);
|
||||
pool.reserve(nfeatures);
|
||||
|
||||
Random::engine eng(FEATURE_RECT_SEED);
|
||||
Random::engine eng((Random::seed_type)FEATURE_RECT_SEED);
|
||||
Random::engine eng_ch(DCHANNELS_SEED);
|
||||
|
||||
Random::uniform chRand(0, N_CHANNELS - 1);
|
||||
|
@ -116,7 +116,7 @@ BoostedSoftCascadeOctave::BoostedSoftCascadeOctave(cv::Rect bb, int np, int nn,
|
||||
_params.truncate_pruned_tree = false;
|
||||
_params.use_surrogates = false;
|
||||
_params.use_1se_rule = false;
|
||||
_params.regression_accuracy = 1.0e-6;
|
||||
_params.regression_accuracy = 1.0e-6f;
|
||||
|
||||
// boost params
|
||||
_params.boost_type = CvBoost::GENTLE;
|
||||
@ -221,7 +221,7 @@ void BoostedSoftCascadeOctave::generateNegatives(const Dataset* dataset)
|
||||
using namespace cv::softcascade::internal;
|
||||
// ToDo: set seed, use offsets
|
||||
Random::engine eng(DX_DY_SEED);
|
||||
Random::engine idxEng(INDEX_ENGINE_SEED);
|
||||
Random::engine idxEng((Random::seed_type)INDEX_ENGINE_SEED);
|
||||
|
||||
int h = boundingBox.height;
|
||||
|
||||
|
@ -180,7 +180,7 @@ struct ChannelStorage
|
||||
cv::Mat hog;
|
||||
int shrinkage;
|
||||
int offset;
|
||||
int step;
|
||||
size_t step;
|
||||
int model_height;
|
||||
|
||||
cv::Ptr<ChannelFeatureBuilder> builder;
|
||||
@ -398,7 +398,7 @@ struct Detector::Fields
|
||||
fns = (*st)[SC_INTERNAL];
|
||||
FileNodeIterator inIt = fns.begin(), inIt_end = fns.end();
|
||||
for (; inIt != inIt_end;)
|
||||
nodes.push_back(Node(features.size(), inIt));
|
||||
nodes.push_back(Node((int)features.size(), inIt));
|
||||
|
||||
fns = (*st)[SC_LEAF];
|
||||
inIt = fns.begin(), inIt_end = fns.end();
|
||||
@ -504,7 +504,7 @@ void Detector::detectNoRoi(const cv::Mat& image, std::vector<Detection>& objects
|
||||
{
|
||||
for (int dx = 0; dx < level.workRect.width; ++dx)
|
||||
{
|
||||
storage.offset = dy * storage.step + dx;
|
||||
storage.offset = (int)(dy * storage.step + dx);
|
||||
fld.detectAt(dx, dy, level, storage, objects);
|
||||
}
|
||||
}
|
||||
@ -555,7 +555,7 @@ void Detector::detect(cv::InputArray _image, cv::InputArray _rois, std::vector<D
|
||||
{
|
||||
if (m[dx])
|
||||
{
|
||||
storage.offset = dy * storage.step + dx;
|
||||
storage.offset = (int)(dy * storage.step + dx);
|
||||
fld.detectAt(dx, dy, level, storage, objects);
|
||||
}
|
||||
}
|
||||
@ -570,11 +570,11 @@ void Detector::detect(InputArray _image, InputArray _rois, OutputArray _rects,
|
||||
std::vector<Detection> objects;
|
||||
detect( _image, _rois, objects);
|
||||
|
||||
_rects.create(1, objects.size(), CV_32SC4);
|
||||
_rects.create(1, (int)objects.size(), CV_32SC4);
|
||||
cv::Mat_<cv::Rect> rects = (cv::Mat_<cv::Rect>)_rects.getMat();
|
||||
cv::Rect* rectPtr = rects.ptr<cv::Rect>(0);
|
||||
|
||||
_confs.create(1, objects.size(), CV_32F);
|
||||
_confs.create(1, (int)objects.size(), CV_32F);
|
||||
cv::Mat confs = _confs.getMat();
|
||||
float* confPtr = confs.ptr<float>(0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user