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

OpenCV dependency removal #3

Closed
PavlosMelissinos opened this issue Apr 8, 2017 · 5 comments
Closed

OpenCV dependency removal #3

PavlosMelissinos opened this issue Apr 8, 2017 · 5 comments

Comments

@PavlosMelissinos
Copy link
Owner

PavlosMelissinos commented Apr 8, 2017

I'm interested in throwing away every import cv2 line because OpenCV has mostly been a pain for no reason. The attempt can be seen in the no_opencv branch

The strongest contenders are pillow and scikit-image.

I will be documenting my experiences here mostly as notes to myself and possibly to fuel a discussion.

Library Wraps NumPy channel order dimension order
OpenCV yes bgr (width, height)
Pillow no rgb (width, height)
skimage yes rgb (height, width)

Any suggestions are welcome!

@PavlosMelissinos PavlosMelissinos mentioned this issue Apr 8, 2017
Closed
@PavlosMelissinos
Copy link
Owner Author

I'm going with pillow after all, as the conversion of a PIL.Image to numpy is trivial and pretty much contains every necessary operation. Next few commits will gradually simplify preprocessing (currently a flag determines which library will be used and that unnecessarily increases code complexity).

@PavlosMelissinos
Copy link
Owner Author

CLAHE is one of the things that does not seem to be supported by pillow. This is not a deal breaker but is anyone aware of an alternative implementation? I know there's equalize in ImageOps but I don't think it uses CLAHE (which works great by the way, I will upload a notebook with a demonstration)

@PavlosMelissinos
Copy link
Owner Author

Here is the notebook, unfortunately I couldn't get ipywidgets to show the outputs at all in the static version.

@mrgloom
Copy link

mrgloom commented Jun 30, 2018

Can you explain why opencv was dropped?

@PavlosMelissinos
Copy link
Owner Author

Hey, sorry for taking this long but I haven't been around in general this past year.

It's a personal choice. I prefer lightweight, simple options that stay away from obscurity and opencv is neither. It follows a different approach than most libraries (e.g. bgr vs rgb), sometimes for no good reason, and this project didn't need any of the advanced features of opencv, therefore I decided against using it. Of course as this is an open source project, anyone is free to modify the code and add it. :)

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

2 participants