Install OpenCV: ~10 min!


Disclaimers

  1. Tested on: Windows 7, Windows 10
  2. There could be other ways to get Open CV working on your Windows computer

Before installation

  1. Find you OS architecture
  2. Decide the Python version (e.g. 2.7 or 3.x)
  3. Install Anaconda, open terminal as administrator and , Continue reading “Install OpenCV: ~10 min!”

Python: PIL (Pillow) & Numpy intersect images


Input images used :

1.png C.png

Continue reading “Python: PIL (Pillow) & Numpy intersect images”

Python: PIL ( Pillow ) & NumPy add images


Pillow (PIL) and NumPy libraries can do wonders in Python! I had once he requirement to overlap two images – not watermarking.

I found several alternatives, but curious to see which would work best.

  1. (x+y)/2 … Mathematically, x/2+y/2 seems equivalent to above, but it is not. We’d be loosing a ton of info by doing so!
  2. Numpy.minimum((x+y),256)
  3. final = (x+y/2) and then addition = addition[addition>256]=256
  4. Pillow’s Image.blend(x,y,0.5)
  5. Pillow’s Image.composite(x,y,y)

Continue reading “Python: PIL ( Pillow ) & NumPy add images”