You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a minimal app working well on my local but crashes on shiny server pro when I click 'Scan Barcode' button (see attached error log). I think the app can't find camera on browser. Is it possible to have a pop-window on browser requesting access to your camera?
library(shiny)
library(opencv)
UI
ui <- fluidPage(
titlePanel("Read QR code in real-time"),
fluidRow(
actionButton("barcode", "Scan Barcode"),
textOutput("results")
)
)
I have seen many applications using BisonCam, https://cozmo.github.io/jsQR/. And I think it would be a good addition to the opencv::qr_scanner() function.
Sadly it is not so easy. The qr_scanner will open a camera on the R session, which is on the server side.
But it seems like you can accomplish what you need with BisonCam without the need for R? Or you can use a library to take a picture in the browser and upload that to R and use opencv:: ocv_qr_detect to read and scan the image.
I have a minimal app working well on my local but crashes on shiny server pro when I click 'Scan Barcode' button (see attached error log). I think the app can't find camera on browser. Is it possible to have a pop-window on browser requesting access to your camera?
library(shiny)
library(opencv)
UI
ui <- fluidPage(
titlePanel("Read QR code in real-time"),
fluidRow(
actionButton("barcode", "Scan Barcode"),
textOutput("results")
)
)
server logic
server <- function(input, output) {
observeEvent( input$barcode , {
identity <- opencv::qr_scanner(draw = FALSE, decoder = "wechat")
output$results <- renderText({
identity
})
})
}
Run the application
shinyApp(ui = ui, server = server)
Error log:
Thanks
The text was updated successfully, but these errors were encountered: