-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
怎样使用摄像头拍照功能 #18
Comments
@790396054 抓取一帧,将Mat转成Bitmap可否满足你的需求? |
1.如何抓取一帧? |
mCamera.takePicture(null, null, new Camera.PictureCallback() { 我用 takePicture 方法,抓取照片后,摄像头不预览了,调用 mCamera.startPreview(); 还是不能预览 |
@Override
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
// 子线程(非UI线程)
mRgba = inputFrame.rgba();
// TODO 抓取 mRgba 转 Bitmap
return mRgba;
} Mat 转 Bitmap Bitmap bitmap = Bitmap.createBitmap(mat.width(), mat.height(), Bitmap.Config.ARGB_8888);
Utils.matToBitmap(mat, bitmap); |
解决了,十分感谢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
就是如何用它进行拍照操作。
The text was updated successfully, but these errors were encountered: