简体   繁体   English

在OpenCV android中隐藏相机预览

[英]Hide camera preview in OpenCV android

I am building this application where I need to get video with the camera and process it with openCV as well as show a view with 3D graphics being renderered in it.I am using two fragments. 我正在构建此应用程序,我需要用相机获取视频并使用openCV处理它,并显示其中渲染了3D图形的视图。我正在使用两个片段。 One for previewing the camera. 一种用于预览相机。 And one for the 3D graphics.The problem is the 3d graphics view has to be fullscreen. 还有一种用于3D图形。问题在于3d图形视图必须全屏显示。 I don't want the camera preview at all. 我根本不需要相机预览。 I can show them side by side using linear layout. 我可以使用线性布局并排显示它们。 But I cannot totally hide the preview and make the 3d scene take up the whole screen. 但是我无法完全隐藏预览并使3d场景占据整个屏幕。 Even using relative layout causes the camera preview to tear through the 3d graphics view. 即使使用相对布局,也会使相机预览撕破3d图形视图。

Simply put it, if the camera preview is not being shown, the CvCameraViewListener2.onCameraFrame() method is not called. 简而言之,如果未显示摄像机预览,则不会调用CvCameraViewListener2.onCameraFrame()方法。 And without that I don't receive any new frames to process. 除此之外,我不会收到任何要处理的新帧。

The problem got solved. 问题解决了。 I really don't know how it got solved though. 我真的不知道如何解决。 I woke up the next day and tried running the project and it ran perfectly without requiring to change anything. 第二天我醒来,尝试运行该项目,该项目运行完美,无需进行任何更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM