title: opencv problems on Android
body: <p>Please we need help urgently, we are using openCv in Android (Java).
  We are facing a lot of problems:</p>
  
  <p>convertTo() doesn't work so we can't convert 3 channel image to 1 channel without passing it on cvtColor().</p>
  
  <pre><code>grayImg.convertTo(grayImg, CvType.CV_8UC1);
  </code></pre>
  
  <p>cvtColor() gives a weird output:    </p>
  
  <pre><code>Imgproc.cvtColor(src, grayImg, Imgproc.COLOR_RGB2GRAY);
  </code></pre>
  
  <p>Output of this line is the image repeated 4 times! 
  The only way to get rid of this repetition is to add this line and the output is a white and black image but 3 channel so it crashes any coming function because it needs 1 channel image.</p>
  
  <pre><code>Imgproc.cvtColor(grayImg, grayImg, Imgproc.COLOR_GRAY2RGB,3);
  </code></pre>
  
  <p>canny() for edge detection:</p>
  
  <pre><code>Imgproc.Canny(grayImg, grayImg, 10, 100,3,true);
  </code></pre>
  
  <p>findContours() counts a horrible number of contours while number of objects in the image is only 2 input image is 3 channel bmp image and we convert it to Mat.</p>
  
  <p>output image:</p>
  
  <p><a href="https://dl.dropbox.com/u/36214963/canny.jpg" rel="nofollow">https://dl.dropbox.com/u/36214963/canny.jpg</a></p>
  
  <p>Thanks for your concern </p>