OpenCV中文网站

 找回密码
 立即注册
搜索
热搜: 安装 配置
查看: 3170|回复: 1

opencv for android 遇到一个问题,望各位大神指点一下

[复制链接]
发表于 2016-5-2 23:20:04 | 显示全部楼层 |阅读模式
我想改变一下摄像头输入图像的分辨率,于是调用了一下opencv中resize函数,代码如下:
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {

          Imgproc.resize(inputFrame.rgba(),next,new Size(640,360));
          return next;

    }


结果报错了,真机调试时候是黑屏的

05-02 23:07:58.423 30806-30891/? E/cv::error(): OpenCV Error: Assertion failed (src.dims == 2 && info.height == (uint32_t)src.rows && info.width == (uint32_t)src.cols) in void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean), file /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/java/generator/src/cpp/utils.cpp, line 97
05-02 23:07:58.423 30806-30891/? E/org.opencv.android.Utils: nMatToBitmap catched cv::Exception: /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/java/generator/src/cpp/utils.cpp:97: error: (-215) src.dims == 2 && info.height == (uint32_t)src.rows && info.width == (uint32_t)src.cols in function void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean)
05-02 23:07:58.423 30806-30891/? E/CameraBridge: Mat type: Mat [ 360*640*CV_8UC4, isCont=true, isSubmat=false, nativeObj=0x5b3bbd20, dataAddr=0x614a3010 ]
05-02 23:07:58.423 30806-30891/? E/CameraBridge: Bitmap type: 1280*720
05-02 23:07:58.424 30806-30891/? E/CameraBridge: Utils.matToBitmap() throws an exception: /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/


这是日志。。。请问哪里出现了问题呢。。?希望大神指点一二
回复

使用道具 举报

发表于 2016-6-19 17:12:06 | 显示全部楼层
Mat [ 360*640*CV_8UC4, isCont=true, isSubmat=false, nativeObj=0x5b3bbd20, dataAddr=0x614a3010 ]
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|OpenCV中文网站

GMT+8, 2024-4-19 12:47 , Processed in 0.008352 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表