簡體   English   中英

適用於 Android 5.0 以上的 OpenCV 原生相機庫?

[英]OpenCV Native Camera Library for Android 5.0 onwards?

當我注意到 OpenCV 庫獲取 Android 設備視頻輸入的方式存在一些差異時,我正在使用 OpenCV 構建一個 android 應用程序。 我使用的是 Nexus 5 第二代。

下面,我有一個來自 OpenCV 應用程序的屏幕截圖,顯示了一個正方形:

OpenCV 截圖

正如你所看到的,正方形似乎被拉伸了,現在是一個矩形。 為了進行比較,以下是來自相機應用程序的屏幕截圖:

相機應用截圖

但是,從本機相機應用程序截取的屏幕截圖中,正方形確實是正方形。 然后我改變了我的代碼:

<org.opencv.android.JavaCameraView 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/color_blob_detection_activity_surface_view" />

<org.opencv.android.NativeCameraView 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/color_blob_detection_activity_surface_view" />

這在運行 Android 4.0-4.4 的設備上運行良好,但是,當我在運行 Lollipop (5.0) 的 Nexus 5 上運行它時,它給了我"It seems that your device does not support camera (or it is locked)." 錯誤。 我的 Android 清單中有相機權限。 然后我檢查了libs文件夾中的文件,然后我注意到我有libnative_camera_r2.2.0.so直到libnative_camera_r4.4.0.so,我推斷rx.xxso指的是版本號,以及為什么沒有工作是因為沒有適用於 Android 5.0 的本機相機庫。

我現在的問題是:

libnative_camera_r5.0.0.so 什么時候發布? 我只是不能使用較低版本,因為我也在使用 Android Lollipop 獨有的一些功能。

版本 3.0 的 OpenCV 更改日志將本機相機列為已刪除

“另一個有點悲傷但不可避免的消息——我們不得不在 Android 上放棄對 nativecamera 的支持。它使用了一些未記錄的 API,並且從來沒有穩定過。”

來自: https : //github.com/Itseez/opencv/wiki/ChangeLog (2015 年 6 月發布)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM