mirror of
https://github.com/opencv/opencv.git
synced 2024-11-30 06:10:02 +08:00
fixed build under windows
This commit is contained in:
parent
2e0161c6c5
commit
2eebd8d939
@ -88,11 +88,11 @@ struct __align__(8) Node
|
|||||||
{
|
{
|
||||||
uchar4 rect;
|
uchar4 rect;
|
||||||
// ushort channel;
|
// ushort channel;
|
||||||
uint threshold;
|
unsigned int threshold;
|
||||||
|
|
||||||
enum { THRESHOLD_MASK = 0x0FFFFFFF };
|
enum { THRESHOLD_MASK = 0x0FFFFFFF };
|
||||||
|
|
||||||
Node(const uchar4 r, const uint ch, const uint t) : rect(r), threshold(t + (ch << 28)) {}
|
Node(const uchar4 r, const unsigned int ch, const unsigned int t) : rect(r), threshold(t + (ch << 28)) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct __align__(16) Detection
|
struct __align__(16) Detection
|
||||||
@ -144,7 +144,7 @@ struct CascadeInvoker
|
|||||||
const int downscales, const cudaStream_t& stream = 0) const;
|
const int downscales, const cudaStream_t& stream = 0) const;
|
||||||
|
|
||||||
template<bool isUp>
|
template<bool isUp>
|
||||||
__device void detect(Detection* objects, const uint ndetections, uint* ctr, const int downscales) const;
|
__device void detect(Detection* objects, const unsigned int ndetections, unsigned int* ctr, const int downscales) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -64,8 +64,8 @@ void cv::gpu::SCascade::read(const FileNode& fn) { Algorithm::read(fn); }
|
|||||||
cv::gpu::device::icf::Level::Level(int idx, const Octave& oct, const float scale, const int w, const int h)
|
cv::gpu::device::icf::Level::Level(int idx, const Octave& oct, const float scale, const int w, const int h)
|
||||||
: octave(idx), step(oct.stages), relScale(scale / oct.scale)
|
: octave(idx), step(oct.stages), relScale(scale / oct.scale)
|
||||||
{
|
{
|
||||||
workRect.x = round(w / (float)oct.shrinkage);
|
workRect.x = cvRound(w / (float)oct.shrinkage);
|
||||||
workRect.y = round(h / (float)oct.shrinkage);
|
workRect.y = cvRound(h / (float)oct.shrinkage);
|
||||||
|
|
||||||
objSize.x = cv::saturate_cast<uchar>(oct.size.x * relScale);
|
objSize.x = cv::saturate_cast<uchar>(oct.size.x * relScale);
|
||||||
objSize.y = cv::saturate_cast<uchar>(oct.size.y * relScale);
|
objSize.y = cv::saturate_cast<uchar>(oct.size.y * relScale);
|
||||||
@ -75,7 +75,7 @@ cv::gpu::device::icf::Level::Level(int idx, const Octave& oct, const float scale
|
|||||||
scaling[0] = scaling[1] = 1.f;
|
scaling[0] = scaling[1] = 1.f;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
scaling[0] = (relScale < 1.f) ? 0.89f * ::pow(relScale, 1.099f / ::log(2)) : 1.f;
|
scaling[0] = (relScale < 1.f) ? 0.89f * ::pow(relScale, 1.099f / ::log(2.0f)) : 1.f;
|
||||||
scaling[1] = relScale * relScale;
|
scaling[1] = relScale * relScale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -199,7 +199,7 @@ struct cv::gpu::SCascade::Fields
|
|||||||
// int feature = (int)(*(inIt +=2)) + feature_offset;
|
// int feature = (int)(*(inIt +=2)) + feature_offset;
|
||||||
inIt +=3;
|
inIt +=3;
|
||||||
// extract feature, Todo:check it
|
// extract feature, Todo:check it
|
||||||
uint th = saturate_cast<uint>((float)(*(inIt++)));
|
unsigned int th = saturate_cast<unsigned int>((float)(*(inIt++)));
|
||||||
cv::FileNode ftn = (*ftrs)[SC_F_RECT];
|
cv::FileNode ftn = (*ftrs)[SC_F_RECT];
|
||||||
cv::FileNodeIterator r_it = ftn.begin();
|
cv::FileNodeIterator r_it = ftn.begin();
|
||||||
uchar4 rect;
|
uchar4 rect;
|
||||||
@ -214,7 +214,7 @@ struct cv::gpu::SCascade::Fields
|
|||||||
rect.w -= rect.y;
|
rect.w -= rect.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint channel = saturate_cast<uint>((int)(*ftrs)[SC_F_CHANNEL]);
|
unsigned int channel = saturate_cast<unsigned int>((int)(*ftrs)[SC_F_CHANNEL]);
|
||||||
vnodes.push_back(Node(rect, channel, th));
|
vnodes.push_back(Node(rect, channel, th));
|
||||||
++ftrs;
|
++ftrs;
|
||||||
}
|
}
|
||||||
@ -426,7 +426,7 @@ private:
|
|||||||
GpuMat nmag(fplane, cv::Rect(0, 4 * fh, fw, fh));
|
GpuMat nmag(fplane, cv::Rect(0, 4 * fh, fw, fh));
|
||||||
GpuMat nang(fplane, cv::Rect(0, 5 * fh, fw, fh));
|
GpuMat nang(fplane, cv::Rect(0, 5 * fh, fw, fh));
|
||||||
|
|
||||||
cv::gpu::multiply(mag, cv::Scalar::all(1.f / (8 *::log(2))), nmag, 1, -1, s);
|
cv::gpu::multiply(mag, cv::Scalar::all(1.f / (8 *::log(2.0f))), nmag, 1, -1, s);
|
||||||
cv::gpu::multiply(ang, cv::Scalar::all(1.f / 60.f), nang, 1, -1, s);
|
cv::gpu::multiply(ang, cv::Scalar::all(1.f / 60.f), nang, 1, -1, s);
|
||||||
|
|
||||||
//create uchar magnitude
|
//create uchar magnitude
|
||||||
|
Loading…
Reference in New Issue
Block a user