title: android opencv rgb to hsv
body: <p>How to convert rgb to hsv and make the hsv display on the screen in opencv for android?</p>
  
  <pre><code>using namespace std;
  using namespace cv;
  
  extern "C" {
  JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial3_Sample3View_FindFeatures(JNIEnv* env, jobject thiz, jint width, jint height, jbyteArray yuv, jintArray bgra)
  {
      jbyte* _yuv  = env-&gt;GetByteArrayElements(yuv, 0);
      jint*  _bgra = env-&gt;GetIntArrayElements(bgra, 0);
  
      Mat myuv(height + height/2, width, CV_8UC1, (unsigned char *)_yuv);
      Mat mbgra(height, width, CV_8UC4, (unsigned char *)_bgra);
      Mat mgray(height, width, CV_8UC1, (unsigned char *)_yuv);
  
  
      //Please make attention about BGRA byte order
      //ARGB stored in java as int array becomes BGRA at native level
      cvtColor(myuv, mbgra, CV_YUV420sp2BGR, 4);
  
  
  
  
  
      env-&gt;ReleaseIntArrayElements(bgra, _bgra, 0);
      env-&gt;ReleaseByteArrayElements(yuv, _yuv, 0);
  }
  
  }
  </code></pre>
  
  <p>The above code gets input from the camera which is yuv and converts to rgb. I know I need to use cvtColor function to convert from rgb to hsv but what parameters the Mat for hsv should have? And how to make it display rather than rgb</p>