Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to get Hue chnanel using open cv in android

i am working on open cv in android, i have detect eye but hue channel is not changed.

Mat eyeball_HSV = new Mat(); Mat dest = new Mat();
Mat eye = new Mat();

eye = mRgba.submat(eye_template).clone();

List<mat> hsv_channel = new ArrayList<mat>(); //convert image to HSV // Imgproc.cvtColor(eye, eyeball_RGB, Imgproc.COLOR_RGBA2RGB, 3); Imgproc.cvtColor(eye, eyeball_HSV, Imgproc.COLOR_RGB2HSV, 0); //Core.inRange(eyeball_HSV, new Scalar(90, 50, 50), new Scalar(130, 255, 255), dest); // get HSV channel //hsv_channel[0] is hue //hsv_channel[1] is saturation //hsv_channel[2] is visibility Core.split(eyeball_HSV, hsv_channel);

  try
  {
    hsv_channel.get(0).setTo(new Scalar(145));

    Log.v(TAG, "Got the Channel!");
  }
  catch(Exception ex)
  {
   ex.printStackTrace();
   Log.v(TAG, "Didn't get any channel");
  }

  Imgproc.cvtColor(eyeball_HSV, dest, Imgproc.COLOR_HSV2RGB);
  Imgproc.cvtColor(dest, eye, Imgproc.COLOR_RGB2RGBA);

how to get Hue chnanel using open cv in android

i am working on open cv in android, i have detect eye but hue channel is not changed.

Mat eyeball_HSV = new Mat();
Mat dest = new Mat(); 
Mat eye = new Mat();

Mat(); eye = mRgba.submat(eye_template).clone();

List<mat> mRgba.submat(eye_template).clone(); List<Mat> hsv_channel = new ArrayList<mat>(); ArrayList<Mat>(); //convert image to HSV // Imgproc.cvtColor(eye, eyeball_RGB, Imgproc.COLOR_RGBA2RGB, 3); Imgproc.cvtColor(eye, eyeball_HSV, Imgproc.COLOR_RGB2HSV, 0); //Core.inRange(eyeball_HSV, new Scalar(90, 50, 50), new Scalar(130, 255, 255), dest); // get HSV channel //hsv_channel[0] is hue //hsv_channel[1] is saturation //hsv_channel[2] is visibility Core.split(eyeball_HSV, hsv_channel);

hsv_channel);
 try
{
hsv_channel.get(0).setTo(new Scalar(145));
Log.v(TAG, "Got the Channel!");
}
catch(Exception ex)
{
ex.printStackTrace();
Log.v(TAG, "Didn't get any channel");
}
Imgproc.cvtColor(eyeball_HSV, dest, Imgproc.COLOR_HSV2RGB);
Imgproc.cvtColor(dest, eye, Imgproc.COLOR_RGB2RGBA);