title: Error when applying OpenCV SURF to HSV color space in python
body: <p>I am implementening <a href="https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_feature2d/py_surf_intro/py_surf_intro.html" rel="nofollow noreferrer">SURF</a> to HSV image, but It is not working.
  And when I am doing same to RGB image, It works fine.</p>
  
  <pre><code>from PIL import Image
  import cv2
  import numpy as np
  import matplotlib
  import matplotlib.pyplot as plt
  
  #loaading image
  rgb_img_arr= np.array(Image.open("myImage.jpg"))
  hsv_image_arr=matplotlib.colors.rgb_to_hsv(rgb_img_arr)
  
  surf = cv2.xfeatures2d.SURF_create()
  
  #it works fine
  keypoints, descriptors = surf.detectAndCompute(rgb_img_arr, None)
  rgb_img = cv2.drawKeypoints(rgb_img_arr, keypoints, None)
  plt.imshow(rgb_img )
  
  #But it doent work
  keypoints, descriptors = surf.detectAndCompute(hsv_image_arr, None)
  hsv_img = cv2.drawKeypoints(hsv_image_arr, keypoints, None)
  plt.imshow(hsv_img )
  </code></pre>
  
  <p>Error I am getting is - </p>
  
  <blockquote>
    <p>C:\projects\opencv-python\opencv_contrib\modules\xfeatures2d\src\surf.cpp:892: error: (-215) !_img.empty() &amp;&amp; ((imgtype) &amp; ((1 &lt;&lt; 3) - 1)) == 0 &amp;&amp; (imgcn == 1 || imgcn == 3 || imgcn == 4) in function cv::xfeatures2d::SURF_Impl::detectAndCompute</p>
  </blockquote>
  
  <p>Please tell me how can i fix this
   ?</p>