title: OpenCV/OpenCL on Android shows weird behaviour when imwrite()
body: <p>I'm trying to read an image, convert it to uMat and process it. I do the same with and without the new T-API in OpenCV 3.0. I was able to build the libraries and the logcats say that OpenCL works. When comparing the output CPU/GPU, it differs. Laplacian in CPU looks as expected, the same "algorithm" in OCL/uMat way is mostly black, only a few features are available. Is this a problem due to memory shifting from GPU to Java? </p>
  
  <p>CPU-Code:</p>
  
  <pre><code>ocl::setUseOpenCL(false);
  Mat cpuFrame;
  String path = "/storage/emulated/0/DCIM/100ANDRO/";
  String filename = "DSC_0581.JPG";
  String filename_result = "DSC_0581_cpu_processed.JPG";
  
  Mat cpuBW;
  Mat cpuBlur;
  Mat cpuEdges;
  
  cpuFrame = imread(path+filename);
  startTimer=clock();
  cvtColor(cpuFrame, cpuBW, COLOR_BGR2GRAY);
  GaussianBlur(cpuBW, cpuBlur, Size(1, 1), 1.5, 1.5);
  Canny(cpuBlur, cpuEdges, 0, 30, 3);
  stopTimer = clock();
  imwrite(path+filename_result, cpuEdges);
  </code></pre>
  
  <p>GPU-Code:</p>
  
  <pre><code>cv::ocl::setUseOpenCL(true);
      Mat mat = cv::imread(path+filename);
      UMat gpuFrame = mat.getUMat(cv::ACCESS_READ);
  
      if (mat.empty()) {
          LOGD("Image Empty");
      }
      cvtColor(gpuFrame, gpuBW, COLOR_BGR2GRAY);
      cv::Laplacian(gpuBW, gpuBW, CV_8U);
      cv:multiply(gpuBW, 10, gpuBW);
      imwrite(path+filename_result+".png", gpuBW, compression_params);
      cv::ocl::finish();
  
      normalize(gpuBW, gpuBW, 0, 255, NORM_MINMAX, -1);
  
      imwrite(path+"resultNormalize.jpg", gpuBW, compression_params);
  </code></pre>
  
  <p>Any ideas? </p>