Merge pull request #921 from SpecLad:merge-2.4

This commit is contained in:
Roman Donchenko 2013-05-29 16:24:49 +04:00 committed by OpenCV Buildbot
commit d81d3fc830
6 changed files with 43 additions and 18 deletions

View File

@ -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 {
/**

View File

@ -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;

View File

@ -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<>

View File

@ -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);

View File

@ -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);
}

View File

@ -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"