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

I'd like to work on it. #10

Open
jwijffels opened this issue Apr 5, 2019 · 4 comments
Open

I'd like to work on it. #10

jwijffels opened this issue Apr 5, 2019 · 4 comments

Comments

@jwijffels
Copy link
Contributor

jwijffels commented Apr 5, 2019

Many thanks for providing the package on CRAN and especially allowing easy compilation on Windows through rtools and providing static opencv libraries at https://github.com/rwinlib/opencv

I would like to aid in developing this package but maybe before doing this it would be nice to have some ideas on the direction.
Things that should probably be discussed is

  1. how this package will position itself compared to magick (maybe it would be interesting to focus first on things which are not in magick (e.g. real-time behaviour, 2D features, image stitching, object detection, background substraction, segmentations not available in magick like grabcut, object tracking)
  2. how this package will position itself to https://github.com/swarm-lab/Rvision and this one https://github.com/swarm-lab/trackR
  3. how to approach the opencv extra modules (as add-on packages as they might have different licenses?)
  4. how to allow other C/C++ toolkits in the wild use the opencv (just an example this http://bnosac.be/index.php/blog/89-human-face-detection-with-r assumes basically a opencv image Mat or darknet also has some opencv code which is than passed on to darknet)
  5. It would be great to have R integrated and used with ros with rosR alongside this R package (e.g. http://www.bnosac.be/index.php/blog/21-using-r-in-robotics-applications-with-ros) or with some deep learning models which were fit with keras or other software
  6. how to position compared to the list of vision software at https://neuroconductor.org/list-packages/all

If you have any ideas on this, shoot...

@jeroen
Copy link
Member

jeroen commented Apr 5, 2019

how this package will position itself compared to magick (maybe it would be interesting to focus first on things which are not in magick (e.g. real-time behaviour, 2D features, image stitching, object detection, background substraction, segmentations not available in magick like grabcut, object tracking)

I agree. It is not a bad thing if there is overlap in functionality. Imagemagick is more extensive and has user-friendly tools, whereas opencv seems faster but a bit more low-level.

how this package will position itself to https://github.com/swarm-lab/Rvision and this one https://github.com/swarm-lab/trackR

This is mostly up to @sjmgarnier. I would love to collaborate with their team and ideally the projects would be merged. Rvision is very cool but the installation via opencvlite makes it impossible to release to CRAN. Also the use of Rcpp modules in Rvision unfortunate, and it seems the Rvision developers have little time these days to further develop the package.

For rOpenSci it is important that packages work out of the box on all operating systems and I have done this for many other libraries. I would be very interested to work with @sjmgarnier to adopt functionality from Rvision, and make it available on CRAN. Perhaps the swarm-lab packages could build on opencv as the bridge between R and the C++ library, and then provide more high level tools.

how to approach the opencv extra modules (as add-on packages as they might have different licenses?)

I think the standard "contrib" modules we can easily include. For 3rd party tools, I'm not sure. Perhaps we can expose a small C++ api in the package to make it easy for other R packages to get to the underlying data.

...

I'm not sure yet. We'll see :-)

@sjmgarnier
Copy link

how this package will position itself compared to magick (maybe it would be interesting to focus first on things which are not in magick (e.g. real-time behaviour, 2D features, image stitching, object detection, background substraction, segmentations not available in magick like grabcut, object tracking)

I think the main difference is that opencv was built with video processing in mind, so it is optimized for speed.

how this package will position itself to https://github.com/swarm-lab/Rvision and this one https://github.com/swarm-lab/trackR

trackR is just a tracking software based on Rvision. It is not a CV library. It's mostly targeted at the behavioral science community.

This is mostly up to @sjmgarnier. I would love to collaborate with their team and ideally the projects would be merged.

Anytime! Rvision/ROpenCVLite are literally my first foray into the c++ world, so I don't know what I'm doing most of the time, I just know what I need it to do in the end. When I started ROpenCVLite/Rvision, there was no R package available that was really capable of processing videos and I needed that, so I built it. Happy to chat anytime, see how we can move this forward.

Rvision is very cool but the installation via opencvlite makes it impossible to release to CRAN.

Not sure why you say that exactly. The goal is to eventually move ROpenCVLite to CRAN at some point (it compiles on all major platforms). The reason I think installing OpenCV via ROpenCVLite is a better approach than relying on people installing OpenCV themselves is that it gives developers a guaranteed standardized installation across platforms.

Also the use of Rcpp modules in Rvision unfortunate

As I said earlier, I don't know what I'm doing most of the time. What's the issue with this approach? It seemed to me that it was the recommended approach when I started delving into Rcpp.

and it seems the Rvision developers have little time these days to further develop the package.

I add new functions when I need them and I have been focusing lately on building software based on Rvision (e.g. trackR). ROpenCVLite/Rvision is mostly a one man operation (with significant contributions from @muschellij2) and I'd be more than happy to collaborate and share the workload.

@dselivanov
Copy link

I think bringing full functionality of the opencv will be very beneficial for the community.

My experience with magick is ambiguous - doing simple things (resize, crop, etc) with small images / small number of images is really smooth.

But it doesn't seem suited for the processing large amount of files:

  1. it seems libmagick is very actively using /tmp. So at some point of time process getting very slow (paired with low cpu usage). It took me quite some time to figure out that the problem is disk - frequent reads and writes and what is more important disk is running out of space very fast. For example processing 10gb of photos can easily occupy 50gb of /tmp
  2. Speed is far from opencv and Pillow

As for ROpenCVLite - it is on CRAN now. I personally had 0 issues with installation. However I agree that if library is available from package managers it may be better to install it from there.

@jwijffels
Copy link
Contributor Author

Completely agree on

I think bringing full functionality of the opencv will be very beneficial for the community.

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

4 participants