Aug 07

Python and Image Processing: Packages like OpenCV

Python and Image Processing: Packages like OpenCV

PIL: comes with the distribution Anaconda. It contains basic image processing capabilities, and convenient to use.

ndimage.scipy: is a module that contains many functions for processing Photos.

misc.scipy: module contains functions for reading and writing Photos

OpenCV: image processing package is very common and accepted

http://www.discoversdk.com/blog/python-image-processing-with-opencv


Installing OpenCV

Options: you can use HomeBrew, PIP, or PIP3. Or Download source and Build.

Building the source though not the easiest but you might be required to do it under certain circumstances (for some library support)

Python 2: pip install opencv or pip install opencv-python

Python 3: pip3 install opencv or pip3 install opencv-python

you might need to install the following packages such as cv2, numpy,  matplotlib

pip3 install numpy

pip3 installmatplotlib

 

An Example


import cv2
import numpy as np
import matplotlib.pyplot as plt
import cv2

img = cv2.imread('C:\Users\USER\Desktop\image.jpg',0)
cv2.imshow('image', img)  
cv2.waitKey(0) 
cv2.destroyAllWindows()

reference: http://www.discoversdk.com/blog/python-image-processing-with-opencv

The instructions on the linkes below will be of good help

http://www.discoversdk.com/blog/python-image-processing-with-opencv

Install OpenCV 3 on MacOS

 


 

Some Other Image Processing Libraries

Octave's image And for Scilab there is SIP and SIVP

Both Octave and Scilab are very Matlab like, but I'm not sure how similar the image toolkits are.

Also look into OpenCV if you are comfortable with C/C++ or Python

Reference: https://stackoverflow.com/questions/3319355/alternatives-to-matlabs-image-processing-toolkit

 

ImageJ (also read: http://en.wikipedia.org/wiki/ImageJ)

 

use AForget.net if you use C#. AForge.net is supported Image Processing and AI

 

OpenCV Source on GitHUB:

https://github.com/opencv/opencv?src=www.discoversdk.com

 

--

Install OpenCV using Homebrew

Install OpenCV 3 on macOS with Homebrew (the easy way)


 

How to build:

 

HOWTO: Install, Build and Use openCV (MacOSX 10.10)

 

 

 

 

 

Skip to toolbar