最近开始接触opencv for Android,从网上down了图像的边沿检测的代码。
测试图片:
http://dl.iteye.com/upload/picture/pic/105498/dd5b230c-ceac-3d38-9ad2-8e4215b82a22.jpg
在Android2.3.1模拟器上跑了,如下:
代码如下:
package cn.netjava.opencv;
import java.io.File;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.highgui.Highgui;
import org.opencv.imgproc.Imgproc;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.net.Uri;
import android.o