OpenCV for androidのインストールが終わったので、実際にアプリケーションを書いてみよう。 OpenCVといえば、まずすることは2値化ということでImageViewに表示する前に画像をOpenCVで2値化するコードを書いてみた。 MainActivity.java private void doBinarize() { Bitmap bm = ((BitmapDrawable)this.cropCanvas.getDrawable()).getBitmap(); Mat src = new Mat(); Utils.bitmapToMat(bm, src); Mat bined = OpenCVUtil.binarize(src, 0); Imgproc.cvtColor(bined, bined, Imgproc.COLOR_GRAY2RGBA, 4); Bitmap ds
![OpenCV for Android 2.4.3 (その2) - Kazzz's diary](https://cdn-ak-scissors.b.st-hatena.com/image/square/ccddc918047f3b29d911e74c56d9492d78a38ff9/height=288;version=1;width=512/http%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2FK%2FKazzz%2F20121129%2F20121129210430.png)