opencv_android开发库

时间:2017-10-02 07:36:39
【文件属性】:

文件名称:opencv_android开发库

文件大小:12.01MB

文件格式:RAR

更新时间:2017-10-02 07:36:39

opencv android 库文件

新建android项目 在AndroidManifest.xml中增加写sd卡的权限: 解压压缩包opencv231_Android.rar 拷贝openvc-2.3.1.jar和两个文件夹armeabi和armeabi-v7a到android项目的libs目录下 在oncreate中添加如下代码 private ImageView imageView = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); imageView = (ImageView)findViewById(R.id.imageView1);//主界面上的ImageView资源 Bitmap bm1 = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher); double scale = 0.1; imageView.setImageBitmap(bm1); Mat img = Highgui.imread("/sdcard/test.png", 0); org.opencv.core.Size dSize = new org.opencv.core.Size(img.width()*scale,img.height()*scale); Mat img2 = new Mat(dSize,CvType.CV_8SC1); Mat img3 = new Mat(); img.convertTo(img2, CvType.CV_8SC1); Imgproc.Canny(img, img3, 123, 250); boolean flag=Highgui.imwrite("/sdcard/new.jpg", img3); if(flag) { File f = new File("/sdcard/new.jpg"); if(f.exists()) { Bitmap bm=BitmapFactory.decodeFile("/sdcard/new.jpg"); imageView.setImageBitmap(bm); } }//end if else{ Toast.makeText(this, "写入失败!!", 3).show(); } }


【文件预览】:
armeabi-v7a
----libnative_camera_r2.2.2.so(119KB)
----libopencv_ml.a(716KB)
----libopencv_contrib.a(513KB)
----libnative_camera_r2.3.3.so(120KB)
----libopencv_core.a(2.27MB)
----libopencv_androidcamera.a(27KB)
----libopencv_flann.a(765KB)
----libopencv_imgproc.a(1.99MB)
----libopencv_java.so(5.17MB)
----libopencv_ts.a(777KB)
----libopencv_highgui.a(422KB)
----libopencv_calib3d.a(645KB)
----libopencv_features2d.a(1.26MB)
----libopencv_legacy.a(1.18MB)
----libopencv_video.a(256KB)
----libopencv_objdetect.a(428KB)
opencv-2.3.1.jar
armeabi
----libnative_camera_r2.2.2.so(105KB)
----libopencv_ml.a(765KB)
----libopencv_contrib.a(552KB)
----libnative_camera_r2.3.3.so(107KB)
----libopencv_core.a(2.48MB)
----libopencv_androidcamera.a(27KB)
----libopencv_flann.a(787KB)
----libopencv_imgproc.a(2.25MB)
----libopencv_java.so(5.44MB)
----libopencv_ts.a(812KB)
----libopencv_highgui.a(427KB)
----libopencv_calib3d.a(718KB)
----libopencv_features2d.a(1.33MB)
----libopencv_legacy.a(1.34MB)
----libopencv_video.a(296KB)
----libopencv_objdetect.a(450KB)

网友评论