admin 管理员组文章数量: 1184232
Camera view sample
In this section we'll extend our empty OpenCV app created in the previous section to support camera. We'll take camera frames and display them on the screen.
-
Tell a system that we need camera permissions. Add the following code to the file
MyApplication/app/src/main/AndroidManifest.xml:
Like this:<uses-permission android:name="android.permission.CAMERA"/> <uses-feature android:name="android.hardware.camera" android:required="false"/> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> <uses-feature android:name="android.hardware.camera.front" android:required="false"/> <uses-feature android:name="android.hardware.camera.front.autofocus" android:required="false"/>
-
Go to
activity_main.xmllayout and delete TextView with text "Hello World!"
This can also be done in Code or Split mode by removing the
TextView
block from XML file.
Add camera view to the layout:
- Add a scheme into layout description:
xmlns:opencv=""
版权声明:本文标题:揭秘 OpenCV 的神秘力量——在 Android 上实现摄像头和 IP 摄像头访问 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1772103792a3552171.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论