title: Using OpenCV Java Bindings to read an image
body: <p>I'm using the new <a href="http://opencv.org/opencv-java-api.html" rel="noreferrer">OpenCV Java bindings</a> to read an image and do some processing on the image. I'm trying to convert C code to Java using the Java bindings but can't seem to find the relevant methods:</p>
  
  <p>C code:</p>
  
  <pre><code>cv::Mat img = cv::imread(argv[1]);
  cv::Mat gray;
  cv::cvtColor(img, gray, CV_BGR2GRAY);
  int erosion_size = 5;
  cv::Mat element = cv::getStructuringElement(cv::MORPH_CROSS,
                                         cv::Size(2 * erosion_size + 1, 2 * erosion_size + 1),
                                         cv::Point(erosion_size, erosion_size) );
  cv::erode(gray, gray, element);
  </code></pre>
  
  <p>I can't find:</p>
  
  <ul>
  <li><code>imread</code></li>
  <li><code>cvtcolor</code></li>
  <li><code>getStructuringElement</code></li>
  <li><code>erode</code></li>
  </ul>
  
  <p>I looked around the api here: <a href="http://docs.opencv.org/java/" rel="noreferrer">http://docs.opencv.org/java/</a></p>
  
  <p>Unfortunately the <a href="https://github.com/Itseez/opencv/blob/master/samples/java/ant/src/SimpleSample.java" rel="noreferrer">sample java code provided</a> doesn't even show how to read an image!</p>