tests/testthat/test-qr_code.R

test_that("qr scanner works", {
  skip_if(identical(Sys.info()[["sysname"]], 'Linux') && ocv_version() < "4.5.2")
  img <- ocv_read('qrtest.jpg')
  expect_s3_class(img, "opencv-image")
  txt <- ocv_qr_detect(img)
  outimg <- ocv_qr_detect(img, draw = TRUE)
  expect_s3_class(outimg, "opencv-image")
  expect_equal(txt, "https://www.r-project.org")
})

Try the opencv package in your browser

Any scripts or data that you put into this service are public.

opencv documentation built on Nov. 2, 2023, 5:52 p.m.