我已將 OpenCV 匯入 Android Studio 并為用戶創建了一個 EditText 選項以輸入其相機的流媒體 URL。
我想在 OpenCV 中使用 VideoCapture 從相機獲取視頻源,但首先我想檢查輸入的流 URL 是否有效并提供適當的輸出。類似的東西:
if (VideoCapture(input) == true)
{
// toast camera detected
}
else
{
// toast camera not detected
}
我不確定執行此操作的確切語法,非常感謝您的幫助。
uj5u.com熱心網友回復:
使用URLUtil驗證URL如下。
URLUtil.isValidUrl(url)
True如果 URL 有效并且falseURL 無效,它將回傳。
if (URLUtil.isValidUrl(url))
{
// toast camera detected
}
else
{
// toast camera not detected
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/345436.html
上一篇:OpenCVexpm()函式
