title: Assertion failed (image.type() == CV_32F). GPU convolution. OpenCV
body: <p>I got this error when I tried to use GPU for convolution.</p>
  
  <p><strong>OpenCV Error: Assertion failed (image.type() == CV_32F) in cv::gpu::convolve, file d:\opencv\sources\modules\gpu\src\imgproc.cpp, line 1413</strong></p>
  
  <p>I've converted the image type to CV_32 but I have this issue.
  I also have a similar issue when using gpu::filter2D.</p>
  
  <p>(I have no problem using Sobel or Gaussianblur in GPU.)</p>
  
  <p>However, when I do this in the main:</p>
  
  <p>int a=image.type();
  the value of a is 21. not CV_32F.</p>
  
  <p>Please let me know how to resolve this issue! I really need your help!! Thank you!!!</p>
  
  <pre><code>using namespace cv;
  using namespace std;
  
  int main()
  {
  
  
  // read kernel from text file
  int kernel_size=15;
  ifstream fin;
  fin.open ("PSF00.txt"); 
  
  float kernel0[15][15];
  for (int i=0; i&lt;kernel_size; i++)
  {
      for (int j=0; j&lt;kernel_size; j++)
      {
          fin &gt;&gt; kernel0[i][j];
      }
  }       
  
  // Save 2D Kernel array into MAT format
  Mat kernel = Mat(kernel_size, kernel_size, CV_32F, kernel0);    
  
  // load image
  Mat image = imread("blurry_00.jpg");        
  image.convertTo(image, CV_32F);         
  
  // GPU
  gpu::GpuMat gpu_input, gpu_input1, gpu_output, gpu_kernel;
  
  gpu_input.upload(image);
  gpu_kernel.upload(kernel);
  
  gpu_input.convertTo(gpu_input1, CV_32F);    
  
  gpu::convolve(gpu_input1, gpu_kernel, gpu_output);  
  
  // Download image from GPU to CPU
  Mat dst(gpu_output);                
  dst.convertTo(dst, CV_8U);
  
  // Create a window for display.
  namedWindow( "Display window (GPU)", WINDOW_AUTOSIZE );
  imshow( "Display window (GPU)", dst );
  
  waitKey(0);
  return 0;
  </code></pre>