Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magick to opencv #36

Open
jwijffels opened this issue Nov 17, 2021 · 3 comments
Open

magick to opencv #36

jwijffels opened this issue Nov 17, 2021 · 3 comments

Comments

@jwijffels
Copy link
Contributor

I'm using this package a lot to parse out data from Transkribus and get the text lines in order to build some handwritten text recognition models.
For the data preparation there, I regularly switch between tools part of magick and tools part of opencv, normally I do this now as follows, it would be nice to have something more native in opencv.

magick_to_opencv <- function(img){
  p <- tempfile()
  on.exit({
    if(file.exists(p)){
      file.remove(p) 
    }
  })
  magick::image_write(img, path = p)
  image <- opencv::ocv_read(p)
  image
}
@jeroen
Copy link
Member

jeroen commented Nov 17, 2021

Go for it, you have write access :P Maybe keep the magick dependency a Suggets though, we don't want to make things too heavy to install.

@jwijffels
Copy link
Contributor Author

Yes, I know, just putting this here as a reminder to myself.

@JanMarvin
Copy link

Just stumbled over this issue, I have a conversion function here: JanMarvin@269433e. The config part was not straight forward, but maybe its useful for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants