Merge commit '0566ab4d3d' into merge-2.4
Conflicts: modules/core/src/system.cpp
This commit is contained in:
commit
1312eca220
@ -107,7 +107,7 @@ std::wstring GetTempPathWinRT()
|
|||||||
if (FAILED(WindowsCreateStringReference(RuntimeClass_Windows_Storage_ApplicationData,
|
if (FAILED(WindowsCreateStringReference(RuntimeClass_Windows_Storage_ApplicationData,
|
||||||
(UINT32)wcslen(RuntimeClass_Windows_Storage_ApplicationData), &hstrHead, &str)))
|
(UINT32)wcslen(RuntimeClass_Windows_Storage_ApplicationData), &hstrHead, &str)))
|
||||||
return wstr;
|
return wstr;
|
||||||
if (FAILED(Windows::Foundation::GetActivationFactory(str, appdataFactory.ReleaseAndGetAddressOf())))
|
if (FAILED(RoGetActivationFactory(str, IID_PPV_ARGS(appdataFactory.ReleaseAndGetAddressOf()))))
|
||||||
return wstr;
|
return wstr;
|
||||||
if (FAILED(appdataFactory->get_Current(appdataRef.ReleaseAndGetAddressOf())))
|
if (FAILED(appdataFactory->get_Current(appdataRef.ReleaseAndGetAddressOf())))
|
||||||
return wstr;
|
return wstr;
|
||||||
|
@ -208,7 +208,7 @@ void cv::ocl::GoodFeaturesToTrackDetector_OCL::operator ()(const oclMat& image,
|
|||||||
if(!use_cpu_sorter)
|
if(!use_cpu_sorter)
|
||||||
{ // round to 2^n
|
{ // round to 2^n
|
||||||
unsigned int n=1;
|
unsigned int n=1;
|
||||||
for(n=1;n<(unsigned int)corner_array_size;n<<=1);
|
for(n=1;n<(unsigned int)corner_array_size;n<<=1) ;
|
||||||
corner_array_size = (int)n;
|
corner_array_size = (int)n;
|
||||||
|
|
||||||
ensureSizeIsEnough(1, corner_array_size , CV_32FC2, tmpCorners_);
|
ensureSizeIsEnough(1, corner_array_size , CV_32FC2, tmpCorners_);
|
||||||
|
@ -381,8 +381,8 @@ struct PtrStepSz {
|
|||||||
int step;
|
int step;
|
||||||
int rows, cols;
|
int rows, cols;
|
||||||
};
|
};
|
||||||
inline int get(struct PtrStepSz data, int y, int x) { return *((__global int *)((__global char*)data.ptr + data.step * y + sizeof(int) * x)); }
|
inline int get(struct PtrStepSz data, int y, int x) { return *((__global int *)((__global char*)data.ptr + data.step * (y + 1) + sizeof(int) * (x + 1))); }
|
||||||
inline void set(struct PtrStepSz data, int y, int x, int value) { *((__global int *)((__global char*)data.ptr + data.step * y + sizeof(int) * x)) = value; }
|
inline void set(struct PtrStepSz data, int y, int x, int value) { *((__global int *)((__global char*)data.ptr + data.step * (y + 1) + sizeof(int) * (x + 1))) = value; }
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// do Hysteresis for pixel whose edge type is 1
|
// do Hysteresis for pixel whose edge type is 1
|
||||||
@ -494,7 +494,7 @@ edgesHysteresisLocal
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
struct PtrStepSz map = {((__global int *)((__global char*)map_ptr + map_offset)), map_step, rows, cols};
|
struct PtrStepSz map = {((__global int *)((__global char*)map_ptr + map_offset)), map_step, rows + 1, cols + 1};
|
||||||
|
|
||||||
__local int smem[18][18];
|
__local int smem[18][18];
|
||||||
|
|
||||||
@ -507,13 +507,13 @@ edgesHysteresisLocal
|
|||||||
|
|
||||||
smem[threadIdx.y + 1][threadIdx.x + 1] = x < map.cols && y < map.rows ? get(map, y, x) : 0;
|
smem[threadIdx.y + 1][threadIdx.x + 1] = x < map.cols && y < map.rows ? get(map, y, x) : 0;
|
||||||
if (threadIdx.y == 0)
|
if (threadIdx.y == 0)
|
||||||
smem[0][threadIdx.x + 1] = y > 0 ? get(map, y - 1, x) : 0;
|
smem[0][threadIdx.x + 1] = x < map.cols ? get(map, y - 1, x) : 0;
|
||||||
if (threadIdx.y == blockDim.y - 1)
|
if (threadIdx.y == blockDim.y - 1)
|
||||||
smem[blockDim.y + 1][threadIdx.x + 1] = y + 1 < map.rows ? get(map, y + 1, x) : 0;
|
smem[blockDim.y + 1][threadIdx.x + 1] = y + 1 < map.rows ? get(map, y + 1, x) : 0;
|
||||||
if (threadIdx.x == 0)
|
if (threadIdx.x == 0)
|
||||||
smem[threadIdx.y + 1][0] = x > 0 ? get(map, y, x - 1) : 0;
|
smem[threadIdx.y + 1][0] = y < map.rows ? get(map, y, x - 1) : 0;
|
||||||
if (threadIdx.x == blockDim.x - 1)
|
if (threadIdx.x == blockDim.x - 1)
|
||||||
smem[threadIdx.y + 1][blockDim.x + 1] = x + 1 < map.cols ? get(map, y, x + 1) : 0;
|
smem[threadIdx.y + 1][blockDim.x + 1] = x + 1 < map.cols && y < map.rows ? get(map, y, x + 1) : 0;
|
||||||
if (threadIdx.x == 0 && threadIdx.y == 0)
|
if (threadIdx.x == 0 && threadIdx.y == 0)
|
||||||
smem[0][0] = y > 0 && x > 0 ? get(map, y - 1, x - 1) : 0;
|
smem[0][0] = y > 0 && x > 0 ? get(map, y - 1, x - 1) : 0;
|
||||||
if (threadIdx.x == blockDim.x - 1 && threadIdx.y == 0)
|
if (threadIdx.x == blockDim.x - 1 && threadIdx.y == 0)
|
||||||
@ -525,7 +525,7 @@ edgesHysteresisLocal
|
|||||||
|
|
||||||
barrier(CLK_LOCAL_MEM_FENCE);
|
barrier(CLK_LOCAL_MEM_FENCE);
|
||||||
|
|
||||||
if (x >= map.cols || y >= map.rows)
|
if (x >= cols || y >= rows)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int n;
|
int n;
|
||||||
@ -576,7 +576,7 @@ edgesHysteresisLocal
|
|||||||
if (n > 0)
|
if (n > 0)
|
||||||
{
|
{
|
||||||
const int ind = atomic_inc(counter);
|
const int ind = atomic_inc(counter);
|
||||||
st[ind] = (ushort2)(x, y);
|
st[ind] = (ushort2)(x + 1, y + 1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user