1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-15 20:37:07 +08:00

fix warnings

This commit is contained in:
Tomoaki Teshima
2023-01-13 22:43:20 +09:00
parent e247b680a6
commit f48a261d8b
2 changed files with 15 additions and 11 deletions

View File

@@ -250,9 +250,9 @@ namespace cv { namespace cudev {
{
}
__host__ TextureOff(PtrStepSz<T> src, const int yoff = 0, const int xoff = 0, const bool normalizedCoords = false, const cudaTextureFilterMode filterMode = cudaFilterModePoint,
__host__ TextureOff(PtrStepSz<T> src, const int yoff_ = 0, const int xoff_ = 0, const bool normalizedCoords = false, const cudaTextureFilterMode filterMode = cudaFilterModePoint,
const cudaTextureAddressMode addressMode = cudaAddressModeClamp, const cudaTextureReadMode readMode = cudaReadModeElementType) :
TextureOff(src.rows, src.cols, src.data, src.step, yoff, xoff, normalizedCoords, filterMode, addressMode, readMode)
TextureOff(src.rows, src.cols, src.data, src.step, yoff_, xoff_, normalizedCoords, filterMode, addressMode, readMode)
{
}

View File

@@ -233,17 +233,21 @@ namespace cv { namespace cuda { namespace device
__host__ Mask(cudev::TexturePtr<unsigned int> tex_): tex(tex_) {};
__device__ bool check(int sum_i, int sum_j, int size)
{
if (!useMask) return true;
float ratio = (float)size / 9.0f;
int dx1 = 0;
int dy1 = 0;
int dx2 = 0;
int dy2 = 0;
float ratio = 0;
float d = 0;
int dx1 = __float2int_rn(ratio * c_DM[0]);
int dy1 = __float2int_rn(ratio * c_DM[1]);
int dx2 = __float2int_rn(ratio * c_DM[2]);
int dy2 = __float2int_rn(ratio * c_DM[3]);
float t = 0;
if (!useMask) return true;
ratio = (float)size / 9.0f;
dx1 = __float2int_rn(ratio * c_DM[0]);
dy1 = __float2int_rn(ratio * c_DM[1]);
dx2 = __float2int_rn(ratio * c_DM[2]);
dy2 = __float2int_rn(ratio * c_DM[3]);
t += tex(sum_i + dy1, sum_j + dx1);
t -= tex(sum_i + dy2, sum_j + dx1);
t -= tex(sum_i + dy1, sum_j + dx2);