Recently,by accident more than anything else, I stumbled upon a brilliant python module for Image Processing. SimpleCV . As with all python modules, the ease of usage is unparalleled, even by the Matlab IP Toolkit.The Speed on the other hand is not as good as that of OpenCV but it is much faster than Matlab. For a more detailed comparison between the 3, you could read the blog article by one of the developers of SimpleCV, where he compares OpenCV,Matlab and SimpleCV on various parameters. As far as I could find out, SimpleCV uses the OpenCV library but has made it much more user friendly , now that it is in Python.
To install SimpleCV, type in the following commands in your shell
sudo apt-get install libopencv-*
sudo apt-get isntall python-opencv
sudo apt-get install python-numpy
sudo apt-get install python-pygame
sudo apt-get install python-setuptools
Go ahead and downlaod and extract the latest version of SimpleCV from Github .Change Directory (cd) into the extracted folder and run the setup.py script
sudo python setup.py install
My first SimpleCV program. It basically loads the image, finds the skin tone mask and thersholds the image to produce a B/W image with the mask values as TRUE. That is followed by erode and dilate to remove unwanted blobs. The final step is to show the output image.
from SimpleCV import * # Use this instead of import SimpleCV. #import SimpleCV doesn't work properly . #This though imports all functionalities of #the module. img = Image("040001.jpg") # Loads the image. img = img.getSkintoneMask(0) # Gets the Skin Tone Mask and does the Threshold. # PostProcessing,Noise Removal img = img.erode(6) # Removes the stray bolbs img = img.dilate(3) # Increases the size of face blob img.show('window') # Final Image Output
Below are a few input and output images.The great thing is unlikeOpenCV and Matlab, since mask extraction is automated here,you don’t need to worry too much about the threshold values, or converting to HSV etc etc.And hence the results are better.