R/xmldata.R

Defines functions find_data_xml find_data_dir

find_data_dir <- function(){
  datapath <- c("/share/opencv", "/share/opencv4", "/share/OpenCV")
  paths <- c(
    system.file('share/opencv4', package = 'opencv'),
    system.file('share', package = 'opencv'),
    paste0(data_prefix(), datapath)
  )
  for(x in paths){
    if(file.exists(x))
      return(x)
  }
  stop("Failed to find opencv 'share' directory")
}

find_data_xml <- function(filename){
  normalizePath(file.path(find_data_dir(), filename), mustWork = TRUE)
}

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.