提交 5ac3b8d5 编写于 作者: R Roman Donchenko

Merge remote-tracking branch 'origin/2.4' into merge-2.4

Pull requests:
	#904 from ograycode:2.4
	#905 from bitwangyaoyao:2.4_TVL1
	#902 from apavlenko:fix_run_py
	#882 from pengx17:2.4_rewrite_query_info

Conflicts:
	modules/nonfree/src/surf.ocl.cpp
	modules/ocl/include/opencv2/ocl/private/util.hpp
	modules/ocl/src/hog.cpp
	modules/ocl/src/pyrlk.cpp
	modules/ocl/src/tvl1flow.cpp
......@@ -80,6 +80,14 @@ public abstract class CameraBridgeViewBase extends SurfaceView implements Surfac
mMaxHeight = MAX_UNSPECIFIED;
styledAttrs.recycle();
}
/**
* Sets the camera index
* @param camera index
*/
public void setCameraIndex(int cameraIndex) {
this.mCameraIndex = cameraIndex;
}
public interface CvCameraViewListener {
/**
......
......@@ -156,22 +156,12 @@ public:
counters.setTo(Scalar::all(0));
integral(img, surf_.sum);
if(support_image2d())
use_image2d = support_image2d();
if(use_image2d)
{
try
{
bindImgTex(img, imgTex);
bindImgTex(surf_.sum, sumTex);
use_image2d = true;
}
catch (const cv::Exception& e)
{
use_image2d = false;
if(e.code != CL_IMAGE_FORMAT_NOT_SUPPORTED && e.code != -217)
{
throw e;
}
}
bindImgTex(img, imgTex);
bindImgTex(surf_.sum, sumTex);
finish();
}
maskSumTex = 0;
......
......@@ -127,11 +127,18 @@ namespace cv
// the enums are used to query device information
enum DEVICE_INFO
{
WAVEFRONT_SIZE,
IS_CPU_DEVICE
WAVEFRONT_SIZE, //in AMD speak
IS_CPU_DEVICE //check if the device is CPU
};
template<DEVICE_INFO _it, typename _ty>
_ty queryDeviceInfo(cl_kernel kernel = NULL);
//info should have been pre-allocated
template<>
int CV_EXPORTS queryDeviceInfo<WAVEFRONT_SIZE, int>(cl_kernel kernel);
template<>
size_t CV_EXPORTS queryDeviceInfo<WAVEFRONT_SIZE, size_t>(cl_kernel kernel);
template<>
bool CV_EXPORTS queryDeviceInfo<IS_CPU_DEVICE, bool>(cl_kernel kernel);
//only these three specializations are implemented at the moment
template<>
......
......@@ -277,9 +277,15 @@ __kernel void arithm_mul_D6 (__global double *src1, int src1_step, int src1_offs
}
#endif
#ifdef DOUBLE_SUPPORT
#define SCALAR_TYPE double
#else
#define SCALAR_TYPE float
#endif
__kernel void arithm_muls_D5 (__global float *src1, int src1_step, int src1_offset,
__global float *dst, int dst_step, int dst_offset,
int rows, int cols, int dst_step1, float scalar)
int rows, int cols, int dst_step1, SCALAR_TYPE scalar)
{
int x = get_global_id(0);
int y = get_global_id(1);
......
......@@ -472,4 +472,8 @@ void ocl_tvl1flow::warpBackward(const oclMat &I0, const oclMat &I1, oclMat &I1x,
args.push_back( make_pair( sizeof(cl_int), (void*)&u2_offset_y));
openCLExecuteKernel(clCxt, &tvl1flow, kernelName, globalThread, localThread, args, -1, -1);
releaseTexture(I1_tex);
releaseTexture(I1x_tex);
releaseTexture(I1y_tex);
}
......@@ -288,6 +288,16 @@ class TestSuite(object):
if self.adb:
# construct name for aapt tool
self.aapt = [os.path.join(os.path.dirname(self.adb[0]), ("aapt","aapt.exe")[hostos == 'nt'])]
if not os.path.isfile(self.aapt[0]):
# it's moved in SDK r22
sdk_dir = os.path.dirname( os.path.dirname(self.adb[0]) )
aapt_fn = ("aapt", "aapt.exe")[hostos == 'nt']
for r, ds, fs in os.walk( os.path.join(sdk_dir, 'build-tools') ):
if aapt_fn in fs:
self.aapt = [ os.path.join(r, aapt_fn) ]
break
else:
self.error = "Can't find '%s' tool!" % aapt_fn
# fix has_perf_tests param
self.has_perf_tests = self.has_perf_tests == "ON"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册